Automatic date update in version.in
[deliverable/binutils-gdb.git] / gnulib / configure
CommitLineData
c971b7fa
PA
1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.
d0ac1c44
SM
3# Generated by GNU Autoconf 2.69 for libgnu UNUSED-VERSION.
4#
5#
6# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
c971b7fa 7#
c971b7fa
PA
8#
9# This configure script is free software; the Free Software Foundation
10# gives unlimited permission to copy, distribute and modify it.
11## -------------------- ##
12## M4sh Initialization. ##
13## -------------------- ##
14
15# Be more Bourne compatible
16DUALCASE=1; export DUALCASE # for MKS sh
17if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
18 emulate sh
19 NULLCMD=:
20 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
21 # is contrary to our usage. Disable this feature.
22 alias -g '${1+"$@"}'='"$@"'
23 setopt NO_GLOB_SUBST
24else
25 case `(set -o) 2>/dev/null` in #(
26 *posix*) :
27 set -o posix ;; #(
28 *) :
29 ;;
30esac
31fi
32
33
34as_nl='
35'
36export as_nl
37# Printing a long string crashes Solaris 7 /usr/bin/printf.
38as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
39as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
40as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
41# Prefer a ksh shell builtin over an external printf program on Solaris,
42# but without wasting forks for bash or zsh.
43if test -z "$BASH_VERSION$ZSH_VERSION" \
44 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
45 as_echo='print -r --'
46 as_echo_n='print -rn --'
47elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
48 as_echo='printf %s\n'
49 as_echo_n='printf %s'
50else
51 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
52 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
53 as_echo_n='/usr/ucb/echo -n'
54 else
55 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
56 as_echo_n_body='eval
57 arg=$1;
58 case $arg in #(
59 *"$as_nl"*)
60 expr "X$arg" : "X\\(.*\\)$as_nl";
61 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
62 esac;
63 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
64 '
65 export as_echo_n_body
66 as_echo_n='sh -c $as_echo_n_body as_echo'
67 fi
68 export as_echo_body
69 as_echo='sh -c $as_echo_body as_echo'
70fi
71
72# The user is always right.
73if test "${PATH_SEPARATOR+set}" != set; then
74 PATH_SEPARATOR=:
75 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
76 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
77 PATH_SEPARATOR=';'
78 }
79fi
80
81
82# IFS
83# We need space, tab and new line, in precisely that order. Quoting is
84# there to prevent editors from complaining about space-tab.
85# (If _AS_PATH_WALK were called with IFS unset, it would disable word
86# splitting by setting IFS to empty value.)
87IFS=" "" $as_nl"
88
89# Find who we are. Look in the path if we contain no directory separator.
d0ac1c44 90as_myself=
c971b7fa
PA
91case $0 in #((
92 *[\\/]* ) as_myself=$0 ;;
93 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
94for as_dir in $PATH
95do
96 IFS=$as_save_IFS
97 test -z "$as_dir" && as_dir=.
98 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
99 done
100IFS=$as_save_IFS
101
102 ;;
103esac
104# We did not find ourselves, most probably we were run as `sh COMMAND'
105# in which case we are not to be found in the path.
106if test "x$as_myself" = x; then
107 as_myself=$0
108fi
109if test ! -f "$as_myself"; then
110 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
111 exit 1
112fi
113
114# Unset variables that we do not need and which cause bugs (e.g. in
115# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
116# suppresses any "Segmentation fault" message there. '((' could
117# trigger a bug in pdksh 5.2.14.
118for as_var in BASH_ENV ENV MAIL MAILPATH
119do eval test x\${$as_var+set} = xset \
120 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
121done
122PS1='$ '
123PS2='> '
124PS4='+ '
125
126# NLS nuisances.
127LC_ALL=C
128export LC_ALL
129LANGUAGE=C
130export LANGUAGE
131
132# CDPATH.
133(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
134
d0ac1c44
SM
135# Use a proper internal environment variable to ensure we don't fall
136 # into an infinite loop, continuously re-executing ourselves.
137 if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
138 _as_can_reexec=no; export _as_can_reexec;
139 # We cannot yet assume a decent shell, so we have to provide a
140# neutralization value for shells without unset; and this also
141# works around shells that cannot unset nonexistent variables.
142# Preserve -v and -x to the replacement shell.
143BASH_ENV=/dev/null
144ENV=/dev/null
145(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
146case $- in # ((((
147 *v*x* | *x*v* ) as_opts=-vx ;;
148 *v* ) as_opts=-v ;;
149 *x* ) as_opts=-x ;;
150 * ) as_opts= ;;
151esac
152exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
153# Admittedly, this is quite paranoid, since all the known shells bail
154# out after a failed `exec'.
155$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
156as_fn_exit 255
157 fi
158 # We don't want this to propagate to other subprocesses.
159 { _as_can_reexec=; unset _as_can_reexec;}
c971b7fa
PA
160if test "x$CONFIG_SHELL" = x; then
161 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
162 emulate sh
163 NULLCMD=:
164 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
165 # is contrary to our usage. Disable this feature.
166 alias -g '\${1+\"\$@\"}'='\"\$@\"'
167 setopt NO_GLOB_SUBST
168else
169 case \`(set -o) 2>/dev/null\` in #(
170 *posix*) :
171 set -o posix ;; #(
172 *) :
173 ;;
174esac
175fi
176"
177 as_required="as_fn_return () { (exit \$1); }
178as_fn_success () { as_fn_return 0; }
179as_fn_failure () { as_fn_return 1; }
180as_fn_ret_success () { return 0; }
181as_fn_ret_failure () { return 1; }
182
183exitcode=0
184as_fn_success || { exitcode=1; echo as_fn_success failed.; }
185as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
186as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
187as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
188if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
189
190else
191 exitcode=1; echo positional parameters were not saved.
192fi
d0ac1c44
SM
193test x\$exitcode = x0 || exit 1
194test -x / || exit 1"
c971b7fa
PA
195 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
196 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
197 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
198 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
199test \$(( 1 + 1 )) = 2 || exit 1"
200 if (eval "$as_required") 2>/dev/null; then :
201 as_have_required=yes
202else
203 as_have_required=no
204fi
205 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
206
207else
208 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
209as_found=false
210for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
211do
212 IFS=$as_save_IFS
213 test -z "$as_dir" && as_dir=.
214 as_found=:
215 case $as_dir in #(
216 /*)
217 for as_base in sh bash ksh sh5; do
218 # Try only shells that exist, to save several forks.
219 as_shell=$as_dir/$as_base
220 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
221 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
222 CONFIG_SHELL=$as_shell as_have_required=yes
223 if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
224 break 2
225fi
226fi
227 done;;
228 esac
229 as_found=false
230done
231$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
232 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
233 CONFIG_SHELL=$SHELL as_have_required=yes
234fi; }
235IFS=$as_save_IFS
236
237
238 if test "x$CONFIG_SHELL" != x; then :
d0ac1c44
SM
239 export CONFIG_SHELL
240 # We cannot yet assume a decent shell, so we have to provide a
241# neutralization value for shells without unset; and this also
242# works around shells that cannot unset nonexistent variables.
243# Preserve -v and -x to the replacement shell.
244BASH_ENV=/dev/null
245ENV=/dev/null
246(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
247case $- in # ((((
248 *v*x* | *x*v* ) as_opts=-vx ;;
249 *v* ) as_opts=-v ;;
250 *x* ) as_opts=-x ;;
251 * ) as_opts= ;;
252esac
253exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
254# Admittedly, this is quite paranoid, since all the known shells bail
255# out after a failed `exec'.
256$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
257exit 255
c971b7fa
PA
258fi
259
260 if test x$as_have_required = xno; then :
261 $as_echo "$0: This script requires a shell more modern than all"
262 $as_echo "$0: the shells that I found on your system."
263 if test x${ZSH_VERSION+set} = xset ; then
264 $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
265 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
266 else
267 $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
268$0: including any error possibly output before this
269$0: message. Then install a modern shell, or manually run
270$0: the script under such a shell if you do have one."
271 fi
272 exit 1
273fi
274fi
275fi
276SHELL=${CONFIG_SHELL-/bin/sh}
277export SHELL
278# Unset more variables known to interfere with behavior of common tools.
279CLICOLOR_FORCE= GREP_OPTIONS=
280unset CLICOLOR_FORCE GREP_OPTIONS
281
282## --------------------- ##
283## M4sh Shell Functions. ##
284## --------------------- ##
285# as_fn_unset VAR
286# ---------------
287# Portably unset VAR.
288as_fn_unset ()
289{
290 { eval $1=; unset $1;}
291}
292as_unset=as_fn_unset
293
294# as_fn_set_status STATUS
295# -----------------------
296# Set $? to STATUS, without forking.
297as_fn_set_status ()
298{
299 return $1
300} # as_fn_set_status
301
302# as_fn_exit STATUS
303# -----------------
304# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
305as_fn_exit ()
306{
307 set +e
308 as_fn_set_status $1
309 exit $1
310} # as_fn_exit
311
312# as_fn_mkdir_p
313# -------------
314# Create "$as_dir" as a directory, including parents if necessary.
315as_fn_mkdir_p ()
316{
317
318 case $as_dir in #(
319 -*) as_dir=./$as_dir;;
320 esac
321 test -d "$as_dir" || eval $as_mkdir_p || {
322 as_dirs=
323 while :; do
324 case $as_dir in #(
325 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
326 *) as_qdir=$as_dir;;
327 esac
328 as_dirs="'$as_qdir' $as_dirs"
329 as_dir=`$as_dirname -- "$as_dir" ||
330$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
331 X"$as_dir" : 'X\(//\)[^/]' \| \
332 X"$as_dir" : 'X\(//\)$' \| \
333 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
334$as_echo X"$as_dir" |
335 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
336 s//\1/
337 q
338 }
339 /^X\(\/\/\)[^/].*/{
340 s//\1/
341 q
342 }
343 /^X\(\/\/\)$/{
344 s//\1/
345 q
346 }
347 /^X\(\/\).*/{
348 s//\1/
349 q
350 }
351 s/.*/./; q'`
352 test -d "$as_dir" && break
353 done
354 test -z "$as_dirs" || eval "mkdir $as_dirs"
d0ac1c44 355 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
c971b7fa
PA
356
357
358} # as_fn_mkdir_p
d0ac1c44
SM
359
360# as_fn_executable_p FILE
361# -----------------------
362# Test if FILE is an executable regular file.
363as_fn_executable_p ()
364{
365 test -f "$1" && test -x "$1"
366} # as_fn_executable_p
c971b7fa
PA
367# as_fn_append VAR VALUE
368# ----------------------
369# Append the text in VALUE to the end of the definition contained in VAR. Take
370# advantage of any shell optimizations that allow amortized linear growth over
371# repeated appends, instead of the typical quadratic growth present in naive
372# implementations.
373if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
374 eval 'as_fn_append ()
375 {
376 eval $1+=\$2
377 }'
378else
379 as_fn_append ()
380 {
381 eval $1=\$$1\$2
382 }
383fi # as_fn_append
384
385# as_fn_arith ARG...
386# ------------------
387# Perform arithmetic evaluation on the ARGs, and store the result in the
388# global $as_val. Take advantage of shells that can avoid forks. The arguments
389# must be portable across $(()) and expr.
390if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
391 eval 'as_fn_arith ()
392 {
393 as_val=$(( $* ))
394 }'
395else
396 as_fn_arith ()
397 {
398 as_val=`expr "$@" || test $? -eq 1`
399 }
400fi # as_fn_arith
401
402
d0ac1c44
SM
403# as_fn_error STATUS ERROR [LINENO LOG_FD]
404# ----------------------------------------
c971b7fa
PA
405# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
406# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
d0ac1c44 407# script with STATUS, using 1 if that was 0.
c971b7fa
PA
408as_fn_error ()
409{
d0ac1c44
SM
410 as_status=$1; test $as_status -eq 0 && as_status=1
411 if test "$4"; then
412 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
413 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
c971b7fa 414 fi
d0ac1c44 415 $as_echo "$as_me: error: $2" >&2
c971b7fa
PA
416 as_fn_exit $as_status
417} # as_fn_error
418
419if expr a : '\(a\)' >/dev/null 2>&1 &&
420 test "X`expr 00001 : '.*\(...\)'`" = X001; then
421 as_expr=expr
422else
423 as_expr=false
424fi
425
426if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
427 as_basename=basename
428else
429 as_basename=false
430fi
431
432if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
433 as_dirname=dirname
434else
435 as_dirname=false
436fi
437
438as_me=`$as_basename -- "$0" ||
439$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
440 X"$0" : 'X\(//\)$' \| \
441 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
442$as_echo X/"$0" |
443 sed '/^.*\/\([^/][^/]*\)\/*$/{
444 s//\1/
445 q
446 }
447 /^X\/\(\/\/\)$/{
448 s//\1/
449 q
450 }
451 /^X\/\(\/\).*/{
452 s//\1/
453 q
454 }
455 s/.*/./; q'`
456
457# Avoid depending upon Character Ranges.
458as_cr_letters='abcdefghijklmnopqrstuvwxyz'
459as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
460as_cr_Letters=$as_cr_letters$as_cr_LETTERS
461as_cr_digits='0123456789'
462as_cr_alnum=$as_cr_Letters$as_cr_digits
463
464
465 as_lineno_1=$LINENO as_lineno_1a=$LINENO
466 as_lineno_2=$LINENO as_lineno_2a=$LINENO
467 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
468 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
469 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
470 sed -n '
471 p
472 /[$]LINENO/=
473 ' <$as_myself |
474 sed '
475 s/[$]LINENO.*/&-/
476 t lineno
477 b
478 :lineno
479 N
480 :loop
481 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
482 t loop
483 s/-\n.*//
484 ' >$as_me.lineno &&
485 chmod +x "$as_me.lineno" ||
486 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
487
d0ac1c44
SM
488 # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
489 # already done that, so ensure we don't try to do so again and fall
490 # in an infinite loop. This has already happened in practice.
491 _as_can_reexec=no; export _as_can_reexec
c971b7fa
PA
492 # Don't try to exec as it changes $[0], causing all sort of problems
493 # (the dirname of $[0] is not the place where we might find the
494 # original and so on. Autoconf is especially sensitive to this).
495 . "./$as_me.lineno"
496 # Exit status is that of the last command.
497 exit
498}
499
500ECHO_C= ECHO_N= ECHO_T=
501case `echo -n x` in #(((((
502-n*)
503 case `echo 'xy\c'` in
504 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
505 xy) ECHO_C='\c';;
506 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
507 ECHO_T=' ';;
508 esac;;
509*)
510 ECHO_N='-n';;
511esac
512
513rm -f conf$$ conf$$.exe conf$$.file
514if test -d conf$$.dir; then
515 rm -f conf$$.dir/conf$$.file
516else
517 rm -f conf$$.dir
518 mkdir conf$$.dir 2>/dev/null
519fi
520if (echo >conf$$.file) 2>/dev/null; then
521 if ln -s conf$$.file conf$$ 2>/dev/null; then
522 as_ln_s='ln -s'
523 # ... but there are two gotchas:
524 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
525 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
d0ac1c44 526 # In both cases, we have to default to `cp -pR'.
c971b7fa 527 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
d0ac1c44 528 as_ln_s='cp -pR'
c971b7fa
PA
529 elif ln conf$$.file conf$$ 2>/dev/null; then
530 as_ln_s=ln
531 else
d0ac1c44 532 as_ln_s='cp -pR'
c971b7fa
PA
533 fi
534else
d0ac1c44 535 as_ln_s='cp -pR'
c971b7fa
PA
536fi
537rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
538rmdir conf$$.dir 2>/dev/null
539
540if mkdir -p . 2>/dev/null; then
541 as_mkdir_p='mkdir -p "$as_dir"'
542else
543 test -d ./-p && rmdir ./-p
544 as_mkdir_p=false
545fi
546
d0ac1c44
SM
547as_test_x='test -x'
548as_executable_p=as_fn_executable_p
c971b7fa
PA
549
550# Sed expression to map a string onto a valid CPP name.
551as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
552
553# Sed expression to map a string onto a valid variable name.
554as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
555
556
d0ac1c44
SM
557test -n "$DJDIR" || exec 7<&0 </dev/null
558exec 6>&1
c971b7fa
PA
559
560# Name of the host.
d0ac1c44 561# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
c971b7fa
PA
562# so uname gets run too.
563ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
564
565#
566# Initializations.
567#
568ac_default_prefix=/usr/local
569ac_clean_files=
570ac_config_libobj_dir=.
571LIBOBJS=
572cross_compiling=no
573subdirs=
574MFLAGS=
575MAKEFLAGS=
576
577# Identity of this package.
d0ac1c44
SM
578PACKAGE_NAME='libgnu'
579PACKAGE_TARNAME='libgnu'
580PACKAGE_VERSION='UNUSED-VERSION'
581PACKAGE_STRING='libgnu UNUSED-VERSION'
582PACKAGE_BUGREPORT=''
583PACKAGE_URL=''
c971b7fa 584
8690e634 585ac_unique_file="import/memmem.c"
c971b7fa
PA
586# Factoring default headers for most tests.
587ac_includes_default="\
588#include <stdio.h>
589#ifdef HAVE_SYS_TYPES_H
590# include <sys/types.h>
591#endif
592#ifdef HAVE_SYS_STAT_H
593# include <sys/stat.h>
594#endif
595#ifdef STDC_HEADERS
596# include <stdlib.h>
597# include <stddef.h>
598#else
599# ifdef HAVE_STDLIB_H
600# include <stdlib.h>
601# endif
602#endif
603#ifdef HAVE_STRING_H
604# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
605# include <memory.h>
606# endif
607# include <string.h>
608#endif
609#ifdef HAVE_STRINGS_H
610# include <strings.h>
611#endif
612#ifdef HAVE_INTTYPES_H
613# include <inttypes.h>
614#endif
615#ifdef HAVE_STDINT_H
616# include <stdint.h>
617#endif
618#ifdef HAVE_UNISTD_H
619# include <unistd.h>
620#endif"
621
5abebf3c 622gl_use_threads_default=
c0c3707f
CB
623gl_use_winpthreads_default=
624ac_header_list=
625ac_func_list=
8690e634 626gl_fnmatch_required=POSIX
c971b7fa
PA
627ac_subst_vars='am__EXEEXT_FALSE
628am__EXEEXT_TRUE
629gltests_LTLIBOBJS
630gltests_LIBOBJS
631gl_LTLIBOBJS
632gl_LIBOBJS
633LTLIBOBJS
634LIBOBJS
635LN_S
39be3c7e
SM
636AM_BACKSLASH
637AM_DEFAULT_VERBOSITY
d0ac1c44
SM
638AM_DEFAULT_V
639AM_V
c971b7fa
PA
640am__fastdepCC_FALSE
641am__fastdepCC_TRUE
642CCDEPMODE
d0ac1c44 643am__nodep
c971b7fa
PA
644AMDEPBACKSLASH
645AMDEP_FALSE
646AMDEP_TRUE
647am__quote
648am__include
649DEPDIR
650am__untar
651am__tar
652AMTAR
653am__leading_dot
654SET_MAKE
655AWK
656mkdir_p
c971b7fa
PA
657INSTALL_STRIP_PROGRAM
658STRIP
659install_sh
660MAKEINFO
661AUTOHEADER
662AUTOMAKE
663AUTOCONF
664ACLOCAL
665VERSION
666PACKAGE
667CYGPATH_W
668am__isrc
669INSTALL_DATA
670INSTALL_SCRIPT
671INSTALL_PROGRAM
672LIBGNU_LTLIBDEPS
673LIBGNU_LIBDEPS
674gltests_WITNESS
8690e634
JK
675REPLACE_TOWLOWER
676REPLACE_ISWCNTRL
677HAVE_WCTYPE_H
678NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
679NEXT_WCTYPE_H
680HAVE_ISWCNTRL
681REPLACE_ISWBLANK
682HAVE_WCTRANS_T
683HAVE_WCTYPE_T
684HAVE_ISWBLANK
685GNULIB_TOWCTRANS
686GNULIB_WCTRANS
687GNULIB_ISWCTYPE
688GNULIB_WCTYPE
689GNULIB_ISWBLANK
c0c3707f 690HAVE_CRTDEFS_H
8690e634 691HAVE_WINT_T
8690e634
JK
692NEXT_AS_FIRST_DIRECTIVE_WCHAR_H
693NEXT_WCHAR_H
8839a007
PA
694HAVE_UNISTD_H
695NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
696NEXT_UNISTD_H
4a626d0a 697UNISTD_H_DEFINES_STRUCT_TIMESPEC
09607c9e
TT
698PTHREAD_H_DEFINES_STRUCT_TIMESPEC
699SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
700TIME_H_DEFINES_STRUCT_TIMESPEC
701NEXT_AS_FIRST_DIRECTIVE_TIME_H
702NEXT_TIME_H
725e2999
JB
703HAVE_SYS_UIO_H
704NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H
705NEXT_SYS_UIO_H
c0c3707f 706WINDOWS_STAT_INODES
63ce7108
TT
707WINDOWS_64_BIT_OFF_T
708NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H
709NEXT_SYS_TYPES_H
2196f55f
YQ
710NEXT_AS_FIRST_DIRECTIVE_STRING_H
711NEXT_STRING_H
98399780
YQ
712NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
713NEXT_STDLIB_H
6a29c58e
YQ
714NEXT_AS_FIRST_DIRECTIVE_STDIO_H
715NEXT_STDIO_H
2196f55f
YQ
716NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
717NEXT_STDDEF_H
718GL_GENERATE_STDDEF_H_FALSE
719GL_GENERATE_STDDEF_H_TRUE
720STDDEF_H
721HAVE_WCHAR_T
4a626d0a 722HAVE_MAX_ALIGN_T
2196f55f
YQ
723REPLACE_NULL
724HAVE__BOOL
725GL_GENERATE_STDBOOL_H_FALSE
726GL_GENERATE_STDBOOL_H_TRUE
727STDBOOL_H
725e2999
JB
728GL_GENERATE_STDALIGN_H_FALSE
729GL_GENERATE_STDALIGN_H_TRUE
730STDALIGN_H
0750520d
PA
731NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H
732NEXT_SIGNAL_H
733REPLACE_RAISE
734REPLACE_PTHREAD_SIGMASK
735HAVE_SIGHANDLER_T
736HAVE_TYPE_VOLATILE_SIG_ATOMIC_T
737HAVE_STRUCT_SIGACTION_SA_SIGACTION
738HAVE_SIGACTION
739HAVE_SIGINFO_T
740HAVE_SIGSET_T
741HAVE_RAISE
742HAVE_PTHREAD_SIGMASK
743HAVE_POSIX_SIGNALBLOCKING
744GNULIB_SIGACTION
745GNULIB_SIGPROCMASK
746GNULIB_SIGNAL_H_SIGPIPE
747GNULIB_RAISE
748GNULIB_PTHREAD_SIGMASK
6a29c58e
YQ
749REPLACE_VSPRINTF
750REPLACE_VSNPRINTF
751REPLACE_VPRINTF
752REPLACE_VFPRINTF
753REPLACE_VDPRINTF
754REPLACE_VASPRINTF
755REPLACE_TMPFILE
756REPLACE_STDIO_WRITE_FUNCS
757REPLACE_STDIO_READ_FUNCS
758REPLACE_SPRINTF
759REPLACE_SNPRINTF
760REPLACE_RENAMEAT
761REPLACE_RENAME
762REPLACE_REMOVE
763REPLACE_PRINTF
764REPLACE_POPEN
765REPLACE_PERROR
766REPLACE_OBSTACK_PRINTF
767REPLACE_GETLINE
768REPLACE_GETDELIM
769REPLACE_FTELLO
770REPLACE_FTELL
771REPLACE_FSEEKO
772REPLACE_FSEEK
773REPLACE_FREOPEN
774REPLACE_FPURGE
775REPLACE_FPRINTF
776REPLACE_FOPEN
777REPLACE_FFLUSH
778REPLACE_FDOPEN
779REPLACE_FCLOSE
780REPLACE_DPRINTF
781HAVE_VDPRINTF
782HAVE_VASPRINTF
783HAVE_RENAMEAT
784HAVE_POPEN
785HAVE_PCLOSE
786HAVE_FTELLO
787HAVE_FSEEKO
788HAVE_DPRINTF
789HAVE_DECL_VSNPRINTF
790HAVE_DECL_SNPRINTF
791HAVE_DECL_OBSTACK_PRINTF
792HAVE_DECL_GETLINE
793HAVE_DECL_GETDELIM
794HAVE_DECL_FTELLO
795HAVE_DECL_FSEEKO
796HAVE_DECL_FPURGE
797GNULIB_VSPRINTF_POSIX
798GNULIB_VSNPRINTF
799GNULIB_VPRINTF_POSIX
800GNULIB_VPRINTF
801GNULIB_VFPRINTF_POSIX
802GNULIB_VFPRINTF
803GNULIB_VDPRINTF
804GNULIB_VSCANF
805GNULIB_VFSCANF
806GNULIB_VASPRINTF
807GNULIB_TMPFILE
808GNULIB_STDIO_H_SIGPIPE
809GNULIB_STDIO_H_NONBLOCKING
810GNULIB_SPRINTF_POSIX
811GNULIB_SNPRINTF
812GNULIB_SCANF
813GNULIB_RENAMEAT
814GNULIB_RENAME
815GNULIB_REMOVE
816GNULIB_PUTS
817GNULIB_PUTCHAR
818GNULIB_PUTC
819GNULIB_PRINTF_POSIX
820GNULIB_PRINTF
821GNULIB_POPEN
822GNULIB_PERROR
823GNULIB_PCLOSE
824GNULIB_OBSTACK_PRINTF_POSIX
825GNULIB_OBSTACK_PRINTF
826GNULIB_GETLINE
827GNULIB_GETDELIM
828GNULIB_GETCHAR
829GNULIB_GETC
830GNULIB_FWRITE
831GNULIB_FTELLO
832GNULIB_FTELL
833GNULIB_FSEEKO
834GNULIB_FSEEK
835GNULIB_FSCANF
836GNULIB_FREOPEN
837GNULIB_FREAD
838GNULIB_FPUTS
839GNULIB_FPUTC
840GNULIB_FPURGE
841GNULIB_FPRINTF_POSIX
842GNULIB_FPRINTF
843GNULIB_FOPEN
844GNULIB_FGETS
845GNULIB_FGETC
846GNULIB_FFLUSH
847GNULIB_FDOPEN
848GNULIB_FCLOSE
849GNULIB_DPRINTF
725e2999
JB
850GL_GENERATE_NETINET_IN_H_FALSE
851GL_GENERATE_NETINET_IN_H_TRUE
852NETINET_IN_H
853HAVE_NETINET_IN_H
854NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
855NEXT_NETINET_IN_H
c971b7fa 856UNDEFINE_STRTOK_R
c971b7fa 857REPLACE_STRSIGNAL
c971b7fa
PA
858REPLACE_STRERROR_R
859REPLACE_STRERROR
c0c3707f 860REPLACE_STRTOK_R
c971b7fa
PA
861REPLACE_STRCASESTR
862REPLACE_STRSTR
c0c3707f
CB
863REPLACE_STRNLEN
864REPLACE_STRNDUP
865REPLACE_STRNCAT
c971b7fa 866REPLACE_STRDUP
c0c3707f 867REPLACE_STRCHRNUL
c971b7fa
PA
868REPLACE_STPNCPY
869REPLACE_MEMMEM
870REPLACE_MEMCHR
871HAVE_STRVERSCMP
872HAVE_DECL_STRSIGNAL
873HAVE_DECL_STRERROR_R
874HAVE_DECL_STRTOK_R
875HAVE_STRCASESTR
876HAVE_STRSEP
877HAVE_STRPBRK
878HAVE_DECL_STRNLEN
879HAVE_DECL_STRNDUP
880HAVE_DECL_STRDUP
881HAVE_STRCHRNUL
882HAVE_STPNCPY
883HAVE_STPCPY
884HAVE_RAWMEMCHR
885HAVE_DECL_MEMRCHR
886HAVE_MEMPCPY
887HAVE_DECL_MEMMEM
888HAVE_MEMCHR
889HAVE_FFSLL
890HAVE_FFSL
c0c3707f 891HAVE_EXPLICIT_BZERO
c971b7fa
PA
892HAVE_MBSLEN
893GNULIB_STRVERSCMP
894GNULIB_STRSIGNAL
895GNULIB_STRERROR_R
896GNULIB_STRERROR
897GNULIB_MBSTOK_R
898GNULIB_MBSSEP
899GNULIB_MBSSPN
900GNULIB_MBSPBRK
901GNULIB_MBSCSPN
902GNULIB_MBSCASESTR
903GNULIB_MBSPCASECMP
904GNULIB_MBSNCASECMP
905GNULIB_MBSCASECMP
906GNULIB_MBSSTR
907GNULIB_MBSRCHR
908GNULIB_MBSCHR
909GNULIB_MBSNLEN
910GNULIB_MBSLEN
911GNULIB_STRTOK_R
912GNULIB_STRCASESTR
913GNULIB_STRSTR
914GNULIB_STRSEP
915GNULIB_STRPBRK
916GNULIB_STRNLEN
917GNULIB_STRNDUP
918GNULIB_STRNCAT
919GNULIB_STRDUP
920GNULIB_STRCHRNUL
921GNULIB_STPNCPY
922GNULIB_STPCPY
923GNULIB_RAWMEMCHR
924GNULIB_MEMRCHR
925GNULIB_MEMPCPY
926GNULIB_MEMMEM
927GNULIB_MEMCHR
928GNULIB_FFSLL
929GNULIB_FFSL
c0c3707f 930GNULIB_EXPLICIT_BZERO
8690e634 931LOCALE_FR
8690e634 932LOCALE_ZH_CN
c0c3707f 933LOCALE_FR_UTF8
8690e634 934LOCALE_JA
c0c3707f
CB
935REPLACE_WCSTOK
936REPLACE_WCSFTIME
8690e634
JK
937REPLACE_WCSWIDTH
938REPLACE_WCWIDTH
939REPLACE_WCSNRTOMBS
940REPLACE_WCSRTOMBS
941REPLACE_WCRTOMB
942REPLACE_MBSNRTOWCS
943REPLACE_MBSRTOWCS
944REPLACE_MBRLEN
945REPLACE_MBRTOWC
946REPLACE_MBSINIT
947REPLACE_WCTOB
948REPLACE_BTOWC
949REPLACE_MBSTATE_T
950HAVE_DECL_WCWIDTH
951HAVE_DECL_WCTOB
c0c3707f 952HAVE_WCSFTIME
8690e634
JK
953HAVE_WCSWIDTH
954HAVE_WCSTOK
955HAVE_WCSSTR
956HAVE_WCSPBRK
957HAVE_WCSSPN
958HAVE_WCSCSPN
959HAVE_WCSRCHR
960HAVE_WCSCHR
961HAVE_WCSDUP
962HAVE_WCSXFRM
963HAVE_WCSCOLL
964HAVE_WCSNCASECMP
965HAVE_WCSCASECMP
966HAVE_WCSNCMP
967HAVE_WCSCMP
968HAVE_WCSNCAT
969HAVE_WCSCAT
970HAVE_WCPNCPY
971HAVE_WCSNCPY
972HAVE_WCPCPY
973HAVE_WCSCPY
974HAVE_WCSNLEN
975HAVE_WCSLEN
976HAVE_WMEMSET
977HAVE_WMEMMOVE
978HAVE_WMEMCPY
979HAVE_WMEMCMP
980HAVE_WMEMCHR
981HAVE_WCSNRTOMBS
982HAVE_WCSRTOMBS
983HAVE_WCRTOMB
984HAVE_MBSNRTOWCS
985HAVE_MBSRTOWCS
986HAVE_MBRLEN
987HAVE_MBRTOWC
988HAVE_MBSINIT
989HAVE_BTOWC
c0c3707f 990GNULIB_WCSFTIME
8690e634
JK
991GNULIB_WCSWIDTH
992GNULIB_WCSTOK
993GNULIB_WCSSTR
994GNULIB_WCSPBRK
995GNULIB_WCSSPN
996GNULIB_WCSCSPN
997GNULIB_WCSRCHR
998GNULIB_WCSCHR
999GNULIB_WCSDUP
1000GNULIB_WCSXFRM
1001GNULIB_WCSCOLL
1002GNULIB_WCSNCASECMP
1003GNULIB_WCSCASECMP
1004GNULIB_WCSNCMP
1005GNULIB_WCSCMP
1006GNULIB_WCSNCAT
1007GNULIB_WCSCAT
1008GNULIB_WCPNCPY
1009GNULIB_WCSNCPY
1010GNULIB_WCPCPY
1011GNULIB_WCSCPY
1012GNULIB_WCSNLEN
1013GNULIB_WCSLEN
1014GNULIB_WMEMSET
1015GNULIB_WMEMMOVE
1016GNULIB_WMEMCPY
1017GNULIB_WMEMCMP
1018GNULIB_WMEMCHR
1019GNULIB_WCWIDTH
1020GNULIB_WCSNRTOMBS
1021GNULIB_WCSRTOMBS
1022GNULIB_WCRTOMB
1023GNULIB_MBSNRTOWCS
1024GNULIB_MBSRTOWCS
1025GNULIB_MBRLEN
1026GNULIB_MBRTOWC
1027GNULIB_MBSINIT
1028GNULIB_WCTOB
1029GNULIB_BTOWC
88b48903
WN
1030NEXT_AS_FIRST_DIRECTIVE_MATH_H
1031NEXT_MATH_H
5abebf3c
CB
1032LTLIBMULTITHREAD
1033LIBMULTITHREAD
1034LTLIBTHREAD
1035LIBTHREAD
c0c3707f
CB
1036LIBPMULTITHREAD
1037LIBPTHREAD
8690e634 1038LOCALCHARSET_TESTS_ENVIRONMENT
c971b7fa
PA
1039NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
1040NEXT_INTTYPES_H
1041UINT64_MAX_EQ_ULONG_MAX
1042UINT32_MAX_LT_UINTMAX_MAX
1043PRIPTR_PREFIX
1044PRI_MACROS_BROKEN
1045INT64_MAX_EQ_LONG_MAX
1046INT32_MAX_LT_INTMAX_MAX
4a626d0a 1047REPLACE_STRTOUMAX
c971b7fa 1048REPLACE_STRTOIMAX
c0c3707f 1049HAVE_IMAXDIV_T
c971b7fa
PA
1050HAVE_DECL_STRTOUMAX
1051HAVE_DECL_STRTOIMAX
1052HAVE_DECL_IMAXDIV
1053HAVE_DECL_IMAXABS
1054GNULIB_STRTOUMAX
1055GNULIB_STRTOIMAX
1056GNULIB_IMAXDIV
1057GNULIB_IMAXABS
1058GL_GENERATE_STDINT_H_FALSE
1059GL_GENERATE_STDINT_H_TRUE
1060STDINT_H
49e4877c
PA
1061HAVE_SYS_INTTYPES_H
1062HAVE_SYS_BITYPES_H
1063HAVE_C99_STDINT_H
c971b7fa
PA
1064WINT_T_SUFFIX
1065WCHAR_T_SUFFIX
1066SIG_ATOMIC_T_SUFFIX
1067SIZE_T_SUFFIX
1068PTRDIFF_T_SUFFIX
1069HAVE_SIGNED_WINT_T
1070HAVE_SIGNED_WCHAR_T
1071HAVE_SIGNED_SIG_ATOMIC_T
1072BITSIZEOF_WINT_T
1073BITSIZEOF_WCHAR_T
1074BITSIZEOF_SIG_ATOMIC_T
1075BITSIZEOF_SIZE_T
1076BITSIZEOF_PTRDIFF_T
1077APPLE_UNIVERSAL_BUILD
c971b7fa
PA
1078HAVE_STDINT_H
1079NEXT_AS_FIRST_DIRECTIVE_STDINT_H
1080NEXT_STDINT_H
c971b7fa
PA
1081HAVE_SYS_TYPES_H
1082HAVE_INTTYPES_H
1083HAVE_WCHAR_H
1084HAVE_UNSIGNED_LONG_LONG_INT
1085HAVE_LONG_LONG_INT
c0c3707f 1086GNULIB_OVERRIDES_WINT_T
49e4877c
PA
1087GL_GENERATE_LIMITS_H_FALSE
1088GL_GENERATE_LIMITS_H_TRUE
1089LIMITS_H
1090NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
1091NEXT_LIMITS_H
725e2999
JB
1092HAVE_SYS_SOCKET_H
1093NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
1094NEXT_SYS_SOCKET_H
1095HAVE_ACCEPT4
1096HAVE_SA_FAMILY_T
1097HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
1098HAVE_STRUCT_SOCKADDR_STORAGE
1099GNULIB_ACCEPT4
1100GNULIB_SHUTDOWN
1101GNULIB_SETSOCKOPT
1102GNULIB_SENDTO
1103GNULIB_RECVFROM
1104GNULIB_SEND
1105GNULIB_RECV
1106GNULIB_LISTEN
1107GNULIB_GETSOCKOPT
1108GNULIB_GETSOCKNAME
1109GNULIB_GETPEERNAME
1110GNULIB_BIND
1111GNULIB_ACCEPT
1112GNULIB_CONNECT
1113GNULIB_SOCKET
1114INET_NTOP_LIB
6ec2e0f5
SDJ
1115GL_GENERATE_GLOB_H_FALSE
1116GL_GENERATE_GLOB_H_TRUE
1117GLOB_H
c0c3707f
CB
1118HAVE_GLOB_H
1119NEXT_AS_FIRST_DIRECTIVE_GLOB_H
1120NEXT_GLOB_H
1121REPLACE_GLOB_PATTERN_P
1122REPLACE_GLOB
1123HAVE_GLOB_PATTERN_P
1124HAVE_GLOB
1125GNULIB_GLOB
1126REPLACE_LOCALTIME
1127REPLACE_GMTIME
1128REPLACE_TZSET
1129REPLACE_TIMEGM
1130REPLACE_STRFTIME
1131REPLACE_NANOSLEEP
1132REPLACE_MKTIME
1133REPLACE_LOCALTIME_R
1134REPLACE_CTIME
1135HAVE_TIMEZONE_T
1136HAVE_TZSET
1137HAVE_TIMEGM
1138HAVE_STRPTIME
1139HAVE_NANOSLEEP
1140HAVE_DECL_LOCALTIME_R
1141GNULIB_TZSET
1142GNULIB_TIME_RZ
1143GNULIB_TIME_R
1144GNULIB_TIMEGM
1145GNULIB_STRPTIME
1146GNULIB_STRFTIME
1147GNULIB_NANOSLEEP
1148GNULIB_LOCALTIME
1149GNULIB_MKTIME
1150GNULIB_CTIME
4a626d0a
PA
1151NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
1152NEXT_SYS_TIME_H
1153REPLACE_STRUCT_TIMEVAL
1154REPLACE_GETTIMEOFDAY
4a626d0a
PA
1155HAVE_SYS_TIME_H
1156HAVE_STRUCT_TIMEVAL
1157HAVE_GETTIMEOFDAY
1158GNULIB_GETTIMEOFDAY
6ec2e0f5
SDJ
1159LTLIBINTL
1160LIBINTL
c0c3707f 1161LIB_GETLOGIN
6ec2e0f5 1162WINDOWS_64_BIT_ST_SIZE
c0c3707f 1163WINDOWS_STAT_TIMESPEC
6ec2e0f5
SDJ
1164NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
1165NEXT_SYS_STAT_H
1166REPLACE_UTIMENSAT
1167REPLACE_STAT
1168REPLACE_MKNOD
1169REPLACE_MKFIFO
1170REPLACE_MKDIR
1171REPLACE_LSTAT
1172REPLACE_FUTIMENS
1173REPLACE_FSTATAT
1174REPLACE_FSTAT
1175HAVE_UTIMENSAT
1176HAVE_MKNODAT
1177HAVE_MKNOD
1178HAVE_MKFIFOAT
1179HAVE_MKFIFO
1180HAVE_MKDIRAT
1181HAVE_LSTAT
1182HAVE_LCHMOD
1183HAVE_FUTIMENS
1184HAVE_FSTATAT
1185HAVE_FCHMODAT
c0c3707f 1186GNULIB_OVERRIDES_STRUCT_STAT
6ec2e0f5
SDJ
1187GNULIB_UTIMENSAT
1188GNULIB_STAT
1189GNULIB_MKNODAT
1190GNULIB_MKNOD
1191GNULIB_MKFIFOAT
1192GNULIB_MKFIFO
1193GNULIB_MKDIRAT
1194GNULIB_LSTAT
1195GNULIB_LCHMOD
1196GNULIB_FUTIMENS
1197GNULIB_FSTATAT
1198GNULIB_FSTAT
1199GNULIB_FCHMODAT
88b48903
WN
1200FREXPL_LIBM
1201HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
1202FREXP_LIBM
1203REPLACE_TRUNCL
1204REPLACE_TRUNCF
1205REPLACE_TRUNC
c0c3707f
CB
1206REPLACE_TANHF
1207REPLACE_TANF
88b48903 1208REPLACE_SQRTL
c0c3707f
CB
1209REPLACE_SQRTF
1210REPLACE_SINHF
1211REPLACE_SINF
88b48903
WN
1212REPLACE_SIGNBIT_USING_GCC
1213REPLACE_SIGNBIT
1214REPLACE_ROUNDL
1215REPLACE_ROUNDF
1216REPLACE_ROUND
c0c3707f 1217REPLACE_RINTL
88b48903
WN
1218REPLACE_REMAINDERL
1219REPLACE_REMAINDERF
1220REPLACE_REMAINDER
1221REPLACE_NAN
1222REPLACE_MODFL
1223REPLACE_MODFF
1224REPLACE_MODF
1225REPLACE_LOGBL
1226REPLACE_LOGBF
1227REPLACE_LOGB
1228REPLACE_LOG2L
1229REPLACE_LOG2F
1230REPLACE_LOG2
1231REPLACE_LOG1PL
1232REPLACE_LOG1PF
1233REPLACE_LOG1P
1234REPLACE_LOG10L
1235REPLACE_LOG10F
1236REPLACE_LOG10
1237REPLACE_LOGL
1238REPLACE_LOGF
1239REPLACE_LOG
1240REPLACE_LDEXPL
1241REPLACE_ISNAN
1242REPLACE_ISINF
1243REPLACE_ISFINITE
c0c3707f 1244REPLACE_ILOGBL
88b48903
WN
1245REPLACE_ILOGBF
1246REPLACE_ILOGB
1247REPLACE_HYPOTL
1248REPLACE_HYPOTF
1249REPLACE_HYPOT
1250REPLACE_HUGE_VAL
1251REPLACE_FREXPL
1252REPLACE_FREXP
1253REPLACE_FREXPF
1254REPLACE_FMODL
1255REPLACE_FMODF
1256REPLACE_FMOD
1257REPLACE_FMAL
1258REPLACE_FMAF
1259REPLACE_FMA
1260REPLACE_FLOORL
1261REPLACE_FLOORF
1262REPLACE_FLOOR
1263REPLACE_FABSL
1264REPLACE_EXP2L
1265REPLACE_EXP2
c0c3707f 1266REPLACE_EXPM1L
88b48903
WN
1267REPLACE_EXPM1F
1268REPLACE_EXPM1
c0c3707f
CB
1269REPLACE_EXPL
1270REPLACE_EXPF
1271REPLACE_COSHF
1272REPLACE_COSF
88b48903
WN
1273REPLACE_CEILL
1274REPLACE_CEILF
1275REPLACE_CEIL
1276REPLACE_CBRTL
1277REPLACE_CBRTF
c0c3707f
CB
1278REPLACE_ATAN2F
1279REPLACE_ATANF
1280REPLACE_ASINF
1281REPLACE_ACOSF
88b48903
WN
1282HAVE_DECL_TRUNCL
1283HAVE_DECL_TRUNCF
1284HAVE_DECL_TRUNC
1285HAVE_DECL_TANL
1286HAVE_DECL_SQRTL
1287HAVE_DECL_SINL
1288HAVE_DECL_ROUNDL
1289HAVE_DECL_ROUNDF
1290HAVE_DECL_ROUND
1291HAVE_DECL_RINTF
1292HAVE_DECL_REMAINDERL
1293HAVE_DECL_REMAINDER
1294HAVE_DECL_LOGB
1295HAVE_DECL_LOG2L
1296HAVE_DECL_LOG2F
1297HAVE_DECL_LOG2
1298HAVE_DECL_LOG10L
1299HAVE_DECL_LOGL
1300HAVE_DECL_LDEXPL
1301HAVE_DECL_FREXPL
1302HAVE_DECL_FLOORL
1303HAVE_DECL_FLOORF
1304HAVE_DECL_EXPM1L
1305HAVE_DECL_EXP2L
1306HAVE_DECL_EXP2F
1307HAVE_DECL_EXP2
1308HAVE_DECL_EXPL
1309HAVE_DECL_COSL
1310HAVE_DECL_COPYSIGNF
1311HAVE_DECL_CEILL
1312HAVE_DECL_CEILF
1313HAVE_DECL_CBRTL
1314HAVE_DECL_CBRTF
1315HAVE_DECL_ATANL
1316HAVE_DECL_ASINL
1317HAVE_DECL_ACOSL
1318HAVE_TANHF
1319HAVE_TANL
1320HAVE_TANF
1321HAVE_SQRTL
1322HAVE_SQRTF
1323HAVE_SINHF
1324HAVE_SINL
1325HAVE_SINF
1326HAVE_RINTL
1327HAVE_RINT
1328HAVE_REMAINDERF
1329HAVE_REMAINDER
1330HAVE_POWF
1331HAVE_MODFL
1332HAVE_MODFF
1333HAVE_LOGBL
1334HAVE_LOGBF
1335HAVE_LOG1PL
1336HAVE_LOG1PF
1337HAVE_LOG1P
1338HAVE_LOG10L
1339HAVE_LOG10F
1340HAVE_LOGL
1341HAVE_LOGF
1342HAVE_LDEXPF
1343HAVE_ISNANL
1344HAVE_ISNAND
1345HAVE_ISNANF
1346HAVE_ILOGBL
1347HAVE_ILOGBF
1348HAVE_ILOGB
1349HAVE_HYPOTL
1350HAVE_HYPOTF
1351HAVE_FREXPF
1352HAVE_FMODL
1353HAVE_FMODF
1354HAVE_FMAL
1355HAVE_FMAF
1356HAVE_FMA
1357HAVE_FABSL
1358HAVE_FABSF
1359HAVE_EXPM1F
1360HAVE_EXPM1
1361HAVE_EXPL
1362HAVE_EXPF
1363HAVE_COSHF
1364HAVE_COSL
1365HAVE_COSF
1366HAVE_COPYSIGNL
1367HAVE_COPYSIGN
1368HAVE_CBRTL
1369HAVE_CBRTF
1370HAVE_CBRT
1371HAVE_ATAN2F
1372HAVE_ATANL
1373HAVE_ATANF
1374HAVE_ASINL
1375HAVE_ASINF
1376HAVE_ACOSL
1377HAVE_ACOSF
1378GNULIB_TRUNCL
1379GNULIB_TRUNCF
1380GNULIB_TRUNC
1381GNULIB_TANHF
1382GNULIB_TANL
1383GNULIB_TANF
1384GNULIB_SQRTL
1385GNULIB_SQRTF
1386GNULIB_SINHF
1387GNULIB_SINL
1388GNULIB_SINF
1389GNULIB_SIGNBIT
1390GNULIB_ROUNDL
1391GNULIB_ROUNDF
1392GNULIB_ROUND
1393GNULIB_RINTL
1394GNULIB_RINTF
1395GNULIB_RINT
1396GNULIB_REMAINDERL
1397GNULIB_REMAINDERF
1398GNULIB_REMAINDER
1399GNULIB_POWF
1400GNULIB_MODFL
1401GNULIB_MODFF
1402GNULIB_MODF
1403GNULIB_LOGBL
1404GNULIB_LOGBF
1405GNULIB_LOGB
1406GNULIB_LOG2L
1407GNULIB_LOG2F
1408GNULIB_LOG2
1409GNULIB_LOG1PL
1410GNULIB_LOG1PF
1411GNULIB_LOG1P
1412GNULIB_LOG10L
1413GNULIB_LOG10F
1414GNULIB_LOG10
1415GNULIB_LOGL
1416GNULIB_LOGF
1417GNULIB_LOG
1418GNULIB_LDEXPL
1419GNULIB_LDEXPF
1420GNULIB_ISNANL
1421GNULIB_ISNAND
1422GNULIB_ISNANF
1423GNULIB_ISNAN
1424GNULIB_ISINF
1425GNULIB_ISFINITE
1426GNULIB_ILOGBL
1427GNULIB_ILOGBF
1428GNULIB_ILOGB
1429GNULIB_HYPOTL
1430GNULIB_HYPOTF
1431GNULIB_HYPOT
1432GNULIB_FREXPL
1433GNULIB_FREXP
1434GNULIB_FREXPF
1435GNULIB_FMODL
1436GNULIB_FMODF
1437GNULIB_FMOD
1438GNULIB_FMAL
1439GNULIB_FMAF
1440GNULIB_FMA
1441GNULIB_FLOORL
1442GNULIB_FLOORF
1443GNULIB_FLOOR
1444GNULIB_FABSL
1445GNULIB_FABSF
1446GNULIB_EXPM1L
1447GNULIB_EXPM1F
1448GNULIB_EXPM1
1449GNULIB_EXP2L
1450GNULIB_EXP2F
1451GNULIB_EXP2
1452GNULIB_EXPL
1453GNULIB_EXPF
1454GNULIB_COSHF
1455GNULIB_COSL
1456GNULIB_COSF
1457GNULIB_COPYSIGNL
1458GNULIB_COPYSIGNF
1459GNULIB_COPYSIGN
1460GNULIB_CEILL
1461GNULIB_CEILF
1462GNULIB_CEIL
1463GNULIB_CBRTL
1464GNULIB_CBRTF
1465GNULIB_CBRT
1466GNULIB_ATAN2F
1467GNULIB_ATANL
1468GNULIB_ATANF
1469GNULIB_ASINL
1470GNULIB_ASINF
1471GNULIB_ACOSL
1472GNULIB_ACOSF
8690e634
JK
1473GL_GENERATE_FNMATCH_H_FALSE
1474GL_GENERATE_FNMATCH_H_TRUE
1475FNMATCH_H
c0c3707f
CB
1476HAVE_FNMATCH_H
1477NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H
1478NEXT_FNMATCH_H
1479REPLACE_FNMATCH
1480HAVE_FNMATCH
1481GNULIB_FNMATCH
88b48903
WN
1482REPLACE_ITOLD
1483GL_GENERATE_FLOAT_H_FALSE
1484GL_GENERATE_FLOAT_H_TRUE
1485FLOAT_H
1486NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
1487NEXT_FLOAT_H
6ec2e0f5
SDJ
1488NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
1489NEXT_FCNTL_H
1490REPLACE_OPENAT
1491REPLACE_OPEN
1492REPLACE_FCNTL
c0c3707f 1493REPLACE_CREAT
6ec2e0f5
SDJ
1494HAVE_OPENAT
1495HAVE_FCNTL
1496GNULIB_OPENAT
1497GNULIB_OPEN
1498GNULIB_NONBLOCKING
1499GNULIB_FCNTL
c0c3707f 1500GNULIB_CREAT
18848e28
GF
1501EOVERFLOW_VALUE
1502EOVERFLOW_HIDDEN
1503ENOLINK_VALUE
1504ENOLINK_HIDDEN
1505EMULTIHOP_VALUE
1506EMULTIHOP_HIDDEN
1507GL_GENERATE_ERRNO_H_FALSE
1508GL_GENERATE_ERRNO_H_TRUE
1509ERRNO_H
1510NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
1511NEXT_ERRNO_H
e26b6bb0
TT
1512HAVE_DIRENT_H
1513NEXT_AS_FIRST_DIRECTIVE_DIRENT_H
1514NEXT_DIRENT_H
e26b6bb0
TT
1515REPLACE_FDOPENDIR
1516REPLACE_DIRFD
1517REPLACE_CLOSEDIR
1518REPLACE_OPENDIR
1519HAVE_ALPHASORT
1520HAVE_SCANDIR
1521HAVE_FDOPENDIR
1522HAVE_DECL_FDOPENDIR
1523HAVE_DECL_DIRFD
1524HAVE_CLOSEDIR
1525HAVE_REWINDDIR
1526HAVE_READDIR
1527HAVE_OPENDIR
1528GNULIB_ALPHASORT
1529GNULIB_SCANDIR
1530GNULIB_FDOPENDIR
1531GNULIB_DIRFD
1532GNULIB_CLOSEDIR
1533GNULIB_REWINDDIR
1534GNULIB_READDIR
1535GNULIB_OPENDIR
6ec2e0f5
SDJ
1536HAVE_WINSOCK2_H
1537HAVE_MSVC_INVALID_PARAMETER_HANDLER
e26b6bb0
TT
1538UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
1539UNISTD_H_HAVE_WINSOCK2_H
1540REPLACE_WRITE
1541REPLACE_USLEEP
1542REPLACE_UNLINKAT
1543REPLACE_UNLINK
1544REPLACE_TTYNAME_R
c0c3707f 1545REPLACE_TRUNCATE
4a626d0a 1546REPLACE_SYMLINKAT
e26b6bb0
TT
1547REPLACE_SYMLINK
1548REPLACE_SLEEP
1549REPLACE_RMDIR
4a626d0a 1550REPLACE_READLINKAT
e26b6bb0
TT
1551REPLACE_READLINK
1552REPLACE_READ
1553REPLACE_PWRITE
1554REPLACE_PREAD
1555REPLACE_LSEEK
1556REPLACE_LINKAT
1557REPLACE_LINK
1558REPLACE_LCHOWN
1559REPLACE_ISATTY
c0c3707f 1560REPLACE_GETPASS
e26b6bb0
TT
1561REPLACE_GETPAGESIZE
1562REPLACE_GETGROUPS
1563REPLACE_GETLOGIN_R
4a626d0a 1564REPLACE_GETDTABLESIZE
e26b6bb0
TT
1565REPLACE_GETDOMAINNAME
1566REPLACE_GETCWD
1567REPLACE_FTRUNCATE
1568REPLACE_FCHOWNAT
c0c3707f 1569REPLACE_FACCESSAT
e26b6bb0
TT
1570REPLACE_DUP2
1571REPLACE_DUP
1572REPLACE_CLOSE
1573REPLACE_CHOWN
c0c3707f 1574REPLACE_ACCESS
e26b6bb0
TT
1575HAVE_SYS_PARAM_H
1576HAVE_OS_H
1577HAVE_DECL_TTYNAME_R
c0c3707f 1578HAVE_DECL_TRUNCATE
e26b6bb0
TT
1579HAVE_DECL_SETHOSTNAME
1580HAVE_DECL_GETUSERSHELL
1581HAVE_DECL_GETPAGESIZE
1582HAVE_DECL_GETLOGIN_R
c0c3707f 1583HAVE_DECL_GETLOGIN
e26b6bb0
TT
1584HAVE_DECL_GETDOMAINNAME
1585HAVE_DECL_FDATASYNC
1586HAVE_DECL_FCHDIR
1587HAVE_DECL_ENVIRON
1588HAVE_USLEEP
1589HAVE_UNLINKAT
1590HAVE_SYMLINKAT
1591HAVE_SYMLINK
1592HAVE_SLEEP
1593HAVE_SETHOSTNAME
1594HAVE_READLINKAT
1595HAVE_READLINK
1596HAVE_PWRITE
1597HAVE_PREAD
1598HAVE_PIPE2
1599HAVE_PIPE
1600HAVE_LINKAT
1601HAVE_LINK
1602HAVE_LCHOWN
1603HAVE_GROUP_MEMBER
c0c3707f 1604HAVE_GETPASS
e26b6bb0
TT
1605HAVE_GETPAGESIZE
1606HAVE_GETLOGIN
1607HAVE_GETHOSTNAME
1608HAVE_GETGROUPS
1609HAVE_GETDTABLESIZE
1610HAVE_FTRUNCATE
1611HAVE_FSYNC
1612HAVE_FDATASYNC
1613HAVE_FCHOWNAT
1614HAVE_FCHDIR
1615HAVE_FACCESSAT
1616HAVE_EUIDACCESS
1617HAVE_DUP3
1618HAVE_DUP2
c0c3707f 1619HAVE_COPY_FILE_RANGE
e26b6bb0
TT
1620HAVE_CHOWN
1621GNULIB_WRITE
1622GNULIB_USLEEP
1623GNULIB_UNLINKAT
1624GNULIB_UNLINK
1625GNULIB_UNISTD_H_SIGPIPE
1626GNULIB_UNISTD_H_NONBLOCKING
1627GNULIB_TTYNAME_R
c0c3707f 1628GNULIB_TRUNCATE
e26b6bb0
TT
1629GNULIB_SYMLINKAT
1630GNULIB_SYMLINK
1631GNULIB_SLEEP
1632GNULIB_SETHOSTNAME
1633GNULIB_RMDIR
1634GNULIB_READLINKAT
1635GNULIB_READLINK
1636GNULIB_READ
1637GNULIB_PWRITE
1638GNULIB_PREAD
1639GNULIB_PIPE2
1640GNULIB_PIPE
1641GNULIB_LSEEK
1642GNULIB_LINKAT
1643GNULIB_LINK
1644GNULIB_LCHOWN
1645GNULIB_ISATTY
1646GNULIB_GROUP_MEMBER
1647GNULIB_GETUSERSHELL
c0c3707f 1648GNULIB_GETPASS
e26b6bb0
TT
1649GNULIB_GETPAGESIZE
1650GNULIB_GETLOGIN_R
1651GNULIB_GETLOGIN
1652GNULIB_GETHOSTNAME
1653GNULIB_GETGROUPS
1654GNULIB_GETDTABLESIZE
1655GNULIB_GETDOMAINNAME
1656GNULIB_GETCWD
1657GNULIB_FTRUNCATE
1658GNULIB_FSYNC
1659GNULIB_FDATASYNC
1660GNULIB_FCHOWNAT
1661GNULIB_FCHDIR
1662GNULIB_FACCESSAT
1663GNULIB_EUIDACCESS
1664GNULIB_ENVIRON
1665GNULIB_DUP3
1666GNULIB_DUP2
1667GNULIB_DUP
c0c3707f 1668GNULIB_COPY_FILE_RANGE
e26b6bb0
TT
1669GNULIB_CLOSE
1670GNULIB_CHOWN
1671GNULIB_CHDIR
c0c3707f 1672GNULIB_ACCESS
98399780
YQ
1673REPLACE_WCTOMB
1674REPLACE_UNSETENV
c0c3707f 1675REPLACE_STRTOLD
98399780 1676REPLACE_STRTOD
c0c3707f 1677REPLACE_SETSTATE
98399780
YQ
1678REPLACE_SETENV
1679REPLACE_REALPATH
1680REPLACE_REALLOC
1681REPLACE_RANDOM_R
c0c3707f 1682REPLACE_RANDOM
4a626d0a 1683REPLACE_QSORT_R
98399780
YQ
1684REPLACE_PUTENV
1685REPLACE_PTSNAME_R
1686REPLACE_PTSNAME
1687REPLACE_MKSTEMP
1688REPLACE_MBTOWC
1689REPLACE_MALLOC
c0c3707f 1690REPLACE_INITSTATE
98399780
YQ
1691REPLACE_CANONICALIZE_FILE_NAME
1692REPLACE_CALLOC
1693HAVE_DECL_UNSETENV
1694HAVE_UNLOCKPT
1695HAVE_SYS_LOADAVG_H
1696HAVE_STRUCT_RANDOM_DATA
1697HAVE_STRTOULL
1698HAVE_STRTOLL
c0c3707f 1699HAVE_STRTOLD
98399780 1700HAVE_STRTOD
c0c3707f
CB
1701HAVE_DECL_SETSTATE
1702HAVE_SETSTATE
98399780
YQ
1703HAVE_DECL_SETENV
1704HAVE_SETENV
4a626d0a 1705HAVE_SECURE_GETENV
98399780
YQ
1706HAVE_RPMATCH
1707HAVE_REALPATH
c0c3707f 1708HAVE_REALLOCARRAY
98399780
YQ
1709HAVE_RANDOM_R
1710HAVE_RANDOM_H
1711HAVE_RANDOM
4c62b19f 1712HAVE_QSORT_R
98399780
YQ
1713HAVE_PTSNAME_R
1714HAVE_PTSNAME
1715HAVE_POSIX_OPENPT
1716HAVE_MKSTEMPS
1717HAVE_MKSTEMP
1718HAVE_MKOSTEMPS
1719HAVE_MKOSTEMP
1720HAVE_MKDTEMP
c0c3707f
CB
1721HAVE_MBTOWC
1722HAVE_DECL_INITSTATE
1723HAVE_INITSTATE
98399780
YQ
1724HAVE_GRANTPT
1725HAVE_GETSUBOPT
1726HAVE_DECL_GETLOADAVG
1727HAVE_CANONICALIZE_FILE_NAME
1728HAVE_ATOLL
1729HAVE__EXIT
1730GNULIB_WCTOMB
1731GNULIB_UNSETENV
1732GNULIB_UNLOCKPT
1733GNULIB_SYSTEM_POSIX
1734GNULIB_STRTOULL
1735GNULIB_STRTOLL
c0c3707f 1736GNULIB_STRTOLD
98399780
YQ
1737GNULIB_STRTOD
1738GNULIB_SETENV
4a626d0a 1739GNULIB_SECURE_GETENV
98399780
YQ
1740GNULIB_RPMATCH
1741GNULIB_REALPATH
1742GNULIB_REALLOC_POSIX
c0c3707f 1743GNULIB_REALLOCARRAY
98399780
YQ
1744GNULIB_RANDOM_R
1745GNULIB_RANDOM
4a626d0a 1746GNULIB_QSORT_R
98399780
YQ
1747GNULIB_PUTENV
1748GNULIB_PTSNAME_R
1749GNULIB_PTSNAME
1750GNULIB_POSIX_OPENPT
1751GNULIB_MKSTEMPS
1752GNULIB_MKSTEMP
1753GNULIB_MKOSTEMPS
1754GNULIB_MKOSTEMP
1755GNULIB_MKDTEMP
1756GNULIB_MBTOWC
1757GNULIB_MALLOC_POSIX
1758GNULIB_GRANTPT
1759GNULIB_GETSUBOPT
1760GNULIB_GETLOADAVG
1761GNULIB_CANONICALIZE_FILE_NAME
1762GNULIB_CALLOC_POSIX
1763GNULIB_ATOLL
1764GNULIB__EXIT
725e2999 1765MKDIR_P
c0c3707f 1766HAVE_WS2TCPIP_H
725e2999
JB
1767HAVE_FEATURES_H
1768NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H
1769NEXT_ARPA_INET_H
1770PRAGMA_COLUMNS
1771PRAGMA_SYSTEM_HEADER
1772INCLUDE_NEXT_AS_FIRST_DIRECTIVE
1773INCLUDE_NEXT
1774HAVE_ARPA_INET_H
1775REPLACE_INET_PTON
1776REPLACE_INET_NTOP
1777HAVE_DECL_INET_PTON
1778HAVE_DECL_INET_NTOP
1779GNULIB_INET_PTON
1780GNULIB_INET_NTOP
c0c3707f 1781HAVE_ALLOCA_H
8690e634
JK
1782GL_GENERATE_ALLOCA_H_FALSE
1783GL_GENERATE_ALLOCA_H_TRUE
1784ALLOCA_H
1785ALLOCA
c971b7fa
PA
1786GL_COND_LIBTOOL_FALSE
1787GL_COND_LIBTOOL_TRUE
1788target_os
1789target_vendor
1790target_cpu
1791target
c971b7fa
PA
1792host_os
1793host_vendor
1794host_cpu
1795host
1796build_os
1797build_vendor
1798build_cpu
1799build
4a626d0a
PA
1800RANLIB
1801ARFLAGS
1802AR
1803EGREP
1804GREP
1805CPP
c971b7fa
PA
1806OBJEXT
1807EXEEXT
1808ac_ct_CC
1809CPPFLAGS
1810LDFLAGS
1811CFLAGS
1812CC
1813MAINT
1814MAINTAINER_MODE_FALSE
1815MAINTAINER_MODE_TRUE
1816target_alias
1817host_alias
1818build_alias
1819LIBS
1820ECHO_T
1821ECHO_N
1822ECHO_C
1823DEFS
1824mandir
1825localedir
1826libdir
1827psdir
1828pdfdir
1829dvidir
1830htmldir
1831infodir
1832docdir
1833oldincludedir
1834includedir
1835localstatedir
1836sharedstatedir
1837sysconfdir
1838datadir
1839datarootdir
1840libexecdir
1841sbindir
1842bindir
1843program_transform_name
1844prefix
1845exec_prefix
1846PACKAGE_URL
1847PACKAGE_BUGREPORT
1848PACKAGE_STRING
1849PACKAGE_VERSION
1850PACKAGE_TARNAME
1851PACKAGE_NAME
1852PATH_SEPARATOR
1853SHELL'
1854ac_subst_files=''
1855ac_user_opts='
1856enable_option_checking
1857enable_maintainer_mode
2196f55f 1858enable_largefile
5abebf3c 1859enable_threads
73cc7272 1860enable_plugins
c0c3707f 1861enable_cross_guesses
c971b7fa 1862enable_dependency_tracking
39be3c7e 1863enable_silent_rules
c971b7fa
PA
1864'
1865 ac_precious_vars='build_alias
1866host_alias
1867target_alias
1868CC
1869CFLAGS
1870LDFLAGS
1871LIBS
1872CPPFLAGS
1873CPP'
1874
1875
1876# Initialize some variables set by options.
1877ac_init_help=
1878ac_init_version=false
1879ac_unrecognized_opts=
1880ac_unrecognized_sep=
1881# The variables have the same names as the options, with
1882# dashes changed to underlines.
1883cache_file=/dev/null
1884exec_prefix=NONE
1885no_create=
1886no_recursion=
1887prefix=NONE
1888program_prefix=NONE
1889program_suffix=NONE
1890program_transform_name=s,x,x,
1891silent=
1892site=
1893srcdir=
1894verbose=
1895x_includes=NONE
1896x_libraries=NONE
1897
1898# Installation directory options.
1899# These are left unexpanded so users can "make install exec_prefix=/foo"
1900# and all the variables that are supposed to be based on exec_prefix
1901# by default will actually change.
1902# Use braces instead of parens because sh, perl, etc. also accept them.
1903# (The list follows the same order as the GNU Coding Standards.)
1904bindir='${exec_prefix}/bin'
1905sbindir='${exec_prefix}/sbin'
1906libexecdir='${exec_prefix}/libexec'
1907datarootdir='${prefix}/share'
1908datadir='${datarootdir}'
1909sysconfdir='${prefix}/etc'
1910sharedstatedir='${prefix}/com'
1911localstatedir='${prefix}/var'
1912includedir='${prefix}/include'
1913oldincludedir='/usr/include'
d0ac1c44 1914docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
c971b7fa
PA
1915infodir='${datarootdir}/info'
1916htmldir='${docdir}'
1917dvidir='${docdir}'
1918pdfdir='${docdir}'
1919psdir='${docdir}'
1920libdir='${exec_prefix}/lib'
1921localedir='${datarootdir}/locale'
1922mandir='${datarootdir}/man'
1923
1924ac_prev=
1925ac_dashdash=
1926for ac_option
1927do
1928 # If the previous option needs an argument, assign it.
1929 if test -n "$ac_prev"; then
1930 eval $ac_prev=\$ac_option
1931 ac_prev=
1932 continue
1933 fi
1934
1935 case $ac_option in
d0ac1c44
SM
1936 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
1937 *=) ac_optarg= ;;
1938 *) ac_optarg=yes ;;
c971b7fa
PA
1939 esac
1940
1941 # Accept the important Cygnus configure options, so we can diagnose typos.
1942
1943 case $ac_dashdash$ac_option in
1944 --)
1945 ac_dashdash=yes ;;
1946
1947 -bindir | --bindir | --bindi | --bind | --bin | --bi)
1948 ac_prev=bindir ;;
1949 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
1950 bindir=$ac_optarg ;;
1951
1952 -build | --build | --buil | --bui | --bu)
1953 ac_prev=build_alias ;;
1954 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
1955 build_alias=$ac_optarg ;;
1956
1957 -cache-file | --cache-file | --cache-fil | --cache-fi \
1958 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1959 ac_prev=cache_file ;;
1960 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1961 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
1962 cache_file=$ac_optarg ;;
1963
1964 --config-cache | -C)
1965 cache_file=config.cache ;;
1966
1967 -datadir | --datadir | --datadi | --datad)
1968 ac_prev=datadir ;;
1969 -datadir=* | --datadir=* | --datadi=* | --datad=*)
1970 datadir=$ac_optarg ;;
1971
1972 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
1973 | --dataroo | --dataro | --datar)
1974 ac_prev=datarootdir ;;
1975 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
1976 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
1977 datarootdir=$ac_optarg ;;
1978
1979 -disable-* | --disable-*)
1980 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
1981 # Reject names that are not valid shell variable names.
1982 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 1983 as_fn_error $? "invalid feature name: $ac_useropt"
c971b7fa
PA
1984 ac_useropt_orig=$ac_useropt
1985 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1986 case $ac_user_opts in
1987 *"
1988"enable_$ac_useropt"
1989"*) ;;
1990 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
1991 ac_unrecognized_sep=', ';;
1992 esac
1993 eval enable_$ac_useropt=no ;;
1994
1995 -docdir | --docdir | --docdi | --doc | --do)
1996 ac_prev=docdir ;;
1997 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
1998 docdir=$ac_optarg ;;
1999
2000 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
2001 ac_prev=dvidir ;;
2002 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
2003 dvidir=$ac_optarg ;;
2004
2005 -enable-* | --enable-*)
2006 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
2007 # Reject names that are not valid shell variable names.
2008 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2009 as_fn_error $? "invalid feature name: $ac_useropt"
c971b7fa
PA
2010 ac_useropt_orig=$ac_useropt
2011 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2012 case $ac_user_opts in
2013 *"
2014"enable_$ac_useropt"
2015"*) ;;
2016 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
2017 ac_unrecognized_sep=', ';;
2018 esac
2019 eval enable_$ac_useropt=\$ac_optarg ;;
2020
2021 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
2022 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
2023 | --exec | --exe | --ex)
2024 ac_prev=exec_prefix ;;
2025 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
2026 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
2027 | --exec=* | --exe=* | --ex=*)
2028 exec_prefix=$ac_optarg ;;
2029
2030 -gas | --gas | --ga | --g)
2031 # Obsolete; use --with-gas.
2032 with_gas=yes ;;
2033
2034 -help | --help | --hel | --he | -h)
2035 ac_init_help=long ;;
2036 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
2037 ac_init_help=recursive ;;
2038 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
2039 ac_init_help=short ;;
2040
2041 -host | --host | --hos | --ho)
2042 ac_prev=host_alias ;;
2043 -host=* | --host=* | --hos=* | --ho=*)
2044 host_alias=$ac_optarg ;;
2045
2046 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
2047 ac_prev=htmldir ;;
2048 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
2049 | --ht=*)
2050 htmldir=$ac_optarg ;;
2051
2052 -includedir | --includedir | --includedi | --included | --include \
2053 | --includ | --inclu | --incl | --inc)
2054 ac_prev=includedir ;;
2055 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
2056 | --includ=* | --inclu=* | --incl=* | --inc=*)
2057 includedir=$ac_optarg ;;
2058
2059 -infodir | --infodir | --infodi | --infod | --info | --inf)
2060 ac_prev=infodir ;;
2061 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
2062 infodir=$ac_optarg ;;
2063
2064 -libdir | --libdir | --libdi | --libd)
2065 ac_prev=libdir ;;
2066 -libdir=* | --libdir=* | --libdi=* | --libd=*)
2067 libdir=$ac_optarg ;;
2068
2069 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
2070 | --libexe | --libex | --libe)
2071 ac_prev=libexecdir ;;
2072 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
2073 | --libexe=* | --libex=* | --libe=*)
2074 libexecdir=$ac_optarg ;;
2075
2076 -localedir | --localedir | --localedi | --localed | --locale)
2077 ac_prev=localedir ;;
2078 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
2079 localedir=$ac_optarg ;;
2080
2081 -localstatedir | --localstatedir | --localstatedi | --localstated \
2082 | --localstate | --localstat | --localsta | --localst | --locals)
2083 ac_prev=localstatedir ;;
2084 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
2085 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
2086 localstatedir=$ac_optarg ;;
2087
2088 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
2089 ac_prev=mandir ;;
2090 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
2091 mandir=$ac_optarg ;;
2092
2093 -nfp | --nfp | --nf)
2094 # Obsolete; use --without-fp.
2095 with_fp=no ;;
2096
2097 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
2098 | --no-cr | --no-c | -n)
2099 no_create=yes ;;
2100
2101 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
2102 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
2103 no_recursion=yes ;;
2104
2105 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
2106 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
2107 | --oldin | --oldi | --old | --ol | --o)
2108 ac_prev=oldincludedir ;;
2109 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
2110 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
2111 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
2112 oldincludedir=$ac_optarg ;;
2113
2114 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
2115 ac_prev=prefix ;;
2116 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
2117 prefix=$ac_optarg ;;
2118
2119 -program-prefix | --program-prefix | --program-prefi | --program-pref \
2120 | --program-pre | --program-pr | --program-p)
2121 ac_prev=program_prefix ;;
2122 -program-prefix=* | --program-prefix=* | --program-prefi=* \
2123 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
2124 program_prefix=$ac_optarg ;;
2125
2126 -program-suffix | --program-suffix | --program-suffi | --program-suff \
2127 | --program-suf | --program-su | --program-s)
2128 ac_prev=program_suffix ;;
2129 -program-suffix=* | --program-suffix=* | --program-suffi=* \
2130 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
2131 program_suffix=$ac_optarg ;;
2132
2133 -program-transform-name | --program-transform-name \
2134 | --program-transform-nam | --program-transform-na \
2135 | --program-transform-n | --program-transform- \
2136 | --program-transform | --program-transfor \
2137 | --program-transfo | --program-transf \
2138 | --program-trans | --program-tran \
2139 | --progr-tra | --program-tr | --program-t)
2140 ac_prev=program_transform_name ;;
2141 -program-transform-name=* | --program-transform-name=* \
2142 | --program-transform-nam=* | --program-transform-na=* \
2143 | --program-transform-n=* | --program-transform-=* \
2144 | --program-transform=* | --program-transfor=* \
2145 | --program-transfo=* | --program-transf=* \
2146 | --program-trans=* | --program-tran=* \
2147 | --progr-tra=* | --program-tr=* | --program-t=*)
2148 program_transform_name=$ac_optarg ;;
2149
2150 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
2151 ac_prev=pdfdir ;;
2152 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
2153 pdfdir=$ac_optarg ;;
2154
2155 -psdir | --psdir | --psdi | --psd | --ps)
2156 ac_prev=psdir ;;
2157 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
2158 psdir=$ac_optarg ;;
2159
2160 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2161 | -silent | --silent | --silen | --sile | --sil)
2162 silent=yes ;;
2163
2164 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
2165 ac_prev=sbindir ;;
2166 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
2167 | --sbi=* | --sb=*)
2168 sbindir=$ac_optarg ;;
2169
2170 -sharedstatedir | --sharedstatedir | --sharedstatedi \
2171 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
2172 | --sharedst | --shareds | --shared | --share | --shar \
2173 | --sha | --sh)
2174 ac_prev=sharedstatedir ;;
2175 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
2176 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
2177 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
2178 | --sha=* | --sh=*)
2179 sharedstatedir=$ac_optarg ;;
2180
2181 -site | --site | --sit)
2182 ac_prev=site ;;
2183 -site=* | --site=* | --sit=*)
2184 site=$ac_optarg ;;
2185
2186 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
2187 ac_prev=srcdir ;;
2188 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
2189 srcdir=$ac_optarg ;;
2190
2191 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
2192 | --syscon | --sysco | --sysc | --sys | --sy)
2193 ac_prev=sysconfdir ;;
2194 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
2195 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
2196 sysconfdir=$ac_optarg ;;
2197
2198 -target | --target | --targe | --targ | --tar | --ta | --t)
2199 ac_prev=target_alias ;;
2200 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
2201 target_alias=$ac_optarg ;;
2202
2203 -v | -verbose | --verbose | --verbos | --verbo | --verb)
2204 verbose=yes ;;
2205
2206 -version | --version | --versio | --versi | --vers | -V)
2207 ac_init_version=: ;;
2208
2209 -with-* | --with-*)
2210 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
2211 # Reject names that are not valid shell variable names.
2212 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2213 as_fn_error $? "invalid package name: $ac_useropt"
c971b7fa
PA
2214 ac_useropt_orig=$ac_useropt
2215 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2216 case $ac_user_opts in
2217 *"
2218"with_$ac_useropt"
2219"*) ;;
2220 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
2221 ac_unrecognized_sep=', ';;
2222 esac
2223 eval with_$ac_useropt=\$ac_optarg ;;
2224
2225 -without-* | --without-*)
2226 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
2227 # Reject names that are not valid shell variable names.
2228 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
d0ac1c44 2229 as_fn_error $? "invalid package name: $ac_useropt"
c971b7fa
PA
2230 ac_useropt_orig=$ac_useropt
2231 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2232 case $ac_user_opts in
2233 *"
2234"with_$ac_useropt"
2235"*) ;;
2236 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
2237 ac_unrecognized_sep=', ';;
2238 esac
2239 eval with_$ac_useropt=no ;;
2240
2241 --x)
2242 # Obsolete; use --with-x.
2243 with_x=yes ;;
2244
2245 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
2246 | --x-incl | --x-inc | --x-in | --x-i)
2247 ac_prev=x_includes ;;
2248 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
2249 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
2250 x_includes=$ac_optarg ;;
2251
2252 -x-libraries | --x-libraries | --x-librarie | --x-librari \
2253 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
2254 ac_prev=x_libraries ;;
2255 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
2256 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
2257 x_libraries=$ac_optarg ;;
2258
d0ac1c44
SM
2259 -*) as_fn_error $? "unrecognized option: \`$ac_option'
2260Try \`$0 --help' for more information"
c971b7fa
PA
2261 ;;
2262
2263 *=*)
2264 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
2265 # Reject names that are not valid shell variable names.
2266 case $ac_envvar in #(
2267 '' | [0-9]* | *[!_$as_cr_alnum]* )
d0ac1c44 2268 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
c971b7fa
PA
2269 esac
2270 eval $ac_envvar=\$ac_optarg
2271 export $ac_envvar ;;
2272
2273 *)
2274 # FIXME: should be removed in autoconf 3.0.
2275 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
2276 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
2277 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
d0ac1c44 2278 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
c971b7fa
PA
2279 ;;
2280
2281 esac
2282done
2283
2284if test -n "$ac_prev"; then
2285 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
d0ac1c44 2286 as_fn_error $? "missing argument to $ac_option"
c971b7fa
PA
2287fi
2288
2289if test -n "$ac_unrecognized_opts"; then
2290 case $enable_option_checking in
2291 no) ;;
d0ac1c44 2292 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
c971b7fa
PA
2293 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
2294 esac
2295fi
2296
2297# Check all directory arguments for consistency.
2298for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
2299 datadir sysconfdir sharedstatedir localstatedir includedir \
2300 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
2301 libdir localedir mandir
2302do
2303 eval ac_val=\$$ac_var
2304 # Remove trailing slashes.
2305 case $ac_val in
2306 */ )
2307 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
2308 eval $ac_var=\$ac_val;;
2309 esac
2310 # Be sure to have absolute directory names.
2311 case $ac_val in
2312 [\\/$]* | ?:[\\/]* ) continue;;
2313 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
2314 esac
d0ac1c44 2315 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
c971b7fa
PA
2316done
2317
2318# There might be people who depend on the old broken behavior: `$host'
2319# used to hold the argument of --host etc.
2320# FIXME: To remove some day.
2321build=$build_alias
2322host=$host_alias
2323target=$target_alias
2324
2325# FIXME: To remove some day.
2326if test "x$host_alias" != x; then
2327 if test "x$build_alias" = x; then
2328 cross_compiling=maybe
c971b7fa
PA
2329 elif test "x$build_alias" != "x$host_alias"; then
2330 cross_compiling=yes
2331 fi
2332fi
2333
2334ac_tool_prefix=
2335test -n "$host_alias" && ac_tool_prefix=$host_alias-
2336
2337test "$silent" = yes && exec 6>/dev/null
2338
2339
2340ac_pwd=`pwd` && test -n "$ac_pwd" &&
2341ac_ls_di=`ls -di .` &&
2342ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
d0ac1c44 2343 as_fn_error $? "working directory cannot be determined"
c971b7fa 2344test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
d0ac1c44 2345 as_fn_error $? "pwd does not report name of working directory"
c971b7fa
PA
2346
2347
2348# Find the source files, if location was not specified.
2349if test -z "$srcdir"; then
2350 ac_srcdir_defaulted=yes
2351 # Try the directory containing this script, then the parent directory.
2352 ac_confdir=`$as_dirname -- "$as_myself" ||
2353$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2354 X"$as_myself" : 'X\(//\)[^/]' \| \
2355 X"$as_myself" : 'X\(//\)$' \| \
2356 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
2357$as_echo X"$as_myself" |
2358 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
2359 s//\1/
2360 q
2361 }
2362 /^X\(\/\/\)[^/].*/{
2363 s//\1/
2364 q
2365 }
2366 /^X\(\/\/\)$/{
2367 s//\1/
2368 q
2369 }
2370 /^X\(\/\).*/{
2371 s//\1/
2372 q
2373 }
2374 s/.*/./; q'`
2375 srcdir=$ac_confdir
2376 if test ! -r "$srcdir/$ac_unique_file"; then
2377 srcdir=..
2378 fi
2379else
2380 ac_srcdir_defaulted=no
2381fi
2382if test ! -r "$srcdir/$ac_unique_file"; then
2383 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
d0ac1c44 2384 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
c971b7fa
PA
2385fi
2386ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
2387ac_abs_confdir=`(
d0ac1c44 2388 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
c971b7fa
PA
2389 pwd)`
2390# When building in place, set srcdir=.
2391if test "$ac_abs_confdir" = "$ac_pwd"; then
2392 srcdir=.
2393fi
2394# Remove unnecessary trailing slashes from srcdir.
2395# Double slashes in file names in object file debugging info
2396# mess up M-x gdb in Emacs.
2397case $srcdir in
2398*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
2399esac
2400for ac_var in $ac_precious_vars; do
2401 eval ac_env_${ac_var}_set=\${${ac_var}+set}
2402 eval ac_env_${ac_var}_value=\$${ac_var}
2403 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
2404 eval ac_cv_env_${ac_var}_value=\$${ac_var}
2405done
2406
2407#
2408# Report the --help message.
2409#
2410if test "$ac_init_help" = "long"; then
2411 # Omit some internal or obsolete options to make the list less imposing.
2412 # This message is too long to be a string in the A/UX 3.1 sh.
2413 cat <<_ACEOF
d0ac1c44 2414\`configure' configures libgnu UNUSED-VERSION to adapt to many kinds of systems.
c971b7fa
PA
2415
2416Usage: $0 [OPTION]... [VAR=VALUE]...
2417
2418To assign environment variables (e.g., CC, CFLAGS...), specify them as
2419VAR=VALUE. See below for descriptions of some of the useful variables.
2420
2421Defaults for the options are specified in brackets.
2422
2423Configuration:
2424 -h, --help display this help and exit
2425 --help=short display options specific to this package
2426 --help=recursive display the short help of all the included packages
2427 -V, --version display version information and exit
d0ac1c44 2428 -q, --quiet, --silent do not print \`checking ...' messages
c971b7fa
PA
2429 --cache-file=FILE cache test results in FILE [disabled]
2430 -C, --config-cache alias for \`--cache-file=config.cache'
2431 -n, --no-create do not create output files
2432 --srcdir=DIR find the sources in DIR [configure dir or \`..']
2433
2434Installation directories:
2435 --prefix=PREFIX install architecture-independent files in PREFIX
2436 [$ac_default_prefix]
2437 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
2438 [PREFIX]
2439
2440By default, \`make install' will install all the files in
2441\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
2442an installation prefix other than \`$ac_default_prefix' using \`--prefix',
2443for instance \`--prefix=\$HOME'.
2444
2445For better control, use the options below.
2446
2447Fine tuning of the installation directories:
2448 --bindir=DIR user executables [EPREFIX/bin]
2449 --sbindir=DIR system admin executables [EPREFIX/sbin]
2450 --libexecdir=DIR program executables [EPREFIX/libexec]
2451 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
2452 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
2453 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
2454 --libdir=DIR object code libraries [EPREFIX/lib]
2455 --includedir=DIR C header files [PREFIX/include]
2456 --oldincludedir=DIR C header files for non-gcc [/usr/include]
2457 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
2458 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
2459 --infodir=DIR info documentation [DATAROOTDIR/info]
2460 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
2461 --mandir=DIR man documentation [DATAROOTDIR/man]
d0ac1c44 2462 --docdir=DIR documentation root [DATAROOTDIR/doc/libgnu]
c971b7fa
PA
2463 --htmldir=DIR html documentation [DOCDIR]
2464 --dvidir=DIR dvi documentation [DOCDIR]
2465 --pdfdir=DIR pdf documentation [DOCDIR]
2466 --psdir=DIR ps documentation [DOCDIR]
2467_ACEOF
2468
2469 cat <<\_ACEOF
2470
2471Program names:
2472 --program-prefix=PREFIX prepend PREFIX to installed program names
2473 --program-suffix=SUFFIX append SUFFIX to installed program names
2474 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
2475
2476System types:
2477 --build=BUILD configure for building on BUILD [guessed]
2478 --host=HOST cross-compile to build programs to run on HOST [BUILD]
2479 --target=TARGET configure for building compilers for TARGET [HOST]
2480_ACEOF
2481fi
2482
2483if test -n "$ac_init_help"; then
d0ac1c44
SM
2484 case $ac_init_help in
2485 short | recursive ) echo "Configuration of libgnu UNUSED-VERSION:";;
2486 esac
c971b7fa
PA
2487 cat <<\_ACEOF
2488
2489Optional Features:
2490 --disable-option-checking ignore unrecognized --enable/--with options
2491 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
2492 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
d0ac1c44
SM
2493 --enable-maintainer-mode
2494 enable make rules and dependencies not useful (and
2495 sometimes confusing) to the casual installer
2196f55f 2496 --disable-largefile omit support for large files
c0c3707f 2497 --enable-threads={isoc|posix|isoc+posix|windows}
5abebf3c
CB
2498 specify multithreading API
2499 --disable-threads build without multithread safety
73cc7272 2500 --enable-plugins Enable support for plugins
c0c3707f
CB
2501 --enable-cross-guesses={conservative|risky}
2502 specify policy for cross-compilation guesses
d0ac1c44
SM
2503 --enable-dependency-tracking
2504 do not reject slow dependency extractors
2505 --disable-dependency-tracking
2506 speeds up one-time build
2507 --enable-silent-rules less verbose build output (undo: "make V=1")
2508 --disable-silent-rules verbose build output (undo: "make V=0")
c971b7fa
PA
2509
2510Some influential environment variables:
2511 CC C compiler command
2512 CFLAGS C compiler flags
2513 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
2514 nonstandard directory <lib dir>
2515 LIBS libraries to pass to the linker, e.g. -l<library>
d0ac1c44 2516 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
c971b7fa
PA
2517 you have headers in a nonstandard directory <include dir>
2518 CPP C preprocessor
2519
2520Use these variables to override the choices made by `configure' or to help
2521it to find libraries and programs with nonstandard names/locations.
2522
2523Report bugs to the package provider.
2524_ACEOF
2525ac_status=$?
2526fi
2527
2528if test "$ac_init_help" = "recursive"; then
2529 # If there are subdirs, report their specific --help.
2530 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
2531 test -d "$ac_dir" ||
2532 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
2533 continue
2534 ac_builddir=.
2535
2536case "$ac_dir" in
2537.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
2538*)
2539 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
2540 # A ".." for each directory in $ac_dir_suffix.
2541 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
2542 case $ac_top_builddir_sub in
2543 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
2544 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
2545 esac ;;
2546esac
2547ac_abs_top_builddir=$ac_pwd
2548ac_abs_builddir=$ac_pwd$ac_dir_suffix
2549# for backward compatibility:
2550ac_top_builddir=$ac_top_build_prefix
2551
2552case $srcdir in
2553 .) # We are building in place.
2554 ac_srcdir=.
2555 ac_top_srcdir=$ac_top_builddir_sub
2556 ac_abs_top_srcdir=$ac_pwd ;;
2557 [\\/]* | ?:[\\/]* ) # Absolute name.
2558 ac_srcdir=$srcdir$ac_dir_suffix;
2559 ac_top_srcdir=$srcdir
2560 ac_abs_top_srcdir=$srcdir ;;
2561 *) # Relative name.
2562 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
2563 ac_top_srcdir=$ac_top_build_prefix$srcdir
2564 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
2565esac
2566ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
2567
2568 cd "$ac_dir" || { ac_status=$?; continue; }
2569 # Check for guested configure.
2570 if test -f "$ac_srcdir/configure.gnu"; then
2571 echo &&
2572 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
2573 elif test -f "$ac_srcdir/configure"; then
2574 echo &&
2575 $SHELL "$ac_srcdir/configure" --help=recursive
2576 else
2577 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
2578 fi || ac_status=$?
2579 cd "$ac_pwd" || { ac_status=$?; break; }
2580 done
2581fi
2582
2583test -n "$ac_init_help" && exit $ac_status
2584if $ac_init_version; then
2585 cat <<\_ACEOF
d0ac1c44
SM
2586libgnu configure UNUSED-VERSION
2587generated by GNU Autoconf 2.69
c971b7fa 2588
d0ac1c44 2589Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
2590This configure script is free software; the Free Software Foundation
2591gives unlimited permission to copy, distribute and modify it.
2592_ACEOF
2593 exit
2594fi
2595
2596## ------------------------ ##
2597## Autoconf initialization. ##
2598## ------------------------ ##
2599
2600# ac_fn_c_try_compile LINENO
2601# --------------------------
2602# Try to compile conftest.$ac_ext, and return whether this succeeded.
2603ac_fn_c_try_compile ()
2604{
2605 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2606 rm -f conftest.$ac_objext
2607 if { { ac_try="$ac_compile"
2608case "(($ac_try" in
2609 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2610 *) ac_try_echo=$ac_try;;
2611esac
2612eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2613$as_echo "$ac_try_echo"; } >&5
2614 (eval "$ac_compile") 2>conftest.err
2615 ac_status=$?
2616 if test -s conftest.err; then
2617 grep -v '^ *+' conftest.err >conftest.er1
2618 cat conftest.er1 >&5
2619 mv -f conftest.er1 conftest.err
2620 fi
2621 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2622 test $ac_status = 0; } && {
2623 test -z "$ac_c_werror_flag" ||
2624 test ! -s conftest.err
2625 } && test -s conftest.$ac_objext; then :
2626 ac_retval=0
2627else
2628 $as_echo "$as_me: failed program was:" >&5
2629sed 's/^/| /' conftest.$ac_ext >&5
2630
2631 ac_retval=1
2632fi
d0ac1c44
SM
2633 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2634 as_fn_set_status $ac_retval
c971b7fa
PA
2635
2636} # ac_fn_c_try_compile
2637
2638# ac_fn_c_try_cpp LINENO
2639# ----------------------
2640# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
2641ac_fn_c_try_cpp ()
2642{
2643 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2644 if { { ac_try="$ac_cpp conftest.$ac_ext"
2645case "(($ac_try" in
2646 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2647 *) ac_try_echo=$ac_try;;
2648esac
2649eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2650$as_echo "$ac_try_echo"; } >&5
2651 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
2652 ac_status=$?
2653 if test -s conftest.err; then
2654 grep -v '^ *+' conftest.err >conftest.er1
2655 cat conftest.er1 >&5
2656 mv -f conftest.er1 conftest.err
2657 fi
2658 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
d0ac1c44 2659 test $ac_status = 0; } > conftest.i && {
c971b7fa
PA
2660 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
2661 test ! -s conftest.err
2662 }; then :
2663 ac_retval=0
2664else
2665 $as_echo "$as_me: failed program was:" >&5
2666sed 's/^/| /' conftest.$ac_ext >&5
2667
2668 ac_retval=1
2669fi
d0ac1c44
SM
2670 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2671 as_fn_set_status $ac_retval
c971b7fa
PA
2672
2673} # ac_fn_c_try_cpp
2674
2675# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
2676# -------------------------------------------------------
2677# Tests whether HEADER exists, giving a warning if it cannot be compiled using
2678# the include files in INCLUDES and setting the cache variable VAR
2679# accordingly.
2680ac_fn_c_check_header_mongrel ()
2681{
2682 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
d0ac1c44 2683 if eval \${$3+:} false; then :
c971b7fa
PA
2684 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2685$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2686if eval \${$3+:} false; then :
c971b7fa
PA
2687 $as_echo_n "(cached) " >&6
2688fi
2689eval ac_res=\$$3
2690 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2691$as_echo "$ac_res" >&6; }
2692else
2693 # Is the header compilable?
2694{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
2695$as_echo_n "checking $2 usability... " >&6; }
2696cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2697/* end confdefs.h. */
2698$4
2699#include <$2>
2700_ACEOF
2701if ac_fn_c_try_compile "$LINENO"; then :
2702 ac_header_compiler=yes
2703else
2704 ac_header_compiler=no
2705fi
2706rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2707{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
2708$as_echo "$ac_header_compiler" >&6; }
2709
2710# Is the header present?
2711{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
2712$as_echo_n "checking $2 presence... " >&6; }
2713cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2714/* end confdefs.h. */
2715#include <$2>
2716_ACEOF
2717if ac_fn_c_try_cpp "$LINENO"; then :
2718 ac_header_preproc=yes
2719else
2720 ac_header_preproc=no
2721fi
d0ac1c44 2722rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
2723{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
2724$as_echo "$ac_header_preproc" >&6; }
2725
2726# So? What about this header?
2727case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
2728 yes:no: )
2729 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
2730$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
2731 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2732$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2733 ;;
2734 no:yes:* )
2735 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
2736$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
2737 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
2738$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
2739 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
2740$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
2741 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
2742$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
2743 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2744$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2745 ;;
2746esac
2747 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2748$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2749if eval \${$3+:} false; then :
c971b7fa
PA
2750 $as_echo_n "(cached) " >&6
2751else
2752 eval "$3=\$ac_header_compiler"
2753fi
2754eval ac_res=\$$3
2755 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2756$as_echo "$ac_res" >&6; }
2757fi
d0ac1c44 2758 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
c971b7fa
PA
2759
2760} # ac_fn_c_check_header_mongrel
2761
2762# ac_fn_c_try_run LINENO
2763# ----------------------
2764# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
2765# that executables *can* be run.
2766ac_fn_c_try_run ()
2767{
2768 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2769 if { { ac_try="$ac_link"
2770case "(($ac_try" in
2771 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2772 *) ac_try_echo=$ac_try;;
2773esac
2774eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2775$as_echo "$ac_try_echo"; } >&5
2776 (eval "$ac_link") 2>&5
2777 ac_status=$?
2778 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2779 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
2780 { { case "(($ac_try" in
2781 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2782 *) ac_try_echo=$ac_try;;
2783esac
2784eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2785$as_echo "$ac_try_echo"; } >&5
2786 (eval "$ac_try") 2>&5
2787 ac_status=$?
2788 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2789 test $ac_status = 0; }; }; then :
2790 ac_retval=0
2791else
2792 $as_echo "$as_me: program exited with status $ac_status" >&5
2793 $as_echo "$as_me: failed program was:" >&5
2794sed 's/^/| /' conftest.$ac_ext >&5
2795
2796 ac_retval=$ac_status
2797fi
2798 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
d0ac1c44
SM
2799 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2800 as_fn_set_status $ac_retval
c971b7fa
PA
2801
2802} # ac_fn_c_try_run
2803
2804# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
2805# -------------------------------------------------------
2806# Tests whether HEADER exists and can be compiled using the include files in
2807# INCLUDES, setting the cache variable VAR accordingly.
2808ac_fn_c_check_header_compile ()
2809{
2810 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2811 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2812$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2813if eval \${$3+:} false; then :
c971b7fa
PA
2814 $as_echo_n "(cached) " >&6
2815else
2816 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2817/* end confdefs.h. */
2818$4
2819#include <$2>
2820_ACEOF
2821if ac_fn_c_try_compile "$LINENO"; then :
2822 eval "$3=yes"
2823else
2824 eval "$3=no"
2825fi
2826rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2827fi
2828eval ac_res=\$$3
2829 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2830$as_echo "$ac_res" >&6; }
d0ac1c44 2831 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
c971b7fa
PA
2832
2833} # ac_fn_c_check_header_compile
2834
73cc7272
TT
2835# ac_fn_c_try_link LINENO
2836# -----------------------
2837# Try to link conftest.$ac_ext, and return whether this succeeded.
2838ac_fn_c_try_link ()
2839{
2840 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2841 rm -f conftest.$ac_objext conftest$ac_exeext
2842 if { { ac_try="$ac_link"
2843case "(($ac_try" in
2844 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2845 *) ac_try_echo=$ac_try;;
2846esac
2847eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2848$as_echo "$ac_try_echo"; } >&5
2849 (eval "$ac_link") 2>conftest.err
2850 ac_status=$?
2851 if test -s conftest.err; then
2852 grep -v '^ *+' conftest.err >conftest.er1
2853 cat conftest.er1 >&5
2854 mv -f conftest.er1 conftest.err
2855 fi
2856 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2857 test $ac_status = 0; } && {
2858 test -z "$ac_c_werror_flag" ||
2859 test ! -s conftest.err
2860 } && test -s conftest$ac_exeext && {
2861 test "$cross_compiling" = yes ||
2862 test -x conftest$ac_exeext
2863 }; then :
2864 ac_retval=0
2865else
2866 $as_echo "$as_me: failed program was:" >&5
2867sed 's/^/| /' conftest.$ac_ext >&5
2868
2869 ac_retval=1
2870fi
2871 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
2872 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
2873 # interfere with the next link command; also delete a directory that is
2874 # left behind by Apple's compiler. We do this before executing the actions.
2875 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2876 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2877 as_fn_set_status $ac_retval
2878
2879} # ac_fn_c_try_link
2880
d0ac1c44
SM
2881# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2882# -------------------------------------------
2883# Tests whether TYPE exists after having included INCLUDES, setting cache
2884# variable VAR accordingly.
2885ac_fn_c_check_type ()
2886{
2887 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2888 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2889$as_echo_n "checking for $2... " >&6; }
2890if eval \${$3+:} false; then :
2891 $as_echo_n "(cached) " >&6
2892else
2893 eval "$3=no"
2894 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2895/* end confdefs.h. */
2896$4
2897int
2898main ()
2899{
2900if (sizeof ($2))
2901 return 0;
2902 ;
2903 return 0;
2904}
2905_ACEOF
2906if ac_fn_c_try_compile "$LINENO"; then :
2907 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2908/* end confdefs.h. */
2909$4
2910int
2911main ()
2912{
2913if (sizeof (($2)))
2914 return 0;
2915 ;
2916 return 0;
2917}
2918_ACEOF
2919if ac_fn_c_try_compile "$LINENO"; then :
2920
2921else
2922 eval "$3=yes"
2923fi
2924rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2925fi
2926rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2927fi
2928eval ac_res=\$$3
2929 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2930$as_echo "$ac_res" >&6; }
2931 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2932
2933} # ac_fn_c_check_type
2934
8690e634
JK
2935# ac_fn_c_check_func LINENO FUNC VAR
2936# ----------------------------------
2937# Tests whether FUNC exists, setting the cache variable VAR accordingly
2938ac_fn_c_check_func ()
2939{
2940 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2941 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2942$as_echo_n "checking for $2... " >&6; }
d0ac1c44 2943if eval \${$3+:} false; then :
8690e634
JK
2944 $as_echo_n "(cached) " >&6
2945else
2946 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2947/* end confdefs.h. */
2948/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
2949 For example, HP-UX 11i <limits.h> declares gettimeofday. */
2950#define $2 innocuous_$2
2951
2952/* System header to define __stub macros and hopefully few prototypes,
2953 which can conflict with char $2 (); below.
2954 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
2955 <limits.h> exists even on freestanding compilers. */
2956
2957#ifdef __STDC__
2958# include <limits.h>
2959#else
2960# include <assert.h>
2961#endif
2962
2963#undef $2
2964
2965/* Override any GCC internal prototype to avoid an error.
2966 Use char because int might match the return type of a GCC
2967 builtin and then its argument prototype would still apply. */
2968#ifdef __cplusplus
2969extern "C"
2970#endif
2971char $2 ();
2972/* The GNU C library defines this for functions which it implements
2973 to always fail with ENOSYS. Some functions are actually named
2974 something starting with __ and the normal name is an alias. */
2975#if defined __stub_$2 || defined __stub___$2
2976choke me
2977#endif
2978
2979int
2980main ()
2981{
2982return $2 ();
2983 ;
2984 return 0;
2985}
2986_ACEOF
2987if ac_fn_c_try_link "$LINENO"; then :
2988 eval "$3=yes"
2989else
2990 eval "$3=no"
2991fi
2992rm -f core conftest.err conftest.$ac_objext \
2993 conftest$ac_exeext conftest.$ac_ext
2994fi
2995eval ac_res=\$$3
2996 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2997$as_echo "$ac_res" >&6; }
d0ac1c44 2998 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
8690e634
JK
2999
3000} # ac_fn_c_check_func
3001
d0ac1c44
SM
3002# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
3003# ---------------------------------------------
3004# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
3005# accordingly.
8986e351
TT
3006ac_fn_c_check_decl ()
3007{
3008 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
d0ac1c44
SM
3009 as_decl_name=`echo $2|sed 's/ *(.*//'`
3010 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
3011 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
3012$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
3013if eval \${$3+:} false; then :
8986e351
TT
3014 $as_echo_n "(cached) " >&6
3015else
3016 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3017/* end confdefs.h. */
3018$4
3019int
3020main ()
3021{
d0ac1c44
SM
3022#ifndef $as_decl_name
3023#ifdef __cplusplus
3024 (void) $as_decl_use;
3025#else
3026 (void) $as_decl_name;
3027#endif
8986e351
TT
3028#endif
3029
3030 ;
3031 return 0;
3032}
3033_ACEOF
3034if ac_fn_c_try_compile "$LINENO"; then :
3035 eval "$3=yes"
3036else
3037 eval "$3=no"
3038fi
3039rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3040fi
3041eval ac_res=\$$3
3042 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3043$as_echo "$ac_res" >&6; }
d0ac1c44 3044 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
8986e351
TT
3045
3046} # ac_fn_c_check_decl
3047
c971b7fa
PA
3048# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
3049# --------------------------------------------
3050# Tries to find the compile-time value of EXPR in a program that includes
3051# INCLUDES, setting VAR accordingly. Returns whether the value could be
3052# computed
3053ac_fn_c_compute_int ()
3054{
3055 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3056 if test "$cross_compiling" = yes; then
3057 # Depending upon the size, compute the lo and hi bounds.
3058cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3059/* end confdefs.h. */
3060$4
3061int
3062main ()
3063{
3064static int test_array [1 - 2 * !(($2) >= 0)];
d0ac1c44
SM
3065test_array [0] = 0;
3066return test_array [0];
c971b7fa
PA
3067
3068 ;
3069 return 0;
3070}
3071_ACEOF
3072if ac_fn_c_try_compile "$LINENO"; then :
3073 ac_lo=0 ac_mid=0
3074 while :; do
3075 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3076/* end confdefs.h. */
3077$4
3078int
3079main ()
3080{
3081static int test_array [1 - 2 * !(($2) <= $ac_mid)];
d0ac1c44
SM
3082test_array [0] = 0;
3083return test_array [0];
c971b7fa
PA
3084
3085 ;
3086 return 0;
3087}
3088_ACEOF
3089if ac_fn_c_try_compile "$LINENO"; then :
3090 ac_hi=$ac_mid; break
3091else
3092 as_fn_arith $ac_mid + 1 && ac_lo=$as_val
3093 if test $ac_lo -le $ac_mid; then
3094 ac_lo= ac_hi=
3095 break
3096 fi
3097 as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
3098fi
3099rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3100 done
3101else
3102 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3103/* end confdefs.h. */
3104$4
3105int
3106main ()
3107{
3108static int test_array [1 - 2 * !(($2) < 0)];
d0ac1c44
SM
3109test_array [0] = 0;
3110return test_array [0];
c971b7fa
PA
3111
3112 ;
3113 return 0;
3114}
3115_ACEOF
3116if ac_fn_c_try_compile "$LINENO"; then :
3117 ac_hi=-1 ac_mid=-1
3118 while :; do
3119 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3120/* end confdefs.h. */
3121$4
3122int
3123main ()
3124{
3125static int test_array [1 - 2 * !(($2) >= $ac_mid)];
d0ac1c44
SM
3126test_array [0] = 0;
3127return test_array [0];
c971b7fa
PA
3128
3129 ;
3130 return 0;
3131}
3132_ACEOF
3133if ac_fn_c_try_compile "$LINENO"; then :
3134 ac_lo=$ac_mid; break
3135else
3136 as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
3137 if test $ac_mid -le $ac_hi; then
3138 ac_lo= ac_hi=
3139 break
3140 fi
3141 as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
3142fi
3143rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3144 done
3145else
3146 ac_lo= ac_hi=
3147fi
3148rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3149fi
3150rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3151# Binary search between lo and hi bounds.
3152while test "x$ac_lo" != "x$ac_hi"; do
3153 as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
3154 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3155/* end confdefs.h. */
3156$4
3157int
3158main ()
3159{
3160static int test_array [1 - 2 * !(($2) <= $ac_mid)];
d0ac1c44
SM
3161test_array [0] = 0;
3162return test_array [0];
c971b7fa
PA
3163
3164 ;
3165 return 0;
3166}
3167_ACEOF
3168if ac_fn_c_try_compile "$LINENO"; then :
3169 ac_hi=$ac_mid
3170else
3171 as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
3172fi
3173rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3174done
3175case $ac_lo in #((
3176?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
3177'') ac_retval=1 ;;
3178esac
3179 else
3180 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3181/* end confdefs.h. */
3182$4
3183static long int longval () { return $2; }
3184static unsigned long int ulongval () { return $2; }
3185#include <stdio.h>
3186#include <stdlib.h>
3187int
3188main ()
3189{
3190
3191 FILE *f = fopen ("conftest.val", "w");
3192 if (! f)
3193 return 1;
3194 if (($2) < 0)
3195 {
3196 long int i = longval ();
3197 if (i != ($2))
3198 return 1;
3199 fprintf (f, "%ld", i);
3200 }
3201 else
3202 {
3203 unsigned long int i = ulongval ();
3204 if (i != ($2))
3205 return 1;
3206 fprintf (f, "%lu", i);
3207 }
3208 /* Do not output a trailing newline, as this causes \r\n confusion
3209 on some platforms. */
3210 return ferror (f) || fclose (f) != 0;
3211
3212 ;
3213 return 0;
3214}
3215_ACEOF
3216if ac_fn_c_try_run "$LINENO"; then :
3217 echo >>conftest.val; read $3 <conftest.val; ac_retval=0
3218else
3219 ac_retval=1
3220fi
3221rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
3222 conftest.$ac_objext conftest.beam conftest.$ac_ext
3223rm -f conftest.val
3224
3225 fi
d0ac1c44
SM
3226 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3227 as_fn_set_status $ac_retval
c971b7fa
PA
3228
3229} # ac_fn_c_compute_int
725e2999
JB
3230
3231# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
3232# ----------------------------------------------------
3233# Tries to find if the field MEMBER exists in type AGGR, after including
3234# INCLUDES, setting cache variable VAR accordingly.
3235ac_fn_c_check_member ()
3236{
3237 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3238 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
3239$as_echo_n "checking for $2.$3... " >&6; }
3240if eval \${$4+:} false; then :
3241 $as_echo_n "(cached) " >&6
3242else
3243 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3244/* end confdefs.h. */
3245$5
3246int
3247main ()
3248{
3249static $2 ac_aggr;
3250if (ac_aggr.$3)
3251return 0;
3252 ;
3253 return 0;
3254}
3255_ACEOF
3256if ac_fn_c_try_compile "$LINENO"; then :
3257 eval "$4=yes"
3258else
3259 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3260/* end confdefs.h. */
3261$5
3262int
3263main ()
3264{
3265static $2 ac_aggr;
3266if (sizeof ac_aggr.$3)
3267return 0;
3268 ;
3269 return 0;
3270}
3271_ACEOF
3272if ac_fn_c_try_compile "$LINENO"; then :
3273 eval "$4=yes"
3274else
3275 eval "$4=no"
3276fi
3277rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3278fi
3279rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3280fi
3281eval ac_res=\$$4
3282 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3283$as_echo "$ac_res" >&6; }
3284 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3285
3286} # ac_fn_c_check_member
c971b7fa
PA
3287cat >config.log <<_ACEOF
3288This file contains any messages produced by compilers while
3289running configure, to aid debugging if configure makes a mistake.
3290
d0ac1c44
SM
3291It was created by libgnu $as_me UNUSED-VERSION, which was
3292generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
3293
3294 $ $0 $@
3295
3296_ACEOF
3297exec 5>>config.log
3298{
3299cat <<_ASUNAME
3300## --------- ##
3301## Platform. ##
3302## --------- ##
3303
3304hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
3305uname -m = `(uname -m) 2>/dev/null || echo unknown`
3306uname -r = `(uname -r) 2>/dev/null || echo unknown`
3307uname -s = `(uname -s) 2>/dev/null || echo unknown`
3308uname -v = `(uname -v) 2>/dev/null || echo unknown`
3309
3310/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
3311/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
3312
3313/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
3314/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
3315/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
3316/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
3317/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
3318/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
3319/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
3320
3321_ASUNAME
3322
3323as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3324for as_dir in $PATH
3325do
3326 IFS=$as_save_IFS
3327 test -z "$as_dir" && as_dir=.
3328 $as_echo "PATH: $as_dir"
3329 done
3330IFS=$as_save_IFS
3331
3332} >&5
3333
3334cat >&5 <<_ACEOF
3335
3336
3337## ----------- ##
3338## Core tests. ##
3339## ----------- ##
3340
3341_ACEOF
3342
3343
3344# Keep a trace of the command line.
3345# Strip out --no-create and --no-recursion so they do not pile up.
3346# Strip out --silent because we don't want to record it for future runs.
3347# Also quote any args containing shell meta-characters.
3348# Make two passes to allow for proper duplicate-argument suppression.
3349ac_configure_args=
3350ac_configure_args0=
3351ac_configure_args1=
3352ac_must_keep_next=false
3353for ac_pass in 1 2
3354do
3355 for ac_arg
3356 do
3357 case $ac_arg in
3358 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
3359 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
3360 | -silent | --silent | --silen | --sile | --sil)
3361 continue ;;
3362 *\'*)
3363 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
3364 esac
3365 case $ac_pass in
3366 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
3367 2)
3368 as_fn_append ac_configure_args1 " '$ac_arg'"
3369 if test $ac_must_keep_next = true; then
3370 ac_must_keep_next=false # Got value, back to normal.
3371 else
3372 case $ac_arg in
3373 *=* | --config-cache | -C | -disable-* | --disable-* \
3374 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
3375 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
3376 | -with-* | --with-* | -without-* | --without-* | --x)
3377 case "$ac_configure_args0 " in
3378 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
3379 esac
3380 ;;
3381 -* ) ac_must_keep_next=true ;;
3382 esac
3383 fi
3384 as_fn_append ac_configure_args " '$ac_arg'"
3385 ;;
3386 esac
3387 done
3388done
3389{ ac_configure_args0=; unset ac_configure_args0;}
3390{ ac_configure_args1=; unset ac_configure_args1;}
3391
3392# When interrupted or exit'd, cleanup temporary files, and complete
3393# config.log. We remove comments because anyway the quotes in there
3394# would cause problems or look ugly.
3395# WARNING: Use '\'' to represent an apostrophe within the trap.
3396# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
3397trap 'exit_status=$?
3398 # Save into config.log some information that might help in debugging.
3399 {
3400 echo
3401
d0ac1c44 3402 $as_echo "## ---------------- ##
c971b7fa 3403## Cache variables. ##
d0ac1c44 3404## ---------------- ##"
c971b7fa
PA
3405 echo
3406 # The following way of writing the cache mishandles newlines in values,
3407(
3408 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
3409 eval ac_val=\$$ac_var
3410 case $ac_val in #(
3411 *${as_nl}*)
3412 case $ac_var in #(
3413 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
3414$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
3415 esac
3416 case $ac_var in #(
3417 _ | IFS | as_nl) ;; #(
3418 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
3419 *) { eval $ac_var=; unset $ac_var;} ;;
3420 esac ;;
3421 esac
3422 done
3423 (set) 2>&1 |
3424 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
3425 *${as_nl}ac_space=\ *)
3426 sed -n \
3427 "s/'\''/'\''\\\\'\'''\''/g;
3428 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
3429 ;; #(
3430 *)
3431 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
3432 ;;
3433 esac |
3434 sort
3435)
3436 echo
3437
d0ac1c44 3438 $as_echo "## ----------------- ##
c971b7fa 3439## Output variables. ##
d0ac1c44 3440## ----------------- ##"
c971b7fa
PA
3441 echo
3442 for ac_var in $ac_subst_vars
3443 do
3444 eval ac_val=\$$ac_var
3445 case $ac_val in
3446 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3447 esac
3448 $as_echo "$ac_var='\''$ac_val'\''"
3449 done | sort
3450 echo
3451
3452 if test -n "$ac_subst_files"; then
d0ac1c44 3453 $as_echo "## ------------------- ##
c971b7fa 3454## File substitutions. ##
d0ac1c44 3455## ------------------- ##"
c971b7fa
PA
3456 echo
3457 for ac_var in $ac_subst_files
3458 do
3459 eval ac_val=\$$ac_var
3460 case $ac_val in
3461 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3462 esac
3463 $as_echo "$ac_var='\''$ac_val'\''"
3464 done | sort
3465 echo
3466 fi
3467
3468 if test -s confdefs.h; then
d0ac1c44 3469 $as_echo "## ----------- ##
c971b7fa 3470## confdefs.h. ##
d0ac1c44 3471## ----------- ##"
c971b7fa
PA
3472 echo
3473 cat confdefs.h
3474 echo
3475 fi
3476 test "$ac_signal" != 0 &&
3477 $as_echo "$as_me: caught signal $ac_signal"
3478 $as_echo "$as_me: exit $exit_status"
3479 } >&5
3480 rm -f core *.core core.conftest.* &&
3481 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
3482 exit $exit_status
3483' 0
3484for ac_signal in 1 2 13 15; do
3485 trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
3486done
3487ac_signal=0
3488
3489# confdefs.h avoids OS command line length limits that DEFS can exceed.
3490rm -f -r conftest* confdefs.h
3491
3492$as_echo "/* confdefs.h */" > confdefs.h
3493
3494# Predefined preprocessor variables.
3495
3496cat >>confdefs.h <<_ACEOF
3497#define PACKAGE_NAME "$PACKAGE_NAME"
3498_ACEOF
3499
3500cat >>confdefs.h <<_ACEOF
3501#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
3502_ACEOF
3503
3504cat >>confdefs.h <<_ACEOF
3505#define PACKAGE_VERSION "$PACKAGE_VERSION"
3506_ACEOF
3507
3508cat >>confdefs.h <<_ACEOF
3509#define PACKAGE_STRING "$PACKAGE_STRING"
3510_ACEOF
3511
3512cat >>confdefs.h <<_ACEOF
3513#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
3514_ACEOF
3515
3516cat >>confdefs.h <<_ACEOF
3517#define PACKAGE_URL "$PACKAGE_URL"
3518_ACEOF
3519
3520
3521# Let the site file select an alternate cache file if it wants to.
3522# Prefer an explicitly selected file to automatically selected ones.
3523ac_site_file1=NONE
3524ac_site_file2=NONE
3525if test -n "$CONFIG_SITE"; then
d0ac1c44
SM
3526 # We do not want a PATH search for config.site.
3527 case $CONFIG_SITE in #((
3528 -*) ac_site_file1=./$CONFIG_SITE;;
3529 */*) ac_site_file1=$CONFIG_SITE;;
3530 *) ac_site_file1=./$CONFIG_SITE;;
3531 esac
c971b7fa
PA
3532elif test "x$prefix" != xNONE; then
3533 ac_site_file1=$prefix/share/config.site
3534 ac_site_file2=$prefix/etc/config.site
3535else
3536 ac_site_file1=$ac_default_prefix/share/config.site
3537 ac_site_file2=$ac_default_prefix/etc/config.site
3538fi
3539for ac_site_file in "$ac_site_file1" "$ac_site_file2"
3540do
3541 test "x$ac_site_file" = xNONE && continue
d0ac1c44 3542 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
c971b7fa
PA
3543 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
3544$as_echo "$as_me: loading site script $ac_site_file" >&6;}
3545 sed 's/^/| /' "$ac_site_file" >&5
d0ac1c44
SM
3546 . "$ac_site_file" \
3547 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3548$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3549as_fn_error $? "failed to load site script $ac_site_file
3550See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
3551 fi
3552done
3553
3554if test -r "$cache_file"; then
d0ac1c44
SM
3555 # Some versions of bash will fail to source /dev/null (special files
3556 # actually), so we avoid doing that. DJGPP emulates it as a regular file.
3557 if test /dev/null != "$cache_file" && test -f "$cache_file"; then
c971b7fa
PA
3558 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
3559$as_echo "$as_me: loading cache $cache_file" >&6;}
3560 case $cache_file in
3561 [\\/]* | ?:[\\/]* ) . "$cache_file";;
3562 *) . "./$cache_file";;
3563 esac
3564 fi
3565else
3566 { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
3567$as_echo "$as_me: creating cache $cache_file" >&6;}
3568 >$cache_file
3569fi
3570
c0c3707f
CB
3571as_fn_append ac_header_list " arpa/inet.h"
3572as_fn_append ac_header_list " features.h"
3573as_fn_append ac_header_list " sys/socket.h"
3574as_fn_append ac_func_list " canonicalize_file_name"
3575as_fn_append ac_func_list " getcwd"
3576as_fn_append ac_func_list " readlink"
3577as_fn_append ac_func_list " realpath"
3578as_fn_append ac_header_list " sys/param.h"
3579as_fn_append ac_header_list " unistd.h"
3580as_fn_append ac_func_list " _set_invalid_parameter_handler"
3581as_fn_append ac_func_list " fchdir"
3582as_fn_append ac_header_list " dirent.h"
3583as_fn_append ac_func_list " fcntl"
3584as_fn_append ac_func_list " symlink"
3585as_fn_append ac_func_list " fdopendir"
3586as_fn_append ac_func_list " mempcpy"
3587as_fn_append ac_header_list " fnmatch.h"
3588as_fn_append ac_func_list " fnmatch"
3589as_fn_append ac_func_list " btowc"
3590as_fn_append ac_func_list " isblank"
3591as_fn_append ac_func_list " iswctype"
3592as_fn_append ac_func_list " mbsrtowcs"
3593as_fn_append ac_func_list " wmemchr"
3594as_fn_append ac_func_list " wmemcpy"
3595as_fn_append ac_func_list " wmempcpy"
3596as_fn_append ac_header_list " wctype.h"
8690e634 3597gl_fnmatch_required=GNU
c0c3707f
CB
3598as_fn_append ac_header_list " sys/stat.h"
3599as_fn_append ac_func_list " fstatat"
3600as_fn_append ac_func_list " getdtablesize"
3601as_fn_append ac_func_list " getlogin_r"
3602as_fn_append ac_func_list " getprogname"
3603as_fn_append ac_func_list " getexecname"
3604as_fn_append ac_header_list " sys/time.h"
3605as_fn_append ac_func_list " gettimeofday"
3606as_fn_append ac_header_list " glob.h"
3607as_fn_append ac_func_list " glob"
3608as_fn_append ac_func_list " glob_pattern_p"
3609as_fn_append ac_func_list " getpwnam_r"
3610as_fn_append ac_header_list " netdb.h"
3611as_fn_append ac_header_list " netinet/in.h"
3612as_fn_append ac_header_list " limits.h"
3613as_fn_append ac_header_list " wchar.h"
3614as_fn_append ac_header_list " stdint.h"
3615as_fn_append ac_header_list " inttypes.h"
3616as_fn_append ac_header_list " threads.h"
3617as_fn_append ac_func_list " lstat"
3618as_fn_append ac_header_list " math.h"
3619as_fn_append ac_func_list " mbsinit"
3620as_fn_append ac_func_list " mbrtowc"
3621as_fn_append ac_header_list " sys/mman.h"
3622as_fn_append ac_func_list " mprotect"
3623as_fn_append ac_func_list " mkostemp"
3624as_fn_append ac_func_list " openat"
3625as_fn_append ac_func_list " link"
3626as_fn_append ac_func_list " setenv"
3627as_fn_append ac_func_list " strdup"
3628as_fn_append ac_func_list " strerror_r"
3629as_fn_append ac_func_list " __xpg_strerror_r"
3630as_fn_append ac_func_list " catgets"
3631as_fn_append ac_func_list " snprintf"
3632as_fn_append ac_header_list " sys/uio.h"
3633as_fn_append ac_func_list " localtime_r"
3634as_fn_append ac_func_list " pipe"
3635as_fn_append ac_header_list " crtdefs.h"
3636as_fn_append ac_func_list " iswcntrl"
c971b7fa
PA
3637# Check that the precious variables saved in the cache have kept the same
3638# value.
3639ac_cache_corrupted=false
3640for ac_var in $ac_precious_vars; do
3641 eval ac_old_set=\$ac_cv_env_${ac_var}_set
3642 eval ac_new_set=\$ac_env_${ac_var}_set
3643 eval ac_old_val=\$ac_cv_env_${ac_var}_value
3644 eval ac_new_val=\$ac_env_${ac_var}_value
3645 case $ac_old_set,$ac_new_set in
3646 set,)
3647 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
3648$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
3649 ac_cache_corrupted=: ;;
3650 ,set)
3651 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
3652$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
3653 ac_cache_corrupted=: ;;
3654 ,);;
3655 *)
3656 if test "x$ac_old_val" != "x$ac_new_val"; then
3657 # differences in whitespace do not lead to failure.
3658 ac_old_val_w=`echo x $ac_old_val`
3659 ac_new_val_w=`echo x $ac_new_val`
3660 if test "$ac_old_val_w" != "$ac_new_val_w"; then
3661 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
3662$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
3663 ac_cache_corrupted=:
3664 else
3665 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
3666$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
3667 eval $ac_var=\$ac_old_val
3668 fi
3669 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
3670$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
3671 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
3672$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
3673 fi;;
3674 esac
3675 # Pass precious variables to config.status.
3676 if test "$ac_new_set" = set; then
3677 case $ac_new_val in
3678 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
3679 *) ac_arg=$ac_var=$ac_new_val ;;
3680 esac
3681 case " $ac_configure_args " in
3682 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
3683 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
3684 esac
3685 fi
3686done
3687if $ac_cache_corrupted; then
3688 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3689$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3690 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
3691$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
d0ac1c44 3692 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
c971b7fa
PA
3693fi
3694## -------------------- ##
3695## Main body of script. ##
3696## -------------------- ##
3697
3698ac_ext=c
3699ac_cpp='$CPP $CPPFLAGS'
3700ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3701ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3702ac_compiler_gnu=$ac_cv_c_compiler_gnu
3703
3704
d0ac1c44 3705
73cc7272
TT
3706
3707
3708
c971b7fa
PA
3709ac_config_headers="$ac_config_headers config.h:config.in"
3710
3711
5abebf3c
CB
3712
3713
c971b7fa
PA
3714{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
3715$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
3716 # Check whether --enable-maintainer-mode was given.
3717if test "${enable_maintainer_mode+set}" = set; then :
3718 enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
3719else
3720 USE_MAINTAINER_MODE=no
3721fi
3722
3723 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
3724$as_echo "$USE_MAINTAINER_MODE" >&6; }
3725 if test $USE_MAINTAINER_MODE = yes; then
3726 MAINTAINER_MODE_TRUE=
3727 MAINTAINER_MODE_FALSE='#'
3728else
3729 MAINTAINER_MODE_TRUE='#'
3730 MAINTAINER_MODE_FALSE=
3731fi
3732
3733 MAINT=$MAINTAINER_MODE_TRUE
3734
3735
3736
3737ac_ext=c
3738ac_cpp='$CPP $CPPFLAGS'
3739ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3740ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3741ac_compiler_gnu=$ac_cv_c_compiler_gnu
3742if test -n "$ac_tool_prefix"; then
3743 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
3744set dummy ${ac_tool_prefix}gcc; ac_word=$2
3745{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3746$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3747if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3748 $as_echo_n "(cached) " >&6
3749else
3750 if test -n "$CC"; then
3751 ac_cv_prog_CC="$CC" # Let the user override the test.
3752else
3753as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3754for as_dir in $PATH
3755do
3756 IFS=$as_save_IFS
3757 test -z "$as_dir" && as_dir=.
3758 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3759 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3760 ac_cv_prog_CC="${ac_tool_prefix}gcc"
3761 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3762 break 2
3763 fi
3764done
3765 done
3766IFS=$as_save_IFS
3767
3768fi
3769fi
3770CC=$ac_cv_prog_CC
3771if test -n "$CC"; then
3772 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3773$as_echo "$CC" >&6; }
3774else
3775 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3776$as_echo "no" >&6; }
3777fi
3778
3779
3780fi
3781if test -z "$ac_cv_prog_CC"; then
3782 ac_ct_CC=$CC
3783 # Extract the first word of "gcc", so it can be a program name with args.
3784set dummy gcc; ac_word=$2
3785{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3786$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3787if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
3788 $as_echo_n "(cached) " >&6
3789else
3790 if test -n "$ac_ct_CC"; then
3791 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3792else
3793as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3794for as_dir in $PATH
3795do
3796 IFS=$as_save_IFS
3797 test -z "$as_dir" && as_dir=.
3798 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3799 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3800 ac_cv_prog_ac_ct_CC="gcc"
3801 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3802 break 2
3803 fi
3804done
3805 done
3806IFS=$as_save_IFS
3807
3808fi
3809fi
3810ac_ct_CC=$ac_cv_prog_ac_ct_CC
3811if test -n "$ac_ct_CC"; then
3812 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3813$as_echo "$ac_ct_CC" >&6; }
3814else
3815 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3816$as_echo "no" >&6; }
3817fi
3818
3819 if test "x$ac_ct_CC" = x; then
3820 CC=""
3821 else
3822 case $cross_compiling:$ac_tool_warned in
3823yes:)
3824{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3825$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3826ac_tool_warned=yes ;;
3827esac
3828 CC=$ac_ct_CC
3829 fi
3830else
3831 CC="$ac_cv_prog_CC"
3832fi
3833
3834if test -z "$CC"; then
3835 if test -n "$ac_tool_prefix"; then
3836 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
3837set dummy ${ac_tool_prefix}cc; ac_word=$2
3838{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3839$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3840if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3841 $as_echo_n "(cached) " >&6
3842else
3843 if test -n "$CC"; then
3844 ac_cv_prog_CC="$CC" # Let the user override the test.
3845else
3846as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3847for as_dir in $PATH
3848do
3849 IFS=$as_save_IFS
3850 test -z "$as_dir" && as_dir=.
3851 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3852 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3853 ac_cv_prog_CC="${ac_tool_prefix}cc"
3854 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3855 break 2
3856 fi
3857done
3858 done
3859IFS=$as_save_IFS
3860
3861fi
3862fi
3863CC=$ac_cv_prog_CC
3864if test -n "$CC"; then
3865 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3866$as_echo "$CC" >&6; }
3867else
3868 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3869$as_echo "no" >&6; }
3870fi
3871
3872
3873 fi
3874fi
3875if test -z "$CC"; then
3876 # Extract the first word of "cc", so it can be a program name with args.
3877set dummy cc; ac_word=$2
3878{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3879$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3880if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3881 $as_echo_n "(cached) " >&6
3882else
3883 if test -n "$CC"; then
3884 ac_cv_prog_CC="$CC" # Let the user override the test.
3885else
3886 ac_prog_rejected=no
3887as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3888for as_dir in $PATH
3889do
3890 IFS=$as_save_IFS
3891 test -z "$as_dir" && as_dir=.
3892 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3893 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3894 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3895 ac_prog_rejected=yes
3896 continue
3897 fi
3898 ac_cv_prog_CC="cc"
3899 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3900 break 2
3901 fi
3902done
3903 done
3904IFS=$as_save_IFS
3905
3906if test $ac_prog_rejected = yes; then
3907 # We found a bogon in the path, so make sure we never use it.
3908 set dummy $ac_cv_prog_CC
3909 shift
3910 if test $# != 0; then
3911 # We chose a different compiler from the bogus one.
3912 # However, it has the same basename, so the bogon will be chosen
3913 # first if we set CC to just the basename; use the full file name.
3914 shift
3915 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
3916 fi
3917fi
3918fi
3919fi
3920CC=$ac_cv_prog_CC
3921if test -n "$CC"; then
3922 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3923$as_echo "$CC" >&6; }
3924else
3925 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3926$as_echo "no" >&6; }
3927fi
3928
3929
3930fi
3931if test -z "$CC"; then
3932 if test -n "$ac_tool_prefix"; then
3933 for ac_prog in cl.exe
3934 do
3935 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3936set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3937{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3938$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3939if ${ac_cv_prog_CC+:} false; then :
c971b7fa
PA
3940 $as_echo_n "(cached) " >&6
3941else
3942 if test -n "$CC"; then
3943 ac_cv_prog_CC="$CC" # Let the user override the test.
3944else
3945as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3946for as_dir in $PATH
3947do
3948 IFS=$as_save_IFS
3949 test -z "$as_dir" && as_dir=.
3950 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3951 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3952 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3953 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3954 break 2
3955 fi
3956done
3957 done
3958IFS=$as_save_IFS
3959
3960fi
3961fi
3962CC=$ac_cv_prog_CC
3963if test -n "$CC"; then
3964 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3965$as_echo "$CC" >&6; }
3966else
3967 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3968$as_echo "no" >&6; }
3969fi
3970
3971
3972 test -n "$CC" && break
3973 done
3974fi
3975if test -z "$CC"; then
3976 ac_ct_CC=$CC
3977 for ac_prog in cl.exe
3978do
3979 # Extract the first word of "$ac_prog", so it can be a program name with args.
3980set dummy $ac_prog; ac_word=$2
3981{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3982$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 3983if ${ac_cv_prog_ac_ct_CC+:} false; then :
c971b7fa
PA
3984 $as_echo_n "(cached) " >&6
3985else
3986 if test -n "$ac_ct_CC"; then
3987 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3988else
3989as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3990for as_dir in $PATH
3991do
3992 IFS=$as_save_IFS
3993 test -z "$as_dir" && as_dir=.
3994 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 3995 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
3996 ac_cv_prog_ac_ct_CC="$ac_prog"
3997 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3998 break 2
3999 fi
4000done
4001 done
4002IFS=$as_save_IFS
4003
4004fi
4005fi
4006ac_ct_CC=$ac_cv_prog_ac_ct_CC
4007if test -n "$ac_ct_CC"; then
4008 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4009$as_echo "$ac_ct_CC" >&6; }
4010else
4011 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4012$as_echo "no" >&6; }
4013fi
4014
4015
4016 test -n "$ac_ct_CC" && break
4017done
4018
4019 if test "x$ac_ct_CC" = x; then
4020 CC=""
4021 else
4022 case $cross_compiling:$ac_tool_warned in
4023yes:)
4024{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4025$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4026ac_tool_warned=yes ;;
4027esac
4028 CC=$ac_ct_CC
4029 fi
4030fi
4031
c0c3707f
CB
4032fi
4033if test -z "$CC"; then
4034 if test -n "$ac_tool_prefix"; then
4035 # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
4036set dummy ${ac_tool_prefix}clang; ac_word=$2
4037{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4038$as_echo_n "checking for $ac_word... " >&6; }
4039if ${ac_cv_prog_CC+:} false; then :
4040 $as_echo_n "(cached) " >&6
4041else
4042 if test -n "$CC"; then
4043 ac_cv_prog_CC="$CC" # Let the user override the test.
4044else
4045as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4046for as_dir in $PATH
4047do
4048 IFS=$as_save_IFS
4049 test -z "$as_dir" && as_dir=.
4050 for ac_exec_ext in '' $ac_executable_extensions; do
4051 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4052 ac_cv_prog_CC="${ac_tool_prefix}clang"
4053 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4054 break 2
4055 fi
4056done
4057 done
4058IFS=$as_save_IFS
4059
4060fi
4061fi
4062CC=$ac_cv_prog_CC
4063if test -n "$CC"; then
4064 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4065$as_echo "$CC" >&6; }
4066else
4067 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4068$as_echo "no" >&6; }
4069fi
4070
4071
4072fi
4073if test -z "$ac_cv_prog_CC"; then
4074 ac_ct_CC=$CC
4075 # Extract the first word of "clang", so it can be a program name with args.
4076set dummy clang; 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; }
4079if ${ac_cv_prog_ac_ct_CC+:} false; then :
4080 $as_echo_n "(cached) " >&6
4081else
4082 if test -n "$ac_ct_CC"; then
4083 ac_cv_prog_ac_ct_CC="$ac_ct_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
4091 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4092 ac_cv_prog_ac_ct_CC="clang"
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
4102ac_ct_CC=$ac_cv_prog_ac_ct_CC
4103if test -n "$ac_ct_CC"; then
4104 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4105$as_echo "$ac_ct_CC" >&6; }
4106else
4107 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4108$as_echo "no" >&6; }
4109fi
4110
4111 if test "x$ac_ct_CC" = x; then
4112 CC=""
4113 else
4114 case $cross_compiling:$ac_tool_warned in
4115yes:)
4116{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4117$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4118ac_tool_warned=yes ;;
4119esac
4120 CC=$ac_ct_CC
4121 fi
4122else
4123 CC="$ac_cv_prog_CC"
4124fi
4125
c971b7fa
PA
4126fi
4127
4128
4129test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4130$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4131as_fn_error $? "no acceptable C compiler found in \$PATH
4132See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4133
4134# Provide some information about the compiler.
4135$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
4136set X $ac_compile
4137ac_compiler=$2
c0c3707f 4138for ac_option in --version -v -V -qversion -version; do
c971b7fa
PA
4139 { { ac_try="$ac_compiler $ac_option >&5"
4140case "(($ac_try" in
4141 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4142 *) ac_try_echo=$ac_try;;
4143esac
4144eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4145$as_echo "$ac_try_echo"; } >&5
4146 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4147 ac_status=$?
4148 if test -s conftest.err; then
4149 sed '10a\
4150... rest of stderr output deleted ...
4151 10q' conftest.err >conftest.er1
4152 cat conftest.er1 >&5
c971b7fa 4153 fi
d0ac1c44 4154 rm -f conftest.er1 conftest.err
c971b7fa
PA
4155 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4156 test $ac_status = 0; }
4157done
4158
4159cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4160/* end confdefs.h. */
d0ac1c44 4161
c971b7fa
PA
4162int
4163main ()
4164{
c971b7fa
PA
4165
4166 ;
4167 return 0;
4168}
4169_ACEOF
4170ac_clean_files_save=$ac_clean_files
d0ac1c44 4171ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
c971b7fa
PA
4172# Try to create an executable without -o first, disregard a.out.
4173# It will help us diagnose broken compilers, and finding out an intuition
4174# of exeext.
d0ac1c44
SM
4175{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
4176$as_echo_n "checking whether the C compiler works... " >&6; }
c971b7fa
PA
4177ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
4178
4179# The possible output files:
4180ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
4181
4182ac_rmfiles=
4183for ac_file in $ac_files
4184do
4185 case $ac_file in
4186 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4187 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
4188 esac
4189done
4190rm -f $ac_rmfiles
4191
4192if { { ac_try="$ac_link_default"
4193case "(($ac_try" in
4194 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4195 *) ac_try_echo=$ac_try;;
4196esac
4197eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4198$as_echo "$ac_try_echo"; } >&5
4199 (eval "$ac_link_default") 2>&5
4200 ac_status=$?
4201 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4202 test $ac_status = 0; }; then :
4203 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
4204# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
4205# in a Makefile. We should not override ac_cv_exeext if it was cached,
4206# so that the user can short-circuit this test for compilers unknown to
4207# Autoconf.
4208for ac_file in $ac_files ''
4209do
4210 test -f "$ac_file" || continue
4211 case $ac_file in
4212 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
4213 ;;
4214 [ab].out )
4215 # We found the default executable, but exeext='' is most
4216 # certainly right.
4217 break;;
4218 *.* )
4219 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
4220 then :; else
4221 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4222 fi
4223 # We set ac_cv_exeext here because the later test for it is not
4224 # safe: cross compilers may not add the suffix if given an `-o'
4225 # argument, so we may need to know it at that point already.
4226 # Even if this section looks crufty: it has the advantage of
4227 # actually working.
4228 break;;
4229 * )
4230 break;;
4231 esac
4232done
4233test "$ac_cv_exeext" = no && ac_cv_exeext=
4234
4235else
4236 ac_file=''
4237fi
c971b7fa 4238if test -z "$ac_file"; then :
d0ac1c44
SM
4239 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4240$as_echo "no" >&6; }
4241$as_echo "$as_me: failed program was:" >&5
c971b7fa
PA
4242sed 's/^/| /' conftest.$ac_ext >&5
4243
4244{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4245$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4246as_fn_error 77 "C compiler cannot create executables
4247See \`config.log' for more details" "$LINENO" 5; }
4248else
4249 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4250$as_echo "yes" >&6; }
c971b7fa 4251fi
d0ac1c44
SM
4252{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
4253$as_echo_n "checking for C compiler default output file name... " >&6; }
4254{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
4255$as_echo "$ac_file" >&6; }
c971b7fa
PA
4256ac_exeext=$ac_cv_exeext
4257
d0ac1c44 4258rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
c971b7fa 4259ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4260{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
4261$as_echo_n "checking for suffix of executables... " >&6; }
4262if { { ac_try="$ac_link"
4263case "(($ac_try" in
4264 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4265 *) ac_try_echo=$ac_try;;
4266esac
4267eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4268$as_echo "$ac_try_echo"; } >&5
4269 (eval "$ac_link") 2>&5
4270 ac_status=$?
4271 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4272 test $ac_status = 0; }; then :
4273 # If both `conftest.exe' and `conftest' are `present' (well, observable)
4274# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
4275# work properly (i.e., refer to `conftest.exe'), while it won't with
4276# `rm'.
4277for ac_file in conftest.exe conftest conftest.*; do
4278 test -f "$ac_file" || continue
4279 case $ac_file in
4280 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4281 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4282 break;;
4283 * ) break;;
4284 esac
4285done
4286else
4287 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4288$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4289as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4290See \`config.log' for more details" "$LINENO" 5; }
c971b7fa 4291fi
d0ac1c44 4292rm -f conftest conftest$ac_cv_exeext
c971b7fa
PA
4293{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4294$as_echo "$ac_cv_exeext" >&6; }
4295
4296rm -f conftest.$ac_ext
4297EXEEXT=$ac_cv_exeext
4298ac_exeext=$EXEEXT
d0ac1c44
SM
4299cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4300/* end confdefs.h. */
4301#include <stdio.h>
4302int
4303main ()
4304{
4305FILE *f = fopen ("conftest.out", "w");
4306 return ferror (f) || fclose (f) != 0;
4307
4308 ;
4309 return 0;
4310}
4311_ACEOF
4312ac_clean_files="$ac_clean_files conftest.out"
4313# Check that the compiler produces executables we can run. If not, either
4314# the compiler is broken, or we cross compile.
4315{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4316$as_echo_n "checking whether we are cross compiling... " >&6; }
4317if test "$cross_compiling" != yes; then
4318 { { ac_try="$ac_link"
4319case "(($ac_try" in
4320 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4321 *) ac_try_echo=$ac_try;;
4322esac
4323eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4324$as_echo "$ac_try_echo"; } >&5
4325 (eval "$ac_link") 2>&5
4326 ac_status=$?
4327 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4328 test $ac_status = 0; }
4329 if { ac_try='./conftest$ac_cv_exeext'
4330 { { case "(($ac_try" in
4331 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4332 *) ac_try_echo=$ac_try;;
4333esac
4334eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4335$as_echo "$ac_try_echo"; } >&5
4336 (eval "$ac_try") 2>&5
4337 ac_status=$?
4338 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4339 test $ac_status = 0; }; }; then
4340 cross_compiling=no
4341 else
4342 if test "$cross_compiling" = maybe; then
4343 cross_compiling=yes
4344 else
4345 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4346$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4347as_fn_error $? "cannot run C compiled programs.
4348If you meant to cross compile, use \`--host'.
4349See \`config.log' for more details" "$LINENO" 5; }
4350 fi
4351 fi
4352fi
4353{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4354$as_echo "$cross_compiling" >&6; }
4355
4356rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4357ac_clean_files=$ac_clean_files_save
c971b7fa
PA
4358{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4359$as_echo_n "checking for suffix of object files... " >&6; }
d0ac1c44 4360if ${ac_cv_objext+:} false; then :
c971b7fa
PA
4361 $as_echo_n "(cached) " >&6
4362else
4363 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4364/* end confdefs.h. */
4365
4366int
4367main ()
4368{
4369
4370 ;
4371 return 0;
4372}
4373_ACEOF
4374rm -f conftest.o conftest.obj
4375if { { ac_try="$ac_compile"
4376case "(($ac_try" in
4377 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4378 *) ac_try_echo=$ac_try;;
4379esac
4380eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4381$as_echo "$ac_try_echo"; } >&5
4382 (eval "$ac_compile") 2>&5
4383 ac_status=$?
4384 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4385 test $ac_status = 0; }; then :
4386 for ac_file in conftest.o conftest.obj conftest.*; do
4387 test -f "$ac_file" || continue;
4388 case $ac_file in
4389 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4390 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4391 break;;
4392 esac
4393done
4394else
4395 $as_echo "$as_me: failed program was:" >&5
4396sed 's/^/| /' conftest.$ac_ext >&5
4397
4398{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4399$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
4400as_fn_error $? "cannot compute suffix of object files: cannot compile
4401See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
4402fi
4403rm -f conftest.$ac_cv_objext conftest.$ac_ext
4404fi
4405{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4406$as_echo "$ac_cv_objext" >&6; }
4407OBJEXT=$ac_cv_objext
4408ac_objext=$OBJEXT
4409{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4410$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
d0ac1c44 4411if ${ac_cv_c_compiler_gnu+:} false; then :
c971b7fa
PA
4412 $as_echo_n "(cached) " >&6
4413else
4414 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4415/* end confdefs.h. */
4416
4417int
4418main ()
4419{
4420#ifndef __GNUC__
4421 choke me
4422#endif
4423
4424 ;
4425 return 0;
4426}
4427_ACEOF
4428if ac_fn_c_try_compile "$LINENO"; then :
4429 ac_compiler_gnu=yes
4430else
4431 ac_compiler_gnu=no
4432fi
4433rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4434ac_cv_c_compiler_gnu=$ac_compiler_gnu
4435
4436fi
4437{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4438$as_echo "$ac_cv_c_compiler_gnu" >&6; }
4439if test $ac_compiler_gnu = yes; then
4440 GCC=yes
4441else
4442 GCC=
4443fi
4444ac_test_CFLAGS=${CFLAGS+set}
4445ac_save_CFLAGS=$CFLAGS
4446{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4447$as_echo_n "checking whether $CC accepts -g... " >&6; }
d0ac1c44 4448if ${ac_cv_prog_cc_g+:} false; then :
c971b7fa
PA
4449 $as_echo_n "(cached) " >&6
4450else
4451 ac_save_c_werror_flag=$ac_c_werror_flag
4452 ac_c_werror_flag=yes
4453 ac_cv_prog_cc_g=no
4454 CFLAGS="-g"
4455 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4456/* end confdefs.h. */
4457
4458int
4459main ()
4460{
4461
4462 ;
4463 return 0;
4464}
4465_ACEOF
4466if ac_fn_c_try_compile "$LINENO"; then :
4467 ac_cv_prog_cc_g=yes
4468else
4469 CFLAGS=""
4470 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4471/* end confdefs.h. */
4472
4473int
4474main ()
4475{
4476
4477 ;
4478 return 0;
4479}
4480_ACEOF
4481if ac_fn_c_try_compile "$LINENO"; then :
4482
4483else
4484 ac_c_werror_flag=$ac_save_c_werror_flag
4485 CFLAGS="-g"
4486 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4487/* end confdefs.h. */
4488
4489int
4490main ()
4491{
4492
4493 ;
4494 return 0;
4495}
4496_ACEOF
4497if ac_fn_c_try_compile "$LINENO"; then :
4498 ac_cv_prog_cc_g=yes
4499fi
4500rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4501fi
4502rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4503fi
4504rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4505 ac_c_werror_flag=$ac_save_c_werror_flag
4506fi
4507{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4508$as_echo "$ac_cv_prog_cc_g" >&6; }
4509if test "$ac_test_CFLAGS" = set; then
4510 CFLAGS=$ac_save_CFLAGS
4511elif test $ac_cv_prog_cc_g = yes; then
4512 if test "$GCC" = yes; then
4513 CFLAGS="-g -O2"
4514 else
4515 CFLAGS="-g"
4516 fi
4517else
4518 if test "$GCC" = yes; then
4519 CFLAGS="-O2"
4520 else
4521 CFLAGS=
4522 fi
4523fi
c0c3707f
CB
4524{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
4525$as_echo_n "checking for $CC option to enable C11 features... " >&6; }
4526if ${ac_cv_prog_cc_c11+:} false; then :
c971b7fa
PA
4527 $as_echo_n "(cached) " >&6
4528else
c0c3707f 4529 ac_cv_prog_cc_c11=no
c971b7fa
PA
4530ac_save_CC=$CC
4531cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4532/* end confdefs.h. */
4533#include <stdarg.h>
c0c3707f
CB
4534#include <stdbool.h>
4535#include <stddef.h>
4536#include <stdlib.h>
4537#include <wchar.h>
c971b7fa 4538#include <stdio.h>
c0c3707f
CB
4539
4540// Check varargs macros. These examples are taken from C99 6.10.3.5.
4541#define debug(...) fprintf (stderr, __VA_ARGS__)
4542#define showlist(...) puts (#__VA_ARGS__)
4543#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4544static void
4545test_varargs_macros (void)
7a6dbc2f 4546{
c0c3707f
CB
4547 int x = 1234;
4548 int y = 5678;
4549 debug ("Flag");
4550 debug ("X = %d\n", x);
4551 showlist (The first, second, and third items.);
4552 report (x>y, "x is %d but y is %d", x, y);
c971b7fa 4553}
c0c3707f
CB
4554
4555// Check long long types.
4556#define BIG64 18446744073709551615ull
4557#define BIG32 4294967295ul
4558#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4559#if !BIG_OK
4560 your preprocessor is broken;
4561#endif
4562#if BIG_OK
4563#else
4564 your preprocessor is broken;
4565#endif
4566static long long int bignum = -9223372036854775807LL;
4567static unsigned long long int ubignum = BIG64;
4568
4569struct incomplete_array
7a6dbc2f 4570{
c0c3707f
CB
4571 int datasize;
4572 double data[];
4573};
4574
4575struct named_init {
4576 int number;
4577 const wchar_t *name;
4578 double average;
4579};
4580
4581typedef const char *ccp;
4582
4583static inline int
4584test_restrict (ccp restrict text)
4585{
4586 // See if C++-style comments work.
4587 // Iterate through items via the restricted pointer.
4588 // Also check for declarations in for loops.
4589 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4590 continue;
4591 return 0;
7a6dbc2f 4592}
7a6dbc2f 4593
c0c3707f
CB
4594// Check varargs and va_copy.
4595static bool
4596test_varargs (const char *format, ...)
4597{
4598 va_list args;
4599 va_start (args, format);
4600 va_list args_copy;
4601 va_copy (args_copy, args);
7a6dbc2f 4602
c0c3707f
CB
4603 const char *str = "";
4604 int number = 0;
4605 float fnumber = 0;
4606
4607 while (*format)
4608 {
4609 switch (*format++)
4610 {
4611 case 's': // string
4612 str = va_arg (args_copy, const char *);
4613 break;
4614 case 'd': // int
4615 number = va_arg (args_copy, int);
4616 break;
4617 case 'f': // float
4618 fnumber = va_arg (args_copy, double);
4619 break;
4620 default:
4621 break;
4622 }
4623 }
4624 va_end (args_copy);
4625 va_end (args);
4626
4627 return *str && number && fnumber;
4628}
4629// Check _Alignas.
4630char _Alignas (double) aligned_as_double;
4631char _Alignas (0) no_special_alignment;
4632extern char aligned_as_int;
4633char _Alignas (0) _Alignas (int) aligned_as_int;
4634
4635// Check _Alignof.
4636enum
4637{
4638 int_alignment = _Alignof (int),
4639 int_array_alignment = _Alignof (int[100]),
4640 char_alignment = _Alignof (char)
4641};
4642_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
4643
4644// Check _Noreturn.
4645int _Noreturn does_not_return (void) { for (;;) continue; }
4646
4647// Check _Static_assert.
4648struct test_static_assert
4649{
4650 int x;
4651 _Static_assert (sizeof (int) <= sizeof (long int),
4652 "_Static_assert does not work in struct");
4653 long int y;
4654};
4655
4656// Check UTF-8 literals.
4657#define u8 syntax error!
4658char const utf8_literal[] = u8"happens to be ASCII" "another string";
4659
4660// Check duplicate typedefs.
4661typedef long *long_ptr;
4662typedef long int *long_ptr;
4663typedef long_ptr long_ptr;
4664
4665// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
4666struct anonymous
4667{
4668 union {
4669 struct { int i; int j; };
4670 struct { int k; long int l; } w;
4671 };
4672 int m;
4673} v1;
c971b7fa 4674
c971b7fa
PA
4675int
4676main ()
4677{
c0c3707f
CB
4678
4679 // Check bool.
4680 _Bool success = false;
4681
4682 // Check restrict.
4683 if (test_restrict ("String literal") == 0)
4684 success = true;
4685 char *restrict newvar = "Another string";
4686
4687 // Check varargs.
4688 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
4689 test_varargs_macros ();
4690
4691 // Check flexible array members.
4692 struct incomplete_array *ia =
4693 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
4694 ia->datasize = 10;
4695 for (int i = 0; i < ia->datasize; ++i)
4696 ia->data[i] = i * 1.234;
4697
4698 // Check named initializers.
4699 struct named_init ni = {
4700 .number = 34,
4701 .name = L"Test wide string",
4702 .average = 543.34343,
4703 };
4704
4705 ni.number = 58;
4706
4707 int dynamic_array[ni.number];
4708 dynamic_array[ni.number - 1] = 543;
4709
4710 // work around unused variable warnings
4711 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
4712 || dynamic_array[ni.number - 1] != 543);
4713
4714 v1.i = 2;
4715 v1.w.k = 5;
4716 _Static_assert ((offsetof (struct anonymous, i)
4717 == offsetof (struct anonymous, w.k)),
4718 "Anonymous union alignment botch");
4719
c971b7fa
PA
4720 ;
4721 return 0;
4722}
4723_ACEOF
c0c3707f 4724for ac_arg in '' -std=gnu11
c971b7fa
PA
4725do
4726 CC="$ac_save_CC $ac_arg"
4727 if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 4728 ac_cv_prog_cc_c11=$ac_arg
c971b7fa
PA
4729fi
4730rm -f core conftest.err conftest.$ac_objext
c0c3707f 4731 test "x$ac_cv_prog_cc_c11" != "xno" && break
c971b7fa
PA
4732done
4733rm -f conftest.$ac_ext
4734CC=$ac_save_CC
4735
4736fi
4737# AC_CACHE_VAL
c0c3707f
CB
4738ac_prog_cc_stdc_options=
4739case "x$ac_cv_prog_cc_c11" in
c971b7fa
PA
4740 x)
4741 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4742$as_echo "none needed" >&6; } ;;
4743 xno)
4744 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4745$as_echo "unsupported" >&6; } ;;
4746 *)
c0c3707f
CB
4747 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11"
4748 CC=$CC$ac_prog_cc_stdc_options
4749 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
4750$as_echo "$ac_cv_prog_cc_c11" >&6; } ;;
c971b7fa 4751esac
c0c3707f
CB
4752if test "x$ac_cv_prog_cc_c11" != xno; then :
4753 ac_prog_cc_stdc=c11
4754 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
4755else
4756 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
4757$as_echo_n "checking for $CC option to enable C99 features... " >&6; }
4758if ${ac_cv_prog_cc_c99+:} false; then :
4759 $as_echo_n "(cached) " >&6
4760else
4761 ac_cv_prog_cc_c99=no
4762ac_save_CC=$CC
4763cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4764/* end confdefs.h. */
4765#include <stdarg.h>
4766#include <stdbool.h>
4767#include <stddef.h>
4768#include <stdlib.h>
4769#include <wchar.h>
4770#include <stdio.h>
7a6dbc2f 4771
c0c3707f
CB
4772// Check varargs macros. These examples are taken from C99 6.10.3.5.
4773#define debug(...) fprintf (stderr, __VA_ARGS__)
4774#define showlist(...) puts (#__VA_ARGS__)
4775#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4776static void
4777test_varargs_macros (void)
4778{
4779 int x = 1234;
4780 int y = 5678;
4781 debug ("Flag");
4782 debug ("X = %d\n", x);
4783 showlist (The first, second, and third items.);
4784 report (x>y, "x is %d but y is %d", x, y);
4785}
7a6dbc2f 4786
c0c3707f
CB
4787// Check long long types.
4788#define BIG64 18446744073709551615ull
4789#define BIG32 4294967295ul
4790#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4791#if !BIG_OK
4792 your preprocessor is broken;
4793#endif
4794#if BIG_OK
4795#else
4796 your preprocessor is broken;
4797#endif
4798static long long int bignum = -9223372036854775807LL;
4799static unsigned long long int ubignum = BIG64;
7a6dbc2f 4800
c0c3707f
CB
4801struct incomplete_array
4802{
4803 int datasize;
4804 double data[];
4805};
7a6dbc2f 4806
c0c3707f
CB
4807struct named_init {
4808 int number;
4809 const wchar_t *name;
4810 double average;
4811};
7a6dbc2f 4812
c0c3707f 4813typedef const char *ccp;
7a6dbc2f 4814
c0c3707f
CB
4815static inline int
4816test_restrict (ccp restrict text)
4817{
4818 // See if C++-style comments work.
4819 // Iterate through items via the restricted pointer.
4820 // Also check for declarations in for loops.
4821 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4822 continue;
4823 return 0;
4824}
7a6dbc2f 4825
c0c3707f
CB
4826// Check varargs and va_copy.
4827static bool
4828test_varargs (const char *format, ...)
4829{
4830 va_list args;
4831 va_start (args, format);
4832 va_list args_copy;
4833 va_copy (args_copy, args);
4834
4835 const char *str = "";
4836 int number = 0;
4837 float fnumber = 0;
4838
4839 while (*format)
4840 {
4841 switch (*format++)
4842 {
4843 case 's': // string
4844 str = va_arg (args_copy, const char *);
4845 break;
4846 case 'd': // int
4847 number = va_arg (args_copy, int);
4848 break;
4849 case 'f': // float
4850 fnumber = va_arg (args_copy, double);
4851 break;
4852 default:
4853 break;
4854 }
4855 }
4856 va_end (args_copy);
4857 va_end (args);
4858
4859 return *str && number && fnumber;
4860}
4861int
4862main ()
4863{
4864
4865 // Check bool.
4866 _Bool success = false;
4867
4868 // Check restrict.
4869 if (test_restrict ("String literal") == 0)
4870 success = true;
4871 char *restrict newvar = "Another string";
4872
4873 // Check varargs.
4874 success &= test_varargs ("s, d' f .", "string", 65, 34.234);
4875 test_varargs_macros ();
4876
4877 // Check flexible array members.
4878 struct incomplete_array *ia =
4879 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
4880 ia->datasize = 10;
4881 for (int i = 0; i < ia->datasize; ++i)
4882 ia->data[i] = i * 1.234;
4883
4884 // Check named initializers.
4885 struct named_init ni = {
4886 .number = 34,
4887 .name = L"Test wide string",
4888 .average = 543.34343,
4889 };
4890
4891 ni.number = 58;
4892
4893 int dynamic_array[ni.number];
4894 dynamic_array[ni.number - 1] = 543;
4895
4896 // work around unused variable warnings
4897 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
4898 || dynamic_array[ni.number - 1] != 543);
4899
4900 ;
4901 return 0;
4902}
4903_ACEOF
4904for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99
4905do
4906 CC="$ac_save_CC $ac_arg"
4907 if ac_fn_c_try_compile "$LINENO"; then :
4908 ac_cv_prog_cc_c99=$ac_arg
4909fi
4910rm -f core conftest.err conftest.$ac_objext
4911 test "x$ac_cv_prog_cc_c99" != "xno" && break
4912done
4913rm -f conftest.$ac_ext
4914CC=$ac_save_CC
4915
4916fi
4917# AC_CACHE_VAL
4918ac_prog_cc_stdc_options=
4919case "x$ac_cv_prog_cc_c99" in
4920 x)
4921 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4922$as_echo "none needed" >&6; } ;;
4923 xno)
4924 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4925$as_echo "unsupported" >&6; } ;;
4926 *)
4927 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99"
4928 CC=$CC$ac_prog_cc_stdc_options
4929 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
4930$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
4931esac
4932if test "x$ac_cv_prog_cc_c99" != xno; then :
4933 ac_prog_cc_stdc=c99
4934 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
4935else
4936 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
4937$as_echo_n "checking for $CC option to enable C89 features... " >&6; }
4938if ${ac_cv_prog_cc_c89+:} false; then :
d0ac1c44
SM
4939 $as_echo_n "(cached) " >&6
4940else
c0c3707f
CB
4941 ac_cv_prog_cc_c89=no
4942ac_save_CC=$CC
4943cat confdefs.h - <<_ACEOF >conftest.$ac_ext
d0ac1c44 4944/* end confdefs.h. */
c0c3707f
CB
4945#include <stdarg.h>
4946#include <stdio.h>
4947struct stat;
4948/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
4949struct buf { int x; };
4950FILE * (*rcsopen) (struct buf *, struct stat *, int);
4951static char *e (p, i)
4952 char **p;
4953 int i;
4954{
4955 return p[i];
4956}
4957static char *f (char * (*g) (char **, int), char **p, ...)
4958{
4959 char *s;
4960 va_list v;
4961 va_start (v,p);
4962 s = g (p, va_arg (v,int));
4963 va_end (v);
4964 return s;
4965}
4966
4967/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
4968 function prototypes and stuff, but not '\xHH' hex character constants.
4969 These don't provoke an error unfortunately, instead are silently treated
4970 as 'x'. The following induces an error, until -std is added to get
4971 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
4972 array size at least. It's necessary to write '\x00'==0 to get something
4973 that's true only with -std. */
4974int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4975
4976/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4977 inside strings and character constants. */
4978#define FOO(x) 'x'
4979int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
d0ac1c44 4980
c0c3707f
CB
4981int test (int i, double x);
4982struct s1 {int (*f) (int a);};
4983struct s2 {int (*f) (double a);};
4984int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4985int argc;
4986char **argv;
d0ac1c44
SM
4987int
4988main ()
4989{
c0c3707f 4990return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
d0ac1c44
SM
4991 ;
4992 return 0;
4993}
4994_ACEOF
c0c3707f
CB
4995for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4996 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4997do
4998 CC="$ac_save_CC $ac_arg"
4999 if ac_fn_c_try_compile "$LINENO"; then :
5000 ac_cv_prog_cc_c89=$ac_arg
5001fi
5002rm -f core conftest.err conftest.$ac_objext
5003 test "x$ac_cv_prog_cc_c89" != "xno" && break
5004done
5005rm -f conftest.$ac_ext
5006CC=$ac_save_CC
5007
5008fi
5009# AC_CACHE_VAL
5010ac_prog_cc_stdc_options=
5011case "x$ac_cv_prog_cc_c89" in
5012 x)
5013 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5014$as_echo "none needed" >&6; } ;;
5015 xno)
5016 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5017$as_echo "unsupported" >&6; } ;;
5018 *)
5019 ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89"
5020 CC=$CC$ac_prog_cc_stdc_options
5021 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
5022$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
5023esac
5024if test "x$ac_cv_prog_cc_c89" != xno; then :
5025 ac_prog_cc_stdc=c89
5026 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
5027else
5028 ac_prog_cc_stdc=no
5029 ac_cv_prog_cc_stdc=no
5030fi
5031
5032fi
5033
7a6dbc2f 5034fi
c0c3707f 5035
d0ac1c44
SM
5036ac_ext=c
5037ac_cpp='$CPP $CPPFLAGS'
5038ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5039ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5040ac_compiler_gnu=$ac_cv_c_compiler_gnu
5041
5042
c971b7fa
PA
5043ac_ext=c
5044ac_cpp='$CPP $CPPFLAGS'
5045ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5046ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5047ac_compiler_gnu=$ac_cv_c_compiler_gnu
5048{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5049$as_echo_n "checking how to run the C preprocessor... " >&6; }
5050# On Suns, sometimes $CPP names a directory.
5051if test -n "$CPP" && test -d "$CPP"; then
5052 CPP=
5053fi
5054if test -z "$CPP"; then
d0ac1c44 5055 if ${ac_cv_prog_CPP+:} false; then :
c971b7fa
PA
5056 $as_echo_n "(cached) " >&6
5057else
5058 # Double quotes because CPP needs to be expanded
5059 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5060 do
5061 ac_preproc_ok=false
5062for ac_c_preproc_warn_flag in '' yes
5063do
5064 # Use a header file that comes with gcc, so configuring glibc
5065 # with a fresh cross-compiler works.
5066 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5067 # <limits.h> exists even on freestanding compilers.
5068 # On the NeXT, cc -E runs the code through the compiler's parser,
5069 # not just through cpp. "Syntax error" is here to catch this case.
5070 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5071/* end confdefs.h. */
5072#ifdef __STDC__
5073# include <limits.h>
5074#else
5075# include <assert.h>
5076#endif
5077 Syntax error
5078_ACEOF
5079if ac_fn_c_try_cpp "$LINENO"; then :
5080
5081else
5082 # Broken: fails on valid input.
5083continue
5084fi
d0ac1c44 5085rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5086
5087 # OK, works on sane cases. Now check whether nonexistent headers
5088 # can be detected and how.
5089 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5090/* end confdefs.h. */
5091#include <ac_nonexistent.h>
5092_ACEOF
5093if ac_fn_c_try_cpp "$LINENO"; then :
5094 # Broken: success on invalid input.
5095continue
5096else
5097 # Passes both tests.
5098ac_preproc_ok=:
5099break
5100fi
d0ac1c44 5101rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5102
5103done
5104# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5105rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5106if $ac_preproc_ok; then :
5107 break
5108fi
5109
5110 done
5111 ac_cv_prog_CPP=$CPP
5112
5113fi
5114 CPP=$ac_cv_prog_CPP
5115else
5116 ac_cv_prog_CPP=$CPP
5117fi
5118{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5119$as_echo "$CPP" >&6; }
5120ac_preproc_ok=false
5121for ac_c_preproc_warn_flag in '' yes
5122do
5123 # Use a header file that comes with gcc, so configuring glibc
5124 # with a fresh cross-compiler works.
5125 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5126 # <limits.h> exists even on freestanding compilers.
5127 # On the NeXT, cc -E runs the code through the compiler's parser,
5128 # not just through cpp. "Syntax error" is here to catch this case.
5129 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5130/* end confdefs.h. */
5131#ifdef __STDC__
5132# include <limits.h>
5133#else
5134# include <assert.h>
5135#endif
5136 Syntax error
5137_ACEOF
5138if ac_fn_c_try_cpp "$LINENO"; then :
5139
5140else
5141 # Broken: fails on valid input.
5142continue
5143fi
d0ac1c44 5144rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5145
5146 # OK, works on sane cases. Now check whether nonexistent headers
5147 # can be detected and how.
5148 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5149/* end confdefs.h. */
5150#include <ac_nonexistent.h>
5151_ACEOF
5152if ac_fn_c_try_cpp "$LINENO"; then :
5153 # Broken: success on invalid input.
5154continue
5155else
5156 # Passes both tests.
5157ac_preproc_ok=:
5158break
5159fi
d0ac1c44 5160rm -f conftest.err conftest.i conftest.$ac_ext
c971b7fa
PA
5161
5162done
5163# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
d0ac1c44 5164rm -f conftest.i conftest.err conftest.$ac_ext
c971b7fa
PA
5165if $ac_preproc_ok; then :
5166
5167else
5168 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5169$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
d0ac1c44
SM
5170as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5171See \`config.log' for more details" "$LINENO" 5; }
c971b7fa
PA
5172fi
5173
5174ac_ext=c
5175ac_cpp='$CPP $CPPFLAGS'
5176ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5177ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5178ac_compiler_gnu=$ac_cv_c_compiler_gnu
5179
5180
5181{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
5182$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
d0ac1c44 5183if ${ac_cv_path_GREP+:} false; then :
c971b7fa
PA
5184 $as_echo_n "(cached) " >&6
5185else
5186 if test -z "$GREP"; then
5187 ac_path_GREP_found=false
5188 # Loop through the user's path and test for each of PROGNAME-LIST
5189 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5190for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5191do
5192 IFS=$as_save_IFS
5193 test -z "$as_dir" && as_dir=.
5194 for ac_prog in grep ggrep; do
5195 for ac_exec_ext in '' $ac_executable_extensions; do
5196 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5197 as_fn_executable_p "$ac_path_GREP" || continue
c971b7fa
PA
5198# Check for GNU ac_path_GREP and select it if it is found.
5199 # Check for GNU $ac_path_GREP
5200case `"$ac_path_GREP" --version 2>&1` in
5201*GNU*)
5202 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
5203*)
5204 ac_count=0
5205 $as_echo_n 0123456789 >"conftest.in"
5206 while :
5207 do
5208 cat "conftest.in" "conftest.in" >"conftest.tmp"
5209 mv "conftest.tmp" "conftest.in"
5210 cp "conftest.in" "conftest.nl"
5211 $as_echo 'GREP' >> "conftest.nl"
5212 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5213 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5214 as_fn_arith $ac_count + 1 && ac_count=$as_val
5215 if test $ac_count -gt ${ac_path_GREP_max-0}; then
5216 # Best one so far, save it but keep looking for a better one
5217 ac_cv_path_GREP="$ac_path_GREP"
5218 ac_path_GREP_max=$ac_count
5219 fi
5220 # 10*(2^10) chars as input seems more than enough
5221 test $ac_count -gt 10 && break
5222 done
5223 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5224esac
5225
5226 $ac_path_GREP_found && break 3
5227 done
5228 done
5229 done
5230IFS=$as_save_IFS
5231 if test -z "$ac_cv_path_GREP"; then
d0ac1c44 5232 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5233 fi
5234else
5235 ac_cv_path_GREP=$GREP
5236fi
5237
5238fi
5239{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
5240$as_echo "$ac_cv_path_GREP" >&6; }
5241 GREP="$ac_cv_path_GREP"
5242
5243
5244{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
5245$as_echo_n "checking for egrep... " >&6; }
d0ac1c44 5246if ${ac_cv_path_EGREP+:} false; then :
c971b7fa
PA
5247 $as_echo_n "(cached) " >&6
5248else
5249 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
5250 then ac_cv_path_EGREP="$GREP -E"
5251 else
5252 if test -z "$EGREP"; then
5253 ac_path_EGREP_found=false
5254 # Loop through the user's path and test for each of PROGNAME-LIST
5255 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5256for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
5257do
5258 IFS=$as_save_IFS
5259 test -z "$as_dir" && as_dir=.
5260 for ac_prog in egrep; do
5261 for ac_exec_ext in '' $ac_executable_extensions; do
5262 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
d0ac1c44 5263 as_fn_executable_p "$ac_path_EGREP" || continue
c971b7fa
PA
5264# Check for GNU ac_path_EGREP and select it if it is found.
5265 # Check for GNU $ac_path_EGREP
5266case `"$ac_path_EGREP" --version 2>&1` in
5267*GNU*)
5268 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
5269*)
5270 ac_count=0
5271 $as_echo_n 0123456789 >"conftest.in"
5272 while :
5273 do
5274 cat "conftest.in" "conftest.in" >"conftest.tmp"
5275 mv "conftest.tmp" "conftest.in"
5276 cp "conftest.in" "conftest.nl"
5277 $as_echo 'EGREP' >> "conftest.nl"
5278 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
5279 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
5280 as_fn_arith $ac_count + 1 && ac_count=$as_val
5281 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
5282 # Best one so far, save it but keep looking for a better one
5283 ac_cv_path_EGREP="$ac_path_EGREP"
5284 ac_path_EGREP_max=$ac_count
5285 fi
5286 # 10*(2^10) chars as input seems more than enough
5287 test $ac_count -gt 10 && break
5288 done
5289 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
5290esac
5291
5292 $ac_path_EGREP_found && break 3
5293 done
5294 done
5295 done
5296IFS=$as_save_IFS
5297 if test -z "$ac_cv_path_EGREP"; then
d0ac1c44 5298 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
c971b7fa
PA
5299 fi
5300else
5301 ac_cv_path_EGREP=$EGREP
5302fi
5303
5304 fi
5305fi
5306{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
5307$as_echo "$ac_cv_path_EGREP" >&6; }
5308 EGREP="$ac_cv_path_EGREP"
5309
5310
5311{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
5312$as_echo_n "checking for ANSI C header files... " >&6; }
d0ac1c44 5313if ${ac_cv_header_stdc+:} false; then :
c971b7fa
PA
5314 $as_echo_n "(cached) " >&6
5315else
5316 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5317/* end confdefs.h. */
5318#include <stdlib.h>
5319#include <stdarg.h>
5320#include <string.h>
5321#include <float.h>
5322
5323int
5324main ()
5325{
5326
5327 ;
5328 return 0;
5329}
5330_ACEOF
5331if ac_fn_c_try_compile "$LINENO"; then :
5332 ac_cv_header_stdc=yes
5333else
5334 ac_cv_header_stdc=no
5335fi
5336rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5337
5338if test $ac_cv_header_stdc = yes; then
5339 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
5340 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5341/* end confdefs.h. */
5342#include <string.h>
5343
5344_ACEOF
5345if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5346 $EGREP "memchr" >/dev/null 2>&1; then :
5347
5348else
5349 ac_cv_header_stdc=no
5350fi
5351rm -f conftest*
5352
5353fi
5354
5355if test $ac_cv_header_stdc = yes; then
5356 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
5357 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5358/* end confdefs.h. */
5359#include <stdlib.h>
5360
5361_ACEOF
5362if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5363 $EGREP "free" >/dev/null 2>&1; then :
5364
5365else
5366 ac_cv_header_stdc=no
5367fi
5368rm -f conftest*
5369
5370fi
5371
5372if test $ac_cv_header_stdc = yes; then
5373 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
5374 if test "$cross_compiling" = yes; then :
5375 :
5376else
5377 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5378/* end confdefs.h. */
5379#include <ctype.h>
5380#include <stdlib.h>
5381#if ((' ' & 0x0FF) == 0x020)
5382# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
5383# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
5384#else
5385# define ISLOWER(c) \
5386 (('a' <= (c) && (c) <= 'i') \
5387 || ('j' <= (c) && (c) <= 'r') \
5388 || ('s' <= (c) && (c) <= 'z'))
5389# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
5390#endif
5391
5392#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
5393int
5394main ()
5395{
5396 int i;
5397 for (i = 0; i < 256; i++)
5398 if (XOR (islower (i), ISLOWER (i))
5399 || toupper (i) != TOUPPER (i))
5400 return 2;
5401 return 0;
5402}
5403_ACEOF
5404if ac_fn_c_try_run "$LINENO"; then :
5405
5406else
5407 ac_cv_header_stdc=no
5408fi
5409rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
5410 conftest.$ac_objext conftest.beam conftest.$ac_ext
5411fi
5412
5413fi
5414fi
5415{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
5416$as_echo "$ac_cv_header_stdc" >&6; }
5417if test $ac_cv_header_stdc = yes; then
5418
5419$as_echo "#define STDC_HEADERS 1" >>confdefs.h
5420
5421fi
5422
5423# On IRIX 5.3, sys/types and inttypes.h are conflicting.
5424for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
5425 inttypes.h stdint.h unistd.h
5426do :
5427 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5428ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
5429"
d0ac1c44 5430if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
c971b7fa
PA
5431 cat >>confdefs.h <<_ACEOF
5432#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5433_ACEOF
5434
5435fi
5436
5437done
5438
5439
5440
c971b7fa 5441 ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
d0ac1c44 5442if test "x$ac_cv_header_minix_config_h" = xyes; then :
c971b7fa
PA
5443 MINIX=yes
5444else
5445 MINIX=
5446fi
5447
5448
5449 if test "$MINIX" = yes; then
5450
5451$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
5452
5453
5454$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
5455
5456
5457$as_echo "#define _MINIX 1" >>confdefs.h
5458
c971b7fa 5459
4a626d0a 5460$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
c971b7fa 5461
4a626d0a 5462 fi
c971b7fa
PA
5463
5464
5465 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
5466$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
d0ac1c44 5467if ${ac_cv_safe_to_define___extensions__+:} false; then :
c971b7fa
PA
5468 $as_echo_n "(cached) " >&6
5469else
5470 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5471/* end confdefs.h. */
5472
5473# define __EXTENSIONS__ 1
5474 $ac_includes_default
5475int
5476main ()
5477{
5478
5479 ;
5480 return 0;
5481}
5482_ACEOF
5483if ac_fn_c_try_compile "$LINENO"; then :
5484 ac_cv_safe_to_define___extensions__=yes
5485else
5486 ac_cv_safe_to_define___extensions__=no
5487fi
5488rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5489fi
5490{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
5491$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
5492 test $ac_cv_safe_to_define___extensions__ = yes &&
5493 $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
5494
5495 $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
5496
5497 $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
5498
5499 $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
5500
c0c3707f
CB
5501 $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
5502
5503 $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h
5504
c971b7fa
PA
5505 $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
5506
49e4877c
PA
5507 $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h
5508
5509 $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h
5510
5511 $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h
5512
5513 $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h
5514
5515 $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h
5516
5517 $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h
5518
5519 $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h
5520
c971b7fa
PA
5521 $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
5522
4a626d0a
PA
5523 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
5524$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; }
d0ac1c44 5525if ${ac_cv_should_define__xopen_source+:} false; then :
4a626d0a
PA
5526 $as_echo_n "(cached) " >&6
5527else
5528 ac_cv_should_define__xopen_source=no
5529 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5530/* end confdefs.h. */
5531
5532 #include <wchar.h>
5533 mbstate_t x;
5534int
5535main ()
5536{
5537
5538 ;
5539 return 0;
5540}
5541_ACEOF
5542if ac_fn_c_try_compile "$LINENO"; then :
5543
5544else
5545 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5546/* end confdefs.h. */
5547
5548 #define _XOPEN_SOURCE 500
5549 #include <wchar.h>
5550 mbstate_t x;
5551int
5552main ()
5553{
5554
5555 ;
5556 return 0;
5557}
5558_ACEOF
5559if ac_fn_c_try_compile "$LINENO"; then :
5560 ac_cv_should_define__xopen_source=yes
5561fi
d0ac1c44
SM
5562rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5563fi
5564rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5565fi
5566{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
5567$as_echo "$ac_cv_should_define__xopen_source" >&6; }
5568 test $ac_cv_should_define__xopen_source = yes &&
5569 $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
5570
c0c3707f
CB
5571 $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h
5572
d0ac1c44
SM
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
5584$as_echo_n "checking for Minix Amsterdam compiler... " >&6; }
5585if ${gl_cv_c_amsterdam_compiler+:} false; then :
5586 $as_echo_n "(cached) " >&6
5587else
5588
5589 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5590/* end confdefs.h. */
5591
5592#ifdef __ACK__
5593Amsterdam
5594#endif
5595
5596_ACEOF
5597if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5598 $EGREP "Amsterdam" >/dev/null 2>&1; then :
5599 gl_cv_c_amsterdam_compiler=yes
5600else
5601 gl_cv_c_amsterdam_compiler=no
5602fi
5603rm -f conftest*
5604
5605
5606fi
5607{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
5608$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
5609
5610 if test $gl_cv_c_amsterdam_compiler = yes; then
5611 if test -z "$AR"; then
5612 AR='cc -c.a'
5613 fi
5614 if test -z "$ARFLAGS"; then
5615 ARFLAGS='-o'
5616 fi
5617 else
c0c3707f
CB
5618 :
5619 fi
5620
5621 if test -n "$ac_tool_prefix"; then
5622 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
5623set dummy ${ac_tool_prefix}ar; ac_word=$2
d0ac1c44
SM
5624{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5625$as_echo_n "checking for $ac_word... " >&6; }
5626if ${ac_cv_prog_AR+:} false; then :
5627 $as_echo_n "(cached) " >&6
5628else
5629 if test -n "$AR"; then
5630 ac_cv_prog_AR="$AR" # Let the user override the test.
5631else
5632as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5633for as_dir in $PATH
5634do
5635 IFS=$as_save_IFS
5636 test -z "$as_dir" && as_dir=.
5637 for ac_exec_ext in '' $ac_executable_extensions; do
5638 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c0c3707f 5639 ac_cv_prog_AR="${ac_tool_prefix}ar"
d0ac1c44
SM
5640 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5641 break 2
5642 fi
5643done
5644 done
5645IFS=$as_save_IFS
5646
5647fi
4a626d0a 5648fi
d0ac1c44
SM
5649AR=$ac_cv_prog_AR
5650if test -n "$AR"; then
5651 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5652$as_echo "$AR" >&6; }
5653else
5654 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5655$as_echo "no" >&6; }
4a626d0a 5656fi
c971b7fa 5657
49e4877c 5658
d0ac1c44 5659fi
c0c3707f 5660if test -z "$ac_cv_prog_AR"; then
d0ac1c44 5661 ac_ct_AR=$AR
c0c3707f
CB
5662 # Extract the first word of "ar", so it can be a program name with args.
5663set dummy ar; ac_word=$2
d0ac1c44
SM
5664{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5665$as_echo_n "checking for $ac_word... " >&6; }
5666if ${ac_cv_prog_ac_ct_AR+:} false; then :
5667 $as_echo_n "(cached) " >&6
5668else
5669 if test -n "$ac_ct_AR"; then
5670 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5671else
5672as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5673for as_dir in $PATH
5674do
5675 IFS=$as_save_IFS
5676 test -z "$as_dir" && as_dir=.
5677 for ac_exec_ext in '' $ac_executable_extensions; do
5678 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c0c3707f 5679 ac_cv_prog_ac_ct_AR="ar"
d0ac1c44
SM
5680 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5681 break 2
5682 fi
5683done
5684 done
5685IFS=$as_save_IFS
49e4877c 5686
d0ac1c44
SM
5687fi
5688fi
5689ac_ct_AR=$ac_cv_prog_ac_ct_AR
5690if test -n "$ac_ct_AR"; then
5691 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
5692$as_echo "$ac_ct_AR" >&6; }
5693else
5694 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5695$as_echo "no" >&6; }
5696fi
49e4877c 5697
d0ac1c44 5698 if test "x$ac_ct_AR" = x; then
c0c3707f 5699 AR="ar"
d0ac1c44
SM
5700 else
5701 case $cross_compiling:$ac_tool_warned in
5702yes:)
5703{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5704$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5705ac_tool_warned=yes ;;
5706esac
5707 AR=$ac_ct_AR
5708 fi
c971b7fa 5709else
c0c3707f 5710 AR="$ac_cv_prog_AR"
5e8754f9 5711fi
5e8754f9 5712
c0c3707f
CB
5713 if test -z "$ARFLAGS"; then
5714 ARFLAGS='cr'
5715 fi
5e8754f9 5716
5e8754f9 5717
5e8754f9 5718
c0c3707f
CB
5719 if test -z "$RANLIB"; then
5720 if test $gl_cv_c_amsterdam_compiler = yes; then
5721 RANLIB=':'
5722 else
5723 if test -n "$ac_tool_prefix"; then
5724 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
5725set dummy ${ac_tool_prefix}ranlib; ac_word=$2
5e8754f9
SDJ
5726{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5727$as_echo_n "checking for $ac_word... " >&6; }
c0c3707f 5728if ${ac_cv_prog_RANLIB+:} false; then :
5e8754f9
SDJ
5729 $as_echo_n "(cached) " >&6
5730else
c0c3707f
CB
5731 if test -n "$RANLIB"; then
5732 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5e8754f9
SDJ
5733else
5734as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5735for as_dir in $PATH
5736do
5737 IFS=$as_save_IFS
5738 test -z "$as_dir" && as_dir=.
5739 for ac_exec_ext in '' $ac_executable_extensions; do
5740 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c0c3707f 5741 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
5e8754f9
SDJ
5742 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5743 break 2
5744 fi
5745done
5746 done
5747IFS=$as_save_IFS
5748
5749fi
5750fi
c0c3707f
CB
5751RANLIB=$ac_cv_prog_RANLIB
5752if test -n "$RANLIB"; then
5753 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
5754$as_echo "$RANLIB" >&6; }
5e8754f9
SDJ
5755else
5756 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5757$as_echo "no" >&6; }
5758fi
5759
5760
5761fi
c0c3707f
CB
5762if test -z "$ac_cv_prog_RANLIB"; then
5763 ac_ct_RANLIB=$RANLIB
5764 # Extract the first word of "ranlib", so it can be a program name with args.
5765set dummy ranlib; ac_word=$2
5e8754f9
SDJ
5766{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5767$as_echo_n "checking for $ac_word... " >&6; }
c0c3707f 5768if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
5e8754f9
SDJ
5769 $as_echo_n "(cached) " >&6
5770else
c0c3707f
CB
5771 if test -n "$ac_ct_RANLIB"; then
5772 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
c971b7fa
PA
5773else
5774as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5775for as_dir in $PATH
5776do
5777 IFS=$as_save_IFS
5778 test -z "$as_dir" && as_dir=.
5779 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 5780 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
5781 ac_cv_prog_ac_ct_RANLIB="ranlib"
5782 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5783 break 2
5784 fi
5785done
5786 done
5787IFS=$as_save_IFS
5788
5789fi
5790fi
5791ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
5792if test -n "$ac_ct_RANLIB"; then
5793 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
5794$as_echo "$ac_ct_RANLIB" >&6; }
5795else
5796 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5797$as_echo "no" >&6; }
5798fi
5799
5800 if test "x$ac_ct_RANLIB" = x; then
5801 RANLIB=":"
5802 else
5803 case $cross_compiling:$ac_tool_warned in
5804yes:)
5805{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5806$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5807ac_tool_warned=yes ;;
5808esac
5809 RANLIB=$ac_ct_RANLIB
5810 fi
5811else
5812 RANLIB="$ac_cv_prog_RANLIB"
5813fi
5814
5815 fi
5816 fi
5817
5818
5abebf3c 5819
c0c3707f
CB
5820ac_aux_dir=
5821for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
5822 if test -f "$ac_dir/install-sh"; then
5823 ac_aux_dir=$ac_dir
5824 ac_install_sh="$ac_aux_dir/install-sh -c"
5825 break
5826 elif test -f "$ac_dir/install.sh"; then
5827 ac_aux_dir=$ac_dir
5828 ac_install_sh="$ac_aux_dir/install.sh -c"
5829 break
5830 elif test -f "$ac_dir/shtool"; then
5831 ac_aux_dir=$ac_dir
5832 ac_install_sh="$ac_aux_dir/shtool install -c"
5833 break
5834 fi
5835done
5836if test -z "$ac_aux_dir"; then
5837 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
5838fi
5839
5840# These three variables are undocumented and unsupported,
5841# and are intended to be withdrawn in a future Autoconf release.
5842# They can cause serious problems if a builder's source tree is in a directory
5843# whose full name contains unusual characters.
5844ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
5845ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
5846ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
5847
5848
4a626d0a
PA
5849# Make sure we can run config.sub.
5850$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
d0ac1c44 5851 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4a626d0a
PA
5852
5853{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
5854$as_echo_n "checking build system type... " >&6; }
d0ac1c44 5855if ${ac_cv_build+:} false; then :
4a626d0a
PA
5856 $as_echo_n "(cached) " >&6
5857else
5858 ac_build_alias=$build_alias
5859test "x$ac_build_alias" = x &&
5860 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
5861test "x$ac_build_alias" = x &&
d0ac1c44 5862 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4a626d0a 5863ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
d0ac1c44 5864 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4a626d0a
PA
5865
5866fi
5867{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
5868$as_echo "$ac_cv_build" >&6; }
5869case $ac_cv_build in
5870*-*-*) ;;
d0ac1c44 5871*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
4a626d0a
PA
5872esac
5873build=$ac_cv_build
5874ac_save_IFS=$IFS; IFS='-'
5875set x $ac_cv_build
5876shift
5877build_cpu=$1
5878build_vendor=$2
5879shift; shift
5880# Remember, the first character of IFS is used to create $*,
5881# except with old shells:
5882build_os=$*
5883IFS=$ac_save_IFS
5884case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
5885
5886
5887{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
5888$as_echo_n "checking host system type... " >&6; }
d0ac1c44 5889if ${ac_cv_host+:} false; then :
4a626d0a
PA
5890 $as_echo_n "(cached) " >&6
5891else
5892 if test "x$host_alias" = x; then
5893 ac_cv_host=$ac_cv_build
5894else
5895 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
d0ac1c44 5896 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4a626d0a
PA
5897fi
5898
5899fi
5900{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
5901$as_echo "$ac_cv_host" >&6; }
5902case $ac_cv_host in
5903*-*-*) ;;
d0ac1c44 5904*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
4a626d0a
PA
5905esac
5906host=$ac_cv_host
5907ac_save_IFS=$IFS; IFS='-'
5908set x $ac_cv_host
5909shift
5910host_cpu=$1
5911host_vendor=$2
5912shift; shift
5913# Remember, the first character of IFS is used to create $*,
5914# except with old shells:
5915host_os=$*
5916IFS=$ac_save_IFS
5917case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
5918
5919
c971b7fa
PA
5920
5921
88b48903
WN
5922
5923 # IEEE behaviour is the default on all CPUs except Alpha and SH
5924 # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
5925 # and the GCC 4.1.2 manual).
5926 case "$host_cpu" in
5927 alpha*)
5928 # On Alpha systems, a compiler option provides the behaviour.
5929 # See the ieee(3) manual page, also available at
c0c3707f 5930 # <https://backdrift.org/man/tru64/man3/ieee.3.html>
88b48903
WN
5931 if test -n "$GCC"; then
5932 # GCC has the option -mieee.
5933 # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
5934 CPPFLAGS="$CPPFLAGS -mieee"
5935 else
5936 # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
5937 # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
5938 CPPFLAGS="$CPPFLAGS -ieee"
5939 fi
5940 ;;
5941 sh*)
5942 if test -n "$GCC"; then
5943 # GCC has the option -mieee.
5944 CPPFLAGS="$CPPFLAGS -mieee"
5945 fi
5946 ;;
5947 esac
5948
2196f55f
YQ
5949# Check whether --enable-largefile was given.
5950if test "${enable_largefile+set}" = set; then :
5951 enableval=$enable_largefile;
5952fi
5953
5954if test "$enable_largefile" != no; then
5955
5956 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
5957$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
d0ac1c44 5958if ${ac_cv_sys_largefile_CC+:} false; then :
2196f55f
YQ
5959 $as_echo_n "(cached) " >&6
5960else
5961 ac_cv_sys_largefile_CC=no
5962 if test "$GCC" != yes; then
5963 ac_save_CC=$CC
5964 while :; do
5965 # IRIX 6.2 and later do not support large files by default,
5966 # so use the C compiler's -n32 option if that helps.
5967 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5968/* end confdefs.h. */
5969#include <sys/types.h>
5970 /* Check that off_t can represent 2**63 - 1 correctly.
5971 We can't simply define LARGE_OFF_T to be 9223372036854775807,
5972 since some C++ compilers masquerading as C compilers
5973 incorrectly reject 9223372036854775807. */
5974#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
5975 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
5976 && LARGE_OFF_T % 2147483647 == 1)
5977 ? 1 : -1];
5978int
5979main ()
5980{
5981
5982 ;
5983 return 0;
5984}
5985_ACEOF
5986 if ac_fn_c_try_compile "$LINENO"; then :
5987 break
5988fi
5989rm -f core conftest.err conftest.$ac_objext
5990 CC="$CC -n32"
5991 if ac_fn_c_try_compile "$LINENO"; then :
5992 ac_cv_sys_largefile_CC=' -n32'; break
5993fi
5994rm -f core conftest.err conftest.$ac_objext
5995 break
5996 done
5997 CC=$ac_save_CC
5998 rm -f conftest.$ac_ext
5999 fi
6000fi
6001{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
6002$as_echo "$ac_cv_sys_largefile_CC" >&6; }
6003 if test "$ac_cv_sys_largefile_CC" != no; then
6004 CC=$CC$ac_cv_sys_largefile_CC
6005 fi
6006
6007 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
6008$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
d0ac1c44 6009if ${ac_cv_sys_file_offset_bits+:} false; then :
2196f55f
YQ
6010 $as_echo_n "(cached) " >&6
6011else
6012 while :; do
6013 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6014/* end confdefs.h. */
6015#include <sys/types.h>
6016 /* Check that off_t can represent 2**63 - 1 correctly.
6017 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6018 since some C++ compilers masquerading as C compilers
6019 incorrectly reject 9223372036854775807. */
6020#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6021 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6022 && LARGE_OFF_T % 2147483647 == 1)
6023 ? 1 : -1];
6024int
6025main ()
6026{
6027
6028 ;
6029 return 0;
6030}
6031_ACEOF
6032if ac_fn_c_try_compile "$LINENO"; then :
6033 ac_cv_sys_file_offset_bits=no; break
6034fi
6035rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6036 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6037/* end confdefs.h. */
6038#define _FILE_OFFSET_BITS 64
6039#include <sys/types.h>
6040 /* Check that off_t can represent 2**63 - 1 correctly.
6041 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6042 since some C++ compilers masquerading as C compilers
6043 incorrectly reject 9223372036854775807. */
6044#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6045 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6046 && LARGE_OFF_T % 2147483647 == 1)
6047 ? 1 : -1];
6048int
6049main ()
6050{
6051
6052 ;
6053 return 0;
6054}
6055_ACEOF
6056if ac_fn_c_try_compile "$LINENO"; then :
6057 ac_cv_sys_file_offset_bits=64; break
6058fi
6059rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6060 ac_cv_sys_file_offset_bits=unknown
6061 break
6062done
6063fi
6064{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
6065$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
6066case $ac_cv_sys_file_offset_bits in #(
6067 no | unknown) ;;
6068 *)
6069cat >>confdefs.h <<_ACEOF
6070#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
6071_ACEOF
6072;;
6073esac
6074rm -rf conftest*
6075 if test $ac_cv_sys_file_offset_bits = unknown; then
6076 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
6077$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
d0ac1c44 6078if ${ac_cv_sys_large_files+:} false; then :
2196f55f
YQ
6079 $as_echo_n "(cached) " >&6
6080else
6081 while :; do
6082 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6083/* end confdefs.h. */
6084#include <sys/types.h>
6085 /* Check that off_t can represent 2**63 - 1 correctly.
6086 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6087 since some C++ compilers masquerading as C compilers
6088 incorrectly reject 9223372036854775807. */
6089#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6090 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6091 && LARGE_OFF_T % 2147483647 == 1)
6092 ? 1 : -1];
6093int
6094main ()
6095{
6096
6097 ;
6098 return 0;
6099}
6100_ACEOF
6101if ac_fn_c_try_compile "$LINENO"; then :
6102 ac_cv_sys_large_files=no; break
6103fi
6104rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6105 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6106/* end confdefs.h. */
6107#define _LARGE_FILES 1
6108#include <sys/types.h>
6109 /* Check that off_t can represent 2**63 - 1 correctly.
6110 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6111 since some C++ compilers masquerading as C compilers
6112 incorrectly reject 9223372036854775807. */
6113#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6114 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6115 && LARGE_OFF_T % 2147483647 == 1)
6116 ? 1 : -1];
6117int
6118main ()
6119{
6120
6121 ;
6122 return 0;
6123}
6124_ACEOF
6125if ac_fn_c_try_compile "$LINENO"; then :
6126 ac_cv_sys_large_files=1; break
6127fi
6128rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6129 ac_cv_sys_large_files=unknown
6130 break
6131done
6132fi
6133{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
6134$as_echo "$ac_cv_sys_large_files" >&6; }
6135case $ac_cv_sys_large_files in #(
6136 no | unknown) ;;
6137 *)
6138cat >>confdefs.h <<_ACEOF
6139#define _LARGE_FILES $ac_cv_sys_large_files
6140_ACEOF
6141;;
6142esac
6143rm -rf conftest*
6144 fi
6145
6146
4a626d0a
PA
6147$as_echo "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h
6148
2196f55f
YQ
6149fi
6150
88b48903
WN
6151
6152
5abebf3c
CB
6153
6154
6155
c0c3707f 6156
5abebf3c
CB
6157 # Check whether --enable-threads was given.
6158if test "${enable_threads+set}" = set; then :
6159 enableval=$enable_threads; gl_use_threads=$enableval
6160else
6161 if test -n "$gl_use_threads_default"; then
6162 gl_use_threads="$gl_use_threads_default"
6163 else
6164 case "$host_os" in
c0c3707f
CB
6165 osf*) gl_use_threads=no ;;
6166 cygwin*)
5abebf3c
CB
6167 case `uname -r` in
6168 1.[0-5].*) gl_use_threads=no ;;
6169 *) gl_use_threads=yes ;;
6170 esac
6171 ;;
c0c3707f
CB
6172 mingw*)
6173 case "$gl_use_winpthreads_default" in
6174 yes) gl_use_threads=posix ;;
6175 no) gl_use_threads=windows ;;
6176 *) gl_use_threads=yes ;;
6177 esac
6178 ;;
5abebf3c
CB
6179 *) gl_use_threads=yes ;;
6180 esac
6181 fi
6182
6183fi
6184
c0c3707f
CB
6185 if test "$gl_use_threads" = yes \
6186 || test "$gl_use_threads" = isoc \
6187 || test "$gl_use_threads" = posix \
6188 || test "$gl_use_threads" = isoc+posix; then
6189 # For using <threads.h> or <pthread.h>:
6190
6191
6192 if test -z "$gl_anythreadlib_early_done"; then
5abebf3c
CB
6193 case "$host_os" in
6194 osf*)
6195 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
6196 # groks <pthread.h>. cc also understands the flag -pthread, but
6197 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
6198 # 2. putting a flag into CPPFLAGS that has an effect on the linker
6199 # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
6200 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
6201 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
6202 ;;
6203 esac
6204 # Some systems optimize for single-threaded programs by default, and
6205 # need special flags to disable these optimizations. For example, the
6206 # definition of 'errno' in <errno.h>.
6207 case "$host_os" in
6208 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
6209 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
6210 esac
c0c3707f
CB
6211 gl_anythreadlib_early_done=done
6212 fi
6213
5abebf3c
CB
6214 fi
6215
6216
6217
49e4877c
PA
6218 # Pre-early section.
6219
6220
6221
5abebf3c 6222
4a626d0a 6223 # Code from module absolute-header:
8690e634
JK
6224 # Code from module alloca:
6225 # Code from module alloca-opt:
725e2999 6226 # Code from module arpa_inet:
6ec2e0f5
SDJ
6227 # Code from module assure:
6228 # Code from module at-internal:
c0c3707f
CB
6229 # Code from module builtin-expect:
6230 # Code from module c99:
98399780 6231 # Code from module canonicalize-lgpl:
6a29c58e 6232 # Code from module chdir:
6ec2e0f5
SDJ
6233 # Code from module chdir-long:
6234 # Code from module cloexec:
6235 # Code from module close:
6236 # Code from module closedir:
5f661e03 6237 # Code from module count-one-bits:
6ec2e0f5
SDJ
6238 # Code from module d-ino:
6239 # Code from module d-type:
e26b6bb0 6240 # Code from module dirent:
18848e28 6241 # Code from module dirfd:
6a29c58e 6242 # Code from module dirname-lgpl:
2196f55f 6243 # Code from module dosname:
6a29c58e 6244 # Code from module double-slash-root:
6ec2e0f5
SDJ
6245 # Code from module dup:
6246 # Code from module dup2:
3d99e817 6247 # Code from module environ:
18848e28 6248 # Code from module errno:
6ec2e0f5
SDJ
6249 # Code from module error:
6250 # Code from module exitfail:
c971b7fa 6251 # Code from module extensions:
a512b375 6252 # Code from module extern-inline:
6ec2e0f5
SDJ
6253 # Code from module fchdir:
6254 # Code from module fcntl:
6255 # Code from module fcntl-h:
6256 # Code from module fd-hook:
c0c3707f 6257 # Code from module fd-safer-flag:
6ec2e0f5
SDJ
6258 # Code from module fdopendir:
6259 # Code from module filename:
6260 # Code from module filenamecat-lgpl:
49e4877c 6261 # Code from module flexmember:
88b48903 6262 # Code from module float:
8690e634
JK
6263 # Code from module fnmatch:
6264 # Code from module fnmatch-gnu:
c0c3707f 6265 # Code from module fnmatch-h:
88b48903
WN
6266 # Code from module fpieee:
6267
6268 # Code from module fpucw:
6269 # Code from module frexp:
6270 # Code from module frexpl:
6ec2e0f5
SDJ
6271 # Code from module fstat:
6272 # Code from module fstatat:
6273 # Code from module getcwd:
6274 # Code from module getcwd-lgpl:
6275 # Code from module getdtablesize:
6276 # Code from module getlogin_r:
6277 # Code from module getprogname:
6278 # Code from module gettext-h:
4a626d0a 6279 # Code from module gettimeofday:
6ec2e0f5 6280 # Code from module glob:
c0c3707f 6281 # Code from module glob-h:
49e4877c 6282 # Code from module hard-locale:
5abebf3c 6283 # Code from module havelib:
c971b7fa 6284 # Code from module include_next:
725e2999 6285 # Code from module inet_ntop:
6ec2e0f5 6286 # Code from module intprops:
c971b7fa
PA
6287 # Code from module inttypes:
6288 # Code from module inttypes-incomplete:
88b48903
WN
6289 # Code from module isnand-nolibm:
6290 # Code from module isnanl-nolibm:
2196f55f
YQ
6291 # Code from module largefile:
6292
c0c3707f 6293 # Code from module libc-config:
49e4877c 6294 # Code from module limits-h:
8690e634 6295 # Code from module localcharset:
c0c3707f 6296 # Code from module localtime-buffer:
5abebf3c 6297 # Code from module lock:
f45c62c4 6298 # Code from module lstat:
6a29c58e 6299 # Code from module malloc-posix:
98399780 6300 # Code from module malloca:
88b48903 6301 # Code from module math:
8690e634
JK
6302 # Code from module mbrtowc:
6303 # Code from module mbsinit:
6304 # Code from module mbsrtowcs:
c971b7fa
PA
6305 # Code from module memchr:
6306 # Code from module memmem:
6307 # Code from module memmem-simple:
6ec2e0f5
SDJ
6308 # Code from module mempcpy:
6309 # Code from module memrchr:
8a99096f 6310 # Code from module mkdir:
e8d8cce6 6311 # Code from module mkdtemp:
b3279b60 6312 # Code from module mkostemp:
6ec2e0f5
SDJ
6313 # Code from module msvc-inval:
6314 # Code from module msvc-nothrow:
c971b7fa 6315 # Code from module multiarch:
725e2999 6316 # Code from module netinet_in:
98399780 6317 # Code from module nocrash:
6ec2e0f5
SDJ
6318 # Code from module open:
6319 # Code from module openat:
6320 # Code from module openat-die:
6321 # Code from module openat-h:
6322 # Code from module opendir:
38ec2207 6323 # Code from module pathmax:
8424cc97 6324 # Code from module rawmemchr:
6ec2e0f5 6325 # Code from module readdir:
2196f55f 6326 # Code from module readlink:
6ec2e0f5 6327 # Code from module realloc-posix:
6a29c58e 6328 # Code from module rename:
6ec2e0f5 6329 # Code from module rewinddir:
6a29c58e
YQ
6330 # Code from module rmdir:
6331 # Code from module same-inode:
6ec2e0f5 6332 # Code from module save-cwd:
c0c3707f 6333 # Code from module scratch_buffer:
3d99e817 6334 # Code from module setenv:
0750520d 6335 # Code from module signal-h:
98399780 6336 # Code from module snippet/_Noreturn:
c971b7fa
PA
6337 # Code from module snippet/arg-nonnull:
6338 # Code from module snippet/c++defs:
6339 # Code from module snippet/warn-on-use:
725e2999 6340 # Code from module socklen:
8839a007 6341 # Code from module ssize_t:
2196f55f 6342 # Code from module stat:
c0c3707f
CB
6343 # Code from module stat-time:
6344 # Code from module std-gnu11:
725e2999 6345 # Code from module stdalign:
8690e634 6346 # Code from module stdbool:
c971b7fa
PA
6347 # Code from module stddef:
6348 # Code from module stdint:
6a29c58e 6349 # Code from module stdio:
98399780 6350 # Code from module stdlib:
8424cc97 6351 # Code from module strchrnul:
6ec2e0f5 6352 # Code from module strdup-posix:
8690e634 6353 # Code from module streq:
6ec2e0f5
SDJ
6354 # Code from module strerror:
6355 # Code from module strerror-override:
5abebf3c 6356 # Code from module strerror_r-posix:
c971b7fa 6357 # Code from module string:
8690e634 6358 # Code from module strnlen1:
63ce7108
TT
6359 # Code from module strstr:
6360 # Code from module strstr-simple:
421693b0 6361 # Code from module strtok_r:
725e2999 6362 # Code from module sys_socket:
09607c9e 6363 # Code from module sys_stat:
4a626d0a 6364 # Code from module sys_time:
8839a007 6365 # Code from module sys_types:
725e2999 6366 # Code from module sys_uio:
2d8adcbd 6367 # Code from module tempname:
5abebf3c
CB
6368 # Code from module threadlib:
6369
6370
6371
09607c9e 6372 # Code from module time:
f8e27d88 6373 # Code from module time_r:
8839a007 6374 # Code from module unistd:
6ec2e0f5 6375 # Code from module unistd-safer:
3d99e817 6376 # Code from module unsetenv:
c971b7fa 6377 # Code from module update-copyright:
8690e634
JK
6378 # Code from module verify:
6379 # Code from module wchar:
6380 # Code from module wctype-h:
c0c3707f
CB
6381 # Code from module windows-mutex:
6382 # Code from module windows-once:
6383 # Code from module windows-recmutex:
6384 # Code from module windows-rwlock:
6385 # Code from module xalloc-oversized:
c971b7fa 6386
c971b7fa 6387
c0c3707f 6388am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
c971b7fa 6389
c971b7fa 6390
c0c3707f
CB
6391{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
6392$as_echo_n "checking target system type... " >&6; }
6393if ${ac_cv_target+:} false; then :
c971b7fa
PA
6394 $as_echo_n "(cached) " >&6
6395else
c0c3707f
CB
6396 if test "x$target_alias" = x; then
6397 ac_cv_target=$ac_cv_host
5e8754f9 6398else
c0c3707f
CB
6399 ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
6400 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
5e8754f9 6401fi
7a6dbc2f 6402
c971b7fa 6403fi
c0c3707f
CB
6404{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
6405$as_echo "$ac_cv_target" >&6; }
6406case $ac_cv_target in
6407*-*-*) ;;
6408*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
6409esac
6410target=$ac_cv_target
6411ac_save_IFS=$IFS; IFS='-'
6412set x $ac_cv_target
6413shift
6414target_cpu=$1
6415target_vendor=$2
6416shift; shift
6417# Remember, the first character of IFS is used to create $*,
6418# except with old shells:
6419target_os=$*
6420IFS=$ac_save_IFS
6421case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
7a6dbc2f 6422
5e8754f9 6423
c0c3707f
CB
6424# The aliases save the names the user supplied, while $host etc.
6425# will get canonicalized.
6426test -n "$target_alias" &&
6427 test "$program_prefix$program_suffix$program_transform_name" = \
6428 NONENONEs,x,x, &&
6429 program_prefix=${target_alias}-
7a6dbc2f 6430
c0c3707f
CB
6431# The tests for host and target for $enable_largefile require
6432# canonical names.
7a6dbc2f 6433
5e8754f9 6434
c0c3707f
CB
6435
6436# As the $enable_largefile decision depends on --enable-plugins we must set it
6437# even in directories otherwise not depending on the $plugins option.
7a6dbc2f 6438
7a6dbc2f 6439
c0c3707f
CB
6440 maybe_plugins=no
6441 for ac_header in dlfcn.h
6442do :
6443 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
6444"
6445if test "x$ac_cv_header_dlfcn_h" = xyes; then :
6446 cat >>confdefs.h <<_ACEOF
6447#define HAVE_DLFCN_H 1
6448_ACEOF
6449 maybe_plugins=yes
c971b7fa 6450fi
c0c3707f 6451
5e8754f9 6452done
5e8754f9 6453
c0c3707f
CB
6454 for ac_header in windows.h
6455do :
6456 ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
6457"
6458if test "x$ac_cv_header_windows_h" = xyes; then :
6459 cat >>confdefs.h <<_ACEOF
6460#define HAVE_WINDOWS_H 1
6461_ACEOF
6462 maybe_plugins=yes
c971b7fa 6463fi
7a6dbc2f 6464
c0c3707f
CB
6465done
6466
6467
6468 # Check whether --enable-plugins was given.
6469if test "${enable_plugins+set}" = set; then :
6470 enableval=$enable_plugins; case "${enableval}" in
6471 no) plugins=no ;;
6472 *) plugins=yes
6473 if test "$maybe_plugins" != "yes" ; then
6474 as_fn_error $? "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
6475 fi ;;
6476 esac
6477else
6478 plugins=$maybe_plugins
5e8754f9 6479
5e8754f9 6480fi
c0c3707f
CB
6481
6482 if test "$plugins" = "yes"; then
6483 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5
6484$as_echo_n "checking for library containing dlsym... " >&6; }
6485if ${ac_cv_search_dlsym+:} false; then :
c971b7fa
PA
6486 $as_echo_n "(cached) " >&6
6487else
c0c3707f
CB
6488 ac_func_search_save_LIBS=$LIBS
6489cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6490/* end confdefs.h. */
6491
6492/* Override any GCC internal prototype to avoid an error.
6493 Use char because int might match the return type of a GCC
6494 builtin and then its argument prototype would still apply. */
6495#ifdef __cplusplus
6496extern "C"
6497#endif
6498char dlsym ();
6499int
6500main ()
6501{
6502return dlsym ();
6503 ;
6504 return 0;
6505}
6506_ACEOF
6507for ac_lib in '' dl; do
6508 if test -z "$ac_lib"; then
6509 ac_res="none required"
6510 else
6511 ac_res=-l$ac_lib
6512 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
5e8754f9 6513 fi
c0c3707f
CB
6514 if ac_fn_c_try_link "$LINENO"; then :
6515 ac_cv_search_dlsym=$ac_res
6516fi
6517rm -f core conftest.err conftest.$ac_objext \
6518 conftest$ac_exeext
6519 if ${ac_cv_search_dlsym+:} false; then :
6520 break
6521fi
5e8754f9 6522done
c0c3707f 6523if ${ac_cv_search_dlsym+:} false; then :
5e8754f9 6524
c0c3707f
CB
6525else
6526 ac_cv_search_dlsym=no
5e8754f9 6527fi
c0c3707f
CB
6528rm conftest.$ac_ext
6529LIBS=$ac_func_search_save_LIBS
5e8754f9 6530fi
c0c3707f
CB
6531{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5
6532$as_echo "$ac_cv_search_dlsym" >&6; }
6533ac_res=$ac_cv_search_dlsym
6534if test "$ac_res" != no; then :
6535 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6536
5e8754f9
SDJ
6537fi
6538
c0c3707f 6539 fi
5e8754f9 6540
5e8754f9 6541
c0c3707f
CB
6542case "${host}" in
6543 sparc-*-solaris*|i[3-7]86-*-solaris*)
6544 # On native 32bit sparc and ia32 solaris, large-file and procfs support
6545 # are mutually exclusive; and without procfs support, the bfd/ elf module
6546 # cannot provide certain routines such as elfcore_write_prpsinfo
6547 # or elfcore_write_prstatus. So unless the user explicitly requested
6548 # large-file support through the --enable-largefile switch, disable
6549 # large-file support in favor of procfs support.
6550 test "${target}" = "${host}" -a "x$plugins" = xno \
6551 && : ${enable_largefile="no"}
6552 ;;
5e8754f9 6553esac
5e8754f9 6554
c0c3707f
CB
6555# Check whether --enable-largefile was given.
6556if test "${enable_largefile+set}" = set; then :
6557 enableval=$enable_largefile;
5e8754f9
SDJ
6558fi
6559
c0c3707f 6560if test "$enable_largefile" != no; then
5e8754f9 6561
c0c3707f
CB
6562 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
6563$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
6564if ${ac_cv_sys_largefile_CC+:} false; then :
5e8754f9 6565 $as_echo_n "(cached) " >&6
7a6dbc2f 6566else
c0c3707f
CB
6567 ac_cv_sys_largefile_CC=no
6568 if test "$GCC" != yes; then
6569 ac_save_CC=$CC
6570 while :; do
6571 # IRIX 6.2 and later do not support large files by default,
6572 # so use the C compiler's -n32 option if that helps.
6573 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 6574/* end confdefs.h. */
c0c3707f
CB
6575#include <sys/types.h>
6576 /* Check that off_t can represent 2**63 - 1 correctly.
6577 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6578 since some C++ compilers masquerading as C compilers
6579 incorrectly reject 9223372036854775807. */
6580#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6581 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6582 && LARGE_OFF_T % 2147483647 == 1)
6583 ? 1 : -1];
c971b7fa 6584int
5e8754f9 6585main ()
c971b7fa 6586{
5e8754f9
SDJ
6587
6588 ;
6589 return 0;
c971b7fa
PA
6590}
6591_ACEOF
c0c3707f
CB
6592 if ac_fn_c_try_compile "$LINENO"; then :
6593 break
c971b7fa 6594fi
c0c3707f
CB
6595rm -f core conftest.err conftest.$ac_objext
6596 CC="$CC -n32"
6597 if ac_fn_c_try_compile "$LINENO"; then :
6598 ac_cv_sys_largefile_CC=' -n32'; break
c971b7fa 6599fi
c0c3707f
CB
6600rm -f core conftest.err conftest.$ac_objext
6601 break
6602 done
6603 CC=$ac_save_CC
6604 rm -f conftest.$ac_ext
6605 fi
d0ac1c44 6606fi
c0c3707f
CB
6607{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
6608$as_echo "$ac_cv_sys_largefile_CC" >&6; }
6609 if test "$ac_cv_sys_largefile_CC" != no; then
6610 CC=$CC$ac_cv_sys_largefile_CC
6611 fi
6612
6613 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
6614$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
6615if ${ac_cv_sys_file_offset_bits+:} false; then :
5e8754f9
SDJ
6616 $as_echo_n "(cached) " >&6
6617else
c0c3707f
CB
6618 while :; do
6619 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 6620/* end confdefs.h. */
c0c3707f
CB
6621#include <sys/types.h>
6622 /* Check that off_t can represent 2**63 - 1 correctly.
6623 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6624 since some C++ compilers masquerading as C compilers
6625 incorrectly reject 9223372036854775807. */
6626#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6627 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6628 && LARGE_OFF_T % 2147483647 == 1)
6629 ? 1 : -1];
5e8754f9
SDJ
6630int
6631main ()
6632{
c971b7fa 6633
5e8754f9
SDJ
6634 ;
6635 return 0;
6636}
6637_ACEOF
6638if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
6639 ac_cv_sys_file_offset_bits=no; break
6640fi
6641rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6642 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 6643/* end confdefs.h. */
c0c3707f
CB
6644#define _FILE_OFFSET_BITS 64
6645#include <sys/types.h>
6646 /* Check that off_t can represent 2**63 - 1 correctly.
6647 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6648 since some C++ compilers masquerading as C compilers
6649 incorrectly reject 9223372036854775807. */
6650#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6651 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6652 && LARGE_OFF_T % 2147483647 == 1)
6653 ? 1 : -1];
5e8754f9
SDJ
6654int
6655main ()
6656{
c971b7fa 6657
5e8754f9
SDJ
6658 ;
6659 return 0;
6660}
6661_ACEOF
6662if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
6663 ac_cv_sys_file_offset_bits=64; break
6664fi
6665rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6666 ac_cv_sys_file_offset_bits=unknown
6667 break
6668done
6669fi
6670{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
6671$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
6672case $ac_cv_sys_file_offset_bits in #(
6673 no | unknown) ;;
6674 *)
6675cat >>confdefs.h <<_ACEOF
6676#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
6677_ACEOF
6678;;
6679esac
6680rm -rf conftest*
6681 if test $ac_cv_sys_file_offset_bits = unknown; then
6682 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
6683$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
6684if ${ac_cv_sys_large_files+:} false; then :
6685 $as_echo_n "(cached) " >&6
5e8754f9 6686else
c0c3707f
CB
6687 while :; do
6688 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 6689/* end confdefs.h. */
c0c3707f
CB
6690#include <sys/types.h>
6691 /* Check that off_t can represent 2**63 - 1 correctly.
6692 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6693 since some C++ compilers masquerading as C compilers
6694 incorrectly reject 9223372036854775807. */
6695#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6696 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6697 && LARGE_OFF_T % 2147483647 == 1)
6698 ? 1 : -1];
5e8754f9
SDJ
6699int
6700main ()
6701{
c971b7fa 6702
5e8754f9
SDJ
6703 ;
6704 return 0;
6705}
7a6dbc2f 6706_ACEOF
5e8754f9 6707if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 6708 ac_cv_sys_large_files=no; break
5e8754f9
SDJ
6709fi
6710rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f
CB
6711 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6712/* end confdefs.h. */
6713#define _LARGE_FILES 1
6714#include <sys/types.h>
6715 /* Check that off_t can represent 2**63 - 1 correctly.
6716 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6717 since some C++ compilers masquerading as C compilers
6718 incorrectly reject 9223372036854775807. */
6719#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6720 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6721 && LARGE_OFF_T % 2147483647 == 1)
6722 ? 1 : -1];
6723int
6724main ()
6725{
6726
6727 ;
6728 return 0;
6729}
6730_ACEOF
6731if ac_fn_c_try_compile "$LINENO"; then :
6732 ac_cv_sys_large_files=1; break
5e8754f9
SDJ
6733fi
6734rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f
CB
6735 ac_cv_sys_large_files=unknown
6736 break
6737done
5e8754f9 6738fi
c0c3707f
CB
6739{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
6740$as_echo "$ac_cv_sys_large_files" >&6; }
6741case $ac_cv_sys_large_files in #(
6742 no | unknown) ;;
6743 *)
6744cat >>confdefs.h <<_ACEOF
6745#define _LARGE_FILES $ac_cv_sys_large_files
6746_ACEOF
6747;;
6748esac
6749rm -rf conftest*
5e8754f9 6750 fi
c0c3707f
CB
6751
6752
6753$as_echo "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h
6754
5e8754f9 6755fi
c971b7fa
PA
6756
6757
6758
c0c3707f
CB
6759ac_aux_dir=
6760for ac_dir in .. "$srcdir"/..; do
6761 if test -f "$ac_dir/install-sh"; then
6762 ac_aux_dir=$ac_dir
6763 ac_install_sh="$ac_aux_dir/install-sh -c"
6764 break
6765 elif test -f "$ac_dir/install.sh"; then
6766 ac_aux_dir=$ac_dir
6767 ac_install_sh="$ac_aux_dir/install.sh -c"
6768 break
6769 elif test -f "$ac_dir/shtool"; then
6770 ac_aux_dir=$ac_dir
6771 ac_install_sh="$ac_aux_dir/shtool install -c"
6772 break
6773 fi
6774done
6775if test -z "$ac_aux_dir"; then
6776 as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5
6777fi
6778
6779# These three variables are undocumented and unsupported,
6780# and are intended to be withdrawn in a future Autoconf release.
6781# They can cause serious problems if a builder's source tree is in a directory
6782# whose full name contains unusual characters.
6783ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
6784ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
6785ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796 # Check whether --enable-cross-guesses was given.
6797if test "${enable_cross_guesses+set}" = set; then :
6798 enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
6799 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5
6800$as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;}
6801 enableval=conservative
6802 fi
6803 gl_cross_guesses="$enableval"
6804else
6805 gl_cross_guesses=conservative
6806fi
6807
6808 if test $gl_cross_guesses = risky; then
6809 gl_cross_guess_normal="guessing yes"
6810 gl_cross_guess_inverted="guessing no"
6811 else
6812 gl_cross_guess_normal="guessing no"
6813 gl_cross_guess_inverted="guessing yes"
6814 fi
6815 LIBC_FATAL_STDERR_=1
6816 export LIBC_FATAL_STDERR_
6817
6818ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
6819if test "x$ac_cv_type_size_t" = xyes; then :
6820
6821else
6822
6823cat >>confdefs.h <<_ACEOF
6824#define size_t unsigned int
6825_ACEOF
6826
6827fi
6828
6829# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
6830# for constant arguments. Useless!
6831{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
6832$as_echo_n "checking for working alloca.h... " >&6; }
6833if ${ac_cv_working_alloca_h+:} false; then :
6834 $as_echo_n "(cached) " >&6
6835else
6836 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6837/* end confdefs.h. */
6838#include <alloca.h>
5e8754f9
SDJ
6839int
6840main ()
6841{
c0c3707f
CB
6842char *p = (char *) alloca (2 * sizeof (int));
6843 if (p) return 0;
5e8754f9
SDJ
6844 ;
6845 return 0;
6846}
6847_ACEOF
c0c3707f
CB
6848if ac_fn_c_try_link "$LINENO"; then :
6849 ac_cv_working_alloca_h=yes
6850else
6851 ac_cv_working_alloca_h=no
5e8754f9 6852fi
c0c3707f
CB
6853rm -f core conftest.err conftest.$ac_objext \
6854 conftest$ac_exeext conftest.$ac_ext
5e8754f9 6855fi
c0c3707f
CB
6856{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
6857$as_echo "$ac_cv_working_alloca_h" >&6; }
6858if test $ac_cv_working_alloca_h = yes; then
c971b7fa 6859
c0c3707f 6860$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
c971b7fa 6861
c0c3707f 6862fi
d0ac1c44 6863
c0c3707f
CB
6864{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
6865$as_echo_n "checking for alloca... " >&6; }
6866if ${ac_cv_func_alloca_works+:} false; then :
5e8754f9
SDJ
6867 $as_echo_n "(cached) " >&6
6868else
6869 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6870/* end confdefs.h. */
c0c3707f
CB
6871#ifdef __GNUC__
6872# define alloca __builtin_alloca
6873#else
6874# ifdef _MSC_VER
6875# include <malloc.h>
6876# define alloca _alloca
6877# else
6878# ifdef HAVE_ALLOCA_H
6879# include <alloca.h>
6880# else
6881# ifdef _AIX
6882 #pragma alloca
6883# else
6884# ifndef alloca /* predefined by HP cc +Olibcalls */
6885void *alloca (size_t);
6886# endif
6887# endif
6888# endif
6889# endif
6890#endif
d0ac1c44 6891
5e8754f9
SDJ
6892int
6893main ()
6894{
c0c3707f
CB
6895char *p = (char *) alloca (1);
6896 if (p) return 0;
5e8754f9
SDJ
6897 ;
6898 return 0;
6899}
6900_ACEOF
c0c3707f
CB
6901if ac_fn_c_try_link "$LINENO"; then :
6902 ac_cv_func_alloca_works=yes
6903else
6904 ac_cv_func_alloca_works=no
5e8754f9 6905fi
c0c3707f
CB
6906rm -f core conftest.err conftest.$ac_objext \
6907 conftest$ac_exeext conftest.$ac_ext
6908fi
6909{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
6910$as_echo "$ac_cv_func_alloca_works" >&6; }
7a6dbc2f 6911
c0c3707f 6912if test $ac_cv_func_alloca_works = yes; then
7a6dbc2f 6913
c0c3707f 6914$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
7a6dbc2f 6915
5e8754f9 6916else
c0c3707f
CB
6917 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
6918# that cause trouble. Some versions do not even contain alloca or
6919# contain a buggy version. If you still want to use their alloca,
6920# use ar to extract alloca.o from them instead of compiling alloca.c.
c971b7fa
PA
6921
6922
7a6dbc2f 6923
73cc7272
TT
6924
6925
c0c3707f 6926ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
73cc7272 6927
c0c3707f 6928$as_echo "#define C_ALLOCA 1" >>confdefs.h
73cc7272
TT
6929
6930
c0c3707f
CB
6931{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
6932$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
6933if ${ac_cv_os_cray+:} false; then :
6934 $as_echo_n "(cached) " >&6
6935else
6936 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6937/* end confdefs.h. */
6938#if defined CRAY && ! defined CRAY2
6939webecray
6940#else
6941wenotbecray
6942#endif
73cc7272 6943
73cc7272 6944_ACEOF
c0c3707f
CB
6945if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6946 $EGREP "webecray" >/dev/null 2>&1; then :
6947 ac_cv_os_cray=yes
6948else
6949 ac_cv_os_cray=no
73cc7272 6950fi
c0c3707f 6951rm -f conftest*
73cc7272 6952
c0c3707f
CB
6953fi
6954{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
6955$as_echo "$ac_cv_os_cray" >&6; }
6956if test $ac_cv_os_cray = yes; then
6957 for ac_func in _getb67 GETB67 getb67; do
6958 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
6959ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
6960if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
73cc7272 6961
c0c3707f
CB
6962cat >>confdefs.h <<_ACEOF
6963#define CRAY_STACKSEG_END $ac_func
6964_ACEOF
73cc7272 6965
c0c3707f
CB
6966 break
6967fi
73cc7272 6968
c0c3707f 6969 done
73cc7272
TT
6970fi
6971
c0c3707f
CB
6972{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
6973$as_echo_n "checking stack direction for C alloca... " >&6; }
6974if ${ac_cv_c_stack_direction+:} false; then :
73cc7272
TT
6975 $as_echo_n "(cached) " >&6
6976else
c0c3707f
CB
6977 if test "$cross_compiling" = yes; then :
6978 ac_cv_c_stack_direction=0
6979else
6980 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 6981/* end confdefs.h. */
c0c3707f
CB
6982$ac_includes_default
6983int
6984find_stack_direction (int *addr, int depth)
6985{
6986 int dir, dummy = 0;
6987 if (! addr)
6988 addr = &dummy;
6989 *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
6990 dir = depth ? find_stack_direction (addr, depth - 1) : 0;
6991 return dir + dummy;
6992}
73cc7272 6993
73cc7272 6994int
c0c3707f 6995main (int argc, char **argv)
73cc7272 6996{
c0c3707f 6997 return find_stack_direction (0, argc + !argv + 20) < 0;
73cc7272
TT
6998}
6999_ACEOF
c0c3707f
CB
7000if ac_fn_c_try_run "$LINENO"; then :
7001 ac_cv_c_stack_direction=1
7002else
7003 ac_cv_c_stack_direction=-1
73cc7272 7004fi
c0c3707f
CB
7005rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7006 conftest.$ac_objext conftest.beam conftest.$ac_ext
73cc7272 7007fi
73cc7272 7008
73cc7272 7009fi
c0c3707f
CB
7010{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
7011$as_echo "$ac_cv_c_stack_direction" >&6; }
7012cat >>confdefs.h <<_ACEOF
7013#define STACK_DIRECTION $ac_cv_c_stack_direction
7014_ACEOF
7015
73cc7272
TT
7016
7017fi
7018
73cc7272 7019
c0c3707f
CB
7020 GNULIB_INET_NTOP=0;
7021 GNULIB_INET_PTON=0;
7022 HAVE_DECL_INET_NTOP=1;
7023 HAVE_DECL_INET_PTON=1;
7024 REPLACE_INET_NTOP=0;
7025 REPLACE_INET_PTON=0;
73cc7272 7026
73cc7272 7027
c0c3707f
CB
7028
7029
7030 for ac_header in $ac_header_list
7031do :
7032 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7033ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7034"
7035if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7036 cat >>confdefs.h <<_ACEOF
7037#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7038_ACEOF
7039
73cc7272
TT
7040fi
7041
c0c3707f 7042done
73cc7272 7043
c0c3707f
CB
7044
7045
7046
7047
7048 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
7049$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
7050if ${gl_cv_have_include_next+:} false; then :
73cc7272
TT
7051 $as_echo_n "(cached) " >&6
7052else
c0c3707f
CB
7053 rm -rf conftestd1a conftestd1b conftestd2
7054 mkdir conftestd1a conftestd1b conftestd2
7055 cat <<EOF > conftestd1a/conftest.h
7056#define DEFINED_IN_CONFTESTD1
7057#include_next <conftest.h>
7058#ifdef DEFINED_IN_CONFTESTD2
7059int foo;
7060#else
7061#error "include_next doesn't work"
7062#endif
7063EOF
7064 cat <<EOF > conftestd1b/conftest.h
7065#define DEFINED_IN_CONFTESTD1
7066#include <stdio.h>
7067#include_next <conftest.h>
7068#ifdef DEFINED_IN_CONFTESTD2
7069int foo;
7070#else
7071#error "include_next doesn't work"
7072#endif
7073EOF
7074 cat <<EOF > conftestd2/conftest.h
7075#ifndef DEFINED_IN_CONFTESTD1
7076#error "include_next test doesn't work"
7077#endif
7078#define DEFINED_IN_CONFTESTD2
7079EOF
7080 gl_save_CPPFLAGS="$CPPFLAGS"
7081 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
7082 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7083/* end confdefs.h. */
c0c3707f 7084#include <conftest.h>
73cc7272 7085_ACEOF
c0c3707f
CB
7086if ac_fn_c_try_compile "$LINENO"; then :
7087 gl_cv_have_include_next=yes
7088else
7089 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
7090 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7091/* end confdefs.h. */
7092#include <conftest.h>
7093_ACEOF
7094if ac_fn_c_try_compile "$LINENO"; then :
7095 gl_cv_have_include_next=buggy
7096else
7097 gl_cv_have_include_next=no
73cc7272 7098fi
c0c3707f
CB
7099rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7100
73cc7272 7101fi
c0c3707f
CB
7102rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7103 CPPFLAGS="$gl_save_CPPFLAGS"
7104 rm -rf conftestd1a conftestd1b conftestd2
7105
73cc7272 7106fi
c0c3707f
CB
7107{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
7108$as_echo "$gl_cv_have_include_next" >&6; }
7109 PRAGMA_SYSTEM_HEADER=
7110 if test $gl_cv_have_include_next = yes; then
7111 INCLUDE_NEXT=include_next
7112 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7113 if test -n "$GCC"; then
7114 PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
7115 fi
7116 else
7117 if test $gl_cv_have_include_next = buggy; then
7118 INCLUDE_NEXT=include
7119 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7120 else
7121 INCLUDE_NEXT=include
7122 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
7123 fi
73cc7272
TT
7124 fi
7125
73cc7272 7126
73cc7272 7127
c0c3707f
CB
7128 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5
7129$as_echo_n "checking whether system header files limit the line length... " >&6; }
7130if ${gl_cv_pragma_columns+:} false; then :
73cc7272
TT
7131 $as_echo_n "(cached) " >&6
7132else
c0c3707f 7133 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7134/* end confdefs.h. */
73cc7272 7135
c0c3707f
CB
7136#ifdef __TANDEM
7137choke me
7138#endif
73cc7272 7139
73cc7272 7140_ACEOF
c0c3707f
CB
7141if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7142 $EGREP "choke me" >/dev/null 2>&1; then :
7143 gl_cv_pragma_columns=yes
7144else
7145 gl_cv_pragma_columns=no
73cc7272 7146fi
c0c3707f 7147rm -f conftest*
73cc7272 7148
73cc7272
TT
7149
7150fi
c0c3707f
CB
7151{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5
7152$as_echo "$gl_cv_pragma_columns" >&6; }
7153 if test $gl_cv_pragma_columns = yes; then
7154 PRAGMA_COLUMNS="#pragma COLUMNS 10000"
7155 else
7156 PRAGMA_COLUMNS=
7157 fi
73cc7272
TT
7158
7159
7160
73cc7272 7161
73cc7272
TT
7162
7163
c0c3707f
CB
7164 if test $ac_cv_header_features_h = yes; then
7165 HAVE_FEATURES_H=1
7166 else
7167 HAVE_FEATURES_H=0
7168 fi
73cc7272 7169
7a6dbc2f
SDJ
7170
7171
7172
7173
c0c3707f
CB
7174 if test $ac_cv_header_sys_socket_h = no; then
7175 for ac_header in ws2tcpip.h
7176do :
7177 ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
7178if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
7179 cat >>confdefs.h <<_ACEOF
7180#define HAVE_WS2TCPIP_H 1
7181_ACEOF
7a6dbc2f 7182
c0c3707f 7183fi
7a6dbc2f 7184
c0c3707f 7185done
7a6dbc2f 7186
c0c3707f 7187 fi
7a6dbc2f 7188
c0c3707f
CB
7189{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7190$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7191if test -z "$MKDIR_P"; then
7192 if ${ac_cv_path_mkdir+:} false; then :
7193 $as_echo_n "(cached) " >&6
5e8754f9 7194else
c0c3707f
CB
7195 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7196for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7197do
7198 IFS=$as_save_IFS
7199 test -z "$as_dir" && as_dir=.
7200 for ac_prog in mkdir gmkdir; do
7201 for ac_exec_ext in '' $ac_executable_extensions; do
7202 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7203 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7204 'mkdir (GNU coreutils) '* | \
7205 'mkdir (coreutils) '* | \
7206 'mkdir (fileutils) '4.1*)
7207 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7208 break 3;;
7209 esac
7210 done
7211 done
7212 done
7213IFS=$as_save_IFS
7a6dbc2f 7214
5e8754f9 7215fi
7a6dbc2f 7216
c0c3707f
CB
7217 test -d ./--version && rmdir ./--version
7218 if test "${ac_cv_path_mkdir+set}" = set; then
7219 MKDIR_P="$ac_cv_path_mkdir -p"
7220 else
7221 # As a last resort, use the slow shell script. Don't cache a
7222 # value for MKDIR_P within a source directory, because that will
7223 # break other packages using the cache if that directory is
7224 # removed, or if the value is a relative name.
7225 MKDIR_P="$ac_install_sh -d"
7226 fi
5e8754f9 7227fi
c0c3707f
CB
7228{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7229$as_echo "$MKDIR_P" >&6; }
7a6dbc2f 7230
5e8754f9 7231
c0c3707f
CB
7232 GNULIB__EXIT=0;
7233 GNULIB_ATOLL=0;
7234 GNULIB_CALLOC_POSIX=0;
7235 GNULIB_CANONICALIZE_FILE_NAME=0;
7236 GNULIB_GETLOADAVG=0;
7237 GNULIB_GETSUBOPT=0;
7238 GNULIB_GRANTPT=0;
7239 GNULIB_MALLOC_POSIX=0;
7240 GNULIB_MBTOWC=0;
7241 GNULIB_MKDTEMP=0;
7242 GNULIB_MKOSTEMP=0;
7243 GNULIB_MKOSTEMPS=0;
7244 GNULIB_MKSTEMP=0;
7245 GNULIB_MKSTEMPS=0;
7246 GNULIB_POSIX_OPENPT=0;
7247 GNULIB_PTSNAME=0;
7248 GNULIB_PTSNAME_R=0;
7249 GNULIB_PUTENV=0;
7250 GNULIB_QSORT_R=0;
7251 GNULIB_RANDOM=0;
7252 GNULIB_RANDOM_R=0;
7253 GNULIB_REALLOCARRAY=0;
7254 GNULIB_REALLOC_POSIX=0;
7255 GNULIB_REALPATH=0;
7256 GNULIB_RPMATCH=0;
7257 GNULIB_SECURE_GETENV=0;
7258 GNULIB_SETENV=0;
7259 GNULIB_STRTOD=0;
7260 GNULIB_STRTOLD=0;
7261 GNULIB_STRTOLL=0;
7262 GNULIB_STRTOULL=0;
7263 GNULIB_SYSTEM_POSIX=0;
7264 GNULIB_UNLOCKPT=0;
7265 GNULIB_UNSETENV=0;
7266 GNULIB_WCTOMB=0;
7267 HAVE__EXIT=1;
7268 HAVE_ATOLL=1;
7269 HAVE_CANONICALIZE_FILE_NAME=1;
7270 HAVE_DECL_GETLOADAVG=1;
7271 HAVE_GETSUBOPT=1;
7272 HAVE_GRANTPT=1;
7273 HAVE_INITSTATE=1;
7274 HAVE_DECL_INITSTATE=1;
7275 HAVE_MBTOWC=1;
7276 HAVE_MKDTEMP=1;
7277 HAVE_MKOSTEMP=1;
7278 HAVE_MKOSTEMPS=1;
7279 HAVE_MKSTEMP=1;
7280 HAVE_MKSTEMPS=1;
7281 HAVE_POSIX_OPENPT=1;
7282 HAVE_PTSNAME=1;
7283 HAVE_PTSNAME_R=1;
7284 HAVE_QSORT_R=1;
7285 HAVE_RANDOM=1;
7286 HAVE_RANDOM_H=1;
7287 HAVE_RANDOM_R=1;
7288 HAVE_REALLOCARRAY=1;
7289 HAVE_REALPATH=1;
7290 HAVE_RPMATCH=1;
7291 HAVE_SECURE_GETENV=1;
7292 HAVE_SETENV=1;
7293 HAVE_DECL_SETENV=1;
7294 HAVE_SETSTATE=1;
7295 HAVE_DECL_SETSTATE=1;
7296 HAVE_STRTOD=1;
7297 HAVE_STRTOLD=1;
7298 HAVE_STRTOLL=1;
7299 HAVE_STRTOULL=1;
7300 HAVE_STRUCT_RANDOM_DATA=1;
7301 HAVE_SYS_LOADAVG_H=0;
7302 HAVE_UNLOCKPT=1;
7303 HAVE_DECL_UNSETENV=1;
7304 REPLACE_CALLOC=0;
7305 REPLACE_CANONICALIZE_FILE_NAME=0;
7306 REPLACE_INITSTATE=0;
7307 REPLACE_MALLOC=0;
7308 REPLACE_MBTOWC=0;
7309 REPLACE_MKSTEMP=0;
7310 REPLACE_PTSNAME=0;
7311 REPLACE_PTSNAME_R=0;
7312 REPLACE_PUTENV=0;
7313 REPLACE_QSORT_R=0;
7314 REPLACE_RANDOM=0;
7315 REPLACE_RANDOM_R=0;
7316 REPLACE_REALLOC=0;
7317 REPLACE_REALPATH=0;
7318 REPLACE_SETENV=0;
7319 REPLACE_SETSTATE=0;
7320 REPLACE_STRTOD=0;
7321 REPLACE_STRTOLD=0;
7322 REPLACE_UNSETENV=0;
7323 REPLACE_WCTOMB=0;
7a6dbc2f 7324
7a6dbc2f 7325
98399780 7326
98399780 7327
c0c3707f
CB
7328 for ac_func in $ac_func_list
7329do :
7330 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
7331ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
7332if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
7333 cat >>confdefs.h <<_ACEOF
7334#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
7335_ACEOF
472fa5ee 7336
c0c3707f
CB
7337fi
7338done
472fa5ee
SM
7339
7340
7341
7342
7343
7344
7345
7346
7347
c0c3707f
CB
7348 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
7349$as_echo_n "checking whether // is distinct from /... " >&6; }
7350if ${gl_cv_double_slash_root+:} false; then :
7351 $as_echo_n "(cached) " >&6
5e8754f9 7352else
c0c3707f
CB
7353 if test x"$cross_compiling" = xyes ; then
7354 # When cross-compiling, there is no way to tell whether // is special
7355 # short of a list of hosts. However, the only known hosts to date
7356 # that have a distinct // are Apollo DomainOS (too old to port to),
7357 # Cygwin, and z/OS. If anyone knows of another system for which // has
7358 # special semantics and is distinct from /, please report it to
7359 # <bug-gnulib@gnu.org>.
7360 case $host in
7361 *-cygwin | i370-ibm-openedition)
7362 gl_cv_double_slash_root=yes ;;
7363 *)
7364 # Be optimistic and assume that / and // are the same when we
7365 # don't know.
7366 gl_cv_double_slash_root='unknown, assuming no' ;;
7367 esac
7368 else
7369 set x `ls -di / // 2>/dev/null`
7370 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
7371 gl_cv_double_slash_root=no
7372 else
7373 gl_cv_double_slash_root=yes
7374 fi
7375 fi
5e8754f9 7376fi
c0c3707f
CB
7377{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
7378$as_echo "$gl_cv_double_slash_root" >&6; }
7379 if test "$gl_cv_double_slash_root" = yes; then
472fa5ee 7380
c0c3707f 7381$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
472fa5ee 7382
c0c3707f 7383 fi
472fa5ee
SM
7384
7385
472fa5ee 7386
c0c3707f
CB
7387
7388
7389 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5
7390$as_echo_n "checking whether realpath works... " >&6; }
7391if ${gl_cv_func_realpath_works+:} false; then :
5e8754f9
SDJ
7392 $as_echo_n "(cached) " >&6
7393else
c0c3707f
CB
7394
7395 touch conftest.a
7396 mkdir conftest.d
7397 if test "$cross_compiling" = yes; then :
7398 case "$host_os" in
7399 # Guess yes on glibc systems.
7400 *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
7401 # Guess yes on musl systems.
7402 *-musl*) gl_cv_func_realpath_works="guessing yes" ;;
7403 # Guess no on native Windows.
7404 mingw*) gl_cv_func_realpath_works="guessing no" ;;
7405 # If we don't know, obey --enable-cross-guesses.
7406 *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
7407 esac
7408
5e8754f9
SDJ
7409else
7410 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7411/* end confdefs.h. */
c0c3707f
CB
7412
7413
7414
7415#include <stdlib.h>
7416#if defined __MACH__ && defined __APPLE__
7417/* Avoid a crash on Mac OS X. */
7418#include <mach/mach.h>
7419#include <mach/mach_error.h>
7420#include <mach/thread_status.h>
7421#include <mach/exception.h>
7422#include <mach/task.h>
7423#include <pthread.h>
7424/* The exception port on which our thread listens. */
7425static mach_port_t our_exception_port;
7426/* The main function of the thread listening for exceptions of type
7427 EXC_BAD_ACCESS. */
7428static void *
7429mach_exception_thread (void *arg)
5e8754f9 7430{
c0c3707f
CB
7431 /* Buffer for a message to be received. */
7432 struct {
7433 mach_msg_header_t head;
7434 mach_msg_body_t msgh_body;
7435 char data[1024];
7436 } msg;
7437 mach_msg_return_t retval;
7438 /* Wait for a message on the exception port. */
7439 retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
7440 our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
7441 if (retval != MACH_MSG_SUCCESS)
7442 abort ();
7443 exit (1);
7444}
7445static void
7446nocrash_init (void)
7447{
7448 mach_port_t self = mach_task_self ();
7449 /* Allocate a port on which the thread shall listen for exceptions. */
7450 if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
7451 == KERN_SUCCESS) {
7452 /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
7453 if (mach_port_insert_right (self, our_exception_port, our_exception_port,
7454 MACH_MSG_TYPE_MAKE_SEND)
7455 == KERN_SUCCESS) {
7456 /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
7457 for us. */
7458 exception_mask_t mask = EXC_MASK_BAD_ACCESS;
7459 /* Create the thread listening on the exception port. */
7460 pthread_attr_t attr;
7461 pthread_t thread;
7462 if (pthread_attr_init (&attr) == 0
7463 && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
7464 && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
7465 pthread_attr_destroy (&attr);
7466 /* Replace the exception port info for these exceptions with our own.
7467 Note that we replace the exception port for the entire task, not only
7468 for a particular thread. This has the effect that when our exception
7469 port gets the message, the thread specific exception port has already
7470 been asked, and we don't need to bother about it.
7471 See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
7472 task_set_exception_ports (self, mask, our_exception_port,
7473 EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
7474 }
7475 }
7476 }
7477}
7478#elif defined _WIN32 && ! defined __CYGWIN__
7479/* Avoid a crash on native Windows. */
7480#define WIN32_LEAN_AND_MEAN
7481#include <windows.h>
7482#include <winerror.h>
7483static LONG WINAPI
7484exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
7485{
7486 switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
7487 {
7488 case EXCEPTION_ACCESS_VIOLATION:
7489 case EXCEPTION_IN_PAGE_ERROR:
7490 case EXCEPTION_STACK_OVERFLOW:
7491 case EXCEPTION_GUARD_PAGE:
7492 case EXCEPTION_PRIV_INSTRUCTION:
7493 case EXCEPTION_ILLEGAL_INSTRUCTION:
7494 case EXCEPTION_DATATYPE_MISALIGNMENT:
7495 case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
7496 case EXCEPTION_NONCONTINUABLE_EXCEPTION:
7497 exit (1);
7498 }
7499 return EXCEPTION_CONTINUE_SEARCH;
7500}
7501static void
7502nocrash_init (void)
7503{
7504 SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
7505}
7506#else
7507/* Avoid a crash on POSIX systems. */
7508#include <signal.h>
7509#include <unistd.h>
7510/* A POSIX signal handler. */
7511static void
7512exception_handler (int sig)
7513{
7514 _exit (1);
7515}
7516static void
7517nocrash_init (void)
7518{
7519#ifdef SIGSEGV
7520 signal (SIGSEGV, exception_handler);
7521#endif
7522#ifdef SIGBUS
7523 signal (SIGBUS, exception_handler);
7524#endif
5e8754f9 7525}
c0c3707f
CB
7526#endif
7527
7528 #include <stdlib.h>
7529 #include <string.h>
472fa5ee 7530
5e8754f9 7531int
c0c3707f 7532main ()
5e8754f9 7533{
c0c3707f
CB
7534
7535 int result = 0;
7536 {
7537 char *name = realpath ("conftest.a", NULL);
7538 if (!(name && *name == '/'))
7539 result |= 1;
7540 free (name);
7541 }
7542 {
7543 char *name = realpath ("conftest.b/../conftest.a", NULL);
7544 if (name != NULL)
7545 result |= 2;
7546 free (name);
7547 }
7548 {
7549 char *name = realpath ("conftest.a/", NULL);
7550 if (name != NULL)
7551 result |= 4;
7552 free (name);
7553 }
7554 {
7555 char *name1 = realpath (".", NULL);
7556 char *name2 = realpath ("conftest.d//./..", NULL);
7557 if (! name1 || ! name2 || strcmp (name1, name2))
7558 result |= 8;
7559 free (name1);
7560 free (name2);
7561 }
7562 return result;
7563
7564 ;
7565 return 0;
5e8754f9 7566}
c0c3707f 7567
5e8754f9
SDJ
7568_ACEOF
7569if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 7570 gl_cv_func_realpath_works=yes
5e8754f9 7571else
c0c3707f 7572 gl_cv_func_realpath_works=no
5e8754f9
SDJ
7573fi
7574rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7575 conftest.$ac_objext conftest.beam conftest.$ac_ext
7576fi
472fa5ee 7577
c0c3707f 7578 rm -rf conftest.a conftest.d
98399780 7579
5e8754f9 7580fi
c0c3707f
CB
7581{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
7582$as_echo "$gl_cv_func_realpath_works" >&6; }
7583 case "$gl_cv_func_realpath_works" in
7584 *yes)
98399780 7585
c0c3707f 7586$as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
98399780 7587
c0c3707f
CB
7588 ;;
7589 esac
725e2999
JB
7590
7591
725e2999 7592
725e2999 7593
725e2999
JB
7594
7595
7596
7597
7598
7599
7600
c0c3707f
CB
7601 GNULIB_ACCESS=0;
7602 GNULIB_CHDIR=0;
7603 GNULIB_CHOWN=0;
7604 GNULIB_CLOSE=0;
7605 GNULIB_COPY_FILE_RANGE=0;
7606 GNULIB_DUP=0;
7607 GNULIB_DUP2=0;
7608 GNULIB_DUP3=0;
7609 GNULIB_ENVIRON=0;
7610 GNULIB_EUIDACCESS=0;
7611 GNULIB_FACCESSAT=0;
7612 GNULIB_FCHDIR=0;
7613 GNULIB_FCHOWNAT=0;
7614 GNULIB_FDATASYNC=0;
7615 GNULIB_FSYNC=0;
7616 GNULIB_FTRUNCATE=0;
7617 GNULIB_GETCWD=0;
7618 GNULIB_GETDOMAINNAME=0;
7619 GNULIB_GETDTABLESIZE=0;
7620 GNULIB_GETGROUPS=0;
7621 GNULIB_GETHOSTNAME=0;
7622 GNULIB_GETLOGIN=0;
7623 GNULIB_GETLOGIN_R=0;
7624 GNULIB_GETPAGESIZE=0;
7625 GNULIB_GETPASS=0;
7626 GNULIB_GETUSERSHELL=0;
7627 GNULIB_GROUP_MEMBER=0;
7628 GNULIB_ISATTY=0;
7629 GNULIB_LCHOWN=0;
7630 GNULIB_LINK=0;
7631 GNULIB_LINKAT=0;
7632 GNULIB_LSEEK=0;
7633 GNULIB_PIPE=0;
7634 GNULIB_PIPE2=0;
7635 GNULIB_PREAD=0;
7636 GNULIB_PWRITE=0;
7637 GNULIB_READ=0;
7638 GNULIB_READLINK=0;
7639 GNULIB_READLINKAT=0;
7640 GNULIB_RMDIR=0;
7641 GNULIB_SETHOSTNAME=0;
7642 GNULIB_SLEEP=0;
7643 GNULIB_SYMLINK=0;
7644 GNULIB_SYMLINKAT=0;
7645 GNULIB_TRUNCATE=0;
7646 GNULIB_TTYNAME_R=0;
7647 GNULIB_UNISTD_H_NONBLOCKING=0;
7648 GNULIB_UNISTD_H_SIGPIPE=0;
7649 GNULIB_UNLINK=0;
7650 GNULIB_UNLINKAT=0;
7651 GNULIB_USLEEP=0;
7652 GNULIB_WRITE=0;
7653 HAVE_CHOWN=1;
7654 HAVE_COPY_FILE_RANGE=1;
7655 HAVE_DUP2=1;
7656 HAVE_DUP3=1;
7657 HAVE_EUIDACCESS=1;
7658 HAVE_FACCESSAT=1;
7659 HAVE_FCHDIR=1;
7660 HAVE_FCHOWNAT=1;
7661 HAVE_FDATASYNC=1;
7662 HAVE_FSYNC=1;
7663 HAVE_FTRUNCATE=1;
7664 HAVE_GETDTABLESIZE=1;
7665 HAVE_GETGROUPS=1;
7666 HAVE_GETHOSTNAME=1;
7667 HAVE_GETLOGIN=1;
7668 HAVE_GETPAGESIZE=1;
7669 HAVE_GETPASS=1;
7670 HAVE_GROUP_MEMBER=1;
7671 HAVE_LCHOWN=1;
7672 HAVE_LINK=1;
7673 HAVE_LINKAT=1;
7674 HAVE_PIPE=1;
7675 HAVE_PIPE2=1;
7676 HAVE_PREAD=1;
7677 HAVE_PWRITE=1;
7678 HAVE_READLINK=1;
7679 HAVE_READLINKAT=1;
7680 HAVE_SETHOSTNAME=1;
7681 HAVE_SLEEP=1;
7682 HAVE_SYMLINK=1;
7683 HAVE_SYMLINKAT=1;
7684 HAVE_UNLINKAT=1;
7685 HAVE_USLEEP=1;
7686 HAVE_DECL_ENVIRON=1;
7687 HAVE_DECL_FCHDIR=1;
7688 HAVE_DECL_FDATASYNC=1;
7689 HAVE_DECL_GETDOMAINNAME=1;
7690 HAVE_DECL_GETLOGIN=1;
7691 HAVE_DECL_GETLOGIN_R=1;
7692 HAVE_DECL_GETPAGESIZE=1;
7693 HAVE_DECL_GETUSERSHELL=1;
7694 HAVE_DECL_SETHOSTNAME=1;
7695 HAVE_DECL_TRUNCATE=1;
7696 HAVE_DECL_TTYNAME_R=1;
7697 HAVE_OS_H=0;
7698 HAVE_SYS_PARAM_H=0;
7699 REPLACE_ACCESS=0;
7700 REPLACE_CHOWN=0;
7701 REPLACE_CLOSE=0;
7702 REPLACE_DUP=0;
7703 REPLACE_DUP2=0;
7704 REPLACE_FACCESSAT=0;
7705 REPLACE_FCHOWNAT=0;
7706 REPLACE_FTRUNCATE=0;
7707 REPLACE_GETCWD=0;
7708 REPLACE_GETDOMAINNAME=0;
7709 REPLACE_GETDTABLESIZE=0;
7710 REPLACE_GETLOGIN_R=0;
7711 REPLACE_GETGROUPS=0;
7712 REPLACE_GETPAGESIZE=0;
7713 REPLACE_GETPASS=0;
7714 REPLACE_ISATTY=0;
7715 REPLACE_LCHOWN=0;
7716 REPLACE_LINK=0;
7717 REPLACE_LINKAT=0;
7718 REPLACE_LSEEK=0;
7719 REPLACE_PREAD=0;
7720 REPLACE_PWRITE=0;
7721 REPLACE_READ=0;
7722 REPLACE_READLINK=0;
7723 REPLACE_READLINKAT=0;
7724 REPLACE_RMDIR=0;
7725 REPLACE_SLEEP=0;
7726 REPLACE_SYMLINK=0;
7727 REPLACE_SYMLINKAT=0;
7728 REPLACE_TRUNCATE=0;
7729 REPLACE_TTYNAME_R=0;
7730 REPLACE_UNLINK=0;
7731 REPLACE_UNLINKAT=0;
7732 REPLACE_USLEEP=0;
7733 REPLACE_WRITE=0;
7734 UNISTD_H_HAVE_WINSOCK2_H=0;
7735 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
725e2999 7736
725e2999 7737
725e2999
JB
7738
7739
7740
725e2999 7741
725e2999 7742
725e2999
JB
7743
7744
c0c3707f
CB
7745
7746
7747 if test $ac_cv_func__set_invalid_parameter_handler = yes; then
7748 HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
7749
7750$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
7751
725e2999 7752 else
c0c3707f 7753 HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
725e2999
JB
7754 fi
7755
7756
7757
7758
7759
c0c3707f
CB
7760 GNULIB_OPENDIR=0;
7761 GNULIB_READDIR=0;
7762 GNULIB_REWINDDIR=0;
7763 GNULIB_CLOSEDIR=0;
7764 GNULIB_DIRFD=0;
7765 GNULIB_FDOPENDIR=0;
7766 GNULIB_SCANDIR=0;
7767 GNULIB_ALPHASORT=0;
7768 HAVE_OPENDIR=1;
7769 HAVE_READDIR=1;
7770 HAVE_REWINDDIR=1;
7771 HAVE_CLOSEDIR=1;
7772 HAVE_DECL_DIRFD=1;
7773 HAVE_DECL_FDOPENDIR=1;
7774 HAVE_FDOPENDIR=1;
7775 HAVE_SCANDIR=1;
7776 HAVE_ALPHASORT=1;
7777 REPLACE_OPENDIR=0;
7778 REPLACE_CLOSEDIR=0;
7779 REPLACE_DIRFD=0;
7780 REPLACE_FDOPENDIR=0;
725e2999
JB
7781
7782
5f661e03
SM
7783 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
7784$as_echo_n "checking for unsigned long long int... " >&6; }
7785if ${ac_cv_type_unsigned_long_long_int+:} false; then :
7786 $as_echo_n "(cached) " >&6
7787else
7788 ac_cv_type_unsigned_long_long_int=yes
7789 if test "x${ac_cv_prog_cc_c99-no}" = xno; then
7790 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7791/* end confdefs.h. */
7792
7793 /* For now, do not test the preprocessor; as of 2007 there are too many
7794 implementations with broken preprocessors. Perhaps this can
7795 be revisited in 2012. In the meantime, code should not expect
7796 #if to work with literals wider than 32 bits. */
7797 /* Test literals. */
7798 long long int ll = 9223372036854775807ll;
7799 long long int nll = -9223372036854775807LL;
7800 unsigned long long int ull = 18446744073709551615ULL;
7801 /* Test constant expressions. */
7802 typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
7803 ? 1 : -1)];
7804 typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
7805 ? 1 : -1)];
7806 int i = 63;
7807int
7808main ()
7809{
7810/* Test availability of runtime routines for shift and division. */
7811 long long int llmax = 9223372036854775807ll;
7812 unsigned long long int ullmax = 18446744073709551615ull;
7813 return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
7814 | (llmax / ll) | (llmax % ll)
7815 | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
7816 | (ullmax / ull) | (ullmax % ull));
7817 ;
7818 return 0;
7819}
7820
7821_ACEOF
7822if ac_fn_c_try_link "$LINENO"; then :
7823
7824else
7825 ac_cv_type_unsigned_long_long_int=no
7826fi
7827rm -f core conftest.err conftest.$ac_objext \
7828 conftest$ac_exeext conftest.$ac_ext
7829 fi
7830fi
7831{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
7832$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
7833 if test $ac_cv_type_unsigned_long_long_int = yes; then
7834
7835$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
7836
7837 fi
7838
7839
725e2999
JB
7840
7841
725e2999
JB
7842
7843
7844
7845
725e2999
JB
7846
7847
c0c3707f
CB
7848 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
7849$as_echo_n "checking if environ is properly declared... " >&6; }
7850if ${gt_cv_var_environ_declaration+:} false; then :
725e2999
JB
7851 $as_echo_n "(cached) " >&6
7852else
c0c3707f
CB
7853 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7854/* end confdefs.h. */
7855#if HAVE_UNISTD_H
7856 #include <unistd.h>
7857 #endif
7858 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
7859 #include <stdlib.h>
725e2999 7860
c0c3707f
CB
7861 extern struct { int foo; } environ;
7862int
7863main ()
7864{
7865environ.foo = 1;
7866 ;
7867 return 0;
7868}
7869_ACEOF
7870if ac_fn_c_try_compile "$LINENO"; then :
7871 gt_cv_var_environ_declaration=no
7872else
7873 gt_cv_var_environ_declaration=yes
725e2999 7874fi
c0c3707f
CB
7875rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7876fi
7877{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
7878$as_echo "$gt_cv_var_environ_declaration" >&6; }
7879 if test $gt_cv_var_environ_declaration = yes; then
7880
7881$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
725e2999 7882
725e2999 7883 fi
725e2999
JB
7884
7885
c0c3707f
CB
7886 if test $gt_cv_var_environ_declaration != yes; then
7887 HAVE_DECL_ENVIRON=0
7888 fi
6ec2e0f5
SDJ
7889
7890
7891
c0c3707f
CB
7892 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
7893$as_echo_n "checking for complete errno.h... " >&6; }
7894if ${gl_cv_header_errno_h_complete+:} false; then :
7895 $as_echo_n "(cached) " >&6
7896else
6ec2e0f5 7897
c0c3707f
CB
7898 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7899/* end confdefs.h. */
472fa5ee 7900
c0c3707f
CB
7901#include <errno.h>
7902#if !defined ETXTBSY
7903booboo
7904#endif
7905#if !defined ENOMSG
7906booboo
7907#endif
7908#if !defined EIDRM
7909booboo
7910#endif
7911#if !defined ENOLINK
7912booboo
7913#endif
7914#if !defined EPROTO
7915booboo
7916#endif
7917#if !defined EMULTIHOP
7918booboo
7919#endif
7920#if !defined EBADMSG
7921booboo
7922#endif
7923#if !defined EOVERFLOW
7924booboo
7925#endif
7926#if !defined ENOTSUP
7927booboo
7928#endif
7929#if !defined ENETRESET
7930booboo
7931#endif
7932#if !defined ECONNABORTED
7933booboo
7934#endif
7935#if !defined ESTALE
7936booboo
7937#endif
7938#if !defined EDQUOT
7939booboo
7940#endif
7941#if !defined ECANCELED
7942booboo
7943#endif
7944#if !defined EOWNERDEAD
7945booboo
7946#endif
7947#if !defined ENOTRECOVERABLE
7948booboo
7949#endif
7950#if !defined EILSEQ
7951booboo
7952#endif
472fa5ee 7953
c0c3707f
CB
7954_ACEOF
7955if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7956 $EGREP "booboo" >/dev/null 2>&1; then :
7957 gl_cv_header_errno_h_complete=no
7958else
7959 gl_cv_header_errno_h_complete=yes
5e8754f9 7960fi
c0c3707f 7961rm -f conftest*
472fa5ee
SM
7962
7963
c0c3707f
CB
7964fi
7965{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
7966$as_echo "$gl_cv_header_errno_h_complete" >&6; }
7967 if test $gl_cv_header_errno_h_complete = yes; then
7968 ERRNO_H=''
7969 else
472fa5ee
SM
7970
7971
7972
7973
7974
472fa5ee
SM
7975
7976
7977
c0c3707f
CB
7978 if test $gl_cv_have_include_next = yes; then
7979 gl_cv_next_errno_h='<'errno.h'>'
7980 else
7981 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
7982$as_echo_n "checking absolute name of <errno.h>... " >&6; }
7983if ${gl_cv_next_errno_h+:} false; then :
5e8754f9
SDJ
7984 $as_echo_n "(cached) " >&6
7985else
6ec2e0f5 7986
6ec2e0f5 7987
6ec2e0f5 7988
c0c3707f
CB
7989 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7990/* end confdefs.h. */
7991#include <errno.h>
7992_ACEOF
7993 case "$host_os" in
7994 aix*) gl_absname_cpp="$ac_cpp -C" ;;
7995 *) gl_absname_cpp="$ac_cpp" ;;
7996 esac
6ec2e0f5 7997
c0c3707f
CB
7998 case "$host_os" in
7999 mingw*)
8000 gl_dirsep_regex='[/\\]'
8001 ;;
8002 *)
8003 gl_dirsep_regex='\/'
8004 ;;
8005 esac
8006 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
8007 gl_header_literal_regex=`echo 'errno.h' \
8008 | sed -e "$gl_make_literal_regex_sed"`
8009 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
8010 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
8011 s|^/[^/]|//&|
8012 p
8013 q
8014 }'
6ec2e0f5 8015
c0c3707f
CB
8016 gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
8017 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 8018
c0c3707f
CB
8019 gl_header=$gl_cv_absolute_errno_h
8020 gl_cv_next_errno_h='"'$gl_header'"'
6ec2e0f5
SDJ
8021
8022
c0c3707f
CB
8023fi
8024{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
8025$as_echo "$gl_cv_next_errno_h" >&6; }
8026 fi
8027 NEXT_ERRNO_H=$gl_cv_next_errno_h
6ec2e0f5 8028
c0c3707f
CB
8029 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
8030 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8031 gl_next_as_first_directive='<'errno.h'>'
8032 else
8033 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8034 gl_next_as_first_directive=$gl_cv_next_errno_h
8035 fi
8036 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
6ec2e0f5 8037
472fa5ee
SM
8038
8039
8040
c0c3707f
CB
8041 ERRNO_H='errno.h'
8042 fi
472fa5ee 8043
c0c3707f
CB
8044 if test -n "$ERRNO_H"; then
8045 GL_GENERATE_ERRNO_H_TRUE=
8046 GL_GENERATE_ERRNO_H_FALSE='#'
5e8754f9 8047else
c0c3707f
CB
8048 GL_GENERATE_ERRNO_H_TRUE='#'
8049 GL_GENERATE_ERRNO_H_FALSE=
8050fi
472fa5ee
SM
8051
8052
c0c3707f
CB
8053 if test -n "$ERRNO_H"; then
8054 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
8055$as_echo_n "checking for EMULTIHOP value... " >&6; }
8056if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
8057 $as_echo_n "(cached) " >&6
5e8754f9 8058else
e26b6bb0 8059
c0c3707f
CB
8060 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8061/* end confdefs.h. */
e26b6bb0 8062
c0c3707f
CB
8063#include <errno.h>
8064#ifdef EMULTIHOP
8065yes
88b48903 8066#endif
88b48903 8067
c0c3707f
CB
8068_ACEOF
8069if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8070 $EGREP "yes" >/dev/null 2>&1; then :
8071 gl_cv_header_errno_h_EMULTIHOP=yes
8072else
8073 gl_cv_header_errno_h_EMULTIHOP=no
8074fi
8075rm -f conftest*
88b48903 8076
c0c3707f
CB
8077 if test $gl_cv_header_errno_h_EMULTIHOP = no; then
8078 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8079/* end confdefs.h. */
88b48903 8080
c0c3707f
CB
8081#define _XOPEN_SOURCE_EXTENDED 1
8082#include <errno.h>
8083#ifdef EMULTIHOP
8084yes
8085#endif
88b48903
WN
8086
8087_ACEOF
c0c3707f
CB
8088if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8089 $EGREP "yes" >/dev/null 2>&1; then :
8090 gl_cv_header_errno_h_EMULTIHOP=hidden
88b48903 8091fi
c0c3707f 8092rm -f conftest*
88b48903 8093
c0c3707f
CB
8094 if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
8095 if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" "
8096#define _XOPEN_SOURCE_EXTENDED 1
8097#include <errno.h>
8098/* The following two lines are a workaround against an autoconf-2.52 bug. */
8099#include <stdio.h>
8100#include <stdlib.h>
8101"; then :
88b48903
WN
8102
8103fi
88b48903 8104
c0c3707f
CB
8105 fi
8106 fi
88b48903 8107
c0c3707f
CB
8108fi
8109{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
8110$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
8111 case $gl_cv_header_errno_h_EMULTIHOP in
8112 yes | no)
8113 EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
8114 ;;
8115 *)
8116 EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
8117 ;;
8118 esac
88b48903 8119
e26b6bb0 8120
c0c3707f 8121 fi
e26b6bb0 8122
3d99e817 8123
c0c3707f
CB
8124 if test -n "$ERRNO_H"; then
8125 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
8126$as_echo_n "checking for ENOLINK value... " >&6; }
8127if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
8128 $as_echo_n "(cached) " >&6
8129else
472fa5ee 8130
c0c3707f
CB
8131 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8132/* end confdefs.h. */
472fa5ee 8133
c0c3707f
CB
8134#include <errno.h>
8135#ifdef ENOLINK
8136yes
8137#endif
472fa5ee 8138
c0c3707f
CB
8139_ACEOF
8140if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8141 $EGREP "yes" >/dev/null 2>&1; then :
8142 gl_cv_header_errno_h_ENOLINK=yes
8143else
8144 gl_cv_header_errno_h_ENOLINK=no
8145fi
8146rm -f conftest*
472fa5ee 8147
c0c3707f
CB
8148 if test $gl_cv_header_errno_h_ENOLINK = no; then
8149 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8150/* end confdefs.h. */
3d99e817 8151
c0c3707f
CB
8152#define _XOPEN_SOURCE_EXTENDED 1
8153#include <errno.h>
8154#ifdef ENOLINK
8155yes
8156#endif
3d99e817 8157
c0c3707f
CB
8158_ACEOF
8159if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8160 $EGREP "yes" >/dev/null 2>&1; then :
8161 gl_cv_header_errno_h_ENOLINK=hidden
8162fi
8163rm -f conftest*
3d99e817 8164
c0c3707f
CB
8165 if test $gl_cv_header_errno_h_ENOLINK = hidden; then
8166 if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" "
8167#define _XOPEN_SOURCE_EXTENDED 1
8168#include <errno.h>
8169/* The following two lines are a workaround against an autoconf-2.52 bug. */
8170#include <stdio.h>
8171#include <stdlib.h>
8172"; then :
3d99e817 8173
c0c3707f 8174fi
3d99e817 8175
c0c3707f
CB
8176 fi
8177 fi
3d99e817 8178
c0c3707f
CB
8179fi
8180{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
8181$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
8182 case $gl_cv_header_errno_h_ENOLINK in
8183 yes | no)
8184 ENOLINK_HIDDEN=0; ENOLINK_VALUE=
8185 ;;
8186 *)
8187 ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
8188 ;;
8189 esac
18848e28 8190
18848e28 8191
c0c3707f 8192 fi
18848e28 8193
18848e28 8194
c0c3707f
CB
8195 if test -n "$ERRNO_H"; then
8196 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
8197$as_echo_n "checking for EOVERFLOW value... " >&6; }
8198if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
8199 $as_echo_n "(cached) " >&6
8200else
18848e28 8201
c0c3707f
CB
8202 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8203/* end confdefs.h. */
18848e28 8204
c0c3707f
CB
8205#include <errno.h>
8206#ifdef EOVERFLOW
8207yes
8208#endif
18848e28 8209
c0c3707f
CB
8210_ACEOF
8211if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8212 $EGREP "yes" >/dev/null 2>&1; then :
8213 gl_cv_header_errno_h_EOVERFLOW=yes
8214else
8215 gl_cv_header_errno_h_EOVERFLOW=no
8216fi
8217rm -f conftest*
18848e28 8218
c0c3707f
CB
8219 if test $gl_cv_header_errno_h_EOVERFLOW = no; then
8220 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8221/* end confdefs.h. */
18848e28 8222
c0c3707f
CB
8223#define _XOPEN_SOURCE_EXTENDED 1
8224#include <errno.h>
8225#ifdef EOVERFLOW
8226yes
8227#endif
18848e28 8228
c0c3707f
CB
8229_ACEOF
8230if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8231 $EGREP "yes" >/dev/null 2>&1; then :
8232 gl_cv_header_errno_h_EOVERFLOW=hidden
8233fi
8234rm -f conftest*
18848e28 8235
c0c3707f
CB
8236 if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
8237 if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" "
8238#define _XOPEN_SOURCE_EXTENDED 1
8239#include <errno.h>
8240/* The following two lines are a workaround against an autoconf-2.52 bug. */
8241#include <stdio.h>
8242#include <stdlib.h>
8243"; then :
18848e28 8244
c0c3707f 8245fi
18848e28 8246
c0c3707f
CB
8247 fi
8248 fi
18848e28 8249
c0c3707f
CB
8250fi
8251{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
8252$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
8253 case $gl_cv_header_errno_h_EOVERFLOW in
8254 yes | no)
8255 EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
8256 ;;
8257 *)
8258 EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
8259 ;;
8260 esac
4a626d0a
PA
8261
8262
c0c3707f 8263 fi
18848e28 8264
4a626d0a 8265
c0c3707f
CB
8266ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
8267if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
8268 ac_have_decl=1
8269else
8270 ac_have_decl=0
8271fi
4a626d0a 8272
c0c3707f
CB
8273cat >>confdefs.h <<_ACEOF
8274#define HAVE_DECL_STRERROR_R $ac_have_decl
8275_ACEOF
4a626d0a 8276
c0c3707f
CB
8277for ac_func in strerror_r
8278do :
8279 ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
8280if test "x$ac_cv_func_strerror_r" = xyes; then :
8281 cat >>confdefs.h <<_ACEOF
8282#define HAVE_STRERROR_R 1
8283_ACEOF
4a626d0a 8284
c0c3707f
CB
8285fi
8286done
18848e28 8287
c0c3707f
CB
8288{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
8289$as_echo_n "checking whether strerror_r returns char *... " >&6; }
8290if ${ac_cv_func_strerror_r_char_p+:} false; then :
8291 $as_echo_n "(cached) " >&6
8292else
18848e28 8293
c0c3707f
CB
8294 ac_cv_func_strerror_r_char_p=no
8295 if test $ac_cv_have_decl_strerror_r = yes; then
8296 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8297/* end confdefs.h. */
8298$ac_includes_default
8299int
8300main ()
8301{
18848e28 8302
c0c3707f
CB
8303 char buf[100];
8304 char x = *strerror_r (0, buf, sizeof buf);
8305 char *p = strerror_r (0, buf, sizeof buf);
8306 return !p || x;
18848e28 8307
c0c3707f
CB
8308 ;
8309 return 0;
8310}
8311_ACEOF
8312if ac_fn_c_try_compile "$LINENO"; then :
8313 ac_cv_func_strerror_r_char_p=yes
8314fi
8315rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8316 else
8317 # strerror_r is not declared. Choose between
8318 # systems that have relatively inaccessible declarations for the
8319 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
8320 # former has a strerror_r that returns char*, while the latter
8321 # has a strerror_r that returns `int'.
8322 # This test should segfault on the DEC system.
8323 if test "$cross_compiling" = yes; then :
8324 :
8325else
8326 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8327/* end confdefs.h. */
8328$ac_includes_default
8329 extern char *strerror_r ();
8330int
8331main ()
8332{
8333char buf[100];
8334 char x = *strerror_r (0, buf, sizeof buf);
8335 return ! isalpha (x);
8336 ;
8337 return 0;
8338}
8339_ACEOF
8340if ac_fn_c_try_run "$LINENO"; then :
8341 ac_cv_func_strerror_r_char_p=yes
8342fi
8343rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8344 conftest.$ac_objext conftest.beam conftest.$ac_ext
8345fi
18848e28 8346
c0c3707f 8347 fi
18848e28 8348
c0c3707f
CB
8349fi
8350{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
8351$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
8352if test $ac_cv_func_strerror_r_char_p = yes; then
18848e28 8353
c0c3707f 8354$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
18848e28 8355
c0c3707f 8356fi
18848e28 8357
18848e28 8358
18848e28 8359
18848e28 8360
c0c3707f
CB
8361ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default"
8362if test "x$ac_cv_have_decl_fchdir" = xyes; then :
8363 ac_have_decl=1
8364else
8365 ac_have_decl=0
8366fi
18848e28 8367
c0c3707f
CB
8368cat >>confdefs.h <<_ACEOF
8369#define HAVE_DECL_FCHDIR $ac_have_decl
8370_ACEOF
18848e28 8371
18848e28 8372
c0c3707f
CB
8373 GNULIB_CREAT=0;
8374 GNULIB_FCNTL=0;
8375 GNULIB_NONBLOCKING=0;
8376 GNULIB_OPEN=0;
8377 GNULIB_OPENAT=0;
8378 HAVE_FCNTL=1;
8379 HAVE_OPENAT=1;
8380 REPLACE_CREAT=0;
8381 REPLACE_FCNTL=0;
8382 REPLACE_OPEN=0;
8383 REPLACE_OPENAT=0;
18848e28 8384
18848e28 8385
18848e28 8386
18848e28
GF
8387
8388
18848e28
GF
8389
8390
18848e28 8391
18848e28 8392
18848e28 8393
c0c3707f
CB
8394 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
8395$as_echo_n "checking for working fcntl.h... " >&6; }
8396if ${gl_cv_header_working_fcntl_h+:} false; then :
8397 $as_echo_n "(cached) " >&6
8398else
8399 if test "$cross_compiling" = yes; then :
8400 case "$host_os" in
8401 # Guess 'no' on native Windows.
8402 mingw*) gl_cv_header_working_fcntl_h='no' ;;
8403 *) gl_cv_header_working_fcntl_h=cross-compiling ;;
8404 esac
18848e28 8405
c0c3707f
CB
8406else
8407 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8408/* end confdefs.h. */
8409#include <sys/types.h>
8410 #include <sys/stat.h>
8411 #if HAVE_UNISTD_H
8412 # include <unistd.h>
8413 #else /* on Windows with MSVC */
8414 # include <io.h>
8415 # include <stdlib.h>
8416 # defined sleep(n) _sleep ((n) * 1000)
8417 #endif
8418 #include <fcntl.h>
8419 #ifndef O_NOATIME
8420 #define O_NOATIME 0
8421 #endif
8422 #ifndef O_NOFOLLOW
8423 #define O_NOFOLLOW 0
8424 #endif
8425 static int const constants[] =
8426 {
8427 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
8428 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
8429 };
18848e28 8430
c0c3707f
CB
8431int
8432main ()
8433{
18848e28 8434
c0c3707f
CB
8435 int result = !constants;
8436 #if HAVE_SYMLINK
8437 {
8438 static char const sym[] = "conftest.sym";
8439 if (symlink ("/dev/null", sym) != 0)
8440 result |= 2;
8441 else
8442 {
8443 int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
8444 if (fd >= 0)
8445 {
8446 close (fd);
8447 result |= 4;
8448 }
8449 }
8450 if (unlink (sym) != 0 || symlink (".", sym) != 0)
8451 result |= 2;
8452 else
8453 {
8454 int fd = open (sym, O_RDONLY | O_NOFOLLOW);
8455 if (fd >= 0)
8456 {
8457 close (fd);
8458 result |= 4;
8459 }
8460 }
8461 unlink (sym);
8462 }
8463 #endif
8464 {
8465 static char const file[] = "confdefs.h";
8466 int fd = open (file, O_RDONLY | O_NOATIME);
8467 if (fd < 0)
8468 result |= 8;
8469 else
8470 {
8471 struct stat st0;
8472 if (fstat (fd, &st0) != 0)
8473 result |= 16;
8474 else
8475 {
8476 char c;
8477 sleep (1);
8478 if (read (fd, &c, 1) != 1)
8479 result |= 24;
8480 else
8481 {
8482 if (close (fd) != 0)
8483 result |= 32;
8484 else
8485 {
8486 struct stat st1;
8487 if (stat (file, &st1) != 0)
8488 result |= 40;
8489 else
8490 if (st0.st_atime != st1.st_atime)
8491 result |= 64;
8492 }
8493 }
8494 }
8495 }
8496 }
8497 return result;
8498 ;
8499 return 0;
8500}
8501_ACEOF
8502if ac_fn_c_try_run "$LINENO"; then :
8503 gl_cv_header_working_fcntl_h=yes
8504else
8505 case $? in #(
8506 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
8507 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
8508 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
8509 *) gl_cv_header_working_fcntl_h='no';;
8510 esac
8511fi
8512rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8513 conftest.$ac_objext conftest.beam conftest.$ac_ext
8514fi
18848e28 8515
18848e28 8516
c0c3707f
CB
8517fi
8518{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
8519$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
18848e28 8520
c0c3707f
CB
8521 case $gl_cv_header_working_fcntl_h in #(
8522 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
8523 *) ac_val=1;;
8524 esac
18848e28 8525
c0c3707f
CB
8526cat >>confdefs.h <<_ACEOF
8527#define HAVE_WORKING_O_NOATIME $ac_val
8528_ACEOF
18848e28
GF
8529
8530
c0c3707f
CB
8531 case $gl_cv_header_working_fcntl_h in #(
8532 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
8533 *) ac_val=1;;
8534 esac
18848e28 8535
c0c3707f
CB
8536cat >>confdefs.h <<_ACEOF
8537#define HAVE_WORKING_O_NOFOLLOW $ac_val
8538_ACEOF
18848e28 8539
63ce7108 8540
c0c3707f
CB
8541ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
8542if test "x$ac_cv_type_pid_t" = xyes; then :
63ce7108 8543
c0c3707f 8544else
63ce7108 8545
c0c3707f
CB
8546cat >>confdefs.h <<_ACEOF
8547#define pid_t int
8548_ACEOF
63ce7108 8549
c0c3707f 8550fi
63ce7108 8551
c0c3707f
CB
8552ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
8553if test "x$ac_cv_type_mode_t" = xyes; then :
63ce7108 8554
c0c3707f 8555else
63ce7108 8556
c0c3707f
CB
8557cat >>confdefs.h <<_ACEOF
8558#define mode_t int
8559_ACEOF
63ce7108 8560
c0c3707f 8561fi
63ce7108 8562
472fa5ee
SM
8563
8564
8565
8566
8567
c0c3707f
CB
8568 GNULIB_FNMATCH=0;
8569 HAVE_FNMATCH=1;
8570 REPLACE_FNMATCH=0;
472fa5ee
SM
8571
8572
8573
8574
8575
8576
472fa5ee
SM
8577
8578
472fa5ee
SM
8579
8580
8581
8582
8583
8584
8585
8586
7a6dbc2f 8587 if test $gl_cv_have_include_next = yes; then
c0c3707f 8588 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
7a6dbc2f 8589 else
c0c3707f
CB
8590 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fnmatch.h>" >&5
8591$as_echo_n "checking absolute name of <fnmatch.h>... " >&6; }
8592if ${gl_cv_next_fnmatch_h+:} false; then :
7a6dbc2f
SDJ
8593 $as_echo_n "(cached) " >&6
8594else
472fa5ee 8595
c0c3707f
CB
8596 if test $ac_cv_header_fnmatch_h = yes; then
8597
8598
472fa5ee
SM
8599
8600
7a6dbc2f
SDJ
8601 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8602/* end confdefs.h. */
c0c3707f 8603#include <fnmatch.h>
7a6dbc2f
SDJ
8604_ACEOF
8605 case "$host_os" in
8606 aix*) gl_absname_cpp="$ac_cpp -C" ;;
8607 *) gl_absname_cpp="$ac_cpp" ;;
8608 esac
472fa5ee 8609
7a6dbc2f
SDJ
8610 case "$host_os" in
8611 mingw*)
8612 gl_dirsep_regex='[/\\]'
8613 ;;
8614 *)
8615 gl_dirsep_regex='\/'
8616 ;;
8617 esac
8618 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 8619 gl_header_literal_regex=`echo 'fnmatch.h' \
7a6dbc2f
SDJ
8620 | sed -e "$gl_make_literal_regex_sed"`
8621 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
8622 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
8623 s|^/[^/]|//&|
8624 p
8625 q
8626 }'
8627
c0c3707f 8628 gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
7a6dbc2f
SDJ
8629 sed -n "$gl_absolute_header_sed"`
8630
c0c3707f
CB
8631 gl_header=$gl_cv_absolute_fnmatch_h
8632 gl_cv_next_fnmatch_h='"'$gl_header'"'
8633 else
8634 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
8635 fi
7a6dbc2f
SDJ
8636
8637
8638fi
c0c3707f
CB
8639{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5
8640$as_echo "$gl_cv_next_fnmatch_h" >&6; }
7a6dbc2f 8641 fi
c0c3707f 8642 NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h
7a6dbc2f
SDJ
8643
8644 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
8645 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 8646 gl_next_as_first_directive='<'fnmatch.h'>'
7a6dbc2f
SDJ
8647 else
8648 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 8649 gl_next_as_first_directive=$gl_cv_next_fnmatch_h
7a6dbc2f 8650 fi
c0c3707f 8651 NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive
7a6dbc2f
SDJ
8652
8653
8654
8655
7a6dbc2f 8656
7a6dbc2f
SDJ
8657
8658
c0c3707f
CB
8659 if test $ac_cv_header_fnmatch_h = yes; then
8660 HAVE_FNMATCH_H=1
8661 else
8662 HAVE_FNMATCH_H=0
8663 fi
7a6dbc2f
SDJ
8664
8665
c0c3707f
CB
8666 FNMATCH_H=''
8667 if false; then
8668 FNMATCH_H=fnmatch.h
8669 else
8670 if test $ac_cv_header_fnmatch_h != yes; then
8671 FNMATCH_H=fnmatch.h
8672 fi
8673 fi
7a6dbc2f 8674
c0c3707f
CB
8675
8676 if test -n "$FNMATCH_H"; then
8677 GL_GENERATE_FNMATCH_H_TRUE=
8678 GL_GENERATE_FNMATCH_H_FALSE='#'
7a6dbc2f 8679else
c0c3707f
CB
8680 GL_GENERATE_FNMATCH_H_TRUE='#'
8681 GL_GENERATE_FNMATCH_H_FALSE=
7a6dbc2f 8682fi
7a6dbc2f 8683
7a6dbc2f 8684
7a6dbc2f 8685
7a6dbc2f
SDJ
8686
8687
8688
8689
8690
8691
8692
c0c3707f
CB
8693 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
8694$as_echo_n "checking for mbstate_t... " >&6; }
8695if ${ac_cv_type_mbstate_t+:} false; then :
5e8754f9
SDJ
8696 $as_echo_n "(cached) " >&6
8697else
c0c3707f 8698 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 8699/* end confdefs.h. */
c0c3707f
CB
8700$ac_includes_default
8701/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
8702 <wchar.h>.
8703 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
8704 included before <wchar.h>. */
8705#include <stddef.h>
8706#include <stdio.h>
8707#include <time.h>
8708#include <wchar.h>
8709int
8710main ()
8711{
8712mbstate_t x; return sizeof x;
8713 ;
8714 return 0;
8715}
5e8754f9 8716_ACEOF
c0c3707f
CB
8717if ac_fn_c_try_compile "$LINENO"; then :
8718 ac_cv_type_mbstate_t=yes
5e8754f9 8719else
c0c3707f 8720 ac_cv_type_mbstate_t=no
5e8754f9 8721fi
c0c3707f
CB
8722rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8723fi
8724{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
8725$as_echo "$ac_cv_type_mbstate_t" >&6; }
8726 if test $ac_cv_type_mbstate_t = yes; then
5e8754f9 8727
c0c3707f 8728$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
5e8754f9 8729
c0c3707f 8730 else
5e8754f9 8731
c0c3707f 8732$as_echo "#define mbstate_t int" >>confdefs.h
5e8754f9 8733
c0c3707f 8734 fi
5e8754f9
SDJ
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753 GNULIB_ACOSF=0;
8754 GNULIB_ACOSL=0;
8755 GNULIB_ASINF=0;
8756 GNULIB_ASINL=0;
8757 GNULIB_ATANF=0;
8758 GNULIB_ATANL=0;
8759 GNULIB_ATAN2F=0;
8760 GNULIB_CBRT=0;
8761 GNULIB_CBRTF=0;
8762 GNULIB_CBRTL=0;
8763 GNULIB_CEIL=0;
8764 GNULIB_CEILF=0;
8765 GNULIB_CEILL=0;
8766 GNULIB_COPYSIGN=0;
8767 GNULIB_COPYSIGNF=0;
8768 GNULIB_COPYSIGNL=0;
8769 GNULIB_COSF=0;
8770 GNULIB_COSL=0;
8771 GNULIB_COSHF=0;
8772 GNULIB_EXPF=0;
8773 GNULIB_EXPL=0;
8774 GNULIB_EXP2=0;
8775 GNULIB_EXP2F=0;
8776 GNULIB_EXP2L=0;
8777 GNULIB_EXPM1=0;
8778 GNULIB_EXPM1F=0;
8779 GNULIB_EXPM1L=0;
8780 GNULIB_FABSF=0;
8781 GNULIB_FABSL=0;
8782 GNULIB_FLOOR=0;
8783 GNULIB_FLOORF=0;
8784 GNULIB_FLOORL=0;
8785 GNULIB_FMA=0;
8786 GNULIB_FMAF=0;
8787 GNULIB_FMAL=0;
8788 GNULIB_FMOD=0;
8789 GNULIB_FMODF=0;
8790 GNULIB_FMODL=0;
8791 GNULIB_FREXPF=0;
8792 GNULIB_FREXP=0;
8793 GNULIB_FREXPL=0;
8794 GNULIB_HYPOT=0;
8795 GNULIB_HYPOTF=0;
8796 GNULIB_HYPOTL=0;
8797 GNULIB_ILOGB=0;
8798 GNULIB_ILOGBF=0;
8799 GNULIB_ILOGBL=0;
8800 GNULIB_ISFINITE=0;
8801 GNULIB_ISINF=0;
8802 GNULIB_ISNAN=0;
8803 GNULIB_ISNANF=0;
8804 GNULIB_ISNAND=0;
8805 GNULIB_ISNANL=0;
8806 GNULIB_LDEXPF=0;
8807 GNULIB_LDEXPL=0;
8808 GNULIB_LOG=0;
8809 GNULIB_LOGF=0;
8810 GNULIB_LOGL=0;
8811 GNULIB_LOG10=0;
8812 GNULIB_LOG10F=0;
8813 GNULIB_LOG10L=0;
8814 GNULIB_LOG1P=0;
8815 GNULIB_LOG1PF=0;
8816 GNULIB_LOG1PL=0;
8817 GNULIB_LOG2=0;
8818 GNULIB_LOG2F=0;
8819 GNULIB_LOG2L=0;
8820 GNULIB_LOGB=0;
8821 GNULIB_LOGBF=0;
8822 GNULIB_LOGBL=0;
8823 GNULIB_MODF=0;
8824 GNULIB_MODFF=0;
8825 GNULIB_MODFL=0;
8826 GNULIB_POWF=0;
8827 GNULIB_REMAINDER=0;
8828 GNULIB_REMAINDERF=0;
8829 GNULIB_REMAINDERL=0;
8830 GNULIB_RINT=0;
8831 GNULIB_RINTF=0;
8832 GNULIB_RINTL=0;
8833 GNULIB_ROUND=0;
8834 GNULIB_ROUNDF=0;
8835 GNULIB_ROUNDL=0;
8836 GNULIB_SIGNBIT=0;
8837 GNULIB_SINF=0;
8838 GNULIB_SINL=0;
8839 GNULIB_SINHF=0;
8840 GNULIB_SQRTF=0;
8841 GNULIB_SQRTL=0;
8842 GNULIB_TANF=0;
8843 GNULIB_TANL=0;
8844 GNULIB_TANHF=0;
8845 GNULIB_TRUNC=0;
8846 GNULIB_TRUNCF=0;
8847 GNULIB_TRUNCL=0;
8848 HAVE_ACOSF=1;
8849 HAVE_ACOSL=1;
8850 HAVE_ASINF=1;
8851 HAVE_ASINL=1;
8852 HAVE_ATANF=1;
8853 HAVE_ATANL=1;
8854 HAVE_ATAN2F=1;
8855 HAVE_CBRT=1;
8856 HAVE_CBRTF=1;
8857 HAVE_CBRTL=1;
8858 HAVE_COPYSIGN=1;
8859 HAVE_COPYSIGNL=1;
8860 HAVE_COSF=1;
8861 HAVE_COSL=1;
8862 HAVE_COSHF=1;
8863 HAVE_EXPF=1;
8864 HAVE_EXPL=1;
8865 HAVE_EXPM1=1;
8866 HAVE_EXPM1F=1;
8867 HAVE_FABSF=1;
8868 HAVE_FABSL=1;
8869 HAVE_FMA=1;
8870 HAVE_FMAF=1;
8871 HAVE_FMAL=1;
8872 HAVE_FMODF=1;
8873 HAVE_FMODL=1;
8874 HAVE_FREXPF=1;
8875 HAVE_HYPOTF=1;
8876 HAVE_HYPOTL=1;
8877 HAVE_ILOGB=1;
8878 HAVE_ILOGBF=1;
8879 HAVE_ILOGBL=1;
8880 HAVE_ISNANF=1;
8881 HAVE_ISNAND=1;
8882 HAVE_ISNANL=1;
8883 HAVE_LDEXPF=1;
8884 HAVE_LOGF=1;
8885 HAVE_LOGL=1;
8886 HAVE_LOG10F=1;
8887 HAVE_LOG10L=1;
8888 HAVE_LOG1P=1;
8889 HAVE_LOG1PF=1;
8890 HAVE_LOG1PL=1;
8891 HAVE_LOGBF=1;
8892 HAVE_LOGBL=1;
8893 HAVE_MODFF=1;
8894 HAVE_MODFL=1;
8895 HAVE_POWF=1;
8896 HAVE_REMAINDER=1;
8897 HAVE_REMAINDERF=1;
8898 HAVE_RINT=1;
8899 HAVE_RINTL=1;
8900 HAVE_SINF=1;
8901 HAVE_SINL=1;
8902 HAVE_SINHF=1;
8903 HAVE_SQRTF=1;
8904 HAVE_SQRTL=1;
8905 HAVE_TANF=1;
8906 HAVE_TANL=1;
8907 HAVE_TANHF=1;
8908 HAVE_DECL_ACOSL=1;
8909 HAVE_DECL_ASINL=1;
8910 HAVE_DECL_ATANL=1;
8911 HAVE_DECL_CBRTF=1;
8912 HAVE_DECL_CBRTL=1;
8913 HAVE_DECL_CEILF=1;
8914 HAVE_DECL_CEILL=1;
8915 HAVE_DECL_COPYSIGNF=1;
8916 HAVE_DECL_COSL=1;
8917 HAVE_DECL_EXPL=1;
8918 HAVE_DECL_EXP2=1;
8919 HAVE_DECL_EXP2F=1;
8920 HAVE_DECL_EXP2L=1;
8921 HAVE_DECL_EXPM1L=1;
8922 HAVE_DECL_FLOORF=1;
8923 HAVE_DECL_FLOORL=1;
8924 HAVE_DECL_FREXPL=1;
8925 HAVE_DECL_LDEXPL=1;
8926 HAVE_DECL_LOGL=1;
8927 HAVE_DECL_LOG10L=1;
8928 HAVE_DECL_LOG2=1;
8929 HAVE_DECL_LOG2F=1;
8930 HAVE_DECL_LOG2L=1;
8931 HAVE_DECL_LOGB=1;
8932 HAVE_DECL_REMAINDER=1;
8933 HAVE_DECL_REMAINDERL=1;
8934 HAVE_DECL_RINTF=1;
8935 HAVE_DECL_ROUND=1;
8936 HAVE_DECL_ROUNDF=1;
8937 HAVE_DECL_ROUNDL=1;
8938 HAVE_DECL_SINL=1;
8939 HAVE_DECL_SQRTL=1;
8940 HAVE_DECL_TANL=1;
8941 HAVE_DECL_TRUNC=1;
8942 HAVE_DECL_TRUNCF=1;
8943 HAVE_DECL_TRUNCL=1;
c0c3707f
CB
8944 REPLACE_ACOSF=0;
8945 REPLACE_ASINF=0;
8946 REPLACE_ATANF=0;
8947 REPLACE_ATAN2F=0;
5e8754f9
SDJ
8948 REPLACE_CBRTF=0;
8949 REPLACE_CBRTL=0;
8950 REPLACE_CEIL=0;
8951 REPLACE_CEILF=0;
8952 REPLACE_CEILL=0;
c0c3707f
CB
8953 REPLACE_COSF=0;
8954 REPLACE_COSHF=0;
8955 REPLACE_EXPF=0;
8956 REPLACE_EXPL=0;
5e8754f9
SDJ
8957 REPLACE_EXPM1=0;
8958 REPLACE_EXPM1F=0;
c0c3707f 8959 REPLACE_EXPM1L=0;
5e8754f9
SDJ
8960 REPLACE_EXP2=0;
8961 REPLACE_EXP2L=0;
8962 REPLACE_FABSL=0;
8963 REPLACE_FLOOR=0;
8964 REPLACE_FLOORF=0;
8965 REPLACE_FLOORL=0;
8966 REPLACE_FMA=0;
8967 REPLACE_FMAF=0;
8968 REPLACE_FMAL=0;
8969 REPLACE_FMOD=0;
8970 REPLACE_FMODF=0;
8971 REPLACE_FMODL=0;
8972 REPLACE_FREXPF=0;
8973 REPLACE_FREXP=0;
8974 REPLACE_FREXPL=0;
8975 REPLACE_HUGE_VAL=0;
8976 REPLACE_HYPOT=0;
8977 REPLACE_HYPOTF=0;
8978 REPLACE_HYPOTL=0;
8979 REPLACE_ILOGB=0;
8980 REPLACE_ILOGBF=0;
c0c3707f 8981 REPLACE_ILOGBL=0;
5e8754f9
SDJ
8982 REPLACE_ISFINITE=0;
8983 REPLACE_ISINF=0;
8984 REPLACE_ISNAN=0;
8985 REPLACE_LDEXPL=0;
8986 REPLACE_LOG=0;
8987 REPLACE_LOGF=0;
8988 REPLACE_LOGL=0;
8989 REPLACE_LOG10=0;
8990 REPLACE_LOG10F=0;
8991 REPLACE_LOG10L=0;
8992 REPLACE_LOG1P=0;
8993 REPLACE_LOG1PF=0;
8994 REPLACE_LOG1PL=0;
8995 REPLACE_LOG2=0;
8996 REPLACE_LOG2F=0;
8997 REPLACE_LOG2L=0;
8998 REPLACE_LOGB=0;
8999 REPLACE_LOGBF=0;
9000 REPLACE_LOGBL=0;
9001 REPLACE_MODF=0;
9002 REPLACE_MODFF=0;
9003 REPLACE_MODFL=0;
9004 REPLACE_NAN=0;
9005 REPLACE_REMAINDER=0;
9006 REPLACE_REMAINDERF=0;
9007 REPLACE_REMAINDERL=0;
c0c3707f 9008 REPLACE_RINTL=0;
5e8754f9 9009 REPLACE_ROUND=0;
c0c3707f
CB
9010 REPLACE_ROUNDF=0;
9011 REPLACE_ROUNDL=0;
9012 REPLACE_SIGNBIT=0;
9013 REPLACE_SIGNBIT_USING_GCC=0;
9014 REPLACE_SINF=0;
9015 REPLACE_SINHF=0;
9016 REPLACE_SQRTF=0;
9017 REPLACE_SQRTL=0;
9018 REPLACE_TANF=0;
9019 REPLACE_TANHF=0;
9020 REPLACE_TRUNC=0;
9021 REPLACE_TRUNCF=0;
9022 REPLACE_TRUNCL=0;
49e4877c 9023
49e4877c 9024
c0c3707f
CB
9025 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
9026$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
9027if ${gl_cv_func_frexp_no_libm+:} false; then :
9028 $as_echo_n "(cached) " >&6
9029else
8690e634 9030
c0c3707f
CB
9031 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9032/* end confdefs.h. */
9033#include <math.h>
9034 double x;
9035int
9036main ()
9037{
9038int e; return frexp (x, &e) > 0;
9039 ;
9040 return 0;
9041}
9042_ACEOF
9043if ac_fn_c_try_link "$LINENO"; then :
9044 gl_cv_func_frexp_no_libm=yes
9045else
9046 gl_cv_func_frexp_no_libm=no
9047fi
9048rm -f core conftest.err conftest.$ac_objext \
9049 conftest$ac_exeext conftest.$ac_ext
8690e634 9050
c0c3707f
CB
9051fi
9052{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
9053$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
8690e634 9054
c0c3707f
CB
9055ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
9056if test "x$ac_cv_have_decl_alarm" = xyes; then :
9057 ac_have_decl=1
9058else
9059 ac_have_decl=0
9060fi
472fa5ee 9061
c0c3707f
CB
9062cat >>confdefs.h <<_ACEOF
9063#define HAVE_DECL_ALARM $ac_have_decl
9064_ACEOF
472fa5ee
SM
9065
9066
9067
9068
c0c3707f
CB
9069 FREXP_LIBM=
9070 if test $gl_cv_func_frexp_no_libm = no; then
9071 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5
9072$as_echo_n "checking whether frexp() can be used with libm... " >&6; }
9073if ${gl_cv_func_frexp_in_libm+:} false; then :
9074 $as_echo_n "(cached) " >&6
9075else
8690e634 9076
c0c3707f
CB
9077 save_LIBS="$LIBS"
9078 LIBS="$LIBS -lm"
9079 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9080/* end confdefs.h. */
9081#include <math.h>
9082 double x;
9083int
9084main ()
9085{
9086int e; return frexp (x, &e) > 0;
9087 ;
9088 return 0;
9089}
9090_ACEOF
9091if ac_fn_c_try_link "$LINENO"; then :
9092 gl_cv_func_frexp_in_libm=yes
9093else
9094 gl_cv_func_frexp_in_libm=no
9095fi
9096rm -f core conftest.err conftest.$ac_objext \
9097 conftest$ac_exeext conftest.$ac_ext
9098 LIBS="$save_LIBS"
8690e634 9099
c0c3707f
CB
9100fi
9101{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5
9102$as_echo "$gl_cv_func_frexp_in_libm" >&6; }
9103 if test $gl_cv_func_frexp_in_libm = yes; then
9104 FREXP_LIBM=-lm
9105 fi
6ec2e0f5 9106 fi
c0c3707f
CB
9107 if test $gl_cv_func_frexp_no_libm = yes \
9108 || test $gl_cv_func_frexp_in_libm = yes; then
9109 save_LIBS="$LIBS"
9110 LIBS="$LIBS $FREXP_LIBM"
8690e634
JK
9111
9112
8690e634 9113
c0c3707f
CB
9114 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
9115$as_echo_n "checking whether frexp works... " >&6; }
9116if ${gl_cv_func_frexp_works+:} false; then :
9117 $as_echo_n "(cached) " >&6
9118else
8690e634 9119
c0c3707f
CB
9120 if test "$cross_compiling" = yes; then :
9121 case "$host_os" in
9122 netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
9123 mingw*) # Guess yes with MSVC, no with mingw.
9124 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9125/* end confdefs.h. */
8690e634 9126
c0c3707f
CB
9127#ifdef _MSC_VER
9128 Good
9129#endif
8690e634 9130
c0c3707f
CB
9131_ACEOF
9132if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9133 $EGREP "Good" >/dev/null 2>&1; then :
9134 gl_cv_func_frexp_works="guessing yes"
9135else
9136 gl_cv_func_frexp_works="guessing no"
9137fi
9138rm -f conftest*
8690e634 9139
c0c3707f
CB
9140 ;;
9141 *) gl_cv_func_frexp_works="guessing yes" ;;
9142 esac
8690e634 9143
c0c3707f
CB
9144else
9145 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9146/* end confdefs.h. */
8690e634 9147
c0c3707f
CB
9148#include <float.h>
9149#include <math.h>
9150#include <string.h>
9151#if HAVE_DECL_ALARM
9152# include <signal.h>
9153# include <unistd.h>
9154#endif
9155/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
9156 ICC 10.0 has a bug when optimizing the expression -zero.
9157 The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
9158 to PowerPC on Mac OS X 10.5. */
9159#if defined __hpux || defined __sgi || defined __ICC
9160static double
9161compute_minus_zero (void)
9162{
9163 return -DBL_MIN * DBL_MIN;
9164}
9165# define minus_zero compute_minus_zero ()
9166#else
9167double minus_zero = -0.0;
9168#endif
9169int main()
9170{
9171 int result = 0;
9172 int i;
9173 volatile double x;
9174 double zero = 0.0;
9175#if HAVE_DECL_ALARM
9176 /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
9177 number. Let the test fail in this case. */
9178 signal (SIGALRM, SIG_DFL);
9179 alarm (5);
9180#endif
9181 /* Test on denormalized numbers. */
9182 for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
9183 ;
9184 if (x > 0.0)
9185 {
9186 int exp;
9187 double y = frexp (x, &exp);
9188 /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
9189 On NetBSD: y = 0.75. Correct: y = 0.5. */
9190 if (y != 0.5)
9191 result |= 1;
9192 }
9193 /* Test on infinite numbers. */
9194 x = 1.0 / zero;
9195 {
9196 int exp;
9197 double y = frexp (x, &exp);
9198 if (y != x)
9199 result |= 2;
9200 }
9201 /* Test on negative zero. */
9202 x = minus_zero;
9203 {
9204 int exp;
9205 double y = frexp (x, &exp);
9206 if (memcmp (&y, &x, sizeof x))
9207 result |= 4;
9208 }
9209 return result;
9210}
9211_ACEOF
9212if ac_fn_c_try_run "$LINENO"; then :
9213 gl_cv_func_frexp_works=yes
9214else
9215 gl_cv_func_frexp_works=no
9216fi
9217rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9218 conftest.$ac_objext conftest.beam conftest.$ac_ext
9219fi
472fa5ee
SM
9220
9221
c0c3707f
CB
9222fi
9223{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
9224$as_echo "$gl_cv_func_frexp_works" >&6; }
472fa5ee 9225
c0c3707f
CB
9226 LIBS="$save_LIBS"
9227 case "$gl_cv_func_frexp_works" in
9228 *yes) gl_func_frexp=yes ;;
9229 *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;;
9230 esac
9231 else
9232 gl_func_frexp=no
9233 fi
9234 if test $gl_func_frexp = yes; then
472fa5ee 9235
c0c3707f 9236$as_echo "#define HAVE_FREXP 1" >>confdefs.h
472fa5ee 9237
c0c3707f 9238 fi
8690e634 9239
6ec2e0f5
SDJ
9240
9241
c0c3707f
CB
9242 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
9243$as_echo_n "checking whether long double and double are the same... " >&6; }
9244if ${gl_cv_long_double_equals_double+:} false; then :
8690e634
JK
9245 $as_echo_n "(cached) " >&6
9246else
c0c3707f
CB
9247 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9248/* end confdefs.h. */
9249#include <float.h>
9250int
9251main ()
9252{
9253typedef int check[sizeof (long double) == sizeof (double)
9254 && LDBL_MANT_DIG == DBL_MANT_DIG
9255 && LDBL_MAX_EXP == DBL_MAX_EXP
9256 && LDBL_MIN_EXP == DBL_MIN_EXP
9257 ? 1 : -1];
8690e634 9258
c0c3707f
CB
9259 ;
9260 return 0;
9261}
9262_ACEOF
9263if ac_fn_c_try_compile "$LINENO"; then :
9264 gl_cv_long_double_equals_double=yes
9265else
9266 gl_cv_long_double_equals_double=no
9267fi
9268rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9269
c0c3707f
CB
9270fi
9271{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
9272$as_echo "$gl_cv_long_double_equals_double" >&6; }
9273 if test $gl_cv_long_double_equals_double = yes; then
8690e634 9274
c0c3707f 9275$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
6ec2e0f5 9276
c0c3707f
CB
9277 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
9278 else
9279 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
9280 fi
8690e634 9281
6ec2e0f5 9282
6ec2e0f5 9283
6ec2e0f5
SDJ
9284
9285
6ec2e0f5 9286
8690e634
JK
9287
9288
c0c3707f
CB
9289 ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
9290"
9291if test "x$ac_cv_have_decl_frexpl" = xyes; then :
8690e634 9292
c0c3707f
CB
9293else
9294 HAVE_DECL_FREXPL=0
9295fi
8690e634 9296
6ec2e0f5 9297
c0c3707f
CB
9298 FREXPL_LIBM=
9299 if test $HAVE_DECL_FREXPL = 1; then
6ec2e0f5 9300
c0c3707f
CB
9301 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
9302$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
9303if ${gl_cv_func_frexpl_no_libm+:} false; then :
8690e634
JK
9304 $as_echo_n "(cached) " >&6
9305else
c0c3707f
CB
9306
9307 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 9308/* end confdefs.h. */
c0c3707f
CB
9309#include <math.h>
9310 long double x;
9311int
9312main ()
9313{
9314int e; return frexpl (x, &e) > 0;
9315 ;
9316 return 0;
9317}
9318_ACEOF
9319if ac_fn_c_try_link "$LINENO"; then :
9320 gl_cv_func_frexpl_no_libm=yes
9321else
9322 gl_cv_func_frexpl_no_libm=no
9323fi
9324rm -f core conftest.err conftest.$ac_objext \
9325 conftest$ac_exeext conftest.$ac_ext
8690e634 9326
c0c3707f
CB
9327fi
9328{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
9329$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
6ec2e0f5 9330
c0c3707f
CB
9331 if test $gl_cv_func_frexpl_no_libm = no; then
9332 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5
9333$as_echo_n "checking whether frexpl() can be used with libm... " >&6; }
9334if ${gl_cv_func_frexpl_in_libm+:} false; then :
9335 $as_echo_n "(cached) " >&6
9336else
6ec2e0f5 9337
c0c3707f
CB
9338 save_LIBS="$LIBS"
9339 LIBS="$LIBS -lm"
9340 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9341/* end confdefs.h. */
9342#include <math.h>
9343 long double x;
9344int
9345main ()
9346{
9347int e; return frexpl (x, &e) > 0;
9348 ;
9349 return 0;
9350}
9351_ACEOF
9352if ac_fn_c_try_link "$LINENO"; then :
9353 gl_cv_func_frexpl_in_libm=yes
9354else
9355 gl_cv_func_frexpl_in_libm=no
9356fi
9357rm -f core conftest.err conftest.$ac_objext \
9358 conftest$ac_exeext conftest.$ac_ext
9359 LIBS="$save_LIBS"
6ec2e0f5 9360
c0c3707f
CB
9361fi
9362{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5
9363$as_echo "$gl_cv_func_frexpl_in_libm" >&6; }
9364 if test $gl_cv_func_frexpl_in_libm = yes; then
9365 FREXPL_LIBM=-lm
9366 fi
9367 fi
9368 if test $gl_cv_func_frexpl_no_libm = yes \
9369 || test $gl_cv_func_frexpl_in_libm = yes; then
9370 save_LIBS="$LIBS"
9371 LIBS="$LIBS $FREXPL_LIBM"
8690e634 9372
8690e634 9373
c0c3707f
CB
9374 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
9375$as_echo_n "checking whether frexpl works... " >&6; }
9376if ${gl_cv_func_frexpl_works+:} false; then :
9377 $as_echo_n "(cached) " >&6
9378else
8690e634 9379
c0c3707f 9380 if test "$cross_compiling" = yes; then :
8690e634 9381
c0c3707f
CB
9382 case "$host_os" in
9383 aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
9384 gl_cv_func_frexpl_works="guessing no";;
9385 *) gl_cv_func_frexpl_works="guessing yes";;
9386 esac
8690e634 9387
c0c3707f
CB
9388else
9389 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9390/* end confdefs.h. */
8690e634 9391
c0c3707f
CB
9392#include <float.h>
9393#include <math.h>
9394/* Override the values of <float.h>, like done in float.in.h. */
9395#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
9396# undef LDBL_MIN_EXP
9397# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9398#endif
c0c3707f
CB
9399#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
9400# undef LDBL_MIN_EXP
9401# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9402#endif
c0c3707f
CB
9403#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
9404# undef LDBL_MIN_EXP
9405# define LDBL_MIN_EXP DBL_MIN_EXP
6ec2e0f5 9406#endif
c0c3707f
CB
9407#if defined __sgi && (LDBL_MANT_DIG >= 106)
9408# if defined __GNUC__
9409# undef LDBL_MIN_EXP
9410# define LDBL_MIN_EXP DBL_MIN_EXP
9411# endif
6ec2e0f5 9412#endif
c0c3707f
CB
9413extern
9414#ifdef __cplusplus
9415"C"
9416#endif
9417long double frexpl (long double, int *);
9418int main()
8690e634 9419{
c0c3707f
CB
9420 int result = 0;
9421 volatile long double x;
9422 /* Test on finite numbers that fails on AIX 5.1. */
9423 x = 16.0L;
9424 {
9425 int exp = -9999;
9426 frexpl (x, &exp);
9427 if (exp != 5)
9428 result |= 1;
9429 }
9430 /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
9431 function returns an invalid (incorrectly normalized) value: it returns
9432 y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
9433 but the correct result is
9434 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */
9435 x = 1.01L;
9436 {
9437 int exp = -9999;
9438 long double y = frexpl (x, &exp);
9439 if (!(exp == 1 && y == 0.505L))
9440 result |= 2;
9441 }
9442 /* Test on large finite numbers. This fails on BeOS at i = 16322, while
9443 LDBL_MAX_EXP = 16384.
9444 In the loop end test, we test x against Infinity, rather than comparing
9445 i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */
9446 {
9447 int i;
9448 for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
9449 {
9450 int exp = -9999;
9451 frexpl (x, &exp);
9452 if (exp != i)
9453 {
9454 result |= 4;
9455 break;
9456 }
9457 }
9458 }
9459 /* Test on denormalized numbers. */
9460 {
9461 int i;
9462 for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
9463 ;
9464 if (x > 0.0L)
9465 {
9466 int exp;
9467 long double y = frexpl (x, &exp);
9468 /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
9469 exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
9470 if (exp != LDBL_MIN_EXP - 1)
9471 result |= 8;
9472 }
9473 }
9474 /* Test on infinite numbers. */
9475 x = 1.0L / 0.0L;
9476 {
9477 int exp;
9478 long double y = frexpl (x, &exp);
9479 if (y != x)
9480 result |= 16;
9481 }
9482 return result;
8690e634
JK
9483}
9484_ACEOF
c0c3707f
CB
9485if ac_fn_c_try_run "$LINENO"; then :
9486 gl_cv_func_frexpl_works=yes
6ec2e0f5 9487else
c0c3707f
CB
9488 gl_cv_func_frexpl_works=no
9489fi
9490rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9491 conftest.$ac_objext conftest.beam conftest.$ac_ext
9492fi
8690e634 9493
8690e634 9494
c0c3707f
CB
9495fi
9496{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
9497$as_echo "$gl_cv_func_frexpl_works" >&6; }
8690e634 9498
c0c3707f
CB
9499 LIBS="$save_LIBS"
9500 case "$gl_cv_func_frexpl_works" in
9501 *yes) gl_func_frexpl=yes ;;
9502 *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
9503 esac
9504 else
9505 gl_func_frexpl=no
9506 fi
9507 if test $gl_func_frexpl = yes; then
8690e634 9508
c0c3707f 9509$as_echo "#define HAVE_FREXPL 1" >>confdefs.h
8690e634 9510
c0c3707f
CB
9511 fi
9512 fi
9513 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
9514 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
8690e634 9515
c0c3707f
CB
9516 FREXPL_LIBM="$FREXP_LIBM"
9517 else
9518 FREXPL_LIBM=
9519 fi
9520 fi
6ec2e0f5 9521
6ec2e0f5 9522
6ec2e0f5 9523
c0c3707f
CB
9524 GNULIB_FCHMODAT=0;
9525 GNULIB_FSTAT=0;
9526 GNULIB_FSTATAT=0;
9527 GNULIB_FUTIMENS=0;
9528 GNULIB_LCHMOD=0;
9529 GNULIB_LSTAT=0;
9530 GNULIB_MKDIRAT=0;
9531 GNULIB_MKFIFO=0;
9532 GNULIB_MKFIFOAT=0;
9533 GNULIB_MKNOD=0;
9534 GNULIB_MKNODAT=0;
9535 GNULIB_STAT=0;
9536 GNULIB_UTIMENSAT=0;
9537 GNULIB_OVERRIDES_STRUCT_STAT=0;
9538 HAVE_FCHMODAT=1;
9539 HAVE_FSTATAT=1;
9540 HAVE_FUTIMENS=1;
9541 HAVE_LCHMOD=1;
9542 HAVE_LSTAT=1;
9543 HAVE_MKDIRAT=1;
9544 HAVE_MKFIFO=1;
9545 HAVE_MKFIFOAT=1;
9546 HAVE_MKNOD=1;
9547 HAVE_MKNODAT=1;
9548 HAVE_UTIMENSAT=1;
9549 REPLACE_FSTAT=0;
9550 REPLACE_FSTATAT=0;
9551 REPLACE_FUTIMENS=0;
9552 REPLACE_LSTAT=0;
9553 REPLACE_MKDIR=0;
9554 REPLACE_MKFIFO=0;
9555 REPLACE_MKNOD=0;
9556 REPLACE_STAT=0;
9557 REPLACE_UTIMENSAT=0;
9558
9559{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
9560$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
9561if ${ac_cv_header_stat_broken+:} false; then :
9562 $as_echo_n "(cached) " >&6
9563else
9564 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9565/* end confdefs.h. */
9566#include <sys/types.h>
9567#include <sys/stat.h>
9568
9569#if defined S_ISBLK && defined S_IFDIR
9570extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
9571#endif
9572
9573#if defined S_ISBLK && defined S_IFCHR
9574extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
9575#endif
9576
9577#if defined S_ISLNK && defined S_IFREG
9578extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
9579#endif
8690e634 9580
c0c3707f
CB
9581#if defined S_ISSOCK && defined S_IFREG
9582extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
9583#endif
8690e634 9584
c0c3707f
CB
9585_ACEOF
9586if ac_fn_c_try_compile "$LINENO"; then :
9587 ac_cv_header_stat_broken=no
9588else
9589 ac_cv_header_stat_broken=yes
6ec2e0f5
SDJ
9590fi
9591rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 9592fi
c0c3707f
CB
9593{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
9594$as_echo "$ac_cv_header_stat_broken" >&6; }
9595if test $ac_cv_header_stat_broken = yes; then
8690e634 9596
c0c3707f 9597$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
49e4877c 9598
c0c3707f 9599fi
49e4877c
PA
9600
9601
9602
9603
8690e634 9604
c0c3707f
CB
9605 case "$host_os" in
9606 mingw*)
9607 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
9608$as_echo_n "checking for 64-bit off_t... " >&6; }
9609if ${gl_cv_type_off_t_64+:} false; then :
9610 $as_echo_n "(cached) " >&6
9611else
9612 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9613/* end confdefs.h. */
9614#include <sys/types.h>
9615 int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
8690e634 9616
6ec2e0f5
SDJ
9617int
9618main ()
9619{
8690e634 9620
6ec2e0f5
SDJ
9621 ;
9622 return 0;
9623}
9624_ACEOF
9625if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
9626 gl_cv_type_off_t_64=yes
9627else
9628 gl_cv_type_off_t_64=no
6ec2e0f5
SDJ
9629fi
9630rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9631
c0c3707f
CB
9632fi
9633{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
9634$as_echo "$gl_cv_type_off_t_64" >&6; }
9635 if test $gl_cv_type_off_t_64 = no; then
9636 WINDOWS_64_BIT_OFF_T=1
9637 else
9638 WINDOWS_64_BIT_OFF_T=0
9639 fi
9640 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5
9641$as_echo_n "checking for 64-bit st_size... " >&6; }
9642if ${gl_cv_member_st_size_64+:} false; then :
6ec2e0f5
SDJ
9643 $as_echo_n "(cached) " >&6
9644else
c0c3707f 9645 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 9646/* end confdefs.h. */
c0c3707f
CB
9647#include <sys/types.h>
9648 struct stat buf;
9649 int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
8690e634 9650
6ec2e0f5
SDJ
9651int
9652main ()
9653{
8690e634 9654
6ec2e0f5
SDJ
9655 ;
9656 return 0;
9657}
9658_ACEOF
9659if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
9660 gl_cv_member_st_size_64=yes
9661else
9662 gl_cv_member_st_size_64=no
6ec2e0f5
SDJ
9663fi
9664rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9665
6ec2e0f5 9666fi
c0c3707f
CB
9667{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5
9668$as_echo "$gl_cv_member_st_size_64" >&6; }
9669 if test $gl_cv_member_st_size_64 = no; then
9670 WINDOWS_64_BIT_ST_SIZE=1
9671 else
9672 WINDOWS_64_BIT_ST_SIZE=0
9673 fi
9674 ;;
9675 *)
9676 WINDOWS_64_BIT_OFF_T=0
9677 WINDOWS_64_BIT_ST_SIZE=0
9678 ;;
9679 esac
8690e634
JK
9680
9681
9682
9683
9684
9685
c0c3707f
CB
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695 if test $gl_cv_have_include_next = yes; then
9696 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
9697 else
9698 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
9699$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
9700if ${gl_cv_next_sys_stat_h+:} false; then :
8690e634
JK
9701 $as_echo_n "(cached) " >&6
9702else
9703
c0c3707f 9704 if test $ac_cv_header_sys_stat_h = yes; then
4a626d0a
PA
9705
9706
4a626d0a 9707
c0c3707f
CB
9708
9709 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9710/* end confdefs.h. */
9711#include <sys/stat.h>
6ec2e0f5 9712_ACEOF
c0c3707f
CB
9713 case "$host_os" in
9714 aix*) gl_absname_cpp="$ac_cpp -C" ;;
9715 *) gl_absname_cpp="$ac_cpp" ;;
9716 esac
9717
9718 case "$host_os" in
9719 mingw*)
9720 gl_dirsep_regex='[/\\]'
9721 ;;
9722 *)
9723 gl_dirsep_regex='\/'
9724 ;;
9725 esac
9726 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
9727 gl_header_literal_regex=`echo 'sys/stat.h' \
9728 | sed -e "$gl_make_literal_regex_sed"`
9729 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
9730 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
9731 s|^/[^/]|//&|
9732 p
9733 q
9734 }'
9735
9736 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
9737 sed -n "$gl_absolute_header_sed"`
9738
9739 gl_header=$gl_cv_absolute_sys_stat_h
9740 gl_cv_next_sys_stat_h='"'$gl_header'"'
9741 else
9742 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
9743 fi
9744
9745
9746fi
9747{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
9748$as_echo "$gl_cv_next_sys_stat_h" >&6; }
9749 fi
9750 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
9751
9752 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
9753 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
9754 gl_next_as_first_directive='<'sys/stat.h'>'
9755 else
9756 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
9757 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
9758 fi
9759 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
9760
9761
9762
9763
9764
9765
9766
9767
9768 WINDOWS_STAT_TIMESPEC=0
9769
9770
9771
9772
4a626d0a 9773
4a626d0a 9774
8690e634
JK
9775
9776
c0c3707f
CB
9777 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
9778 #include <sys/stat.h>
9779"
9780if test "x$ac_cv_type_nlink_t" = xyes; then :
8690e634 9781
6ec2e0f5 9782else
8690e634 9783
c0c3707f 9784$as_echo "#define nlink_t int" >>confdefs.h
6ec2e0f5 9785
6ec2e0f5 9786fi
8690e634
JK
9787
9788
9789
9790
9791
9792
9793
c0c3707f
CB
9794 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
9795$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
9796if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
8690e634 9797 $as_echo_n "(cached) " >&6
c0c3707f
CB
9798else
9799 rm -f conftest.sym conftest.file
9800 echo >conftest.file
9801 if test "$cross_compiling" = yes; then :
9802 case "$host_os" in
9803 linux-* | linux)
9804 # Guess yes on Linux systems.
9805 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
9806 *-gnu* | gnu*)
9807 # Guess yes on glibc systems.
9808 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
9809 mingw*)
9810 # Guess no on native Windows.
9811 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
9812 *)
9813 # If we don't know, obey --enable-cross-guesses.
9814 gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
9815 esac
9816
8690e634
JK
9817else
9818 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9819/* end confdefs.h. */
c0c3707f 9820$ac_includes_default
8690e634
JK
9821int
9822main ()
9823{
c0c3707f
CB
9824struct stat sbuf;
9825 if (symlink ("conftest.file", "conftest.sym") != 0)
9826 return 1;
9827 /* Linux will dereference the symlink and fail, as required by
9828 POSIX. That is better in the sense that it means we will not
9829 have to compile and use the lstat wrapper. */
9830 return lstat ("conftest.sym/", &sbuf) == 0;
6ec2e0f5 9831
8690e634
JK
9832 ;
9833 return 0;
9834}
9835_ACEOF
c0c3707f
CB
9836if ac_fn_c_try_run "$LINENO"; then :
9837 gl_cv_func_lstat_dereferences_slashed_symlink=yes
8690e634 9838else
c0c3707f 9839 gl_cv_func_lstat_dereferences_slashed_symlink=no
8690e634 9840fi
c0c3707f
CB
9841rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9842 conftest.$ac_objext conftest.beam conftest.$ac_ext
9843fi
9844
9845 rm -f conftest.sym conftest.file
6ec2e0f5 9846
8690e634 9847fi
c0c3707f
CB
9848{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
9849$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
9850 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
9851 *yes)
9852
9853cat >>confdefs.h <<_ACEOF
9854#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
8690e634
JK
9855_ACEOF
9856
c0c3707f
CB
9857 ;;
9858 esac
8690e634 9859
8690e634 9860
8690e634 9861
8690e634 9862
c0c3707f
CB
9863
9864 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
9865$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
9866if ${gl_cv_func_getcwd_null+:} false; then :
8690e634
JK
9867 $as_echo_n "(cached) " >&6
9868else
c0c3707f
CB
9869 if test "$cross_compiling" = yes; then :
9870 case "$host_os" in
9871 # Guess yes on glibc systems.
9872 *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
9873 # Guess yes on musl systems.
9874 *-musl*) gl_cv_func_getcwd_null="guessing yes";;
9875 # Guess yes on Cygwin.
9876 cygwin*) gl_cv_func_getcwd_null="guessing yes";;
9877 # If we don't know, obey --enable-cross-guesses.
9878 *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
9879 esac
9880
9881else
9882 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
9883/* end confdefs.h. */
9884
c0c3707f
CB
9885# include <stdlib.h>
9886# if HAVE_UNISTD_H
9887# include <unistd.h>
9888# else /* on Windows with MSVC */
9889# include <direct.h>
9890# endif
9891# ifndef getcwd
9892 char *getcwd ();
9893# endif
8690e634
JK
9894
9895int
9896main ()
9897{
9898
c0c3707f
CB
9899#if defined _WIN32 && ! defined __CYGWIN__
9900/* mingw cwd does not start with '/', but getcwd does allocate.
9901 However, mingw fails to honor non-zero size. */
9902#else
9903 if (chdir ("/") != 0)
9904 return 1;
9905 else
9906 {
9907 char *f = getcwd (NULL, 0);
9908 if (! f)
9909 return 2;
9910 if (f[0] != '/')
9911 { free (f); return 3; }
9912 if (f[1] != '\0')
9913 { free (f); return 4; }
9914 free (f);
9915 return 0;
9916 }
9917#endif
9918
8690e634
JK
9919 ;
9920 return 0;
9921}
9922_ACEOF
c0c3707f
CB
9923if ac_fn_c_try_run "$LINENO"; then :
9924 gl_cv_func_getcwd_null=yes
9925else
9926 gl_cv_func_getcwd_null=no
8690e634 9927fi
c0c3707f
CB
9928rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9929 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 9930fi
8690e634 9931
c0c3707f
CB
9932fi
9933{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
9934$as_echo "$gl_cv_func_getcwd_null" >&6; }
8690e634 9935
6ec2e0f5 9936
c0c3707f
CB
9937 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
9938$as_echo_n "checking for getcwd with POSIX signature... " >&6; }
9939if ${gl_cv_func_getcwd_posix_signature+:} false; then :
8690e634
JK
9940 $as_echo_n "(cached) " >&6
9941else
c0c3707f 9942 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 9943/* end confdefs.h. */
c0c3707f 9944#include <unistd.h>
88b48903
WN
9945int
9946main ()
9947{
c0c3707f
CB
9948extern
9949 #ifdef __cplusplus
9950 "C"
9951 #endif
9952 char *getcwd (char *, size_t);
88b48903
WN
9953
9954 ;
9955 return 0;
9956}
c0c3707f 9957
88b48903
WN
9958_ACEOF
9959if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
9960 gl_cv_func_getcwd_posix_signature=yes
9961else
9962 gl_cv_func_getcwd_posix_signature=no
8690e634 9963fi
88b48903 9964rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9965
c0c3707f
CB
9966fi
9967{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
9968$as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
8690e634 9969
c0c3707f
CB
9970ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default"
9971if test "x$ac_cv_have_decl_getcwd" = xyes; then :
9972 ac_have_decl=1
9973else
9974 ac_have_decl=0
9975fi
8690e634 9976
c0c3707f
CB
9977cat >>confdefs.h <<_ACEOF
9978#define HAVE_DECL_GETCWD $ac_have_decl
9979_ACEOF
8690e634
JK
9980
9981
7a6dbc2f 9982
c0c3707f
CB
9983ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
9984if test "x$ac_cv_have_decl_getdtablesize" = xyes; then :
9985 ac_have_decl=1
88b48903 9986else
c0c3707f 9987 ac_have_decl=0
88b48903 9988fi
8690e634 9989
c0c3707f
CB
9990cat >>confdefs.h <<_ACEOF
9991#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
9992_ACEOF
8690e634 9993
c0c3707f
CB
9994ac_fn_c_check_decl "$LINENO" "getlogin_r" "ac_cv_have_decl_getlogin_r" "$ac_includes_default"
9995if test "x$ac_cv_have_decl_getlogin_r" = xyes; then :
9996 ac_have_decl=1
9997else
9998 ac_have_decl=0
9999fi
8690e634 10000
c0c3707f
CB
10001cat >>confdefs.h <<_ACEOF
10002#define HAVE_DECL_GETLOGIN_R $ac_have_decl
10003_ACEOF
8690e634
JK
10004
10005
6ec2e0f5 10006
c0c3707f
CB
10007ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default"
10008if test "x$ac_cv_have_decl_getlogin" = xyes; then :
10009 ac_have_decl=1
6ec2e0f5 10010else
c0c3707f 10011 ac_have_decl=0
88b48903 10012fi
8690e634 10013
c0c3707f
CB
10014cat >>confdefs.h <<_ACEOF
10015#define HAVE_DECL_GETLOGIN $ac_have_decl
10016_ACEOF
8690e634
JK
10017
10018
10019
c0c3707f
CB
10020 case $host_os in
10021 mingw*)
10022 LIB_GETLOGIN='-ladvapi32' ;;
10023 *)
10024 LIB_GETLOGIN= ;;
10025 esac
6ec2e0f5 10026
472fa5ee
SM
10027
10028
10029
6ec2e0f5
SDJ
10030
10031
10032
c0c3707f
CB
10033 GNULIB_GETTIMEOFDAY=0;
10034 HAVE_GETTIMEOFDAY=1;
10035 HAVE_STRUCT_TIMEVAL=1;
10036 HAVE_SYS_TIME_H=1;
10037 REPLACE_GETTIMEOFDAY=0;
10038 REPLACE_STRUCT_TIMEVAL=0;
472fa5ee 10039
c0c3707f
CB
10040{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
10041$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
10042if ${ac_cv_c_restrict+:} false; then :
10043 $as_echo_n "(cached) " >&6
10044else
10045 ac_cv_c_restrict=no
10046 # The order here caters to the fact that C++ does not require restrict.
10047 for ac_kw in __restrict __restrict__ _Restrict restrict; do
10048 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10049/* end confdefs.h. */
10050typedef int *int_ptr;
10051 int foo (int_ptr $ac_kw ip) { return ip[0]; }
10052 int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
10053 int bar (int ip[$ac_kw]) { return ip[0]; }
472fa5ee 10054
c0c3707f
CB
10055int
10056main ()
10057{
10058int s[1];
10059 int *$ac_kw t = s;
10060 t[0] = 0;
10061 return foo (t) + bar (t);
472fa5ee 10062
c0c3707f
CB
10063 ;
10064 return 0;
10065}
10066_ACEOF
10067if ac_fn_c_try_compile "$LINENO"; then :
10068 ac_cv_c_restrict=$ac_kw
10069fi
10070rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10071 test "$ac_cv_c_restrict" != no && break
10072 done
472fa5ee 10073
c0c3707f
CB
10074fi
10075{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
10076$as_echo "$ac_cv_c_restrict" >&6; }
472fa5ee 10077
c0c3707f
CB
10078 case $ac_cv_c_restrict in
10079 restrict) ;;
10080 no) $as_echo "#define restrict /**/" >>confdefs.h
10081 ;;
10082 *) cat >>confdefs.h <<_ACEOF
10083#define restrict $ac_cv_c_restrict
10084_ACEOF
10085 ;;
10086 esac
472fa5ee
SM
10087
10088
6ec2e0f5
SDJ
10089
10090
10091
10092
10093
10094
472fa5ee
SM
10095
10096
10097
6ec2e0f5
SDJ
10098
10099
10100
10101
10102
10103 if test $gl_cv_have_include_next = yes; then
c0c3707f 10104 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10105 else
c0c3707f
CB
10106 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
10107$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
10108if ${gl_cv_next_sys_time_h+:} false; then :
6ec2e0f5 10109 $as_echo_n "(cached) " >&6
88b48903 10110else
8690e634 10111
c0c3707f 10112 if test $ac_cv_header_sys_time_h = yes; then
8690e634
JK
10113
10114
8690e634
JK
10115
10116
6ec2e0f5
SDJ
10117 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10118/* end confdefs.h. */
c0c3707f 10119#include <sys/time.h>
88b48903 10120_ACEOF
6ec2e0f5
SDJ
10121 case "$host_os" in
10122 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10123 *) gl_absname_cpp="$ac_cpp" ;;
10124 esac
8690e634 10125
6ec2e0f5
SDJ
10126 case "$host_os" in
10127 mingw*)
10128 gl_dirsep_regex='[/\\]'
10129 ;;
10130 *)
10131 gl_dirsep_regex='\/'
88b48903
WN
10132 ;;
10133 esac
6ec2e0f5 10134 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 10135 gl_header_literal_regex=`echo 'sys/time.h' \
6ec2e0f5
SDJ
10136 | sed -e "$gl_make_literal_regex_sed"`
10137 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10138 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10139 s|^/[^/]|//&|
10140 p
10141 q
10142 }'
8690e634 10143
c0c3707f 10144 gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5 10145 sed -n "$gl_absolute_header_sed"`
8690e634 10146
c0c3707f
CB
10147 gl_header=$gl_cv_absolute_sys_time_h
10148 gl_cv_next_sys_time_h='"'$gl_header'"'
6ec2e0f5 10149 else
c0c3707f 10150 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10151 fi
88b48903 10152
88b48903 10153
88b48903 10154fi
c0c3707f
CB
10155{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
10156$as_echo "$gl_cv_next_sys_time_h" >&6; }
6ec2e0f5 10157 fi
c0c3707f 10158 NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
88b48903 10159
6ec2e0f5
SDJ
10160 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10161 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 10162 gl_next_as_first_directive='<'sys/time.h'>'
6ec2e0f5
SDJ
10163 else
10164 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f
CB
10165 gl_next_as_first_directive=$gl_cv_next_sys_time_h
10166 fi
10167 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
6ec2e0f5 10168
6ec2e0f5
SDJ
10169
10170
10171
6ec2e0f5 10172
c0c3707f
CB
10173 if test $ac_cv_header_sys_time_h != yes; then
10174 HAVE_SYS_TIME_H=0
10175 fi
6ec2e0f5 10176
6ec2e0f5 10177
6ec2e0f5 10178
6ec2e0f5 10179
6ec2e0f5 10180
c0c3707f
CB
10181 if test $ac_cv_header_sys_socket_h != yes; then
10182 for ac_header in winsock2.h
10183do :
10184 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
10185if test "x$ac_cv_header_winsock2_h" = xyes; then :
10186 cat >>confdefs.h <<_ACEOF
10187#define HAVE_WINSOCK2_H 1
6ec2e0f5 10188_ACEOF
6ec2e0f5 10189
6ec2e0f5 10190fi
6ec2e0f5 10191
c0c3707f 10192done
6ec2e0f5 10193
c0c3707f
CB
10194 fi
10195 if test "$ac_cv_header_winsock2_h" = yes; then
10196 HAVE_WINSOCK2_H=1
10197 UNISTD_H_HAVE_WINSOCK2_H=1
10198 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
10199 else
10200 HAVE_WINSOCK2_H=0
10201 fi
10202
10203
10204 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
10205$as_echo_n "checking for struct timeval... " >&6; }
10206if ${gl_cv_sys_struct_timeval+:} false; then :
10207 $as_echo_n "(cached) " >&6
10208else
10209 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10210/* end confdefs.h. */
c0c3707f
CB
10211#if HAVE_SYS_TIME_H
10212 #include <sys/time.h>
10213 #endif
10214 #include <time.h>
10215 #if HAVE_WINSOCK2_H
10216 # include <winsock2.h>
10217 #endif
6ec2e0f5
SDJ
10218
10219int
10220main ()
10221{
c0c3707f 10222static struct timeval x; x.tv_sec = x.tv_usec;
6ec2e0f5
SDJ
10223 ;
10224 return 0;
10225}
10226_ACEOF
10227if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10228 gl_cv_sys_struct_timeval=yes
6ec2e0f5 10229else
c0c3707f 10230 gl_cv_sys_struct_timeval=no
6ec2e0f5
SDJ
10231fi
10232rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
88b48903 10233
c0c3707f
CB
10234fi
10235{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
10236$as_echo "$gl_cv_sys_struct_timeval" >&6; }
10237 if test $gl_cv_sys_struct_timeval != yes; then
10238 HAVE_STRUCT_TIMEVAL=0
10239 else
10240 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
10241$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
10242if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then :
10243 $as_echo_n "(cached) " >&6
10244else
10245 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88b48903 10246/* end confdefs.h. */
c0c3707f
CB
10247#if HAVE_SYS_TIME_H
10248 #include <sys/time.h>
10249 #endif
10250 #include <time.h>
10251 #if HAVE_WINSOCK2_H
10252 # include <winsock2.h>
10253 #endif
88b48903
WN
10254
10255int
10256main ()
10257{
c0c3707f
CB
10258static struct timeval x;
10259 typedef int verify_tv_sec_type[
10260 sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
10261 ];
88b48903
WN
10262
10263 ;
10264 return 0;
10265}
10266_ACEOF
10267if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10268 gl_cv_sys_struct_timeval_tv_sec=yes
88b48903 10269else
c0c3707f 10270 gl_cv_sys_struct_timeval_tv_sec=no
88b48903
WN
10271fi
10272rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10273
88b48903 10274fi
c0c3707f
CB
10275{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
10276$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
10277 if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
10278 REPLACE_STRUCT_TIMEVAL=1
88b48903 10279 fi
c0c3707f 10280 fi
88b48903 10281
c0c3707f
CB
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292 NEED_LOCALTIME_BUFFER=0
10293
10294
10295 GNULIB_CTIME=0;
10296 GNULIB_MKTIME=0;
10297 GNULIB_LOCALTIME=0;
10298 GNULIB_NANOSLEEP=0;
10299 GNULIB_STRFTIME=0;
10300 GNULIB_STRPTIME=0;
10301 GNULIB_TIMEGM=0;
10302 GNULIB_TIME_R=0;
10303 GNULIB_TIME_RZ=0;
10304 GNULIB_TZSET=0;
10305 HAVE_DECL_LOCALTIME_R=1;
10306 HAVE_NANOSLEEP=1;
10307 HAVE_STRPTIME=1;
10308 HAVE_TIMEGM=1;
10309 HAVE_TZSET=1;
10310 HAVE_TIMEZONE_T=0;
10311 REPLACE_CTIME=GNULIB_PORTCHECK;
10312 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
10313 REPLACE_MKTIME=GNULIB_PORTCHECK;
10314 REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
10315 REPLACE_STRFTIME=GNULIB_PORTCHECK;
10316 REPLACE_TIMEGM=GNULIB_PORTCHECK;
10317 REPLACE_TZSET=GNULIB_PORTCHECK;
10318
10319 : ${GNULIB_GETTIMEOFDAY=0};
10320 REPLACE_GMTIME=0;
10321 REPLACE_LOCALTIME=0;
10322
10323
10324 GNULIB_GLOB=0;
10325 HAVE_GLOB=1;
10326 HAVE_GLOB_PATTERN_P=1;
10327 REPLACE_GLOB=0;
10328 REPLACE_GLOB_PATTERN_P=0;
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346 if test $gl_cv_have_include_next = yes; then
10347 gl_cv_next_glob_h='<'glob.h'>'
10348 else
10349 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <glob.h>" >&5
10350$as_echo_n "checking absolute name of <glob.h>... " >&6; }
10351if ${gl_cv_next_glob_h+:} false; then :
10352 $as_echo_n "(cached) " >&6
88b48903 10353else
c0c3707f
CB
10354
10355 if test $ac_cv_header_glob_h = yes; then
10356
10357
10358
10359
88b48903
WN
10360 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10361/* end confdefs.h. */
c0c3707f
CB
10362#include <glob.h>
10363_ACEOF
10364 case "$host_os" in
10365 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10366 *) gl_absname_cpp="$ac_cpp" ;;
10367 esac
88b48903 10368
c0c3707f
CB
10369 case "$host_os" in
10370 mingw*)
10371 gl_dirsep_regex='[/\\]'
10372 ;;
10373 *)
10374 gl_dirsep_regex='\/'
10375 ;;
10376 esac
10377 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10378 gl_header_literal_regex=`echo 'glob.h' \
10379 | sed -e "$gl_make_literal_regex_sed"`
10380 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10381 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10382 s|^/[^/]|//&|
10383 p
10384 q
10385 }'
10386
10387 gl_cv_absolute_glob_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10388 sed -n "$gl_absolute_header_sed"`
10389
10390 gl_header=$gl_cv_absolute_glob_h
10391 gl_cv_next_glob_h='"'$gl_header'"'
10392 else
10393 gl_cv_next_glob_h='<'glob.h'>'
10394 fi
88b48903 10395
88b48903 10396
88b48903 10397fi
c0c3707f
CB
10398{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_glob_h" >&5
10399$as_echo "$gl_cv_next_glob_h" >&6; }
10400 fi
10401 NEXT_GLOB_H=$gl_cv_next_glob_h
88b48903 10402
c0c3707f
CB
10403 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10404 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10405 gl_next_as_first_directive='<'glob.h'>'
10406 else
10407 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10408 gl_next_as_first_directive=$gl_cv_next_glob_h
10409 fi
10410 NEXT_AS_FIRST_DIRECTIVE_GLOB_H=$gl_next_as_first_directive
88b48903 10411
88b48903
WN
10412
10413
10414
2196f55f 10415
c0c3707f
CB
10416 if test $ac_cv_header_glob_h = yes; then
10417 HAVE_GLOB_H=1
10418 else
10419 HAVE_GLOB_H=0
10420 fi
2196f55f 10421
6ec2e0f5 10422
c0c3707f
CB
10423 GLOB_H=''
10424 if false; then
10425 GLOB_H=glob.h
10426 else
10427 if test $ac_cv_header_glob_h != yes; then
10428 GLOB_H=glob.h
10429 fi
10430 fi
10431
10432
10433 if test -n "$GLOB_H"; then
10434 GL_GENERATE_GLOB_H_TRUE=
10435 GL_GENERATE_GLOB_H_FALSE='#'
88b48903 10436else
c0c3707f
CB
10437 GL_GENERATE_GLOB_H_TRUE='#'
10438 GL_GENERATE_GLOB_H_FALSE=
6ec2e0f5
SDJ
10439fi
10440
88b48903 10441
88b48903 10442
88b48903 10443
88b48903
WN
10444
10445
10446
10447
10448
10449
10450
10451
8690e634 10452
c0c3707f
CB
10453
10454
10455 GNULIB_SOCKET=0;
10456 GNULIB_CONNECT=0;
10457 GNULIB_ACCEPT=0;
10458 GNULIB_BIND=0;
10459 GNULIB_GETPEERNAME=0;
10460 GNULIB_GETSOCKNAME=0;
10461 GNULIB_GETSOCKOPT=0;
10462 GNULIB_LISTEN=0;
10463 GNULIB_RECV=0;
10464 GNULIB_SEND=0;
10465 GNULIB_RECVFROM=0;
10466 GNULIB_SENDTO=0;
10467 GNULIB_SETSOCKOPT=0;
10468 GNULIB_SHUTDOWN=0;
10469 GNULIB_ACCEPT4=0;
10470 HAVE_STRUCT_SOCKADDR_STORAGE=1;
10471 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
10472
10473 HAVE_SA_FAMILY_T=1;
10474 HAVE_ACCEPT4=1;
10475
10476
10477
10478
10479
10480 case "$host_os" in
10481 osf*)
10482
10483$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h
10484
10485 ;;
10486 esac
10487
10488 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
10489$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
10490if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then :
10491 $as_echo_n "(cached) " >&6
10492else
10493
10494 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10495/* end confdefs.h. */
10496#include <sys/socket.h>
8690e634
JK
10497int
10498main ()
10499{
10500
8690e634
JK
10501 ;
10502 return 0;
10503}
10504_ACEOF
6ec2e0f5 10505if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10506 gl_cv_header_sys_socket_h_selfcontained=yes
8690e634 10507else
c0c3707f 10508 gl_cv_header_sys_socket_h_selfcontained=no
8690e634 10509fi
6ec2e0f5 10510rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10511
8690e634 10512fi
c0c3707f
CB
10513{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
10514$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
10515 if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
10516 for ac_func in shutdown
10517do :
10518 ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
10519if test "x$ac_cv_func_shutdown" = xyes; then :
10520 cat >>confdefs.h <<_ACEOF
10521#define HAVE_SHUTDOWN 1
10522_ACEOF
6ec2e0f5 10523
c0c3707f
CB
10524fi
10525done
6ec2e0f5 10526
c0c3707f
CB
10527 if test $ac_cv_func_shutdown = yes; then
10528 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
10529$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
10530if ${gl_cv_header_sys_socket_h_shut+:} false; then :
10531 $as_echo_n "(cached) " >&6
10532else
8690e634 10533
c0c3707f
CB
10534 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10535/* end confdefs.h. */
10536#include <sys/socket.h>
6ec2e0f5
SDJ
10537int
10538main ()
10539{
c0c3707f 10540int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
6ec2e0f5
SDJ
10541 ;
10542 return 0;
10543}
10544_ACEOF
10545if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10546 gl_cv_header_sys_socket_h_shut=yes
6ec2e0f5 10547else
c0c3707f 10548 gl_cv_header_sys_socket_h_shut=no
8690e634 10549fi
6ec2e0f5 10550rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10551
6ec2e0f5 10552fi
c0c3707f
CB
10553{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
10554$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
10555 if test $gl_cv_header_sys_socket_h_shut = no; then
10556 SYS_SOCKET_H='sys/socket.h'
10557 fi
6ec2e0f5 10558 fi
c0c3707f
CB
10559 fi
10560 # We need to check for ws2tcpip.h now.
8690e634 10561
c0c3707f
CB
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572 if test $gl_cv_have_include_next = yes; then
10573 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
10574 else
10575 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
10576$as_echo_n "checking absolute name of <sys/socket.h>... " >&6; }
10577if ${gl_cv_next_sys_socket_h+:} false; then :
10578 $as_echo_n "(cached) " >&6
6ec2e0f5 10579else
c0c3707f
CB
10580
10581 if test $ac_cv_header_sys_socket_h = yes; then
10582
10583
10584
10585
6ec2e0f5
SDJ
10586 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10587/* end confdefs.h. */
c0c3707f
CB
10588#include <sys/socket.h>
10589_ACEOF
10590 case "$host_os" in
10591 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10592 *) gl_absname_cpp="$ac_cpp" ;;
10593 esac
8690e634 10594
c0c3707f
CB
10595 case "$host_os" in
10596 mingw*)
10597 gl_dirsep_regex='[/\\]'
10598 ;;
10599 *)
10600 gl_dirsep_regex='\/'
10601 ;;
10602 esac
10603 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10604 gl_header_literal_regex=`echo 'sys/socket.h' \
10605 | sed -e "$gl_make_literal_regex_sed"`
10606 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10607 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10608 s|^/[^/]|//&|
10609 p
10610 q
10611 }'
10612
10613 gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10614 sed -n "$gl_absolute_header_sed"`
10615
10616 gl_header=$gl_cv_absolute_sys_socket_h
10617 gl_cv_next_sys_socket_h='"'$gl_header'"'
10618 else
10619 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
10620 fi
6ec2e0f5 10621
6ec2e0f5 10622
6ec2e0f5 10623fi
c0c3707f
CB
10624{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
10625$as_echo "$gl_cv_next_sys_socket_h" >&6; }
10626 fi
10627 NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
8690e634 10628
c0c3707f
CB
10629 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10630 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10631 gl_next_as_first_directive='<'sys/socket.h'>'
10632 else
10633 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10634 gl_next_as_first_directive=$gl_cv_next_sys_socket_h
10635 fi
10636 NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
8690e634 10637
8690e634 10638
6ec2e0f5
SDJ
10639
10640
c0c3707f
CB
10641 if test $ac_cv_header_sys_socket_h = yes; then
10642 HAVE_SYS_SOCKET_H=1
10643 else
10644 HAVE_SYS_SOCKET_H=0
10645 fi
6ec2e0f5 10646
6ec2e0f5 10647
8690e634 10648
c0c3707f
CB
10649 if test $ac_cv_header_sys_socket_h = yes; then
10650 HAVE_WS2TCPIP_H=0
10651 else
10652 if test $ac_cv_header_ws2tcpip_h = yes; then
10653 HAVE_WS2TCPIP_H=1
10654 else
10655 HAVE_WS2TCPIP_H=0
10656 fi
6ec2e0f5 10657 fi
8690e634 10658
472fa5ee 10659
c0c3707f
CB
10660
10661 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
10662 /* sys/types.h is not needed according to POSIX, but the
10663 sys/socket.h in i386-unknown-freebsd4.10 and
10664 powerpc-apple-darwin5.5 required it. */
10665#include <sys/types.h>
10666#ifdef HAVE_SYS_SOCKET_H
10667#include <sys/socket.h>
10668#endif
10669#ifdef HAVE_WS2TCPIP_H
10670#include <ws2tcpip.h>
10671#endif
10672
10673"
10674if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
10675
10676cat >>confdefs.h <<_ACEOF
10677#define HAVE_STRUCT_SOCKADDR_STORAGE 1
10678_ACEOF
10679
10680
5e8754f9 10681fi
c0c3707f
CB
10682ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "
10683 /* sys/types.h is not needed according to POSIX, but the
10684 sys/socket.h in i386-unknown-freebsd4.10 and
10685 powerpc-apple-darwin5.5 required it. */
10686#include <sys/types.h>
10687#ifdef HAVE_SYS_SOCKET_H
10688#include <sys/socket.h>
10689#endif
10690#ifdef HAVE_WS2TCPIP_H
10691#include <ws2tcpip.h>
10692#endif
10693
10694"
10695if test "x$ac_cv_type_sa_family_t" = xyes; then :
5e8754f9
SDJ
10696
10697cat >>confdefs.h <<_ACEOF
c0c3707f 10698#define HAVE_SA_FAMILY_T 1
5e8754f9
SDJ
10699_ACEOF
10700
10701
c0c3707f 10702fi
5e8754f9 10703
c0c3707f
CB
10704 if test $ac_cv_type_struct_sockaddr_storage = no; then
10705 HAVE_STRUCT_SOCKADDR_STORAGE=0
10706 fi
10707 if test $ac_cv_type_sa_family_t = no; then
10708 HAVE_SA_FAMILY_T=0
10709 fi
10710 if test $ac_cv_type_struct_sockaddr_storage != no; then
10711 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
10712 #ifdef HAVE_SYS_SOCKET_H
10713 #include <sys/socket.h>
10714 #endif
10715 #ifdef HAVE_WS2TCPIP_H
10716 #include <ws2tcpip.h>
10717 #endif
5abebf3c 10718
c0c3707f
CB
10719"
10720if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
5abebf3c 10721
c0c3707f
CB
10722cat >>confdefs.h <<_ACEOF
10723#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
5abebf3c 10724_ACEOF
c0c3707f
CB
10725
10726
5abebf3c 10727else
c0c3707f 10728 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
5abebf3c 10729fi
c0c3707f
CB
10730
10731 fi
10732 if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
10733 || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
10734 SYS_SOCKET_H='sys/socket.h'
10735 fi
5abebf3c
CB
10736
10737
10738
5abebf3c 10739
c0c3707f
CB
10740 if test $ac_cv_header_sys_socket_h != yes; then
10741 for ac_header in winsock2.h
10742do :
10743 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
10744if test "x$ac_cv_header_winsock2_h" = xyes; then :
10745 cat >>confdefs.h <<_ACEOF
10746#define HAVE_WINSOCK2_H 1
10747_ACEOF
5abebf3c 10748
c0c3707f 10749fi
5abebf3c 10750
c0c3707f 10751done
5abebf3c 10752
5abebf3c 10753 fi
c0c3707f
CB
10754 if test "$ac_cv_header_winsock2_h" = yes; then
10755 HAVE_WINSOCK2_H=1
10756 UNISTD_H_HAVE_WINSOCK2_H=1
10757 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
5abebf3c 10758 else
c0c3707f 10759 HAVE_WINSOCK2_H=0
5abebf3c 10760 fi
5abebf3c
CB
10761
10762
10763
5abebf3c 10764
5abebf3c 10765
c0c3707f
CB
10766
10767
10768
10769
10770
10771
10772
10773
10774 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
10775$as_echo_n "checking for IPv4 sockets... " >&6; }
10776if ${gl_cv_socket_ipv4+:} false; then :
5abebf3c
CB
10777 $as_echo_n "(cached) " >&6
10778else
c0c3707f
CB
10779 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10780/* end confdefs.h. */
10781#include <sys/types.h>
10782#ifdef HAVE_SYS_SOCKET_H
10783#include <sys/socket.h>
10784#endif
10785#ifdef HAVE_NETINET_IN_H
10786#include <netinet/in.h>
10787#endif
10788#ifdef HAVE_WINSOCK2_H
10789#include <winsock2.h>
10790#endif
10791int
10792main ()
10793{
10794int x = AF_INET; struct in_addr y; struct sockaddr_in z;
10795 if (&x && &y && &z) return 0;
10796 ;
10797 return 0;
10798}
10799_ACEOF
10800if ac_fn_c_try_compile "$LINENO"; then :
10801 gl_cv_socket_ipv4=yes
5abebf3c 10802else
c0c3707f 10803 gl_cv_socket_ipv4=no
5abebf3c 10804fi
c0c3707f 10805rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 10806fi
c0c3707f
CB
10807{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
10808$as_echo "$gl_cv_socket_ipv4" >&6; }
10809 if test $gl_cv_socket_ipv4 = yes; then
5abebf3c 10810
c0c3707f
CB
10811$as_echo "#define HAVE_IPV4 1" >>confdefs.h
10812
10813 fi
10814
10815 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
10816$as_echo_n "checking for IPv6 sockets... " >&6; }
10817if ${gl_cv_socket_ipv6+:} false; then :
5abebf3c
CB
10818 $as_echo_n "(cached) " >&6
10819else
c0c3707f
CB
10820 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10821/* end confdefs.h. */
10822#include <sys/types.h>
10823#ifdef HAVE_SYS_SOCKET_H
10824#include <sys/socket.h>
10825#endif
10826#ifdef HAVE_NETINET_IN_H
10827#include <netinet/in.h>
10828#endif
10829#ifdef HAVE_WINSOCK2_H
10830#include <winsock2.h>
10831#endif
10832#ifdef HAVE_WS2TCPIP_H
10833#include <ws2tcpip.h>
10834#endif
10835int
10836main ()
10837{
10838int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
10839 if (&x && &y && &z) return 0;
10840 ;
10841 return 0;
10842}
10843_ACEOF
10844if ac_fn_c_try_compile "$LINENO"; then :
10845 gl_cv_socket_ipv6=yes
10846else
10847 gl_cv_socket_ipv6=no
10848fi
10849rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 10850fi
c0c3707f
CB
10851{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
10852$as_echo "$gl_cv_socket_ipv6" >&6; }
10853 if test $gl_cv_socket_ipv6 = yes; then
10854
10855$as_echo "#define HAVE_IPV6 1" >>confdefs.h
5abebf3c 10856
c0c3707f 10857 fi
5abebf3c
CB
10858
10859
10860
5abebf3c 10861
5abebf3c 10862
5abebf3c
CB
10863
10864
10865
10866
c0c3707f
CB
10867
10868
10869
10870
10871 if test $gl_cv_have_include_next = yes; then
10872 gl_cv_next_limits_h='<'limits.h'>'
10873 else
10874 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
10875$as_echo_n "checking absolute name of <limits.h>... " >&6; }
10876if ${gl_cv_next_limits_h+:} false; then :
5abebf3c
CB
10877 $as_echo_n "(cached) " >&6
10878else
5abebf3c 10879
c0c3707f 10880 if test $ac_cv_header_limits_h = yes; then
5abebf3c 10881
5abebf3c
CB
10882
10883
c0c3707f
CB
10884
10885 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10886/* end confdefs.h. */
10887#include <limits.h>
10888_ACEOF
10889 case "$host_os" in
10890 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10891 *) gl_absname_cpp="$ac_cpp" ;;
10892 esac
10893
10894 case "$host_os" in
10895 mingw*)
10896 gl_dirsep_regex='[/\\]'
5abebf3c
CB
10897 ;;
10898 *)
c0c3707f 10899 gl_dirsep_regex='\/'
5abebf3c
CB
10900 ;;
10901 esac
c0c3707f
CB
10902 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10903 gl_header_literal_regex=`echo 'limits.h' \
10904 | sed -e "$gl_make_literal_regex_sed"`
10905 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10906 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10907 s|^/[^/]|//&|
10908 p
10909 q
10910 }'
5abebf3c 10911
c0c3707f
CB
10912 gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10913 sed -n "$gl_absolute_header_sed"`
5abebf3c 10914
c0c3707f
CB
10915 gl_header=$gl_cv_absolute_limits_h
10916 gl_cv_next_limits_h='"'$gl_header'"'
10917 else
10918 gl_cv_next_limits_h='<'limits.h'>'
10919 fi
5abebf3c 10920
5abebf3c 10921
5abebf3c 10922fi
c0c3707f
CB
10923{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
10924$as_echo "$gl_cv_next_limits_h" >&6; }
10925 fi
10926 NEXT_LIMITS_H=$gl_cv_next_limits_h
10927
10928 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10929 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10930 gl_next_as_first_directive='<'limits.h'>'
10931 else
10932 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10933 gl_next_as_first_directive=$gl_cv_next_limits_h
10934 fi
10935 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
5abebf3c
CB
10936
10937
c0c3707f
CB
10938
10939
10940
10941 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5
10942$as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; }
10943if ${gl_cv_header_limits_width+:} false; then :
10944 $as_echo_n "(cached) " >&6
5abebf3c
CB
10945else
10946 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10947/* end confdefs.h. */
c0c3707f
CB
10948#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
10949 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
10950 #endif
10951 #include <limits.h>
10952 long long llm = LLONG_MAX;
10953 int wb = WORD_BIT;
10954 int ullw = ULLONG_WIDTH;
5abebf3c 10955
c0c3707f
CB
10956int
10957main ()
5abebf3c 10958{
c0c3707f
CB
10959
10960 ;
10961 return 0;
5abebf3c
CB
10962}
10963_ACEOF
c0c3707f
CB
10964if ac_fn_c_try_compile "$LINENO"; then :
10965 gl_cv_header_limits_width=yes
5abebf3c 10966else
c0c3707f 10967 gl_cv_header_limits_width=no
5abebf3c 10968fi
c0c3707f 10969rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 10970fi
c0c3707f
CB
10971{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
10972$as_echo "$gl_cv_header_limits_width" >&6; }
10973 if test "$gl_cv_header_limits_width" = yes; then
10974 LIMITS_H=
10975 else
10976 LIMITS_H=limits.h
10977 fi
5abebf3c 10978
c0c3707f
CB
10979 if test -n "$LIMITS_H"; then
10980 GL_GENERATE_LIMITS_H_TRUE=
10981 GL_GENERATE_LIMITS_H_FALSE='#'
5abebf3c 10982else
c0c3707f
CB
10983 GL_GENERATE_LIMITS_H_TRUE='#'
10984 GL_GENERATE_LIMITS_H_FALSE=
5abebf3c
CB
10985fi
10986
10987
5abebf3c 10988
c0c3707f
CB
10989 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
10990$as_echo_n "checking for wint_t... " >&6; }
10991if ${gt_cv_c_wint_t+:} false; then :
5abebf3c
CB
10992 $as_echo_n "(cached) " >&6
10993else
c0c3707f 10994 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c
CB
10995/* end confdefs.h. */
10996
c0c3707f
CB
10997/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
10998 <wchar.h>.
10999 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
11000 before <wchar.h>. */
11001#include <stddef.h>
11002#include <stdio.h>
11003#include <time.h>
11004#include <wchar.h>
11005 wint_t foo = (wchar_t)'\0';
5abebf3c
CB
11006int
11007main ()
11008{
c0c3707f 11009
5abebf3c
CB
11010 ;
11011 return 0;
11012}
11013_ACEOF
c0c3707f
CB
11014if ac_fn_c_try_compile "$LINENO"; then :
11015 gt_cv_c_wint_t=yes
5abebf3c 11016else
c0c3707f 11017 gt_cv_c_wint_t=no
5abebf3c 11018fi
c0c3707f 11019rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11020fi
c0c3707f
CB
11021{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
11022$as_echo "$gt_cv_c_wint_t" >&6; }
11023 if test $gt_cv_c_wint_t = yes; then
5abebf3c 11024
c0c3707f 11025$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
5abebf3c 11026
5abebf3c 11027
c0c3707f
CB
11028 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5
11029$as_echo_n "checking whether wint_t is too small... " >&6; }
11030if ${gl_cv_type_wint_t_too_small+:} false; then :
5abebf3c
CB
11031 $as_echo_n "(cached) " >&6
11032else
c0c3707f 11033 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c
CB
11034/* end confdefs.h. */
11035
c0c3707f
CB
11036/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
11037 <wchar.h>.
11038 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11039 included before <wchar.h>. */
11040#if !(defined __GLIBC__ && !defined __UCLIBC__)
11041# include <stddef.h>
11042# include <stdio.h>
11043# include <time.h>
5abebf3c 11044#endif
c0c3707f
CB
11045#include <wchar.h>
11046 int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
11047
5abebf3c
CB
11048int
11049main ()
11050{
c0c3707f 11051
5abebf3c
CB
11052 ;
11053 return 0;
11054}
11055_ACEOF
c0c3707f
CB
11056if ac_fn_c_try_compile "$LINENO"; then :
11057 gl_cv_type_wint_t_too_small=no
5abebf3c 11058else
c0c3707f 11059 gl_cv_type_wint_t_too_small=yes
5abebf3c 11060fi
c0c3707f 11061rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11062fi
c0c3707f
CB
11063{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5
11064$as_echo "$gl_cv_type_wint_t_too_small" >&6; }
11065 if test $gl_cv_type_wint_t_too_small = yes; then
11066 GNULIB_OVERRIDES_WINT_T=1
11067 else
11068 GNULIB_OVERRIDES_WINT_T=0
11069 fi
11070 else
11071 GNULIB_OVERRIDES_WINT_T=0
11072 fi
5abebf3c 11073
c0c3707f
CB
11074
11075
5abebf3c 11076
c0c3707f
CB
11077 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
11078$as_echo_n "checking for long long int... " >&6; }
11079if ${ac_cv_type_long_long_int+:} false; then :
11080 $as_echo_n "(cached) " >&6
11081else
11082 ac_cv_type_long_long_int=yes
11083 if test "x${ac_cv_prog_cc_c99-no}" = xno; then
11084 ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
11085 if test $ac_cv_type_long_long_int = yes; then
11086 if test "$cross_compiling" = yes; then :
11087 :
11088else
11089 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11090/* end confdefs.h. */
c0c3707f
CB
11091#include <limits.h>
11092 #ifndef LLONG_MAX
11093 # define HALF \
11094 (1LL << (sizeof (long long int) * CHAR_BIT - 2))
11095 # define LLONG_MAX (HALF - 1 + HALF)
11096 #endif
5abebf3c
CB
11097int
11098main ()
11099{
c0c3707f
CB
11100long long int n = 1;
11101 int i;
11102 for (i = 0; ; i++)
11103 {
11104 long long int m = n << i;
11105 if (m >> i != n)
11106 return 1;
11107 if (LLONG_MAX / 2 < m)
11108 break;
11109 }
11110 return 0;
5abebf3c
CB
11111 ;
11112 return 0;
11113}
11114_ACEOF
c0c3707f 11115if ac_fn_c_try_run "$LINENO"; then :
5abebf3c 11116
c0c3707f
CB
11117else
11118 ac_cv_type_long_long_int=no
11119fi
11120rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11121 conftest.$ac_objext conftest.beam conftest.$ac_ext
11122fi
5abebf3c 11123
5abebf3c
CB
11124 fi
11125 fi
c0c3707f
CB
11126fi
11127{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
11128$as_echo "$ac_cv_type_long_long_int" >&6; }
11129 if test $ac_cv_type_long_long_int = yes; then
5abebf3c 11130
c0c3707f 11131$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 11132
c0c3707f 11133 fi
5abebf3c 11134
5abebf3c
CB
11135
11136
11137
11138
11139
c0c3707f
CB
11140 gl_cv_c_multiarch=no
11141 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11142/* end confdefs.h. */
11143#ifndef __APPLE_CC__
11144 not a universal capable compiler
11145 #endif
11146 typedef int dummy;
5abebf3c 11147
c0c3707f
CB
11148_ACEOF
11149if ac_fn_c_try_compile "$LINENO"; then :
5abebf3c 11150
c0c3707f
CB
11151 arch=
11152 prev=
11153 for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
11154 if test -n "$prev"; then
11155 case $word in
11156 i?86 | x86_64 | ppc | ppc64)
11157 if test -z "$arch" || test "$arch" = "$word"; then
11158 arch="$word"
11159 else
11160 gl_cv_c_multiarch=yes
11161 fi
11162 ;;
11163 esac
11164 prev=
11165 else
11166 if test "x$word" = "x-arch"; then
11167 prev=arch
11168 fi
11169 fi
11170 done
5abebf3c 11171
c0c3707f
CB
11172fi
11173rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11174 if test $gl_cv_c_multiarch = yes; then
11175 APPLE_UNIVERSAL_BUILD=1
11176 else
11177 APPLE_UNIVERSAL_BUILD=0
11178 fi
5abebf3c 11179
5abebf3c 11180
5abebf3c 11181
5abebf3c
CB
11182
11183
5abebf3c 11184
5abebf3c 11185
5abebf3c 11186
c0c3707f
CB
11187 if test $ac_cv_type_long_long_int = yes; then
11188 HAVE_LONG_LONG_INT=1
11189 else
11190 HAVE_LONG_LONG_INT=0
11191 fi
5abebf3c 11192
5abebf3c 11193
c0c3707f
CB
11194 if test $ac_cv_type_unsigned_long_long_int = yes; then
11195 HAVE_UNSIGNED_LONG_LONG_INT=1
11196 else
11197 HAVE_UNSIGNED_LONG_LONG_INT=0
11198 fi
5abebf3c 11199
c0c3707f
CB
11200
11201
11202 if test $ac_cv_header_wchar_h = yes; then
11203 HAVE_WCHAR_H=1
11204 else
11205 HAVE_WCHAR_H=0
5abebf3c 11206 fi
c0c3707f
CB
11207
11208
11209 if test $ac_cv_header_inttypes_h = yes; then
11210 HAVE_INTTYPES_H=1
11211 else
11212 HAVE_INTTYPES_H=0
5abebf3c
CB
11213 fi
11214
11215
c0c3707f
CB
11216 if test $ac_cv_header_sys_types_h = yes; then
11217 HAVE_SYS_TYPES_H=1
11218 else
11219 HAVE_SYS_TYPES_H=0
11220 fi
11221
5abebf3c
CB
11222
11223
11224
11225
5abebf3c 11226
5abebf3c 11227
5abebf3c 11228
5abebf3c 11229
5abebf3c
CB
11230
11231
c0c3707f
CB
11232 if test $gl_cv_have_include_next = yes; then
11233 gl_cv_next_stdint_h='<'stdint.h'>'
11234 else
11235 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
11236$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
11237if ${gl_cv_next_stdint_h+:} false; then :
11238 $as_echo_n "(cached) " >&6
11239else
5abebf3c 11240
c0c3707f 11241 if test $ac_cv_header_stdint_h = yes; then
5abebf3c 11242
5abebf3c
CB
11243
11244
11245
c0c3707f 11246 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11247/* end confdefs.h. */
c0c3707f 11248#include <stdint.h>
5abebf3c 11249_ACEOF
c0c3707f
CB
11250 case "$host_os" in
11251 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11252 *) gl_absname_cpp="$ac_cpp" ;;
11253 esac
5abebf3c 11254
c0c3707f
CB
11255 case "$host_os" in
11256 mingw*)
11257 gl_dirsep_regex='[/\\]'
11258 ;;
11259 *)
11260 gl_dirsep_regex='\/'
11261 ;;
11262 esac
11263 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
11264 gl_header_literal_regex=`echo 'stdint.h' \
11265 | sed -e "$gl_make_literal_regex_sed"`
11266 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11267 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11268 s|^/[^/]|//&|
11269 p
11270 q
11271 }'
5abebf3c 11272
c0c3707f
CB
11273 gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
11274 sed -n "$gl_absolute_header_sed"`
5abebf3c 11275
c0c3707f
CB
11276 gl_header=$gl_cv_absolute_stdint_h
11277 gl_cv_next_stdint_h='"'$gl_header'"'
11278 else
11279 gl_cv_next_stdint_h='<'stdint.h'>'
11280 fi
5abebf3c 11281
5abebf3c 11282
c0c3707f
CB
11283fi
11284{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
11285$as_echo "$gl_cv_next_stdint_h" >&6; }
11286 fi
11287 NEXT_STDINT_H=$gl_cv_next_stdint_h
5abebf3c 11288
c0c3707f
CB
11289 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11290 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
11291 gl_next_as_first_directive='<'stdint.h'>'
11292 else
11293 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
11294 gl_next_as_first_directive=$gl_cv_next_stdint_h
11295 fi
11296 NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
5abebf3c 11297
5e8754f9 11298
5e8754f9 11299
5e8754f9 11300
c0c3707f
CB
11301 if test $ac_cv_header_stdint_h = yes; then
11302 HAVE_STDINT_H=1
11303 else
11304 HAVE_STDINT_H=0
11305 fi
5e8754f9
SDJ
11306
11307
c0c3707f
CB
11308 if test $ac_cv_header_stdint_h = yes; then
11309 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
11310$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
11311if ${gl_cv_header_working_stdint_h+:} false; then :
11312 $as_echo_n "(cached) " >&6
11313else
11314 gl_cv_header_working_stdint_h=no
11315 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11316/* end confdefs.h. */
5e8754f9 11317
5e8754f9 11318
c0c3707f
CB
11319#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
11320#define __STDC_CONSTANT_MACROS 1
11321#define __STDC_LIMIT_MACROS 1
11322#include <stdint.h>
11323/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
11324#if !(defined WCHAR_MIN && defined WCHAR_MAX)
11325#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
11326#endif
5e8754f9
SDJ
11327
11328
c0c3707f
CB
11329 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11330 included before <wchar.h>. */
11331 #include <stddef.h>
11332 #include <signal.h>
11333 #if HAVE_WCHAR_H
11334 # include <stdio.h>
11335 # include <time.h>
11336 # include <wchar.h>
11337 #endif
f45c62c4
YQ
11338
11339
c0c3707f
CB
11340#ifdef INT8_MAX
11341int8_t a1 = INT8_MAX;
11342int8_t a1min = INT8_MIN;
11343#endif
11344#ifdef INT16_MAX
11345int16_t a2 = INT16_MAX;
11346int16_t a2min = INT16_MIN;
11347#endif
11348#ifdef INT32_MAX
11349int32_t a3 = INT32_MAX;
11350int32_t a3min = INT32_MIN;
11351#endif
11352#ifdef INT64_MAX
11353int64_t a4 = INT64_MAX;
11354int64_t a4min = INT64_MIN;
11355#endif
11356#ifdef UINT8_MAX
11357uint8_t b1 = UINT8_MAX;
11358#else
11359typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
11360#endif
11361#ifdef UINT16_MAX
11362uint16_t b2 = UINT16_MAX;
11363#endif
11364#ifdef UINT32_MAX
11365uint32_t b3 = UINT32_MAX;
11366#endif
11367#ifdef UINT64_MAX
11368uint64_t b4 = UINT64_MAX;
11369#endif
11370int_least8_t c1 = INT8_C (0x7f);
11371int_least8_t c1max = INT_LEAST8_MAX;
11372int_least8_t c1min = INT_LEAST8_MIN;
11373int_least16_t c2 = INT16_C (0x7fff);
11374int_least16_t c2max = INT_LEAST16_MAX;
11375int_least16_t c2min = INT_LEAST16_MIN;
11376int_least32_t c3 = INT32_C (0x7fffffff);
11377int_least32_t c3max = INT_LEAST32_MAX;
11378int_least32_t c3min = INT_LEAST32_MIN;
11379int_least64_t c4 = INT64_C (0x7fffffffffffffff);
11380int_least64_t c4max = INT_LEAST64_MAX;
11381int_least64_t c4min = INT_LEAST64_MIN;
11382uint_least8_t d1 = UINT8_C (0xff);
11383uint_least8_t d1max = UINT_LEAST8_MAX;
11384uint_least16_t d2 = UINT16_C (0xffff);
11385uint_least16_t d2max = UINT_LEAST16_MAX;
11386uint_least32_t d3 = UINT32_C (0xffffffff);
11387uint_least32_t d3max = UINT_LEAST32_MAX;
11388uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
11389uint_least64_t d4max = UINT_LEAST64_MAX;
11390int_fast8_t e1 = INT_FAST8_MAX;
11391int_fast8_t e1min = INT_FAST8_MIN;
11392int_fast16_t e2 = INT_FAST16_MAX;
11393int_fast16_t e2min = INT_FAST16_MIN;
11394int_fast32_t e3 = INT_FAST32_MAX;
11395int_fast32_t e3min = INT_FAST32_MIN;
11396int_fast64_t e4 = INT_FAST64_MAX;
11397int_fast64_t e4min = INT_FAST64_MIN;
11398uint_fast8_t f1 = UINT_FAST8_MAX;
11399uint_fast16_t f2 = UINT_FAST16_MAX;
11400uint_fast32_t f3 = UINT_FAST32_MAX;
11401uint_fast64_t f4 = UINT_FAST64_MAX;
11402#ifdef INTPTR_MAX
11403intptr_t g = INTPTR_MAX;
11404intptr_t gmin = INTPTR_MIN;
11405#endif
11406#ifdef UINTPTR_MAX
11407uintptr_t h = UINTPTR_MAX;
11408#endif
11409intmax_t i = INTMAX_MAX;
11410uintmax_t j = UINTMAX_MAX;
472fa5ee 11411
c0c3707f
CB
11412/* Check that SIZE_MAX has the correct type, if possible. */
11413#if 201112 <= __STDC_VERSION__
11414int k = _Generic (SIZE_MAX, size_t: 0);
11415#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
11416 || (0x5110 <= __SUNPRO_C && !__STDC__))
11417extern size_t k;
11418extern __typeof__ (SIZE_MAX) k;
11419#endif
472fa5ee 11420
c0c3707f
CB
11421#include <limits.h> /* for CHAR_BIT */
11422#define TYPE_MINIMUM(t) \
11423 ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
11424#define TYPE_MAXIMUM(t) \
11425 ((t) ((t) 0 < (t) -1 \
11426 ? (t) -1 \
11427 : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
11428struct s {
11429 int check_PTRDIFF:
11430 PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
11431 && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
11432 ? 1 : -1;
11433 /* Detect bug in FreeBSD 6.0 / ia64. */
11434 int check_SIG_ATOMIC:
11435 SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
11436 && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
11437 ? 1 : -1;
11438 int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
11439 int check_WCHAR:
11440 WCHAR_MIN == TYPE_MINIMUM (wchar_t)
11441 && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
11442 ? 1 : -1;
11443 /* Detect bug in mingw. */
11444 int check_WINT:
11445 WINT_MIN == TYPE_MINIMUM (wint_t)
11446 && WINT_MAX == TYPE_MAXIMUM (wint_t)
11447 ? 1 : -1;
472fa5ee 11448
c0c3707f
CB
11449 /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
11450 int check_UINT8_C:
11451 (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
11452 int check_UINT16_C:
11453 (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
f45c62c4 11454
c0c3707f
CB
11455 /* Detect bugs in OpenBSD 3.9 stdint.h. */
11456#ifdef UINT8_MAX
11457 int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
11458#endif
11459#ifdef UINT16_MAX
11460 int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
11461#endif
11462#ifdef UINT32_MAX
11463 int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
11464#endif
11465#ifdef UINT64_MAX
11466 int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
11467#endif
11468 int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
11469 int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
11470 int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
11471 int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
11472 int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
11473 int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
11474 int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
11475 int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
11476 int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
11477 int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
11478 int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
11479};
6ec2e0f5 11480
f45c62c4
YQ
11481int
11482main ()
11483{
f45c62c4
YQ
11484
11485 ;
11486 return 0;
11487}
11488_ACEOF
6ec2e0f5 11489if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 11490 if test "$cross_compiling" = yes; then :
6a29c58e 11491 case "$host_os" in
c0c3707f
CB
11492 # Guess yes on native Windows.
11493 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
11494 # In general, assume it works.
11495 *) gl_cv_header_working_stdint_h="guessing yes" ;;
11496 esac
6a29c58e 11497
98399780
YQ
11498else
11499 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11500/* end confdefs.h. */
98399780
YQ
11501
11502
c0c3707f
CB
11503#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
11504#define __STDC_CONSTANT_MACROS 1
11505#define __STDC_LIMIT_MACROS 1
11506#include <stdint.h>
98399780 11507
88b48903 11508
c0c3707f
CB
11509 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11510 included before <wchar.h>. */
11511 #include <stddef.h>
11512 #include <signal.h>
11513 #if HAVE_WCHAR_H
11514 # include <stdio.h>
11515 # include <time.h>
11516 # include <wchar.h>
11517 #endif
88b48903 11518
472fa5ee 11519
c0c3707f
CB
11520#include <stdio.h>
11521#include <string.h>
11522#define MVAL(macro) MVAL1(macro)
11523#define MVAL1(expression) #expression
11524static const char *macro_values[] =
11525 {
11526#ifdef INT8_MAX
11527 MVAL (INT8_MAX),
11528#endif
11529#ifdef INT16_MAX
11530 MVAL (INT16_MAX),
11531#endif
11532#ifdef INT32_MAX
11533 MVAL (INT32_MAX),
11534#endif
11535#ifdef INT64_MAX
11536 MVAL (INT64_MAX),
11537#endif
11538#ifdef UINT8_MAX
11539 MVAL (UINT8_MAX),
11540#endif
11541#ifdef UINT16_MAX
11542 MVAL (UINT16_MAX),
11543#endif
11544#ifdef UINT32_MAX
11545 MVAL (UINT32_MAX),
11546#endif
11547#ifdef UINT64_MAX
11548 MVAL (UINT64_MAX),
11549#endif
11550 NULL
11551 };
472fa5ee 11552
c0c3707f
CB
11553int
11554main ()
11555{
472fa5ee 11556
c0c3707f
CB
11557 const char **mv;
11558 for (mv = macro_values; *mv != NULL; mv++)
11559 {
11560 const char *value = *mv;
11561 /* Test whether it looks like a cast expression. */
11562 if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
11563 || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
11564 || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
11565 || strncmp (value, "((int)"/*)*/, 6) == 0
11566 || strncmp (value, "((signed short)"/*)*/, 15) == 0
11567 || strncmp (value, "((signed char)"/*)*/, 14) == 0)
11568 return mv - macro_values + 1;
11569 }
11570 return 0;
11571
11572 ;
11573 return 0;
11574}
11575_ACEOF
11576if ac_fn_c_try_run "$LINENO"; then :
11577 gl_cv_header_working_stdint_h=yes
11578fi
11579rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11580 conftest.$ac_objext conftest.beam conftest.$ac_ext
11581fi
11582
11583
11584fi
11585rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 11586
c0c3707f
CB
11587fi
11588{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
11589$as_echo "$gl_cv_header_working_stdint_h" >&6; }
11590 fi
8690e634 11591
c0c3707f
CB
11592 HAVE_C99_STDINT_H=0
11593 HAVE_SYS_BITYPES_H=0
11594 HAVE_SYS_INTTYPES_H=0
11595 STDINT_H=stdint.h
11596 case "$gl_cv_header_working_stdint_h" in
11597 *yes)
11598 HAVE_C99_STDINT_H=1
11599 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5
11600$as_echo_n "checking whether stdint.h predates C++11... " >&6; }
11601if ${gl_cv_header_stdint_predates_cxx11_h+:} false; then :
11602 $as_echo_n "(cached) " >&6
11603else
11604 gl_cv_header_stdint_predates_cxx11_h=yes
11605 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11606/* end confdefs.h. */
8690e634
JK
11607
11608
c0c3707f
CB
11609#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
11610#include <stdint.h>
8690e634
JK
11611
11612
c0c3707f
CB
11613 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11614 included before <wchar.h>. */
11615 #include <stddef.h>
11616 #include <signal.h>
11617 #if HAVE_WCHAR_H
11618 # include <stdio.h>
11619 # include <time.h>
11620 # include <wchar.h>
11621 #endif
8690e634
JK
11622
11623
c0c3707f
CB
11624intmax_t im = INTMAX_MAX;
11625int32_t i32 = INT32_C (0x7fffffff);
472fa5ee 11626
c0c3707f
CB
11627int
11628main ()
11629{
472fa5ee 11630
c0c3707f
CB
11631 ;
11632 return 0;
11633}
11634_ACEOF
11635if ac_fn_c_try_compile "$LINENO"; then :
11636 gl_cv_header_stdint_predates_cxx11_h=no
11637fi
11638rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11639fi
11640{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5
11641$as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; }
472fa5ee 11642
c0c3707f 11643 if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
472fa5ee 11644
c0c3707f 11645$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
472fa5ee
SM
11646
11647
c0c3707f
CB
11648$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
11649
11650 fi
11651 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
11652$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
11653if ${gl_cv_header_stdint_width+:} false; then :
8690e634
JK
11654 $as_echo_n "(cached) " >&6
11655else
c0c3707f
CB
11656 gl_cv_header_stdint_width=no
11657 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
11658/* end confdefs.h. */
11659
c0c3707f
CB
11660 /* Work if build is not clean. */
11661 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
11662 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
11663 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
11664 #endif
11665 #include <stdint.h>
11666
11667 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11668 included before <wchar.h>. */
11669 #include <stddef.h>
11670 #include <signal.h>
11671 #if HAVE_WCHAR_H
11672 # include <stdio.h>
11673 # include <time.h>
11674 # include <wchar.h>
11675 #endif
11676
11677 int iw = UINTMAX_WIDTH;
11678
11679int
11680main ()
8690e634 11681{
c0c3707f
CB
11682
11683 ;
8690e634
JK
11684 return 0;
11685}
8690e634 11686_ACEOF
c0c3707f
CB
11687if ac_fn_c_try_compile "$LINENO"; then :
11688 gl_cv_header_stdint_width=yes
11689fi
11690rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11691fi
11692{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
11693$as_echo "$gl_cv_header_stdint_width" >&6; }
11694 if test "$gl_cv_header_stdint_width" = yes; then
11695 STDINT_H=
11696 fi
11697 ;;
11698 *)
11699 for ac_header in sys/inttypes.h sys/bitypes.h
11700do :
11701 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
11702ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
11703if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
11704 cat >>confdefs.h <<_ACEOF
11705#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
11706_ACEOF
11707
11708fi
11709
11710done
11711
11712 if test $ac_cv_header_sys_inttypes_h = yes; then
11713 HAVE_SYS_INTTYPES_H=1
11714 fi
11715 if test $ac_cv_header_sys_bitypes_h = yes; then
11716 HAVE_SYS_BITYPES_H=1
11717 fi
11718
11719
11720 if test $APPLE_UNIVERSAL_BUILD = 0; then
11721
11722
11723 for gltype in ptrdiff_t size_t ; do
11724 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
11725$as_echo_n "checking for bit size of $gltype... " >&6; }
11726if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
11727 $as_echo_n "(cached) " >&6
11728else
11729 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
11730 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11731 included before <wchar.h>. */
11732 #include <stddef.h>
11733 #include <signal.h>
11734 #if HAVE_WCHAR_H
11735 # include <stdio.h>
11736 # include <time.h>
11737 # include <wchar.h>
11738 #endif
11739
11740#include <limits.h>"; then :
11741
11742else
11743 result=unknown
11744fi
11745
11746 eval gl_cv_bitsizeof_${gltype}=\$result
11747
11748fi
11749eval ac_res=\$gl_cv_bitsizeof_${gltype}
11750 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
11751$as_echo "$ac_res" >&6; }
11752 eval result=\$gl_cv_bitsizeof_${gltype}
11753 if test $result = unknown; then
11754 result=0
8690e634 11755 fi
c0c3707f
CB
11756 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
11757 cat >>confdefs.h <<_ACEOF
11758#define BITSIZEOF_${GLTYPE} $result
11759_ACEOF
8690e634 11760
c0c3707f
CB
11761 eval BITSIZEOF_${GLTYPE}=\$result
11762 done
8690e634
JK
11763
11764
c0c3707f 11765 fi
8690e634
JK
11766
11767
c0c3707f
CB
11768 for gltype in sig_atomic_t wchar_t wint_t ; do
11769 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
11770$as_echo_n "checking for bit size of $gltype... " >&6; }
11771if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
8690e634
JK
11772 $as_echo_n "(cached) " >&6
11773else
c0c3707f
CB
11774 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
11775 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11776 included before <wchar.h>. */
11777 #include <stddef.h>
11778 #include <signal.h>
11779 #if HAVE_WCHAR_H
11780 # include <stdio.h>
11781 # include <time.h>
11782 # include <wchar.h>
11783 #endif
8690e634 11784
c0c3707f 11785#include <limits.h>"; then :
8690e634 11786
c0c3707f
CB
11787else
11788 result=unknown
11789fi
8690e634 11790
c0c3707f 11791 eval gl_cv_bitsizeof_${gltype}=\$result
8690e634
JK
11792
11793fi
c0c3707f
CB
11794eval ac_res=\$gl_cv_bitsizeof_${gltype}
11795 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
11796$as_echo "$ac_res" >&6; }
11797 eval result=\$gl_cv_bitsizeof_${gltype}
11798 if test $result = unknown; then
11799 result=0
11800 fi
11801 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
11802 cat >>confdefs.h <<_ACEOF
11803#define BITSIZEOF_${GLTYPE} $result
11804_ACEOF
11805
11806 eval BITSIZEOF_${GLTYPE}=\$result
11807 done
8690e634
JK
11808
11809
11810
11811
c0c3707f
CB
11812 for gltype in sig_atomic_t wchar_t wint_t ; do
11813 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
11814$as_echo_n "checking whether $gltype is signed... " >&6; }
11815if eval \${gl_cv_type_${gltype}_signed+:} false; then :
8690e634
JK
11816 $as_echo_n "(cached) " >&6
11817else
c0c3707f 11818 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
11819/* end confdefs.h. */
11820
c0c3707f
CB
11821 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11822 included before <wchar.h>. */
11823 #include <stddef.h>
11824 #include <signal.h>
11825 #if HAVE_WCHAR_H
11826 # include <stdio.h>
11827 # include <time.h>
11828 # include <wchar.h>
11829 #endif
11830
11831 int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
11832int
11833main ()
11834{
11835
11836 ;
8690e634
JK
11837 return 0;
11838}
c0c3707f
CB
11839_ACEOF
11840if ac_fn_c_try_compile "$LINENO"; then :
11841 result=yes
11842else
11843 result=no
11844fi
11845rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11846 eval gl_cv_type_${gltype}_signed=\$result
8690e634 11847
c0c3707f
CB
11848fi
11849eval ac_res=\$gl_cv_type_${gltype}_signed
11850 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
11851$as_echo "$ac_res" >&6; }
11852 eval result=\$gl_cv_type_${gltype}_signed
11853 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
11854 if test "$result" = yes; then
11855 cat >>confdefs.h <<_ACEOF
11856#define HAVE_SIGNED_${GLTYPE} 1
8690e634 11857_ACEOF
c0c3707f
CB
11858
11859 eval HAVE_SIGNED_${GLTYPE}=1
11860 else
11861 eval HAVE_SIGNED_${GLTYPE}=0
8690e634 11862 fi
c0c3707f
CB
11863 done
11864
11865
11866 gl_cv_type_ptrdiff_t_signed=yes
11867 gl_cv_type_size_t_signed=no
11868 if test $APPLE_UNIVERSAL_BUILD = 0; then
11869
11870
11871 for gltype in ptrdiff_t size_t ; do
11872 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
11873$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
11874if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
11875 $as_echo_n "(cached) " >&6
11876else
11877 eval gl_cv_type_${gltype}_suffix=no
11878 eval result=\$gl_cv_type_${gltype}_signed
11879 if test "$result" = yes; then
11880 glsufu=
11881 else
11882 glsufu=u
11883 fi
11884 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
11885 case $glsuf in
11886 '') gltype1='int';;
11887 l) gltype1='long int';;
11888 ll) gltype1='long long int';;
11889 i64) gltype1='__int64';;
11890 u) gltype1='unsigned int';;
11891 ul) gltype1='unsigned long int';;
11892 ull) gltype1='unsigned long long int';;
11893 ui64)gltype1='unsigned __int64';;
11894 esac
11895 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11896/* end confdefs.h. */
11897
11898 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11899 included before <wchar.h>. */
11900 #include <stddef.h>
11901 #include <signal.h>
11902 #if HAVE_WCHAR_H
11903 # include <stdio.h>
11904 # include <time.h>
11905 # include <wchar.h>
11906 #endif
8690e634 11907
c0c3707f
CB
11908 extern $gltype foo;
11909 extern $gltype1 foo;
11910int
11911main ()
11912{
11913
11914 ;
11915 return 0;
11916}
11917_ACEOF
11918if ac_fn_c_try_compile "$LINENO"; then :
11919 eval gl_cv_type_${gltype}_suffix=\$glsuf
8690e634 11920fi
c0c3707f
CB
11921rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11922 eval result=\$gl_cv_type_${gltype}_suffix
11923 test "$result" != no && break
11924 done
11925fi
11926eval ac_res=\$gl_cv_type_${gltype}_suffix
11927 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
11928$as_echo "$ac_res" >&6; }
11929 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
11930 eval result=\$gl_cv_type_${gltype}_suffix
11931 test "$result" = no && result=
11932 eval ${GLTYPE}_SUFFIX=\$result
11933 cat >>confdefs.h <<_ACEOF
11934#define ${GLTYPE}_SUFFIX $result
11935_ACEOF
8690e634 11936
c0c3707f 11937 done
8690e634
JK
11938
11939
c0c3707f 11940 fi
8690e634
JK
11941
11942
c0c3707f
CB
11943 for gltype in sig_atomic_t wchar_t wint_t ; do
11944 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
11945$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
11946if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
8690e634
JK
11947 $as_echo_n "(cached) " >&6
11948else
c0c3707f
CB
11949 eval gl_cv_type_${gltype}_suffix=no
11950 eval result=\$gl_cv_type_${gltype}_signed
11951 if test "$result" = yes; then
11952 glsufu=
11953 else
11954 glsufu=u
11955 fi
11956 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
11957 case $glsuf in
11958 '') gltype1='int';;
11959 l) gltype1='long int';;
11960 ll) gltype1='long long int';;
11961 i64) gltype1='__int64';;
11962 u) gltype1='unsigned int';;
11963 ul) gltype1='unsigned long int';;
11964 ull) gltype1='unsigned long long int';;
11965 ui64)gltype1='unsigned __int64';;
11966 esac
11967 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
11968/* end confdefs.h. */
11969
c0c3707f
CB
11970 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11971 included before <wchar.h>. */
11972 #include <stddef.h>
11973 #include <signal.h>
11974 #if HAVE_WCHAR_H
11975 # include <stdio.h>
11976 # include <time.h>
11977 # include <wchar.h>
11978 #endif
11979
11980 extern $gltype foo;
11981 extern $gltype1 foo;
11982int
11983main ()
11984{
11985
11986 ;
5e8754f9 11987 return 0;
8690e634 11988}
c0c3707f
CB
11989_ACEOF
11990if ac_fn_c_try_compile "$LINENO"; then :
11991 eval gl_cv_type_${gltype}_suffix=\$glsuf
11992fi
11993rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11994 eval result=\$gl_cv_type_${gltype}_suffix
11995 test "$result" != no && break
11996 done
11997fi
11998eval ac_res=\$gl_cv_type_${gltype}_suffix
11999 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12000$as_echo "$ac_res" >&6; }
12001 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12002 eval result=\$gl_cv_type_${gltype}_suffix
12003 test "$result" = no && result=
12004 eval ${GLTYPE}_SUFFIX=\$result
12005 cat >>confdefs.h <<_ACEOF
12006#define ${GLTYPE}_SUFFIX $result
12007_ACEOF
12008
12009 done
12010
12011
12012
12013 if test $GNULIB_OVERRIDES_WINT_T = 1; then
12014 BITSIZEOF_WINT_T=32
12015 fi
12016
12017 ;;
12018 esac
8690e634 12019
8690e634 12020
c0c3707f
CB
12021
12022 LIMITS_H='limits.h'
12023 if test -n "$LIMITS_H"; then
12024 GL_GENERATE_LIMITS_H_TRUE=
12025 GL_GENERATE_LIMITS_H_FALSE='#'
12026else
12027 GL_GENERATE_LIMITS_H_TRUE='#'
12028 GL_GENERATE_LIMITS_H_FALSE=
8690e634 12029fi
6ec2e0f5
SDJ
12030
12031
12032
12033
12034
12035
12036
c0c3707f
CB
12037 if test -n "$STDINT_H"; then
12038 GL_GENERATE_STDINT_H_TRUE=
12039 GL_GENERATE_STDINT_H_FALSE='#'
12040else
12041 GL_GENERATE_STDINT_H_TRUE='#'
12042 GL_GENERATE_STDINT_H_FALSE=
12043fi
472fa5ee
SM
12044
12045
12046
12047
12048
c0c3707f
CB
12049 GNULIB_IMAXABS=0;
12050 GNULIB_IMAXDIV=0;
12051 GNULIB_STRTOIMAX=0;
12052 GNULIB_STRTOUMAX=0;
12053 HAVE_DECL_IMAXABS=1;
12054 HAVE_DECL_IMAXDIV=1;
12055 HAVE_DECL_STRTOIMAX=1;
12056 HAVE_DECL_STRTOUMAX=1;
12057 HAVE_IMAXDIV_T=1;
12058 REPLACE_STRTOIMAX=0;
12059 REPLACE_STRTOUMAX=0;
12060 INT32_MAX_LT_INTMAX_MAX=1;
12061 INT64_MAX_EQ_LONG_MAX='defined _LP64';
12062 PRI_MACROS_BROKEN=0;
12063 PRIPTR_PREFIX=__PRIPTR_PREFIX;
12064 UINT32_MAX_LT_UINTMAX_MAX=1;
12065 UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
472fa5ee 12066
6ec2e0f5
SDJ
12067
12068
12069
12070
12071
6ec2e0f5
SDJ
12072
12073
6ec2e0f5 12074
6ec2e0f5 12075
6ec2e0f5 12076
6ec2e0f5 12077
6ec2e0f5 12078
c0c3707f
CB
12079
12080
12081 if test $gl_cv_have_include_next = yes; then
12082 gl_cv_next_inttypes_h='<'inttypes.h'>'
12083 else
12084 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
12085$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
12086if ${gl_cv_next_inttypes_h+:} false; then :
12087 $as_echo_n "(cached) " >&6
12088else
12089
12090 if test $ac_cv_header_inttypes_h = yes; then
12091
12092
12093
12094
12095 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12096/* end confdefs.h. */
12097#include <inttypes.h>
6ec2e0f5 12098_ACEOF
c0c3707f
CB
12099 case "$host_os" in
12100 aix*) gl_absname_cpp="$ac_cpp -C" ;;
12101 *) gl_absname_cpp="$ac_cpp" ;;
12102 esac
6ec2e0f5 12103
c0c3707f
CB
12104 case "$host_os" in
12105 mingw*)
12106 gl_dirsep_regex='[/\\]'
12107 ;;
12108 *)
12109 gl_dirsep_regex='\/'
12110 ;;
12111 esac
12112 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
12113 gl_header_literal_regex=`echo 'inttypes.h' \
12114 | sed -e "$gl_make_literal_regex_sed"`
12115 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
12116 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12117 s|^/[^/]|//&|
12118 p
12119 q
12120 }'
6ec2e0f5 12121
c0c3707f
CB
12122 gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12123 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 12124
c0c3707f
CB
12125 gl_header=$gl_cv_absolute_inttypes_h
12126 gl_cv_next_inttypes_h='"'$gl_header'"'
12127 else
12128 gl_cv_next_inttypes_h='<'inttypes.h'>'
12129 fi
6ec2e0f5 12130
6ec2e0f5 12131
c0c3707f
CB
12132fi
12133{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
12134$as_echo "$gl_cv_next_inttypes_h" >&6; }
12135 fi
12136 NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
6ec2e0f5 12137
c0c3707f
CB
12138 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12139 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12140 gl_next_as_first_directive='<'inttypes.h'>'
12141 else
12142 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12143 gl_next_as_first_directive=$gl_cv_next_inttypes_h
12144 fi
12145 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
6ec2e0f5 12146
472fa5ee
SM
12147
12148
12149
12150
12151
12152
472fa5ee
SM
12153
12154
12155
12156
6ec2e0f5 12157
c0c3707f
CB
12158 for ac_header in inttypes.h
12159do :
12160 ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
12161if test "x$ac_cv_header_inttypes_h" = xyes; then :
12162 cat >>confdefs.h <<_ACEOF
12163#define HAVE_INTTYPES_H 1
12164_ACEOF
6ec2e0f5 12165
c0c3707f 12166fi
6ec2e0f5 12167
c0c3707f 12168done
6ec2e0f5 12169
c0c3707f
CB
12170 if test $ac_cv_header_inttypes_h = yes; then
12171 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5
12172$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; }
12173if ${gt_cv_inttypes_pri_broken+:} false; then :
6ec2e0f5
SDJ
12174 $as_echo_n "(cached) " >&6
12175else
c0c3707f
CB
12176
12177 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
12178/* end confdefs.h. */
12179
c0c3707f
CB
12180#include <inttypes.h>
12181#ifdef PRId32
12182char *p = PRId32;
6ec2e0f5
SDJ
12183#endif
12184
12185int
12186main ()
12187{
12188
6ec2e0f5
SDJ
12189 ;
12190 return 0;
12191}
12192_ACEOF
c0c3707f
CB
12193if ac_fn_c_try_compile "$LINENO"; then :
12194 gt_cv_inttypes_pri_broken=no
6ec2e0f5 12195else
c0c3707f 12196 gt_cv_inttypes_pri_broken=yes
6ec2e0f5 12197fi
c0c3707f 12198rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5
SDJ
12199
12200fi
c0c3707f
CB
12201{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5
12202$as_echo "$gt_cv_inttypes_pri_broken" >&6; }
6ec2e0f5 12203 fi
c0c3707f 12204 if test "$gt_cv_inttypes_pri_broken" = yes; then
6ec2e0f5
SDJ
12205
12206cat >>confdefs.h <<_ACEOF
c0c3707f 12207#define PRI_MACROS_BROKEN 1
6ec2e0f5
SDJ
12208_ACEOF
12209
c0c3707f 12210 PRI_MACROS_BROKEN=1
6ec2e0f5 12211 else
c0c3707f 12212 PRI_MACROS_BROKEN=0
6ec2e0f5
SDJ
12213 fi
12214
472fa5ee
SM
12215
12216
c0c3707f
CB
12217 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
12218$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
12219if ${gl_cv_cc_double_expbit0+:} false; then :
6ec2e0f5
SDJ
12220 $as_echo_n "(cached) " >&6
12221else
c0c3707f
CB
12222
12223 if test "$cross_compiling" = yes; then :
12224
12225 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
12226/* end confdefs.h. */
12227
c0c3707f
CB
12228#if defined arm || defined __arm || defined __arm__
12229 mixed_endianness
6ec2e0f5
SDJ
12230#endif
12231
12232_ACEOF
12233if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
c0c3707f
CB
12234 $EGREP "mixed_endianness" >/dev/null 2>&1; then :
12235 gl_cv_cc_double_expbit0="unknown"
6ec2e0f5 12236else
6ec2e0f5 12237
c0c3707f
CB
12238 :
12239if ${ac_cv_c_bigendian+:} false; then :
12240 $as_echo_n "(cached) " >&6
6ec2e0f5 12241else
c0c3707f
CB
12242 ac_cv_c_bigendian=unknown
12243 # See if we're dealing with a universal compiler.
12244 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 12245/* end confdefs.h. */
c0c3707f
CB
12246#ifndef __APPLE_CC__
12247 not a universal capable compiler
12248 #endif
12249 typedef int dummy;
6ec2e0f5 12250
c0c3707f
CB
12251_ACEOF
12252if ac_fn_c_try_compile "$LINENO"; then :
12253
12254 # Check for potential -arch flags. It is not universal unless
12255 # there are at least two -arch flags with different values.
12256 ac_arch=
12257 ac_prev=
12258 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
12259 if test -n "$ac_prev"; then
12260 case $ac_word in
12261 i?86 | x86_64 | ppc | ppc64)
12262 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
12263 ac_arch=$ac_word
12264 else
12265 ac_cv_c_bigendian=universal
12266 break
12267 fi
12268 ;;
12269 esac
12270 ac_prev=
12271 elif test "x$ac_word" = "x-arch"; then
12272 ac_prev=arch
12273 fi
12274 done
12275fi
12276rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12277 if test $ac_cv_c_bigendian = unknown; then
12278 # See if sys/param.h defines the BYTE_ORDER macro.
12279 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12280/* end confdefs.h. */
12281#include <sys/types.h>
12282 #include <sys/param.h>
6ec2e0f5
SDJ
12283
12284int
12285main ()
12286{
c0c3707f
CB
12287#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
12288 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
12289 && LITTLE_ENDIAN)
12290 bogus endian macros
12291 #endif
6ec2e0f5 12292
c0c3707f
CB
12293 ;
12294 return 0;
12295}
12296_ACEOF
12297if ac_fn_c_try_compile "$LINENO"; then :
12298 # It does; now see whether it defined to BIG_ENDIAN or not.
12299 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12300/* end confdefs.h. */
12301#include <sys/types.h>
12302 #include <sys/param.h>
12303
12304int
12305main ()
12306{
12307#if BYTE_ORDER != BIG_ENDIAN
12308 not big endian
12309 #endif
6ec2e0f5
SDJ
12310
12311 ;
12312 return 0;
12313}
12314_ACEOF
c0c3707f
CB
12315if ac_fn_c_try_compile "$LINENO"; then :
12316 ac_cv_c_bigendian=yes
6ec2e0f5 12317else
c0c3707f 12318 ac_cv_c_bigendian=no
6ec2e0f5 12319fi
c0c3707f 12320rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 12321fi
c0c3707f
CB
12322rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12323 fi
12324 if test $ac_cv_c_bigendian = unknown; then
12325 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
12326 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12327/* end confdefs.h. */
12328#include <limits.h>
472fa5ee 12329
c0c3707f
CB
12330int
12331main ()
12332{
12333#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
12334 bogus endian macros
12335 #endif
6ec2e0f5 12336
c0c3707f
CB
12337 ;
12338 return 0;
12339}
6ec2e0f5 12340_ACEOF
c0c3707f
CB
12341if ac_fn_c_try_compile "$LINENO"; then :
12342 # It does; now see whether it defined to _BIG_ENDIAN or not.
12343 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 12344/* end confdefs.h. */
c0c3707f
CB
12345#include <limits.h>
12346
6ec2e0f5
SDJ
12347int
12348main ()
12349{
c0c3707f
CB
12350#ifndef _BIG_ENDIAN
12351 not big endian
12352 #endif
12353
6ec2e0f5
SDJ
12354 ;
12355 return 0;
12356}
12357_ACEOF
12358if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 12359 ac_cv_c_bigendian=yes
6ec2e0f5 12360else
c0c3707f 12361 ac_cv_c_bigendian=no
6ec2e0f5
SDJ
12362fi
12363rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 12364fi
c0c3707f
CB
12365rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12366 fi
12367 if test $ac_cv_c_bigendian = unknown; then
12368 # Compile a test program.
12369 if test "$cross_compiling" = yes; then :
12370 # Try to guess by grepping values from an object file.
12371 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12372/* end confdefs.h. */
12373short int ascii_mm[] =
12374 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
12375 short int ascii_ii[] =
12376 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
12377 int use_ascii (int i) {
12378 return ascii_mm[i] + ascii_ii[i];
12379 }
12380 short int ebcdic_ii[] =
12381 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
12382 short int ebcdic_mm[] =
12383 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
12384 int use_ebcdic (int i) {
12385 return ebcdic_mm[i] + ebcdic_ii[i];
12386 }
12387 extern int foo;
6ec2e0f5 12388
c0c3707f
CB
12389int
12390main ()
12391{
12392return use_ascii (foo) == use_ebcdic (foo);
12393 ;
12394 return 0;
12395}
6ec2e0f5 12396_ACEOF
c0c3707f
CB
12397if ac_fn_c_try_compile "$LINENO"; then :
12398 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
12399 ac_cv_c_bigendian=yes
12400 fi
12401 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
12402 if test "$ac_cv_c_bigendian" = unknown; then
12403 ac_cv_c_bigendian=no
12404 else
12405 # finding both strings is unlikely to happen, but who knows?
12406 ac_cv_c_bigendian=unknown
12407 fi
12408 fi
12409fi
12410rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12411else
12412 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12413/* end confdefs.h. */
12414$ac_includes_default
12415int
12416main ()
12417{
6ec2e0f5 12418
c0c3707f
CB
12419 /* Are we little or big endian? From Harbison&Steele. */
12420 union
12421 {
12422 long int l;
12423 char c[sizeof (long int)];
12424 } u;
12425 u.l = 1;
12426 return u.c[sizeof (long int) - 1] == 1;
6ec2e0f5 12427
c0c3707f
CB
12428 ;
12429 return 0;
12430}
12431_ACEOF
12432if ac_fn_c_try_run "$LINENO"; then :
12433 ac_cv_c_bigendian=no
12434else
12435 ac_cv_c_bigendian=yes
12436fi
12437rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12438 conftest.$ac_objext conftest.beam conftest.$ac_ext
12439fi
6ec2e0f5 12440
c0c3707f
CB
12441 fi
12442fi
12443:
12444 case $ac_cv_c_bigendian in #(
12445 yes)
12446 gl_cv_cc_double_expbit0="word 0 bit 20";; #(
12447 no)
12448 gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
12449 universal)
6ec2e0f5 12450
c0c3707f 12451$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
6ec2e0f5 12452
c0c3707f
CB
12453 ;; #(
12454 *)
12455 gl_cv_cc_double_expbit0="unknown" ;;
12456 esac
472fa5ee
SM
12457
12458
c0c3707f
CB
12459fi
12460rm -f conftest*
5e8754f9
SDJ
12461
12462
c0c3707f
CB
12463else
12464 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12465/* end confdefs.h. */
5e8754f9 12466
c0c3707f
CB
12467#include <float.h>
12468#include <stddef.h>
12469#include <stdio.h>
12470#include <string.h>
12471#define NWORDS \
12472 ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
12473typedef union { double value; unsigned int word[NWORDS]; } memory_double;
12474static unsigned int ored_words[NWORDS];
12475static unsigned int anded_words[NWORDS];
12476static void add_to_ored_words (double x)
12477{
12478 memory_double m;
12479 size_t i;
12480 /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
12481 memset (&m, 0, sizeof (memory_double));
12482 m.value = x;
12483 for (i = 0; i < NWORDS; i++)
12484 {
12485 ored_words[i] |= m.word[i];
12486 anded_words[i] &= m.word[i];
12487 }
12488}
12489int main ()
12490{
12491 size_t j;
12492 FILE *fp = fopen ("conftest.out", "w");
12493 if (fp == NULL)
12494 return 1;
12495 for (j = 0; j < NWORDS; j++)
12496 anded_words[j] = ~ (unsigned int) 0;
12497 add_to_ored_words (0.25);
12498 add_to_ored_words (0.5);
12499 add_to_ored_words (1.0);
12500 add_to_ored_words (2.0);
12501 add_to_ored_words (4.0);
12502 /* Remove bits that are common (e.g. if representation of the first mantissa
12503 bit is explicit). */
12504 for (j = 0; j < NWORDS; j++)
12505 ored_words[j] &= ~anded_words[j];
12506 /* Now find the nonzero word. */
12507 for (j = 0; j < NWORDS; j++)
12508 if (ored_words[j] != 0)
12509 break;
12510 if (j < NWORDS)
12511 {
12512 size_t i;
12513 for (i = j + 1; i < NWORDS; i++)
12514 if (ored_words[i] != 0)
12515 {
12516 fprintf (fp, "unknown");
12517 return (fclose (fp) != 0);
12518 }
12519 for (i = 0; ; i++)
12520 if ((ored_words[j] >> i) & 1)
12521 {
12522 fprintf (fp, "word %d bit %d", (int) j, (int) i);
12523 return (fclose (fp) != 0);
12524 }
12525 }
12526 fprintf (fp, "unknown");
12527 return (fclose (fp) != 0);
12528}
5e8754f9 12529
c0c3707f
CB
12530_ACEOF
12531if ac_fn_c_try_run "$LINENO"; then :
12532 gl_cv_cc_double_expbit0=`cat conftest.out`
12533else
12534 gl_cv_cc_double_expbit0="unknown"
12535fi
12536rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12537 conftest.$ac_objext conftest.beam conftest.$ac_ext
12538fi
5e8754f9 12539
c0c3707f 12540 rm -f conftest.out
5e8754f9 12541
c0c3707f
CB
12542fi
12543{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
12544$as_echo "$gl_cv_cc_double_expbit0" >&6; }
12545 case "$gl_cv_cc_double_expbit0" in
12546 word*bit*)
12547 word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
12548 bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
5e8754f9 12549
c0c3707f
CB
12550cat >>confdefs.h <<_ACEOF
12551#define DBL_EXPBIT0_WORD $word
12552_ACEOF
5e8754f9
SDJ
12553
12554
c0c3707f
CB
12555cat >>confdefs.h <<_ACEOF
12556#define DBL_EXPBIT0_BIT $bit
12557_ACEOF
5e8754f9 12558
c0c3707f
CB
12559 ;;
12560 esac
5e8754f9
SDJ
12561
12562
c0c3707f
CB
12563 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
12564$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
12565if ${ac_cv_c_bigendian+:} false; then :
12566 $as_echo_n "(cached) " >&6
12567else
12568 ac_cv_c_bigendian=unknown
12569 # See if we're dealing with a universal compiler.
12570 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12571/* end confdefs.h. */
12572#ifndef __APPLE_CC__
12573 not a universal capable compiler
12574 #endif
12575 typedef int dummy;
5e8754f9 12576
c0c3707f
CB
12577_ACEOF
12578if ac_fn_c_try_compile "$LINENO"; then :
5e8754f9 12579
c0c3707f
CB
12580 # Check for potential -arch flags. It is not universal unless
12581 # there are at least two -arch flags with different values.
12582 ac_arch=
12583 ac_prev=
12584 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
12585 if test -n "$ac_prev"; then
12586 case $ac_word in
12587 i?86 | x86_64 | ppc | ppc64)
12588 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
12589 ac_arch=$ac_word
12590 else
12591 ac_cv_c_bigendian=universal
12592 break
12593 fi
12594 ;;
12595 esac
12596 ac_prev=
12597 elif test "x$ac_word" = "x-arch"; then
12598 ac_prev=arch
12599 fi
12600 done
12601fi
12602rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12603 if test $ac_cv_c_bigendian = unknown; then
12604 # See if sys/param.h defines the BYTE_ORDER macro.
12605 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12606/* end confdefs.h. */
12607#include <sys/types.h>
12608 #include <sys/param.h>
5e8754f9 12609
c0c3707f
CB
12610int
12611main ()
12612{
12613#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
12614 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
12615 && LITTLE_ENDIAN)
12616 bogus endian macros
12617 #endif
5e8754f9 12618
c0c3707f
CB
12619 ;
12620 return 0;
12621}
12622_ACEOF
12623if ac_fn_c_try_compile "$LINENO"; then :
12624 # It does; now see whether it defined to BIG_ENDIAN or not.
12625 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12626/* end confdefs.h. */
12627#include <sys/types.h>
12628 #include <sys/param.h>
5e8754f9 12629
c0c3707f
CB
12630int
12631main ()
12632{
12633#if BYTE_ORDER != BIG_ENDIAN
12634 not big endian
12635 #endif
5e8754f9 12636
c0c3707f
CB
12637 ;
12638 return 0;
12639}
12640_ACEOF
12641if ac_fn_c_try_compile "$LINENO"; then :
12642 ac_cv_c_bigendian=yes
12643else
12644 ac_cv_c_bigendian=no
12645fi
12646rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12647fi
12648rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12649 fi
12650 if test $ac_cv_c_bigendian = unknown; then
12651 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
12652 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12653/* end confdefs.h. */
12654#include <limits.h>
5e8754f9 12655
c0c3707f
CB
12656int
12657main ()
12658{
12659#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
12660 bogus endian macros
12661 #endif
5e8754f9 12662
c0c3707f
CB
12663 ;
12664 return 0;
12665}
12666_ACEOF
12667if ac_fn_c_try_compile "$LINENO"; then :
12668 # It does; now see whether it defined to _BIG_ENDIAN or not.
12669 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12670/* end confdefs.h. */
12671#include <limits.h>
5e8754f9 12672
c0c3707f
CB
12673int
12674main ()
12675{
12676#ifndef _BIG_ENDIAN
12677 not big endian
12678 #endif
5e8754f9 12679
c0c3707f
CB
12680 ;
12681 return 0;
12682}
12683_ACEOF
12684if ac_fn_c_try_compile "$LINENO"; then :
12685 ac_cv_c_bigendian=yes
12686else
12687 ac_cv_c_bigendian=no
12688fi
12689rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12690fi
12691rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12692 fi
12693 if test $ac_cv_c_bigendian = unknown; then
12694 # Compile a test program.
12695 if test "$cross_compiling" = yes; then :
12696 # Try to guess by grepping values from an object file.
12697 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12698/* end confdefs.h. */
12699short int ascii_mm[] =
12700 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
12701 short int ascii_ii[] =
12702 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
12703 int use_ascii (int i) {
12704 return ascii_mm[i] + ascii_ii[i];
12705 }
12706 short int ebcdic_ii[] =
12707 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
12708 short int ebcdic_mm[] =
12709 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
12710 int use_ebcdic (int i) {
12711 return ebcdic_mm[i] + ebcdic_ii[i];
12712 }
12713 extern int foo;
5e8754f9 12714
c0c3707f
CB
12715int
12716main ()
12717{
12718return use_ascii (foo) == use_ebcdic (foo);
12719 ;
12720 return 0;
12721}
12722_ACEOF
12723if ac_fn_c_try_compile "$LINENO"; then :
12724 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
12725 ac_cv_c_bigendian=yes
12726 fi
12727 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
12728 if test "$ac_cv_c_bigendian" = unknown; then
12729 ac_cv_c_bigendian=no
12730 else
12731 # finding both strings is unlikely to happen, but who knows?
12732 ac_cv_c_bigendian=unknown
12733 fi
12734 fi
12735fi
12736rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12737else
12738 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12739/* end confdefs.h. */
12740$ac_includes_default
12741int
12742main ()
12743{
5e8754f9 12744
c0c3707f
CB
12745 /* Are we little or big endian? From Harbison&Steele. */
12746 union
12747 {
12748 long int l;
12749 char c[sizeof (long int)];
12750 } u;
12751 u.l = 1;
12752 return u.c[sizeof (long int) - 1] == 1;
5e8754f9 12753
c0c3707f
CB
12754 ;
12755 return 0;
12756}
12757_ACEOF
12758if ac_fn_c_try_run "$LINENO"; then :
12759 ac_cv_c_bigendian=no
6ec2e0f5 12760else
c0c3707f
CB
12761 ac_cv_c_bigendian=yes
12762fi
12763rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12764 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5
SDJ
12765fi
12766
c0c3707f
CB
12767 fi
12768fi
12769{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
12770$as_echo "$ac_cv_c_bigendian" >&6; }
12771 case $ac_cv_c_bigendian in #(
12772 yes)
12773 $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
12774;; #(
12775 no)
12776 ;; #(
12777 universal)
472fa5ee 12778
c0c3707f 12779$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
472fa5ee 12780
c0c3707f
CB
12781 ;; #(
12782 *)
12783 as_fn_error $? "unknown endianness
12784 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
12785 esac
472fa5ee 12786
472fa5ee
SM
12787
12788
c0c3707f
CB
12789 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
12790$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
12791if ${am_cv_langinfo_codeset+:} false; then :
12792 $as_echo_n "(cached) " >&6
12793else
12794 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12795/* end confdefs.h. */
12796#include <langinfo.h>
12797int
12798main ()
12799{
12800char* cs = nl_langinfo(CODESET); return !cs;
12801 ;
12802 return 0;
12803}
12804_ACEOF
12805if ac_fn_c_try_link "$LINENO"; then :
12806 am_cv_langinfo_codeset=yes
12807else
12808 am_cv_langinfo_codeset=no
12809fi
12810rm -f core conftest.err conftest.$ac_objext \
12811 conftest$ac_exeext conftest.$ac_ext
472fa5ee 12812
c0c3707f
CB
12813fi
12814{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
12815$as_echo "$am_cv_langinfo_codeset" >&6; }
12816 if test $am_cv_langinfo_codeset = yes; then
472fa5ee 12817
c0c3707f 12818$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
472fa5ee 12819
6ec2e0f5
SDJ
12820 fi
12821
472fa5ee
SM
12822
12823
12824
12825
c0c3707f
CB
12826 gl_threads_api=none
12827 LIBTHREAD=
12828 LTLIBTHREAD=
12829 LIBMULTITHREAD=
12830 LTLIBMULTITHREAD=
12831 if test "$gl_use_threads" != no; then
472fa5ee 12832
c0c3707f
CB
12833 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
12834$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
12835if ${gl_cv_have_weak+:} false; then :
12836 $as_echo_n "(cached) " >&6
12837else
12838 gl_cv_have_weak=no
12839 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12840/* end confdefs.h. */
12841extern void xyzzy ();
12842#pragma weak xyzzy
12843int
12844main ()
12845{
12846xyzzy();
12847 ;
12848 return 0;
12849}
12850_ACEOF
12851if ac_fn_c_try_link "$LINENO"; then :
12852 gl_cv_have_weak=maybe
12853fi
12854rm -f core conftest.err conftest.$ac_objext \
12855 conftest$ac_exeext conftest.$ac_ext
12856 if test $gl_cv_have_weak = maybe; then
12857 if test "$cross_compiling" = yes; then :
12858 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12859/* end confdefs.h. */
12860#ifdef __ELF__
12861 Extensible Linking Format
12862 #endif
6ec2e0f5 12863
c0c3707f
CB
12864_ACEOF
12865if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12866 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
12867 gl_cv_have_weak="guessing yes"
12868else
12869 gl_cv_have_weak="guessing no"
12870fi
12871rm -f conftest*
6ec2e0f5
SDJ
12872
12873
c0c3707f
CB
12874else
12875 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12876/* end confdefs.h. */
6ec2e0f5 12877
c0c3707f
CB
12878#include <stdio.h>
12879#pragma weak fputs
12880int main ()
12881{
12882 return (fputs == NULL);
12883}
6ec2e0f5 12884_ACEOF
c0c3707f
CB
12885if ac_fn_c_try_run "$LINENO"; then :
12886 gl_cv_have_weak=yes
12887else
12888 gl_cv_have_weak=no
12889fi
12890rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12891 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5
SDJ
12892fi
12893
c0c3707f
CB
12894 fi
12895 case " $LDFLAGS " in
12896 *" -static "*) gl_cv_have_weak=no ;;
12897 esac
6ec2e0f5
SDJ
12898
12899fi
c0c3707f
CB
12900{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
12901$as_echo "$gl_cv_have_weak" >&6; }
12902 case "$gl_cv_have_weak" in
12903 *yes)
6ec2e0f5 12904
c0c3707f 12905$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
6ec2e0f5 12906
c0c3707f
CB
12907 ;;
12908 esac
6ec2e0f5 12909
c0c3707f 12910 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
6ec2e0f5 12911
c0c3707f
CB
12912 :
12913 fi
12914 if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
6ec2e0f5 12915
c0c3707f
CB
12916 if test $ac_cv_header_threads_h = yes; then
12917 gl_have_isoc_threads=
12918 # Test whether both mtx_lock and cnd_timedwait exist in libc.
12919 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12920/* end confdefs.h. */
12921#include <threads.h>
12922 #include <stddef.h>
12923 mtx_t m;
12924 cnd_t c;
6ec2e0f5 12925
c0c3707f
CB
12926int
12927main ()
12928{
12929mtx_lock (&m);
12930 cnd_timedwait (&c, &m, NULL);
12931 ;
12932 return 0;
12933}
12934_ACEOF
12935if ac_fn_c_try_link "$LINENO"; then :
12936 gl_have_isoc_threads=yes
12937fi
12938rm -f core conftest.err conftest.$ac_objext \
12939 conftest$ac_exeext conftest.$ac_ext
12940 fi
12941 fi
12942 if test "$gl_use_threads" = yes \
12943 || test "$gl_use_threads" = posix \
12944 || test "$gl_use_threads" = isoc+posix; then
12945
12946
12947 if test -z "$gl_threadlib_body_done"; then
12948 gl_pthread_api=no
12949 LIBPTHREAD=
12950 LIBPMULTITHREAD=
12951 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
12952 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
12953 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
12954if test "x$ac_cv_header_pthread_h" = xyes; then :
12955 gl_have_pthread_h=yes
12956else
12957 gl_have_pthread_h=no
12958fi
6ec2e0f5 12959
6ec2e0f5 12960
c0c3707f
CB
12961 if test "$gl_have_pthread_h" = yes; then
12962 # Other possible tests:
12963 # -lpthreads (FSU threads, PCthreads)
12964 # -lgthreads
12965 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
12966 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
12967 # the second one only in libpthread, and lock.c needs it.
12968 #
12969 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
12970 # needs -pthread for some reason. See:
12971 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
12972 save_LIBS=$LIBS
12973 for gl_pthread in '' '-pthread'; do
12974 LIBS="$LIBS $gl_pthread"
12975 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12976/* end confdefs.h. */
12977#include <pthread.h>
12978 pthread_mutex_t m;
12979 pthread_mutexattr_t ma;
6ec2e0f5 12980
c0c3707f
CB
12981int
12982main ()
12983{
12984pthread_mutex_lock (&m);
12985 pthread_mutexattr_init (&ma);
12986 ;
12987 return 0;
12988}
6ec2e0f5 12989_ACEOF
c0c3707f
CB
12990if ac_fn_c_try_link "$LINENO"; then :
12991 gl_pthread_api=yes
12992 LIBPTHREAD=$gl_pthread
12993 LIBPMULTITHREAD=$gl_pthread
6ec2e0f5 12994fi
c0c3707f
CB
12995rm -f core conftest.err conftest.$ac_objext \
12996 conftest$ac_exeext conftest.$ac_ext
12997 LIBS=$save_LIBS
12998 test $gl_pthread_api = yes && break
12999 done
6ec2e0f5 13000
c0c3707f
CB
13001 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
13002 # since it is defined as a macro on OSF/1.)
13003 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
13004 # The program links fine without libpthread. But it may actually
13005 # need to link with libpthread in order to create multiple threads.
13006 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
13007$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
13008if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
6ec2e0f5
SDJ
13009 $as_echo_n "(cached) " >&6
13010else
c0c3707f
CB
13011 ac_check_lib_save_LIBS=$LIBS
13012LIBS="-lpthread $LIBS"
13013cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13014/* end confdefs.h. */
6ec2e0f5 13015
c0c3707f
CB
13016/* Override any GCC internal prototype to avoid an error.
13017 Use char because int might match the return type of a GCC
13018 builtin and then its argument prototype would still apply. */
13019#ifdef __cplusplus
13020extern "C"
13021#endif
13022char pthread_kill ();
13023int
13024main ()
13025{
13026return pthread_kill ();
13027 ;
13028 return 0;
13029}
6ec2e0f5 13030_ACEOF
c0c3707f
CB
13031if ac_fn_c_try_link "$LINENO"; then :
13032 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 13033else
c0c3707f 13034 ac_cv_lib_pthread_pthread_kill=no
6ec2e0f5 13035fi
c0c3707f
CB
13036rm -f core conftest.err conftest.$ac_objext \
13037 conftest$ac_exeext conftest.$ac_ext
13038LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 13039fi
c0c3707f
CB
13040{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
13041$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
13042if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
13043 LIBPMULTITHREAD=-lpthread
13044 # On Solaris and HP-UX, most pthread functions exist also in libc.
13045 # Therefore pthread_in_use() needs to actually try to create a
13046 # thread: pthread_create from libc will fail, whereas
13047 # pthread_create will actually create a thread.
13048 # On Solaris 10 or newer, this test is no longer needed, because
13049 # libc contains the fully functional pthread functions.
13050 case "$host_os" in
13051 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
6ec2e0f5 13052
c0c3707f 13053$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
6ec2e0f5 13054
c0c3707f 13055 esac
6ec2e0f5
SDJ
13056
13057fi
13058
c0c3707f
CB
13059 elif test $gl_pthread_api != yes; then
13060 # Some library is needed. Try libpthread and libc_r.
13061 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
13062$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
13063if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
6ec2e0f5
SDJ
13064 $as_echo_n "(cached) " >&6
13065else
c0c3707f
CB
13066 ac_check_lib_save_LIBS=$LIBS
13067LIBS="-lpthread $LIBS"
13068cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
13069/* end confdefs.h. */
13070
c0c3707f
CB
13071/* Override any GCC internal prototype to avoid an error.
13072 Use char because int might match the return type of a GCC
13073 builtin and then its argument prototype would still apply. */
13074#ifdef __cplusplus
13075extern "C"
13076#endif
13077char pthread_kill ();
6ec2e0f5
SDJ
13078int
13079main ()
13080{
c0c3707f
CB
13081return pthread_kill ();
13082 ;
13083 return 0;
13084}
13085_ACEOF
13086if ac_fn_c_try_link "$LINENO"; then :
13087 ac_cv_lib_pthread_pthread_kill=yes
13088else
13089 ac_cv_lib_pthread_pthread_kill=no
13090fi
13091rm -f core conftest.err conftest.$ac_objext \
13092 conftest$ac_exeext conftest.$ac_ext
13093LIBS=$ac_check_lib_save_LIBS
13094fi
13095{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
13096$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
13097if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
13098 gl_pthread_api=yes
13099 LIBPTHREAD=-lpthread
13100 LIBPMULTITHREAD=-lpthread
13101fi
6ec2e0f5 13102
c0c3707f
CB
13103 if test $gl_pthread_api != yes; then
13104 # For FreeBSD 4.
13105 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
13106$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
13107if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
13108 $as_echo_n "(cached) " >&6
13109else
13110 ac_check_lib_save_LIBS=$LIBS
13111LIBS="-lc_r $LIBS"
13112cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13113/* end confdefs.h. */
6ec2e0f5 13114
c0c3707f
CB
13115/* Override any GCC internal prototype to avoid an error.
13116 Use char because int might match the return type of a GCC
13117 builtin and then its argument prototype would still apply. */
13118#ifdef __cplusplus
13119extern "C"
13120#endif
13121char pthread_kill ();
13122int
13123main ()
13124{
13125return pthread_kill ();
6ec2e0f5
SDJ
13126 ;
13127 return 0;
13128}
13129_ACEOF
c0c3707f
CB
13130if ac_fn_c_try_link "$LINENO"; then :
13131 ac_cv_lib_c_r_pthread_kill=yes
6ec2e0f5 13132else
c0c3707f 13133 ac_cv_lib_c_r_pthread_kill=no
6ec2e0f5 13134fi
c0c3707f
CB
13135rm -f core conftest.err conftest.$ac_objext \
13136 conftest$ac_exeext conftest.$ac_ext
13137LIBS=$ac_check_lib_save_LIBS
13138fi
13139{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
13140$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
13141if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
13142 gl_pthread_api=yes
13143 LIBPTHREAD=-lc_r
13144 LIBPMULTITHREAD=-lc_r
6ec2e0f5 13145fi
6ec2e0f5 13146
c0c3707f
CB
13147 fi
13148 fi
13149 fi
13150 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
13151$as_echo_n "checking whether POSIX threads API is available... " >&6; }
13152 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
13153$as_echo "$gl_pthread_api" >&6; }
6ec2e0f5
SDJ
13154
13155
c0c3707f 13156 if test $gl_pthread_api = yes; then
6ec2e0f5 13157
c0c3707f 13158$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
6ec2e0f5 13159
c0c3707f
CB
13160 fi
13161 gl_threadlib_body_done=done
13162 fi
6ec2e0f5 13163
c0c3707f
CB
13164 LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
13165 LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
13166 if test $gl_pthread_api = yes; then
13167 if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
13168 gl_threads_api='isoc+posix'
6ec2e0f5 13169
c0c3707f 13170$as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h
6ec2e0f5 13171
c0c3707f
CB
13172 LIBTHREAD= LTLIBTHREAD=
13173 else
13174 gl_threads_api=posix
13175
13176$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
13177
13178 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
13179 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
13180
13181$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
13182
13183 LIBTHREAD= LTLIBTHREAD=
13184 fi
13185 fi
13186 fi
13187 fi
13188 fi
13189 if test $gl_threads_api = none; then
13190 if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
13191 gl_threads_api=isoc
13192
13193$as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h
13194
13195 fi
13196 fi
13197 if test $gl_threads_api = none; then
13198 case "$gl_use_threads" in
13199 yes | windows | win32) # The 'win32' is for backward compatibility.
13200 if { case "$host_os" in
13201 mingw*) true;;
13202 *) false;;
13203 esac
13204 }; then
13205 gl_threads_api=windows
13206
13207$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
13208
13209 fi
13210 ;;
13211 esac
13212 fi
13213 fi
13214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
13215$as_echo_n "checking for multithread API to use... " >&6; }
13216 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
13217$as_echo "$gl_threads_api" >&6; }
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
13231$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
13232if ${gl_cv_func_malloc_posix+:} false; then :
6ec2e0f5
SDJ
13233 $as_echo_n "(cached) " >&6
13234else
c0c3707f
CB
13235
13236 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13237/* end confdefs.h. */
c0c3707f 13238
6ec2e0f5
SDJ
13239int
13240main ()
13241{
c0c3707f
CB
13242#if defined _WIN32 && ! defined __CYGWIN__
13243 choke me
13244 #endif
6ec2e0f5
SDJ
13245
13246 ;
13247 return 0;
13248}
13249_ACEOF
13250if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 13251 gl_cv_func_malloc_posix=yes
6ec2e0f5 13252else
c0c3707f 13253 gl_cv_func_malloc_posix=no
6ec2e0f5
SDJ
13254fi
13255rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
472fa5ee 13256
c0c3707f
CB
13257fi
13258{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
13259$as_echo "$gl_cv_func_malloc_posix" >&6; }
472fa5ee
SM
13260
13261
6ec2e0f5 13262
c0c3707f
CB
13263 for ac_header in stdlib.h
13264do :
13265 ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
13266if test "x$ac_cv_header_stdlib_h" = xyes; then :
13267 cat >>confdefs.h <<_ACEOF
13268#define HAVE_STDLIB_H 1
6ec2e0f5
SDJ
13269_ACEOF
13270
c0c3707f 13271fi
6ec2e0f5 13272
c0c3707f 13273done
472fa5ee 13274
c0c3707f
CB
13275 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
13276$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
13277if ${ac_cv_func_malloc_0_nonnull+:} false; then :
6ec2e0f5
SDJ
13278 $as_echo_n "(cached) " >&6
13279else
13280 if test "$cross_compiling" = yes; then :
13281 case "$host_os" in
c0c3707f
CB
13282 # Guess yes on platforms where we know the result.
13283 *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
13284 | hpux* | solaris* | cygwin* | mingw*)
13285 ac_cv_func_malloc_0_nonnull="guessing yes" ;;
13286 # If we don't know, obey --enable-cross-guesses.
13287 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
13288 esac
6ec2e0f5
SDJ
13289
13290else
13291 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13292/* end confdefs.h. */
c0c3707f
CB
13293#if defined STDC_HEADERS || defined HAVE_STDLIB_H
13294 # include <stdlib.h>
13295 #else
13296 char *malloc ();
13297 #endif
6ec2e0f5
SDJ
13298
13299int
13300main ()
13301{
c0c3707f
CB
13302char *p = malloc (0);
13303 int result = !p;
13304 free (p);
13305 return result;
6ec2e0f5
SDJ
13306 ;
13307 return 0;
13308}
c0c3707f 13309
6ec2e0f5
SDJ
13310_ACEOF
13311if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 13312 ac_cv_func_malloc_0_nonnull=yes
6ec2e0f5 13313else
c0c3707f 13314 ac_cv_func_malloc_0_nonnull=no
6ec2e0f5
SDJ
13315fi
13316rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13317 conftest.$ac_objext conftest.beam conftest.$ac_ext
13318fi
13319
13320
13321fi
c0c3707f
CB
13322{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
13323$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
13324 case "$ac_cv_func_malloc_0_nonnull" in
13325 *yes)
13326 gl_cv_func_malloc_0_nonnull=1
13327 ;;
6ec2e0f5 13328 *)
c0c3707f 13329 gl_cv_func_malloc_0_nonnull=0
6ec2e0f5
SDJ
13330 ;;
13331 esac
13332
13333
c0c3707f
CB
13334cat >>confdefs.h <<_ACEOF
13335#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
13336_ACEOF
13337
13338
13339
13340
13341
13342 GNULIB_BTOWC=0;
13343 GNULIB_WCTOB=0;
13344 GNULIB_MBSINIT=0;
13345 GNULIB_MBRTOWC=0;
13346 GNULIB_MBRLEN=0;
13347 GNULIB_MBSRTOWCS=0;
13348 GNULIB_MBSNRTOWCS=0;
13349 GNULIB_WCRTOMB=0;
13350 GNULIB_WCSRTOMBS=0;
13351 GNULIB_WCSNRTOMBS=0;
13352 GNULIB_WCWIDTH=0;
13353 GNULIB_WMEMCHR=0;
13354 GNULIB_WMEMCMP=0;
13355 GNULIB_WMEMCPY=0;
13356 GNULIB_WMEMMOVE=0;
13357 GNULIB_WMEMSET=0;
13358 GNULIB_WCSLEN=0;
13359 GNULIB_WCSNLEN=0;
13360 GNULIB_WCSCPY=0;
13361 GNULIB_WCPCPY=0;
13362 GNULIB_WCSNCPY=0;
13363 GNULIB_WCPNCPY=0;
13364 GNULIB_WCSCAT=0;
13365 GNULIB_WCSNCAT=0;
13366 GNULIB_WCSCMP=0;
13367 GNULIB_WCSNCMP=0;
13368 GNULIB_WCSCASECMP=0;
13369 GNULIB_WCSNCASECMP=0;
13370 GNULIB_WCSCOLL=0;
13371 GNULIB_WCSXFRM=0;
13372 GNULIB_WCSDUP=0;
13373 GNULIB_WCSCHR=0;
13374 GNULIB_WCSRCHR=0;
13375 GNULIB_WCSCSPN=0;
13376 GNULIB_WCSSPN=0;
13377 GNULIB_WCSPBRK=0;
13378 GNULIB_WCSSTR=0;
13379 GNULIB_WCSTOK=0;
13380 GNULIB_WCSWIDTH=0;
13381 GNULIB_WCSFTIME=0;
13382 HAVE_BTOWC=1;
13383 HAVE_MBSINIT=1;
13384 HAVE_MBRTOWC=1;
13385 HAVE_MBRLEN=1;
13386 HAVE_MBSRTOWCS=1;
13387 HAVE_MBSNRTOWCS=1;
13388 HAVE_WCRTOMB=1;
13389 HAVE_WCSRTOMBS=1;
13390 HAVE_WCSNRTOMBS=1;
13391 HAVE_WMEMCHR=1;
13392 HAVE_WMEMCMP=1;
13393 HAVE_WMEMCPY=1;
13394 HAVE_WMEMMOVE=1;
13395 HAVE_WMEMSET=1;
13396 HAVE_WCSLEN=1;
13397 HAVE_WCSNLEN=1;
13398 HAVE_WCSCPY=1;
13399 HAVE_WCPCPY=1;
13400 HAVE_WCSNCPY=1;
13401 HAVE_WCPNCPY=1;
13402 HAVE_WCSCAT=1;
13403 HAVE_WCSNCAT=1;
13404 HAVE_WCSCMP=1;
13405 HAVE_WCSNCMP=1;
13406 HAVE_WCSCASECMP=1;
13407 HAVE_WCSNCASECMP=1;
13408 HAVE_WCSCOLL=1;
13409 HAVE_WCSXFRM=1;
13410 HAVE_WCSDUP=1;
13411 HAVE_WCSCHR=1;
13412 HAVE_WCSRCHR=1;
13413 HAVE_WCSCSPN=1;
13414 HAVE_WCSSPN=1;
13415 HAVE_WCSPBRK=1;
13416 HAVE_WCSSTR=1;
13417 HAVE_WCSTOK=1;
13418 HAVE_WCSWIDTH=1;
13419 HAVE_WCSFTIME=1;
13420 HAVE_DECL_WCTOB=1;
13421 HAVE_DECL_WCWIDTH=1;
13422 REPLACE_MBSTATE_T=0;
13423 REPLACE_BTOWC=0;
13424 REPLACE_WCTOB=0;
13425 REPLACE_MBSINIT=0;
13426 REPLACE_MBRTOWC=0;
13427 REPLACE_MBRLEN=0;
13428 REPLACE_MBSRTOWCS=0;
13429 REPLACE_MBSNRTOWCS=0;
13430 REPLACE_WCRTOMB=0;
13431 REPLACE_WCSRTOMBS=0;
13432 REPLACE_WCSNRTOMBS=0;
13433 REPLACE_WCWIDTH=0;
13434 REPLACE_WCSWIDTH=0;
13435 REPLACE_WCSFTIME=0;
13436 REPLACE_WCSTOK=0;
13437
13438
6ec2e0f5
SDJ
13439
13440
13441
13442
13443
13444
c0c3707f
CB
13445 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
13446$as_echo_n "checking for a traditional japanese locale... " >&6; }
13447if ${gt_cv_locale_ja+:} false; then :
13448 $as_echo_n "(cached) " >&6
13449else
13450
13451 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13452/* end confdefs.h. */
6ec2e0f5 13453
c0c3707f
CB
13454#include <locale.h>
13455#include <time.h>
13456#if HAVE_LANGINFO_CODESET
13457# include <langinfo.h>
13458#endif
13459#include <stdlib.h>
13460#include <string.h>
13461struct tm t;
13462char buf[16];
13463int main ()
13464{
13465 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
13466 imitates locale dependent behaviour by looking at the environment
13467 variables, and all locales use the UTF-8 encoding. */
13468#if defined __BEOS__ || defined __HAIKU__
13469 return 1;
13470#else
13471 /* Check whether the given locale name is recognized by the system. */
13472# if defined _WIN32 && !defined __CYGWIN__
13473 /* On native Windows, setlocale(category, "") looks at the system settings,
13474 not at the environment variables. Also, when an encoding suffix such
13475 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
13476 category of the locale to "C". */
13477 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
13478 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
13479 return 1;
13480# else
13481 if (setlocale (LC_ALL, "") == NULL) return 1;
13482# endif
13483 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
13484 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
13485 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
13486 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
13487 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
13488 some unit tests fail.
13489 On MirBSD 10, when an unsupported locale is specified, setlocale()
13490 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
13491# if HAVE_LANGINFO_CODESET
13492 {
13493 const char *cs = nl_langinfo (CODESET);
13494 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
13495 || strcmp (cs, "UTF-8") == 0)
13496 return 1;
13497 }
13498# endif
13499# ifdef __CYGWIN__
13500 /* On Cygwin, avoid locale names without encoding suffix, because the
13501 locale_charset() function relies on the encoding suffix. Note that
13502 LC_ALL is set on the command line. */
13503 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
13504# endif
13505 /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
13506 on Cygwin 1.5.x. */
13507 if (MB_CUR_MAX == 1)
13508 return 1;
13509 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
13510 This excludes the UTF-8 encoding (except on MirBSD). */
13511 {
13512 const char *p;
13513 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
13514 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
13515 for (p = buf; *p != '\0'; p++)
13516 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
13517 return 1;
13518 }
13519 return 0;
13520#endif
13521}
6ec2e0f5 13522
c0c3707f
CB
13523_ACEOF
13524 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13525 (eval $ac_link) 2>&5
13526 ac_status=$?
13527 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13528 test $ac_status = 0; } && test -s conftest$ac_exeext; then
13529 case "$host_os" in
13530 # Handle native Windows specially, because there setlocale() interprets
13531 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
13532 # "fr" or "fra" as "French" or "French_France.1252",
13533 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
13534 # "ja" as "Japanese" or "Japanese_Japan.932",
13535 # and similar.
13536 mingw*)
13537 # Note that on native Windows, the Japanese locale is
13538 # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
13539 # cannot use it here.
13540 gt_cv_locale_ja=none
13541 ;;
13542 *)
13543 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
13544 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
13545 # configure script would override the LC_ALL setting. Likewise for
13546 # LC_CTYPE, which is also set at the beginning of the configure script.
13547 # Test for the AIX locale name.
13548 if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13549 gt_cv_locale_ja=ja_JP
13550 else
13551 # Test for the locale name with explicit encoding suffix.
13552 if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13553 gt_cv_locale_ja=ja_JP.EUC-JP
13554 else
13555 # Test for the HP-UX, OSF/1, NetBSD locale name.
13556 if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13557 gt_cv_locale_ja=ja_JP.eucJP
13558 else
13559 # Test for the IRIX, FreeBSD locale name.
13560 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13561 gt_cv_locale_ja=ja_JP.EUC
13562 else
13563 # Test for the Solaris 7 locale name.
13564 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13565 gt_cv_locale_ja=ja
13566 else
13567 # Special test for NetBSD 1.6.
13568 if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
13569 gt_cv_locale_ja=ja_JP.eucJP
13570 else
13571 # None found.
13572 gt_cv_locale_ja=none
13573 fi
13574 fi
13575 fi
13576 fi
13577 fi
13578 fi
13579 ;;
13580 esac
13581 fi
13582 rm -fr conftest*
5abebf3c
CB
13583
13584fi
c0c3707f
CB
13585{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
13586$as_echo "$gt_cv_locale_ja" >&6; }
13587 LOCALE_JA=$gt_cv_locale_ja
5abebf3c 13588
5abebf3c 13589
5abebf3c 13590
5abebf3c 13591
c0c3707f
CB
13592 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
13593$as_echo_n "checking for a french Unicode locale... " >&6; }
13594if ${gt_cv_locale_fr_utf8+:} false; then :
5abebf3c
CB
13595 $as_echo_n "(cached) " >&6
13596else
5abebf3c 13597
c0c3707f 13598 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 13599/* end confdefs.h. */
5abebf3c 13600
c0c3707f
CB
13601#include <locale.h>
13602#include <time.h>
13603#if HAVE_LANGINFO_CODESET
13604# include <langinfo.h>
13605#endif
13606#include <stdlib.h>
13607#include <string.h>
13608struct tm t;
13609char buf[16];
13610int main () {
13611 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
13612 imitates locale dependent behaviour by looking at the environment
13613 variables, and all locales use the UTF-8 encoding. */
13614#if !(defined __BEOS__ || defined __HAIKU__)
13615 /* Check whether the given locale name is recognized by the system. */
13616# if defined _WIN32 && !defined __CYGWIN__
13617 /* On native Windows, setlocale(category, "") looks at the system settings,
13618 not at the environment variables. Also, when an encoding suffix such
13619 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
13620 category of the locale to "C". */
13621 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
13622 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
13623 return 1;
13624# else
13625 if (setlocale (LC_ALL, "") == NULL) return 1;
13626# endif
13627 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
13628 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
13629 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
13630 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
13631 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
13632 some unit tests fail. */
13633# if HAVE_LANGINFO_CODESET
13634 {
13635 const char *cs = nl_langinfo (CODESET);
13636 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
13637 return 1;
13638 }
13639# endif
13640# ifdef __CYGWIN__
13641 /* On Cygwin, avoid locale names without encoding suffix, because the
13642 locale_charset() function relies on the encoding suffix. Note that
13643 LC_ALL is set on the command line. */
13644 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
13645# endif
13646 /* Check whether in the abbreviation of the second month, the second
13647 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
13648 two bytes long, with UTF-8 encoding. */
13649 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
13650 if (strftime (buf, sizeof (buf), "%b", &t) < 4
13651 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
13652 return 1;
13653#endif
13654#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
13655 /* Check whether the decimal separator is a comma.
13656 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
13657 are nl_langinfo(RADIXCHAR) are both ".". */
13658 if (localeconv () ->decimal_point[0] != ',') return 1;
13659#endif
5abebf3c
CB
13660 return 0;
13661}
5abebf3c 13662
c0c3707f
CB
13663_ACEOF
13664 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13665 (eval $ac_link) 2>&5
13666 ac_status=$?
13667 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13668 test $ac_status = 0; } && test -s conftest$ac_exeext; then
13669 case "$host_os" in
13670 # Handle native Windows specially, because there setlocale() interprets
13671 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
13672 # "fr" or "fra" as "French" or "French_France.1252",
13673 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
13674 # "ja" as "Japanese" or "Japanese_Japan.932",
13675 # and similar.
13676 mingw*)
13677 # Test for the hypothetical native Windows locale name.
13678 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13679 gt_cv_locale_fr_utf8=French_France.65001
13680 else
13681 # None found.
13682 gt_cv_locale_fr_utf8=none
13683 fi
13684 ;;
13685 *)
13686 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
13687 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
13688 # configure script would override the LC_ALL setting. Likewise for
13689 # LC_CTYPE, which is also set at the beginning of the configure script.
13690 # Test for the usual locale name.
13691 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13692 gt_cv_locale_fr_utf8=fr_FR
13693 else
13694 # Test for the locale name with explicit encoding suffix.
13695 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13696 gt_cv_locale_fr_utf8=fr_FR.UTF-8
13697 else
13698 # Test for the Solaris 7 locale name.
13699 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13700 gt_cv_locale_fr_utf8=fr.UTF-8
13701 else
13702 # None found.
13703 gt_cv_locale_fr_utf8=none
13704 fi
13705 fi
13706 fi
13707 ;;
13708 esac
13709 fi
13710 rm -fr conftest*
5abebf3c
CB
13711
13712fi
c0c3707f
CB
13713{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
13714$as_echo "$gt_cv_locale_fr_utf8" >&6; }
13715 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
5abebf3c
CB
13716
13717
13718
13719
13720
c0c3707f
CB
13721 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
13722$as_echo_n "checking for a transitional chinese locale... " >&6; }
13723if ${gt_cv_locale_zh_CN+:} false; then :
5abebf3c
CB
13724 $as_echo_n "(cached) " >&6
13725else
5abebf3c 13726
c0c3707f 13727 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 13728/* end confdefs.h. */
5abebf3c 13729
c0c3707f
CB
13730#include <locale.h>
13731#include <stdlib.h>
13732#include <time.h>
13733#if HAVE_LANGINFO_CODESET
13734# include <langinfo.h>
13735#endif
13736#include <stdlib.h>
13737#include <string.h>
13738struct tm t;
13739char buf[16];
13740int main ()
5abebf3c 13741{
c0c3707f
CB
13742 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
13743 imitates locale dependent behaviour by looking at the environment
13744 variables, and all locales use the UTF-8 encoding. */
13745#if defined __BEOS__ || defined __HAIKU__
13746 return 1;
13747#else
13748 /* Check whether the given locale name is recognized by the system. */
13749# if defined _WIN32 && !defined __CYGWIN__
13750 /* On native Windows, setlocale(category, "") looks at the system settings,
13751 not at the environment variables. Also, when an encoding suffix such
13752 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
13753 category of the locale to "C". */
13754 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
13755 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
13756 return 1;
13757# else
13758 if (setlocale (LC_ALL, "") == NULL) return 1;
13759# endif
13760 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
13761 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
13762 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
13763 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
13764 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
13765 some unit tests fail.
13766 On MirBSD 10, when an unsupported locale is specified, setlocale()
13767 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
13768# if HAVE_LANGINFO_CODESET
13769 {
13770 const char *cs = nl_langinfo (CODESET);
13771 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
13772 || strcmp (cs, "UTF-8") == 0)
13773 return 1;
13774 }
13775# endif
13776# ifdef __CYGWIN__
13777 /* On Cygwin, avoid locale names without encoding suffix, because the
13778 locale_charset() function relies on the encoding suffix. Note that
13779 LC_ALL is set on the command line. */
13780 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
13781# endif
13782 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
13783 This excludes the UTF-8 encoding (except on MirBSD). */
13784 {
13785 const char *p;
13786 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
13787 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
13788 for (p = buf; *p != '\0'; p++)
13789 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
13790 return 1;
13791 }
13792 /* Check whether a typical GB18030 multibyte sequence is recognized as a
13793 single wide character. This excludes the GB2312 and GBK encodings. */
13794 if (mblen ("\203\062\332\066", 5) != 4)
13795 return 1;
5abebf3c 13796 return 0;
c0c3707f 13797#endif
5abebf3c 13798}
c0c3707f 13799
5abebf3c 13800_ACEOF
c0c3707f
CB
13801 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13802 (eval $ac_link) 2>&5
13803 ac_status=$?
13804 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13805 test $ac_status = 0; } && test -s conftest$ac_exeext; then
13806 case "$host_os" in
13807 # Handle native Windows specially, because there setlocale() interprets
13808 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
13809 # "fr" or "fra" as "French" or "French_France.1252",
13810 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
13811 # "ja" as "Japanese" or "Japanese_Japan.932",
13812 # and similar.
13813 mingw*)
13814 # Test for the hypothetical native Windows locale name.
13815 if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13816 gt_cv_locale_zh_CN=Chinese_China.54936
13817 else
13818 # None found.
13819 gt_cv_locale_zh_CN=none
13820 fi
13821 ;;
13822 solaris2.8)
13823 # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
13824 # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
13825 # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
13826 gt_cv_locale_zh_CN=none
13827 ;;
13828 *)
13829 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
13830 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
13831 # configure script would override the LC_ALL setting. Likewise for
13832 # LC_CTYPE, which is also set at the beginning of the configure script.
13833 # Test for the locale name without encoding suffix.
13834 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13835 gt_cv_locale_zh_CN=zh_CN
13836 else
13837 # Test for the locale name with explicit encoding suffix.
13838 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13839 gt_cv_locale_zh_CN=zh_CN.GB18030
13840 else
13841 # None found.
13842 gt_cv_locale_zh_CN=none
13843 fi
13844 fi
13845 ;;
13846 esac
13847 else
13848 # If there was a link error, due to mblen(), the system is so old that
13849 # it certainly doesn't have a chinese locale.
13850 gt_cv_locale_zh_CN=none
13851 fi
13852 rm -fr conftest*
13853
5abebf3c 13854fi
c0c3707f
CB
13855{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
13856$as_echo "$gt_cv_locale_zh_CN" >&6; }
13857 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
13858
13859
13860{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
13861$as_echo_n "checking for inline... " >&6; }
13862if ${ac_cv_c_inline+:} false; then :
13863 $as_echo_n "(cached) " >&6
13864else
13865 ac_cv_c_inline=no
13866for ac_kw in inline __inline__ __inline; do
13867 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13868/* end confdefs.h. */
13869#ifndef __cplusplus
13870typedef int foo_t;
13871static $ac_kw foo_t static_foo () {return 0; }
13872$ac_kw foo_t foo () {return 0; }
13873#endif
5abebf3c 13874
c0c3707f
CB
13875_ACEOF
13876if ac_fn_c_try_compile "$LINENO"; then :
13877 ac_cv_c_inline=$ac_kw
13878fi
13879rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13880 test "$ac_cv_c_inline" != no && break
13881done
5abebf3c
CB
13882
13883fi
c0c3707f
CB
13884{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
13885$as_echo "$ac_cv_c_inline" >&6; }
5abebf3c 13886
c0c3707f
CB
13887case $ac_cv_c_inline in
13888 inline | yes) ;;
13889 *)
13890 case $ac_cv_c_inline in
13891 no) ac_val=;;
13892 *) ac_val=$ac_cv_c_inline;;
13893 esac
13894 cat >>confdefs.h <<_ACEOF
13895#ifndef __cplusplus
13896#define inline $ac_val
13897#endif
13898_ACEOF
13899 ;;
13900esac
5abebf3c
CB
13901
13902
13903
13904
c0c3707f
CB
13905 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
13906$as_echo_n "checking for a traditional french locale... " >&6; }
13907if ${gt_cv_locale_fr+:} false; then :
13908 $as_echo_n "(cached) " >&6
13909else
5abebf3c 13910
c0c3707f
CB
13911 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13912/* end confdefs.h. */
5abebf3c 13913
c0c3707f
CB
13914#include <locale.h>
13915#include <time.h>
13916#if HAVE_LANGINFO_CODESET
13917# include <langinfo.h>
13918#endif
13919#include <stdlib.h>
13920#include <string.h>
13921struct tm t;
13922char buf[16];
13923int main () {
13924 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
13925 imitates locale dependent behaviour by looking at the environment
13926 variables, and all locales use the UTF-8 encoding. */
13927#if defined __BEOS__ || defined __HAIKU__
13928 return 1;
13929#else
13930 /* Check whether the given locale name is recognized by the system. */
13931# if defined _WIN32 && !defined __CYGWIN__
13932 /* On native Windows, setlocale(category, "") looks at the system settings,
13933 not at the environment variables. Also, when an encoding suffix such
13934 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
13935 category of the locale to "C". */
13936 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
13937 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
13938 return 1;
13939# else
13940 if (setlocale (LC_ALL, "") == NULL) return 1;
13941# endif
13942 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
13943 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
13944 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
13945 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
13946 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
13947 some unit tests fail.
13948 On MirBSD 10, when an unsupported locale is specified, setlocale()
13949 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
13950# if HAVE_LANGINFO_CODESET
13951 {
13952 const char *cs = nl_langinfo (CODESET);
13953 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
13954 || strcmp (cs, "UTF-8") == 0)
13955 return 1;
13956 }
13957# endif
13958# ifdef __CYGWIN__
13959 /* On Cygwin, avoid locale names without encoding suffix, because the
13960 locale_charset() function relies on the encoding suffix. Note that
13961 LC_ALL is set on the command line. */
13962 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
13963# endif
13964 /* Check whether in the abbreviation of the second month, the second
13965 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
13966 one byte long. This excludes the UTF-8 encoding. */
13967 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
13968 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
13969# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
13970 /* Check whether the decimal separator is a comma.
13971 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
13972 are nl_langinfo(RADIXCHAR) are both ".". */
13973 if (localeconv () ->decimal_point[0] != ',') return 1;
13974# endif
13975 return 0;
13976#endif
13977}
5abebf3c 13978
c0c3707f
CB
13979_ACEOF
13980 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13981 (eval $ac_link) 2>&5
13982 ac_status=$?
13983 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13984 test $ac_status = 0; } && test -s conftest$ac_exeext; then
13985 case "$host_os" in
13986 # Handle native Windows specially, because there setlocale() interprets
13987 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
13988 # "fr" or "fra" as "French" or "French_France.1252",
13989 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
13990 # "ja" as "Japanese" or "Japanese_Japan.932",
13991 # and similar.
13992 mingw*)
13993 # Test for the native Windows locale name.
13994 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13995 gt_cv_locale_fr=French_France.1252
13996 else
13997 # None found.
13998 gt_cv_locale_fr=none
13999 fi
14000 ;;
14001 *)
14002 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
14003 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
14004 # configure script would override the LC_ALL setting. Likewise for
14005 # LC_CTYPE, which is also set at the beginning of the configure script.
14006 # Test for the usual locale name.
14007 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14008 gt_cv_locale_fr=fr_FR
14009 else
14010 # Test for the locale name with explicit encoding suffix.
14011 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14012 gt_cv_locale_fr=fr_FR.ISO-8859-1
14013 else
14014 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
14015 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14016 gt_cv_locale_fr=fr_FR.ISO8859-1
14017 else
14018 # Test for the HP-UX locale name.
14019 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14020 gt_cv_locale_fr=fr_FR.iso88591
14021 else
14022 # Test for the Solaris 7 locale name.
14023 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14024 gt_cv_locale_fr=fr
14025 else
14026 # None found.
14027 gt_cv_locale_fr=none
14028 fi
14029 fi
14030 fi
14031 fi
14032 fi
14033 ;;
14034 esac
14035 fi
14036 rm -fr conftest*
5abebf3c 14037
c0c3707f
CB
14038fi
14039{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
14040$as_echo "$gt_cv_locale_fr" >&6; }
14041 LOCALE_FR=$gt_cv_locale_fr
5abebf3c
CB
14042
14043
14044
14045
14046
14047
14048
c0c3707f
CB
14049 GNULIB_EXPLICIT_BZERO=0;
14050 GNULIB_FFSL=0;
14051 GNULIB_FFSLL=0;
14052 GNULIB_MEMCHR=0;
14053 GNULIB_MEMMEM=0;
14054 GNULIB_MEMPCPY=0;
14055 GNULIB_MEMRCHR=0;
14056 GNULIB_RAWMEMCHR=0;
14057 GNULIB_STPCPY=0;
14058 GNULIB_STPNCPY=0;
14059 GNULIB_STRCHRNUL=0;
14060 GNULIB_STRDUP=0;
14061 GNULIB_STRNCAT=0;
14062 GNULIB_STRNDUP=0;
14063 GNULIB_STRNLEN=0;
14064 GNULIB_STRPBRK=0;
14065 GNULIB_STRSEP=0;
14066 GNULIB_STRSTR=0;
14067 GNULIB_STRCASESTR=0;
14068 GNULIB_STRTOK_R=0;
14069 GNULIB_MBSLEN=0;
14070 GNULIB_MBSNLEN=0;
14071 GNULIB_MBSCHR=0;
14072 GNULIB_MBSRCHR=0;
14073 GNULIB_MBSSTR=0;
14074 GNULIB_MBSCASECMP=0;
14075 GNULIB_MBSNCASECMP=0;
14076 GNULIB_MBSPCASECMP=0;
14077 GNULIB_MBSCASESTR=0;
14078 GNULIB_MBSCSPN=0;
14079 GNULIB_MBSPBRK=0;
14080 GNULIB_MBSSPN=0;
14081 GNULIB_MBSSEP=0;
14082 GNULIB_MBSTOK_R=0;
14083 GNULIB_STRERROR=0;
14084 GNULIB_STRERROR_R=0;
14085 GNULIB_STRSIGNAL=0;
14086 GNULIB_STRVERSCMP=0;
14087 HAVE_MBSLEN=0;
14088 HAVE_EXPLICIT_BZERO=1;
14089 HAVE_FFSL=1;
14090 HAVE_FFSLL=1;
14091 HAVE_MEMCHR=1;
14092 HAVE_DECL_MEMMEM=1;
14093 HAVE_MEMPCPY=1;
14094 HAVE_DECL_MEMRCHR=1;
14095 HAVE_RAWMEMCHR=1;
14096 HAVE_STPCPY=1;
14097 HAVE_STPNCPY=1;
14098 HAVE_STRCHRNUL=1;
14099 HAVE_DECL_STRDUP=1;
14100 HAVE_DECL_STRNDUP=1;
14101 HAVE_DECL_STRNLEN=1;
14102 HAVE_STRPBRK=1;
14103 HAVE_STRSEP=1;
14104 HAVE_STRCASESTR=1;
14105 HAVE_DECL_STRTOK_R=1;
14106 HAVE_DECL_STRERROR_R=1;
14107 HAVE_DECL_STRSIGNAL=1;
14108 HAVE_STRVERSCMP=1;
14109 REPLACE_MEMCHR=0;
14110 REPLACE_MEMMEM=0;
14111 REPLACE_STPNCPY=0;
14112 REPLACE_STRCHRNUL=0;
14113 REPLACE_STRDUP=0;
14114 REPLACE_STRNCAT=0;
14115 REPLACE_STRNDUP=0;
14116 REPLACE_STRNLEN=0;
14117 REPLACE_STRSTR=0;
14118 REPLACE_STRCASESTR=0;
14119 REPLACE_STRTOK_R=0;
14120 REPLACE_STRERROR=0;
14121 REPLACE_STRERROR_R=0;
14122 REPLACE_STRSIGNAL=0;
14123 UNDEFINE_STRTOK_R=0;
5abebf3c
CB
14124
14125
14126
14127
6ec2e0f5
SDJ
14128
14129
c0c3707f
CB
14130 # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
14131 # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
14132 # irrelevant for anonymous mappings.
14133 ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
14134if test "x$ac_cv_func_mmap" = xyes; then :
14135 gl_have_mmap=yes
6ec2e0f5 14136else
c0c3707f
CB
14137 gl_have_mmap=no
14138fi
6ec2e0f5
SDJ
14139
14140
c0c3707f
CB
14141 # Try to allow MAP_ANONYMOUS.
14142 gl_have_mmap_anonymous=no
14143 if test $gl_have_mmap = yes; then
14144 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
14145$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
14146 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14147/* end confdefs.h. */
6ec2e0f5 14148
c0c3707f
CB
14149#include <sys/mman.h>
14150#ifdef MAP_ANONYMOUS
14151 I cannot identify this map
14152#endif
6ec2e0f5 14153
c0c3707f
CB
14154_ACEOF
14155if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14156 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
14157 gl_have_mmap_anonymous=yes
6ec2e0f5 14158fi
c0c3707f 14159rm -f conftest*
6ec2e0f5 14160
c0c3707f
CB
14161 if test $gl_have_mmap_anonymous != yes; then
14162 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14163/* end confdefs.h. */
6ec2e0f5 14164
c0c3707f
CB
14165#include <sys/mman.h>
14166#ifdef MAP_ANON
14167 I cannot identify this map
14168#endif
6ec2e0f5 14169
c0c3707f
CB
14170_ACEOF
14171if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14172 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
6ec2e0f5 14173
c0c3707f 14174$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
5e8754f9 14175
c0c3707f 14176 gl_have_mmap_anonymous=yes
5e8754f9 14177fi
c0c3707f
CB
14178rm -f conftest*
14179
14180 fi
14181 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
14182$as_echo "$gl_have_mmap_anonymous" >&6; }
14183 if test $gl_have_mmap_anonymous = yes; then
6ec2e0f5 14184
c0c3707f 14185$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
6ec2e0f5 14186
c0c3707f
CB
14187 fi
14188 fi
6ec2e0f5
SDJ
14189
14190
14191
14192
6ec2e0f5 14193
6ec2e0f5 14194
c0c3707f
CB
14195 if test $HAVE_MEMCHR = 1; then
14196 # Detect platform-specific bugs in some versions of glibc:
14197 # memchr should not dereference anything with length 0
14198 # https://bugzilla.redhat.com/show_bug.cgi?id=499689
14199 # memchr should not dereference overestimated length after a match
14200 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
14201 # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
14202 # memchr should cast the second argument to 'unsigned char'.
14203 # This bug exists in Android 4.3.
14204 # Assume that memchr works on platforms that lack mprotect.
14205 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
14206$as_echo_n "checking whether memchr works... " >&6; }
14207if ${gl_cv_func_memchr_works+:} false; then :
14208 $as_echo_n "(cached) " >&6
6ec2e0f5 14209else
c0c3707f
CB
14210 if test "$cross_compiling" = yes; then :
14211 case "$host_os" in
14212 # Guess no on Android.
14213 linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
14214 # Guess yes on native Windows.
14215 mingw*) gl_cv_func_memchr_works="guessing yes" ;;
14216 # If we don't know, obey --enable-cross-guesses.
14217 *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
14218 esac
6ec2e0f5
SDJ
14219
14220else
14221 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14222/* end confdefs.h. */
14223
c0c3707f
CB
14224#include <string.h>
14225#if HAVE_SYS_MMAN_H
14226# include <fcntl.h>
14227# include <unistd.h>
14228# include <sys/types.h>
14229# include <sys/mman.h>
14230# ifndef MAP_FILE
14231# define MAP_FILE 0
14232# endif
14233#endif
6ec2e0f5
SDJ
14234
14235int
14236main ()
14237{
c0c3707f
CB
14238
14239 int result = 0;
14240 char *fence = NULL;
14241#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
14242# if HAVE_MAP_ANONYMOUS
14243 const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
14244 const int fd = -1;
14245# else /* !HAVE_MAP_ANONYMOUS */
14246 const int flags = MAP_FILE | MAP_PRIVATE;
14247 int fd = open ("/dev/zero", O_RDONLY, 0666);
14248 if (fd >= 0)
14249# endif
14250 {
14251 int pagesize = getpagesize ();
14252 char *two_pages =
14253 (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
14254 flags, fd, 0);
14255 if (two_pages != (char *)(-1)
14256 && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
14257 fence = two_pages + pagesize;
14258 }
14259#endif
14260 if (fence)
14261 {
14262 if (memchr (fence, 0, 0))
14263 result |= 1;
14264 strcpy (fence - 9, "12345678");
14265 if (memchr (fence - 9, 0, 79) != fence - 1)
14266 result |= 2;
14267 if (memchr (fence - 1, 0, 3) != fence - 1)
14268 result |= 4;
14269 }
14270 /* Test against bug on Android 4.3. */
14271 {
14272 char input[3];
14273 input[0] = 'a';
14274 input[1] = 'b';
14275 input[2] = 'c';
14276 if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
14277 result |= 8;
14278 }
14279 return result;
6ec2e0f5
SDJ
14280
14281 ;
14282 return 0;
14283}
14284_ACEOF
14285if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 14286 gl_cv_func_memchr_works=yes
6ec2e0f5 14287else
c0c3707f 14288 gl_cv_func_memchr_works=no
6ec2e0f5
SDJ
14289fi
14290rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14291 conftest.$ac_objext conftest.beam conftest.$ac_ext
14292fi
14293
14294
14295fi
c0c3707f
CB
14296{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
14297$as_echo "$gl_cv_func_memchr_works" >&6; }
14298 case "$gl_cv_func_memchr_works" in
6ec2e0f5 14299 *yes) ;;
c0c3707f 14300 *) REPLACE_MEMCHR=1 ;;
6ec2e0f5
SDJ
14301 esac
14302 fi
14303
c0c3707f
CB
14304ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default"
14305if test "x$ac_cv_have_decl_memmem" = xyes; then :
6ec2e0f5
SDJ
14306 ac_have_decl=1
14307else
14308 ac_have_decl=0
14309fi
14310
14311cat >>confdefs.h <<_ACEOF
c0c3707f 14312#define HAVE_DECL_MEMMEM $ac_have_decl
6ec2e0f5
SDJ
14313_ACEOF
14314
472fa5ee 14315
6ec2e0f5
SDJ
14316
14317
14318
c0c3707f
CB
14319 for ac_func in memmem
14320do :
14321 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
14322if test "x$ac_cv_func_memmem" = xyes; then :
14323 cat >>confdefs.h <<_ACEOF
14324#define HAVE_MEMMEM 1
14325_ACEOF
6ec2e0f5 14326
c0c3707f
CB
14327fi
14328done
6ec2e0f5 14329
c0c3707f
CB
14330 if test $ac_cv_func_memmem = yes; then
14331 HAVE_MEMMEM=1
14332 else
14333 HAVE_MEMMEM=0
14334 fi
6ec2e0f5 14335
c0c3707f
CB
14336 if test $ac_cv_have_decl_memmem = no; then
14337 HAVE_DECL_MEMMEM=0
14338 else
14339 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
14340$as_echo_n "checking whether memmem works... " >&6; }
14341if ${gl_cv_func_memmem_works_always+:} false; then :
6ec2e0f5
SDJ
14342 $as_echo_n "(cached) " >&6
14343else
c0c3707f
CB
14344 if test "$cross_compiling" = yes; then :
14345 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14346/* end confdefs.h. */
472fa5ee 14347
c0c3707f
CB
14348#ifdef __GNU_LIBRARY__
14349 #include <features.h>
14350 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
14351 || __GLIBC_MINOR__ > 12)) \
14352 || (__GLIBC__ > 2)) \
14353 || defined __UCLIBC__
14354 Lucky user
14355 #endif
14356#elif defined __CYGWIN__
14357 #include <cygwin/version.h>
14358 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
14359 Lucky user
14360 #endif
14361#else
14362 Lucky user
14363#endif
472fa5ee 14364
c0c3707f
CB
14365_ACEOF
14366if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14367 $EGREP "Lucky user" >/dev/null 2>&1; then :
14368 gl_cv_func_memmem_works_always="guessing yes"
14369else
14370 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
14371fi
14372rm -f conftest*
472fa5ee
SM
14373
14374
6ec2e0f5
SDJ
14375else
14376 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14377/* end confdefs.h. */
c0c3707f
CB
14378
14379#include <string.h> /* for memmem */
14380#define P "_EF_BF_BD"
14381#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
14382#define NEEDLE P P P P P
6ec2e0f5
SDJ
14383
14384int
14385main ()
14386{
c0c3707f
CB
14387
14388 int result = 0;
14389 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
14390 result |= 1;
14391 /* Check for empty needle behavior. */
14392 {
14393 const char *haystack = "AAA";
14394 if (memmem (haystack, 3, NULL, 0) != haystack)
14395 result |= 2;
14396 }
14397 return result;
14398
6ec2e0f5
SDJ
14399 ;
14400 return 0;
14401}
14402_ACEOF
c0c3707f
CB
14403if ac_fn_c_try_run "$LINENO"; then :
14404 gl_cv_func_memmem_works_always=yes
6ec2e0f5 14405else
c0c3707f 14406 gl_cv_func_memmem_works_always=no
6ec2e0f5 14407fi
c0c3707f
CB
14408rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14409 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5 14410fi
6ec2e0f5 14411
c0c3707f
CB
14412
14413fi
14414{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
14415$as_echo "$gl_cv_func_memmem_works_always" >&6; }
14416 case "$gl_cv_func_memmem_works_always" in
14417 *yes) ;;
14418 *)
14419 REPLACE_MEMMEM=1
14420 ;;
14421 esac
14422 fi
14423 :
14424
14425ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
14426if test "x$ac_cv_have_decl_memrchr" = xyes; then :
14427 ac_have_decl=1
14428else
14429 ac_have_decl=0
14430fi
14431
14432cat >>confdefs.h <<_ACEOF
14433#define HAVE_DECL_MEMRCHR $ac_have_decl
14434_ACEOF
14435
14436
14437
14438
14439
14440
14441
14442 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
14443$as_echo_n "checking for O_CLOEXEC... " >&6; }
14444if ${gl_cv_macro_O_CLOEXEC+:} false; then :
6ec2e0f5
SDJ
14445 $as_echo_n "(cached) " >&6
14446else
14447 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14448/* end confdefs.h. */
c0c3707f
CB
14449#include <fcntl.h>
14450 #ifndef O_CLOEXEC
14451 choke me;
14452 #endif
6ec2e0f5
SDJ
14453
14454int
14455main ()
14456{
c0c3707f 14457return O_CLOEXEC;
6ec2e0f5
SDJ
14458 ;
14459 return 0;
14460}
14461_ACEOF
14462if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 14463 gl_cv_macro_O_CLOEXEC=yes
6ec2e0f5 14464else
c0c3707f 14465 gl_cv_macro_O_CLOEXEC=no
6ec2e0f5
SDJ
14466fi
14467rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14468fi
c0c3707f
CB
14469{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5
14470$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; }
14471
14472
14473
14474 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
14475$as_echo_n "checking for promoted mode_t type... " >&6; }
14476if ${gl_cv_promoted_mode_t+:} false; then :
6ec2e0f5
SDJ
14477 $as_echo_n "(cached) " >&6
14478else
6ec2e0f5 14479
c0c3707f
CB
14480 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14481/* end confdefs.h. */
14482#include <sys/types.h>
6ec2e0f5
SDJ
14483int
14484main ()
14485{
c0c3707f 14486typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
6ec2e0f5
SDJ
14487 ;
14488 return 0;
14489}
14490_ACEOF
14491if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 14492 gl_cv_promoted_mode_t='int'
6ec2e0f5 14493else
c0c3707f 14494 gl_cv_promoted_mode_t='mode_t'
6ec2e0f5
SDJ
14495fi
14496rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 14497
6ec2e0f5 14498fi
c0c3707f
CB
14499{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
14500$as_echo "$gl_cv_promoted_mode_t" >&6; }
6ec2e0f5 14501
c0c3707f
CB
14502cat >>confdefs.h <<_ACEOF
14503#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
6ec2e0f5 14504_ACEOF
c0c3707f
CB
14505
14506
14507
14508
14509
14510 GNULIB_DPRINTF=0;
14511 GNULIB_FCLOSE=0;
14512 GNULIB_FDOPEN=0;
14513 GNULIB_FFLUSH=0;
14514 GNULIB_FGETC=0;
14515 GNULIB_FGETS=0;
14516 GNULIB_FOPEN=0;
14517 GNULIB_FPRINTF=0;
14518 GNULIB_FPRINTF_POSIX=0;
14519 GNULIB_FPURGE=0;
14520 GNULIB_FPUTC=0;
14521 GNULIB_FPUTS=0;
14522 GNULIB_FREAD=0;
14523 GNULIB_FREOPEN=0;
14524 GNULIB_FSCANF=0;
14525 GNULIB_FSEEK=0;
14526 GNULIB_FSEEKO=0;
14527 GNULIB_FTELL=0;
14528 GNULIB_FTELLO=0;
14529 GNULIB_FWRITE=0;
14530 GNULIB_GETC=0;
14531 GNULIB_GETCHAR=0;
14532 GNULIB_GETDELIM=0;
14533 GNULIB_GETLINE=0;
14534 GNULIB_OBSTACK_PRINTF=0;
14535 GNULIB_OBSTACK_PRINTF_POSIX=0;
14536 GNULIB_PCLOSE=0;
14537 GNULIB_PERROR=0;
14538 GNULIB_POPEN=0;
14539 GNULIB_PRINTF=0;
14540 GNULIB_PRINTF_POSIX=0;
14541 GNULIB_PUTC=0;
14542 GNULIB_PUTCHAR=0;
14543 GNULIB_PUTS=0;
14544 GNULIB_REMOVE=0;
14545 GNULIB_RENAME=0;
14546 GNULIB_RENAMEAT=0;
14547 GNULIB_SCANF=0;
14548 GNULIB_SNPRINTF=0;
14549 GNULIB_SPRINTF_POSIX=0;
14550 GNULIB_STDIO_H_NONBLOCKING=0;
14551 GNULIB_STDIO_H_SIGPIPE=0;
14552 GNULIB_TMPFILE=0;
14553 GNULIB_VASPRINTF=0;
14554 GNULIB_VFSCANF=0;
14555 GNULIB_VSCANF=0;
14556 GNULIB_VDPRINTF=0;
14557 GNULIB_VFPRINTF=0;
14558 GNULIB_VFPRINTF_POSIX=0;
14559 GNULIB_VPRINTF=0;
14560 GNULIB_VPRINTF_POSIX=0;
14561 GNULIB_VSNPRINTF=0;
14562 GNULIB_VSPRINTF_POSIX=0;
14563 HAVE_DECL_FPURGE=1;
14564 HAVE_DECL_FSEEKO=1;
14565 HAVE_DECL_FTELLO=1;
14566 HAVE_DECL_GETDELIM=1;
14567 HAVE_DECL_GETLINE=1;
14568 HAVE_DECL_OBSTACK_PRINTF=1;
14569 HAVE_DECL_SNPRINTF=1;
14570 HAVE_DECL_VSNPRINTF=1;
14571 HAVE_DPRINTF=1;
14572 HAVE_FSEEKO=1;
14573 HAVE_FTELLO=1;
14574 HAVE_PCLOSE=1;
14575 HAVE_POPEN=1;
14576 HAVE_RENAMEAT=1;
14577 HAVE_VASPRINTF=1;
14578 HAVE_VDPRINTF=1;
14579 REPLACE_DPRINTF=0;
14580 REPLACE_FCLOSE=0;
14581 REPLACE_FDOPEN=0;
14582 REPLACE_FFLUSH=0;
14583 REPLACE_FOPEN=0;
14584 REPLACE_FPRINTF=0;
14585 REPLACE_FPURGE=0;
14586 REPLACE_FREOPEN=0;
14587 REPLACE_FSEEK=0;
14588 REPLACE_FSEEKO=0;
14589 REPLACE_FTELL=0;
14590 REPLACE_FTELLO=0;
14591 REPLACE_GETDELIM=0;
14592 REPLACE_GETLINE=0;
14593 REPLACE_OBSTACK_PRINTF=0;
14594 REPLACE_PERROR=0;
14595 REPLACE_POPEN=0;
14596 REPLACE_PRINTF=0;
14597 REPLACE_REMOVE=0;
14598 REPLACE_RENAME=0;
14599 REPLACE_RENAMEAT=0;
14600 REPLACE_SNPRINTF=0;
14601 REPLACE_SPRINTF=0;
14602 REPLACE_STDIO_READ_FUNCS=0;
14603 REPLACE_STDIO_WRITE_FUNCS=0;
14604 REPLACE_TMPFILE=0;
14605 REPLACE_VASPRINTF=0;
14606 REPLACE_VDPRINTF=0;
14607 REPLACE_VFPRINTF=0;
14608 REPLACE_VPRINTF=0;
14609 REPLACE_VSNPRINTF=0;
14610 REPLACE_VSPRINTF=0;
14611
14612
14613
14614ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
14615if test "x$ac_cv_have_decl_setenv" = xyes; then :
14616 ac_have_decl=1
6ec2e0f5 14617else
c0c3707f 14618 ac_have_decl=0
6ec2e0f5 14619fi
c0c3707f
CB
14620
14621cat >>confdefs.h <<_ACEOF
14622#define HAVE_DECL_SETENV $ac_have_decl
14623_ACEOF
14624
14625
14626
14627
14628
14629
14630 if test $ac_cv_have_decl_setenv = no; then
14631 HAVE_DECL_SETENV=0
6ec2e0f5
SDJ
14632 fi
14633
14634
14635
14636
14637
c0c3707f
CB
14638 for ac_header in search.h
14639do :
14640 ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
14641if test "x$ac_cv_header_search_h" = xyes; then :
14642 cat >>confdefs.h <<_ACEOF
14643#define HAVE_SEARCH_H 1
14644_ACEOF
6ec2e0f5 14645
c0c3707f 14646fi
6ec2e0f5 14647
c0c3707f 14648done
6ec2e0f5 14649
c0c3707f
CB
14650 for ac_func in tsearch
14651do :
14652 ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
14653if test "x$ac_cv_func_tsearch" = xyes; then :
14654 cat >>confdefs.h <<_ACEOF
14655#define HAVE_TSEARCH 1
14656_ACEOF
6ec2e0f5 14657
c0c3707f
CB
14658fi
14659done
6ec2e0f5
SDJ
14660
14661
14662
14663
c0c3707f
CB
14664 GNULIB_PTHREAD_SIGMASK=0;
14665 GNULIB_RAISE=0;
14666 GNULIB_SIGNAL_H_SIGPIPE=0;
14667 GNULIB_SIGPROCMASK=0;
14668 GNULIB_SIGACTION=0;
14669 HAVE_POSIX_SIGNALBLOCKING=1;
14670 HAVE_PTHREAD_SIGMASK=1;
14671 HAVE_RAISE=1;
14672 HAVE_SIGSET_T=1;
14673 HAVE_SIGINFO_T=1;
14674 HAVE_SIGACTION=1;
14675 HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
6ec2e0f5 14676
c0c3707f 14677 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
6ec2e0f5 14678
c0c3707f
CB
14679 HAVE_SIGHANDLER_T=1;
14680 REPLACE_PTHREAD_SIGMASK=0;
14681 REPLACE_RAISE=0;
6ec2e0f5 14682
6ec2e0f5 14683
c0c3707f
CB
14684 ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
14685 #include <signal.h>
14686 /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
14687 #include <sys/types.h>
14688
14689"
14690if test "x$ac_cv_type_sigset_t" = xyes; then :
14691
14692cat >>confdefs.h <<_ACEOF
14693#define HAVE_SIGSET_T 1
14694_ACEOF
14695
14696gl_cv_type_sigset_t=yes
14697else
14698 gl_cv_type_sigset_t=no
14699fi
6ec2e0f5 14700
c0c3707f
CB
14701 if test $gl_cv_type_sigset_t != yes; then
14702 HAVE_SIGSET_T=0
14703 fi
6ec2e0f5 14704
c0c3707f
CB
14705{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
14706$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
14707if ${ac_cv_type_uid_t+:} false; then :
14708 $as_echo_n "(cached) " >&6
14709else
6ec2e0f5
SDJ
14710 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14711/* end confdefs.h. */
c0c3707f
CB
14712#include <sys/types.h>
14713
6ec2e0f5 14714_ACEOF
c0c3707f
CB
14715if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14716 $EGREP "uid_t" >/dev/null 2>&1; then :
14717 ac_cv_type_uid_t=yes
14718else
14719 ac_cv_type_uid_t=no
14720fi
14721rm -f conftest*
6ec2e0f5 14722
c0c3707f
CB
14723fi
14724{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
14725$as_echo "$ac_cv_type_uid_t" >&6; }
14726if test $ac_cv_type_uid_t = no; then
6ec2e0f5 14727
c0c3707f 14728$as_echo "#define uid_t int" >>confdefs.h
6ec2e0f5 14729
6ec2e0f5 14730
c0c3707f 14731$as_echo "#define gid_t int" >>confdefs.h
6ec2e0f5
SDJ
14732
14733fi
6ec2e0f5 14734
c0c3707f
CB
14735{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
14736$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
14737if ${ac_cv_header_stdbool_h+:} false; then :
14738 $as_echo_n "(cached) " >&6
14739else
14740 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14741/* end confdefs.h. */
14742
14743 #include <stdbool.h>
14744
14745 #ifdef __cplusplus
14746 typedef bool Bool;
14747 #else
14748 typedef _Bool Bool;
14749 #ifndef bool
14750 "error: bool is not defined"
14751 #endif
14752 #ifndef false
14753 "error: false is not defined"
14754 #endif
14755 #if false
14756 "error: false is not 0"
14757 #endif
14758 #ifndef true
14759 "error: true is not defined"
14760 #endif
14761 #if true != 1
14762 "error: true is not 1"
14763 #endif
14764 #endif
14765
14766 #ifndef __bool_true_false_are_defined
14767 "error: __bool_true_false_are_defined is not defined"
14768 #endif
14769
14770 struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
14771
14772 char a[true == 1 ? 1 : -1];
14773 char b[false == 0 ? 1 : -1];
14774 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
14775 char d[(bool) 0.5 == true ? 1 : -1];
14776 /* See body of main program for 'e'. */
14777 char f[(Bool) 0.0 == false ? 1 : -1];
14778 char g[true];
14779 char h[sizeof (Bool)];
14780 char i[sizeof s.t];
14781 enum { j = false, k = true, l = false * true, m = true * 256 };
14782 /* The following fails for
14783 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
14784 Bool n[m];
14785 char o[sizeof n == m * sizeof n[0] ? 1 : -1];
14786 char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
14787 /* Catch a bug in an HP-UX C compiler. See
14788 https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
14789 https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
14790 */
14791 Bool q = true;
14792 Bool *pq = &q;
14793 bool *qq = &q;
6ec2e0f5 14794
c0c3707f
CB
14795int
14796main ()
14797{
6ec2e0f5 14798
c0c3707f
CB
14799 bool e = &s;
14800 *pq |= q; *pq |= ! q;
14801 *qq |= q; *qq |= ! q;
14802 /* Refer to every declared value, to avoid compiler optimizations. */
14803 return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
14804 + !m + !n + !o + !p + !q + !pq + !qq);
6ec2e0f5 14805
c0c3707f
CB
14806 ;
14807 return 0;
14808}
14809_ACEOF
14810if ac_fn_c_try_compile "$LINENO"; then :
14811 ac_cv_header_stdbool_h=yes
14812else
14813 ac_cv_header_stdbool_h=no
14814fi
14815rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14816fi
14817{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
14818$as_echo "$ac_cv_header_stdbool_h" >&6; }
14819 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
14820if test "x$ac_cv_type__Bool" = xyes; then :
6ec2e0f5 14821
c0c3707f
CB
14822cat >>confdefs.h <<_ACEOF
14823#define HAVE__BOOL 1
14824_ACEOF
6ec2e0f5
SDJ
14825
14826
c0c3707f 14827fi
6ec2e0f5
SDJ
14828
14829
472fa5ee 14830
c0c3707f
CB
14831 REPLACE_NULL=0;
14832 HAVE_MAX_ALIGN_T=1;
14833 HAVE_WCHAR_T=1;
472fa5ee
SM
14834
14835
c0c3707f
CB
14836 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
14837$as_echo_n "checking for wchar_t... " >&6; }
14838if ${gt_cv_c_wchar_t+:} false; then :
14839 $as_echo_n "(cached) " >&6
14840else
14841 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14842/* end confdefs.h. */
14843#include <stddef.h>
14844 wchar_t foo = (wchar_t)'\0';
14845int
14846main ()
14847{
472fa5ee 14848
c0c3707f
CB
14849 ;
14850 return 0;
14851}
14852_ACEOF
14853if ac_fn_c_try_compile "$LINENO"; then :
14854 gt_cv_c_wchar_t=yes
14855else
14856 gt_cv_c_wchar_t=no
14857fi
14858rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14859fi
14860{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
14861$as_echo "$gt_cv_c_wchar_t" >&6; }
14862 if test $gt_cv_c_wchar_t = yes; then
f8e27d88 14863
c0c3707f 14864$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
f8e27d88 14865
c0c3707f 14866 fi
f8e27d88
CB
14867
14868
14869
c0c3707f
CB
14870ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
14871if test "x$ac_cv_have_decl_strdup" = xyes; then :
6ec2e0f5
SDJ
14872 ac_have_decl=1
14873else
14874 ac_have_decl=0
14875fi
14876
14877cat >>confdefs.h <<_ACEOF
c0c3707f 14878#define HAVE_DECL_STRDUP $ac_have_decl
6ec2e0f5
SDJ
14879_ACEOF
14880
14881
c0c3707f
CB
14882 REPLACE_STRERROR_0=0
14883 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
14884$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
14885if ${gl_cv_func_strerror_0_works+:} false; then :
6ec2e0f5
SDJ
14886 $as_echo_n "(cached) " >&6
14887else
c0c3707f
CB
14888 if test "$cross_compiling" = yes; then :
14889 case "$host_os" in
14890 # Guess yes on glibc systems.
14891 *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
14892 # Guess yes on musl systems.
14893 *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
14894 # Guess yes on native Windows.
14895 mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
14896 # If we don't know, obey --enable-cross-guesses.
14897 *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
14898 esac
6ec2e0f5 14899
5e8754f9
SDJ
14900else
14901 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14902/* end confdefs.h. */
c0c3707f
CB
14903#include <string.h>
14904 #include <errno.h>
6ec2e0f5 14905
5e8754f9
SDJ
14906int
14907main ()
14908{
c0c3707f
CB
14909int result = 0;
14910 char *str;
14911 errno = 0;
14912 str = strerror (0);
14913 if (!*str) result |= 1;
14914 if (errno) result |= 2;
14915 if (strstr (str, "nknown") || strstr (str, "ndefined"))
14916 result |= 4;
14917 return result;
5e8754f9
SDJ
14918 ;
14919 return 0;
14920}
14921_ACEOF
c0c3707f
CB
14922if ac_fn_c_try_run "$LINENO"; then :
14923 gl_cv_func_strerror_0_works=yes
5e8754f9 14924else
c0c3707f 14925 gl_cv_func_strerror_0_works=no
5e8754f9 14926fi
c0c3707f
CB
14927rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14928 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 14929fi
6ec2e0f5 14930
6ec2e0f5 14931
c0c3707f
CB
14932fi
14933{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
14934$as_echo "$gl_cv_func_strerror_0_works" >&6; }
14935 case "$gl_cv_func_strerror_0_works" in
14936 *yes) ;;
14937 *)
14938 REPLACE_STRERROR_0=1
6ec2e0f5 14939
c0c3707f 14940$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
6ec2e0f5 14941
c0c3707f
CB
14942 ;;
14943 esac
6ec2e0f5
SDJ
14944
14945
14946
14947
472fa5ee
SM
14948
14949
14950
725e2999 14951
725e2999
JB
14952
14953
c0c3707f
CB
14954 if test $ac_cv_func_strerror_r = yes; then
14955 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
14956 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
14957$as_echo_n "checking for strerror_r with POSIX signature... " >&6; }
14958if ${gl_cv_func_strerror_r_posix_signature+:} false; then :
14959 $as_echo_n "(cached) " >&6
14960else
14961 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14962/* end confdefs.h. */
14963#include <string.h>
14964 int strerror_r (int, char *, size_t);
725e2999 14965
c0c3707f
CB
14966int
14967main ()
14968{
725e2999 14969
c0c3707f
CB
14970 ;
14971 return 0;
14972}
14973_ACEOF
14974if ac_fn_c_try_compile "$LINENO"; then :
14975 gl_cv_func_strerror_r_posix_signature=yes
14976else
14977 gl_cv_func_strerror_r_posix_signature=no
14978fi
14979rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
725e2999 14980
c0c3707f
CB
14981fi
14982{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
14983$as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; }
14984 if test $gl_cv_func_strerror_r_posix_signature = yes; then
14985 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
14986$as_echo_n "checking whether strerror_r works... " >&6; }
14987if ${gl_cv_func_strerror_r_works+:} false; then :
14988 $as_echo_n "(cached) " >&6
14989else
14990 if test "$cross_compiling" = yes; then :
725e2999 14991
c0c3707f
CB
14992 case "$host_os" in
14993 # Guess no on AIX.
14994 aix*) gl_cv_func_strerror_r_works="guessing no";;
14995 # Guess no on HP-UX.
14996 hpux*) gl_cv_func_strerror_r_works="guessing no";;
14997 # Guess no on BSD variants.
14998 *bsd*) gl_cv_func_strerror_r_works="guessing no";;
14999 # Guess yes otherwise.
15000 *) gl_cv_func_strerror_r_works="guessing yes";;
15001 esac
725e2999 15002
c0c3707f
CB
15003else
15004 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15005/* end confdefs.h. */
15006#include <errno.h>
15007 #include <string.h>
725e2999 15008
c0c3707f
CB
15009int
15010main ()
15011{
15012int result = 0;
15013 char buf[79];
15014 if (strerror_r (EACCES, buf, 0) < 0)
15015 result |= 1;
15016 errno = 0;
15017 if (strerror_r (EACCES, buf, sizeof buf) != 0)
15018 result |= 2;
15019 strcpy (buf, "Unknown");
15020 if (strerror_r (0, buf, sizeof buf) != 0)
15021 result |= 4;
15022 if (errno)
15023 result |= 8;
15024 if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
15025 result |= 0x10;
15026 errno = 0;
15027 *buf = 0;
15028 if (strerror_r (-3, buf, sizeof buf) < 0)
15029 result |= 0x20;
15030 if (errno)
15031 result |= 0x40;
15032 if (!*buf)
15033 result |= 0x80;
15034 return result;
725e2999 15035
c0c3707f
CB
15036 ;
15037 return 0;
15038}
15039_ACEOF
15040if ac_fn_c_try_run "$LINENO"; then :
15041 gl_cv_func_strerror_r_works=yes
15042else
15043 gl_cv_func_strerror_r_works=no
15044fi
15045rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15046 conftest.$ac_objext conftest.beam conftest.$ac_ext
15047fi
725e2999
JB
15048
15049
c0c3707f
CB
15050fi
15051{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
15052$as_echo "$gl_cv_func_strerror_r_works" >&6; }
15053 else
725e2999 15054
c0c3707f
CB
15055 if test $ac_cv_func___xpg_strerror_r = yes; then
15056 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
15057$as_echo_n "checking whether __xpg_strerror_r works... " >&6; }
15058if ${gl_cv_func_strerror_r_works+:} false; then :
725e2999
JB
15059 $as_echo_n "(cached) " >&6
15060else
c0c3707f
CB
15061 if test "$cross_compiling" = yes; then :
15062 gl_cv_func_strerror_r_works="$gl_cross_guess_normal"
725e2999 15063
c0c3707f
CB
15064else
15065 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
725e2999 15066/* end confdefs.h. */
c0c3707f
CB
15067#include <errno.h>
15068 #include <string.h>
15069 extern
15070 #ifdef __cplusplus
15071 "C"
15072 #endif
15073 int __xpg_strerror_r(int, char *, size_t);
725e2999 15074
c0c3707f
CB
15075int
15076main ()
15077{
15078int result = 0;
15079 char buf[256] = "^";
15080 char copy[256];
15081 char *str = strerror (-1);
15082 strcpy (copy, str);
15083 if (__xpg_strerror_r (-2, buf, 1) == 0)
15084 result |= 1;
15085 if (*buf)
15086 result |= 2;
15087 __xpg_strerror_r (-2, buf, 256);
15088 if (strcmp (str, copy))
15089 result |= 4;
15090 return result;
725e2999 15091
c0c3707f
CB
15092 ;
15093 return 0;
15094}
725e2999 15095_ACEOF
c0c3707f
CB
15096if ac_fn_c_try_run "$LINENO"; then :
15097 gl_cv_func_strerror_r_works=yes
725e2999 15098else
c0c3707f 15099 gl_cv_func_strerror_r_works=no
725e2999 15100fi
c0c3707f
CB
15101rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15102 conftest.$ac_objext conftest.beam conftest.$ac_ext
725e2999 15103fi
725e2999 15104
725e2999 15105
c0c3707f
CB
15106fi
15107{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
15108$as_echo "$gl_cv_func_strerror_r_works" >&6; }
15109 fi
15110 fi
725e2999 15111 fi
725e2999
JB
15112 fi
15113
c0c3707f
CB
15114ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
15115if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
15116 ac_have_decl=1
725e2999 15117else
c0c3707f 15118 ac_have_decl=0
725e2999
JB
15119fi
15120
c0c3707f
CB
15121cat >>confdefs.h <<_ACEOF
15122#define HAVE_DECL_STRERROR_R $ac_have_decl
15123_ACEOF
725e2999
JB
15124
15125
15126
15127
15128
725e2999
JB
15129
15130
15131
725e2999
JB
15132
15133
15134
15135
15136
15137
15138
15139
15140 if test $gl_cv_have_include_next = yes; then
c0c3707f 15141 gl_cv_next_string_h='<'string.h'>'
725e2999 15142 else
c0c3707f
CB
15143 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
15144$as_echo_n "checking absolute name of <string.h>... " >&6; }
15145if ${gl_cv_next_string_h+:} false; then :
725e2999
JB
15146 $as_echo_n "(cached) " >&6
15147else
15148
725e2999
JB
15149
15150
15151 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15152/* end confdefs.h. */
c0c3707f 15153#include <string.h>
725e2999
JB
15154_ACEOF
15155 case "$host_os" in
15156 aix*) gl_absname_cpp="$ac_cpp -C" ;;
15157 *) gl_absname_cpp="$ac_cpp" ;;
15158 esac
15159
15160 case "$host_os" in
15161 mingw*)
15162 gl_dirsep_regex='[/\\]'
15163 ;;
15164 *)
15165 gl_dirsep_regex='\/'
15166 ;;
15167 esac
15168 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 15169 gl_header_literal_regex=`echo 'string.h' \
725e2999
JB
15170 | sed -e "$gl_make_literal_regex_sed"`
15171 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
15172 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
15173 s|^/[^/]|//&|
15174 p
15175 q
15176 }'
6ec2e0f5 15177
c0c3707f 15178 gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
725e2999 15179 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 15180
c0c3707f
CB
15181 gl_header=$gl_cv_absolute_string_h
15182 gl_cv_next_string_h='"'$gl_header'"'
6ec2e0f5
SDJ
15183
15184
725e2999 15185fi
c0c3707f
CB
15186{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
15187$as_echo "$gl_cv_next_string_h" >&6; }
725e2999 15188 fi
c0c3707f 15189 NEXT_STRING_H=$gl_cv_next_string_h
6ec2e0f5 15190
725e2999
JB
15191 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
15192 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 15193 gl_next_as_first_directive='<'string.h'>'
725e2999
JB
15194 else
15195 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 15196 gl_next_as_first_directive=$gl_cv_next_string_h
725e2999 15197 fi
c0c3707f
CB
15198 NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
15199
15200
15201
6ec2e0f5
SDJ
15202
15203
15204
15205
15206
6ec2e0f5
SDJ
15207
15208
6ec2e0f5 15209
c0c3707f
CB
15210
15211 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
15212 REPLACE_STRSTR=1
15213 else
15214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
15215$as_echo_n "checking whether strstr works... " >&6; }
15216if ${gl_cv_func_strstr_works_always+:} false; then :
6ec2e0f5
SDJ
15217 $as_echo_n "(cached) " >&6
15218else
c0c3707f
CB
15219 if test "$cross_compiling" = yes; then :
15220 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
15221/* end confdefs.h. */
15222
c0c3707f
CB
15223#ifdef __GNU_LIBRARY__
15224 #include <features.h>
15225 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
15226 || defined __UCLIBC__
15227 Lucky user
15228 #endif
15229#elif defined __CYGWIN__
15230 #include <cygwin/version.h>
15231 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
15232 Lucky user
15233 #endif
15234#else
15235 Lucky user
6ec2e0f5 15236#endif
c0c3707f
CB
15237
15238_ACEOF
15239if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15240 $EGREP "Lucky user" >/dev/null 2>&1; then :
15241 gl_cv_func_strstr_works_always="guessing yes"
15242else
15243 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
15244fi
15245rm -f conftest*
15246
15247
15248else
15249 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15250/* end confdefs.h. */
15251
15252#include <string.h> /* for strstr */
15253#ifdef __GNU_LIBRARY__
15254 #include <features.h>
15255 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
15256 Unlucky user
15257 #endif
725e2999 15258#endif
c0c3707f
CB
15259#define P "_EF_BF_BD"
15260#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
15261#define NEEDLE P P P P P
6ec2e0f5 15262
725e2999
JB
15263int
15264main ()
15265{
c0c3707f
CB
15266return !!strstr (HAYSTACK, NEEDLE);
15267
725e2999
JB
15268 ;
15269 return 0;
15270}
6ec2e0f5 15271_ACEOF
c0c3707f
CB
15272if ac_fn_c_try_run "$LINENO"; then :
15273 gl_cv_func_strstr_works_always=yes
6ec2e0f5 15274else
c0c3707f 15275 gl_cv_func_strstr_works_always=no
6ec2e0f5 15276fi
c0c3707f
CB
15277rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15278 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5 15279fi
6ec2e0f5
SDJ
15280
15281
c0c3707f
CB
15282fi
15283{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
15284$as_echo "$gl_cv_func_strstr_works_always" >&6; }
15285 case "$gl_cv_func_strstr_works_always" in
15286 *yes) ;;
15287 *)
15288 REPLACE_STRSTR=1
15289 ;;
15290 esac
15291 fi
6ec2e0f5 15292
c0c3707f
CB
15293ac_fn_c_check_decl "$LINENO" "strtok_r" "ac_cv_have_decl_strtok_r" "$ac_includes_default"
15294if test "x$ac_cv_have_decl_strtok_r" = xyes; then :
15295 ac_have_decl=1
15296else
15297 ac_have_decl=0
15298fi
6ec2e0f5 15299
c0c3707f
CB
15300cat >>confdefs.h <<_ACEOF
15301#define HAVE_DECL_STRTOK_R $ac_have_decl
15302_ACEOF
6ec2e0f5
SDJ
15303
15304
15305
15306
6ec2e0f5
SDJ
15307
15308
15309
15310
15311
15312
15313
c0c3707f 15314$as_echo "#define _USE_STD_STAT 1" >>confdefs.h
6ec2e0f5 15315
6ec2e0f5
SDJ
15316
15317
15318
15319
15320
6ec2e0f5
SDJ
15321
15322
15323
15324
15325
c0c3707f
CB
15326 if test $gl_cv_have_include_next = yes; then
15327 gl_cv_next_sys_types_h='<'sys/types.h'>'
15328 else
15329 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
15330$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
15331if ${gl_cv_next_sys_types_h+:} false; then :
6ec2e0f5
SDJ
15332 $as_echo_n "(cached) " >&6
15333else
6ec2e0f5 15334
6ec2e0f5 15335
c0c3707f
CB
15336
15337 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15338/* end confdefs.h. */
15339#include <sys/types.h>
6ec2e0f5 15340_ACEOF
c0c3707f
CB
15341 case "$host_os" in
15342 aix*) gl_absname_cpp="$ac_cpp -C" ;;
15343 *) gl_absname_cpp="$ac_cpp" ;;
15344 esac
6ec2e0f5 15345
c0c3707f
CB
15346 case "$host_os" in
15347 mingw*)
15348 gl_dirsep_regex='[/\\]'
15349 ;;
15350 *)
15351 gl_dirsep_regex='\/'
15352 ;;
15353 esac
15354 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
15355 gl_header_literal_regex=`echo 'sys/types.h' \
15356 | sed -e "$gl_make_literal_regex_sed"`
15357 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
15358 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
15359 s|^/[^/]|//&|
15360 p
15361 q
15362 }'
6ec2e0f5 15363
c0c3707f
CB
15364 gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
15365 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 15366
c0c3707f
CB
15367 gl_header=$gl_cv_absolute_sys_types_h
15368 gl_cv_next_sys_types_h='"'$gl_header'"'
6ec2e0f5
SDJ
15369
15370
c0c3707f
CB
15371fi
15372{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
15373$as_echo "$gl_cv_next_sys_types_h" >&6; }
15374 fi
15375 NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
6ec2e0f5 15376
c0c3707f
CB
15377 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
15378 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
15379 gl_next_as_first_directive='<'sys/types.h'>'
15380 else
15381 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
15382 gl_next_as_first_directive=$gl_cv_next_sys_types_h
15383 fi
15384 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
15385
15386
15387
15388
6ec2e0f5 15389
6ec2e0f5
SDJ
15390
15391
6ec2e0f5
SDJ
15392
15393
15394
15395
15396
c0c3707f 15397 WINDOWS_STAT_INODES=0
6ec2e0f5
SDJ
15398
15399
15400
15401
15402
472fa5ee
SM
15403
15404
15405
15406
c0c3707f
CB
15407 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
15408$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
15409if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
15410 $as_echo_n "(cached) " >&6
15411else
15412 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15413/* end confdefs.h. */
15414#include <time.h>
472fa5ee 15415
c0c3707f
CB
15416int
15417main ()
15418{
15419static struct timespec x; x.tv_sec = x.tv_nsec;
15420 ;
15421 return 0;
15422}
6ec2e0f5 15423_ACEOF
c0c3707f
CB
15424if ac_fn_c_try_compile "$LINENO"; then :
15425 gl_cv_sys_struct_timespec_in_time_h=yes
15426else
15427 gl_cv_sys_struct_timespec_in_time_h=no
6ec2e0f5 15428fi
c0c3707f
CB
15429rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15430fi
15431{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
15432$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
6ec2e0f5 15433
c0c3707f
CB
15434 TIME_H_DEFINES_STRUCT_TIMESPEC=0
15435 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
15436 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
15437 UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
15438 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
15439 TIME_H_DEFINES_STRUCT_TIMESPEC=1
6ec2e0f5 15440 else
c0c3707f
CB
15441 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
15442$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
15443if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
15444 $as_echo_n "(cached) " >&6
15445else
15446 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15447/* end confdefs.h. */
15448#include <sys/time.h>
472fa5ee 15449
c0c3707f
CB
15450int
15451main ()
15452{
15453static struct timespec x; x.tv_sec = x.tv_nsec;
15454 ;
15455 return 0;
15456}
15457_ACEOF
15458if ac_fn_c_try_compile "$LINENO"; then :
15459 gl_cv_sys_struct_timespec_in_sys_time_h=yes
15460else
15461 gl_cv_sys_struct_timespec_in_sys_time_h=no
15462fi
15463rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15464fi
15465{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
15466$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
15467 if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
15468 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
15469 else
15470 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
15471$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
15472if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
15473 $as_echo_n "(cached) " >&6
15474else
15475 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15476/* end confdefs.h. */
15477#include <pthread.h>
472fa5ee 15478
c0c3707f
CB
15479int
15480main ()
15481{
15482static struct timespec x; x.tv_sec = x.tv_nsec;
15483 ;
15484 return 0;
15485}
15486_ACEOF
15487if ac_fn_c_try_compile "$LINENO"; then :
15488 gl_cv_sys_struct_timespec_in_pthread_h=yes
15489else
15490 gl_cv_sys_struct_timespec_in_pthread_h=no
15491fi
15492rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15493fi
15494{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
15495$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
15496 if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
15497 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
15498 else
15499 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
15500$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; }
15501if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then :
15502 $as_echo_n "(cached) " >&6
15503else
15504 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15505/* end confdefs.h. */
15506#include <unistd.h>
6ec2e0f5 15507
c0c3707f
CB
15508int
15509main ()
15510{
15511static struct timespec x; x.tv_sec = x.tv_nsec;
15512 ;
15513 return 0;
15514}
15515_ACEOF
15516if ac_fn_c_try_compile "$LINENO"; then :
15517 gl_cv_sys_struct_timespec_in_unistd_h=yes
15518else
15519 gl_cv_sys_struct_timespec_in_unistd_h=no
15520fi
15521rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15522fi
15523{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
15524$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
15525 if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
15526 UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
15527 fi
6ec2e0f5
SDJ
15528 fi
15529 fi
c0c3707f 15530 fi
6ec2e0f5
SDJ
15531
15532
15533
15534
15535
15536
6ec2e0f5 15537
6ec2e0f5
SDJ
15538
15539
15540
15541
15542
6ec2e0f5
SDJ
15543
15544
15545
15546
c0c3707f
CB
15547 if test $gl_cv_have_include_next = yes; then
15548 gl_cv_next_time_h='<'time.h'>'
15549 else
15550 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
15551$as_echo_n "checking absolute name of <time.h>... " >&6; }
15552if ${gl_cv_next_time_h+:} false; then :
15553 $as_echo_n "(cached) " >&6
15554else
6ec2e0f5 15555
6ec2e0f5
SDJ
15556
15557
c0c3707f
CB
15558 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15559/* end confdefs.h. */
15560#include <time.h>
15561_ACEOF
15562 case "$host_os" in
15563 aix*) gl_absname_cpp="$ac_cpp -C" ;;
15564 *) gl_absname_cpp="$ac_cpp" ;;
15565 esac
6ec2e0f5 15566
c0c3707f
CB
15567 case "$host_os" in
15568 mingw*)
15569 gl_dirsep_regex='[/\\]'
15570 ;;
15571 *)
15572 gl_dirsep_regex='\/'
15573 ;;
15574 esac
15575 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
15576 gl_header_literal_regex=`echo 'time.h' \
15577 | sed -e "$gl_make_literal_regex_sed"`
15578 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
15579 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
15580 s|^/[^/]|//&|
15581 p
15582 q
15583 }'
6ec2e0f5 15584
c0c3707f
CB
15585 gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
15586 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 15587
c0c3707f
CB
15588 gl_header=$gl_cv_absolute_time_h
15589 gl_cv_next_time_h='"'$gl_header'"'
6ec2e0f5 15590
6ec2e0f5
SDJ
15591
15592fi
c0c3707f
CB
15593{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
15594$as_echo "$gl_cv_next_time_h" >&6; }
15595 fi
15596 NEXT_TIME_H=$gl_cv_next_time_h
6ec2e0f5 15597
c0c3707f
CB
15598 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
15599 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
15600 gl_next_as_first_directive='<'time.h'>'
15601 else
15602 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
15603 gl_next_as_first_directive=$gl_cv_next_time_h
15604 fi
15605 NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
6ec2e0f5 15606
472fa5ee
SM
15607
15608
15609
15610
15611
6ec2e0f5 15612
6ec2e0f5 15613
6ec2e0f5 15614
6ec2e0f5 15615
c0c3707f
CB
15616ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
15617if test "x$ac_cv_have_decl_unsetenv" = xyes; then :
15618 ac_have_decl=1
15619else
15620 ac_have_decl=0
15621fi
6ec2e0f5 15622
c0c3707f
CB
15623cat >>confdefs.h <<_ACEOF
15624#define HAVE_DECL_UNSETENV $ac_have_decl
15625_ACEOF
6ec2e0f5
SDJ
15626
15627
c0c3707f
CB
15628 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
15629$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
15630if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
15631 $as_echo_n "(cached) " >&6
15632else
15633 gl_cv_header_wchar_h_correct_inline=yes
15634 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15635/* end confdefs.h. */
6ec2e0f5 15636
c0c3707f
CB
15637 #define wcstod renamed_wcstod
15638/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
15639 <wchar.h>.
15640 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
15641 included before <wchar.h>. */
15642#include <stddef.h>
15643#include <stdio.h>
15644#include <time.h>
15645#include <wchar.h>
15646extern int zero (void);
15647int main () { return zero(); }
6ec2e0f5 15648
c0c3707f
CB
15649_ACEOF
15650 save_ac_compile="$ac_compile"
15651 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
15652 if echo '#include "conftest.c"' >conftest1.c &&
15653 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
15654 (eval $ac_compile) 2>&5
15655 ac_status=$?
15656 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15657 test $ac_status = 0; }; then
15658 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15659/* end confdefs.h. */
6ec2e0f5 15660
c0c3707f
CB
15661 #define wcstod renamed_wcstod
15662/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
15663 <wchar.h>.
15664 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
15665 included before <wchar.h>. */
15666#include <stddef.h>
15667#include <stdio.h>
15668#include <time.h>
15669#include <wchar.h>
15670int zero (void) { return 0; }
6ec2e0f5 15671
c0c3707f
CB
15672_ACEOF
15673 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
15674 if echo '#include "conftest.c"' >conftest2.c &&
15675 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
15676 (eval $ac_compile) 2>&5
15677 ac_status=$?
15678 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15679 test $ac_status = 0; }; then
15680 if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
15681 :
15682 else
15683 gl_cv_header_wchar_h_correct_inline=no
15684 fi
15685 fi
15686 fi
15687 ac_compile="$save_ac_compile"
15688 rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext
6ec2e0f5 15689
c0c3707f
CB
15690fi
15691{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
15692$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
15693 if test $gl_cv_header_wchar_h_correct_inline = no; then
15694 as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
15695This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
15696C99 mode. You have four options:
15697 - Add the flag -fgnu89-inline to CC and reconfigure, or
15698 - Fix your include files, using parts of
15699 <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
15700 - Use a gcc version older than 4.3, or
15701 - Don't use the flags -std=c99 or -std=gnu99.
15702Configuration aborted." "$LINENO" 5
6ec2e0f5
SDJ
15703 fi
15704
15705
15706
15707
15708
c0c3707f
CB
15709 if test $ac_cv_header_crtdefs_h = yes; then
15710 HAVE_CRTDEFS_H=1
15711 else
15712 HAVE_CRTDEFS_H=0
5e8754f9 15713 fi
5e8754f9 15714
5e8754f9 15715
5e8754f9 15716
c0c3707f
CB
15717 GNULIB_ISWBLANK=0;
15718 GNULIB_WCTYPE=0;
15719 GNULIB_ISWCTYPE=0;
15720 GNULIB_WCTRANS=0;
15721 GNULIB_TOWCTRANS=0;
15722 HAVE_ISWBLANK=1;
15723 HAVE_WCTYPE_T=1;
15724 HAVE_WCTRANS_T=1;
15725 REPLACE_ISWBLANK=0;
5e8754f9 15726
5e8754f9 15727
5e8754f9 15728
5e8754f9 15729
c0c3707f
CB
15730 if false; then
15731 GL_COND_LIBTOOL_TRUE=
15732 GL_COND_LIBTOOL_FALSE='#'
15733else
15734 GL_COND_LIBTOOL_TRUE='#'
15735 GL_COND_LIBTOOL_FALSE=
15736fi
5e8754f9 15737
c0c3707f
CB
15738 gl_cond_libtool=false
15739 gl_libdeps=
15740 gl_ltlibdeps=
15741 gl_m4_base='import/m4'
5e8754f9 15742
5e8754f9
SDJ
15743
15744
6ec2e0f5 15745
6ec2e0f5 15746
6ec2e0f5 15747
6ec2e0f5 15748
6ec2e0f5 15749
6ec2e0f5 15750
c0c3707f
CB
15751 gl_source_base='import'
15752
6ec2e0f5 15753
c0c3707f
CB
15754 if test $ac_cv_func_alloca_works = no; then
15755 :
15756 fi
6ec2e0f5 15757
c0c3707f
CB
15758 # Define an additional variable used in the Makefile substitution.
15759 if test $ac_cv_working_alloca_h = yes; then
15760 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
15761$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
15762if ${gl_cv_rpl_alloca+:} false; then :
6ec2e0f5
SDJ
15763 $as_echo_n "(cached) " >&6
15764else
c0c3707f
CB
15765
15766 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
15767/* end confdefs.h. */
15768
c0c3707f
CB
15769#if defined __GNUC__ || defined _AIX || defined _MSC_VER
15770 Need own alloca
15771#endif
6ec2e0f5 15772
6ec2e0f5 15773_ACEOF
c0c3707f
CB
15774if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15775 $EGREP "Need own alloca" >/dev/null 2>&1; then :
15776 gl_cv_rpl_alloca=yes
6ec2e0f5 15777else
c0c3707f 15778 gl_cv_rpl_alloca=no
6ec2e0f5 15779fi
c0c3707f 15780rm -f conftest*
6ec2e0f5
SDJ
15781
15782
15783fi
c0c3707f
CB
15784{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
15785$as_echo "$gl_cv_rpl_alloca" >&6; }
15786 if test $gl_cv_rpl_alloca = yes; then
6ec2e0f5 15787
c0c3707f 15788$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
6ec2e0f5 15789
c0c3707f
CB
15790 ALLOCA_H=alloca.h
15791 else
15792 ALLOCA_H=
15793 fi
15794 else
15795 ALLOCA_H=alloca.h
15796 fi
6ec2e0f5 15797
c0c3707f
CB
15798 if test -n "$ALLOCA_H"; then
15799 GL_GENERATE_ALLOCA_H_TRUE=
15800 GL_GENERATE_ALLOCA_H_FALSE='#'
15801else
15802 GL_GENERATE_ALLOCA_H_TRUE='#'
15803 GL_GENERATE_ALLOCA_H_FALSE=
15804fi
6ec2e0f5
SDJ
15805
15806
c0c3707f
CB
15807 if test $ac_cv_working_alloca_h = yes; then
15808 HAVE_ALLOCA_H=1
15809 else
15810 HAVE_ALLOCA_H=0
15811 fi
6ec2e0f5
SDJ
15812
15813
15814
15815
15816
15817
c0c3707f
CB
15818 if test $ac_cv_header_arpa_inet_h = yes; then
15819 HAVE_ARPA_INET_H=1
15820 else
15821 HAVE_ARPA_INET_H=0
15822 fi
6ec2e0f5
SDJ
15823
15824
472fa5ee
SM
15825
15826
15827
15828
15829
6ec2e0f5
SDJ
15830
15831
15832
15833 if test $gl_cv_have_include_next = yes; then
c0c3707f 15834 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5 15835 else
c0c3707f
CB
15836 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
15837$as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; }
15838if ${gl_cv_next_arpa_inet_h+:} false; then :
6ec2e0f5
SDJ
15839 $as_echo_n "(cached) " >&6
15840else
15841
c0c3707f 15842 if test $ac_cv_header_arpa_inet_h = yes; then
6ec2e0f5
SDJ
15843
15844
15845
15846
15847 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15848/* end confdefs.h. */
c0c3707f 15849#include <arpa/inet.h>
6ec2e0f5
SDJ
15850_ACEOF
15851 case "$host_os" in
15852 aix*) gl_absname_cpp="$ac_cpp -C" ;;
15853 *) gl_absname_cpp="$ac_cpp" ;;
15854 esac
15855
15856 case "$host_os" in
15857 mingw*)
15858 gl_dirsep_regex='[/\\]'
15859 ;;
15860 *)
15861 gl_dirsep_regex='\/'
15862 ;;
15863 esac
15864 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 15865 gl_header_literal_regex=`echo 'arpa/inet.h' \
6ec2e0f5
SDJ
15866 | sed -e "$gl_make_literal_regex_sed"`
15867 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
15868 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
15869 s|^/[^/]|//&|
15870 p
15871 q
15872 }'
15873
c0c3707f 15874 gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5
SDJ
15875 sed -n "$gl_absolute_header_sed"`
15876
c0c3707f
CB
15877 gl_header=$gl_cv_absolute_arpa_inet_h
15878 gl_cv_next_arpa_inet_h='"'$gl_header'"'
6ec2e0f5 15879 else
c0c3707f 15880 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5
SDJ
15881 fi
15882
c0c3707f 15883
6ec2e0f5 15884fi
c0c3707f
CB
15885{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
15886$as_echo "$gl_cv_next_arpa_inet_h" >&6; }
15887 fi
15888 NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
6ec2e0f5 15889
c0c3707f
CB
15890 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
15891 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
15892 gl_next_as_first_directive='<'arpa/inet.h'>'
15893 else
15894 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
15895 gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
15896 fi
15897 NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
15898
15899
6ec2e0f5 15900
6ec2e0f5 15901
6ec2e0f5
SDJ
15902
15903
6ec2e0f5
SDJ
15904
15905
15906
c0c3707f
CB
15907 if test $ac_cv_header_sys_socket_h = yes; then
15908 HAVE_WS2TCPIP_H=0
15909 else
15910 if test $ac_cv_header_ws2tcpip_h = yes; then
15911 HAVE_WS2TCPIP_H=1
15912 else
15913 HAVE_WS2TCPIP_H=0
15914 fi
15915 fi
15916
15917
6ec2e0f5
SDJ
15918
15919
6ec2e0f5
SDJ
15920
15921
15922
15923
15924
6ec2e0f5
SDJ
15925
15926
15927
15928
15929
15930
15931
c0c3707f 15932 gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext"
6ec2e0f5
SDJ
15933
15934
c0c3707f
CB
15935 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
15936$as_echo_n "checking for __builtin_expect... " >&6; }
15937if ${gl_cv___builtin_expect+:} false; then :
6ec2e0f5
SDJ
15938 $as_echo_n "(cached) " >&6
15939else
c0c3707f
CB
15940 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15941/* end confdefs.h. */
15942
15943 int
15944 main (int argc, char **argv)
15945 {
15946 argc = __builtin_expect (argc, 100);
15947 return argv[argc != 100][0];
15948 }
15949_ACEOF
15950if ac_fn_c_try_link "$LINENO"; then :
15951 gl_cv___builtin_expect=yes
15952else
15953 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15954/* end confdefs.h. */
15955
15956 #include <builtins.h>
15957 int
15958 main (int argc, char **argv)
15959 {
15960 argc = __builtin_expect (argc, 100);
15961 return argv[argc != 100][0];
15962 }
15963_ACEOF
15964if ac_fn_c_try_link "$LINENO"; then :
15965 gl_cv___builtin_expect="in <builtins.h>"
15966else
15967 gl_cv___builtin_expect=no
6ec2e0f5 15968fi
c0c3707f
CB
15969rm -f core conftest.err conftest.$ac_objext \
15970 conftest$ac_exeext conftest.$ac_ext
15971fi
15972rm -f core conftest.err conftest.$ac_objext \
15973 conftest$ac_exeext conftest.$ac_ext
15974fi
15975{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
15976$as_echo "$gl_cv___builtin_expect" >&6; }
15977 if test "$gl_cv___builtin_expect" = yes; then
15978 $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
8690e634 15979
c0c3707f
CB
15980 elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
15981 $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
8690e634 15982
6ec2e0f5 15983 fi
8690e634
JK
15984
15985
15986
15987
c0c3707f
CB
15988
15989 if test $ac_cv_func_canonicalize_file_name = no; then
15990 HAVE_CANONICALIZE_FILE_NAME=0
15991 if test $ac_cv_func_realpath = no; then
15992 HAVE_REALPATH=0
15993 else
15994 case "$gl_cv_func_realpath_works" in
15995 *yes) ;;
15996 *) REPLACE_REALPATH=1 ;;
15997 esac
15998 fi
15999 else
16000 case "$gl_cv_func_realpath_works" in
16001 *yes)
16002 ;;
16003 *)
16004 REPLACE_CANONICALIZE_FILE_NAME=1
16005 REPLACE_REALPATH=1
16006 ;;
16007 esac
5e8754f9 16008 fi
8690e634 16009
c0c3707f 16010 if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
8690e634
JK
16011
16012
16013
472fa5ee
SM
16014
16015
16016
16017
16018
c0c3707f
CB
16019 gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext"
16020
6ec2e0f5 16021 fi
8690e634
JK
16022
16023
c0c3707f
CB
16024cat >>confdefs.h <<_ACEOF
16025#define GNULIB_CANONICALIZE_LGPL 1
16026_ACEOF
8690e634 16027
8690e634 16028
8690e634 16029
8690e634 16030
8690e634 16031
8690e634 16032
8690e634 16033
c0c3707f 16034 GNULIB_CANONICALIZE_FILE_NAME=1
8690e634 16035
8690e634 16036
8690e634 16037
6ec2e0f5
SDJ
16038
16039
c0c3707f 16040$as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
6ec2e0f5 16041
6ec2e0f5 16042
8690e634
JK
16043
16044
8690e634
JK
16045
16046
16047
16048
c0c3707f 16049 GNULIB_REALPATH=1
6ec2e0f5
SDJ
16050
16051
16052
16053
6ec2e0f5 16054
c0c3707f 16055$as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
6ec2e0f5
SDJ
16056
16057
16058
16059
16060
16061
16062
6ec2e0f5 16063
c0c3707f 16064 GNULIB_CHDIR=1
6ec2e0f5 16065
8690e634 16066
8690e634 16067
6ec2e0f5 16068
6ec2e0f5 16069
c0c3707f
CB
16070$as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
16071
16072
16073
16074
16075
16076 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system has an arbitrary file name length limit" >&5
16077$as_echo_n "checking whether this system has an arbitrary file name length limit... " >&6; }
16078if ${gl_cv_have_arbitrary_file_name_length_limit+:} false; then :
16079 $as_echo_n "(cached) " >&6
8690e634 16080else
c0c3707f
CB
16081 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16082/* end confdefs.h. */
8690e634 16083
c0c3707f
CB
16084/* Arrange to define PATH_MAX, like "pathmax.h" does. */
16085#if HAVE_UNISTD_H
16086# include <unistd.h>
16087#endif
16088#include <limits.h>
16089#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
16090# include <sys/param.h>
16091#endif
16092#if !defined PATH_MAX && defined MAXPATHLEN
16093# define PATH_MAX MAXPATHLEN
16094#endif
16095#ifdef __hpux
16096# undef PATH_MAX
16097# define PATH_MAX 1024
16098#endif
16099#if defined _WIN32 && ! defined __CYGWIN__
16100# undef PATH_MAX
16101# define PATH_MAX 260
16102#endif
6ec2e0f5 16103
c0c3707f
CB
16104#ifdef PATH_MAX
16105have_arbitrary_file_name_length_limit
16106#endif
6ec2e0f5 16107_ACEOF
c0c3707f
CB
16108if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16109 $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then :
16110 gl_cv_have_arbitrary_file_name_length_limit=yes
16111else
16112 gl_cv_have_arbitrary_file_name_length_limit=no
16113fi
16114rm -f conftest*
6ec2e0f5
SDJ
16115
16116fi
c0c3707f
CB
16117{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5
16118$as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; }
6ec2e0f5 16119
c0c3707f 16120 if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then
6ec2e0f5
SDJ
16121
16122
16123
16124
472fa5ee
SM
16125
16126
16127
16128
c0c3707f 16129 gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext"
472fa5ee 16130
c0c3707f 16131 :
8690e634
JK
16132 fi
16133
8690e634 16134
c0c3707f 16135$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
8690e634
JK
16136
16137
16138
16139
16140
8690e634 16141
c0c3707f
CB
16142 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
16143 REPLACE_CLOSE=1
16144 fi
8690e634 16145
6ec2e0f5
SDJ
16146
16147
6ec2e0f5
SDJ
16148
16149
8690e634 16150
c0c3707f
CB
16151 if test $ac_cv_header_sys_socket_h != yes; then
16152 for ac_header in winsock2.h
16153do :
16154 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
16155if test "x$ac_cv_header_winsock2_h" = xyes; then :
16156 cat >>confdefs.h <<_ACEOF
16157#define HAVE_WINSOCK2_H 1
16158_ACEOF
8690e634 16159
c0c3707f 16160fi
8690e634 16161
c0c3707f 16162done
8690e634 16163
c0c3707f
CB
16164 fi
16165 if test "$ac_cv_header_winsock2_h" = yes; then
16166 HAVE_WINSOCK2_H=1
16167 UNISTD_H_HAVE_WINSOCK2_H=1
16168 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
16169 else
16170 HAVE_WINSOCK2_H=0
16171 fi
8690e634 16172
6ec2e0f5 16173
c0c3707f
CB
16174 if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
16175 REPLACE_CLOSE=1
16176 fi
6ec2e0f5
SDJ
16177
16178
c0c3707f 16179 if test $REPLACE_CLOSE = 0; then
6ec2e0f5
SDJ
16180
16181
6ec2e0f5 16182
c0c3707f
CB
16183 if test $ac_cv_func_fchdir = no; then
16184 HAVE_FCHDIR=0
16185 fi
6ec2e0f5 16186
c0c3707f
CB
16187 if test $HAVE_FCHDIR = 0; then
16188 REPLACE_CLOSE=1
16189 fi
16190 fi
6ec2e0f5
SDJ
16191
16192
c0c3707f 16193 if test $REPLACE_CLOSE = 1; then
6ec2e0f5
SDJ
16194
16195
16196
16197
16198
6ec2e0f5
SDJ
16199
16200
16201
c0c3707f 16202 gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
6ec2e0f5 16203
c0c3707f 16204 fi
6ec2e0f5 16205
6ec2e0f5
SDJ
16206
16207
16208
16209
c0c3707f 16210 GNULIB_CLOSE=1
6ec2e0f5 16211
6ec2e0f5 16212
6ec2e0f5
SDJ
16213
16214
16215
c0c3707f 16216$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
6ec2e0f5
SDJ
16217
16218
16219
16220
16221
c0c3707f
CB
16222
16223 for ac_func in closedir
16224do :
16225 ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
16226if test "x$ac_cv_func_closedir" = xyes; then :
16227 cat >>confdefs.h <<_ACEOF
16228#define HAVE_CLOSEDIR 1
16229_ACEOF
16230
16231fi
16232done
16233
16234 if test $ac_cv_func_closedir = no; then
16235 HAVE_CLOSEDIR=0
16236 fi
6ec2e0f5 16237
8690e634
JK
16238
16239
8690e634 16240
c0c3707f
CB
16241 if test $ac_cv_func_fchdir = no; then
16242 HAVE_FCHDIR=0
6ec2e0f5 16243 fi
6a29c58e 16244
c0c3707f
CB
16245 if test $HAVE_FCHDIR = 0; then
16246 if test $HAVE_CLOSEDIR = 1; then
16247 REPLACE_CLOSEDIR=1
16248 fi
16249 fi
6a29c58e 16250
c0c3707f
CB
16251 case $host_os,$HAVE_CLOSEDIR in
16252 os2*,1)
16253 REPLACE_CLOSEDIR=1;;
16254 esac
d0ac1c44 16255
c0c3707f 16256 if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
d0ac1c44
SM
16257
16258
d0ac1c44
SM
16259
16260
6a29c58e
YQ
16261
16262
3d99e817 16263
6ec2e0f5 16264
c0c3707f 16265 gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext"
6ec2e0f5 16266
6ec2e0f5
SDJ
16267 fi
16268
16269
6ec2e0f5
SDJ
16270
16271
3d99e817 16272
c0c3707f 16273 GNULIB_CLOSEDIR=1
3d99e817
AK
16274
16275
16276
16277
16278
c0c3707f 16279$as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
3d99e817
AK
16280
16281
16282
5f661e03
SM
16283
16284
16285
c0c3707f
CB
16286 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
16287$as_echo_n "checking for d_ino member in directory struct... " >&6; }
16288if ${gl_cv_struct_dirent_d_ino+:} false; then :
6ec2e0f5
SDJ
16289 $as_echo_n "(cached) " >&6
16290else
16291 if test "$cross_compiling" = yes; then :
16292 case "$host_os" in
c0c3707f
CB
16293 # Guess yes on glibc systems with Linux kernel.
16294 linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
16295 # Guess yes on musl systems with Linux kernel.
16296 linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
16297 # Guess no on native Windows.
16298 mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
16299 # If we don't know, obey --enable-cross-guesses.
16300 *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
16301 esac
3d99e817 16302
6ec2e0f5
SDJ
16303else
16304 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16305/* end confdefs.h. */
c0c3707f
CB
16306#include <sys/types.h>
16307 #include <sys/stat.h>
16308 #include <dirent.h>
3d99e817 16309
6ec2e0f5
SDJ
16310int
16311main ()
16312{
c0c3707f
CB
16313DIR *dp = opendir (".");
16314 struct dirent *e;
16315 struct stat st;
16316 if (! dp)
16317 return 1;
16318 e = readdir (dp);
16319 if (! e)
16320 { closedir (dp); return 2; }
16321 if (lstat (e->d_name, &st) != 0)
16322 { closedir (dp); return 3; }
16323 if (e->d_ino != st.st_ino)
16324 { closedir (dp); return 4; }
16325 closedir (dp);
16326 return 0;
16327
6ec2e0f5
SDJ
16328 ;
16329 return 0;
16330}
3d99e817 16331_ACEOF
6ec2e0f5 16332if ac_fn_c_try_run "$LINENO"; then :
c0c3707f
CB
16333 gl_cv_struct_dirent_d_ino=yes
16334else
16335 gl_cv_struct_dirent_d_ino=no
16336fi
16337rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16338 conftest.$ac_objext conftest.beam conftest.$ac_ext
16339fi
16340
16341fi
16342{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
16343$as_echo "$gl_cv_struct_dirent_d_ino" >&6; }
16344 case "$gl_cv_struct_dirent_d_ino" in
16345 *yes)
16346
16347$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
16348
16349 ;;
16350 esac
16351
16352
16353 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5
16354$as_echo_n "checking for d_type member in directory struct... " >&6; }
16355if ${gl_cv_struct_dirent_d_type+:} false; then :
16356 $as_echo_n "(cached) " >&6
16357else
16358 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16359/* end confdefs.h. */
16360
16361#include <sys/types.h>
16362#include <dirent.h>
16363
16364int
16365main ()
16366{
16367struct dirent dp; dp.d_type = 0;
16368 ;
16369 return 0;
16370}
16371_ACEOF
16372if ac_fn_c_try_link "$LINENO"; then :
16373 gl_cv_struct_dirent_d_type=yes
6ec2e0f5 16374else
c0c3707f 16375 gl_cv_struct_dirent_d_type=no
3d99e817 16376fi
c0c3707f
CB
16377rm -f core conftest.err conftest.$ac_objext \
16378 conftest$ac_exeext conftest.$ac_ext
3d99e817 16379
3d99e817 16380
c0c3707f
CB
16381fi
16382{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5
16383$as_echo "$gl_cv_struct_dirent_d_type" >&6; }
16384 if test $gl_cv_struct_dirent_d_type = yes; then
3d99e817 16385
c0c3707f 16386$as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h
3d99e817 16387
c0c3707f 16388 fi
3d99e817 16389
0750520d 16390
0750520d 16391
0750520d 16392
0750520d
PA
16393
16394
0750520d 16395
0750520d 16396
0750520d 16397
0750520d 16398
0750520d 16399
0750520d 16400
0750520d 16401
0750520d 16402
c0c3707f
CB
16403 if test $gl_cv_have_include_next = yes; then
16404 gl_cv_next_dirent_h='<'dirent.h'>'
16405 else
16406 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
16407$as_echo_n "checking absolute name of <dirent.h>... " >&6; }
16408if ${gl_cv_next_dirent_h+:} false; then :
16409 $as_echo_n "(cached) " >&6
16410else
0750520d 16411
c0c3707f 16412 if test $ac_cv_header_dirent_h = yes; then
6ec2e0f5 16413
472fa5ee
SM
16414
16415
16416
c0c3707f
CB
16417 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16418/* end confdefs.h. */
16419#include <dirent.h>
16420_ACEOF
16421 case "$host_os" in
16422 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16423 *) gl_absname_cpp="$ac_cpp" ;;
16424 esac
472fa5ee 16425
c0c3707f
CB
16426 case "$host_os" in
16427 mingw*)
16428 gl_dirsep_regex='[/\\]'
16429 ;;
16430 *)
16431 gl_dirsep_regex='\/'
16432 ;;
16433 esac
16434 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
16435 gl_header_literal_regex=`echo 'dirent.h' \
16436 | sed -e "$gl_make_literal_regex_sed"`
16437 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16438 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16439 s|^/[^/]|//&|
16440 p
16441 q
16442 }'
472fa5ee 16443
c0c3707f
CB
16444 gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
16445 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16446
c0c3707f
CB
16447 gl_header=$gl_cv_absolute_dirent_h
16448 gl_cv_next_dirent_h='"'$gl_header'"'
16449 else
16450 gl_cv_next_dirent_h='<'dirent.h'>'
16451 fi
6ec2e0f5
SDJ
16452
16453
c0c3707f
CB
16454fi
16455{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
16456$as_echo "$gl_cv_next_dirent_h" >&6; }
16457 fi
16458 NEXT_DIRENT_H=$gl_cv_next_dirent_h
472fa5ee 16459
c0c3707f
CB
16460 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16461 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
16462 gl_next_as_first_directive='<'dirent.h'>'
16463 else
16464 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
16465 gl_next_as_first_directive=$gl_cv_next_dirent_h
16466 fi
16467 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
472fa5ee
SM
16468
16469
16470
16471
c0c3707f
CB
16472 if test $ac_cv_header_dirent_h = yes; then
16473 HAVE_DIRENT_H=1
6ec2e0f5 16474 else
c0c3707f 16475 HAVE_DIRENT_H=0
6ec2e0f5
SDJ
16476 fi
16477
6ec2e0f5 16478
0750520d 16479
0750520d 16480
0750520d 16481
472fa5ee
SM
16482
16483
16484
16485
16486
0750520d 16487
c0c3707f
CB
16488 for ac_func in dirfd
16489do :
16490 ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
16491if test "x$ac_cv_func_dirfd" = xyes; then :
16492 cat >>confdefs.h <<_ACEOF
16493#define HAVE_DIRFD 1
16494_ACEOF
0750520d 16495
c0c3707f
CB
16496fi
16497done
0750520d 16498
c0c3707f
CB
16499 ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
16500 #include <dirent.h>
16501"
16502if test "x$ac_cv_have_decl_dirfd" = xyes; then :
16503 ac_have_decl=1
8690e634 16504else
c0c3707f
CB
16505 ac_have_decl=0
16506fi
8690e634 16507
c0c3707f
CB
16508cat >>confdefs.h <<_ACEOF
16509#define HAVE_DECL_DIRFD $ac_have_decl
16510_ACEOF
49e4877c 16511
c0c3707f
CB
16512 if test $ac_cv_have_decl_dirfd = no; then
16513 HAVE_DECL_DIRFD=0
16514 fi
8690e634 16515
c0c3707f
CB
16516 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
16517$as_echo_n "checking whether dirfd is a macro... " >&6; }
16518if ${gl_cv_func_dirfd_macro+:} false; then :
16519 $as_echo_n "(cached) " >&6
16520else
6ec2e0f5
SDJ
16521 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16522/* end confdefs.h. */
8690e634 16523
c0c3707f
CB
16524#include <sys/types.h>
16525#include <dirent.h>
16526#ifdef dirfd
16527 dirent_header_defines_dirfd
6ec2e0f5 16528#endif
8690e634 16529_ACEOF
c0c3707f
CB
16530if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16531 $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then :
16532 gl_cv_func_dirfd_macro=yes
6ec2e0f5 16533else
c0c3707f 16534 gl_cv_func_dirfd_macro=no
6ec2e0f5 16535fi
c0c3707f 16536rm -f conftest*
472fa5ee 16537
c0c3707f
CB
16538fi
16539{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
16540$as_echo "$gl_cv_func_dirfd_macro" >&6; }
472fa5ee 16541
c0c3707f
CB
16542 # Use the replacement if we have no function or macro with that name,
16543 # or if OS/2 kLIBC whose dirfd() does not work.
16544 # Replace only if the system declares dirfd already.
16545 case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
16546 no,no,*,yes | *,*,os2*,yes)
16547 REPLACE_DIRFD=1
472fa5ee 16548
c0c3707f
CB
16549$as_echo "#define REPLACE_DIRFD 1" >>confdefs.h
16550;;
16551 esac
472fa5ee 16552
c0c3707f
CB
16553 if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
16554 || test $REPLACE_DIRFD = 1; then
6ec2e0f5 16555
6ec2e0f5
SDJ
16556
16557
16558
16559
472fa5ee
SM
16560
16561
16562
c0c3707f 16563 gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext"
472fa5ee
SM
16564
16565
c0c3707f
CB
16566 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
16567$as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; }
16568if ${gl_cv_sys_dir_fd_member_name+:} false; then :
16569 $as_echo_n "(cached) " >&6
16570else
6ec2e0f5 16571
c0c3707f
CB
16572 dirfd_save_CFLAGS=$CFLAGS
16573 for ac_expr in d_fd dd_fd; do
6ec2e0f5 16574
c0c3707f
CB
16575 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
16576 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16577/* end confdefs.h. */
6ec2e0f5 16578
c0c3707f
CB
16579 #include <sys/types.h>
16580 #include <dirent.h>
16581int
16582main ()
16583{
16584DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;
16585 ;
16586 return 0;
16587}
16588_ACEOF
16589if ac_fn_c_try_compile "$LINENO"; then :
16590 dir_fd_found=yes
6ec2e0f5 16591
c0c3707f
CB
16592fi
16593rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16594 CFLAGS=$dirfd_save_CFLAGS
16595 test "$dir_fd_found" = yes && break
16596 done
16597 test "$dir_fd_found" = yes || ac_expr=no_such_member
472fa5ee 16598
c0c3707f 16599 gl_cv_sys_dir_fd_member_name=$ac_expr
472fa5ee
SM
16600
16601
c0c3707f
CB
16602fi
16603{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
16604$as_echo "$gl_cv_sys_dir_fd_member_name" >&6; }
16605 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
472fa5ee 16606
c0c3707f
CB
16607cat >>confdefs.h <<_ACEOF
16608#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name
16609_ACEOF
472fa5ee 16610
6ec2e0f5
SDJ
16611 fi
16612
6ec2e0f5 16613
c0c3707f 16614 fi
6ec2e0f5
SDJ
16615
16616
16617
16618
16619
c0c3707f 16620 GNULIB_DIRFD=1
6ec2e0f5
SDJ
16621
16622
16623
6ec2e0f5 16624
8690e634 16625
c0c3707f 16626$as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
8690e634
JK
16627
16628
8690e634
JK
16629
16630
16631
8690e634
JK
16632
16633
8690e634 16634
8690e634 16635
c0c3707f
CB
16636 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
16637$as_echo_n "checking whether // is distinct from /... " >&6; }
16638if ${gl_cv_double_slash_root+:} false; then :
16639 $as_echo_n "(cached) " >&6
16640else
16641 if test x"$cross_compiling" = xyes ; then
16642 # When cross-compiling, there is no way to tell whether // is special
16643 # short of a list of hosts. However, the only known hosts to date
16644 # that have a distinct // are Apollo DomainOS (too old to port to),
16645 # Cygwin, and z/OS. If anyone knows of another system for which // has
16646 # special semantics and is distinct from /, please report it to
16647 # <bug-gnulib@gnu.org>.
16648 case $host in
16649 *-cygwin | i370-ibm-openedition)
16650 gl_cv_double_slash_root=yes ;;
16651 *)
16652 # Be optimistic and assume that / and // are the same when we
16653 # don't know.
16654 gl_cv_double_slash_root='unknown, assuming no' ;;
16655 esac
16656 else
16657 set x `ls -di / // 2>/dev/null`
16658 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
16659 gl_cv_double_slash_root=no
16660 else
16661 gl_cv_double_slash_root=yes
16662 fi
16663 fi
16664fi
16665{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
16666$as_echo "$gl_cv_double_slash_root" >&6; }
16667 if test "$gl_cv_double_slash_root" = yes; then
6ec2e0f5 16668
c0c3707f 16669$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
8690e634 16670
c0c3707f 16671 fi
8690e634 16672
63ce7108
TT
16673
16674
16675
16676
c0c3707f
CB
16677 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
16678 REPLACE_DUP=1
16679 fi
8690e634
JK
16680
16681
16682
16683
16684
c0c3707f
CB
16685 if test $ac_cv_func_fchdir = no; then
16686 HAVE_FCHDIR=0
16687 fi
8690e634 16688
c0c3707f
CB
16689 if test $HAVE_FCHDIR = 0; then
16690 REPLACE_DUP=1
16691 fi
8690e634 16692
c0c3707f
CB
16693 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5
16694$as_echo_n "checking whether dup works... " >&6; }
16695if ${gl_cv_func_dup_works+:} false; then :
8690e634
JK
16696 $as_echo_n "(cached) " >&6
16697else
c0c3707f
CB
16698 if test "$cross_compiling" = yes; then :
16699 case "$host_os" in
16700 # Guess no on native Windows.
16701 mingw*) gl_cv_func_dup_works="guessing no" ;;
16702 *) gl_cv_func_dup_works="guessing yes" ;;
16703 esac
8690e634 16704
c0c3707f 16705else
4a626d0a 16706 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 16707/* end confdefs.h. */
c0c3707f
CB
16708#include <unistd.h>
16709 #include <fcntl.h>
16710 #include <errno.h>
16711int
16712main ()
16713{
16714/* On OS/2 kLIBC, dup does not work on a directory fd. */
16715 int fd = open (".", O_RDONLY);
16716 return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
8690e634 16717
c0c3707f
CB
16718 ;
16719 return 0;
16720}
8690e634 16721
c0c3707f
CB
16722_ACEOF
16723if ac_fn_c_try_run "$LINENO"; then :
16724 gl_cv_func_dup_works=yes
16725else
16726 gl_cv_func_dup_works=no
16727fi
16728rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16729 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 16730fi
8690e634 16731
8690e634 16732
c0c3707f
CB
16733fi
16734{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5
16735$as_echo "$gl_cv_func_dup_works" >&6; }
16736 case "$gl_cv_func_dup_works" in
16737 *yes) ;;
16738 *)
16739 REPLACE_DUP=1
16740 ;;
16741 esac
8690e634 16742
c0c3707f 16743 if test $REPLACE_DUP = 1; then
8690e634
JK
16744
16745
16746
16747
6ec2e0f5
SDJ
16748
16749
16750
16751
c0c3707f 16752 gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext"
8690e634 16753
c0c3707f
CB
16754 :
16755 fi
8690e634 16756
5e8754f9 16757
8690e634
JK
16758
16759
8839a007 16760
c0c3707f 16761 GNULIB_DUP=1
63ce7108 16762
63ce7108 16763
63ce7108 16764
6ec2e0f5 16765
6ec2e0f5 16766
c0c3707f 16767$as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h
6ec2e0f5 16768
63ce7108
TT
16769
16770
472fa5ee
SM
16771
16772
16773
16774
16775
c0c3707f
CB
16776$as_echo "#define HAVE_DUP2 1" >>confdefs.h
16777
16778
16779 if test $HAVE_DUP2 = 1; then
16780 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
16781$as_echo_n "checking whether dup2 works... " >&6; }
16782if ${gl_cv_func_dup2_works+:} false; then :
6ec2e0f5
SDJ
16783 $as_echo_n "(cached) " >&6
16784else
16785 if test "$cross_compiling" = yes; then :
16786 case "$host_os" in
c0c3707f
CB
16787 mingw*) # on this platform, dup2 always returns 0 for success
16788 gl_cv_func_dup2_works="guessing no" ;;
16789 cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
16790 gl_cv_func_dup2_works="guessing no" ;;
16791 aix* | freebsd*)
16792 # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
16793 # not EBADF.
16794 gl_cv_func_dup2_works="guessing no" ;;
16795 haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
16796 gl_cv_func_dup2_works="guessing no" ;;
16797 *-android*) # implemented using dup3(), which fails if oldfd == newfd
16798 gl_cv_func_dup2_works="guessing no" ;;
16799 os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
16800 gl_cv_func_dup2_works="guessing no" ;;
16801 *) gl_cv_func_dup2_works="guessing yes" ;;
16802 esac
63ce7108
TT
16803else
16804 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16805/* end confdefs.h. */
16806
c0c3707f
CB
16807 #include <errno.h>
16808 #include <fcntl.h>
16809 #include <limits.h>
16810 #include <sys/resource.h>
16811 #include <unistd.h>
16812 #ifndef RLIM_SAVED_CUR
16813 # define RLIM_SAVED_CUR RLIM_INFINITY
16814 #endif
16815 #ifndef RLIM_SAVED_MAX
16816 # define RLIM_SAVED_MAX RLIM_INFINITY
16817 #endif
63ce7108
TT
16818
16819int
16820main ()
16821{
6ec2e0f5 16822int result = 0;
c0c3707f
CB
16823 int bad_fd = INT_MAX;
16824 struct rlimit rlim;
16825 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
16826 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
16827 && rlim.rlim_cur != RLIM_INFINITY
16828 && rlim.rlim_cur != RLIM_SAVED_MAX
16829 && rlim.rlim_cur != RLIM_SAVED_CUR)
16830 bad_fd = rlim.rlim_cur;
16831 #ifdef FD_CLOEXEC
16832 if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
16833 result |= 1;
16834 #endif
16835 if (dup2 (1, 1) != 1)
16836 result |= 2;
16837 #ifdef FD_CLOEXEC
16838 if (fcntl (1, F_GETFD) != FD_CLOEXEC)
16839 result |= 4;
16840 #endif
16841 close (0);
16842 if (dup2 (0, 0) != -1)
16843 result |= 8;
16844 /* Many gnulib modules require POSIX conformance of EBADF. */
16845 if (dup2 (2, bad_fd) == -1 && errno != EBADF)
16846 result |= 16;
16847 /* Flush out some cygwin core dumps. */
16848 if (dup2 (2, -1) != -1 || errno != EBADF)
16849 result |= 32;
16850 dup2 (2, 255);
16851 dup2 (2, 256);
16852 /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
16853 {
16854 int fd = open (".", O_RDONLY);
16855 if (fd == -1)
16856 result |= 64;
16857 else if (dup2 (fd, fd + 1) == -1)
16858 result |= 128;
16859
16860 close (fd);
16861 }
16862 return result;
63ce7108
TT
16863 ;
16864 return 0;
16865}
c0c3707f 16866
63ce7108
TT
16867_ACEOF
16868if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 16869 gl_cv_func_dup2_works=yes
63ce7108 16870else
c0c3707f 16871 gl_cv_func_dup2_works=no
63ce7108
TT
16872fi
16873rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16874 conftest.$ac_objext conftest.beam conftest.$ac_ext
16875fi
16876
c0c3707f 16877
63ce7108 16878fi
c0c3707f
CB
16879{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
16880$as_echo "$gl_cv_func_dup2_works" >&6; }
16881 case "$gl_cv_func_dup2_works" in
63ce7108
TT
16882 *yes) ;;
16883 *)
c0c3707f
CB
16884 REPLACE_DUP2=1
16885 for ac_func in setdtablesize
16886do :
16887 ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
16888if test "x$ac_cv_func_setdtablesize" = xyes; then :
16889 cat >>confdefs.h <<_ACEOF
16890#define HAVE_SETDTABLESIZE 1
16891_ACEOF
16892
16893fi
16894done
16895
63ce7108
TT
16896 ;;
16897 esac
16898 fi
16899
09607c9e
TT
16900
16901
16902
c0c3707f
CB
16903 if test $ac_cv_func_fchdir = no; then
16904 HAVE_FCHDIR=0
16905 fi
4a626d0a 16906
c0c3707f
CB
16907 if test $HAVE_FCHDIR = 0; then
16908 if test $HAVE_DUP2 = 1; then
16909 REPLACE_DUP2=1
16910 fi
16911 fi
4a626d0a
PA
16912
16913
c0c3707f 16914 if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
4a626d0a
PA
16915
16916
16917
16918
16919
16920
4a626d0a 16921
4a626d0a 16922
c0c3707f 16923 gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
4a626d0a
PA
16924
16925
c0c3707f 16926 fi
4a626d0a
PA
16927
16928
16929
16930
16931
c0c3707f 16932 GNULIB_DUP2=1
4a626d0a
PA
16933
16934
16935
16936
09607c9e 16937
c0c3707f 16938$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
09607c9e
TT
16939
16940
472fa5ee
SM
16941
16942
16943
16944
16945
09607c9e 16946
6ec2e0f5 16947
c0c3707f 16948 GNULIB_ENVIRON=1
6ec2e0f5 16949
09607c9e 16950
09607c9e 16951
6ec2e0f5
SDJ
16952
16953
c0c3707f 16954$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
6ec2e0f5
SDJ
16955
16956
6ec2e0f5 16957
5e8754f9 16958
6ec2e0f5 16959
c0c3707f
CB
16960 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
16961$as_echo_n "checking for error_at_line... " >&6; }
16962if ${ac_cv_lib_error_at_line+:} false; then :
09607c9e 16963 $as_echo_n "(cached) " >&6
4a626d0a
PA
16964else
16965 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16966/* end confdefs.h. */
c0c3707f
CB
16967#include <error.h>
16968int
16969main ()
16970{
16971error_at_line (0, 0, "", 0, "an error occurred");
16972 ;
4a626d0a
PA
16973 return 0;
16974}
16975_ACEOF
c0c3707f
CB
16976if ac_fn_c_try_link "$LINENO"; then :
16977 ac_cv_lib_error_at_line=yes
4a626d0a 16978else
c0c3707f 16979 ac_cv_lib_error_at_line=no
6ec2e0f5 16980fi
c0c3707f
CB
16981rm -f core conftest.err conftest.$ac_objext \
16982 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5 16983fi
c0c3707f
CB
16984{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
16985$as_echo "$ac_cv_lib_error_at_line" >&6; }
09607c9e 16986
c0c3707f 16987 if test $ac_cv_lib_error_at_line = no; then
09607c9e
TT
16988
16989
16990
16991
16992
16993
16994
16995
c0c3707f 16996 gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
09607c9e 16997
4a626d0a 16998
09607c9e 16999
c0c3707f 17000 :
4a626d0a 17001
c0c3707f 17002 fi
4a626d0a 17003
4a626d0a 17004
09607c9e 17005
09607c9e 17006
09607c9e
TT
17007
17008
09607c9e 17009
c0c3707f
CB
17010 if test $ac_cv_have_decl_fchdir = no; then
17011 HAVE_DECL_FCHDIR=0
17012 fi
09607c9e
TT
17013
17014
c0c3707f 17015 if test $HAVE_FCHDIR = 0; then
09607c9e
TT
17016
17017
17018
c0c3707f
CB
17019
17020
17021
17022
17023
17024 gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext"
17025
17026 :
17027
17028$as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h
17029
17030 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
17031$as_echo_n "checking whether open can visit directories... " >&6; }
17032if ${gl_cv_func_open_directory_works+:} false; then :
17033 $as_echo_n "(cached) " >&6
3d99e817 17034else
c0c3707f
CB
17035 if test "$cross_compiling" = yes; then :
17036 case "$host_os" in
17037 # Guess yes on Linux systems.
17038 linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
17039 # Guess yes on glibc systems.
17040 *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
17041 # Guess no on native Windows.
17042 mingw*) gl_cv_func_open_directory_works="guessing no" ;;
17043 # If we don't know, obey --enable-cross-guesses.
17044 *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
17045 esac
17046
17047else
17048 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17049/* end confdefs.h. */
17050#include <fcntl.h>
17051
17052int
17053main ()
17054{
17055return open(".", O_RDONLY) < 0;
17056 ;
17057 return 0;
17058}
17059_ACEOF
17060if ac_fn_c_try_run "$LINENO"; then :
17061 gl_cv_func_open_directory_works=yes
17062else
17063 gl_cv_func_open_directory_works=no
17064fi
17065rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17066 conftest.$ac_objext conftest.beam conftest.$ac_ext
3d99e817
AK
17067fi
17068
c0c3707f
CB
17069fi
17070{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
17071$as_echo "$gl_cv_func_open_directory_works" >&6; }
17072 case "$gl_cv_func_open_directory_works" in
17073 *yes) ;;
17074 *)
3d99e817 17075
c0c3707f 17076$as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
09607c9e 17077
c0c3707f
CB
17078 ;;
17079 esac
17080 fi
8690e634 17081
8690e634 17082
8690e634 17083
8690e634 17084
8690e634 17085
6ec2e0f5 17086
c0c3707f 17087 GNULIB_FCHDIR=1
6ec2e0f5
SDJ
17088
17089
6ec2e0f5 17090
8690e634
JK
17091
17092
c0c3707f 17093$as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h
8690e634
JK
17094
17095
17096
6ec2e0f5
SDJ
17097
17098
17099
6ec2e0f5 17100
8690e634 17101
c0c3707f 17102 if test $ac_cv_func_fcntl = no; then
8690e634
JK
17103
17104
6ec2e0f5 17105
c0c3707f
CB
17106 if test $ac_cv_func_fcntl = no; then
17107 HAVE_FCNTL=0
17108 else
17109 REPLACE_FCNTL=1
17110 fi
5e8754f9 17111
c0c3707f
CB
17112 else
17113 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
17114$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
17115if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
8690e634 17116 $as_echo_n "(cached) " >&6
6ec2e0f5 17117else
c0c3707f
CB
17118 if test "$cross_compiling" = yes; then :
17119 case $host_os in
17120 aix* | cygwin* | haiku*)
17121 gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
17122 *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
17123 esac
17124else
17125 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17126/* end confdefs.h. */
17127#include <errno.h>
17128 #include <fcntl.h>
17129 #include <limits.h>
17130 #include <sys/resource.h>
17131 #include <unistd.h>
17132 #ifndef RLIM_SAVED_CUR
17133 # define RLIM_SAVED_CUR RLIM_INFINITY
17134 #endif
17135 #ifndef RLIM_SAVED_MAX
17136 # define RLIM_SAVED_MAX RLIM_INFINITY
17137 #endif
17138
17139int
17140main ()
17141{
17142int result = 0;
17143 int bad_fd = INT_MAX;
17144 struct rlimit rlim;
17145 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
17146 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
17147 && rlim.rlim_cur != RLIM_INFINITY
17148 && rlim.rlim_cur != RLIM_SAVED_MAX
17149 && rlim.rlim_cur != RLIM_SAVED_CUR)
17150 bad_fd = rlim.rlim_cur;
17151 if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
17152 if (errno != EINVAL) result |= 2;
17153 if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
17154 if (errno != EINVAL) result |= 8;
17155 /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
17156 {
17157 int fd;
17158 fd = open (".", O_RDONLY);
17159 if (fd == -1)
17160 result |= 16;
17161 else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
17162 result |= 32;
17163
17164 close (fd);
17165 }
17166 return result;
17167 ;
17168 return 0;
17169}
17170_ACEOF
17171if ac_fn_c_try_run "$LINENO"; then :
17172 gl_cv_func_fcntl_f_dupfd_works=yes
17173else
17174 gl_cv_func_fcntl_f_dupfd_works=no
17175fi
17176rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17177 conftest.$ac_objext conftest.beam conftest.$ac_ext
17178fi
17179
17180fi
17181{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
17182$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
17183 case $gl_cv_func_fcntl_f_dupfd_works in
17184 *yes) ;;
17185 *)
17186
17187
17188 if test $ac_cv_func_fcntl = no; then
17189 HAVE_FCNTL=0
17190 else
17191 REPLACE_FCNTL=1
17192 fi
17193
17194
17195$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
17196 ;;
17197 esac
17198
17199 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
17200$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
17201if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
17202 $as_echo_n "(cached) " >&6
8690e634
JK
17203else
17204 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17205/* end confdefs.h. */
c0c3707f
CB
17206
17207#include <fcntl.h>
17208#ifndef F_DUPFD_CLOEXEC
17209choke me
17210#endif
17211
17212int
17213main ()
17214{
17215
17216 ;
17217 return 0;
17218}
17219_ACEOF
17220if ac_fn_c_try_compile "$LINENO"; then :
17221 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17222/* end confdefs.h. */
17223
17224#ifdef __linux__
17225/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
17226 it to support the semantics on older kernels that failed with EINVAL. */
17227choke me
17228#endif
8690e634 17229
8690e634
JK
17230int
17231main ()
17232{
17233
17234 ;
17235 return 0;
17236}
17237_ACEOF
c0c3707f
CB
17238if ac_fn_c_try_compile "$LINENO"; then :
17239 gl_cv_func_fcntl_f_dupfd_cloexec=yes
8690e634 17240else
c0c3707f 17241 gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
8690e634 17242fi
c0c3707f
CB
17243rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17244else
17245 gl_cv_func_fcntl_f_dupfd_cloexec=no
17246fi
17247rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 17248fi
c0c3707f
CB
17249{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
17250$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
17251 if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
8690e634 17252
8690e634 17253
c0c3707f
CB
17254
17255 if test $ac_cv_func_fcntl = no; then
17256 HAVE_FCNTL=0
5e8754f9 17257 else
c0c3707f
CB
17258 REPLACE_FCNTL=1
17259 fi
17260
17261 fi
8690e634
JK
17262 fi
17263
17264
8690e634 17265
8690e634 17266
c0c3707f
CB
17267 if test $ac_cv_func_fchdir = no; then
17268 HAVE_FCHDIR=0
17269 fi
6ec2e0f5 17270
c0c3707f 17271 if test $HAVE_FCHDIR = 0; then
6ec2e0f5
SDJ
17272
17273
17274
c0c3707f
CB
17275 if test $ac_cv_func_fcntl = no; then
17276 HAVE_FCNTL=0
17277 else
17278 REPLACE_FCNTL=1
17279 fi
6ec2e0f5 17280
c0c3707f 17281 fi
6ec2e0f5
SDJ
17282
17283
c0c3707f 17284 if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
6ec2e0f5 17285
6ec2e0f5
SDJ
17286
17287
5e8754f9
SDJ
17288
17289
8690e634 17290
8690e634
JK
17291
17292
c0c3707f 17293 gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
472fa5ee 17294
c0c3707f 17295 fi
472fa5ee
SM
17296
17297
17298
17299
17300
c0c3707f 17301 GNULIB_FCNTL=1
472fa5ee
SM
17302
17303
17304
17305
17306
c0c3707f 17307$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
472fa5ee
SM
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
c0c3707f
CB
17322 if test $gl_cv_have_include_next = yes; then
17323 gl_cv_next_fcntl_h='<'fcntl.h'>'
17324 else
17325 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
17326$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
17327if ${gl_cv_next_fcntl_h+:} false; then :
17328 $as_echo_n "(cached) " >&6
17329else
472fa5ee
SM
17330
17331
472fa5ee 17332
c0c3707f
CB
17333 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17334/* end confdefs.h. */
17335#include <fcntl.h>
17336_ACEOF
17337 case "$host_os" in
17338 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17339 *) gl_absname_cpp="$ac_cpp" ;;
17340 esac
472fa5ee 17341
c0c3707f
CB
17342 case "$host_os" in
17343 mingw*)
17344 gl_dirsep_regex='[/\\]'
17345 ;;
17346 *)
17347 gl_dirsep_regex='\/'
17348 ;;
17349 esac
17350 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17351 gl_header_literal_regex=`echo 'fcntl.h' \
17352 | sed -e "$gl_make_literal_regex_sed"`
17353 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17354 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17355 s|^/[^/]|//&|
17356 p
17357 q
17358 }'
472fa5ee 17359
c0c3707f
CB
17360 gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17361 sed -n "$gl_absolute_header_sed"`
472fa5ee 17362
c0c3707f
CB
17363 gl_header=$gl_cv_absolute_fcntl_h
17364 gl_cv_next_fcntl_h='"'$gl_header'"'
8690e634
JK
17365
17366
c0c3707f
CB
17367fi
17368{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
17369$as_echo "$gl_cv_next_fcntl_h" >&6; }
17370 fi
17371 NEXT_FCNTL_H=$gl_cv_next_fcntl_h
8690e634 17372
c0c3707f
CB
17373 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17374 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17375 gl_next_as_first_directive='<'fcntl.h'>'
17376 else
17377 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17378 gl_next_as_first_directive=$gl_cv_next_fcntl_h
17379 fi
17380 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
8690e634
JK
17381
17382
17383
17384
5e8754f9
SDJ
17385
17386
17387
17388
472fa5ee
SM
17389
17390
17391
17392
17393
17394
17395
5e8754f9 17396cat >>confdefs.h <<_ACEOF
c0c3707f 17397#define GNULIB_FD_SAFER_FLAG 1
5e8754f9 17398_ACEOF
472fa5ee
SM
17399
17400
c0c3707f
CB
17401
17402
17403
17404
17405
17406 ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
17407#include <dirent.h>
17408
5e8754f9 17409"
c0c3707f 17410if test "x$ac_cv_have_decl_fdopendir" = xyes; then :
5e8754f9
SDJ
17411 ac_have_decl=1
17412else
17413 ac_have_decl=0
17414fi
472fa5ee 17415
5e8754f9 17416cat >>confdefs.h <<_ACEOF
c0c3707f 17417#define HAVE_DECL_FDOPENDIR $ac_have_decl
5e8754f9 17418_ACEOF
c0c3707f 17419if test $ac_have_decl = 1; then :
472fa5ee 17420
c0c3707f
CB
17421else
17422 HAVE_DECL_FDOPENDIR=0
17423fi
472fa5ee
SM
17424
17425
c0c3707f
CB
17426 if test $ac_cv_func_fdopendir = no; then
17427 HAVE_FDOPENDIR=0
17428 else
17429 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
17430$as_echo_n "checking whether fdopendir works... " >&6; }
17431if ${gl_cv_func_fdopendir_works+:} false; then :
17432 $as_echo_n "(cached) " >&6
17433else
17434 if test "$cross_compiling" = yes; then :
17435 case "$host_os" in
17436 # Guess yes on glibc systems.
17437 *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
17438 # Guess yes on musl systems.
17439 *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
17440 # If we don't know, obey --enable-cross-guesses.
17441 *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
17442 esac
472fa5ee 17443
c0c3707f
CB
17444else
17445 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17446/* end confdefs.h. */
472fa5ee 17447
c0c3707f
CB
17448#include <dirent.h>
17449#include <fcntl.h>
17450#include <unistd.h>
17451#if !HAVE_DECL_FDOPENDIR
17452extern
17453# ifdef __cplusplus
17454"C"
17455# endif
17456DIR *fdopendir (int);
17457#endif
472fa5ee 17458
c0c3707f
CB
17459int
17460main ()
17461{
17462int result = 0;
17463 int fd = open ("conftest.c", O_RDONLY);
17464 if (fd < 0) result |= 1;
17465 if (fdopendir (fd)) result |= 2;
17466 if (close (fd)) result |= 4;
17467 return result;
17468 ;
17469 return 0;
17470}
17471_ACEOF
17472if ac_fn_c_try_run "$LINENO"; then :
17473 gl_cv_func_fdopendir_works=yes
17474else
17475 gl_cv_func_fdopendir_works=no
17476fi
17477rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17478 conftest.$ac_objext conftest.beam conftest.$ac_ext
17479fi
472fa5ee 17480
c0c3707f
CB
17481fi
17482{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
17483$as_echo "$gl_cv_func_fdopendir_works" >&6; }
17484 case "$gl_cv_func_fdopendir_works" in
17485 *yes) ;;
17486 *)
17487 REPLACE_FDOPENDIR=1
17488 ;;
17489 esac
17490 fi
472fa5ee 17491
c0c3707f 17492 if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
472fa5ee
SM
17493
17494
17495
17496
17497
98399780 17498
5e8754f9
SDJ
17499
17500
c0c3707f 17501 gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
5e8754f9 17502
c0c3707f 17503 fi
5e8754f9
SDJ
17504
17505
17506
17507
17508
c0c3707f 17509 GNULIB_FDOPENDIR=1
5e8754f9
SDJ
17510
17511
17512
17513
17514
c0c3707f 17515$as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h
5e8754f9
SDJ
17516
17517
5e8754f9
SDJ
17518
17519
17520
c0c3707f
CB
17521cat >>confdefs.h <<_ACEOF
17522#define GNULIB_FDOPENDIR 1
17523_ACEOF
5e8754f9
SDJ
17524
17525
17526
5e8754f9
SDJ
17527
17528
17529
c0c3707f
CB
17530 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
17531$as_echo_n "checking for flexible array member... " >&6; }
17532if ${ac_cv_c_flexmember+:} false; then :
5e8754f9 17533 $as_echo_n "(cached) " >&6
6ec2e0f5 17534else
c0c3707f 17535 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 17536/* end confdefs.h. */
c0c3707f
CB
17537#include <stdlib.h>
17538 #include <stdio.h>
17539 #include <stddef.h>
17540 struct m { struct m *next, **list; char name[]; };
17541 struct s { struct s *p; struct m *m; int n; double d[]; };
5e8754f9
SDJ
17542int
17543main ()
17544{
c0c3707f
CB
17545int m = getchar ();
17546 size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
17547 nbytes += sizeof (struct s) - 1;
17548 nbytes -= nbytes % sizeof (struct s);
17549 struct s *p = malloc (nbytes);
17550 p->p = p;
17551 p->m = NULL;
17552 p->d[0] = 0.0;
17553 return p->d != (double *) NULL;
5e8754f9
SDJ
17554 ;
17555 return 0;
17556}
7a6dbc2f 17557_ACEOF
c0c3707f
CB
17558if ac_fn_c_try_compile "$LINENO"; then :
17559 ac_cv_c_flexmember=yes
5e8754f9 17560else
c0c3707f 17561 ac_cv_c_flexmember=no
5e8754f9 17562fi
c0c3707f 17563rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5e8754f9 17564fi
c0c3707f
CB
17565{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
17566$as_echo "$ac_cv_c_flexmember" >&6; }
17567 if test $ac_cv_c_flexmember = yes; then
17568
17569$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
5e8754f9 17570
c0c3707f
CB
17571 else
17572 $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
98399780 17573
c0c3707f 17574 fi
98399780 17575
472fa5ee
SM
17576
17577
17578
c0c3707f
CB
17579 FLOAT_H=
17580 REPLACE_FLOAT_LDBL=0
17581 case "$host_os" in
17582 aix* | beos* | openbsd* | mirbsd* | irix*)
17583 FLOAT_H=float.h
17584 ;;
17585 freebsd* | dragonfly*)
17586 case "$host_cpu" in
17587 i[34567]86 )
17588 FLOAT_H=float.h
17589 ;;
17590 x86_64 )
17591 # On x86_64 systems, the C compiler may still be generating
17592 # 32-bit code.
17593 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17594/* end confdefs.h. */
17595#if defined __LP64__ || defined __x86_64__ || defined __amd64__
17596 int ok;
17597 #else
17598 error fail
17599 #endif
472fa5ee 17600
c0c3707f
CB
17601_ACEOF
17602if ac_fn_c_try_compile "$LINENO"; then :
472fa5ee 17603
c0c3707f
CB
17604else
17605 FLOAT_H=float.h
17606fi
17607rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17608 ;;
17609 esac
17610 ;;
17611 linux*)
17612 case "$host_cpu" in
17613 powerpc*)
17614 FLOAT_H=float.h
17615 ;;
17616 esac
17617 ;;
17618 esac
17619 case "$host_os" in
17620 aix* | freebsd* | dragonfly* | linux*)
17621 if test -n "$FLOAT_H"; then
17622 REPLACE_FLOAT_LDBL=1
17623 fi
17624 ;;
17625 esac
17626
17627 REPLACE_ITOLD=0
17628 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
17629$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
17630if ${gl_cv_func_itold_works+:} false; then :
5e8754f9
SDJ
17631 $as_echo_n "(cached) " >&6
17632else
17633
17634 if test "$cross_compiling" = yes; then :
c0c3707f
CB
17635 case "$host" in
17636 sparc*-*-linux*)
17637 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17638/* end confdefs.h. */
17639#if defined __LP64__ || defined __arch64__
17640 int ok;
17641 #else
17642 error fail
17643 #endif
17644
17645_ACEOF
17646if ac_fn_c_try_compile "$LINENO"; then :
17647 gl_cv_func_itold_works="guessing no"
17648else
17649 gl_cv_func_itold_works="guessing yes"
17650fi
17651rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17652 ;;
17653 # Guess yes on native Windows.
17654 mingw*) gl_cv_func_itold_works="guessing yes" ;;
17655 *) gl_cv_func_itold_works="guessing yes" ;;
5e8754f9
SDJ
17656 esac
17657
17658else
17659 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17660/* end confdefs.h. */
17661
c0c3707f
CB
17662int i = -1;
17663volatile long double ld;
17664int main ()
5e8754f9 17665{
c0c3707f
CB
17666 ld += i * 1.0L;
17667 if (ld > 0)
17668 return 1;
17669 return 0;
5e8754f9
SDJ
17670}
17671_ACEOF
17672if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 17673 gl_cv_func_itold_works=yes
5e8754f9 17674else
c0c3707f 17675 gl_cv_func_itold_works=no
5e8754f9
SDJ
17676fi
17677rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17678 conftest.$ac_objext conftest.beam conftest.$ac_ext
17679fi
17680
98399780 17681
5e8754f9 17682fi
c0c3707f
CB
17683{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
17684$as_echo "$gl_cv_func_itold_works" >&6; }
17685 case "$gl_cv_func_itold_works" in
17686 *no)
17687 REPLACE_ITOLD=1
17688 FLOAT_H=float.h
17689 ;;
17690 esac
98399780 17691
c0c3707f 17692 if test -n "$FLOAT_H"; then
98399780
YQ
17693
17694
17695
17696
6a29c58e
YQ
17697
17698
17699
17700
c0c3707f
CB
17701 if test $gl_cv_have_include_next = yes; then
17702 gl_cv_next_float_h='<'float.h'>'
17703 else
17704 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
17705$as_echo_n "checking absolute name of <float.h>... " >&6; }
17706if ${gl_cv_next_float_h+:} false; then :
17707 $as_echo_n "(cached) " >&6
17708else
17709
17710
17711
17712 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17713/* end confdefs.h. */
17714#include <float.h>
17715_ACEOF
17716 case "$host_os" in
17717 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17718 *) gl_absname_cpp="$ac_cpp" ;;
17719 esac
17720
17721 case "$host_os" in
17722 mingw*)
17723 gl_dirsep_regex='[/\\]'
17724 ;;
17725 *)
17726 gl_dirsep_regex='\/'
17727 ;;
17728 esac
17729 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17730 gl_header_literal_regex=`echo 'float.h' \
17731 | sed -e "$gl_make_literal_regex_sed"`
17732 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17733 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17734 s|^/[^/]|//&|
17735 p
17736 q
17737 }'
17738
17739 gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17740 sed -n "$gl_absolute_header_sed"`
17741
17742 gl_header=$gl_cv_absolute_float_h
17743 gl_cv_next_float_h='"'$gl_header'"'
17744
17745
17746fi
17747{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
17748$as_echo "$gl_cv_next_float_h" >&6; }
17749 fi
17750 NEXT_FLOAT_H=$gl_cv_next_float_h
17751
17752 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17753 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17754 gl_next_as_first_directive='<'float.h'>'
17755 else
17756 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17757 gl_next_as_first_directive=$gl_cv_next_float_h
17758 fi
17759 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
17760
17761
17762
6a29c58e 17763
c0c3707f 17764 fi
6a29c58e 17765
c0c3707f
CB
17766 if test -n "$FLOAT_H"; then
17767 GL_GENERATE_FLOAT_H_TRUE=
17768 GL_GENERATE_FLOAT_H_FALSE='#'
17769else
17770 GL_GENERATE_FLOAT_H_TRUE='#'
17771 GL_GENERATE_FLOAT_H_FALSE=
17772fi
6a29c58e
YQ
17773
17774
8690e634 17775
c0c3707f 17776 if test $REPLACE_FLOAT_LDBL = 1; then
8690e634 17777
8690e634 17778
8690e634 17779
8690e634 17780
8690e634 17781
8690e634 17782
8690e634 17783
4a626d0a 17784
c0c3707f 17785 gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
8690e634 17786
c0c3707f
CB
17787 fi
17788 if test $REPLACE_ITOLD = 1; then
8690e634
JK
17789
17790
17791
17792
17793
17794
63ce7108 17795
e26b6bb0 17796
c0c3707f 17797 gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
e26b6bb0 17798
c0c3707f 17799 fi
e26b6bb0
TT
17800
17801
17802
17803
c0c3707f
CB
17804 gl_fnmatch_required_lowercase=`
17805 echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
17806 `
e26b6bb0 17807
c0c3707f
CB
17808 if test $ac_cv_func_fnmatch = no; then
17809 HAVE_FNMATCH=0
17810 else
17811 gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
17812 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5
17813$as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; }
17814if eval \${$gl_fnmatch_cache_var+:} false; then :
5e8754f9
SDJ
17815 $as_echo_n "(cached) " >&6
17816else
c0c3707f
CB
17817 if test $gl_fnmatch_required = GNU; then
17818 gl_fnmatch_gnu_start=
17819 gl_fnmatch_gnu_end=
17820 else
17821 gl_fnmatch_gnu_start='#if 0'
17822 gl_fnmatch_gnu_end='#endif'
17823 fi
17824 if test "$cross_compiling" = yes; then :
17825 case "$host_os" in
17826 # Guess yes on musl systems.
17827 *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;;
17828 # Guess no otherwise, even on glibc systems.
17829 *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;;
17830 esac
e26b6bb0 17831
c0c3707f
CB
17832else
17833 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 17834/* end confdefs.h. */
c0c3707f
CB
17835#include <fnmatch.h>
17836 static int
17837 y (char const *pattern, char const *string, int flags)
17838 {
17839 return fnmatch (pattern, string, flags) == 0;
17840 }
17841 static int
17842 n (char const *pattern, char const *string, int flags)
17843 {
17844 return fnmatch (pattern, string, flags) == FNM_NOMATCH;
17845 }
17846
5e8754f9
SDJ
17847int
17848main ()
17849{
c0c3707f
CB
17850char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
17851 char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]";
17852 static char const A_1[] = { 'A' - 1, 0 };
17853 static char const A01[] = { 'A' + 1, 0 };
17854 static char const a_1[] = { 'a' - 1, 0 };
17855 static char const a01[] = { 'a' + 1, 0 };
17856 static char const bs_1[] = { '\\\\' - 1, 0 };
17857 static char const bs01[] = { '\\\\' + 1, 0 };
17858 int result = 0;
17859 if (!n ("a*", "", 0))
17860 return 1;
17861 if (!y ("a*", "abc", 0))
17862 return 1;
17863 if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
17864 return 1;
17865 if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
17866 return 2;
17867 if (!y ("a\\\\bc", "abc", 0))
17868 return 3;
17869 if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
17870 return 3;
17871 if (!y ("*x", ".x", 0))
17872 return 4;
17873 if (!n ("*x", ".x", FNM_PERIOD))
17874 return 4;
17875 if (!y (Apat, "\\\\", 0))
17876 return 5;
17877 if (!y (Apat, "A", 0))
17878 return 5;
17879 if (!y (apat, "\\\\", 0))
17880 return 5;
17881 if (!y (apat, "a", 0))
17882 return 5;
17883 if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
17884 return 5;
17885 if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
17886 return 5;
17887 if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
17888 return 5;
17889 if (!(y (apat, a01, 0) == ('a' < '\\\\')))
17890 return 5;
17891 if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
17892 return 5;
17893 if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
17894 return 5;
17895 if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
17896 return 5;
17897 if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
17898 return 5;
17899 $gl_fnmatch_gnu_start
17900 if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
17901 result |= 8;
17902 if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
17903 result |= 16;
17904 if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
17905 result |= 32;
17906 if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
17907 result |= 64;
17908 if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
17909 result |= 64;
17910 if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
17911 result |= 64;
17912 $gl_fnmatch_gnu_end
17913 return result;
17914
5e8754f9
SDJ
17915 ;
17916 return 0;
17917}
17918_ACEOF
c0c3707f
CB
17919if ac_fn_c_try_run "$LINENO"; then :
17920 eval "$gl_fnmatch_cache_var=yes"
5e8754f9 17921else
c0c3707f
CB
17922 eval "$gl_fnmatch_cache_var=no"
17923fi
17924rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17925 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 17926fi
c0c3707f 17927
e26b6bb0 17928
5e8754f9 17929fi
c0c3707f
CB
17930eval ac_res=\$$gl_fnmatch_cache_var
17931 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17932$as_echo "$ac_res" >&6; }
17933 eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
17934 case "$gl_fnmatch_result" in
17935 *yes) ;;
17936 *) REPLACE_FNMATCH=1 ;;
17937 esac
17938 fi
17939 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
e26b6bb0 17940
e26b6bb0 17941
c0c3707f
CB
17942 FNMATCH_H='fnmatch.h'
17943 if test -n "$FNMATCH_H"; then
17944 GL_GENERATE_FNMATCH_H_TRUE=
17945 GL_GENERATE_FNMATCH_H_FALSE='#'
5e8754f9 17946else
c0c3707f
CB
17947 GL_GENERATE_FNMATCH_H_TRUE='#'
17948 GL_GENERATE_FNMATCH_H_FALSE=
5e8754f9 17949fi
e26b6bb0 17950
18848e28 17951
c0c3707f 17952 fi
18848e28 17953
c0c3707f 17954 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
18848e28 17955
18848e28 17956
18848e28 17957
c0c3707f
CB
17958
17959
17960
17961
17962
17963 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
17964
17965
17966
17967 ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
17968"
17969if test "x$ac_cv_have_decl_isblank" = xyes; then :
17970 ac_have_decl=1
5e8754f9 17971else
c0c3707f
CB
17972 ac_have_decl=0
17973fi
18848e28 17974
c0c3707f
CB
17975cat >>confdefs.h <<_ACEOF
17976#define HAVE_DECL_ISBLANK $ac_have_decl
5e8754f9 17977_ACEOF
c0c3707f
CB
17978
17979
17980
17981
17982 fi
17983
17984
17985
17986
17987
17988 GNULIB_FNMATCH=1
17989
17990
17991
17992
17993
17994$as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h
17995
17996
17997
17998
17999
18000
18001
18002
18003 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
18004
18005
18006
18007
18008
18009
18010
18011
18012 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
18013
18014
18015
18016 ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
18017"
18018if test "x$ac_cv_have_decl_isblank" = xyes; then :
18019 ac_have_decl=1
5e8754f9 18020else
c0c3707f 18021 ac_have_decl=0
5e8754f9 18022fi
18848e28 18023
c0c3707f
CB
18024cat >>confdefs.h <<_ACEOF
18025#define HAVE_DECL_ISBLANK $ac_have_decl
18026_ACEOF
18848e28
GF
18027
18028
18029
18848e28 18030
5e8754f9 18031 fi
18848e28 18032
18848e28 18033
c0c3707f
CB
18034cat >>confdefs.h <<_ACEOF
18035#define GNULIB_FNMATCH_GNU 1
18036_ACEOF
18848e28 18037
18848e28 18038
18848e28 18039
18848e28 18040
c0c3707f
CB
18041 if test $gl_func_frexp != yes; then
18042
18043
18848e28
GF
18044
18045
18848e28 18046
18848e28 18047
18848e28 18048
c0c3707f
CB
18049
18050 gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext"
18848e28
GF
18051
18052 fi
18053
18054
18055
18056
18057
c0c3707f 18058 GNULIB_FREXP=1
18848e28
GF
18059
18060
18061
18062
18063
c0c3707f 18064$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h
18848e28
GF
18065
18066
18067
18068
c0c3707f
CB
18069 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
18070
18071
18072
18848e28
GF
18073
18074
18075
5e8754f9
SDJ
18076
18077
c0c3707f
CB
18078 gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext"
18079
5e8754f9 18080 fi
18848e28 18081
6a29c58e 18082
6a29c58e 18083
6a29c58e 18084
6ec2e0f5 18085
c0c3707f
CB
18086 GNULIB_FREXPL=1
18087
18088
18089
18090
18091
18092$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
18093
18094
18095
18096
18097
18098
18099
18100 case "$host_os" in
18101 mingw* | solaris*)
18102 REPLACE_FSTAT=1
18103 ;;
18104 esac
472fa5ee
SM
18105
18106
18107
18108
18109
6ec2e0f5
SDJ
18110 if test $ac_cv_func_fchdir = no; then
18111 HAVE_FCHDIR=0
6a29c58e
YQ
18112 fi
18113
6ec2e0f5
SDJ
18114 if test $HAVE_FCHDIR = 0; then
18115 case "$gl_cv_func_open_directory_works" in
18116 *yes) ;;
18117 *)
18118 REPLACE_FSTAT=1
18119 ;;
18120 esac
18121 fi
6a29c58e
YQ
18122
18123
6ec2e0f5 18124 if test $REPLACE_FSTAT = 1; then
6a29c58e 18125
3d99e817
AK
18126
18127
18128
3d99e817
AK
18129
18130
18131
18132
6ec2e0f5 18133 gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext"
3d99e817 18134
c0c3707f
CB
18135 case "$host_os" in
18136 mingw*)
3d99e817
AK
18137
18138
18139
18140
18141
18142
49e4877c 18143
49e4877c 18144
c0c3707f 18145 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
49e4877c 18146
c0c3707f
CB
18147 ;;
18148 esac
49e4877c
PA
18149
18150
c0c3707f
CB
18151 :
18152
18153 fi
6a29c58e
YQ
18154
18155
88b48903 18156
8690e634 18157
a512b375 18158
c0c3707f
CB
18159 GNULIB_FSTAT=1
18160
18161
18162
18163
18164
18165$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
18166
18167
88b48903 18168
88b48903 18169
472fa5ee
SM
18170
18171
18172
18173
18174
6ec2e0f5
SDJ
18175
18176 if test $ac_cv_func_fstatat = no; then
18177 HAVE_FSTATAT=0
18178 else
18179 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5
18180$as_echo_n "checking whether fstatat (..., 0) works... " >&6; }
d0ac1c44 18181if ${gl_cv_func_fstatat_zero_flag+:} false; then :
6ec2e0f5
SDJ
18182 $as_echo_n "(cached) " >&6
18183else
18184 if test "$cross_compiling" = yes; then :
18185 case "$host_os" in
18186 aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
18187 *) gl_cv_func_fstatat_zero_flag="guessing yes";;
18188 esac
88b48903 18189
8690e634
JK
18190else
18191 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18192/* end confdefs.h. */
8690e634 18193
6ec2e0f5
SDJ
18194 #include <fcntl.h>
18195 #include <sys/stat.h>
18196 int
18197 main (void)
18198 {
18199 struct stat a;
18200 return fstatat (AT_FDCWD, ".", &a, 0) != 0;
18201 }
18202
88b48903
WN
18203_ACEOF
18204if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 18205 gl_cv_func_fstatat_zero_flag=yes
88b48903 18206else
6ec2e0f5 18207 gl_cv_func_fstatat_zero_flag=no
88b48903
WN
18208fi
18209rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18210 conftest.$ac_objext conftest.beam conftest.$ac_ext
18211fi
18212
18213
18214fi
6ec2e0f5
SDJ
18215{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5
18216$as_echo "$gl_cv_func_fstatat_zero_flag" >&6; }
88b48903 18217
6ec2e0f5
SDJ
18218 case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
18219 *yes+*yes) ;;
c0c3707f
CB
18220 *) REPLACE_FSTATAT=1 ;;
18221 esac
18222
18223 case $host_os in
18224 solaris*)
18225 REPLACE_FSTATAT=1 ;;
18226 esac
18227
18228 case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
18229 1,*yes)
88b48903 18230
6ec2e0f5 18231$as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h
88b48903 18232
7a6dbc2f 18233 ;;
6ec2e0f5
SDJ
18234 esac
18235 fi
88b48903 18236
6ec2e0f5 18237 if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
88b48903
WN
18238
18239
18240
18241
18242
88b48903 18243
4a626d0a
PA
18244
18245
6ec2e0f5
SDJ
18246 gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext"
18247
18248 fi
18249
18250
18251
4a626d0a 18252
6ec2e0f5
SDJ
18253
18254 GNULIB_FSTATAT=1
18255
18256
18257
18258
18259
18260$as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h
18261
18262
18263
18264
18265
18266
18267
18268
18269 gl_abort_bug=no
4a626d0a
PA
18270 case "$host_os" in
18271 mingw*)
6ec2e0f5 18272 gl_cv_func_getcwd_path_max=yes
4a626d0a
PA
18273 ;;
18274 *)
88b48903 18275
88b48903 18276
88b48903
WN
18277
18278
88b48903 18279
6ec2e0f5
SDJ
18280 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5
18281$as_echo_n "checking whether getcwd handles long file names properly... " >&6; }
d0ac1c44 18282if ${gl_cv_func_getcwd_path_max+:} false; then :
6ec2e0f5
SDJ
18283 $as_echo_n "(cached) " >&6
18284else
18285 # Arrange for deletion of the temporary directory this test creates.
18286 ac_clean_files="$ac_clean_files confdir3"
18287 if test "$cross_compiling" = yes; then :
b567ca63 18288 # Cross-compilation guesses:
c0c3707f
CB
18289 case "$host_os" in
18290 aix*) # On AIX, it has the AIX bug.
18291 gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
18292 gnu*) # On Hurd, it is 'yes'.
18293 gl_cv_func_getcwd_path_max='guessing yes' ;;
18294 linux* | kfreebsd*)
18295 # On older Linux+glibc it's 'no, but it is partly working',
18296 # on newer Linux+glibc it's 'yes'.
18297 # On Linux+musl libc, it's 'no, but it is partly working'.
18298 # On kFreeBSD+glibc, it's 'no, but it is partly working'.
18299 gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
18300 *) # If we don't know, obey --enable-cross-guesses.
18301 gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
18302 esac
b567ca63 18303
6ec2e0f5
SDJ
18304else
18305 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18306/* end confdefs.h. */
88b48903 18307
6ec2e0f5
SDJ
18308#include <errno.h>
18309#include <stdlib.h>
18310#if HAVE_UNISTD_H
18311# include <unistd.h>
18312#else
18313# include <direct.h>
18314#endif
18315#include <string.h>
18316#include <limits.h>
18317#include <sys/stat.h>
18318#include <sys/types.h>
18319#include <fcntl.h>
88b48903
WN
18320
18321
6ec2e0f5
SDJ
18322/* Arrange to define PATH_MAX, like "pathmax.h" does. */
18323#if HAVE_UNISTD_H
18324# include <unistd.h>
18325#endif
18326#include <limits.h>
18327#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
18328# include <sys/param.h>
18329#endif
18330#if !defined PATH_MAX && defined MAXPATHLEN
18331# define PATH_MAX MAXPATHLEN
18332#endif
18333#ifdef __hpux
18334# undef PATH_MAX
18335# define PATH_MAX 1024
18336#endif
c0c3707f 18337#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
18338# undef PATH_MAX
18339# define PATH_MAX 260
18340#endif
88b48903 18341
88b48903 18342
6ec2e0f5
SDJ
18343#ifndef AT_FDCWD
18344# define AT_FDCWD 0
18345#endif
18346#ifdef ENAMETOOLONG
18347# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
18348#else
18349# define is_ENAMETOOLONG(x) 0
18350#endif
88b48903 18351
6ec2e0f5
SDJ
18352/* Use the getcwd function, not any macro. */
18353#undef getcwd
88b48903 18354
6ec2e0f5
SDJ
18355/* Don't get link errors because mkdir is redefined to rpl_mkdir. */
18356#undef mkdir
88b48903 18357
6ec2e0f5
SDJ
18358#ifndef S_IRWXU
18359# define S_IRWXU 0700
18360#endif
88b48903 18361
6ec2e0f5
SDJ
18362/* The length of this name must be 8. */
18363#define DIR_NAME "confdir3"
18364#define DIR_NAME_LEN 8
18365#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
88b48903 18366
6ec2e0f5
SDJ
18367/* The length of "../". */
18368#define DOTDOTSLASH_LEN 3
88b48903 18369
6ec2e0f5
SDJ
18370/* Leftover bytes in the buffer, to work around library or OS bugs. */
18371#define BUF_SLOP 20
88b48903 18372
6ec2e0f5
SDJ
18373int
18374main ()
18375{
18376#ifndef PATH_MAX
18377 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
18378 at least not on a local file system. And if we were to start worrying
18379 about remote file systems, we'd have to enable the wrapper function
18380 all of the time, just to be safe. That's not worth the cost. */
18381 exit (0);
18382#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
18383 - DIR_NAME_SIZE - BUF_SLOP) \
18384 <= PATH_MAX)
18385 /* FIXME: Assuming there's a system for which this is true,
18386 this should be done in a compile test. */
18387 exit (0);
18388#else
18389 char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
18390 + DIR_NAME_SIZE + BUF_SLOP];
18391 char *cwd = getcwd (buf, PATH_MAX);
18392 size_t initial_cwd_len;
18393 size_t cwd_len;
18394 int fail = 0;
18395 size_t n_chdirs = 0;
88b48903 18396
6ec2e0f5
SDJ
18397 if (cwd == NULL)
18398 exit (10);
88b48903 18399
6ec2e0f5 18400 cwd_len = initial_cwd_len = strlen (cwd);
88b48903 18401
6ec2e0f5
SDJ
18402 while (1)
18403 {
18404 size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
18405 char *c = NULL;
18406
18407 cwd_len += DIR_NAME_SIZE;
18408 /* If mkdir or chdir fails, it could be that this system cannot create
18409 any file with an absolute name longer than PATH_MAX, such as cygwin.
18410 If so, leave fail as 0, because the current working directory can't
c0c3707f
CB
18411 be too long for getcwd if it can't even be created. On Linux with
18412 the 9p file system, mkdir fails with error EINVAL when cwd_len gets
18413 too long; ignore this failure because the getcwd() system call
18414 produces good results whereas the gnulib substitute calls getdents64
18415 which fails with error EPROTO.
18416 For other errors, be pessimistic and consider that as a failure,
18417 too. */
6ec2e0f5
SDJ
18418 if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
18419 {
18420 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
c0c3707f
CB
18421 #ifdef __linux__
18422 if (! (errno == EINVAL))
18423 #endif
18424 fail = 20;
6ec2e0f5
SDJ
18425 break;
18426 }
88b48903 18427
6ec2e0f5
SDJ
18428 if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
18429 {
18430 struct stat sb;
88b48903 18431
6ec2e0f5
SDJ
18432 c = getcwd (buf, PATH_MAX);
18433 if (!c && errno == ENOENT)
18434 {
18435 fail = 11;
18436 break;
18437 }
18438 if (c)
18439 {
18440 fail = 31;
18441 break;
18442 }
18443 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
18444 {
18445 fail = 21;
18446 break;
18447 }
88b48903 18448
6ec2e0f5
SDJ
18449 /* Our replacement needs to be able to stat() long ../../paths,
18450 so generate a path larger than PATH_MAX to check,
18451 avoiding the replacement if we can't stat(). */
18452 c = getcwd (buf, cwd_len + 1);
18453 if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
18454 {
18455 fail = 32;
18456 break;
18457 }
18458 }
88b48903 18459
6ec2e0f5
SDJ
18460 if (dotdot_max <= cwd_len - initial_cwd_len)
18461 {
18462 if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
18463 break;
18464 c = getcwd (buf, cwd_len + 1);
18465 if (!c)
18466 {
18467 if (! (errno == ERANGE || errno == ENOENT
18468 || is_ENAMETOOLONG (errno)))
18469 {
18470 fail = 22;
18471 break;
18472 }
18473 if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
18474 {
18475 fail = 12;
18476 break;
18477 }
18478 }
18479 }
88b48903 18480
6ec2e0f5
SDJ
18481 if (c && strlen (c) != cwd_len)
18482 {
18483 fail = 23;
18484 break;
18485 }
18486 ++n_chdirs;
18487 }
88b48903 18488
6ec2e0f5
SDJ
18489 /* Leaving behind such a deep directory is not polite.
18490 So clean up here, right away, even though the driving
18491 shell script would also clean up. */
18492 {
18493 size_t i;
88b48903 18494
6ec2e0f5
SDJ
18495 /* Try rmdir first, in case the chdir failed. */
18496 rmdir (DIR_NAME);
18497 for (i = 0; i <= n_chdirs; i++)
18498 {
18499 if (chdir ("..") < 0)
18500 break;
18501 if (rmdir (DIR_NAME) != 0)
18502 break;
18503 }
18504 }
88b48903 18505
6ec2e0f5
SDJ
18506 exit (fail);
18507#endif
18508}
88b48903 18509
6ec2e0f5
SDJ
18510_ACEOF
18511if ac_fn_c_try_run "$LINENO"; then :
18512 gl_cv_func_getcwd_path_max=yes
18513else
18514 case $? in
c0c3707f
CB
18515 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
18516 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
18517 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
18518 *) gl_cv_func_getcwd_path_max=no;;
18519 esac
6ec2e0f5
SDJ
18520fi
18521rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18522 conftest.$ac_objext conftest.beam conftest.$ac_ext
18523fi
88b48903 18524
88b48903 18525
6ec2e0f5
SDJ
18526fi
18527{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5
18528$as_echo "$gl_cv_func_getcwd_path_max" >&6; }
88b48903 18529
6ec2e0f5
SDJ
18530 case "$gl_cv_func_getcwd_null" in
18531 *yes)
88b48903
WN
18532
18533
472fa5ee
SM
18534
18535
18536
472fa5ee 18537
c0c3707f
CB
18538 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
18539$as_echo_n "checking for getpagesize... " >&6; }
18540if ${gl_cv_func_getpagesize+:} false; then :
18541 $as_echo_n "(cached) " >&6
18542else
18543 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18544/* end confdefs.h. */
18545#include <unistd.h>
18546int
18547main ()
18548{
18549return getpagesize();
18550 ;
18551 return 0;
18552}
472fa5ee 18553
c0c3707f
CB
18554_ACEOF
18555if ac_fn_c_try_link "$LINENO"; then :
18556 gl_cv_func_getpagesize=yes
18557else
18558 gl_cv_func_getpagesize=no
18559fi
18560rm -f core conftest.err conftest.$ac_objext \
18561 conftest$ac_exeext conftest.$ac_ext
472fa5ee 18562
c0c3707f
CB
18563fi
18564{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
18565$as_echo "$gl_cv_func_getpagesize" >&6; }
88b48903 18566
c0c3707f 18567 if test $gl_cv_func_getpagesize = yes; then
88b48903 18568
c0c3707f 18569cat >>confdefs.h <<_ACEOF
7a6dbc2f
SDJ
18570#define HAVE_GETPAGESIZE 1
18571_ACEOF
18572
c0c3707f 18573 fi
6ec2e0f5
SDJ
18574
18575 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5
18576$as_echo_n "checking whether getcwd aborts when 4k < cwd_length < 16k... " >&6; }
d0ac1c44 18577if ${gl_cv_func_getcwd_abort_bug+:} false; then :
88b48903
WN
18578 $as_echo_n "(cached) " >&6
18579else
6ec2e0f5
SDJ
18580 # Remove any remnants of a previous test.
18581 rm -rf confdir-14B---
18582 # Arrange for deletion of the temporary directory this test creates.
18583 ac_clean_files="$ac_clean_files confdir-14B---"
18584 if test "$cross_compiling" = yes; then :
c0c3707f
CB
18585 case "$host_os" in
18586 # Guess no on musl systems.
18587 *-musl*) gl_cv_func_getcwd_abort_bug="guessing no" ;;
18588 # Guess yes otherwise, even on glibc systems.
18589 *) gl_cv_func_getcwd_abort_bug="guessing yes"
18590 esac
18591
88b48903
WN
18592else
18593 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18594/* end confdefs.h. */
6ec2e0f5
SDJ
18595
18596#include <errno.h>
18597#include <stdlib.h>
18598#if HAVE_UNISTD_H
18599# include <unistd.h>
18600#else /* on Windows with MSVC */
18601# include <direct.h>
18602#endif
18603#include <string.h>
18604#include <sys/stat.h>
18605
18606
18607/* Arrange to define PATH_MAX, like "pathmax.h" does. */
18608#if HAVE_UNISTD_H
18609# include <unistd.h>
18610#endif
18611#include <limits.h>
18612#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
18613# include <sys/param.h>
18614#endif
18615#if !defined PATH_MAX && defined MAXPATHLEN
18616# define PATH_MAX MAXPATHLEN
18617#endif
18618#ifdef __hpux
18619# undef PATH_MAX
18620# define PATH_MAX 1024
18621#endif
c0c3707f 18622#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
18623# undef PATH_MAX
18624# define PATH_MAX 260
18625#endif
18626
18627
18628/* Don't get link errors because mkdir is redefined to rpl_mkdir. */
18629#undef mkdir
18630
18631#ifndef S_IRWXU
18632# define S_IRWXU 0700
18633#endif
18634
18635/* FIXME: skip the run-test altogether on systems without getpagesize. */
18636#if ! HAVE_GETPAGESIZE
18637# define getpagesize() 0
18638#endif
18639
18640/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
18641 the 16kB pagesize on ia64 linux. Those conditions make the code below
18642 trigger a bug in glibc's getcwd implementation before 2.4.90-10. */
18643#define TARGET_LEN (5 * 1024)
88b48903
WN
18644
18645int
18646main ()
18647{
6ec2e0f5
SDJ
18648 char *cwd;
18649 size_t initial_cwd_len;
18650 int fail = 0;
18651
18652 /* The bug is triggered when PATH_MAX < getpagesize (), so skip
18653 this relatively expensive and invasive test if that's not true. */
18654#ifdef PATH_MAX
18655 int bug_possible = PATH_MAX < getpagesize ();
18656#else
18657 int bug_possible = 0;
18658#endif
18659 if (! bug_possible)
18660 return 0;
8690e634 18661
6ec2e0f5
SDJ
18662 cwd = getcwd (NULL, 0);
18663 if (cwd == NULL)
18664 return 2;
18665
18666 initial_cwd_len = strlen (cwd);
18667 free (cwd);
18668
18669 if (1)
18670 {
18671 static char const dir_name[] = "confdir-14B---";
18672 size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
18673 / sizeof dir_name);
18674 size_t d;
18675 for (d = 0; d < desired_depth; d++)
18676 {
18677 if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
18678 {
18679 if (! (errno == ERANGE || errno == ENAMETOOLONG
18680 || errno == ENOENT))
18681 fail = 3; /* Unable to construct deep hierarchy. */
18682 break;
18683 }
18684 }
18685
18686 /* If libc has the bug in question, this invocation of getcwd
18687 results in a failed assertion. */
18688 cwd = getcwd (NULL, 0);
18689 if (cwd == NULL)
18690 fail = 4; /* getcwd didn't assert, but it failed for a long name
18691 where the answer could have been learned. */
18692 free (cwd);
18693
18694 /* Call rmdir first, in case the above chdir failed. */
18695 rmdir (dir_name);
18696 while (0 < d--)
18697 {
18698 if (chdir ("..") < 0)
18699 {
18700 fail = 5;
18701 break;
18702 }
18703 rmdir (dir_name);
18704 }
18705 }
18706
18707 return fail;
8690e634 18708}
6ec2e0f5 18709
8690e634
JK
18710_ACEOF
18711if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 18712 gl_cv_func_getcwd_abort_bug=no
8690e634 18713else
c0c3707f
CB
18714 ret=$?
18715 if test $ret -ge 128 || test $ret = 4; then
18716 gl_cv_func_getcwd_abort_bug=yes
18717 else
18718 gl_cv_func_getcwd_abort_bug=no
18719 fi
18720
8690e634
JK
18721fi
18722rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18723 conftest.$ac_objext conftest.beam conftest.$ac_ext
18724fi
18725
18726
18727fi
6ec2e0f5
SDJ
18728{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_abort_bug" >&5
18729$as_echo "$gl_cv_func_getcwd_abort_bug" >&6; }
c0c3707f
CB
18730 case "$gl_cv_func_getcwd_abort_bug" in
18731 *yes)
18732 gl_abort_bug=yes
18733 ;;
18734 *)
18735
18736 ;;
18737 esac
6ec2e0f5
SDJ
18738
18739 ;;
18740 esac
18741 ;;
18742 esac
18743 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 18744 *"no" | *"no, it has the AIX bug") ;;
6ec2e0f5
SDJ
18745 *)
18746
18747$as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h
18748
18749 ;;
18750 esac
18751 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 18752 *"no, but it is partly working")
6ec2e0f5
SDJ
18753
18754$as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h
18755
18756 ;;
c0c3707f 18757 *"yes, but with shorter paths")
6ec2e0f5
SDJ
18758
18759$as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h
18760
18761 ;;
18762 esac
18763
18764 if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
18765 || test $gl_cv_func_getcwd_posix_signature != yes \
18766 || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \
18767 || test $gl_abort_bug = yes; then
18768 REPLACE_GETCWD=1
8690e634
JK
18769 fi
18770
6ec2e0f5 18771 if test $REPLACE_GETCWD = 1; then
8690e634
JK
18772
18773
8690e634
JK
18774
18775
18776
18777
18778
18779
6ec2e0f5 18780 gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext"
8690e634
JK
18781
18782
8690e634
JK
18783
18784
6ec2e0f5
SDJ
18785 :
18786
18787 fi
18788
8690e634
JK
18789
18790cat >>confdefs.h <<_ACEOF
6ec2e0f5 18791#define GNULIB_GETCWD 1
8690e634
JK
18792_ACEOF
18793
18794
8690e634 18795
8690e634
JK
18796
18797
c971b7fa 18798
c971b7fa 18799
6ec2e0f5
SDJ
18800 GNULIB_GETCWD=1
18801
18802
18803
18804
18805
18806$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
18807
c971b7fa 18808
c971b7fa 18809
c971b7fa 18810
c971b7fa 18811
c971b7fa 18812
c971b7fa 18813
c971b7fa 18814
6ec2e0f5
SDJ
18815 case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
18816 *yes,yes) ;;
18817 *)
18818 REPLACE_GETCWD=1
18819 ;;
18820 esac
c971b7fa 18821
6ec2e0f5 18822 if test $REPLACE_GETCWD = 1; then
c971b7fa 18823
c971b7fa
PA
18824
18825
c971b7fa
PA
18826
18827
c971b7fa 18828
c971b7fa 18829
c971b7fa 18830
6ec2e0f5 18831 gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext"
c971b7fa 18832
6ec2e0f5 18833 fi
c971b7fa 18834
c971b7fa 18835
c971b7fa 18836
c971b7fa 18837
8690e634 18838
6ec2e0f5 18839 GNULIB_GETCWD=1
c971b7fa 18840
88b48903
WN
18841
18842
18843
88b48903 18844
6ec2e0f5 18845$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
88b48903 18846
88b48903
WN
18847
18848
18849
6ec2e0f5
SDJ
18850
18851
18852
18853
18854 if test $ac_cv_func_getdtablesize = yes &&
18855 test $ac_cv_have_decl_getdtablesize = yes; then
6ec2e0f5
SDJ
18856 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
18857$as_echo_n "checking whether getdtablesize works... " >&6; }
d0ac1c44 18858if ${gl_cv_func_getdtablesize_works+:} false; then :
88b48903
WN
18859 $as_echo_n "(cached) " >&6
18860else
c0c3707f
CB
18861 case "$host_os" in
18862 vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
18863 *)
18864 if test "$cross_compiling" = yes; then :
88b48903 18865 case "$host_os" in
c0c3707f
CB
18866 cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
18867 gl_cv_func_getdtablesize_works="guessing no" ;;
18868 *) gl_cv_func_getdtablesize_works="guessing yes" ;;
18869 esac
18870
88b48903
WN
18871else
18872 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18873/* end confdefs.h. */
18874
c0c3707f 18875 #include <unistd.h>
6ec2e0f5
SDJ
18876int
18877main ()
88b48903 18878{
6ec2e0f5 18879int size = getdtablesize();
c0c3707f
CB
18880 if (dup2 (0, getdtablesize()) != -1)
18881 return 1;
18882 if (size != getdtablesize())
18883 return 2;
6ec2e0f5
SDJ
18884
18885 ;
18886 return 0;
88b48903
WN
18887}
18888_ACEOF
18889if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 18890 gl_cv_func_getdtablesize_works=yes
88b48903 18891else
6ec2e0f5 18892 gl_cv_func_getdtablesize_works=no
88b48903
WN
18893fi
18894rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18895 conftest.$ac_objext conftest.beam conftest.$ac_ext
18896fi
18897
c0c3707f
CB
18898 ;;
18899 esac
88b48903
WN
18900
18901fi
6ec2e0f5
SDJ
18902{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
18903$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
18904 case "$gl_cv_func_getdtablesize_works" in
c0c3707f 18905 *yes | "no (limitation)") ;;
6ec2e0f5 18906 *) REPLACE_GETDTABLESIZE=1 ;;
88b48903
WN
18907 esac
18908 else
6ec2e0f5 18909 HAVE_GETDTABLESIZE=0
88b48903
WN
18910 fi
18911
6ec2e0f5 18912 if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
88b48903
WN
18913
18914
18915
18916
18917
18918
18919
18920
6ec2e0f5 18921 gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext"
88b48903 18922
6ec2e0f5 18923 :
88b48903
WN
18924 fi
18925
18926
18927
18928
18929
6ec2e0f5 18930 GNULIB_GETDTABLESIZE=1
88b48903
WN
18931
18932
18933
88b48903 18934
88b48903 18935
6ec2e0f5 18936$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
88b48903 18937
88b48903 18938
88b48903 18939
88b48903 18940
88b48903 18941
88b48903 18942
88b48903 18943
88b48903
WN
18944
18945
6ec2e0f5
SDJ
18946 if test $ac_cv_have_decl_getlogin_r = no; then
18947 HAVE_DECL_GETLOGIN_R=0
18948 fi
88b48903 18949
88b48903 18950
6ec2e0f5
SDJ
18951 if test $ac_cv_func_getlogin_r = no; then
18952 HAVE_GETLOGIN_R=0
18953 else
18954 HAVE_GETLOGIN_R=1
18955
18956 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getlogin_r works with small buffers" >&5
18957$as_echo_n "checking whether getlogin_r works with small buffers... " >&6; }
d0ac1c44 18958if ${gl_cv_func_getlogin_r_works+:} false; then :
6ec2e0f5
SDJ
18959 $as_echo_n "(cached) " >&6
18960else
88b48903 18961
6ec2e0f5 18962 case "$host_os" in
c0c3707f
CB
18963 # Guess no on Mac OS X, OSF/1.
18964 darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;;
18965 # Guess yes otherwise.
18966 *) gl_cv_func_getlogin_r_works="guessing yes" ;;
6ec2e0f5
SDJ
18967 esac
18968 if test "$cross_compiling" = yes; then :
18969 :
88b48903
WN
18970else
18971 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18972/* end confdefs.h. */
18973
6ec2e0f5 18974#include <stddef.h>
c0c3707f 18975#include <string.h>
6ec2e0f5
SDJ
18976#include <unistd.h>
18977#if !HAVE_DECL_GETLOGIN_R
88b48903 18978extern
6ec2e0f5 18979# ifdef __cplusplus
88b48903 18980"C"
6ec2e0f5
SDJ
18981# endif
18982int getlogin_r (char *, size_t);
88b48903 18983#endif
6ec2e0f5
SDJ
18984int
18985main (void)
88b48903
WN
18986{
18987 int result = 0;
6ec2e0f5
SDJ
18988 char buf[100];
18989
18990 if (getlogin_r (buf, 0) == 0)
c0c3707f 18991 result |= 1;
6ec2e0f5 18992 if (getlogin_r (buf, 1) == 0)
c0c3707f
CB
18993 result |= 2;
18994 if (getlogin_r (buf, 100) == 0)
18995 {
18996 size_t n = strlen (buf);
18997 if (getlogin_r (buf, n) == 0)
18998 result |= 4;
18999 }
88b48903
WN
19000 return result;
19001}
19002_ACEOF
19003if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 19004 gl_cv_func_getlogin_r_works=yes
88b48903 19005else
c0c3707f 19006 gl_cv_func_getlogin_r_works=no
88b48903
WN
19007fi
19008rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19009 conftest.$ac_objext conftest.beam conftest.$ac_ext
19010fi
19011
19012
4a626d0a 19013fi
6ec2e0f5
SDJ
19014{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getlogin_r_works" >&5
19015$as_echo "$gl_cv_func_getlogin_r_works" >&6; }
19016 case "$gl_cv_func_getlogin_r_works" in
19017 *yes) ;;
19018 *) REPLACE_GETLOGIN_R=1 ;;
19019 esac
19020 fi
19021
19022 if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then
19023
19024
19025
19026
19027
19028
19029
19030
19031 gl_LIBOBJS="$gl_LIBOBJS getlogin_r.$ac_objext"
4a626d0a 19032
4a626d0a 19033
4a626d0a 19034
4a626d0a 19035
4a626d0a
PA
19036 fi
19037
19038
4a626d0a
PA
19039
19040
19041
6ec2e0f5 19042 GNULIB_GETLOGIN_R=1
4a626d0a
PA
19043
19044
19045
19046
19047
6ec2e0f5 19048$as_echo "#define GNULIB_TEST_GETLOGIN_R 1" >>confdefs.h
4a626d0a 19049
4a626d0a
PA
19050
19051
19052
19053
472fa5ee 19054
4a626d0a 19055
6ec2e0f5
SDJ
19056 ac_found=0
19057 ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
19058"
d0ac1c44 19059if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
6ec2e0f5
SDJ
19060 ac_have_decl=1
19061else
19062 ac_have_decl=0
19063fi
19064
19065cat >>confdefs.h <<_ACEOF
19066#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
19067_ACEOF
19068if test $ac_have_decl = 1; then :
19069 ac_found=1
19070fi
19071
19072 ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
19073"
d0ac1c44 19074if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
6ec2e0f5
SDJ
19075 ac_have_decl=1
19076else
19077 ac_have_decl=0
19078fi
19079
19080cat >>confdefs.h <<_ACEOF
19081#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
19082_ACEOF
19083if test $ac_have_decl = 1; then :
19084 ac_found=1
19085fi
4a626d0a 19086
6ec2e0f5
SDJ
19087 ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
19088"
d0ac1c44 19089if test "x$ac_cv_have_decl___argv" = xyes; then :
6ec2e0f5
SDJ
19090 ac_have_decl=1
19091else
19092 ac_have_decl=0
19093fi
4a626d0a 19094
6ec2e0f5
SDJ
19095cat >>confdefs.h <<_ACEOF
19096#define HAVE_DECL___ARGV $ac_have_decl
19097_ACEOF
19098if test $ac_have_decl = 1; then :
19099 ac_found=1
19100fi
4a626d0a
PA
19101
19102
6ec2e0f5
SDJ
19103 # Incur the cost of this test only if none of the above worked.
19104 if test $ac_found = 0; then
19105 # On OpenBSD 5.1, using the global __progname variable appears to be
19106 # the only way to implement getprogname.
19107 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
19108$as_echo_n "checking whether __progname is defined in default libraries... " >&6; }
d0ac1c44 19109if ${gl_cv_var___progname+:} false; then :
6ec2e0f5
SDJ
19110 $as_echo_n "(cached) " >&6
19111else
4a626d0a 19112
6ec2e0f5
SDJ
19113 gl_cv_var___progname=
19114 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19115/* end confdefs.h. */
19116extern char *__progname;
19117int
19118main ()
19119{
19120return *__progname;
19121
19122 ;
19123 return 0;
19124}
19125_ACEOF
19126if ac_fn_c_try_link "$LINENO"; then :
19127 gl_cv_var___progname=yes
19128
19129fi
19130rm -f core conftest.err conftest.$ac_objext \
19131 conftest$ac_exeext conftest.$ac_ext
19132
19133
19134fi
19135{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
19136$as_echo "$gl_cv_var___progname" >&6; }
19137 if test "$gl_cv_var___progname" = yes; then
19138
19139$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
19140
19141 fi
19142 fi
4a626d0a
PA
19143
19144
19145
19146
19147
19148
19149
19150
472fa5ee 19151
4a626d0a
PA
19152
19153 gl_gettimeofday_timezone=void
19154 if test $ac_cv_func_gettimeofday != yes; then
19155 HAVE_GETTIMEOFDAY=0
19156 else
19157
19158
19159
c0c3707f 19160
4a626d0a
PA
19161 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
19162$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
d0ac1c44 19163if ${gl_cv_func_gettimeofday_clobber+:} false; then :
4a626d0a
PA
19164 $as_echo_n "(cached) " >&6
19165else
19166 if test "$cross_compiling" = yes; then :
19167 # When cross-compiling:
19168 case "$host_os" in
c0c3707f
CB
19169 # Guess all is fine on glibc systems.
19170 *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
19171 # Guess all is fine on musl systems.
19172 *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
19173 # Guess no on native Windows.
19174 mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
19175 # If we don't know, obey --enable-cross-guesses.
19176 *) gl_cv_func_gettimeofday_clobber="$gl_cross_guess_inverted" ;;
4a626d0a
PA
19177 esac
19178
19179else
19180 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19181/* end confdefs.h. */
19182#include <string.h>
19183 #include <sys/time.h>
19184 #include <time.h>
19185 #include <stdlib.h>
19186
19187int
19188main ()
19189{
19190
19191 time_t t = 0;
19192 struct tm *lt;
19193 struct tm saved_lt;
19194 struct timeval tv;
19195 lt = localtime (&t);
19196 saved_lt = *lt;
19197 gettimeofday (&tv, NULL);
19198 return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
19199
19200 ;
19201 return 0;
19202}
19203_ACEOF
19204if ac_fn_c_try_run "$LINENO"; then :
19205 gl_cv_func_gettimeofday_clobber=no
19206else
19207 gl_cv_func_gettimeofday_clobber=yes
19208fi
19209rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19210 conftest.$ac_objext conftest.beam conftest.$ac_ext
19211fi
19212
19213fi
19214{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5
19215$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
19216
19217 case "$gl_cv_func_gettimeofday_clobber" in
19218 *yes)
19219 REPLACE_GETTIMEOFDAY=1
19220
c0c3707f 19221$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
4a626d0a 19222
5e8754f9 19223
c0c3707f
CB
19224
19225
19226 NEED_LOCALTIME_BUFFER=1
19227 REPLACE_GMTIME=1
19228 REPLACE_LOCALTIME=1
5e8754f9 19229
4a626d0a
PA
19230 ;;
19231 esac
19232
19233 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
19234$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
d0ac1c44 19235if ${gl_cv_func_gettimeofday_posix_signature+:} false; then :
4a626d0a
PA
19236 $as_echo_n "(cached) " >&6
19237else
19238 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19239/* end confdefs.h. */
19240#include <sys/time.h>
19241 struct timeval c;
19242 int gettimeofday (struct timeval *restrict, void *restrict);
19243
19244int
19245main ()
19246{
19247/* glibc uses struct timezone * rather than the POSIX void *
19248 if _GNU_SOURCE is defined. However, since the only portable
19249 use of gettimeofday uses NULL as the second parameter, and
19250 since the glibc definition is actually more typesafe, it is
19251 not worth wrapping this to get a compliant signature. */
19252 int (*f) (struct timeval *restrict, void *restrict)
19253 = gettimeofday;
19254 int x = f (&c, 0);
19255 return !(x | c.tv_sec | c.tv_usec);
19256
19257 ;
19258 return 0;
19259}
19260_ACEOF
19261if ac_fn_c_try_compile "$LINENO"; then :
19262 gl_cv_func_gettimeofday_posix_signature=yes
19263else
19264 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19265/* end confdefs.h. */
19266#include <sys/time.h>
19267int gettimeofday (struct timeval *restrict, struct timezone *restrict);
19268
19269int
19270main ()
19271{
19272
19273 ;
19274 return 0;
19275}
19276_ACEOF
19277if ac_fn_c_try_compile "$LINENO"; then :
19278 gl_cv_func_gettimeofday_posix_signature=almost
19279else
19280 gl_cv_func_gettimeofday_posix_signature=no
19281fi
19282rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19283fi
19284rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19285fi
19286{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
19287$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
19288 if test $gl_cv_func_gettimeofday_posix_signature = almost; then
19289 gl_gettimeofday_timezone='struct timezone'
19290 elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
19291 REPLACE_GETTIMEOFDAY=1
19292 fi
19293 if test $REPLACE_STRUCT_TIMEVAL = 1; then
19294 REPLACE_GETTIMEOFDAY=1
19295 fi
c0c3707f
CB
19296 case "$host_os" in
19297 mingw*) REPLACE_GETTIMEOFDAY=1 ;;
19298 esac
4a626d0a
PA
19299 fi
19300
19301cat >>confdefs.h <<_ACEOF
c0c3707f
CB
19302#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
19303_ACEOF
88b48903
WN
19304
19305
c0c3707f 19306 if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
88b48903 19307
6ec2e0f5 19308
6ec2e0f5 19309
6ec2e0f5 19310
6ec2e0f5 19311
6ec2e0f5
SDJ
19312
19313
6ec2e0f5 19314
c0c3707f 19315 gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
6ec2e0f5 19316
c0c3707f 19317 :
5e8754f9 19318 fi
6ec2e0f5
SDJ
19319
19320
19321
6ec2e0f5
SDJ
19322
19323
5e8754f9 19324 GNULIB_GETTIMEOFDAY=1
6ec2e0f5
SDJ
19325
19326
19327
7a6dbc2f
SDJ
19328
19329
5e8754f9 19330$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
6ec2e0f5
SDJ
19331
19332
19333
6ec2e0f5 19334
6ec2e0f5 19335
6ec2e0f5
SDJ
19336
19337
c0c3707f
CB
19338 if test $ac_cv_func_glob = no; then
19339 HAVE_GLOB=0
19340 else
19341
19342 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU glob interface version 1 or 2" >&5
19343$as_echo_n "checking for GNU glob interface version 1 or 2... " >&6; }
19344if ${gl_cv_gnu_glob_interface_version_1_2+:} false; then :
6ec2e0f5
SDJ
19345 $as_echo_n "(cached) " >&6
19346else
19347 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19348/* end confdefs.h. */
19349#include <gnu-versions.h>
c0c3707f 19350char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1];
6ec2e0f5
SDJ
19351_ACEOF
19352if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 19353 gl_cv_gnu_glob_interface_version_1_2=yes
6ec2e0f5 19354else
c0c3707f 19355 gl_cv_gnu_glob_interface_version_1_2=no
6ec2e0f5
SDJ
19356fi
19357rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19358fi
c0c3707f
CB
19359{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_gnu_glob_interface_version_1_2" >&5
19360$as_echo "$gl_cv_gnu_glob_interface_version_1_2" >&6; }
19361 if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then
19362 REPLACE_GLOB=1
6ec2e0f5 19363 fi
6ec2e0f5 19364
c0c3707f
CB
19365 if test $REPLACE_GLOB = 0; then
19366 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether glob lists broken symlinks" >&5
6ec2e0f5 19367$as_echo_n "checking whether glob lists broken symlinks... " >&6; }
d0ac1c44 19368if ${gl_cv_glob_lists_symlinks+:} false; then :
6ec2e0f5
SDJ
19369 $as_echo_n "(cached) " >&6
19370else
c0c3707f
CB
19371 if test $cross_compiling != yes; then
19372 if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
19373 gl_cv_glob_lists_symlinks=maybe
19374 else
19375 # If we can't make a symlink, then we cannot test this issue. Be
19376 # pessimistic about this.
19377 gl_cv_glob_lists_symlinks=no
19378 fi
19379 if test $gl_cv_glob_lists_symlinks = maybe; then
19380 if test "$cross_compiling" = yes; then :
19381 :
5e8754f9 19382
6ec2e0f5
SDJ
19383else
19384 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19385/* end confdefs.h. */
6ec2e0f5 19386#include <stddef.h>
c0c3707f 19387 #include <glob.h>
6ec2e0f5
SDJ
19388int
19389main ()
19390{
19391glob_t found;
c0c3707f
CB
19392 if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
19393 return 1;
19394
6ec2e0f5
SDJ
19395 ;
19396 return 0;
19397}
4a626d0a 19398_ACEOF
6ec2e0f5
SDJ
19399if ac_fn_c_try_run "$LINENO"; then :
19400 gl_cv_glob_lists_symlinks=yes
19401else
19402 gl_cv_glob_lists_symlinks=no
19403fi
19404rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19405 conftest.$ac_objext conftest.beam conftest.$ac_ext
19406fi
88b48903 19407
c0c3707f
CB
19408 fi
19409 rm -f conf$$-globtest
19410 else
19411 gl_cv_glob_lists_symlinks="$gl_cross_guess_normal"
19412 fi
19413
4a626d0a 19414fi
6ec2e0f5
SDJ
19415{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_glob_lists_symlinks" >&5
19416$as_echo "$gl_cv_glob_lists_symlinks" >&6; }
c0c3707f
CB
19417 case "$gl_cv_glob_lists_symlinks" in
19418 *yes) ;;
19419 *) REPLACE_GLOB=1 ;;
19420 esac
19421 fi
19422
19423 fi
88b48903 19424
c0c3707f
CB
19425 if test $ac_cv_func_glob_pattern_p = no; then
19426 HAVE_GLOB_PATTERN_P=0
19427 else
19428 if test $REPLACE_GLOB = 1; then
19429 REPLACE_GLOB_PATTERN_P=1
6ec2e0f5
SDJ
19430 fi
19431 fi
4a626d0a 19432
c0c3707f 19433 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
4a626d0a 19434
88b48903 19435
c0c3707f 19436 GLOB_H='glob.h'
6ec2e0f5
SDJ
19437 if test -n "$GLOB_H"; then
19438 GL_GENERATE_GLOB_H_TRUE=
19439 GL_GENERATE_GLOB_H_FALSE='#'
19440else
19441 GL_GENERATE_GLOB_H_TRUE='#'
19442 GL_GENERATE_GLOB_H_FALSE=
19443fi
88b48903 19444
88b48903 19445
c0c3707f
CB
19446 fi
19447
19448 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
472fa5ee
SM
19449
19450
19451
19452
19453
19454
19455
19456
19457 gl_LIBOBJS="$gl_LIBOBJS glob.$ac_objext"
19458
19459
19460
7a6dbc2f
SDJ
19461
19462
19463
472fa5ee 19464
472fa5ee 19465
88b48903 19466
c0c3707f 19467 gl_LIBOBJS="$gl_LIBOBJS globfree.$ac_objext"
88b48903
WN
19468
19469
19470
725e2999
JB
19471
19472
19473
c0c3707f
CB
19474 fi
19475 if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then
19476
725e2999
JB
19477
19478
19479
19480
19481
19482
19483
c0c3707f 19484 gl_LIBOBJS="$gl_LIBOBJS glob_pattern_p.$ac_objext"
725e2999
JB
19485
19486 fi
19487
725e2999
JB
19488
19489
19490
19491
c0c3707f
CB
19492 GNULIB_GLOB=1
19493
19494
19495
19496
19497
19498$as_echo "#define GNULIB_TEST_GLOB 1" >>confdefs.h
19499
19500
725e2999
JB
19501
19502
19503
19504
725e2999
JB
19505
19506
19507
19508
725e2999 19509
c0c3707f
CB
19510 HAVE_INET_NTOP=1
19511 INET_NTOP_LIB=
725e2999
JB
19512
19513
19514
19515
19516 if test $ac_cv_header_sys_socket_h != yes; then
19517 for ac_header in winsock2.h
19518do :
19519 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
19520if test "x$ac_cv_header_winsock2_h" = xyes; then :
19521 cat >>confdefs.h <<_ACEOF
19522#define HAVE_WINSOCK2_H 1
19523_ACEOF
19524
19525fi
19526
19527done
19528
19529 fi
19530 if test "$ac_cv_header_winsock2_h" = yes; then
19531 HAVE_WINSOCK2_H=1
19532 UNISTD_H_HAVE_WINSOCK2_H=1
19533 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
19534 else
19535 HAVE_WINSOCK2_H=0
19536 fi
19537
19538
19539 if test $HAVE_WINSOCK2_H = 1; then
c0c3707f 19540 REPLACE_INET_NTOP=1
725e2999
JB
19541 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
19542"
19543if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
19544 ac_have_decl=1
19545else
19546 ac_have_decl=0
19547fi
19548
19549cat >>confdefs.h <<_ACEOF
19550#define HAVE_DECL_INET_NTOP $ac_have_decl
19551_ACEOF
19552
19553 if test $ac_cv_have_decl_inet_ntop = yes; then
725e2999
JB
19554 INET_NTOP_LIB="-lws2_32"
19555 else
19556 HAVE_DECL_INET_NTOP=0
725e2999
JB
19557 fi
19558 else
19559 gl_save_LIBS=$LIBS
19560 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
19561$as_echo_n "checking for library containing inet_ntop... " >&6; }
19562if ${ac_cv_search_inet_ntop+:} false; then :
19563 $as_echo_n "(cached) " >&6
19564else
19565 ac_func_search_save_LIBS=$LIBS
19566cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19567/* end confdefs.h. */
19568
19569/* Override any GCC internal prototype to avoid an error.
19570 Use char because int might match the return type of a GCC
19571 builtin and then its argument prototype would still apply. */
19572#ifdef __cplusplus
19573extern "C"
19574#endif
19575char inet_ntop ();
19576int
19577main ()
19578{
19579return inet_ntop ();
19580 ;
19581 return 0;
19582}
19583_ACEOF
c0c3707f 19584for ac_lib in '' nsl resolv network; do
725e2999
JB
19585 if test -z "$ac_lib"; then
19586 ac_res="none required"
19587 else
19588 ac_res=-l$ac_lib
19589 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
19590 fi
19591 if ac_fn_c_try_link "$LINENO"; then :
19592 ac_cv_search_inet_ntop=$ac_res
19593fi
19594rm -f core conftest.err conftest.$ac_objext \
19595 conftest$ac_exeext
19596 if ${ac_cv_search_inet_ntop+:} false; then :
19597 break
19598fi
19599done
19600if ${ac_cv_search_inet_ntop+:} false; then :
19601
19602else
19603 ac_cv_search_inet_ntop=no
19604fi
19605rm conftest.$ac_ext
19606LIBS=$ac_func_search_save_LIBS
19607fi
19608{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
19609$as_echo "$ac_cv_search_inet_ntop" >&6; }
19610ac_res=$ac_cv_search_inet_ntop
19611if test "$ac_res" != no; then :
19612 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
19613
19614else
19615 for ac_func in inet_ntop
19616do :
19617 ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
19618if test "x$ac_cv_func_inet_ntop" = xyes; then :
19619 cat >>confdefs.h <<_ACEOF
19620#define HAVE_INET_NTOP 1
19621_ACEOF
19622
19623fi
19624done
19625
19626 if test $ac_cv_func_inet_ntop = no; then
19627 HAVE_INET_NTOP=0
19628 fi
19629
19630fi
19631
19632 LIBS=$gl_save_LIBS
19633
19634 if test "$ac_cv_search_inet_ntop" != "no" \
19635 && test "$ac_cv_search_inet_ntop" != "none required"; then
19636 INET_NTOP_LIB="$ac_cv_search_inet_ntop"
19637 fi
19638
19639
725e2999
JB
19640 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
19641 #if HAVE_NETDB_H
19642 # include <netdb.h>
19643 #endif
19644
19645"
19646if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
19647 ac_have_decl=1
19648else
19649 ac_have_decl=0
19650fi
19651
19652cat >>confdefs.h <<_ACEOF
19653#define HAVE_DECL_INET_NTOP $ac_have_decl
19654_ACEOF
19655
19656 if test $ac_cv_have_decl_inet_ntop = no; then
19657 HAVE_DECL_INET_NTOP=0
19658 fi
19659 fi
19660
19661
19662 if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
19663
19664
19665
19666
19667
19668
19669
7a6dbc2f 19670
725e2999 19671 gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext"
7a6dbc2f
SDJ
19672
19673
19674
7a6dbc2f 19675
725e2999 19676 fi
7a6dbc2f
SDJ
19677
19678
19679
19680
7a6dbc2f 19681
725e2999
JB
19682 GNULIB_INET_NTOP=1
19683
7a6dbc2f
SDJ
19684
19685
49e4877c
PA
19686
19687
88b48903
WN
19688
19689
19690
19691
19692 PRIPTR_PREFIX=
19693 if test -n "$STDINT_H"; then
19694 PRIPTR_PREFIX='"l"'
19695 else
19696 for glpfx in '' l ll I64; do
19697 case $glpfx in
19698 '') gltype1='int';;
19699 l) gltype1='long int';;
19700 ll) gltype1='long long int';;
19701 I64) gltype1='__int64';;
19702 esac
19703 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19704/* end confdefs.h. */
19705#include <stdint.h>
19706 extern intptr_t foo;
19707 extern $gltype1 foo;
19708int
19709main ()
19710{
19711
19712 ;
19713 return 0;
19714}
19715_ACEOF
19716if ac_fn_c_try_compile "$LINENO"; then :
19717 PRIPTR_PREFIX='"'$glpfx'"'
19718fi
19719rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19720 test -n "$PRIPTR_PREFIX" && break
19721 done
19722 fi
19723
19724
19725
19726 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
19727$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
d0ac1c44 19728if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then :
88b48903
WN
19729 $as_echo_n "(cached) " >&6
19730else
19731 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19732/* end confdefs.h. */
19733/* Work also in C++ mode. */
19734 #define __STDC_LIMIT_MACROS 1
19735
19736 /* Work if build is not clean. */
19737 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
19738
19739 #include <limits.h>
19740 #if HAVE_STDINT_H
19741 #include <stdint.h>
19742 #endif
19743
19744 #if defined INT32_MAX && defined INTMAX_MAX
19745 #define CONDITION (INT32_MAX < INTMAX_MAX)
19746 #elif HAVE_LONG_LONG_INT
19747 #define CONDITION (sizeof (int) < sizeof (long long int))
19748 #else
19749 #define CONDITION 0
19750 #endif
19751 int test[CONDITION ? 1 : -1];
19752int
19753main ()
19754{
19755
19756 ;
19757 return 0;
19758}
19759_ACEOF
19760if ac_fn_c_try_compile "$LINENO"; then :
19761 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
19762else
19763 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
19764fi
19765rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19766fi
19767{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
19768$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
19769 if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
19770 INT32_MAX_LT_INTMAX_MAX=1;
19771 else
19772 INT32_MAX_LT_INTMAX_MAX=0;
19773 fi
19774
19775
19776 if test $APPLE_UNIVERSAL_BUILD = 0; then
19777
19778 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
19779$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; }
d0ac1c44 19780if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then :
88b48903
WN
19781 $as_echo_n "(cached) " >&6
19782else
19783 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19784/* end confdefs.h. */
19785/* Work also in C++ mode. */
19786 #define __STDC_LIMIT_MACROS 1
19787
19788 /* Work if build is not clean. */
19789 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
19790
19791 #include <limits.h>
19792 #if HAVE_STDINT_H
19793 #include <stdint.h>
19794 #endif
19795
19796 #if defined INT64_MAX
19797 #define CONDITION (INT64_MAX == LONG_MAX)
19798 #elif HAVE_LONG_LONG_INT
19799 #define CONDITION (sizeof (long long int) == sizeof (long int))
19800 #else
19801 #define CONDITION 0
19802 #endif
19803 int test[CONDITION ? 1 : -1];
19804int
19805main ()
19806{
19807
19808 ;
19809 return 0;
19810}
19811_ACEOF
19812if ac_fn_c_try_compile "$LINENO"; then :
19813 gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
19814else
19815 gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
19816fi
19817rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19818fi
19819{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
19820$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
19821 if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
19822 INT64_MAX_EQ_LONG_MAX=1;
19823 else
19824 INT64_MAX_EQ_LONG_MAX=0;
19825 fi
19826
19827
19828 else
19829 INT64_MAX_EQ_LONG_MAX=-1
19830 fi
19831
19832 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
19833$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
d0ac1c44 19834if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then :
88b48903
WN
19835 $as_echo_n "(cached) " >&6
19836else
19837 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19838/* end confdefs.h. */
19839/* Work also in C++ mode. */
19840 #define __STDC_LIMIT_MACROS 1
19841
19842 /* Work if build is not clean. */
19843 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
19844
19845 #include <limits.h>
19846 #if HAVE_STDINT_H
19847 #include <stdint.h>
19848 #endif
19849
19850 #if defined UINT32_MAX && defined UINTMAX_MAX
19851 #define CONDITION (UINT32_MAX < UINTMAX_MAX)
19852 #elif HAVE_LONG_LONG_INT
19853 #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
19854 #else
19855 #define CONDITION 0
19856 #endif
19857 int test[CONDITION ? 1 : -1];
19858int
19859main ()
19860{
19861
19862 ;
19863 return 0;
19864}
19865_ACEOF
19866if ac_fn_c_try_compile "$LINENO"; then :
19867 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
19868else
19869 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
19870fi
19871rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19872fi
19873{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
19874$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
19875 if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
19876 UINT32_MAX_LT_UINTMAX_MAX=1;
19877 else
19878 UINT32_MAX_LT_UINTMAX_MAX=0;
19879 fi
19880
19881
19882 if test $APPLE_UNIVERSAL_BUILD = 0; then
19883
19884 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
19885$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
d0ac1c44 19886if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then :
88b48903
WN
19887 $as_echo_n "(cached) " >&6
19888else
19889 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19890/* end confdefs.h. */
19891/* Work also in C++ mode. */
19892 #define __STDC_LIMIT_MACROS 1
19893
19894 /* Work if build is not clean. */
19895 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
19896
19897 #include <limits.h>
19898 #if HAVE_STDINT_H
19899 #include <stdint.h>
19900 #endif
19901
19902 #if defined UINT64_MAX
19903 #define CONDITION (UINT64_MAX == ULONG_MAX)
19904 #elif HAVE_LONG_LONG_INT
19905 #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
19906 #else
19907 #define CONDITION 0
19908 #endif
19909 int test[CONDITION ? 1 : -1];
19910int
19911main ()
19912{
19913
19914 ;
19915 return 0;
19916}
19917_ACEOF
19918if ac_fn_c_try_compile "$LINENO"; then :
19919 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
19920else
19921 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
19922fi
19923rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19924fi
19925{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
19926$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
19927 if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
19928 UINT64_MAX_EQ_ULONG_MAX=1;
19929 else
19930 UINT64_MAX_EQ_ULONG_MAX=0;
19931 fi
19932
19933
19934 else
19935 UINT64_MAX_EQ_ULONG_MAX=-1
19936 fi
19937
19938
19939
19940
19941
19942 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
19943$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
d0ac1c44 19944if ${gl_cv_func_isnand_no_libm+:} false; then :
88b48903
WN
19945 $as_echo_n "(cached) " >&6
19946else
19947
19948 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19949/* end confdefs.h. */
19950#include <math.h>
19951 #if __GNUC__ >= 4
19952 # undef isnand
19953 # define isnand(x) __builtin_isnan ((double)(x))
19954 #else
19955 # undef isnand
19956 # define isnand(x) isnan ((double)(x))
19957 #endif
19958 double x;
19959int
19960main ()
19961{
19962return isnand (x);
19963 ;
19964 return 0;
19965}
19966_ACEOF
19967if ac_fn_c_try_link "$LINENO"; then :
19968 gl_cv_func_isnand_no_libm=yes
19969else
19970 gl_cv_func_isnand_no_libm=no
19971fi
19972rm -f core conftest.err conftest.$ac_objext \
19973 conftest$ac_exeext conftest.$ac_ext
19974
19975fi
19976{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
19977$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
19978
19979 gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
19980 if test $gl_cv_func_isnand_no_libm = yes; then
19981
19982$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
19983
19984 fi
19985
19986 if test $gl_func_isnand_no_libm != yes; then
19987
19988
19989
19990
19991
19992
19993
19994
19995 gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext"
19996
19997
19998
19999
20000 fi
20001
20002
20003 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
20004$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; }
d0ac1c44 20005if ${gl_cv_func_isnanl_no_libm+:} false; then :
88b48903
WN
20006 $as_echo_n "(cached) " >&6
20007else
20008
20009 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20010/* end confdefs.h. */
20011#include <math.h>
20012 #if __GNUC__ >= 4
20013 # undef isnanl
20014 # define isnanl(x) __builtin_isnanl ((long double)(x))
20015 #elif defined isnan
20016 # undef isnanl
20017 # define isnanl(x) isnan ((long double)(x))
20018 #endif
20019 long double x;
20020int
20021main ()
20022{
20023return isnanl (x);
20024 ;
20025 return 0;
20026}
20027_ACEOF
20028if ac_fn_c_try_link "$LINENO"; then :
20029 gl_cv_func_isnanl_no_libm=yes
20030else
20031 gl_cv_func_isnanl_no_libm=no
20032fi
20033rm -f core conftest.err conftest.$ac_objext \
20034 conftest$ac_exeext conftest.$ac_ext
20035
20036fi
20037{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5
20038$as_echo "$gl_cv_func_isnanl_no_libm" >&6; }
20039
20040 gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
20041 if test $gl_func_isnanl_no_libm = yes; then
20042
20043
20044
20045
20046 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
20047$as_echo_n "checking whether isnanl works... " >&6; }
d0ac1c44 20048if ${gl_cv_func_isnanl_works+:} false; then :
88b48903
WN
20049 $as_echo_n "(cached) " >&6
20050else
20051
20052 if test "$cross_compiling" = yes; then :
c0c3707f
CB
20053 case "$host_os" in
20054 mingw*) # Guess yes on mingw, no on MSVC.
20055 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20056/* end confdefs.h. */
20057
20058#ifdef __MINGW32__
20059 Known
20060#endif
20061
20062_ACEOF
20063if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20064 $EGREP "Known" >/dev/null 2>&1; then :
4a626d0a 20065 gl_cv_func_isnanl_works="guessing yes"
c0c3707f
CB
20066else
20067 gl_cv_func_isnanl_works="guessing no"
20068fi
20069rm -f conftest*
20070
20071 ;;
20072 *) gl_cv_func_isnanl_works="guessing yes" ;;
20073 esac
20074
88b48903
WN
20075else
20076 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20077/* end confdefs.h. */
20078
20079#include <float.h>
20080#include <limits.h>
20081#include <math.h>
20082#if __GNUC__ >= 4
20083# undef isnanl
20084# define isnanl(x) __builtin_isnanl ((long double)(x))
20085#elif defined isnan
20086# undef isnanl
20087# define isnanl(x) isnan ((long double)(x))
20088#endif
20089#define NWORDS \
20090 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
20091typedef union { unsigned int word[NWORDS]; long double value; }
20092 memory_long_double;
20093/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
20094 runtime type conversion. */
20095#ifdef __sgi
20096static long double NaNl ()
20097{
20098 double zero = 0.0;
20099 return zero / zero;
20100}
20101#else
20102# define NaNl() (0.0L / 0.0L)
20103#endif
20104int main ()
20105{
20106 int result = 0;
20107
20108 if (!isnanl (NaNl ()))
20109 result |= 1;
20110
20111 {
20112 memory_long_double m;
20113 unsigned int i;
20114
20115 /* The isnanl function should be immune against changes in the sign bit and
20116 in the mantissa bits. The xor operation twiddles a bit that can only be
20117 a sign bit or a mantissa bit (since the exponent never extends to
20118 bit 31). */
20119 m.value = NaNl ();
20120 m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
20121 for (i = 0; i < NWORDS; i++)
20122 m.word[i] |= 1;
20123 if (!isnanl (m.value))
20124 result |= 1;
20125 }
20126
20127#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
20128/* Representation of an 80-bit 'long double' as an initializer for a sequence
20129 of 'unsigned int' words. */
20130# ifdef WORDS_BIGENDIAN
20131# define LDBL80_WORDS(exponent,manthi,mantlo) \
20132 { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
4a626d0a 20133 ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
88b48903
WN
20134 (unsigned int) (mantlo) << 16 \
20135 }
20136# else
20137# define LDBL80_WORDS(exponent,manthi,mantlo) \
20138 { mantlo, manthi, exponent }
20139# endif
20140 { /* Quiet NaN. */
20141 static memory_long_double x =
20142 { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
20143 if (!isnanl (x.value))
20144 result |= 2;
20145 }
20146 {
20147 /* Signalling NaN. */
20148 static memory_long_double x =
20149 { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
20150 if (!isnanl (x.value))
20151 result |= 2;
20152 }
4a626d0a 20153 /* isnanl should return something even for noncanonical values. */
88b48903
WN
20154 { /* Pseudo-NaN. */
20155 static memory_long_double x =
20156 { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
4a626d0a 20157 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
20158 result |= 4;
20159 }
20160 { /* Pseudo-Infinity. */
20161 static memory_long_double x =
20162 { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
4a626d0a 20163 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
20164 result |= 8;
20165 }
20166 { /* Pseudo-Zero. */
20167 static memory_long_double x =
20168 { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
4a626d0a 20169 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
20170 result |= 16;
20171 }
20172 { /* Unnormalized number. */
20173 static memory_long_double x =
20174 { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
4a626d0a 20175 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
20176 result |= 32;
20177 }
20178 { /* Pseudo-Denormal. */
20179 static memory_long_double x =
20180 { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
4a626d0a 20181 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
20182 result |= 64;
20183 }
20184#endif
20185
20186 return result;
20187}
20188_ACEOF
20189if ac_fn_c_try_run "$LINENO"; then :
20190 gl_cv_func_isnanl_works=yes
20191else
20192 gl_cv_func_isnanl_works=no
20193fi
20194rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20195 conftest.$ac_objext conftest.beam conftest.$ac_ext
20196fi
20197
20198
20199fi
20200{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5
20201$as_echo "$gl_cv_func_isnanl_works" >&6; }
20202
20203 case "$gl_cv_func_isnanl_works" in
20204 *yes) ;;
20205 *) gl_func_isnanl_no_libm=no ;;
20206 esac
20207 fi
20208 if test $gl_func_isnanl_no_libm = yes; then
20209
20210$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
20211
20212 fi
20213
20214 if test $gl_func_isnanl_no_libm != yes; then
20215
20216
20217
20218
20219
20220
20221
20222
20223 gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext"
20224
20225
20226
20227
c0c3707f 20228 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
88b48903 20229$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
d0ac1c44 20230if ${gl_cv_cc_long_double_expbit0+:} false; then :
88b48903
WN
20231 $as_echo_n "(cached) " >&6
20232else
20233
20234 if test "$cross_compiling" = yes; then :
20235
20236 gl_cv_cc_long_double_expbit0="unknown"
c0c3707f
CB
20237 case "$host_os" in
20238 mingw*) # On native Windows (little-endian), we know the result
20239 # in two cases: mingw, MSVC.
20240 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20241/* end confdefs.h. */
20242
20243#ifdef __MINGW32__
20244 Known
20245#endif
20246
20247_ACEOF
20248if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20249 $EGREP "Known" >/dev/null 2>&1; then :
20250 gl_cv_cc_long_double_expbit0="word 2 bit 0"
20251fi
20252rm -f conftest*
20253
20254 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20255/* end confdefs.h. */
20256
20257#ifdef _MSC_VER
20258 Known
20259#endif
20260
20261_ACEOF
20262if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20263 $EGREP "Known" >/dev/null 2>&1; then :
20264 gl_cv_cc_long_double_expbit0="word 1 bit 20"
20265fi
20266rm -f conftest*
20267
20268 ;;
20269 esac
88b48903
WN
20270
20271else
20272 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20273/* end confdefs.h. */
20274
20275#include <float.h>
20276#include <stddef.h>
20277#include <stdio.h>
20278#include <string.h>
20279#define NWORDS \
20280 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
20281typedef union { long double value; unsigned int word[NWORDS]; }
20282 memory_long_double;
20283static unsigned int ored_words[NWORDS];
20284static unsigned int anded_words[NWORDS];
20285static void add_to_ored_words (long double x)
20286{
20287 memory_long_double m;
20288 size_t i;
20289 /* Clear it first, in case
20290 sizeof (long double) < sizeof (memory_long_double). */
20291 memset (&m, 0, sizeof (memory_long_double));
20292 m.value = x;
20293 for (i = 0; i < NWORDS; i++)
20294 {
20295 ored_words[i] |= m.word[i];
20296 anded_words[i] &= m.word[i];
20297 }
20298}
20299int main ()
20300{
20301 size_t j;
20302 FILE *fp = fopen ("conftest.out", "w");
20303 if (fp == NULL)
20304 return 1;
20305 for (j = 0; j < NWORDS; j++)
20306 anded_words[j] = ~ (unsigned int) 0;
20307 add_to_ored_words (0.25L);
20308 add_to_ored_words (0.5L);
20309 add_to_ored_words (1.0L);
20310 add_to_ored_words (2.0L);
20311 add_to_ored_words (4.0L);
20312 /* Remove bits that are common (e.g. if representation of the first mantissa
20313 bit is explicit). */
20314 for (j = 0; j < NWORDS; j++)
20315 ored_words[j] &= ~anded_words[j];
20316 /* Now find the nonzero word. */
20317 for (j = 0; j < NWORDS; j++)
20318 if (ored_words[j] != 0)
20319 break;
20320 if (j < NWORDS)
20321 {
20322 size_t i;
20323 for (i = j + 1; i < NWORDS; i++)
20324 if (ored_words[i] != 0)
20325 {
20326 fprintf (fp, "unknown");
20327 return (fclose (fp) != 0);
20328 }
20329 for (i = 0; ; i++)
20330 if ((ored_words[j] >> i) & 1)
20331 {
20332 fprintf (fp, "word %d bit %d", (int) j, (int) i);
20333 return (fclose (fp) != 0);
20334 }
20335 }
20336 fprintf (fp, "unknown");
20337 return (fclose (fp) != 0);
20338}
20339
20340_ACEOF
20341if ac_fn_c_try_run "$LINENO"; then :
20342 gl_cv_cc_long_double_expbit0=`cat conftest.out`
20343else
20344 gl_cv_cc_long_double_expbit0="unknown"
20345fi
20346rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20347 conftest.$ac_objext conftest.beam conftest.$ac_ext
20348fi
20349
20350 rm -f conftest.out
20351
20352fi
20353{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
20354$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
20355 case "$gl_cv_cc_long_double_expbit0" in
20356 word*bit*)
20357 word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
20358 bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
20359
20360cat >>confdefs.h <<_ACEOF
20361#define LDBL_EXPBIT0_WORD $word
20362_ACEOF
20363
20364
20365cat >>confdefs.h <<_ACEOF
20366#define LDBL_EXPBIT0_BIT $bit
20367_ACEOF
20368
20369 ;;
20370 esac
20371
20372
20373
20374 fi
20375
20376
c0c3707f
CB
20377 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5
20378$as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; }
20379if ${gl_cv_c___inline+:} false; then :
20380 $as_echo_n "(cached) " >&6
20381else
20382 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20383/* end confdefs.h. */
20384typedef int foo_t;
20385 static __inline foo_t foo (void) { return 0; }
20386int
20387main ()
20388{
20389return foo ();
20390 ;
20391 return 0;
20392}
20393_ACEOF
20394if ac_fn_c_try_compile "$LINENO"; then :
20395 gl_cv_c___inline=yes
20396else
20397 gl_cv_c___inline=no
20398fi
20399rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20400fi
20401{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5
20402$as_echo "$gl_cv_c___inline" >&6; }
20403 if test $gl_cv_c___inline = yes; then
20404
20405$as_echo "#define HAVE___INLINE 1" >>confdefs.h
20406
20407 fi
88b48903
WN
20408
20409
88b48903
WN
20410
20411
472fa5ee 20412
c0c3707f 20413 LOCALCHARSET_TESTS_ENVIRONMENT=
472fa5ee
SM
20414
20415
20416
20417
88b48903
WN
20418
20419
2196f55f 20420
49e4877c 20421
c0c3707f
CB
20422
20423
20424 gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext"
88b48903
WN
20425
20426
20427
5abebf3c
CB
20428 if test "$gl_threads_api" = posix; then
20429 # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
20430 # pthread_rwlock_* functions.
c0c3707f 20431 has_rwlock=false
5abebf3c
CB
20432 ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
20433"
20434if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
c0c3707f 20435 has_rwlock=true
5abebf3c
CB
20436
20437$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
20438
20439fi
20440
c0c3707f
CB
20441 if $has_rwlock; then
20442
20443
20444 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5
20445$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; }
20446if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then :
20447 $as_echo_n "(cached) " >&6
20448else
20449 save_LIBS="$LIBS"
20450 LIBS="$LIBS $LIBMULTITHREAD"
20451 if test "$cross_compiling" = yes; then :
20452 case "$host_os" in
20453 # Guess no on glibc systems.
20454 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
20455 # Guess no on musl systems.
20456 *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
20457 # Guess no on bionic systems.
20458 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
20459 # Guess yes on native Windows with the mingw-w64 winpthreads library.
20460 # Guess no on native Windows with the gnulib windows-rwlock module.
20461 mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
20462 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
20463 else
20464 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
20465 fi
20466 ;;
20467 # If we don't know, obey --enable-cross-guesses.
20468 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
20469 esac
20470
20471else
20472 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20473/* end confdefs.h. */
20474
20475#include <errno.h>
20476#include <pthread.h>
20477#include <stdlib.h>
20478#include <unistd.h>
20479
20480#define SUCCEED() exit (0)
20481#define FAILURE() exit (1)
20482#define UNEXPECTED(n) (exit (10 + (n)))
20483
20484/* The main thread creates the waiting writer and the requesting reader threads
20485 in the default way; this guarantees that they have the same priority.
20486 We can reuse the main thread as first reader thread. */
20487
20488static pthread_rwlock_t lock;
20489static pthread_t reader1;
20490static pthread_t writer;
20491static pthread_t reader2;
20492static pthread_t timer;
20493/* Used to pass control from writer to reader2 and from reader2 to timer,
20494 as in a relay race.
20495 Passing control from one running thread to another running thread
20496 is most likely faster than to create the second thread. */
20497static pthread_mutex_t baton;
20498
20499static void *
20500timer_func (void *ignored)
20501{
20502 /* Step 13 (can be before or after step 12):
20503 The timer thread takes the baton, then waits a moment to make sure
20504 it can tell whether the second reader thread is blocked at step 12. */
20505 if (pthread_mutex_lock (&baton))
20506 UNEXPECTED (13);
20507 usleep (100000);
20508 /* By the time we get here, it's clear that the second reader thread is
20509 blocked at step 12. This is the desired behaviour. */
20510 SUCCEED ();
20511}
20512
20513static void *
20514reader2_func (void *ignored)
20515{
20516 int err;
20517
20518 /* Step 8 (can be before or after step 7):
20519 The second reader thread takes the baton, then waits a moment to make sure
20520 the writer thread has reached step 7. */
20521 if (pthread_mutex_lock (&baton))
20522 UNEXPECTED (8);
20523 usleep (100000);
20524 /* Step 9: The second reader thread requests the lock. */
20525 err = pthread_rwlock_tryrdlock (&lock);
20526 if (err == 0)
20527 FAILURE ();
20528 else if (err != EBUSY)
20529 UNEXPECTED (9);
20530 /* Step 10: Launch a timer, to test whether the next call blocks. */
20531 if (pthread_create (&timer, NULL, timer_func, NULL))
20532 UNEXPECTED (10);
20533 /* Step 11: Release the baton. */
20534 if (pthread_mutex_unlock (&baton))
20535 UNEXPECTED (11);
20536 /* Step 12: The second reader thread requests the lock. */
20537 err = pthread_rwlock_rdlock (&lock);
20538 if (err == 0)
20539 FAILURE ();
20540 else
20541 UNEXPECTED (12);
20542}
20543
20544static void *
20545writer_func (void *ignored)
20546{
20547 /* Step 4: Take the baton, so that the second reader thread does not go ahead
20548 too early. */
20549 if (pthread_mutex_lock (&baton))
20550 UNEXPECTED (4);
20551 /* Step 5: Create the second reader thread. */
20552 if (pthread_create (&reader2, NULL, reader2_func, NULL))
20553 UNEXPECTED (5);
20554 /* Step 6: Release the baton. */
20555 if (pthread_mutex_unlock (&baton))
20556 UNEXPECTED (6);
20557 /* Step 7: The writer thread requests the lock. */
20558 if (pthread_rwlock_wrlock (&lock))
20559 UNEXPECTED (7);
20560 return NULL;
20561}
20562
20563int
20564main ()
20565{
20566 reader1 = pthread_self ();
20567
20568 /* Step 1: The main thread initializes the lock and the baton. */
20569 if (pthread_rwlock_init (&lock, NULL))
20570 UNEXPECTED (1);
20571 if (pthread_mutex_init (&baton, NULL))
20572 UNEXPECTED (1);
20573 /* Step 2: The main thread acquires the lock as a reader. */
20574 if (pthread_rwlock_rdlock (&lock))
20575 UNEXPECTED (2);
20576 /* Step 3: Create the writer thread. */
20577 if (pthread_create (&writer, NULL, writer_func, NULL))
20578 UNEXPECTED (3);
20579 /* Job done. Go to sleep. */
20580 for (;;)
20581 {
20582 sleep (1);
20583 }
20584}
20585
20586_ACEOF
20587if ac_fn_c_try_run "$LINENO"; then :
20588 gl_cv_pthread_rwlock_rdlock_prefer_writer=yes
20589else
20590 gl_cv_pthread_rwlock_rdlock_prefer_writer=no
20591fi
20592rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20593 conftest.$ac_objext conftest.beam conftest.$ac_ext
20594fi
20595
20596 LIBS="$save_LIBS"
20597
20598fi
20599{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5
20600$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; }
20601 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
20602 *yes)
20603
20604$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h
20605
20606 ;;
20607 esac
20608
20609 fi
5abebf3c
CB
20610 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
20611 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20612/* end confdefs.h. */
20613
20614 #include <pthread.h>
20615int
20616main ()
20617{
20618
20619#if __FreeBSD__ == 4
20620error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
20621#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
20622 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
20623error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
20624#else
20625int x = (int)PTHREAD_MUTEX_RECURSIVE;
20626return !x;
20627#endif
20628
20629 ;
20630 return 0;
20631}
20632_ACEOF
20633if ac_fn_c_try_compile "$LINENO"; then :
20634
20635$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
20636
20637fi
20638rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20639 fi
20640 :
20641
20642
20643
20644cat >>confdefs.h <<_ACEOF
20645#define GNULIB_LOCK 1
20646_ACEOF
20647
20648
20649
20650
88b48903 20651
472fa5ee 20652
f45c62c4
YQ
20653 if test $ac_cv_func_lstat = yes; then
20654
c0c3707f
CB
20655 case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
20656 solaris* | *no)
f45c62c4
YQ
20657 REPLACE_LSTAT=1
20658 ;;
20659 esac
20660 else
20661 HAVE_LSTAT=0
20662 fi
20663
20664 if test $REPLACE_LSTAT = 1; then
20665
20666
20667
20668
20669
20670
20671
20672
20673 gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
20674
20675 :
20676 fi
20677
20678
20679
20680
20681
20682 GNULIB_LSTAT=1
20683
20684
20685
20686
20687
20688$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
20689
20690
20691
20692
20693
20694
6a29c58e
YQ
20695 if test $gl_cv_func_malloc_posix = yes; then
20696
20697$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
20698
20699 else
20700 REPLACE_MALLOC=1
20701 fi
20702
20703 if test $REPLACE_MALLOC = 1; then
20704
20705
20706
20707
20708
20709
20710
20711
20712 gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
20713
20714 fi
20715
20716
20717
20718
20719
20720 GNULIB_MALLOC_POSIX=1
20721
20722
20723
20724
20725
20726$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
20727
20728
20729
20730
20731
20732
88b48903
WN
20733
20734
20735
20736
20737
88b48903 20738
c971b7fa 20739
c971b7fa 20740
98399780
YQ
20741
20742
20743
20744
88b48903
WN
20745 if test $gl_cv_have_include_next = yes; then
20746 gl_cv_next_math_h='<'math.h'>'
20747 else
20748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
20749$as_echo_n "checking absolute name of <math.h>... " >&6; }
d0ac1c44 20750if ${gl_cv_next_math_h+:} false; then :
88b48903
WN
20751 $as_echo_n "(cached) " >&6
20752else
c971b7fa 20753
88b48903 20754 if test $ac_cv_header_math_h = yes; then
c971b7fa
PA
20755
20756
4a626d0a
PA
20757
20758
20759 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 20760/* end confdefs.h. */
88b48903 20761#include <math.h>
8690e634 20762_ACEOF
4a626d0a
PA
20763 case "$host_os" in
20764 aix*) gl_absname_cpp="$ac_cpp -C" ;;
20765 *) gl_absname_cpp="$ac_cpp" ;;
20766 esac
20767
20768 case "$host_os" in
20769 mingw*)
20770 gl_dirsep_regex='[/\\]'
20771 ;;
20772 *)
20773 gl_dirsep_regex='\/'
20774 ;;
20775 esac
20776 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
20777 gl_header_literal_regex=`echo 'math.h' \
20778 | sed -e "$gl_make_literal_regex_sed"`
20779 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
20780 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
20781 s|^/[^/]|//&|
20782 p
20783 q
20784 }'
20785
20786 gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
20787 sed -n "$gl_absolute_header_sed"`
20788
20789 gl_header=$gl_cv_absolute_math_h
20790 gl_cv_next_math_h='"'$gl_header'"'
88b48903
WN
20791 else
20792 gl_cv_next_math_h='<'math.h'>'
20793 fi
8690e634 20794
c971b7fa 20795
88b48903
WN
20796fi
20797{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
20798$as_echo "$gl_cv_next_math_h" >&6; }
20799 fi
20800 NEXT_MATH_H=$gl_cv_next_math_h
c971b7fa 20801
88b48903
WN
20802 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
20803 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
20804 gl_next_as_first_directive='<'math.h'>'
20805 else
20806 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
20807 gl_next_as_first_directive=$gl_cv_next_math_h
20808 fi
20809 NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
8690e634 20810
c971b7fa 20811
c971b7fa
PA
20812
20813
c971b7fa 20814
88b48903
WN
20815 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
20816$as_echo_n "checking whether NAN macro works... " >&6; }
d0ac1c44 20817if ${gl_cv_header_math_nan_works+:} false; then :
c971b7fa
PA
20818 $as_echo_n "(cached) " >&6
20819else
8690e634
JK
20820 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20821/* end confdefs.h. */
88b48903 20822#include <math.h>
c971b7fa
PA
20823int
20824main ()
20825{
88b48903
WN
20826/* Solaris 10 has a broken definition of NAN. Other platforms
20827 fail to provide NAN, or provide it only in C99 mode; this
20828 test only needs to fail when NAN is provided but wrong. */
20829 float f = 1.0f;
20830#ifdef NAN
20831 f = NAN;
20832#endif
20833 return f == 0;
c971b7fa
PA
20834 ;
20835 return 0;
20836}
20837_ACEOF
20838if ac_fn_c_try_compile "$LINENO"; then :
88b48903 20839 gl_cv_header_math_nan_works=yes
8690e634 20840else
88b48903 20841 gl_cv_header_math_nan_works=no
c971b7fa
PA
20842fi
20843rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 20844fi
88b48903
WN
20845{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
20846$as_echo "$gl_cv_header_math_nan_works" >&6; }
20847 if test $gl_cv_header_math_nan_works = no; then
20848 REPLACE_NAN=1
c971b7fa 20849 fi
88b48903
WN
20850 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
20851$as_echo_n "checking whether HUGE_VAL works... " >&6; }
d0ac1c44 20852if ${gl_cv_header_math_huge_val_works+:} false; then :
c971b7fa
PA
20853 $as_echo_n "(cached) " >&6
20854else
8690e634 20855 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 20856/* end confdefs.h. */
88b48903 20857#include <math.h>
c971b7fa
PA
20858int
20859main ()
20860{
88b48903
WN
20861/* Solaris 10 has a broken definition of HUGE_VAL. */
20862 double d = HUGE_VAL;
20863 return d == 0;
c971b7fa
PA
20864 ;
20865 return 0;
20866}
20867_ACEOF
20868if ac_fn_c_try_compile "$LINENO"; then :
88b48903 20869 gl_cv_header_math_huge_val_works=yes
8690e634 20870else
88b48903 20871 gl_cv_header_math_huge_val_works=no
c971b7fa
PA
20872fi
20873rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 20874fi
88b48903
WN
20875{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
20876$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
20877 if test $gl_cv_header_math_huge_val_works = no; then
20878 REPLACE_HUGE_VAL=1
8690e634 20879 fi
c971b7fa 20880
c971b7fa 20881
c971b7fa
PA
20882
20883
20884
20885
20886
20887
c971b7fa 20888
c971b7fa 20889
c971b7fa 20890
c971b7fa
PA
20891
20892
c971b7fa 20893
472fa5ee 20894
c0c3707f 20895 if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
472fa5ee
SM
20896
20897
20898
20899
c0c3707f
CB
20900 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
20901$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
20902if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
20903 $as_echo_n "(cached) " >&6
20904else
472fa5ee 20905
c0c3707f
CB
20906 case "$host_os" in
20907 # Guess no on AIX and OSF/1.
20908 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
20909 # Guess yes otherwise.
20910 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
20911 esac
20912 if test $LOCALE_JA != none; then
20913 if test "$cross_compiling" = yes; then :
472fa5ee 20914 :
c0c3707f
CB
20915else
20916 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20917/* end confdefs.h. */
472fa5ee 20918
c0c3707f
CB
20919#include <locale.h>
20920#include <string.h>
20921/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20922 <wchar.h>.
20923 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
20924 included before <wchar.h>. */
20925#include <stddef.h>
20926#include <stdio.h>
20927#include <time.h>
20928#include <wchar.h>
20929int main ()
20930{
20931 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
20932 {
20933 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
20934 mbstate_t state;
20935 wchar_t wc;
472fa5ee 20936
c0c3707f
CB
20937 memset (&state, '\0', sizeof (mbstate_t));
20938 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
20939 if (mbsinit (&state))
20940 return 2;
20941 }
20942 return 0;
20943}
20944_ACEOF
20945if ac_fn_c_try_run "$LINENO"; then :
20946 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 20947else
c0c3707f
CB
20948 gl_cv_func_mbrtowc_incomplete_state=no
20949fi
20950rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20951 conftest.$ac_objext conftest.beam conftest.$ac_ext
20952fi
8690e634 20953
c0c3707f
CB
20954 else
20955 if test $LOCALE_FR_UTF8 != none; then
20956 if test "$cross_compiling" = yes; then :
8690e634
JK
20957 :
20958else
c971b7fa
PA
20959 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20960/* end confdefs.h. */
c971b7fa 20961
8690e634
JK
20962#include <locale.h>
20963#include <string.h>
20964/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20965 <wchar.h>.
20966 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
20967 included before <wchar.h>. */
20968#include <stddef.h>
20969#include <stdio.h>
20970#include <time.h>
20971#include <wchar.h>
20972int main ()
c971b7fa 20973{
c0c3707f 20974 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
8690e634 20975 {
c0c3707f 20976 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
8690e634
JK
20977 mbstate_t state;
20978 wchar_t wc;
20979
20980 memset (&state, '\0', sizeof (mbstate_t));
20981 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
20982 if (mbsinit (&state))
c0c3707f 20983 return 2;
8690e634 20984 }
c971b7fa
PA
20985 return 0;
20986}
20987_ACEOF
8690e634
JK
20988if ac_fn_c_try_run "$LINENO"; then :
20989 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 20990else
8690e634 20991 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa 20992fi
8690e634
JK
20993rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20994 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 20995fi
c971b7fa 20996
c0c3707f 20997 fi
8690e634 20998 fi
c971b7fa 20999
8690e634
JK
21000fi
21001{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
21002$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa 21003
c971b7fa 21004
c971b7fa 21005
c971b7fa 21006
8690e634
JK
21007 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
21008$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 21009if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
21010 $as_echo_n "(cached) " >&6
21011else
21012
8690e634
JK
21013 case "$host_os" in
21014 # Guess no on Solaris 8.
21015 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
21016 # Guess yes otherwise.
21017 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
21018 esac
21019 if test $LOCALE_ZH_CN != none; then
21020 if test "$cross_compiling" = yes; then :
21021 :
21022else
21023 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
21024/* end confdefs.h. */
21025
8690e634
JK
21026#include <locale.h>
21027#include <stdlib.h>
21028#include <string.h>
21029/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21030 <wchar.h>.
21031 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21032 included before <wchar.h>. */
21033#include <stddef.h>
21034#include <stdio.h>
21035#include <time.h>
21036#include <wchar.h>
21037int main ()
c971b7fa 21038{
8690e634
JK
21039 /* This fails on Solaris 8:
21040 mbrtowc returns 2, and sets wc to 0x00F0.
21041 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
21042 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
21043 {
21044 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
21045 mbstate_t state;
21046 wchar_t wc;
21047
21048 memset (&state, '\0', sizeof (mbstate_t));
21049 if (mbrtowc (&wc, input + 3, 6, &state) != 4
21050 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 21051 return 2;
8690e634 21052 }
c971b7fa
PA
21053 return 0;
21054}
21055_ACEOF
8690e634
JK
21056if ac_fn_c_try_run "$LINENO"; then :
21057 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 21058else
8690e634 21059 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 21060fi
8690e634
JK
21061rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21062 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 21063fi
c971b7fa 21064
8690e634 21065 fi
c971b7fa 21066
8690e634
JK
21067fi
21068{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
21069$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
21070
21071 REPLACE_MBSTATE_T=0
21072 case "$gl_cv_func_mbrtowc_incomplete_state" in
21073 *yes) ;;
21074 *) REPLACE_MBSTATE_T=1 ;;
21075 esac
21076 case "$gl_cv_func_mbrtowc_sanitycheck" in
21077 *yes) ;;
21078 *) REPLACE_MBSTATE_T=1 ;;
21079 esac
c971b7fa 21080 else
8690e634 21081 REPLACE_MBSTATE_T=1
c971b7fa
PA
21082 fi
21083
21084
21085
8690e634
JK
21086 if test $ac_cv_func_mbrtowc = no; then
21087 HAVE_MBRTOWC=0
21088 ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
21089/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21090 <wchar.h>.
21091 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21092 included before <wchar.h>. */
21093#include <stddef.h>
21094#include <stdio.h>
21095#include <time.h>
21096#include <wchar.h>
c971b7fa 21097
8690e634 21098"
d0ac1c44 21099if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
8690e634
JK
21100 ac_have_decl=1
21101else
21102 ac_have_decl=0
c971b7fa 21103fi
c971b7fa 21104
8690e634
JK
21105cat >>confdefs.h <<_ACEOF
21106#define HAVE_DECL_MBRTOWC $ac_have_decl
21107_ACEOF
c971b7fa 21108
8690e634
JK
21109 if test $ac_cv_have_decl_mbrtowc = yes; then
21110 REPLACE_MBRTOWC=1
21111 fi
21112 else
21113 if test $REPLACE_MBSTATE_T = 1; then
21114 REPLACE_MBRTOWC=1
21115 else
c971b7fa
PA
21116
21117
21118
8690e634
JK
21119 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
21120$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
d0ac1c44 21121if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
8690e634 21122 $as_echo_n "(cached) " >&6
c971b7fa 21123else
c971b7fa 21124
8690e634
JK
21125 case "$host_os" in
21126 # Guess no on Solaris.
21127 solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
21128 # Guess yes otherwise.
21129 *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
21130 esac
21131 if test $LOCALE_FR_UTF8 != none; then
21132 if test "$cross_compiling" = yes; then :
21133 :
21134else
21135 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
21136/* end confdefs.h. */
21137
8690e634
JK
21138#include <locale.h>
21139#include <stdlib.h>
21140#include <string.h>
21141/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21142 <wchar.h>.
21143 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21144 included before <wchar.h>. */
21145#include <stddef.h>
21146#include <stdio.h>
21147#include <time.h>
21148#include <wchar.h>
21149int main ()
21150{
21151 int result = 0;
21152
21153 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
21154 {
21155 char input[] = "\303\237er";
21156 mbstate_t state;
21157 wchar_t wc;
21158 size_t ret;
21159
21160 memset (&state, '\0', sizeof (mbstate_t));
21161 wc = (wchar_t) 0xBADFACE;
21162 ret = mbrtowc (&wc, input, 5, &state);
21163 if (ret != 2)
21164 result |= 1;
21165 if (!mbsinit (&state))
21166 result |= 2;
c971b7fa 21167
8690e634
JK
21168 memset (&state, '\0', sizeof (mbstate_t));
21169 ret = mbrtowc (NULL, input, 5, &state);
21170 if (ret != 2) /* Solaris 7 fails here: ret is -1. */
21171 result |= 4;
21172 if (!mbsinit (&state))
21173 result |= 8;
21174 }
21175 return result;
21176}
c971b7fa 21177_ACEOF
8690e634
JK
21178if ac_fn_c_try_run "$LINENO"; then :
21179 gl_cv_func_mbrtowc_null_arg1=yes
21180else
21181 gl_cv_func_mbrtowc_null_arg1=no
21182fi
21183rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21184 conftest.$ac_objext conftest.beam conftest.$ac_ext
21185fi
c971b7fa 21186
8690e634 21187 fi
c971b7fa 21188
c971b7fa 21189fi
8690e634
JK
21190{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
21191$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
c971b7fa 21192
c971b7fa 21193
c971b7fa 21194
c971b7fa 21195
8690e634
JK
21196 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
21197$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
d0ac1c44 21198if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
8690e634
JK
21199 $as_echo_n "(cached) " >&6
21200else
c971b7fa 21201
8690e634
JK
21202 case "$host_os" in
21203 # Guess no on OSF/1.
21204 osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
21205 # Guess yes otherwise.
21206 *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
21207 esac
21208 if test $LOCALE_FR_UTF8 != none; then
21209 if test "$cross_compiling" = yes; then :
c971b7fa 21210 :
8690e634
JK
21211else
21212 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21213/* end confdefs.h. */
21214
21215#include <locale.h>
21216#include <string.h>
21217/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21218 <wchar.h>.
21219 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21220 included before <wchar.h>. */
21221#include <stddef.h>
21222#include <stdio.h>
21223#include <time.h>
21224#include <wchar.h>
21225int main ()
21226{
21227 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
21228 {
21229 mbstate_t state;
21230 wchar_t wc;
21231 int ret;
21232
21233 memset (&state, '\0', sizeof (mbstate_t));
21234 wc = (wchar_t) 0xBADFACE;
21235 mbrtowc (&wc, NULL, 5, &state);
21236 /* Check that wc was not modified. */
21237 if (wc != (wchar_t) 0xBADFACE)
c0c3707f 21238 return 2;
8690e634
JK
21239 }
21240 return 0;
21241}
21242_ACEOF
21243if ac_fn_c_try_run "$LINENO"; then :
21244 gl_cv_func_mbrtowc_null_arg2=yes
21245else
21246 gl_cv_func_mbrtowc_null_arg2=no
21247fi
21248rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21249 conftest.$ac_objext conftest.beam conftest.$ac_ext
21250fi
21251
21252 fi
21253
21254fi
21255{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
21256$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
c971b7fa
PA
21257
21258
21259
21260
21261
21262
8690e634
JK
21263 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
21264$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
d0ac1c44 21265if ${gl_cv_func_mbrtowc_retval+:} false; then :
8690e634
JK
21266 $as_echo_n "(cached) " >&6
21267else
21268
21269 case "$host_os" in
21270 # Guess no on HP-UX, Solaris, native Windows.
21271 hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
21272 # Guess yes otherwise.
21273 *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
21274 esac
21275 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
21276 || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
21277 if test "$cross_compiling" = yes; then :
c971b7fa 21278 :
8690e634
JK
21279else
21280 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21281/* end confdefs.h. */
c971b7fa 21282
8690e634
JK
21283#include <locale.h>
21284#include <string.h>
21285/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21286 <wchar.h>.
21287 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21288 included before <wchar.h>. */
21289#include <stddef.h>
21290#include <stdio.h>
21291#include <time.h>
21292#include <wchar.h>
21293int main ()
21294{
21295 int result = 0;
21296 int found_some_locale = 0;
21297 /* This fails on Solaris. */
21298 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
21299 {
21300 char input[] = "B\303\274\303\237er"; /* "Büßer" */
21301 mbstate_t state;
21302 wchar_t wc;
21303
21304 memset (&state, '\0', sizeof (mbstate_t));
21305 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
21306 {
21307 input[1] = '\0';
21308 if (mbrtowc (&wc, input + 2, 5, &state) != 1)
21309 result |= 1;
21310 }
21311 found_some_locale = 1;
21312 }
21313 /* This fails on HP-UX 11.11. */
21314 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
21315 {
21316 char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
21317 mbstate_t state;
21318 wchar_t wc;
21319
21320 memset (&state, '\0', sizeof (mbstate_t));
21321 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
21322 {
21323 input[1] = '\0';
21324 if (mbrtowc (&wc, input + 2, 5, &state) != 2)
21325 result |= 2;
21326 }
21327 found_some_locale = 1;
21328 }
21329 /* This fails on native Windows. */
21330 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
21331 {
21332 char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
21333 mbstate_t state;
21334 wchar_t wc;
21335
21336 memset (&state, '\0', sizeof (mbstate_t));
21337 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
21338 {
21339 input[3] = '\0';
21340 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
21341 result |= 4;
21342 }
21343 found_some_locale = 1;
21344 }
21345 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
21346 {
21347 char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
21348 mbstate_t state;
21349 wchar_t wc;
21350
21351 memset (&state, '\0', sizeof (mbstate_t));
21352 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
21353 {
21354 input[3] = '\0';
21355 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
21356 result |= 8;
21357 }
21358 found_some_locale = 1;
21359 }
21360 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
21361 {
21362 char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
21363 mbstate_t state;
21364 wchar_t wc;
21365
21366 memset (&state, '\0', sizeof (mbstate_t));
21367 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
21368 {
21369 input[3] = '\0';
21370 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
21371 result |= 16;
21372 }
21373 found_some_locale = 1;
21374 }
21375 return (found_some_locale ? result : 77);
21376}
21377_ACEOF
21378if ac_fn_c_try_run "$LINENO"; then :
21379 gl_cv_func_mbrtowc_retval=yes
21380else
21381 if test $? != 77; then
21382 gl_cv_func_mbrtowc_retval=no
21383 fi
c971b7fa 21384
8690e634
JK
21385fi
21386rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21387 conftest.$ac_objext conftest.beam conftest.$ac_ext
21388fi
c971b7fa 21389
8690e634 21390 fi
c971b7fa 21391
8690e634
JK
21392fi
21393{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
21394$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
c971b7fa
PA
21395
21396
21397
21398
8690e634
JK
21399 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
21400$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
d0ac1c44 21401if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
c971b7fa
PA
21402 $as_echo_n "(cached) " >&6
21403else
8690e634
JK
21404
21405 case "$host_os" in
21406 # Guess no on Solaris 8 and 9.
21407 solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
21408 # Guess yes otherwise.
21409 *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
21410 esac
21411 if test $LOCALE_ZH_CN != none; then
21412 if test "$cross_compiling" = yes; then :
21413 :
c971b7fa
PA
21414else
21415 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21416/* end confdefs.h. */
21417
8690e634 21418#include <locale.h>
c971b7fa 21419#include <string.h>
8690e634
JK
21420/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21421 <wchar.h>.
21422 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21423 included before <wchar.h>. */
21424#include <stddef.h>
21425#include <stdio.h>
21426#include <time.h>
21427#include <wchar.h>
21428int main ()
c971b7fa 21429{
8690e634
JK
21430 /* This fails on Solaris 8 and 9. */
21431 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
c971b7fa 21432 {
8690e634
JK
21433 mbstate_t state;
21434 wchar_t wc;
c971b7fa 21435
8690e634
JK
21436 memset (&state, '\0', sizeof (mbstate_t));
21437 if (mbrtowc (&wc, "", 1, &state) != 0)
c0c3707f 21438 return 2;
8690e634 21439 }
c971b7fa
PA
21440 return 0;
21441}
21442_ACEOF
21443if ac_fn_c_try_run "$LINENO"; then :
8690e634 21444 gl_cv_func_mbrtowc_nul_retval=yes
c971b7fa 21445else
8690e634 21446 gl_cv_func_mbrtowc_nul_retval=no
c971b7fa
PA
21447fi
21448rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21449 conftest.$ac_objext conftest.beam conftest.$ac_ext
21450fi
21451
8690e634
JK
21452 fi
21453
c971b7fa 21454fi
8690e634
JK
21455{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
21456$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
21457
4a626d0a
PA
21458
21459
21460 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
21461$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
d0ac1c44 21462if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
4a626d0a
PA
21463 $as_echo_n "(cached) " >&6
21464else
21465
21466 case "$host_os" in
c0c3707f
CB
21467 # Guess no on AIX and glibc systems.
21468 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
21469 # Guess yes on native Windows.
21470 mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
21471 *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
4a626d0a
PA
21472 esac
21473 if test "$cross_compiling" = yes; then :
21474 :
21475else
21476 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21477/* end confdefs.h. */
21478
21479 #include <wchar.h>
21480 static wchar_t wc;
21481 static mbstate_t mbs;
21482 int
21483 main (void)
21484 {
49e4877c 21485 return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
4a626d0a
PA
21486 }
21487_ACEOF
21488if ac_fn_c_try_run "$LINENO"; then :
4a626d0a 21489 gl_cv_func_mbrtowc_empty_input=yes
49e4877c
PA
21490else
21491 gl_cv_func_mbrtowc_empty_input=no
4a626d0a
PA
21492fi
21493rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21494 conftest.$ac_objext conftest.beam conftest.$ac_ext
21495fi
21496
21497
21498fi
21499{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
21500$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
21501
49e4877c 21502
c0c3707f 21503 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
49e4877c 21504$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
d0ac1c44 21505if ${gl_cv_C_locale_sans_EILSEQ+:} false; then :
49e4877c
PA
21506 $as_echo_n "(cached) " >&6
21507else
21508
c0c3707f 21509 gl_cv_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
49e4877c
PA
21510
21511 if test "$cross_compiling" = yes; then :
c0c3707f
CB
21512 case "$host_os" in
21513 # Guess yes on native Windows.
21514 mingw*) gl_cv_C_locale_sans_EILSEQ="guessing yes" ;;
21515 esac
21516
49e4877c
PA
21517else
21518 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21519/* end confdefs.h. */
21520#include <limits.h>
21521 #include <locale.h>
21522 #include <wchar.h>
21523
21524int
21525main ()
21526{
21527
21528 int i;
21529 char *locale = setlocale (LC_ALL, "C");
21530 if (! locale)
c0c3707f 21531 return 2;
49e4877c
PA
21532 for (i = CHAR_MIN; i <= CHAR_MAX; i++)
21533 {
21534 char c = i;
21535 wchar_t wc;
21536 mbstate_t mbs = { 0, };
21537 size_t ss = mbrtowc (&wc, &c, 1, &mbs);
21538 if (1 < ss)
c0c3707f 21539 return 3;
49e4877c
PA
21540 }
21541 return 0;
21542
6ec2e0f5
SDJ
21543 ;
21544 return 0;
21545}
21546_ACEOF
21547if ac_fn_c_try_run "$LINENO"; then :
21548 gl_cv_C_locale_sans_EILSEQ=yes
21549else
21550 gl_cv_C_locale_sans_EILSEQ=no
21551fi
21552rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21553 conftest.$ac_objext conftest.beam conftest.$ac_ext
21554fi
21555
c0c3707f 21556
6ec2e0f5
SDJ
21557fi
21558{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5
21559$as_echo "$gl_cv_C_locale_sans_EILSEQ" >&6; }
21560
21561 case "$gl_cv_func_mbrtowc_null_arg1" in
21562 *yes) ;;
21563 *)
21564$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
21565
21566 REPLACE_MBRTOWC=1
21567 ;;
21568 esac
21569 case "$gl_cv_func_mbrtowc_null_arg2" in
21570 *yes) ;;
21571 *)
21572$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
21573
21574 REPLACE_MBRTOWC=1
21575 ;;
21576 esac
21577 case "$gl_cv_func_mbrtowc_retval" in
21578 *yes) ;;
21579 *)
21580$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
21581
21582 REPLACE_MBRTOWC=1
21583 ;;
21584 esac
21585 case "$gl_cv_func_mbrtowc_nul_retval" in
21586 *yes) ;;
21587 *)
21588$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
21589
21590 REPLACE_MBRTOWC=1
21591 ;;
21592 esac
21593 case "$gl_cv_func_mbrtowc_empty_input" in
21594 *yes) ;;
21595 *)
21596$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
21597
21598 REPLACE_MBRTOWC=1
21599 ;;
21600 esac
21601 case $gl_cv_C_locale_sans_EILSEQ in
21602 *yes) ;;
21603 *)
21604$as_echo "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
21605
21606 REPLACE_MBRTOWC=1
21607 ;;
21608 esac
21609 fi
21610 fi
21611
21612 if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
21613
21614
21615
21616
21617
21618
21619
21620
21621 gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
21622
21623
c0c3707f 21624
6ec2e0f5
SDJ
21625 :
21626
21627 fi
21628
21629
21630
21631
21632
21633 GNULIB_MBRTOWC=1
21634
21635
21636
21637
21638
21639$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654 if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
21655
21656
21657
c0c3707f 21658
6ec2e0f5
SDJ
21659 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
21660$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 21661if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
6ec2e0f5
SDJ
21662 $as_echo_n "(cached) " >&6
21663else
21664
21665 case "$host_os" in
21666 # Guess no on AIX and OSF/1.
21667 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
21668 # Guess yes otherwise.
21669 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
21670 esac
21671 if test $LOCALE_JA != none; then
21672 if test "$cross_compiling" = yes; then :
21673 :
21674else
21675 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21676/* end confdefs.h. */
21677
21678#include <locale.h>
21679#include <string.h>
21680/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21681 <wchar.h>.
21682 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21683 included before <wchar.h>. */
21684#include <stddef.h>
21685#include <stdio.h>
21686#include <time.h>
21687#include <wchar.h>
21688int main ()
21689{
21690 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
21691 {
21692 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
21693 mbstate_t state;
21694 wchar_t wc;
21695
21696 memset (&state, '\0', sizeof (mbstate_t));
21697 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
21698 if (mbsinit (&state))
c0c3707f
CB
21699 return 2;
21700 }
21701 return 0;
21702}
21703_ACEOF
21704if ac_fn_c_try_run "$LINENO"; then :
21705 gl_cv_func_mbrtowc_incomplete_state=yes
21706else
21707 gl_cv_func_mbrtowc_incomplete_state=no
21708fi
21709rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21710 conftest.$ac_objext conftest.beam conftest.$ac_ext
21711fi
21712
21713 else
21714 if test $LOCALE_FR_UTF8 != none; then
21715 if test "$cross_compiling" = yes; then :
21716 :
21717else
21718 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21719/* end confdefs.h. */
21720
21721#include <locale.h>
21722#include <string.h>
21723/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21724 <wchar.h>.
21725 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21726 included before <wchar.h>. */
21727#include <stddef.h>
21728#include <stdio.h>
21729#include <time.h>
21730#include <wchar.h>
21731int main ()
21732{
21733 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
21734 {
21735 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
21736 mbstate_t state;
21737 wchar_t wc;
21738
21739 memset (&state, '\0', sizeof (mbstate_t));
21740 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
21741 if (mbsinit (&state))
21742 return 2;
6ec2e0f5
SDJ
21743 }
21744 return 0;
21745}
21746_ACEOF
21747if ac_fn_c_try_run "$LINENO"; then :
21748 gl_cv_func_mbrtowc_incomplete_state=yes
21749else
21750 gl_cv_func_mbrtowc_incomplete_state=no
21751fi
21752rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21753 conftest.$ac_objext conftest.beam conftest.$ac_ext
21754fi
21755
c0c3707f 21756 fi
6ec2e0f5
SDJ
21757 fi
21758
21759fi
21760{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
21761$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
21762
21763
21764
21765
21766 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
21767$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 21768if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
6ec2e0f5
SDJ
21769 $as_echo_n "(cached) " >&6
21770else
21771
21772 case "$host_os" in
21773 # Guess no on Solaris 8.
21774 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
21775 # Guess yes otherwise.
21776 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
21777 esac
21778 if test $LOCALE_ZH_CN != none; then
21779 if test "$cross_compiling" = yes; then :
21780 :
21781else
21782 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21783/* end confdefs.h. */
21784
21785#include <locale.h>
21786#include <stdlib.h>
21787#include <string.h>
21788/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21789 <wchar.h>.
21790 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21791 included before <wchar.h>. */
21792#include <stddef.h>
21793#include <stdio.h>
21794#include <time.h>
21795#include <wchar.h>
21796int main ()
21797{
21798 /* This fails on Solaris 8:
21799 mbrtowc returns 2, and sets wc to 0x00F0.
21800 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
21801 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
21802 {
21803 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
21804 mbstate_t state;
21805 wchar_t wc;
21806
21807 memset (&state, '\0', sizeof (mbstate_t));
21808 if (mbrtowc (&wc, input + 3, 6, &state) != 4
21809 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 21810 return 2;
6ec2e0f5 21811 }
49e4877c
PA
21812 return 0;
21813}
21814_ACEOF
21815if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 21816 gl_cv_func_mbrtowc_sanitycheck=yes
49e4877c 21817else
6ec2e0f5 21818 gl_cv_func_mbrtowc_sanitycheck=no
49e4877c
PA
21819fi
21820rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21821 conftest.$ac_objext conftest.beam conftest.$ac_ext
21822fi
21823
6ec2e0f5
SDJ
21824 fi
21825
49e4877c 21826fi
6ec2e0f5
SDJ
21827{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
21828$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
49e4877c 21829
6ec2e0f5
SDJ
21830 REPLACE_MBSTATE_T=0
21831 case "$gl_cv_func_mbrtowc_incomplete_state" in
21832 *yes) ;;
21833 *) REPLACE_MBSTATE_T=1 ;;
21834 esac
21835 case "$gl_cv_func_mbrtowc_sanitycheck" in
21836 *yes) ;;
21837 *) REPLACE_MBSTATE_T=1 ;;
21838 esac
21839 else
21840 REPLACE_MBSTATE_T=1
21841 fi
8690e634 21842
8690e634 21843
8690e634 21844
6ec2e0f5
SDJ
21845 if test $ac_cv_func_mbsinit = no; then
21846 HAVE_MBSINIT=0
21847 ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
21848/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21849 <wchar.h>.
21850 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21851 included before <wchar.h>. */
21852#include <stddef.h>
21853#include <stdio.h>
21854#include <time.h>
21855#include <wchar.h>
8690e634 21856
6ec2e0f5 21857"
d0ac1c44 21858if test "x$ac_cv_have_decl_mbsinit" = xyes; then :
6ec2e0f5
SDJ
21859 ac_have_decl=1
21860else
21861 ac_have_decl=0
21862fi
4a626d0a 21863
6ec2e0f5
SDJ
21864cat >>confdefs.h <<_ACEOF
21865#define HAVE_DECL_MBSINIT $ac_have_decl
21866_ACEOF
49e4877c 21867
6ec2e0f5
SDJ
21868 if test $ac_cv_have_decl_mbsinit = yes; then
21869 REPLACE_MBSINIT=1
21870 fi
21871 else
21872 if test $REPLACE_MBSTATE_T = 1; then
21873 REPLACE_MBSINIT=1
21874 else
21875 case "$host_os" in
21876 mingw*) REPLACE_MBSINIT=1 ;;
8690e634 21877 esac
c971b7fa
PA
21878 fi
21879 fi
21880
6ec2e0f5 21881 if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
c971b7fa 21882
c971b7fa 21883
c971b7fa
PA
21884
21885
21886
21887
21888
21889
6ec2e0f5 21890 gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
8690e634
JK
21891
21892
21893 :
c971b7fa 21894
a512b375 21895 fi
c971b7fa 21896
8690e634
JK
21897
21898
21899
21900
6ec2e0f5 21901 GNULIB_MBSINIT=1
8690e634
JK
21902
21903
21904
21905
8690e634 21906
6ec2e0f5 21907$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
8690e634
JK
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
c971b7fa 21919
c971b7fa 21920
8690e634 21921 if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
c971b7fa 21922
8690e634
JK
21923
21924
c0c3707f 21925
8690e634
JK
21926 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
21927$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 21928if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
8690e634
JK
21929 $as_echo_n "(cached) " >&6
21930else
21931
21932 case "$host_os" in
21933 # Guess no on AIX and OSF/1.
21934 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
21935 # Guess yes otherwise.
21936 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
21937 esac
21938 if test $LOCALE_JA != none; then
21939 if test "$cross_compiling" = yes; then :
21940 :
c971b7fa
PA
21941else
21942 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21943/* end confdefs.h. */
21944
8690e634
JK
21945#include <locale.h>
21946#include <string.h>
21947/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21948 <wchar.h>.
21949 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21950 included before <wchar.h>. */
21951#include <stddef.h>
21952#include <stdio.h>
21953#include <time.h>
21954#include <wchar.h>
21955int main ()
c971b7fa 21956{
8690e634 21957 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
c971b7fa 21958 {
8690e634
JK
21959 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
21960 mbstate_t state;
21961 wchar_t wc;
21962
21963 memset (&state, '\0', sizeof (mbstate_t));
21964 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
21965 if (mbsinit (&state))
c0c3707f
CB
21966 return 2;
21967 }
21968 return 0;
21969}
21970_ACEOF
21971if ac_fn_c_try_run "$LINENO"; then :
21972 gl_cv_func_mbrtowc_incomplete_state=yes
21973else
21974 gl_cv_func_mbrtowc_incomplete_state=no
21975fi
21976rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21977 conftest.$ac_objext conftest.beam conftest.$ac_ext
21978fi
21979
21980 else
21981 if test $LOCALE_FR_UTF8 != none; then
21982 if test "$cross_compiling" = yes; then :
21983 :
21984else
21985 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21986/* end confdefs.h. */
21987
21988#include <locale.h>
21989#include <string.h>
21990/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21991 <wchar.h>.
21992 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21993 included before <wchar.h>. */
21994#include <stddef.h>
21995#include <stdio.h>
21996#include <time.h>
21997#include <wchar.h>
21998int main ()
21999{
22000 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
22001 {
22002 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
22003 mbstate_t state;
22004 wchar_t wc;
22005
22006 memset (&state, '\0', sizeof (mbstate_t));
22007 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
22008 if (mbsinit (&state))
22009 return 2;
c971b7fa 22010 }
c971b7fa
PA
22011 return 0;
22012}
22013_ACEOF
22014if ac_fn_c_try_run "$LINENO"; then :
8690e634 22015 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 22016else
8690e634 22017 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa
PA
22018fi
22019rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22020 conftest.$ac_objext conftest.beam conftest.$ac_ext
22021fi
22022
c0c3707f 22023 fi
8690e634 22024 fi
c971b7fa
PA
22025
22026fi
8690e634
JK
22027{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
22028$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa
PA
22029
22030
c971b7fa
PA
22031
22032
8690e634
JK
22033 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
22034$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 22035if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
22036 $as_echo_n "(cached) " >&6
22037else
8690e634
JK
22038
22039 case "$host_os" in
22040 # Guess no on Solaris 8.
22041 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
22042 # Guess yes otherwise.
22043 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
22044 esac
22045 if test $LOCALE_ZH_CN != none; then
22046 if test "$cross_compiling" = yes; then :
22047 :
22048else
c971b7fa
PA
22049 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22050/* end confdefs.h. */
8690e634
JK
22051
22052#include <locale.h>
22053#include <stdlib.h>
22054#include <string.h>
22055/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22056 <wchar.h>.
22057 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22058 included before <wchar.h>. */
c971b7fa 22059#include <stddef.h>
8690e634
JK
22060#include <stdio.h>
22061#include <time.h>
22062#include <wchar.h>
22063int main ()
c971b7fa 22064{
8690e634
JK
22065 /* This fails on Solaris 8:
22066 mbrtowc returns 2, and sets wc to 0x00F0.
22067 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
22068 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
22069 {
22070 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
22071 mbstate_t state;
22072 wchar_t wc;
22073
22074 memset (&state, '\0', sizeof (mbstate_t));
22075 if (mbrtowc (&wc, input + 3, 6, &state) != 4
22076 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 22077 return 2;
8690e634 22078 }
c971b7fa
PA
22079 return 0;
22080}
22081_ACEOF
8690e634
JK
22082if ac_fn_c_try_run "$LINENO"; then :
22083 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 22084else
8690e634 22085 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 22086fi
8690e634
JK
22087rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22088 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 22089fi
c971b7fa 22090
8690e634
JK
22091 fi
22092
22093fi
22094{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
22095$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
c971b7fa 22096
8690e634
JK
22097 REPLACE_MBSTATE_T=0
22098 case "$gl_cv_func_mbrtowc_incomplete_state" in
22099 *yes) ;;
22100 *) REPLACE_MBSTATE_T=1 ;;
22101 esac
22102 case "$gl_cv_func_mbrtowc_sanitycheck" in
22103 *yes) ;;
22104 *) REPLACE_MBSTATE_T=1 ;;
22105 esac
22106 else
22107 REPLACE_MBSTATE_T=1
c971b7fa
PA
22108 fi
22109
c971b7fa 22110
8690e634 22111
6ec2e0f5
SDJ
22112 if test $ac_cv_func_mbsrtowcs = no; then
22113 HAVE_MBSRTOWCS=0
22114 ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" "
8690e634
JK
22115/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22116 <wchar.h>.
22117 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22118 included before <wchar.h>. */
22119#include <stddef.h>
22120#include <stdio.h>
22121#include <time.h>
22122#include <wchar.h>
22123
22124"
d0ac1c44 22125if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then :
8690e634
JK
22126 ac_have_decl=1
22127else
22128 ac_have_decl=0
c971b7fa 22129fi
c971b7fa 22130
8690e634 22131cat >>confdefs.h <<_ACEOF
6ec2e0f5 22132#define HAVE_DECL_MBSRTOWCS $ac_have_decl
c971b7fa 22133_ACEOF
c971b7fa 22134
6ec2e0f5
SDJ
22135 if test $ac_cv_have_decl_mbsrtowcs = yes; then
22136 REPLACE_MBSRTOWCS=1
8690e634
JK
22137 fi
22138 else
22139 if test $REPLACE_MBSTATE_T = 1; then
6ec2e0f5 22140 REPLACE_MBSRTOWCS=1
8690e634 22141 else
6ec2e0f5
SDJ
22142
22143
22144
22145
22146
22147
22148 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5
22149$as_echo_n "checking whether mbsrtowcs works... " >&6; }
d0ac1c44 22150if ${gl_cv_func_mbsrtowcs_works+:} false; then :
6ec2e0f5
SDJ
22151 $as_echo_n "(cached) " >&6
22152else
22153
22154 case "$host_os" in
22155 # Guess no on HP-UX, Solaris, mingw.
22156 hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
22157 # Guess yes otherwise.
22158 *) gl_cv_func_mbsrtowcs_works="guessing yes" ;;
22159 esac
22160 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
22161 if test "$cross_compiling" = yes; then :
22162 :
22163else
22164 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22165/* end confdefs.h. */
22166
22167#include <locale.h>
22168#include <string.h>
22169/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22170 <wchar.h>.
22171 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22172 included before <wchar.h>. */
22173#include <stddef.h>
22174#include <stdio.h>
22175#include <time.h>
22176#include <wchar.h>
22177int main ()
22178{
22179 int result = 0;
22180 /* Test whether the function supports a NULL destination argument.
22181 This fails on native Windows. */
22182 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
22183 {
22184 const char input[] = "\337er";
22185 const char *src = input;
22186 mbstate_t state;
22187
22188 memset (&state, '\0', sizeof (mbstate_t));
22189 if (mbsrtowcs (NULL, &src, 1, &state) != 3
22190 || src != input)
22191 result |= 1;
22192 }
22193 /* Test whether the function works when started with a conversion state
22194 in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */
22195 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
22196 {
22197 const char input[] = "B\303\274\303\237er";
22198 mbstate_t state;
22199
22200 memset (&state, '\0', sizeof (mbstate_t));
22201 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
22202 if (!mbsinit (&state))
22203 {
22204 const char *src = input + 2;
22205 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
22206 result |= 2;
22207 }
22208 }
22209 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
22210 {
22211 const char input[] = "<\306\374\313\334\270\354>";
22212 mbstate_t state;
22213
22214 memset (&state, '\0', sizeof (mbstate_t));
22215 if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2))
22216 if (!mbsinit (&state))
22217 {
22218 const char *src = input + 4;
22219 if (mbsrtowcs (NULL, &src, 10, &state) != 3)
22220 result |= 4;
22221 }
22222 }
22223 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
22224 {
22225 const char input[] = "B\250\271\201\060\211\070er";
22226 mbstate_t state;
22227
22228 memset (&state, '\0', sizeof (mbstate_t));
22229 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
22230 if (!mbsinit (&state))
22231 {
22232 const char *src = input + 2;
22233 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
22234 result |= 8;
22235 }
22236 }
22237 return result;
22238}
22239_ACEOF
22240if ac_fn_c_try_run "$LINENO"; then :
22241 gl_cv_func_mbsrtowcs_works=yes
22242else
22243 gl_cv_func_mbsrtowcs_works=no
22244fi
22245rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22246 conftest.$ac_objext conftest.beam conftest.$ac_ext
22247fi
22248
22249 fi
22250
22251fi
22252{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5
22253$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
22254
22255 case "$gl_cv_func_mbsrtowcs_works" in
22256 *yes) ;;
22257 *) REPLACE_MBSRTOWCS=1 ;;
8690e634
JK
22258 esac
22259 fi
22260 fi
c971b7fa 22261
6ec2e0f5 22262 if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
c971b7fa
PA
22263
22264
22265
22266
22267
22268
22269
22270
6ec2e0f5
SDJ
22271 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext"
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext"
c971b7fa
PA
22282
22283
8690e634 22284 :
c971b7fa 22285
a512b375 22286 fi
c971b7fa 22287
c971b7fa 22288
c971b7fa 22289
c971b7fa
PA
22290
22291
6ec2e0f5 22292 GNULIB_MBSRTOWCS=1
c971b7fa 22293
c971b7fa
PA
22294
22295
22296
22297
6ec2e0f5 22298$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
c971b7fa
PA
22299
22300
c971b7fa 22301
c971b7fa 22302
6ec2e0f5 22303 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
c971b7fa
PA
22304
22305
22306
c971b7fa 22307
c971b7fa
PA
22308
22309
22310
22311
6ec2e0f5 22312 gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
8690e634 22313
c971b7fa 22314
6ec2e0f5
SDJ
22315 for ac_header in bp-sym.h
22316do :
22317 ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
d0ac1c44 22318if test "x$ac_cv_header_bp_sym_h" = xyes; then :
6ec2e0f5
SDJ
22319 cat >>confdefs.h <<_ACEOF
22320#define HAVE_BP_SYM_H 1
22321_ACEOF
c971b7fa 22322
6ec2e0f5 22323fi
c971b7fa 22324
6ec2e0f5
SDJ
22325done
22326
22327
22328 fi
22329
22330
22331
22332
22333
22334 GNULIB_MEMCHR=1
22335
22336
22337
22338
22339
22340$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
22341
22342
22343
22344
22345
22346 if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
22347 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works in linear time" >&5
22348$as_echo_n "checking whether memmem works in linear time... " >&6; }
d0ac1c44 22349if ${gl_cv_func_memmem_works_fast+:} false; then :
8690e634
JK
22350 $as_echo_n "(cached) " >&6
22351else
6ec2e0f5
SDJ
22352 if test "$cross_compiling" = yes; then :
22353 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22354/* end confdefs.h. */
22355
22356#include <features.h>
22357#ifdef __GNU_LIBRARY__
22358 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \
22359 && !defined __UCLIBC__
22360 Lucky user
22361 #endif
22362#endif
22363#ifdef __CYGWIN__
22364 #include <cygwin/version.h>
22365 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0)
22366 Lucky user
22367 #endif
22368#endif
22369
22370_ACEOF
22371if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22372 $EGREP "Lucky user" >/dev/null 2>&1; then :
22373 gl_cv_func_memmem_works_fast="guessing yes"
22374else
c0c3707f 22375 gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"
6ec2e0f5
SDJ
22376fi
22377rm -f conftest*
22378
c971b7fa 22379
8690e634
JK
22380else
22381 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 22382/* end confdefs.h. */
c971b7fa 22383
6ec2e0f5
SDJ
22384#include <signal.h> /* for signal */
22385#include <string.h> /* for memmem */
22386#include <stdlib.h> /* for malloc */
22387#include <unistd.h> /* for alarm */
22388static void quit (int sig) { _exit (sig + 128); }
22389
22390int
22391main ()
8690e634 22392{
8690e634 22393
6ec2e0f5
SDJ
22394 int result = 0;
22395 size_t m = 1000000;
22396 char *haystack = (char *) malloc (2 * m + 1);
22397 char *needle = (char *) malloc (m + 1);
22398 /* Failure to compile this test due to missing alarm is okay,
22399 since all such platforms (mingw) also lack memmem. */
22400 signal (SIGALRM, quit);
22401 alarm (5);
22402 /* Check for quadratic performance. */
22403 if (haystack && needle)
22404 {
22405 memset (haystack, 'A', 2 * m);
22406 haystack[2 * m] = 'B';
22407 memset (needle, 'A', m);
22408 needle[m] = 'B';
22409 if (!memmem (haystack, 2 * m + 1, needle, m + 1))
22410 result |= 1;
22411 }
c0c3707f
CB
22412 /* Free allocated memory, in case some sanitizer is watching. */
22413 free (haystack);
22414 free (needle);
6ec2e0f5
SDJ
22415 return result;
22416
22417 ;
c971b7fa
PA
22418 return 0;
22419}
22420_ACEOF
8690e634 22421if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 22422 gl_cv_func_memmem_works_fast=yes
8690e634 22423else
6ec2e0f5 22424 gl_cv_func_memmem_works_fast=no
8690e634
JK
22425fi
22426rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22427 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 22428fi
c971b7fa
PA
22429
22430
8690e634 22431fi
6ec2e0f5
SDJ
22432{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_fast" >&5
22433$as_echo "$gl_cv_func_memmem_works_fast" >&6; }
22434 case "$gl_cv_func_memmem_works_fast" in
22435 *yes) ;;
22436 *)
22437 REPLACE_MEMMEM=1
22438 ;;
22439 esac
22440 fi
c971b7fa 22441
6ec2e0f5 22442 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
8690e634
JK
22443
22444
22445
6ec2e0f5
SDJ
22446
22447
22448
22449
22450
22451 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
22452
22453 fi
22454
22455
22456
22457
22458 for ac_func in memmem
22459do :
22460 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
d0ac1c44 22461if test "x$ac_cv_func_memmem" = xyes; then :
6ec2e0f5
SDJ
22462 cat >>confdefs.h <<_ACEOF
22463#define HAVE_MEMMEM 1
22464_ACEOF
22465
22466fi
22467done
22468
22469 if test $ac_cv_func_memmem = yes; then
22470 HAVE_MEMMEM=1
22471 else
22472 HAVE_MEMMEM=0
22473 fi
22474
22475 if test $ac_cv_have_decl_memmem = no; then
22476 HAVE_DECL_MEMMEM=0
22477 else
22478 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
22479$as_echo_n "checking whether memmem works... " >&6; }
d0ac1c44 22480if ${gl_cv_func_memmem_works_always+:} false; then :
c971b7fa
PA
22481 $as_echo_n "(cached) " >&6
22482else
6ec2e0f5
SDJ
22483 if test "$cross_compiling" = yes; then :
22484 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22485/* end confdefs.h. */
22486
22487#ifdef __GNU_LIBRARY__
22488 #include <features.h>
22489 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
22490 || __GLIBC_MINOR__ > 12)) \
22491 || (__GLIBC__ > 2)) \
22492 || defined __UCLIBC__
22493 Lucky user
22494 #endif
22495#elif defined __CYGWIN__
22496 #include <cygwin/version.h>
22497 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
22498 Lucky user
22499 #endif
22500#else
22501 Lucky user
22502#endif
22503
22504_ACEOF
22505if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22506 $EGREP "Lucky user" >/dev/null 2>&1; then :
22507 gl_cv_func_memmem_works_always="guessing yes"
22508else
c0c3707f 22509 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
6ec2e0f5
SDJ
22510fi
22511rm -f conftest*
22512
8690e634 22513
8690e634 22514else
c971b7fa
PA
22515 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22516/* end confdefs.h. */
c971b7fa 22517
6ec2e0f5
SDJ
22518#include <string.h> /* for memmem */
22519#define P "_EF_BF_BD"
22520#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
22521#define NEEDLE P P P P P
22522
22523int
22524main ()
c971b7fa 22525{
8690e634 22526
6ec2e0f5
SDJ
22527 int result = 0;
22528 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
22529 result |= 1;
22530 /* Check for empty needle behavior. */
22531 {
22532 const char *haystack = "AAA";
22533 if (memmem (haystack, 3, NULL, 0) != haystack)
22534 result |= 2;
8690e634 22535 }
6ec2e0f5
SDJ
22536 return result;
22537
22538 ;
c971b7fa
PA
22539 return 0;
22540}
22541_ACEOF
8690e634 22542if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 22543 gl_cv_func_memmem_works_always=yes
c971b7fa 22544else
6ec2e0f5 22545 gl_cv_func_memmem_works_always=no
c971b7fa 22546fi
8690e634
JK
22547rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22548 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 22549fi
8690e634 22550
8690e634
JK
22551
22552fi
6ec2e0f5
SDJ
22553{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
22554$as_echo "$gl_cv_func_memmem_works_always" >&6; }
22555 case "$gl_cv_func_memmem_works_always" in
8690e634 22556 *yes) ;;
6ec2e0f5
SDJ
22557 *)
22558 REPLACE_MEMMEM=1
22559 ;;
8690e634 22560 esac
c971b7fa 22561 fi
6ec2e0f5 22562 :
c971b7fa 22563
6ec2e0f5 22564 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
c971b7fa 22565
c971b7fa 22566
8690e634 22567
c971b7fa 22568
6ec2e0f5
SDJ
22569
22570
22571
22572
22573 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
22574
22575 fi
22576
22577
22578
22579
22580
22581 GNULIB_MEMMEM=1
22582
22583
22584
22585
22586
22587$as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597 for ac_func in mempcpy
22598do :
22599 ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
d0ac1c44 22600if test "x$ac_cv_func_mempcpy" = xyes; then :
6ec2e0f5
SDJ
22601 cat >>confdefs.h <<_ACEOF
22602#define HAVE_MEMPCPY 1
8690e634 22603_ACEOF
c971b7fa 22604
6ec2e0f5
SDJ
22605fi
22606done
c971b7fa 22607
6ec2e0f5
SDJ
22608 if test $ac_cv_func_mempcpy = no; then
22609 HAVE_MEMPCPY=0
22610 fi
8690e634 22611
6ec2e0f5 22612 if test $HAVE_MEMPCPY = 0; then
8690e634
JK
22613
22614
22615
22616
8690e634 22617
6ec2e0f5
SDJ
22618
22619
22620
22621 gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext"
22622
22623
8690e634 22624 :
c971b7fa 22625
6ec2e0f5 22626 fi
c971b7fa 22627
8690e634 22628
8690e634 22629
8690e634 22630
6ec2e0f5
SDJ
22631
22632 GNULIB_MEMPCPY=1
22633
22634
22635
22636
22637
22638$as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
22639
22640
22641
22642
22643
22644
22645
22646
22647 if test $ac_cv_have_decl_memrchr = no; then
22648 HAVE_DECL_MEMRCHR=0
22649 fi
22650
22651 for ac_func in memrchr
22652do :
22653 ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
d0ac1c44 22654if test "x$ac_cv_func_memrchr" = xyes; then :
6ec2e0f5
SDJ
22655 cat >>confdefs.h <<_ACEOF
22656#define HAVE_MEMRCHR 1
c971b7fa 22657_ACEOF
6ec2e0f5 22658
c971b7fa 22659fi
6ec2e0f5 22660done
8690e634 22661
8690e634 22662
6ec2e0f5 22663 if test $ac_cv_func_memrchr = no; then
8690e634 22664
6ec2e0f5
SDJ
22665
22666
22667
22668
22669
22670
22671
22672 gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext"
22673
22674 :
c971b7fa
PA
22675 fi
22676
22677
c971b7fa 22678
c971b7fa 22679
c971b7fa 22680
6ec2e0f5
SDJ
22681 GNULIB_MEMRCHR=1
22682
22683
22684
22685
22686
22687$as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h
22688
22689
22690
22691
2d8adcbd 22692
8a99096f
SM
22693 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5
22694$as_echo_n "checking whether mkdir handles trailing slash... " >&6; }
22695if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then :
22696 $as_echo_n "(cached) " >&6
22697else
22698 rm -rf conftest.dir
22699 if test "$cross_compiling" = yes; then :
22700 case "$host_os" in
c0c3707f
CB
22701 # Guess yes on Linux systems.
22702 linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
22703 # Guess yes on glibc systems.
22704 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
22705 # Guess yes on MSVC, no on mingw.
22706 mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22707/* end confdefs.h. */
22708
22709#ifdef _MSC_VER
22710 Known
22711#endif
22712
22713_ACEOF
22714if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22715 $EGREP "Known" >/dev/null 2>&1; then :
22716 gl_cv_func_mkdir_trailing_slash_works="guessing yes"
22717else
22718 gl_cv_func_mkdir_trailing_slash_works="guessing no"
22719fi
22720rm -f conftest*
22721
22722 ;;
22723 # If we don't know, obey --enable-cross-guesses.
22724 *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
8a99096f
SM
22725 esac
22726
22727else
22728 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22729/* end confdefs.h. */
22730
22731# include <sys/types.h>
22732# include <sys/stat.h>
22733
22734int
22735main ()
22736{
22737return mkdir ("conftest.dir/", 0700);
22738 ;
22739 return 0;
22740}
22741_ACEOF
22742if ac_fn_c_try_run "$LINENO"; then :
22743 gl_cv_func_mkdir_trailing_slash_works=yes
22744else
22745 gl_cv_func_mkdir_trailing_slash_works=no
22746fi
22747rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22748 conftest.$ac_objext conftest.beam conftest.$ac_ext
22749fi
22750
22751 rm -rf conftest.dir
22752
22753
22754fi
22755{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5
22756$as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; }
22757 case "$gl_cv_func_mkdir_trailing_slash_works" in
22758 *yes) ;;
22759 *)
22760 REPLACE_MKDIR=1
22761 ;;
22762 esac
22763
22764 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5
22765$as_echo_n "checking whether mkdir handles trailing dot... " >&6; }
22766if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then :
22767 $as_echo_n "(cached) " >&6
22768else
22769 rm -rf conftest.dir
22770 if test "$cross_compiling" = yes; then :
22771 case "$host_os" in
c0c3707f
CB
22772 # Guess yes on glibc systems.
22773 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
22774 # Guess yes on musl systems.
22775 *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
22776 # Guess no on native Windows.
22777 mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
22778 # If we don't know, obey --enable-cross-guesses.
22779 *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
8a99096f
SM
22780 esac
22781
22782else
22783 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22784/* end confdefs.h. */
22785
22786# include <sys/types.h>
22787# include <sys/stat.h>
22788
22789int
22790main ()
22791{
22792return !mkdir ("conftest.dir/./", 0700);
22793 ;
22794 return 0;
22795}
22796_ACEOF
22797if ac_fn_c_try_run "$LINENO"; then :
22798 gl_cv_func_mkdir_trailing_dot_works=yes
22799else
22800 gl_cv_func_mkdir_trailing_dot_works=no
22801fi
22802rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22803 conftest.$ac_objext conftest.beam conftest.$ac_ext
22804fi
22805
22806 rm -rf conftest.dir
22807
22808
22809fi
22810{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5
22811$as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; }
22812 case "$gl_cv_func_mkdir_trailing_dot_works" in
22813 *yes) ;;
22814 *)
22815 REPLACE_MKDIR=1
22816
22817$as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h
22818
22819 ;;
22820 esac
22821
22822 if test $REPLACE_MKDIR = 1; then
22823
22824
22825
22826
22827
22828
22829
22830
22831 gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext"
22832
22833 fi
22834
22835
e8d8cce6
SM
22836 for ac_func in mkdtemp
22837do :
22838 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
22839if test "x$ac_cv_func_mkdtemp" = xyes; then :
22840 cat >>confdefs.h <<_ACEOF
22841#define HAVE_MKDTEMP 1
22842_ACEOF
22843
22844fi
22845done
22846
22847 if test $ac_cv_func_mkdtemp = no; then
22848 HAVE_MKDTEMP=0
22849 fi
22850
22851 if test $HAVE_MKDTEMP = 0; then
22852
22853
22854
22855
22856
22857
22858
22859
22860 gl_LIBOBJS="$gl_LIBOBJS mkdtemp.$ac_objext"
22861
22862 :
22863
22864 fi
22865
22866
22867
22868
22869
22870 GNULIB_MKDTEMP=1
22871
22872
22873
22874
22875
22876$as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h
22877
22878
22879
22880
22881
2d8adcbd
MM
22882
22883
b3279b60
TT
22884
22885
b3279b60
TT
22886 if test $ac_cv_func_mkostemp != yes; then
22887 HAVE_MKOSTEMP=0
22888 fi
2d8adcbd 22889
b3279b60 22890 if test $HAVE_MKOSTEMP = 0; then
2d8adcbd 22891
2d8adcbd 22892
2d8adcbd 22893
2d8adcbd 22894
2d8adcbd
MM
22895
22896
22897
22898
b3279b60 22899 gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext"
2d8adcbd
MM
22900
22901
22902
b3279b60 22903 fi
2d8adcbd 22904
2d8adcbd 22905
b3279b60
TT
22906cat >>confdefs.h <<_ACEOF
22907#define GNULIB_MKOSTEMP 1
22908_ACEOF
2d8adcbd
MM
22909
22910
2d8adcbd
MM
22911
22912
22913
22914
22915
b3279b60 22916 GNULIB_MKOSTEMP=1
2d8adcbd
MM
22917
22918
22919
22920
22921
b3279b60 22922$as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h
2d8adcbd
MM
22923
22924
22925
22926
6ec2e0f5
SDJ
22927 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
22928
22929
22930
c971b7fa 22931
c971b7fa 22932
c971b7fa
PA
22933
22934
8690e634 22935
6ec2e0f5 22936 gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext"
8690e634 22937
6ec2e0f5 22938 fi
8690e634 22939
6ec2e0f5 22940 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
8690e634
JK
22941
22942
22943
22944
22945
22946
8690e634
JK
22947
22948
6ec2e0f5 22949 gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext"
8690e634 22950
a512b375 22951 fi
8690e634
JK
22952
22953
c0c3707f
CB
22954cat >>confdefs.h <<_ACEOF
22955#define GNULIB_MSVC_NOTHROW 1
22956_ACEOF
22957
22958
22959
22960
725e2999
JB
22961 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
22962$as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
22963if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then :
22964 $as_echo_n "(cached) " >&6
22965else
22966
22967 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22968/* end confdefs.h. */
22969#include <netinet/in.h>
22970int
22971main ()
22972{
22973
22974 ;
22975 return 0;
22976}
22977_ACEOF
22978if ac_fn_c_try_compile "$LINENO"; then :
22979 gl_cv_header_netinet_in_h_selfcontained=yes
22980else
22981 gl_cv_header_netinet_in_h_selfcontained=no
22982fi
22983rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22984
22985fi
22986{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
22987$as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
22988 if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
22989 NETINET_IN_H=''
22990 else
22991 NETINET_IN_H='netinet/in.h'
22992 for ac_header in netinet/in.h
22993do :
22994 ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
22995if test "x$ac_cv_header_netinet_in_h" = xyes; then :
22996 cat >>confdefs.h <<_ACEOF
22997#define HAVE_NETINET_IN_H 1
22998_ACEOF
22999
23000fi
23001
23002done
23003
23004
23005
23006
23007
23008
23009
725e2999
JB
23010
23011
23012
23013 if test $gl_cv_have_include_next = yes; then
23014 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
23015 else
23016 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
23017$as_echo_n "checking absolute name of <netinet/in.h>... " >&6; }
23018if ${gl_cv_next_netinet_in_h+:} false; then :
23019 $as_echo_n "(cached) " >&6
23020else
23021
23022 if test $ac_cv_header_netinet_in_h = yes; then
23023
23024
23025
23026
23027 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23028/* end confdefs.h. */
23029#include <netinet/in.h>
23030_ACEOF
23031 case "$host_os" in
23032 aix*) gl_absname_cpp="$ac_cpp -C" ;;
23033 *) gl_absname_cpp="$ac_cpp" ;;
23034 esac
23035
23036 case "$host_os" in
23037 mingw*)
23038 gl_dirsep_regex='[/\\]'
23039 ;;
23040 *)
23041 gl_dirsep_regex='\/'
23042 ;;
23043 esac
23044 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
23045 gl_header_literal_regex=`echo 'netinet/in.h' \
23046 | sed -e "$gl_make_literal_regex_sed"`
23047 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
23048 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
23049 s|^/[^/]|//&|
23050 p
23051 q
23052 }'
23053
23054 gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
23055 sed -n "$gl_absolute_header_sed"`
23056
23057 gl_header=$gl_cv_absolute_netinet_in_h
23058 gl_cv_next_netinet_in_h='"'$gl_header'"'
23059 else
23060 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
23061 fi
23062
23063
23064fi
23065{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
23066$as_echo "$gl_cv_next_netinet_in_h" >&6; }
23067 fi
23068 NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
23069
23070 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
23071 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
23072 gl_next_as_first_directive='<'netinet/in.h'>'
23073 else
23074 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
23075 gl_next_as_first_directive=$gl_cv_next_netinet_in_h
23076 fi
23077 NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
23078
23079
23080
23081
23082 if test $ac_cv_header_netinet_in_h = yes; then
23083 HAVE_NETINET_IN_H=1
23084 else
23085 HAVE_NETINET_IN_H=0
23086 fi
23087
23088 fi
23089
23090 if test -n "$NETINET_IN_H"; then
23091 GL_GENERATE_NETINET_IN_H_TRUE=
23092 GL_GENERATE_NETINET_IN_H_FALSE='#'
23093else
23094 GL_GENERATE_NETINET_IN_H_TRUE='#'
23095 GL_GENERATE_NETINET_IN_H_FALSE=
23096fi
23097
23098
23099
23100
8690e634 23101
c0c3707f 23102
6ec2e0f5
SDJ
23103 case "$host_os" in
23104 mingw* | pw*)
23105 REPLACE_OPEN=1
23106 ;;
23107 *)
23108
c0c3707f
CB
23109 if test "$gl_cv_macro_O_CLOEXEC" != yes; then
23110 REPLACE_OPEN=1
23111 fi
472fa5ee
SM
23112
23113
c0c3707f 23114 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
6ec2e0f5 23115$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
d0ac1c44 23116if ${gl_cv_func_open_slash+:} false; then :
6ec2e0f5
SDJ
23117 $as_echo_n "(cached) " >&6
23118else
23119 # Assume that if we have lstat, we can also check symlinks.
c0c3707f
CB
23120 if test $ac_cv_func_lstat = yes; then
23121 touch conftest.tmp
23122 ln -s conftest.tmp conftest.lnk
23123 fi
23124 if test "$cross_compiling" = yes; then :
8690e634 23125
c0c3707f
CB
23126 case "$host_os" in
23127 freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
23128 gl_cv_func_open_slash="guessing no" ;;
23129 *)
23130 gl_cv_func_open_slash="guessing yes" ;;
23131 esac
8690e634 23132
6ec2e0f5
SDJ
23133else
23134 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23135/* end confdefs.h. */
23136
23137#include <fcntl.h>
23138#if HAVE_UNISTD_H
23139# include <unistd.h>
23140#endif
23141int main ()
23142{
23143 int result = 0;
23144#if HAVE_LSTAT
23145 if (open ("conftest.lnk/", O_RDONLY) != -1)
23146 result |= 1;
23147#endif
23148 if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
23149 result |= 2;
23150 return result;
23151}
23152_ACEOF
23153if ac_fn_c_try_run "$LINENO"; then :
23154 gl_cv_func_open_slash=yes
23155else
23156 gl_cv_func_open_slash=no
23157fi
23158rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23159 conftest.$ac_objext conftest.beam conftest.$ac_ext
23160fi
8690e634 23161
c0c3707f 23162 rm -f conftest.sl conftest.tmp conftest.lnk
8690e634 23163
6ec2e0f5
SDJ
23164fi
23165{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
23166$as_echo "$gl_cv_func_open_slash" >&6; }
c0c3707f
CB
23167 case "$gl_cv_func_open_slash" in
23168 *no)
8690e634 23169
6ec2e0f5 23170$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
8690e634 23171
6ec2e0f5
SDJ
23172 ;;
23173 esac
8690e634 23174
c0c3707f
CB
23175 case "$gl_cv_func_open_slash" in
23176 *no)
23177 REPLACE_OPEN=1
23178 ;;
23179 esac
23180 ;;
23181 esac
472fa5ee 23182
c0c3707f 23183 if test $REPLACE_OPEN = 0; then
472fa5ee
SM
23184
23185
23186
6ec2e0f5
SDJ
23187 if test $ac_cv_func_fchdir = no; then
23188 HAVE_FCHDIR=0
23189 fi
c971b7fa 23190
6ec2e0f5
SDJ
23191 if test $HAVE_FCHDIR = 0; then
23192 REPLACE_OPEN=1
23193 fi
23194 fi
c971b7fa
PA
23195
23196
23197
6ec2e0f5 23198 if test $REPLACE_OPEN = 1; then
c971b7fa
PA
23199
23200
23201
23202
23203
c971b7fa
PA
23204
23205
c971b7fa 23206
6ec2e0f5 23207 gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
c971b7fa 23208
c971b7fa
PA
23209
23210
6ec2e0f5
SDJ
23211 :
23212
a512b375 23213 fi
c971b7fa
PA
23214
23215
23216
23217
23218
6ec2e0f5 23219 GNULIB_OPEN=1
c971b7fa
PA
23220
23221
23222
23223
23224
6ec2e0f5 23225$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
c971b7fa
PA
23226
23227
23228
23229
23230
c971b7fa 23231
c971b7fa 23232
472fa5ee 23233
63ce7108 23234
c0c3707f
CB
23235 case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
23236 yes+*yes+yes)
6ec2e0f5
SDJ
23237 ;;
23238 yes+*)
c0c3707f 23239 # Solaris 10 lacks O_CLOEXEC.
6ec2e0f5
SDJ
23240 # Solaris 9 has *at functions, but uniformly mishandles trailing
23241 # slash in all of them.
23242 REPLACE_OPENAT=1
23243 ;;
23244 *)
23245 HAVE_OPENAT=0
23246 ;;
23247 esac
63ce7108 23248
6ec2e0f5 23249 if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
63ce7108 23250
63ce7108 23251
63ce7108 23252
63ce7108 23253
63ce7108
TT
23254
23255
63ce7108 23256
63ce7108 23257
6ec2e0f5 23258 gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext"
63ce7108
TT
23259
23260
23261
6ec2e0f5 23262 :
63ce7108 23263
6ec2e0f5 23264 fi
63ce7108
TT
23265
23266
6ec2e0f5
SDJ
23267cat >>confdefs.h <<_ACEOF
23268#define GNULIB_OPENAT 1
23269_ACEOF
63ce7108 23270
63ce7108 23271
63ce7108
TT
23272
23273
23274
23275
6ec2e0f5 23276 GNULIB_OPENAT=1
63ce7108 23277
63ce7108 23278
63ce7108 23279
63ce7108 23280
63ce7108 23281
6ec2e0f5 23282$as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h
63ce7108
TT
23283
23284
63ce7108 23285
63ce7108 23286
63ce7108 23287
63ce7108 23288
6ec2e0f5
SDJ
23289 for ac_func in opendir
23290do :
23291 ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
d0ac1c44 23292if test "x$ac_cv_func_opendir" = xyes; then :
6ec2e0f5
SDJ
23293 cat >>confdefs.h <<_ACEOF
23294#define HAVE_OPENDIR 1
63ce7108 23295_ACEOF
6ec2e0f5 23296
63ce7108 23297fi
6ec2e0f5 23298done
63ce7108 23299
6ec2e0f5
SDJ
23300 if test $ac_cv_func_opendir = no; then
23301 HAVE_OPENDIR=0
23302 fi
63ce7108 23303
6ec2e0f5
SDJ
23304
23305
23306
23307 if test $ac_cv_func_fchdir = no; then
23308 HAVE_FCHDIR=0
63ce7108 23309 fi
63ce7108 23310
6ec2e0f5
SDJ
23311 if test $HAVE_FCHDIR = 0; then
23312 if test $HAVE_OPENDIR = 1; then
23313 REPLACE_OPENDIR=1
23314 fi
23315 fi
23316
23317 case $host_os,$HAVE_OPENDIR in
23318 os2*,1)
23319 REPLACE_OPENDIR=1;;
23320 esac
23321
23322 if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
63ce7108
TT
23323
23324
23325
23326
23327
23328
23329
23330
6ec2e0f5 23331 gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext"
63ce7108
TT
23332
23333 fi
23334
23335
23336
23337
23338
6ec2e0f5 23339 GNULIB_OPENDIR=1
63ce7108
TT
23340
23341
23342
23343
63ce7108 23344
6ec2e0f5 23345$as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
63ce7108
TT
23346
23347
23348
23349
23350
23351
23352
2196f55f
YQ
23353
23354
8424cc97
SM
23355
23356 for ac_func in rawmemchr
23357do :
23358 ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr"
d0ac1c44 23359if test "x$ac_cv_func_rawmemchr" = xyes; then :
8424cc97
SM
23360 cat >>confdefs.h <<_ACEOF
23361#define HAVE_RAWMEMCHR 1
23362_ACEOF
23363
23364fi
23365done
23366
23367 if test $ac_cv_func_rawmemchr = no; then
23368 HAVE_RAWMEMCHR=0
23369 fi
23370
23371 if test $HAVE_RAWMEMCHR = 0; then
23372
23373
23374
23375
23376
23377
23378
23379
23380 gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext"
23381
23382 :
23383 fi
23384
23385
23386
23387
23388
23389 GNULIB_RAWMEMCHR=1
23390
23391
23392
23393
23394
23395$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
23396
23397
23398
23399
23400
23401
6ec2e0f5
SDJ
23402 for ac_func in readdir
23403do :
23404 ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
d0ac1c44 23405if test "x$ac_cv_func_readdir" = xyes; then :
6ec2e0f5
SDJ
23406 cat >>confdefs.h <<_ACEOF
23407#define HAVE_READDIR 1
23408_ACEOF
23409
23410fi
23411done
23412
23413 if test $ac_cv_func_readdir = no; then
23414 HAVE_READDIR=0
23415 fi
23416
23417 if test $HAVE_READDIR = 0; then
23418
23419
23420
23421
23422
23423
23424
23425
23426 gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext"
23427
23428 fi
23429
23430
23431
23432
23433
23434 GNULIB_READDIR=1
23435
23436
23437
23438
23439
23440$as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h
23441
23442
23443
23444
23445
23446
2196f55f
YQ
23447 if test $ac_cv_func_readlink = no; then
23448 HAVE_READLINK=0
23449 else
23450 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
23451$as_echo_n "checking whether readlink signature is correct... " >&6; }
d0ac1c44 23452if ${gl_cv_decl_readlink_works+:} false; then :
2196f55f
YQ
23453 $as_echo_n "(cached) " >&6
23454else
23455 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23456/* end confdefs.h. */
23457#include <unistd.h>
23458 /* Cause compilation failure if original declaration has wrong type. */
23459 ssize_t readlink (const char *, char *, size_t);
23460int
23461main ()
23462{
23463
23464 ;
23465 return 0;
23466}
23467_ACEOF
23468if ac_fn_c_try_compile "$LINENO"; then :
23469 gl_cv_decl_readlink_works=yes
23470else
23471 gl_cv_decl_readlink_works=no
23472fi
23473rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23474fi
23475{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
23476$as_echo "$gl_cv_decl_readlink_works" >&6; }
23477 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
23478$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
d0ac1c44 23479if ${gl_cv_func_readlink_works+:} false; then :
2196f55f
YQ
23480 $as_echo_n "(cached) " >&6
23481else
23482 # We have readlink, so assume ln -s works.
23483 ln -s conftest.no-such conftest.link
23484 ln -s conftest.link conftest.lnk2
23485 if test "$cross_compiling" = yes; then :
23486 case "$host_os" in
c0c3707f
CB
23487 # Guess yes on Linux systems.
23488 linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;;
23489 # Guess yes on glibc systems.
23490 *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;;
23491 # If we don't know, obey --enable-cross-guesses.
23492 *) gl_cv_func_readlink_works="$gl_cross_guess_normal" ;;
2196f55f
YQ
23493 esac
23494
23495else
23496 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23497/* end confdefs.h. */
23498#include <unistd.h>
23499
23500int
23501main ()
23502{
23503char buf[20];
23504 return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
23505 ;
23506 return 0;
23507}
23508_ACEOF
23509if ac_fn_c_try_run "$LINENO"; then :
23510 gl_cv_func_readlink_works=yes
23511else
23512 gl_cv_func_readlink_works=no
23513fi
23514rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23515 conftest.$ac_objext conftest.beam conftest.$ac_ext
23516fi
23517
23518 rm -f conftest.link conftest.lnk2
23519fi
23520{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5
23521$as_echo "$gl_cv_func_readlink_works" >&6; }
23522 case "$gl_cv_func_readlink_works" in
23523 *yes)
23524 if test "$gl_cv_decl_readlink_works" != yes; then
23525 REPLACE_READLINK=1
23526 fi
23527 ;;
23528 *)
23529
23530$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
23531
23532 REPLACE_READLINK=1
23533 ;;
23534 esac
23535 fi
23536
23537 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
23538
23539
23540
23541
23542
23543
23544
23545
23546 gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
23547
23548
23549 :
23550
23551 fi
23552
23553
23554
23555
23556
23557 GNULIB_READLINK=1
23558
23559
23560
23561
23562
23563$as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
23564
23565
23566
23567
6a29c58e
YQ
23568
23569
6ec2e0f5
SDJ
23570 if test $gl_cv_func_malloc_posix = yes; then
23571
23572$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
23573
23574 else
23575 REPLACE_REALLOC=1
23576 fi
23577
23578 if test $REPLACE_REALLOC = 1; then
23579
23580
23581
23582
23583
23584
23585
23586
23587 gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
23588
23589 fi
23590
23591
23592
23593
23594
23595 GNULIB_REALLOC_POSIX=1
23596
23597
23598
23599
23600
23601$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
23602
23603
23604
23605
23606
23607
6a29c58e
YQ
23608
23609
23610 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5
23611$as_echo_n "checking whether rename honors trailing slash on destination... " >&6; }
d0ac1c44 23612if ${gl_cv_func_rename_slash_dst_works+:} false; then :
6a29c58e
YQ
23613 $as_echo_n "(cached) " >&6
23614else
23615 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
23616 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 23617 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
23618 # Assume that if we have lstat, we can also check symlinks.
23619 if test $ac_cv_func_lstat = yes; then
23620 ln -s conftest.f conftest.lnk
23621 fi
23622 if test "$cross_compiling" = yes; then :
23623 case "$host_os" in
c0c3707f
CB
23624 # Guess yes on Linux systems.
23625 linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
23626 # Guess yes on glibc systems.
23627 *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
23628 # Guess no on native Windows.
23629 mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
23630 # If we don't know, obey --enable-cross-guesses.
23631 *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
23632 esac
23633
23634else
23635 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23636/* end confdefs.h. */
23637
23638# include <stdio.h>
23639# include <stdlib.h>
23640
23641int
23642main ()
23643{
23644int result = 0;
23645 if (rename ("conftest.f1", "conftest.f2/") == 0)
23646 result |= 1;
23647 if (rename ("conftest.d1", "conftest.d2/") != 0)
23648 result |= 2;
23649#if HAVE_LSTAT
23650 if (rename ("conftest.f", "conftest.lnk/") == 0)
23651 result |= 4;
23652#endif
23653 return result;
23654
23655 ;
23656 return 0;
23657}
23658_ACEOF
23659if ac_fn_c_try_run "$LINENO"; then :
23660 gl_cv_func_rename_slash_dst_works=yes
23661else
23662 gl_cv_func_rename_slash_dst_works=no
23663fi
23664rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23665 conftest.$ac_objext conftest.beam conftest.$ac_ext
23666fi
23667
23668 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
23669
23670fi
23671{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5
23672$as_echo "$gl_cv_func_rename_slash_dst_works" >&6; }
23673 case "$gl_cv_func_rename_slash_dst_works" in
23674 *yes) ;;
23675 *)
23676 REPLACE_RENAME=1
23677
23678$as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h
23679
23680 ;;
23681 esac
23682
23683 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5
23684$as_echo_n "checking whether rename honors trailing slash on source... " >&6; }
d0ac1c44 23685if ${gl_cv_func_rename_slash_src_works+:} false; then :
6a29c58e
YQ
23686 $as_echo_n "(cached) " >&6
23687else
23688 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
23689 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 23690 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
23691 # Assume that if we have lstat, we can also check symlinks.
23692 if test $ac_cv_func_lstat = yes; then
23693 ln -s conftest.f conftest.lnk
23694 fi
23695 if test "$cross_compiling" = yes; then :
23696 case "$host_os" in
c0c3707f
CB
23697 # Guess yes on Linux systems.
23698 linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
23699 # Guess yes on glibc systems.
23700 *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
23701 # Guess yes on native Windows.
23702 mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
23703 # If we don't know, obey --enable-cross-guesses.
23704 *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
23705 esac
23706
23707else
23708 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23709/* end confdefs.h. */
23710
23711# include <stdio.h>
23712# include <stdlib.h>
23713
23714int
23715main ()
23716{
23717int result = 0;
23718 if (rename ("conftest.f1/", "conftest.d3") == 0)
23719 result |= 1;
23720 if (rename ("conftest.d1/", "conftest.d2") != 0)
23721 result |= 2;
23722#if HAVE_LSTAT
23723 if (rename ("conftest.lnk/", "conftest.f") == 0)
23724 result |= 4;
23725#endif
23726 return result;
23727
23728 ;
23729 return 0;
23730}
23731_ACEOF
23732if ac_fn_c_try_run "$LINENO"; then :
23733 gl_cv_func_rename_slash_src_works=yes
23734else
23735 gl_cv_func_rename_slash_src_works=no
23736fi
23737rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23738 conftest.$ac_objext conftest.beam conftest.$ac_ext
23739fi
23740
23741 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
23742
23743fi
23744{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5
23745$as_echo "$gl_cv_func_rename_slash_src_works" >&6; }
23746 case "$gl_cv_func_rename_slash_src_works" in
23747 *yes) ;;
23748 *)
23749 REPLACE_RENAME=1
23750
23751$as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h
23752
23753 ;;
23754 esac
23755
23756
23757 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5
23758$as_echo_n "checking whether rename manages hard links correctly... " >&6; }
d0ac1c44 23759if ${gl_cv_func_rename_link_works+:} false; then :
6a29c58e
YQ
23760 $as_echo_n "(cached) " >&6
23761else
23762 if test $ac_cv_func_link = yes; then
c0c3707f
CB
23763 if test $cross_compiling != yes; then
23764 rm -rf conftest.f conftest.f1 conftest.f2
23765 if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
23766 set x `ls -i conftest.f conftest.f1` && test "" = ""; then
23767 if test "$cross_compiling" = yes; then :
23768 :
6a29c58e
YQ
23769
23770else
23771 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23772/* end confdefs.h. */
23773
c0c3707f
CB
23774# include <errno.h>
23775# include <stdio.h>
23776# include <stdlib.h>
23777# include <unistd.h>
6a29c58e
YQ
23778
23779int
23780main ()
23781{
23782int result = 0;
c0c3707f
CB
23783 if (rename ("conftest.f", "conftest.f1"))
23784 result |= 1;
23785 if (unlink ("conftest.f1"))
23786 result |= 2;
23787
23788 /* Allow either the POSIX-required behavior, where the
23789 previous rename kept conftest.f, or the (better) NetBSD
23790 behavior, where it removed conftest.f. */
23791 if (rename ("conftest.f", "conftest.f") != 0
23792 && errno != ENOENT)
23793 result |= 4;
23794
23795 if (rename ("conftest.f1", "conftest.f1") == 0)
23796 result |= 8;
23797 if (rename ("conftest.f2", "conftest.f2") != 0)
23798 result |= 16;
23799 return result;
6a29c58e
YQ
23800
23801 ;
23802 return 0;
23803}
23804_ACEOF
23805if ac_fn_c_try_run "$LINENO"; then :
23806 gl_cv_func_rename_link_works=yes
23807else
23808 gl_cv_func_rename_link_works=no
23809fi
23810rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23811 conftest.$ac_objext conftest.beam conftest.$ac_ext
23812fi
23813
c0c3707f
CB
23814 else
23815 gl_cv_func_rename_link_works="guessing no"
23816 fi
23817 rm -rf conftest.f conftest.f1 conftest.f2
6a29c58e 23818 else
c0c3707f
CB
23819 case "$host_os" in
23820 # Guess yes on Linux systems.
23821 linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
23822 # Guess yes on glibc systems.
23823 *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
23824 # Guess yes on native Windows.
23825 mingw*) gl_cv_func_rename_link_works="guessing yes" ;;
23826 # If we don't know, obey --enable-cross-guesses.
23827 *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
23828 esac
6a29c58e 23829 fi
6a29c58e
YQ
23830 else
23831 gl_cv_func_rename_link_works=yes
23832 fi
23833
23834fi
23835{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5
23836$as_echo "$gl_cv_func_rename_link_works" >&6; }
23837 case "$gl_cv_func_rename_link_works" in
23838 *yes) ;;
23839 *)
23840 REPLACE_RENAME=1
23841
23842$as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h
23843
23844 ;;
23845 esac
23846
23847 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5
23848$as_echo_n "checking whether rename manages existing destinations correctly... " >&6; }
d0ac1c44 23849if ${gl_cv_func_rename_dest_works+:} false; then :
6a29c58e
YQ
23850 $as_echo_n "(cached) " >&6
23851else
23852 rm -rf conftest.f conftest.d1 conftest.d2
23853 touch conftest.f && mkdir conftest.d1 conftest.d2 ||
d0ac1c44 23854 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
23855 if test "$cross_compiling" = yes; then :
23856 case "$host_os" in
c0c3707f
CB
23857 # Guess yes on Linux systems.
23858 linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
23859 # Guess yes on glibc systems.
23860 *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
23861 # Guess no on native Windows.
23862 mingw*) gl_cv_func_rename_dest_works="guessing no" ;;
23863 # If we don't know, obey --enable-cross-guesses.
23864 *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
23865 esac
23866
23867else
23868 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23869/* end confdefs.h. */
23870
23871# include <stdio.h>
23872# include <stdlib.h>
23873
23874int
23875main ()
23876{
23877int result = 0;
23878 if (rename ("conftest.d1", "conftest.d2") != 0)
23879 result |= 1;
23880 if (rename ("conftest.d2", "conftest.f") == 0)
23881 result |= 2;
23882 return result;
23883
23884 ;
23885 return 0;
23886}
23887_ACEOF
23888if ac_fn_c_try_run "$LINENO"; then :
23889 gl_cv_func_rename_dest_works=yes
23890else
23891 gl_cv_func_rename_dest_works=no
23892fi
23893rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23894 conftest.$ac_objext conftest.beam conftest.$ac_ext
23895fi
23896
23897 rm -rf conftest.f conftest.d1 conftest.d2
23898
23899fi
23900{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5
23901$as_echo "$gl_cv_func_rename_dest_works" >&6; }
23902 case "$gl_cv_func_rename_dest_works" in
23903 *yes) ;;
23904 *)
23905 REPLACE_RENAME=1
23906
23907$as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
23908
23909 ;;
23910 esac
23911
23912 if test $REPLACE_RENAME = 1; then
23913
23914
23915
23916
23917
23918
23919
23920
23921 gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext"
23922
23923 fi
23924
23925
23926
23927
23928
23929 GNULIB_RENAME=1
23930
23931
23932
23933
23934
23935$as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h
23936
23937
23938
23939
23940
23941
6ec2e0f5
SDJ
23942 for ac_func in rewinddir
23943do :
23944 ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir"
d0ac1c44 23945if test "x$ac_cv_func_rewinddir" = xyes; then :
6ec2e0f5
SDJ
23946 cat >>confdefs.h <<_ACEOF
23947#define HAVE_REWINDDIR 1
23948_ACEOF
23949
23950fi
23951done
23952
23953 if test $ac_cv_func_rewinddir = no; then
23954 HAVE_REWINDDIR=0
23955 fi
23956
23957 if test $HAVE_REWINDDIR = 0; then
23958
23959
23960
23961
23962
23963
23964
23965
23966 gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext"
23967
23968 fi
23969
23970
23971
23972
23973
23974 GNULIB_REWINDDIR=1
23975
23976
23977
23978
23979
23980$as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h
23981
23982
23983
23984
23985
23986
6a29c58e
YQ
23987 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
23988$as_echo_n "checking whether rmdir works... " >&6; }
d0ac1c44 23989if ${gl_cv_func_rmdir_works+:} false; then :
6a29c58e
YQ
23990 $as_echo_n "(cached) " >&6
23991else
23992 mkdir conftest.dir
23993 touch conftest.file
23994 if test "$cross_compiling" = yes; then :
23995 case "$host_os" in
c0c3707f
CB
23996 # Guess yes on Linux systems.
23997 linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
23998 # Guess yes on glibc systems.
23999 *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
24000 # Guess no on native Windows.
24001 mingw*) gl_cv_func_rmdir_works="guessing no" ;;
24002 # If we don't know, obey --enable-cross-guesses.
24003 *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
24004 esac
24005
24006else
24007 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24008/* end confdefs.h. */
24009#include <stdio.h>
24010 #include <errno.h>
24011 #if HAVE_UNISTD_H
24012 # include <unistd.h>
24013 #else /* on Windows with MSVC */
24014 # include <direct.h>
24015 #endif
24016
24017int
24018main ()
24019{
24020int result = 0;
24021 if (!rmdir ("conftest.file/"))
24022 result |= 1;
24023 else if (errno != ENOTDIR)
24024 result |= 2;
24025 if (!rmdir ("conftest.dir/./"))
24026 result |= 4;
24027 return result;
24028
24029 ;
24030 return 0;
24031}
24032_ACEOF
24033if ac_fn_c_try_run "$LINENO"; then :
24034 gl_cv_func_rmdir_works=yes
24035else
24036 gl_cv_func_rmdir_works=no
24037fi
24038rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24039 conftest.$ac_objext conftest.beam conftest.$ac_ext
24040fi
24041
24042 rm -rf conftest.dir conftest.file
24043fi
24044{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
24045$as_echo "$gl_cv_func_rmdir_works" >&6; }
24046 case "$gl_cv_func_rmdir_works" in
24047 *yes) ;;
24048 *)
24049 REPLACE_RMDIR=1
24050 ;;
24051 esac
24052
24053 if test $REPLACE_RMDIR = 1; then
24054
24055
24056
24057
24058
24059
24060
24061
24062 gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext"
24063
24064 fi
24065
24066
24067
24068
24069
24070 GNULIB_RMDIR=1
24071
24072
24073
24074
24075
24076$as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
24077
24078
24079
24080
0750520d 24081
5e8754f9
SDJ
24082
24083
24084
3d99e817
AK
24085 if test $ac_cv_func_setenv = no; then
24086 HAVE_SETENV=0
24087 else
24088 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
24089$as_echo_n "checking whether setenv validates arguments... " >&6; }
d0ac1c44 24090if ${gl_cv_func_setenv_works+:} false; then :
3d99e817
AK
24091 $as_echo_n "(cached) " >&6
24092else
24093 if test "$cross_compiling" = yes; then :
24094 case "$host_os" in
c0c3707f
CB
24095 # Guess yes on glibc systems.
24096 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
24097 # Guess yes on musl systems.
24098 *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
24099 # If we don't know, obey --enable-cross-guesses.
24100 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
24101 esac
24102
24103else
24104 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24105/* end confdefs.h. */
24106
24107 #include <stdlib.h>
24108 #include <errno.h>
24109 #include <string.h>
24110
24111int
24112main ()
24113{
24114
24115 int result = 0;
24116 {
24117 if (setenv ("", "", 0) != -1)
24118 result |= 1;
24119 else if (errno != EINVAL)
24120 result |= 2;
24121 }
24122 {
24123 if (setenv ("a", "=", 1) != 0)
24124 result |= 4;
24125 else if (strcmp (getenv ("a"), "=") != 0)
24126 result |= 8;
24127 }
24128 return result;
24129
24130 ;
24131 return 0;
24132}
24133_ACEOF
24134if ac_fn_c_try_run "$LINENO"; then :
24135 gl_cv_func_setenv_works=yes
24136else
24137 gl_cv_func_setenv_works=no
24138fi
24139rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24140 conftest.$ac_objext conftest.beam conftest.$ac_ext
24141fi
24142
24143fi
24144{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
24145$as_echo "$gl_cv_func_setenv_works" >&6; }
24146 case "$gl_cv_func_setenv_works" in
24147 *yes) ;;
24148 *)
24149 REPLACE_SETENV=1
24150 ;;
24151 esac
24152 fi
24153
24154 if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
24155
24156
24157
24158
24159
24160
24161
24162
24163 gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext"
24164
24165 fi
24166
24167
24168
24169
24170
24171 GNULIB_SETENV=1
24172
24173
24174
24175
24176
24177$as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
24178
24179
24180
24181
24182
0750520d
PA
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192 if test $gl_cv_have_include_next = yes; then
24193 gl_cv_next_signal_h='<'signal.h'>'
24194 else
24195 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
24196$as_echo_n "checking absolute name of <signal.h>... " >&6; }
d0ac1c44 24197if ${gl_cv_next_signal_h+:} false; then :
0750520d
PA
24198 $as_echo_n "(cached) " >&6
24199else
24200
24201
24202
24203 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24204/* end confdefs.h. */
24205#include <signal.h>
24206_ACEOF
24207 case "$host_os" in
24208 aix*) gl_absname_cpp="$ac_cpp -C" ;;
24209 *) gl_absname_cpp="$ac_cpp" ;;
24210 esac
24211
24212 case "$host_os" in
24213 mingw*)
24214 gl_dirsep_regex='[/\\]'
24215 ;;
24216 *)
24217 gl_dirsep_regex='\/'
24218 ;;
24219 esac
24220 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
24221 gl_header_literal_regex=`echo 'signal.h' \
24222 | sed -e "$gl_make_literal_regex_sed"`
24223 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
24224 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
24225 s|^/[^/]|//&|
24226 p
24227 q
24228 }'
24229
24230 gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
24231 sed -n "$gl_absolute_header_sed"`
24232
24233 gl_header=$gl_cv_absolute_signal_h
24234 gl_cv_next_signal_h='"'$gl_header'"'
24235
24236
24237fi
24238{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
24239$as_echo "$gl_cv_next_signal_h" >&6; }
24240 fi
24241 NEXT_SIGNAL_H=$gl_cv_next_signal_h
24242
24243 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
24244 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
24245 gl_next_as_first_directive='<'signal.h'>'
24246 else
24247 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
24248 gl_next_as_first_directive=$gl_cv_next_signal_h
24249 fi
24250 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
24251
24252
24253
24254
24255
24256# AIX declares sig_atomic_t to already include volatile, and C89 compilers
24257# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
24258 ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
24259#include <signal.h>
24260
24261"
d0ac1c44 24262if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then :
0750520d
PA
24263
24264else
24265 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
24266fi
24267
24268
24269
24270
24271
24272
24273
24274 ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
24275#include <signal.h>
24276
24277"
d0ac1c44 24278if test "x$ac_cv_type_sighandler_t" = xyes; then :
0750520d
PA
24279
24280else
24281 HAVE_SIGHANDLER_T=0
24282fi
24283
24284
24285
0750520d 24286
0750520d
PA
24287
24288
725e2999
JB
24289 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
24290/* <sys/types.h> is not needed according to POSIX, but the
24291 <sys/socket.h> in i386-unknown-freebsd4.10 and
24292 powerpc-apple-darwin5.5 required it. */
24293#include <sys/types.h>
24294#if HAVE_SYS_SOCKET_H
24295# include <sys/socket.h>
24296#elif HAVE_WS2TCPIP_H
24297# include <ws2tcpip.h>
24298#endif
24299
24300"
24301if test "x$ac_cv_type_socklen_t" = xyes; then :
24302
24303else
24304 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
24305$as_echo_n "checking for socklen_t equivalent... " >&6; }
c0c3707f 24306if ${gl_cv_socklen_t_equiv+:} false; then :
725e2999
JB
24307 $as_echo_n "(cached) " >&6
24308else
24309 # Systems have either "struct sockaddr *" or
24310 # "void *" as the second argument to getpeername
24311 gl_cv_socklen_t_equiv=
24312 for arg2 in "struct sockaddr" void; do
24313 for t in int size_t "unsigned int" "long int" "unsigned long int"; do
24314 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24315/* end confdefs.h. */
24316#include <sys/types.h>
24317 #include <sys/socket.h>
24318
24319 int getpeername (int, $arg2 *, $t *);
24320int
24321main ()
24322{
24323$t len;
24324 getpeername (0, 0, &len);
24325 ;
24326 return 0;
24327}
24328_ACEOF
24329if ac_fn_c_try_compile "$LINENO"; then :
24330 gl_cv_socklen_t_equiv="$t"
24331fi
24332rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24333 test "$gl_cv_socklen_t_equiv" != "" && break
24334 done
24335 test "$gl_cv_socklen_t_equiv" != "" && break
24336 done
c0c3707f
CB
24337 if test "$gl_cv_socklen_t_equiv" = ""; then
24338 as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
24339 fi
725e2999
JB
24340
24341fi
c0c3707f 24342{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
725e2999
JB
24343$as_echo "$gl_cv_socklen_t_equiv" >&6; }
24344
24345cat >>confdefs.h <<_ACEOF
24346#define socklen_t $gl_cv_socklen_t_equiv
24347_ACEOF
24348
24349fi
24350
0750520d 24351
63ce7108
TT
24352 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
24353$as_echo_n "checking for ssize_t... " >&6; }
d0ac1c44 24354if ${gt_cv_ssize_t+:} false; then :
63ce7108
TT
24355 $as_echo_n "(cached) " >&6
24356else
24357 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24358/* end confdefs.h. */
24359#include <sys/types.h>
24360int
24361main ()
24362{
24363int x = sizeof (ssize_t *) + sizeof (ssize_t);
24364 return !x;
24365 ;
24366 return 0;
24367}
24368_ACEOF
24369if ac_fn_c_try_compile "$LINENO"; then :
24370 gt_cv_ssize_t=yes
24371else
24372 gt_cv_ssize_t=no
24373fi
24374rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24375fi
24376{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
24377$as_echo "$gt_cv_ssize_t" >&6; }
24378 if test $gt_cv_ssize_t = no; then
24379
24380$as_echo "#define ssize_t int" >>confdefs.h
24381
24382 fi
24383
24384
24385
24386
472fa5ee 24387
c0c3707f
CB
24388 case "$host_os" in
24389 mingw*)
24390 REPLACE_STAT=1
24391 ;;
24392 *)
24393 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
24394$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
24395if ${gl_cv_func_stat_file_slash+:} false; then :
2196f55f
YQ
24396 $as_echo_n "(cached) " >&6
24397else
c0c3707f
CB
24398 touch conftest.tmp
24399 # Assume that if we have lstat, we can also check symlinks.
24400 if test $ac_cv_func_lstat = yes; then
24401 ln -s conftest.tmp conftest.lnk
24402 fi
24403 if test "$cross_compiling" = yes; then :
24404 case "$host_os" in
24405 # Guess yes on Linux systems.
24406 linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
24407 # Guess yes on glibc systems.
24408 *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
24409 # If we don't know, obey --enable-cross-guesses.
24410 *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
24411 esac
24412
2196f55f
YQ
24413else
24414 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24415/* end confdefs.h. */
24416#include <sys/stat.h>
24417
24418int
24419main ()
24420{
c0c3707f
CB
24421int result = 0;
24422 struct stat st;
24423 if (!stat ("conftest.tmp/", &st))
24424 result |= 1;
24425#if HAVE_LSTAT
24426 if (!stat ("conftest.lnk/", &st))
24427 result |= 2;
24428#endif
24429 return result;
24430
2196f55f
YQ
24431 ;
24432 return 0;
24433}
24434_ACEOF
24435if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 24436 gl_cv_func_stat_file_slash=yes
2196f55f 24437else
c0c3707f 24438 gl_cv_func_stat_file_slash=no
2196f55f
YQ
24439fi
24440rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24441 conftest.$ac_objext conftest.beam conftest.$ac_ext
24442fi
24443
c0c3707f 24444 rm -f conftest.tmp conftest.lnk
2196f55f 24445fi
c0c3707f
CB
24446{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
24447$as_echo "$gl_cv_func_stat_file_slash" >&6; }
24448 case $gl_cv_func_stat_file_slash in
24449 *no)
24450 REPLACE_STAT=1
24451
24452$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
24453;;
24454 esac
24455 case $host_os in
24456 solaris*)
24457 REPLACE_FSTAT=1 ;;
24458 esac
24459 ;;
24460 esac
24461
24462 if test $REPLACE_STAT = 1; then
24463
24464
24465
24466
24467
24468
24469
24470
24471 gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
24472
24473 case "$host_os" in
24474 mingw*)
24475
24476
24477
24478
24479
24480
24481
24482
24483 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
24484
24485 ;;
24486 esac
24487
24488
24489 :
24490
24491 fi
24492
24493
24494
24495
24496
24497 GNULIB_STAT=1
24498
24499
24500
24501
24502
24503$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
24504
24505
24506
24507
7a6dbc2f 24508
c0c3707f
CB
24509
24510
24511 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>
24512 #include <sys/stat.h>
24513"
24514if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
24515
24516cat >>confdefs.h <<_ACEOF
24517#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
24518_ACEOF
24519
24520{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
24521$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
24522if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
24523 $as_echo_n "(cached) " >&6
2196f55f 24524else
5e8754f9
SDJ
24525 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24526/* end confdefs.h. */
c0c3707f
CB
24527
24528 #include <sys/types.h>
24529 #include <sys/stat.h>
24530 #if HAVE_SYS_TIME_H
24531 # include <sys/time.h>
24532 #endif
24533 #include <time.h>
24534 struct timespec ts;
24535 struct stat st;
7a6dbc2f 24536
5e8754f9
SDJ
24537int
24538main ()
24539{
c0c3707f
CB
24540
24541 st.st_atim = ts;
7a6dbc2f 24542
5e8754f9
SDJ
24543 ;
24544 return 0;
24545}
24546_ACEOF
c0c3707f
CB
24547if ac_fn_c_try_compile "$LINENO"; then :
24548 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
5e8754f9 24549else
c0c3707f 24550 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
2196f55f 24551fi
c0c3707f 24552rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2196f55f 24553fi
c0c3707f
CB
24554{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
24555$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
24556 if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
2196f55f 24557
c0c3707f 24558$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
2196f55f 24559
c0c3707f
CB
24560 fi
24561else
24562 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>
24563 #include <sys/stat.h>
24564"
24565if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
2196f55f 24566
c0c3707f
CB
24567cat >>confdefs.h <<_ACEOF
24568#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
24569_ACEOF
2196f55f 24570
c0c3707f
CB
24571
24572else
24573 ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
24574 #include <sys/stat.h>
24575"
24576if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
24577
24578cat >>confdefs.h <<_ACEOF
24579#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
24580_ACEOF
2196f55f
YQ
24581
24582
c0c3707f
CB
24583else
24584 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>
24585 #include <sys/stat.h>
24586"
24587if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
2196f55f 24588
c0c3707f
CB
24589cat >>confdefs.h <<_ACEOF
24590#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
24591_ACEOF
2196f55f
YQ
24592
24593
c0c3707f 24594fi
2196f55f 24595
c0c3707f 24596fi
2196f55f 24597
c0c3707f 24598fi
2196f55f 24599
c0c3707f 24600fi
2196f55f
YQ
24601
24602
24603
24604
24605
c0c3707f
CB
24606 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>
24607 #include <sys/stat.h>
24608"
24609if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then :
2196f55f 24610
c0c3707f
CB
24611cat >>confdefs.h <<_ACEOF
24612#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
24613_ACEOF
2196f55f
YQ
24614
24615
c0c3707f
CB
24616else
24617 ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
24618 #include <sys/stat.h>
24619"
24620if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then :
2196f55f 24621
c0c3707f
CB
24622cat >>confdefs.h <<_ACEOF
24623#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
24624_ACEOF
2196f55f 24625
2196f55f 24626
c0c3707f
CB
24627else
24628 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>
24629 #include <sys/stat.h>
24630"
24631if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then :
24632
24633cat >>confdefs.h <<_ACEOF
24634#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
24635_ACEOF
24636
24637
24638fi
24639
24640fi
5e8754f9 24641
c0c3707f 24642fi
2196f55f
YQ
24643
24644
24645
725e2999
JB
24646 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
24647$as_echo_n "checking for working stdalign.h... " >&6; }
24648if ${gl_cv_header_working_stdalign_h+:} false; then :
24649 $as_echo_n "(cached) " >&6
24650else
24651 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24652/* end confdefs.h. */
24653#include <stdalign.h>
24654 #include <stddef.h>
24655
24656 /* Test that alignof yields a result consistent with offsetof.
24657 This catches GCC bug 52023
c0c3707f 24658 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
725e2999
JB
24659 #ifdef __cplusplus
24660 template <class t> struct alignof_helper { char a; t b; };
24661 # define ao(type) offsetof (alignof_helper<type>, b)
24662 #else
24663 # define ao(type) offsetof (struct { char a; type b; }, b)
24664 #endif
24665 char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
24666 char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
24667 char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
24668
24669 /* Test _Alignas only on platforms where gnulib can help. */
24670 #if \
24671 ((defined __cplusplus && 201103 <= __cplusplus) \
24672 || (defined __APPLE__ && defined __MACH__ \
24673 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
24674 : __GNUC__) \
c0c3707f
CB
24675 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
24676 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
725e2999
JB
24677 || 1300 <= _MSC_VER)
24678 struct alignas_test { char c; char alignas (8) alignas_8; };
24679 char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
24680 ? 1 : -1];
24681 #endif
24682
24683int
24684main ()
24685{
24686
24687 ;
24688 return 0;
24689}
24690_ACEOF
24691if ac_fn_c_try_compile "$LINENO"; then :
24692 gl_cv_header_working_stdalign_h=yes
24693else
24694 gl_cv_header_working_stdalign_h=no
24695fi
24696rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24697fi
24698{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
24699$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
24700
24701 if test $gl_cv_header_working_stdalign_h = yes; then
24702 STDALIGN_H=''
24703 else
24704 STDALIGN_H='stdalign.h'
24705 fi
24706
24707
24708 if test -n "$STDALIGN_H"; then
24709 GL_GENERATE_STDALIGN_H_TRUE=
24710 GL_GENERATE_STDALIGN_H_FALSE='#'
24711else
24712 GL_GENERATE_STDALIGN_H_TRUE='#'
24713 GL_GENERATE_STDALIGN_H_FALSE=
24714fi
24715
24716
24717
2196f55f
YQ
24718
24719
63ce7108 24720
c0c3707f
CB
24721 if test "$ac_cv_header_stdbool_h" = yes; then
24722 case "$host_os" in
24723 solaris*)
24724 if test -z "$GCC"; then
24725 STDBOOL_H='stdbool.h'
24726 else
24727 STDBOOL_H=''
24728 fi
24729 ;;
24730 *)
24731 STDBOOL_H=''
24732 ;;
24733 esac
63ce7108
TT
24734 else
24735 STDBOOL_H='stdbool.h'
24736 fi
24737
24738 if test -n "$STDBOOL_H"; then
24739 GL_GENERATE_STDBOOL_H_TRUE=
24740 GL_GENERATE_STDBOOL_H_FALSE='#'
24741else
24742 GL_GENERATE_STDBOOL_H_TRUE='#'
24743 GL_GENERATE_STDBOOL_H_FALSE=
24744fi
24745
24746
24747 if test "$ac_cv_type__Bool" = yes; then
24748 HAVE__BOOL=1
24749 else
24750 HAVE__BOOL=0
24751 fi
24752
24753
24754
24755
24756
24757 STDDEF_H=
4a626d0a 24758
c0c3707f
CB
24759 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
24760$as_echo_n "checking for good max_align_t... " >&6; }
24761if ${gl_cv_type_max_align_t+:} false; then :
24762 $as_echo_n "(cached) " >&6
24763else
24764 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24765/* end confdefs.h. */
24766#include <stddef.h>
24767 unsigned int s = sizeof (max_align_t);
24768 #if defined __GNUC__ || defined __IBM__ALIGNOF__
24769 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
24770 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
24771 #endif
24772
24773int
24774main ()
24775{
4a626d0a 24776
c0c3707f
CB
24777 ;
24778 return 0;
24779}
24780_ACEOF
24781if ac_fn_c_try_compile "$LINENO"; then :
24782 gl_cv_type_max_align_t=yes
4a626d0a 24783else
c0c3707f 24784 gl_cv_type_max_align_t=no
4a626d0a 24785fi
c0c3707f
CB
24786rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24787
24788fi
24789{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
24790$as_echo "$gl_cv_type_max_align_t" >&6; }
24791 if test $gl_cv_type_max_align_t = no; then
24792 HAVE_MAX_ALIGN_T=0
24793 STDDEF_H=stddef.h
24794 fi
4a626d0a 24795
63ce7108
TT
24796 if test $gt_cv_c_wchar_t = no; then
24797 HAVE_WCHAR_T=0
24798 STDDEF_H=stddef.h
24799 fi
c0c3707f 24800
63ce7108
TT
24801 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
24802$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
d0ac1c44 24803if ${gl_cv_decl_null_works+:} false; then :
63ce7108
TT
24804 $as_echo_n "(cached) " >&6
24805else
24806 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24807/* end confdefs.h. */
24808#include <stddef.h>
24809 int test[2 * (sizeof NULL == sizeof (void *)) -1];
24810
24811int
24812main ()
24813{
24814
24815 ;
24816 return 0;
24817}
24818_ACEOF
24819if ac_fn_c_try_compile "$LINENO"; then :
24820 gl_cv_decl_null_works=yes
24821else
24822 gl_cv_decl_null_works=no
24823fi
24824rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24825fi
24826{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
24827$as_echo "$gl_cv_decl_null_works" >&6; }
24828 if test $gl_cv_decl_null_works = no; then
24829 REPLACE_NULL=1
24830 STDDEF_H=stddef.h
24831 fi
24832
c0c3707f 24833
63ce7108
TT
24834 if test -n "$STDDEF_H"; then
24835 GL_GENERATE_STDDEF_H_TRUE=
24836 GL_GENERATE_STDDEF_H_FALSE='#'
24837else
24838 GL_GENERATE_STDDEF_H_TRUE='#'
24839 GL_GENERATE_STDDEF_H_FALSE=
24840fi
24841
24842 if test -n "$STDDEF_H"; then
24843
24844
24845
24846
24847
24848
24849
24850
24851 if test $gl_cv_have_include_next = yes; then
24852 gl_cv_next_stddef_h='<'stddef.h'>'
24853 else
24854 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
24855$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
d0ac1c44 24856if ${gl_cv_next_stddef_h+:} false; then :
63ce7108
TT
24857 $as_echo_n "(cached) " >&6
24858else
24859
4a626d0a
PA
24860
24861
24862 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63ce7108
TT
24863/* end confdefs.h. */
24864#include <stddef.h>
63ce7108 24865_ACEOF
4a626d0a
PA
24866 case "$host_os" in
24867 aix*) gl_absname_cpp="$ac_cpp -C" ;;
24868 *) gl_absname_cpp="$ac_cpp" ;;
24869 esac
63ce7108 24870
4a626d0a
PA
24871 case "$host_os" in
24872 mingw*)
24873 gl_dirsep_regex='[/\\]'
24874 ;;
24875 *)
24876 gl_dirsep_regex='\/'
24877 ;;
24878 esac
24879 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
24880 gl_header_literal_regex=`echo 'stddef.h' \
24881 | sed -e "$gl_make_literal_regex_sed"`
24882 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
24883 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
24884 s|^/[^/]|//&|
24885 p
24886 q
24887 }'
63ce7108 24888
4a626d0a
PA
24889 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
24890 sed -n "$gl_absolute_header_sed"`
24891
24892 gl_header=$gl_cv_absolute_stddef_h
24893 gl_cv_next_stddef_h='"'$gl_header'"'
63ce7108
TT
24894
24895
24896fi
24897{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
24898$as_echo "$gl_cv_next_stddef_h" >&6; }
24899 fi
24900 NEXT_STDDEF_H=$gl_cv_next_stddef_h
24901
24902 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
24903 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
24904 gl_next_as_first_directive='<'stddef.h'>'
24905 else
24906 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
24907 gl_next_as_first_directive=$gl_cv_next_stddef_h
24908 fi
24909 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
24910
24911
24912
24913
24914 fi
24915
24916
24917
24918
49e4877c 24919 $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
63ce7108
TT
24920
24921
24922
98399780
YQ
24923
24924
24925
24926
24927
4a626d0a
PA
24928
24929
6a29c58e
YQ
24930 if test $gl_cv_have_include_next = yes; then
24931 gl_cv_next_stdio_h='<'stdio.h'>'
24932 else
24933 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
24934$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
d0ac1c44 24935if ${gl_cv_next_stdio_h+:} false; then :
6a29c58e
YQ
24936 $as_echo_n "(cached) " >&6
24937else
24938
4a626d0a
PA
24939
24940
24941 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6a29c58e
YQ
24942/* end confdefs.h. */
24943#include <stdio.h>
6a29c58e 24944_ACEOF
4a626d0a
PA
24945 case "$host_os" in
24946 aix*) gl_absname_cpp="$ac_cpp -C" ;;
24947 *) gl_absname_cpp="$ac_cpp" ;;
24948 esac
24949
24950 case "$host_os" in
24951 mingw*)
24952 gl_dirsep_regex='[/\\]'
24953 ;;
24954 *)
24955 gl_dirsep_regex='\/'
24956 ;;
24957 esac
24958 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
24959 gl_header_literal_regex=`echo 'stdio.h' \
24960 | sed -e "$gl_make_literal_regex_sed"`
24961 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
24962 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
24963 s|^/[^/]|//&|
24964 p
24965 q
24966 }'
6a29c58e 24967
4a626d0a
PA
24968 gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
24969 sed -n "$gl_absolute_header_sed"`
6a29c58e 24970
4a626d0a
PA
24971 gl_header=$gl_cv_absolute_stdio_h
24972 gl_cv_next_stdio_h='"'$gl_header'"'
6a29c58e
YQ
24973
24974
24975fi
24976{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
24977$as_echo "$gl_cv_next_stdio_h" >&6; }
24978 fi
24979 NEXT_STDIO_H=$gl_cv_next_stdio_h
24980
24981 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
24982 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
24983 gl_next_as_first_directive='<'stdio.h'>'
24984 else
24985 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
24986 gl_next_as_first_directive=$gl_cv_next_stdio_h
24987 fi
24988 NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
24989
24990
24991
24992
24993
4a626d0a
PA
24994 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
24995$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; }
d0ac1c44 24996if ${gl_cv_func_printf_attribute_flavor+:} false; then :
4a626d0a
PA
24997 $as_echo_n "(cached) " >&6
24998else
24999 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25000/* end confdefs.h. */
25001
25002 #define __STDC_FORMAT_MACROS 1
25003 #include <stdio.h>
25004 #include <inttypes.h>
25005 /* For non-mingw systems, compilation will trivially succeed.
25006 For mingw, compilation will succeed for older mingw (system
25007 printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
c0c3707f 25008 #if (defined _WIN32 && ! defined __CYGWIN__) && \
4a626d0a
PA
25009 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
25010 extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
25011 #endif
25012
25013int
25014main ()
25015{
25016
25017 ;
25018 return 0;
25019}
25020_ACEOF
25021if ac_fn_c_try_compile "$LINENO"; then :
25022 gl_cv_func_printf_attribute_flavor=system
25023else
25024 gl_cv_func_printf_attribute_flavor=gnu
25025fi
25026rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25027fi
25028{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
25029$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; }
25030 if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
25031
25032$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
25033
25034 fi
25035
6a29c58e
YQ
25036 GNULIB_FSCANF=1
25037
25038
25039cat >>confdefs.h <<_ACEOF
25040#define GNULIB_FSCANF 1
25041_ACEOF
25042
25043
25044 GNULIB_SCANF=1
25045
25046
25047cat >>confdefs.h <<_ACEOF
25048#define GNULIB_SCANF 1
25049_ACEOF
25050
25051
25052 GNULIB_FGETC=1
25053 GNULIB_GETC=1
25054 GNULIB_GETCHAR=1
25055 GNULIB_FGETS=1
25056 GNULIB_FREAD=1
25057
25058
25059 GNULIB_FPRINTF=1
25060 GNULIB_PRINTF=1
25061 GNULIB_VFPRINTF=1
25062 GNULIB_VPRINTF=1
25063 GNULIB_FPUTC=1
25064 GNULIB_PUTC=1
25065 GNULIB_PUTCHAR=1
25066 GNULIB_FPUTS=1
25067 GNULIB_PUTS=1
25068 GNULIB_FWRITE=1
25069
25070
25071
25072
6a29c58e 25073
6a29c58e
YQ
25074
25075
25076
25077
25078
25079
25080
25081
25082
25083
25084
25085
98399780
YQ
25086 if test $gl_cv_have_include_next = yes; then
25087 gl_cv_next_stdlib_h='<'stdlib.h'>'
25088 else
25089 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
25090$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
d0ac1c44 25091if ${gl_cv_next_stdlib_h+:} false; then :
98399780
YQ
25092 $as_echo_n "(cached) " >&6
25093else
25094
4a626d0a
PA
25095
25096
25097 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98399780
YQ
25098/* end confdefs.h. */
25099#include <stdlib.h>
98399780 25100_ACEOF
4a626d0a
PA
25101 case "$host_os" in
25102 aix*) gl_absname_cpp="$ac_cpp -C" ;;
25103 *) gl_absname_cpp="$ac_cpp" ;;
25104 esac
25105
25106 case "$host_os" in
25107 mingw*)
25108 gl_dirsep_regex='[/\\]'
25109 ;;
25110 *)
25111 gl_dirsep_regex='\/'
25112 ;;
25113 esac
25114 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
25115 gl_header_literal_regex=`echo 'stdlib.h' \
25116 | sed -e "$gl_make_literal_regex_sed"`
25117 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
25118 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
25119 s|^/[^/]|//&|
25120 p
25121 q
25122 }'
98399780 25123
4a626d0a
PA
25124 gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
25125 sed -n "$gl_absolute_header_sed"`
98399780 25126
4a626d0a
PA
25127 gl_header=$gl_cv_absolute_stdlib_h
25128 gl_cv_next_stdlib_h='"'$gl_header'"'
98399780
YQ
25129
25130
25131fi
25132{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
25133$as_echo "$gl_cv_next_stdlib_h" >&6; }
25134 fi
25135 NEXT_STDLIB_H=$gl_cv_next_stdlib_h
25136
25137 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
25138 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
25139 gl_next_as_first_directive='<'stdlib.h'>'
25140 else
25141 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
25142 gl_next_as_first_directive=$gl_cv_next_stdlib_h
25143 fi
25144 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
25145
25146
25147
25148
25149
25150
98399780 25151
98399780
YQ
25152
25153
25154
25155
25156
25157
8424cc97
SM
25158 for ac_func in strchrnul
25159do :
25160 ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul"
d0ac1c44 25161if test "x$ac_cv_func_strchrnul" = xyes; then :
8424cc97
SM
25162 cat >>confdefs.h <<_ACEOF
25163#define HAVE_STRCHRNUL 1
25164_ACEOF
25165
25166fi
25167done
25168
25169 if test $ac_cv_func_strchrnul = no; then
25170 HAVE_STRCHRNUL=0
25171 else
25172 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5
25173$as_echo_n "checking whether strchrnul works... " >&6; }
d0ac1c44 25174if ${gl_cv_func_strchrnul_works+:} false; then :
8424cc97
SM
25175 $as_echo_n "(cached) " >&6
25176else
25177 if test "$cross_compiling" = yes; then :
25178 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25179/* end confdefs.h. */
25180
25181#if defined __CYGWIN__
25182 #include <cygwin/version.h>
25183 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
25184 Lucky user
25185 #endif
25186#else
25187 Lucky user
25188#endif
25189
25190_ACEOF
25191if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25192 $EGREP "Lucky user" >/dev/null 2>&1; then :
25193 gl_cv_func_strchrnul_works="guessing yes"
25194else
25195 gl_cv_func_strchrnul_works="guessing no"
25196fi
25197rm -f conftest*
25198
25199
25200else
25201 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25202/* end confdefs.h. */
25203
25204#include <string.h> /* for strchrnul */
25205
25206int
25207main ()
25208{
25209const char *buf = "a";
25210 return strchrnul (buf, 'b') != buf + 1;
25211
25212 ;
25213 return 0;
25214}
25215_ACEOF
25216if ac_fn_c_try_run "$LINENO"; then :
25217 gl_cv_func_strchrnul_works=yes
25218else
25219 gl_cv_func_strchrnul_works=no
25220fi
25221rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25222 conftest.$ac_objext conftest.beam conftest.$ac_ext
25223fi
25224
25225
25226fi
25227{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5
25228$as_echo "$gl_cv_func_strchrnul_works" >&6; }
25229 case "$gl_cv_func_strchrnul_works" in
25230 *yes) ;;
25231 *) REPLACE_STRCHRNUL=1 ;;
25232 esac
25233 fi
25234
25235 if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
25236
25237
25238
25239
25240
25241
25242
25243
25244 gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext"
25245
25246 :
25247 fi
25248
25249
25250
25251
25252
25253 GNULIB_STRCHRNUL=1
25254
25255
25256
25257
25258
25259$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
25260
25261
25262
25263
25264
25265
25266
6ec2e0f5
SDJ
25267 if test $ac_cv_func_strdup = yes; then
25268 if test $gl_cv_func_malloc_posix != yes; then
25269 REPLACE_STRDUP=1
25270 fi
25271 fi
25272
25273 if test $ac_cv_have_decl_strdup = no; then
25274 HAVE_DECL_STRDUP=0
25275 fi
25276
25277 if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
25278
25279
25280
25281
25282
25283
25284
25285
25286 gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext"
25287
25288 :
25289 fi
25290
25291
25292
25293
25294
25295 GNULIB_STRDUP=1
25296
25297
25298
25299
25300
25301$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
25302
25303
25304
25305
25306
25307
25308
25309
5abebf3c
CB
25310
25311
6ec2e0f5
SDJ
25312 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
25313 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
25314$as_echo_n "checking for working strerror function... " >&6; }
d0ac1c44 25315if ${gl_cv_func_working_strerror+:} false; then :
6ec2e0f5
SDJ
25316 $as_echo_n "(cached) " >&6
25317else
25318 if test "$cross_compiling" = yes; then :
25319 case "$host_os" in
c0c3707f
CB
25320 # Guess yes on glibc systems.
25321 *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
25322 # Guess yes on musl systems.
25323 *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
25324 # If we don't know, obey --enable-cross-guesses.
25325 *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
6ec2e0f5
SDJ
25326 esac
25327
25328else
25329 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25330/* end confdefs.h. */
25331#include <string.h>
25332
25333int
25334main ()
25335{
25336if (!*strerror (-2)) return 1;
25337 ;
25338 return 0;
25339}
25340_ACEOF
25341if ac_fn_c_try_run "$LINENO"; then :
25342 gl_cv_func_working_strerror=yes
25343else
25344 gl_cv_func_working_strerror=no
25345fi
25346rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25347 conftest.$ac_objext conftest.beam conftest.$ac_ext
25348fi
25349
25350
25351fi
25352{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
25353$as_echo "$gl_cv_func_working_strerror" >&6; }
25354 case "$gl_cv_func_working_strerror" in
25355 *yes) ;;
25356 *)
25357 REPLACE_STRERROR=1
25358 ;;
25359 esac
25360
5abebf3c
CB
25361 case "$gl_cv_func_strerror_r_works" in
25362 *no) REPLACE_STRERROR=1 ;;
25363 esac
25364
6ec2e0f5
SDJ
25365 else
25366 REPLACE_STRERROR=1
25367 fi
25368
25369 if test $REPLACE_STRERROR = 1; then
25370
25371
25372
25373
25374
25375
25376
25377
25378 gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
25379
25380 fi
25381
25382
25383cat >>confdefs.h <<_ACEOF
25384#define GNULIB_STRERROR 1
25385_ACEOF
25386
25387
25388
25389
25390
25391
25392
25393 GNULIB_STRERROR=1
25394
25395
25396
25397
25398
25399$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
25400
25401
25402
25403
25404
25405 if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
25406
25407
25408
25409
25410
25411
25412
25413
25414 gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext"
25415
25416
25417
25418
25419
25420 if test $ac_cv_header_sys_socket_h != yes; then
25421 for ac_header in winsock2.h
25422do :
25423 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
d0ac1c44 25424if test "x$ac_cv_header_winsock2_h" = xyes; then :
6ec2e0f5
SDJ
25425 cat >>confdefs.h <<_ACEOF
25426#define HAVE_WINSOCK2_H 1
25427_ACEOF
25428
25429fi
25430
25431done
25432
25433 fi
25434 if test "$ac_cv_header_winsock2_h" = yes; then
25435 HAVE_WINSOCK2_H=1
25436 UNISTD_H_HAVE_WINSOCK2_H=1
25437 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
25438 else
25439 HAVE_WINSOCK2_H=0
25440 fi
25441
25442
25443 fi
25444
25445
25446
25447
98399780 25448
5abebf3c 25449
5abebf3c 25450
c0c3707f
CB
25451 if test $ac_cv_have_decl_strerror_r = no; then
25452 HAVE_DECL_STRERROR_R=0
25453 fi
5abebf3c
CB
25454
25455 if test $ac_cv_func_strerror_r = yes; then
25456 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
25457 if test $gl_cv_func_strerror_r_posix_signature = yes; then
25458 case "$gl_cv_func_strerror_r_works" in
25459 *no) REPLACE_STRERROR_R=1 ;;
25460 esac
25461 else
25462 REPLACE_STRERROR_R=1
25463 fi
25464 else
25465 REPLACE_STRERROR_R=1
25466 fi
25467 fi
25468
5abebf3c
CB
25469 if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
25470
25471
25472
25473
25474
25475
25476
25477
25478 gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext"
25479
25480
25481
5abebf3c
CB
25482
25483
25484
c0c3707f 25485 fi
5abebf3c
CB
25486
25487
25488
25489
5abebf3c 25490
c0c3707f 25491 GNULIB_STRERROR_R=1
5abebf3c
CB
25492
25493
25494
25495
5abebf3c 25496
c0c3707f 25497$as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
5abebf3c
CB
25498
25499
25500
25501
5abebf3c 25502
c0c3707f
CB
25503cat >>confdefs.h <<_ACEOF
25504#define GNULIB_STRERROR_R_POSIX 1
25505_ACEOF
5abebf3c
CB
25506
25507
25508
25509
25510
25511
25512
63ce7108
TT
25513 if test $REPLACE_STRSTR = 0; then
25514 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5
25515$as_echo_n "checking whether strstr works in linear time... " >&6; }
d0ac1c44 25516if ${gl_cv_func_strstr_linear+:} false; then :
63ce7108
TT
25517 $as_echo_n "(cached) " >&6
25518else
25519 if test "$cross_compiling" = yes; then :
25520 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25521/* end confdefs.h. */
25522
25523#include <features.h>
25524#ifdef __GNU_LIBRARY__
25525 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
25526 && !(defined __i386__ || defined __x86_64__) \
25527 && !defined __UCLIBC__
25528 Lucky user
25529 #endif
25530#endif
25531#ifdef __CYGWIN__
25532 #include <cygwin/version.h>
25533 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
25534 Lucky user
25535 #endif
25536#endif
25537
25538_ACEOF
25539if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25540 $EGREP "Lucky user" >/dev/null 2>&1; then :
25541 gl_cv_func_strstr_linear="guessing yes"
c971b7fa 25542else
c0c3707f 25543 gl_cv_func_strstr_linear="$gl_cross_guess_normal"
c971b7fa
PA
25544fi
25545rm -f conftest*
25546
25547
25548else
25549 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25550/* end confdefs.h. */
25551
49e4877c
PA
25552#ifdef __MVS__
25553/* z/OS does not deliver signals while strstr() is running (thanks to
25554 restrictions on its LE runtime), which prevents us from limiting the
25555 running time of this test. */
25556# error "This test does not work properly on z/OS"
25557#endif
c971b7fa 25558#include <signal.h> /* for signal */
63ce7108 25559#include <string.h> /* for strstr */
c971b7fa
PA
25560#include <stdlib.h> /* for malloc */
25561#include <unistd.h> /* for alarm */
49e4877c 25562static void quit (int sig) { _exit (sig + 128); }
c971b7fa
PA
25563
25564int
25565main ()
25566{
25567
25568 int result = 0;
25569 size_t m = 1000000;
63ce7108
TT
25570 char *haystack = (char *) malloc (2 * m + 2);
25571 char *needle = (char *) malloc (m + 2);
c971b7fa 25572 /* Failure to compile this test due to missing alarm is okay,
63ce7108 25573 since all such platforms (mingw) also have quadratic strstr. */
c971b7fa
PA
25574 signal (SIGALRM, quit);
25575 alarm (5);
25576 /* Check for quadratic performance. */
25577 if (haystack && needle)
25578 {
25579 memset (haystack, 'A', 2 * m);
25580 haystack[2 * m] = 'B';
63ce7108 25581 haystack[2 * m + 1] = 0;
c971b7fa
PA
25582 memset (needle, 'A', m);
25583 needle[m] = 'B';
63ce7108
TT
25584 needle[m + 1] = 0;
25585 if (!strstr (haystack, needle))
c971b7fa
PA
25586 result |= 1;
25587 }
c0c3707f
CB
25588 /* Free allocated memory, in case some sanitizer is watching. */
25589 free (haystack);
25590 free (needle);
c971b7fa
PA
25591 return result;
25592
25593 ;
25594 return 0;
25595}
25596_ACEOF
25597if ac_fn_c_try_run "$LINENO"; then :
63ce7108 25598 gl_cv_func_strstr_linear=yes
c971b7fa 25599else
63ce7108 25600 gl_cv_func_strstr_linear=no
c971b7fa
PA
25601fi
25602rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25603 conftest.$ac_objext conftest.beam conftest.$ac_ext
25604fi
25605
25606
25607fi
63ce7108
TT
25608{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5
25609$as_echo "$gl_cv_func_strstr_linear" >&6; }
25610 case "$gl_cv_func_strstr_linear" in
40a73391
JK
25611 *yes) ;;
25612 *)
63ce7108 25613 REPLACE_STRSTR=1
40a73391
JK
25614 ;;
25615 esac
c971b7fa
PA
25616 fi
25617
63ce7108 25618 if test $REPLACE_STRSTR = 1; then
c971b7fa
PA
25619
25620
25621
25622
25623
25624
25625
25626
63ce7108 25627 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
c971b7fa 25628
a512b375 25629 fi
c971b7fa
PA
25630
25631
25632
c0c3707f 25633 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
63ce7108 25634 REPLACE_STRSTR=1
c971b7fa 25635 else
c0c3707f 25636 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
63ce7108 25637$as_echo_n "checking whether strstr works... " >&6; }
d0ac1c44 25638if ${gl_cv_func_strstr_works_always+:} false; then :
c971b7fa
PA
25639 $as_echo_n "(cached) " >&6
25640else
25641 if test "$cross_compiling" = yes; then :
c0c3707f 25642 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
25643/* end confdefs.h. */
25644
25645#ifdef __GNU_LIBRARY__
25646 #include <features.h>
63ce7108 25647 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
c971b7fa
PA
25648 || defined __UCLIBC__
25649 Lucky user
25650 #endif
25651#elif defined __CYGWIN__
25652 #include <cygwin/version.h>
25653 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
25654 Lucky user
25655 #endif
25656#else
25657 Lucky user
25658#endif
25659
25660_ACEOF
25661if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25662 $EGREP "Lucky user" >/dev/null 2>&1; then :
63ce7108 25663 gl_cv_func_strstr_works_always="guessing yes"
c971b7fa 25664else
c0c3707f 25665 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
c971b7fa
PA
25666fi
25667rm -f conftest*
25668
25669
25670else
25671 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25672/* end confdefs.h. */
25673
63ce7108 25674#include <string.h> /* for strstr */
c0c3707f
CB
25675#ifdef __GNU_LIBRARY__
25676 #include <features.h>
25677 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
25678 Unlucky user
25679 #endif
25680#endif
c971b7fa
PA
25681#define P "_EF_BF_BD"
25682#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
25683#define NEEDLE P P P P P
25684
25685int
25686main ()
25687{
63ce7108 25688return !!strstr (HAYSTACK, NEEDLE);
c971b7fa
PA
25689
25690 ;
25691 return 0;
25692}
25693_ACEOF
25694if ac_fn_c_try_run "$LINENO"; then :
63ce7108 25695 gl_cv_func_strstr_works_always=yes
c971b7fa 25696else
63ce7108 25697 gl_cv_func_strstr_works_always=no
c971b7fa
PA
25698fi
25699rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25700 conftest.$ac_objext conftest.beam conftest.$ac_ext
25701fi
25702
25703
25704fi
63ce7108
TT
25705{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
25706$as_echo "$gl_cv_func_strstr_works_always" >&6; }
25707 case "$gl_cv_func_strstr_works_always" in
40a73391
JK
25708 *yes) ;;
25709 *)
63ce7108 25710 REPLACE_STRSTR=1
40a73391
JK
25711 ;;
25712 esac
c971b7fa 25713 fi
8839a007 25714
63ce7108 25715 if test $REPLACE_STRSTR = 1; then
8839a007 25716
8690e634
JK
25717
25718
8690e634
JK
25719
25720
25721
25722
25723
63ce7108 25724 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
8690e634 25725
8690e634
JK
25726 fi
25727
8690e634
JK
25728
25729
8690e634 25730
8690e634 25731
63ce7108 25732 GNULIB_STRSTR=1
8690e634
JK
25733
25734
25735
8690e634
JK
25736
25737
63ce7108 25738$as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
8690e634
JK
25739
25740
25741
25742
25743
25744
25745
421693b0
PA
25746 for ac_func in strtok_r
25747do :
25748 ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r"
d0ac1c44 25749if test "x$ac_cv_func_strtok_r" = xyes; then :
421693b0
PA
25750 cat >>confdefs.h <<_ACEOF
25751#define HAVE_STRTOK_R 1
25752_ACEOF
25753
25754fi
25755done
25756
25757 if test $ac_cv_func_strtok_r = yes; then
25758 HAVE_STRTOK_R=1
25759 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r works" >&5
25760$as_echo_n "checking whether strtok_r works... " >&6; }
d0ac1c44 25761if ${gl_cv_func_strtok_r_works+:} false; then :
421693b0
PA
25762 $as_echo_n "(cached) " >&6
25763else
25764 if test "$cross_compiling" = yes; then :
c0c3707f
CB
25765 case "$host_os" in
25766 # Guess no on glibc systems.
25767 *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;;
25768 # Guess yes on native Windows.
25769 mingw*) gl_cv_func_strtok_r_works="guessing yes" ;;
25770 *) gl_cv_func_strtok_r_works="guessing yes" ;;
421693b0
PA
25771 esac
25772
25773else
25774 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25775/* end confdefs.h. */
25776
25777 #ifndef __OPTIMIZE__
25778 # define __OPTIMIZE__ 1
25779 #endif
25780 #undef __OPTIMIZE_SIZE__
25781 #undef __NO_INLINE__
25782 #include <stdlib.h>
25783 #include <string.h>
25784
25785int
25786main ()
25787{
25788static const char dummy[] = "\177\01a";
25789 char delimiters[] = "xxxxxxxx";
25790 char *save_ptr = (char *) dummy;
25791 strtok_r (delimiters, "x", &save_ptr);
25792 strtok_r (NULL, "x", &save_ptr);
25793 return 0;
25794
25795 ;
25796 return 0;
25797}
25798
25799_ACEOF
25800if ac_fn_c_try_run "$LINENO"; then :
25801 gl_cv_func_strtok_r_works=yes
25802else
25803 gl_cv_func_strtok_r_works=no
25804fi
25805rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25806 conftest.$ac_objext conftest.beam conftest.$ac_ext
25807fi
25808
25809
25810fi
25811{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtok_r_works" >&5
25812$as_echo "$gl_cv_func_strtok_r_works" >&6; }
25813 case "$gl_cv_func_strtok_r_works" in
25814 *no)
25815 UNDEFINE_STRTOK_R=1
25816 ;;
25817 esac
25818 else
25819 HAVE_STRTOK_R=0
25820 fi
25821
25822 if test $ac_cv_have_decl_strtok_r = no; then
25823 HAVE_DECL_STRTOK_R=0
25824 fi
25825
25826 if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then
25827
25828
25829
25830
25831
25832
25833
25834
25835 gl_LIBOBJS="$gl_LIBOBJS strtok_r.$ac_objext"
25836
25837
25838 :
25839
25840 fi
25841
25842
25843
25844
25845
25846 GNULIB_STRTOK_R=1
25847
25848
25849
25850
25851
25852$as_echo "#define GNULIB_TEST_STRTOK_R 1" >>confdefs.h
25853
25854
25855
25856
25857
25858
25859
8690e634
JK
25860
25861
25862
25863
25864
8690e634 25865
09607c9e 25866
725e2999
JB
25867
25868
09607c9e
TT
25869
25870
25871
25872 if test $gl_cv_have_include_next = yes; then
25873 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
25874 else
25875 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
25876$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
d0ac1c44 25877if ${gl_cv_next_sys_stat_h+:} false; then :
09607c9e
TT
25878 $as_echo_n "(cached) " >&6
25879else
25880
25881 if test $ac_cv_header_sys_stat_h = yes; then
25882
25883
4a626d0a
PA
25884
25885
25886 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
09607c9e
TT
25887/* end confdefs.h. */
25888#include <sys/stat.h>
09607c9e 25889_ACEOF
4a626d0a
PA
25890 case "$host_os" in
25891 aix*) gl_absname_cpp="$ac_cpp -C" ;;
25892 *) gl_absname_cpp="$ac_cpp" ;;
25893 esac
25894
25895 case "$host_os" in
25896 mingw*)
25897 gl_dirsep_regex='[/\\]'
25898 ;;
25899 *)
25900 gl_dirsep_regex='\/'
25901 ;;
25902 esac
25903 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
25904 gl_header_literal_regex=`echo 'sys/stat.h' \
25905 | sed -e "$gl_make_literal_regex_sed"`
25906 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
25907 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
25908 s|^/[^/]|//&|
25909 p
25910 q
25911 }'
25912
25913 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
25914 sed -n "$gl_absolute_header_sed"`
25915
25916 gl_header=$gl_cv_absolute_sys_stat_h
25917 gl_cv_next_sys_stat_h='"'$gl_header'"'
09607c9e
TT
25918 else
25919 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
25920 fi
25921
25922
25923fi
25924{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
25925$as_echo "$gl_cv_next_sys_stat_h" >&6; }
25926 fi
25927 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
25928
25929 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
25930 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
25931 gl_next_as_first_directive='<'sys/stat.h'>'
25932 else
25933 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
25934 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
25935 fi
25936 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
25937
25938
25939
25940
25941
25942
25943
25944
c0c3707f
CB
25945 WINDOWS_STAT_TIMESPEC=0
25946
25947
2196f55f 25948
09607c9e
TT
25949
25950
09607c9e 25951
09607c9e 25952
09607c9e
TT
25953
25954 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
25955 #include <sys/stat.h>
25956"
d0ac1c44 25957if test "x$ac_cv_type_nlink_t" = xyes; then :
09607c9e
TT
25958
25959else
25960
c0c3707f 25961$as_echo "#define nlink_t int" >>confdefs.h
09607c9e 25962
c0c3707f 25963fi
09607c9e
TT
25964
25965
25966
25967
25968
25969
25970
25971
25972
25973
725e2999
JB
25974
25975
25976
25977
25978
25979
725e2999
JB
25980
25981
25982
25983
25984
25985
25986
25987
25988 if test $gl_cv_have_include_next = yes; then
25989 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
25990 else
25991 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
25992$as_echo_n "checking absolute name of <sys/uio.h>... " >&6; }
25993if ${gl_cv_next_sys_uio_h+:} false; then :
25994 $as_echo_n "(cached) " >&6
25995else
25996
25997 if test $ac_cv_header_sys_uio_h = yes; then
25998
25999
26000
26001
26002 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26003/* end confdefs.h. */
26004#include <sys/uio.h>
26005_ACEOF
26006 case "$host_os" in
26007 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26008 *) gl_absname_cpp="$ac_cpp" ;;
26009 esac
26010
26011 case "$host_os" in
26012 mingw*)
26013 gl_dirsep_regex='[/\\]'
26014 ;;
26015 *)
26016 gl_dirsep_regex='\/'
26017 ;;
26018 esac
26019 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26020 gl_header_literal_regex=`echo 'sys/uio.h' \
26021 | sed -e "$gl_make_literal_regex_sed"`
26022 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26023 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26024 s|^/[^/]|//&|
26025 p
26026 q
26027 }'
26028
26029 gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26030 sed -n "$gl_absolute_header_sed"`
26031
26032 gl_header=$gl_cv_absolute_sys_uio_h
26033 gl_cv_next_sys_uio_h='"'$gl_header'"'
26034 else
26035 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
26036 fi
26037
26038
26039fi
26040{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
26041$as_echo "$gl_cv_next_sys_uio_h" >&6; }
26042 fi
26043 NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h
26044
26045 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
26046 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
26047 gl_next_as_first_directive='<'sys/uio.h'>'
26048 else
26049 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
26050 gl_next_as_first_directive=$gl_cv_next_sys_uio_h
26051 fi
26052 NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
26053
26054
26055
26056
26057 if test $ac_cv_header_sys_uio_h = yes; then
26058 HAVE_SYS_UIO_H=1
26059 else
26060 HAVE_SYS_UIO_H=0
26061 fi
26062
26063
26064
26065
26066
2d8adcbd
MM
26067 :
26068
26069
26070
26071
09607c9e
TT
26072
26073
26074
8839a007
PA
26075
26076
26077
26078
09607c9e 26079
c0c3707f
CB
26080 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,
26081 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
26082 been included before. */
26083 #if defined __MINGW32__
26084 # include <unistd.h>
26085 #endif
26086 #include <time.h>
09607c9e 26087
f8e27d88
CB
26088"
26089if test "x$ac_cv_have_decl_localtime_r" = xyes; then :
26090 ac_have_decl=1
26091else
26092 ac_have_decl=0
26093fi
26094
26095cat >>confdefs.h <<_ACEOF
26096#define HAVE_DECL_LOCALTIME_R $ac_have_decl
26097_ACEOF
26098
26099 if test $ac_cv_have_decl_localtime_r = no; then
26100 HAVE_DECL_LOCALTIME_R=0
26101 fi
26102
26103
f8e27d88
CB
26104 if test $ac_cv_func_localtime_r = yes; then
26105 HAVE_LOCALTIME_R=1
26106 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
26107$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
26108if ${gl_cv_time_r_posix+:} false; then :
26109 $as_echo_n "(cached) " >&6
26110else
26111 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26112/* end confdefs.h. */
c0c3707f
CB
26113/* mingw's <time.h> provides the functions asctime_r, ctime_r,
26114 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
26115 been included before. */
26116 #if defined __MINGW32__
26117 # include <unistd.h>
26118 #endif
26119 #include <time.h>
26120
f8e27d88
CB
26121int
26122main ()
26123{
26124/* We don't need to append 'restrict's to the argument types,
26125 even though the POSIX signature has the 'restrict's,
26126 since C99 says they can't affect type compatibility. */
26127 struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
26128 if (ptr) return 0;
26129 /* Check the return type is a pointer.
26130 On HP-UX 10 it is 'int'. */
26131 *localtime_r (0, 0);
26132 ;
26133 return 0;
26134}
26135
26136_ACEOF
26137if ac_fn_c_try_compile "$LINENO"; then :
26138 gl_cv_time_r_posix=yes
26139else
26140 gl_cv_time_r_posix=no
26141fi
26142rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26143
26144fi
26145{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
26146$as_echo "$gl_cv_time_r_posix" >&6; }
26147 if test $gl_cv_time_r_posix = yes; then
26148 REPLACE_LOCALTIME_R=0
26149 else
26150 REPLACE_LOCALTIME_R=1
26151 fi
26152 else
26153 HAVE_LOCALTIME_R=0
c0c3707f
CB
26154 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5
26155$as_echo_n "checking whether localtime_r exists as an inline function... " >&6; }
26156if ${gl_cv_func_localtime_r_inline+:} false; then :
26157 $as_echo_n "(cached) " >&6
26158else
26159 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26160/* end confdefs.h. */
26161/* mingw's <time.h> provides the functions asctime_r, ctime_r,
26162 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
26163 been included before. */
26164 #if defined __MINGW32__
26165 # include <unistd.h>
26166 #endif
26167 #include <time.h>
26168
26169int
26170main ()
26171{
26172time_t a;
26173 struct tm r;
26174 localtime_r (&a, &r);
26175
26176 ;
26177 return 0;
26178}
26179
26180_ACEOF
26181if ac_fn_c_try_link "$LINENO"; then :
26182 gl_cv_func_localtime_r_inline=yes
26183else
26184 gl_cv_func_localtime_r_inline=no
26185fi
26186rm -f core conftest.err conftest.$ac_objext \
26187 conftest$ac_exeext conftest.$ac_ext
26188
26189fi
26190{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5
26191$as_echo "$gl_cv_func_localtime_r_inline" >&6; }
26192 if test $gl_cv_func_localtime_r_inline = yes; then
26193 REPLACE_LOCALTIME_R=1
26194 fi
f8e27d88
CB
26195 fi
26196
26197 if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
26198
26199
26200
26201
26202
26203
26204
26205
26206 gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
26207
26208
26209 :
26210
26211 fi
26212
26213
26214
26215
26216
26217 GNULIB_TIME_R=1
26218
26219
26220
26221
26222
26223$as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h
26224
26225
26226
26227
26228
26229
26230
26231
26232
5abebf3c
CB
26233
26234
26235
8839a007
PA
26236
26237
26238
26239 if test $gl_cv_have_include_next = yes; then
26240 gl_cv_next_unistd_h='<'unistd.h'>'
26241 else
26242 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
26243$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
d0ac1c44 26244if ${gl_cv_next_unistd_h+:} false; then :
8839a007
PA
26245 $as_echo_n "(cached) " >&6
26246else
26247
26248 if test $ac_cv_header_unistd_h = yes; then
26249
26250
4a626d0a
PA
26251
26252
26253 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8839a007
PA
26254/* end confdefs.h. */
26255#include <unistd.h>
8839a007 26256_ACEOF
4a626d0a
PA
26257 case "$host_os" in
26258 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26259 *) gl_absname_cpp="$ac_cpp" ;;
26260 esac
26261
26262 case "$host_os" in
26263 mingw*)
26264 gl_dirsep_regex='[/\\]'
26265 ;;
26266 *)
26267 gl_dirsep_regex='\/'
26268 ;;
26269 esac
26270 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26271 gl_header_literal_regex=`echo 'unistd.h' \
26272 | sed -e "$gl_make_literal_regex_sed"`
26273 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26274 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26275 s|^/[^/]|//&|
26276 p
26277 q
26278 }'
26279
26280 gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26281 sed -n "$gl_absolute_header_sed"`
26282
26283 gl_header=$gl_cv_absolute_unistd_h
26284 gl_cv_next_unistd_h='"'$gl_header'"'
8839a007
PA
26285 else
26286 gl_cv_next_unistd_h='<'unistd.h'>'
26287 fi
26288
26289
26290fi
26291{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
26292$as_echo "$gl_cv_next_unistd_h" >&6; }
26293 fi
26294 NEXT_UNISTD_H=$gl_cv_next_unistd_h
26295
26296 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
26297 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
26298 gl_next_as_first_directive='<'unistd.h'>'
26299 else
26300 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
26301 gl_next_as_first_directive=$gl_cv_next_unistd_h
26302 fi
26303 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
26304
26305
26306
26307
26308 if test $ac_cv_header_unistd_h = yes; then
26309 HAVE_UNISTD_H=1
26310 else
26311 HAVE_UNISTD_H=0
26312 fi
26313
26314
26315
26316
26317
26318
26319
472fa5ee
SM
26320
26321
26322
26323
26324
8839a007 26325
6ec2e0f5
SDJ
26326
26327
26328
3d99e817
AK
26329 if test $ac_cv_have_decl_unsetenv = no; then
26330 HAVE_DECL_UNSETENV=0
26331 fi
26332 for ac_func in unsetenv
26333do :
26334 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
d0ac1c44 26335if test "x$ac_cv_func_unsetenv" = xyes; then :
3d99e817
AK
26336 cat >>confdefs.h <<_ACEOF
26337#define HAVE_UNSETENV 1
26338_ACEOF
26339
26340fi
26341done
26342
26343 if test $ac_cv_func_unsetenv = no; then
26344 HAVE_UNSETENV=0
26345 else
26346 HAVE_UNSETENV=1
26347 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
26348$as_echo_n "checking for unsetenv() return type... " >&6; }
d0ac1c44 26349if ${gt_cv_func_unsetenv_ret+:} false; then :
3d99e817
AK
26350 $as_echo_n "(cached) " >&6
26351else
26352 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26353/* end confdefs.h. */
26354
26355#undef _BSD
26356#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
26357#include <stdlib.h>
26358extern
26359#ifdef __cplusplus
26360"C"
26361#endif
26362int unsetenv (const char *name);
26363
26364int
26365main ()
26366{
26367
26368 ;
26369 return 0;
26370}
26371_ACEOF
26372if ac_fn_c_try_compile "$LINENO"; then :
26373 gt_cv_func_unsetenv_ret='int'
26374else
26375 gt_cv_func_unsetenv_ret='void'
26376fi
26377rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26378fi
26379{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
26380$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
26381 if test $gt_cv_func_unsetenv_ret = 'void'; then
26382
26383$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
26384
26385 REPLACE_UNSETENV=1
26386 fi
26387
26388 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
26389$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
d0ac1c44 26390if ${gl_cv_func_unsetenv_works+:} false; then :
3d99e817
AK
26391 $as_echo_n "(cached) " >&6
26392else
26393 if test "$cross_compiling" = yes; then :
26394 case "$host_os" in
26395 # Guess yes on glibc systems.
26396 *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
c0c3707f
CB
26397 # If we don't know, obey --enable-cross-guesses.
26398 *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
26399 esac
26400
26401else
26402 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26403/* end confdefs.h. */
26404
26405 #include <stdlib.h>
26406 #include <errno.h>
26407 extern char **environ;
26408
26409int
26410main ()
26411{
26412
26413 char entry1[] = "a=1";
26414 char entry2[] = "b=2";
26415 char *env[] = { entry1, entry2, NULL };
26416 if (putenv ((char *) "a=1")) return 1;
26417 if (putenv (entry2)) return 2;
26418 entry2[0] = 'a';
26419 unsetenv ("a");
26420 if (getenv ("a")) return 3;
26421 if (!unsetenv ("") || errno != EINVAL) return 4;
26422 entry2[0] = 'b';
26423 environ = env;
26424 if (!getenv ("a")) return 5;
26425 entry2[0] = 'a';
26426 unsetenv ("a");
26427 if (getenv ("a")) return 6;
26428
26429 ;
26430 return 0;
26431}
26432_ACEOF
26433if ac_fn_c_try_run "$LINENO"; then :
26434 gl_cv_func_unsetenv_works=yes
26435else
26436 gl_cv_func_unsetenv_works=no
26437fi
26438rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26439 conftest.$ac_objext conftest.beam conftest.$ac_ext
26440fi
26441
26442fi
26443{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
26444$as_echo "$gl_cv_func_unsetenv_works" >&6; }
26445 case "$gl_cv_func_unsetenv_works" in
26446 *yes) ;;
26447 *)
26448 REPLACE_UNSETENV=1
26449 ;;
26450 esac
26451 fi
26452
26453 if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
26454
26455
26456
26457
26458
26459
26460
26461
26462 gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext"
26463
26464
26465
26466
26467
26468 fi
26469
26470
26471
26472
26473
26474 GNULIB_UNSETENV=1
26475
26476
26477
26478
26479
26480$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
26481
26482
26483
26484
26485
26486
8839a007
PA
26487
26488
26489
26490
26491
26492
26493
8690e634
JK
26494
26495
26496 if test $gl_cv_have_include_next = yes; then
26497 gl_cv_next_wchar_h='<'wchar.h'>'
26498 else
26499 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
26500$as_echo_n "checking absolute name of <wchar.h>... " >&6; }
d0ac1c44 26501if ${gl_cv_next_wchar_h+:} false; then :
8690e634
JK
26502 $as_echo_n "(cached) " >&6
26503else
26504
26505 if test $ac_cv_header_wchar_h = yes; then
26506
26507
4a626d0a
PA
26508
26509
26510 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
26511/* end confdefs.h. */
26512#include <wchar.h>
8690e634 26513_ACEOF
4a626d0a
PA
26514 case "$host_os" in
26515 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26516 *) gl_absname_cpp="$ac_cpp" ;;
26517 esac
26518
26519 case "$host_os" in
26520 mingw*)
26521 gl_dirsep_regex='[/\\]'
26522 ;;
26523 *)
26524 gl_dirsep_regex='\/'
26525 ;;
26526 esac
26527 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26528 gl_header_literal_regex=`echo 'wchar.h' \
26529 | sed -e "$gl_make_literal_regex_sed"`
26530 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26531 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26532 s|^/[^/]|//&|
26533 p
26534 q
26535 }'
26536
26537 gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26538 sed -n "$gl_absolute_header_sed"`
26539
26540 gl_header=$gl_cv_absolute_wchar_h
26541 gl_cv_next_wchar_h='"'$gl_header'"'
8690e634
JK
26542 else
26543 gl_cv_next_wchar_h='<'wchar.h'>'
26544 fi
26545
26546
26547fi
26548{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
26549$as_echo "$gl_cv_next_wchar_h" >&6; }
26550 fi
26551 NEXT_WCHAR_H=$gl_cv_next_wchar_h
26552
26553 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
26554 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
26555 gl_next_as_first_directive='<'wchar.h'>'
26556 else
26557 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
26558 gl_next_as_first_directive=$gl_cv_next_wchar_h
26559 fi
26560 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
26561
26562
26563
26564
26565 if test $ac_cv_header_wchar_h = yes; then
26566 HAVE_WCHAR_H=1
26567 else
26568 HAVE_WCHAR_H=0
26569 fi
26570
c971b7fa
PA
26571
26572
26573
26574
8690e634
JK
26575 if test $gt_cv_c_wint_t = yes; then
26576 HAVE_WINT_T=1
26577 else
26578 HAVE_WINT_T=0
26579 fi
c971b7fa
PA
26580
26581
26582
8690e634
JK
26583
26584
26585
26586
26587
472fa5ee
SM
26588
26589
26590
26591
26592
8690e634
JK
26593 if test $ac_cv_func_iswcntrl = yes; then
26594 HAVE_ISWCNTRL=1
26595 else
26596 HAVE_ISWCNTRL=0
26597 fi
26598
26599
26600
8690e634
JK
26601 if test $gt_cv_c_wint_t = yes; then
26602 HAVE_WINT_T=1
26603 else
26604 HAVE_WINT_T=0
26605 fi
26606
26607
26608
26609
26610
26611
c971b7fa 26612
8690e634 26613
472fa5ee
SM
26614
26615
c971b7fa
PA
26616
26617
26618
26619 if test $gl_cv_have_include_next = yes; then
8690e634 26620 gl_cv_next_wctype_h='<'wctype.h'>'
c971b7fa 26621 else
8690e634
JK
26622 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
26623$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
d0ac1c44 26624if ${gl_cv_next_wctype_h+:} false; then :
c971b7fa
PA
26625 $as_echo_n "(cached) " >&6
26626else
26627
8690e634
JK
26628 if test $ac_cv_header_wctype_h = yes; then
26629
26630
4a626d0a
PA
26631
26632
26633 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 26634/* end confdefs.h. */
8690e634 26635#include <wctype.h>
c971b7fa 26636_ACEOF
4a626d0a
PA
26637 case "$host_os" in
26638 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26639 *) gl_absname_cpp="$ac_cpp" ;;
26640 esac
26641
26642 case "$host_os" in
26643 mingw*)
26644 gl_dirsep_regex='[/\\]'
26645 ;;
26646 *)
26647 gl_dirsep_regex='\/'
26648 ;;
26649 esac
26650 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26651 gl_header_literal_regex=`echo 'wctype.h' \
26652 | sed -e "$gl_make_literal_regex_sed"`
26653 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26654 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26655 s|^/[^/]|//&|
26656 p
26657 q
26658 }'
26659
26660 gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26661 sed -n "$gl_absolute_header_sed"`
26662
26663 gl_header=$gl_cv_absolute_wctype_h
26664 gl_cv_next_wctype_h='"'$gl_header'"'
8690e634
JK
26665 else
26666 gl_cv_next_wctype_h='<'wctype.h'>'
26667 fi
c971b7fa
PA
26668
26669
26670fi
8690e634
JK
26671{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
26672$as_echo "$gl_cv_next_wctype_h" >&6; }
c971b7fa 26673 fi
8690e634 26674 NEXT_WCTYPE_H=$gl_cv_next_wctype_h
c971b7fa
PA
26675
26676 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
26677 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8690e634 26678 gl_next_as_first_directive='<'wctype.h'>'
c971b7fa
PA
26679 else
26680 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8690e634 26681 gl_next_as_first_directive=$gl_cv_next_wctype_h
c971b7fa 26682 fi
8690e634
JK
26683 NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
26684
26685
26686
26687
26688 if test $ac_cv_header_wctype_h = yes; then
26689 if test $ac_cv_func_iswcntrl = yes; then
26690 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
26691$as_echo_n "checking whether iswcntrl works... " >&6; }
d0ac1c44 26692if ${gl_cv_func_iswcntrl_works+:} false; then :
8690e634
JK
26693 $as_echo_n "(cached) " >&6
26694else
26695
26696 if test "$cross_compiling" = yes; then :
c0c3707f 26697 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
26698/* end confdefs.h. */
26699#include <stdlib.h>
26700 #if __GNU_LIBRARY__ == 1
26701 Linux libc5 i18n is broken.
26702 #endif
26703int
26704main ()
26705{
26706
26707 ;
26708 return 0;
26709}
26710_ACEOF
26711if ac_fn_c_try_compile "$LINENO"; then :
26712 gl_cv_func_iswcntrl_works="guessing yes"
26713else
26714 gl_cv_func_iswcntrl_works="guessing no"
26715fi
26716rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26717
26718else
26719 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26720/* end confdefs.h. */
26721
26722 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
26723 included before <wchar.h>.
26724 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
26725 must be included before <wchar.h>. */
26726 #include <stddef.h>
26727 #include <stdio.h>
26728 #include <time.h>
26729 #include <wchar.h>
26730 #include <wctype.h>
26731 int main () { return iswprint ('x') == 0; }
26732
26733_ACEOF
26734if ac_fn_c_try_run "$LINENO"; then :
26735 gl_cv_func_iswcntrl_works=yes
26736else
26737 gl_cv_func_iswcntrl_works=no
26738fi
26739rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26740 conftest.$ac_objext conftest.beam conftest.$ac_ext
26741fi
26742
26743
26744fi
26745{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
26746$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
26747 fi
26748 HAVE_WCTYPE_H=1
26749 else
26750 HAVE_WCTYPE_H=0
26751 fi
26752
26753
c0c3707f
CB
26754 if test $GNULIB_OVERRIDES_WINT_T = 1; then
26755 REPLACE_ISWCNTRL=1
26756 else
26757 case "$gl_cv_func_iswcntrl_works" in
26758 *yes) REPLACE_ISWCNTRL=0 ;;
26759 *) REPLACE_ISWCNTRL=1 ;;
26760 esac
26761 fi
8690e634
JK
26762
26763
26764 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
26765 :
26766 fi
26767
26768 if test $REPLACE_ISWCNTRL = 1; then
26769 REPLACE_TOWLOWER=1
26770 else
26771 for ac_func in towlower
26772do :
26773 ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
d0ac1c44 26774if test "x$ac_cv_func_towlower" = xyes; then :
8690e634
JK
26775 cat >>confdefs.h <<_ACEOF
26776#define HAVE_TOWLOWER 1
26777_ACEOF
26778
26779fi
26780done
26781
26782 if test $ac_cv_func_towlower = yes; then
26783 REPLACE_TOWLOWER=0
26784 else
26785 ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
26786 included before <wchar.h>.
26787 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
26788 must be included before <wchar.h>. */
26789 #include <stddef.h>
26790 #include <stdio.h>
26791 #include <time.h>
26792 #include <wchar.h>
26793 #if HAVE_WCTYPE_H
26794 # include <wctype.h>
26795 #endif
26796
26797"
d0ac1c44 26798if test "x$ac_cv_have_decl_towlower" = xyes; then :
8690e634
JK
26799 ac_have_decl=1
26800else
26801 ac_have_decl=0
26802fi
26803
26804cat >>confdefs.h <<_ACEOF
26805#define HAVE_DECL_TOWLOWER $ac_have_decl
26806_ACEOF
26807
26808 if test $ac_cv_have_decl_towlower = yes; then
26809 REPLACE_TOWLOWER=1
26810 else
26811 REPLACE_TOWLOWER=0
26812 fi
26813 fi
26814 fi
26815
26816
26817 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
26818 :
26819 fi
26820
26821 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
26822$as_echo_n "checking for wctype_t... " >&6; }
d0ac1c44 26823if ${gl_cv_type_wctype_t+:} false; then :
8690e634
JK
26824 $as_echo_n "(cached) " >&6
26825else
26826 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26827/* end confdefs.h. */
26828/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
26829 included before <wchar.h>.
26830 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
26831 must be included before <wchar.h>. */
26832 #include <stddef.h>
26833 #include <stdio.h>
26834 #include <time.h>
26835 #include <wchar.h>
26836 #if HAVE_WCTYPE_H
26837 # include <wctype.h>
26838 #endif
26839 wctype_t a;
26840
26841int
26842main ()
26843{
26844
26845 ;
26846 return 0;
26847}
26848_ACEOF
26849if ac_fn_c_try_compile "$LINENO"; then :
26850 gl_cv_type_wctype_t=yes
26851else
26852 gl_cv_type_wctype_t=no
26853fi
26854rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 26855
8690e634
JK
26856fi
26857{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
26858$as_echo "$gl_cv_type_wctype_t" >&6; }
26859 if test $gl_cv_type_wctype_t = no; then
26860 HAVE_WCTYPE_T=0
26861 fi
26862
26863 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
26864$as_echo_n "checking for wctrans_t... " >&6; }
d0ac1c44 26865if ${gl_cv_type_wctrans_t+:} false; then :
8690e634
JK
26866 $as_echo_n "(cached) " >&6
26867else
26868 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26869/* end confdefs.h. */
26870/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
26871 included before <wchar.h>.
26872 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
26873 must be included before <wchar.h>. */
26874 #include <stddef.h>
26875 #include <stdio.h>
26876 #include <time.h>
26877 #include <wchar.h>
26878 #include <wctype.h>
26879 wctrans_t a;
c971b7fa 26880
8690e634
JK
26881int
26882main ()
26883{
c971b7fa 26884
8690e634
JK
26885 ;
26886 return 0;
26887}
26888_ACEOF
26889if ac_fn_c_try_compile "$LINENO"; then :
26890 gl_cv_type_wctrans_t=yes
26891else
26892 gl_cv_type_wctrans_t=no
26893fi
26894rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 26895
8690e634
JK
26896fi
26897{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
26898$as_echo "$gl_cv_type_wctrans_t" >&6; }
26899 if test $gl_cv_type_wctrans_t = no; then
26900 HAVE_WCTRANS_T=0
c971b7fa
PA
26901 fi
26902
26903
5e8754f9 26904
5e8754f9 26905
c971b7fa 26906
c0c3707f
CB
26907
26908 case "$host_os" in
26909 mingw*)
26910
26911
26912
26913
26914
26915
26916
26917
26918 gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext"
26919
26920 ;;
26921 esac
26922
26923 case "$host_os" in
26924 mingw*)
26925
26926
26927
26928
26929
26930
26931
26932
26933 gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext"
26934
26935 ;;
26936 esac
26937
26938 case "$host_os" in
26939 mingw*)
26940
26941
c971b7fa
PA
26942
26943
c0c3707f
CB
26944
26945
26946
26947
26948 gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext"
26949
26950 ;;
26951 esac
26952
26953 case "$host_os" in
26954 mingw*)
26955
26956
26957
26958
26959
26960
26961
26962
26963 gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext"
26964
26965 ;;
26966 esac
c971b7fa
PA
26967 # End of code from modules
26968
26969
26970
26971
26972
26973
26974
26975
26976
26977 gltests_libdeps=
26978 gltests_ltlibdeps=
26979
26980
26981
26982
26983
26984
26985
26986
26987
26988 gl_source_base='tests'
26989 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
26990
26991 gl_module_indicator_condition=$gltests_WITNESS
26992
26993
26994
26995
26996
26997
26998
26999
27000
27001 LIBGNU_LIBDEPS="$gl_libdeps"
27002
27003 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
27004
27005
27006
d0ac1c44 27007am__api_version='1.15'
c971b7fa
PA
27008
27009# Find a good install program. We prefer a C program (faster),
27010# so one script is as good as another. But avoid the broken or
27011# incompatible versions:
27012# SysV /etc/install, /usr/sbin/install
27013# SunOS /usr/etc/install
27014# IRIX /sbin/install
27015# AIX /bin/install
27016# AmigaOS /C/install, which installs bootblocks on floppy discs
27017# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
27018# AFS /usr/afsws/bin/install, which mishandles nonexistent args
27019# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
27020# OS/2's system install, which has a completely different semantic
27021# ./install, which can be erroneously created by make from ./install.sh.
27022# Reject install programs that cannot install multiple files.
27023{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
27024$as_echo_n "checking for a BSD-compatible install... " >&6; }
27025if test -z "$INSTALL"; then
d0ac1c44 27026if ${ac_cv_path_install+:} false; then :
c971b7fa
PA
27027 $as_echo_n "(cached) " >&6
27028else
27029 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27030for as_dir in $PATH
27031do
27032 IFS=$as_save_IFS
27033 test -z "$as_dir" && as_dir=.
27034 # Account for people who put trailing slashes in PATH elements.
27035case $as_dir/ in #((
27036 ./ | .// | /[cC]/* | \
27037 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
27038 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
27039 /usr/ucb/* ) ;;
27040 *)
27041 # OSF1 and SCO ODT 3.0 have their own names for install.
27042 # Don't use installbsd from OSF since it installs stuff as root
27043 # by default.
27044 for ac_prog in ginstall scoinst install; do
27045 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27046 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
c971b7fa
PA
27047 if test $ac_prog = install &&
27048 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
27049 # AIX install. It has an incompatible calling convention.
27050 :
27051 elif test $ac_prog = install &&
27052 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
27053 # program-specific install script used by HP pwplus--don't use.
27054 :
27055 else
27056 rm -rf conftest.one conftest.two conftest.dir
27057 echo one > conftest.one
27058 echo two > conftest.two
27059 mkdir conftest.dir
27060 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
27061 test -s conftest.one && test -s conftest.two &&
27062 test -s conftest.dir/conftest.one &&
27063 test -s conftest.dir/conftest.two
27064 then
27065 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
27066 break 3
27067 fi
27068 fi
27069 fi
27070 done
27071 done
27072 ;;
27073esac
27074
27075 done
27076IFS=$as_save_IFS
27077
27078rm -rf conftest.one conftest.two conftest.dir
27079
27080fi
27081 if test "${ac_cv_path_install+set}" = set; then
27082 INSTALL=$ac_cv_path_install
27083 else
27084 # As a last resort, use the slow shell script. Don't cache a
27085 # value for INSTALL within a source directory, because that will
27086 # break other packages using the cache if that directory is
27087 # removed, or if the value is a relative name.
27088 INSTALL=$ac_install_sh
27089 fi
27090fi
27091{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
27092$as_echo "$INSTALL" >&6; }
27093
27094# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
27095# It thinks the first close brace ends the variable substitution.
27096test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
27097
27098test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
27099
27100test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
27101
27102{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
27103$as_echo_n "checking whether build environment is sane... " >&6; }
c971b7fa
PA
27104# Reject unsafe characters in $srcdir or the absolute working directory
27105# name. Accept space and tab only in the latter.
27106am_lf='
27107'
27108case `pwd` in
27109 *[\\\"\#\$\&\'\`$am_lf]*)
d0ac1c44 27110 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
c971b7fa
PA
27111esac
27112case $srcdir in
27113 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
d0ac1c44 27114 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
c971b7fa
PA
27115esac
27116
d0ac1c44 27117# Do 'set' in a subshell so we don't clobber the current shell's
c971b7fa
PA
27118# arguments. Must try -L first in case configure is actually a
27119# symlink; some systems play weird games with the mod time of symlinks
27120# (eg FreeBSD returns the mod time of the symlink's containing
27121# directory).
27122if (
d0ac1c44
SM
27123 am_has_slept=no
27124 for am_try in 1 2; do
27125 echo "timestamp, slept: $am_has_slept" > conftest.file
27126 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
27127 if test "$*" = "X"; then
27128 # -L didn't work.
27129 set X `ls -t "$srcdir/configure" conftest.file`
27130 fi
27131 if test "$*" != "X $srcdir/configure conftest.file" \
27132 && test "$*" != "X conftest.file $srcdir/configure"; then
27133
27134 # If neither matched, then we have a broken ls. This can happen
27135 # if, for instance, CONFIG_SHELL is bash and it inherits a
27136 # broken ls alias from the environment. This has actually
27137 # happened. Such a system could not be considered "sane".
27138 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
27139 alias in your environment" "$LINENO" 5
27140 fi
27141 if test "$2" = conftest.file || test $am_try -eq 2; then
27142 break
27143 fi
27144 # Just in case.
27145 sleep 1
27146 am_has_slept=yes
27147 done
c971b7fa
PA
27148 test "$2" = conftest.file
27149 )
27150then
27151 # Ok.
27152 :
27153else
d0ac1c44 27154 as_fn_error $? "newly created file is older than distributed files!
c971b7fa
PA
27155Check your system clock" "$LINENO" 5
27156fi
27157{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
27158$as_echo "yes" >&6; }
d0ac1c44
SM
27159# If we didn't sleep, we still need to ensure time stamps of config.status and
27160# generated files are strictly newer.
27161am_sleep_pid=
27162if grep 'slept: no' conftest.file >/dev/null 2>&1; then
27163 ( sleep 1 ) &
27164 am_sleep_pid=$!
27165fi
27166
27167rm -f conftest.file
27168
c971b7fa
PA
27169test "$program_prefix" != NONE &&
27170 program_transform_name="s&^&$program_prefix&;$program_transform_name"
27171# Use a double $ so make ignores it.
27172test "$program_suffix" != NONE &&
27173 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
27174# Double any \ or $.
27175# By default was `s,x,x', remove it if useless.
27176ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
27177program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
27178
c0c3707f
CB
27179# Expand $ac_aux_dir to an absolute path.
27180am_aux_dir=`cd "$ac_aux_dir" && pwd`
27181
c971b7fa
PA
27182if test x"${MISSING+set}" != xset; then
27183 case $am_aux_dir in
27184 *\ * | *\ *)
27185 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
27186 *)
27187 MISSING="\${SHELL} $am_aux_dir/missing" ;;
27188 esac
27189fi
27190# Use eval to expand $SHELL
d0ac1c44
SM
27191if eval "$MISSING --is-lightweight"; then
27192 am_missing_run="$MISSING "
c971b7fa
PA
27193else
27194 am_missing_run=
d0ac1c44
SM
27195 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
27196$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
c971b7fa
PA
27197fi
27198
d0ac1c44 27199if test x"${install_sh+set}" != xset; then
c971b7fa
PA
27200 case $am_aux_dir in
27201 *\ * | *\ *)
27202 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
27203 *)
27204 install_sh="\${SHELL} $am_aux_dir/install-sh"
27205 esac
27206fi
27207
d0ac1c44
SM
27208# Installed binaries are usually stripped using 'strip' when the user
27209# run "make install-strip". However 'strip' might not be the right
c971b7fa 27210# tool to use in cross-compilation environments, therefore Automake
d0ac1c44 27211# will honor the 'STRIP' environment variable to overrule this program.
c971b7fa
PA
27212if test "$cross_compiling" != no; then
27213 if test -n "$ac_tool_prefix"; then
27214 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
27215set dummy ${ac_tool_prefix}strip; ac_word=$2
27216{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27217$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27218if ${ac_cv_prog_STRIP+:} false; then :
c971b7fa
PA
27219 $as_echo_n "(cached) " >&6
27220else
27221 if test -n "$STRIP"; then
27222 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
27223else
27224as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27225for as_dir in $PATH
27226do
27227 IFS=$as_save_IFS
27228 test -z "$as_dir" && as_dir=.
27229 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27230 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27231 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
27232 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27233 break 2
27234 fi
27235done
27236 done
27237IFS=$as_save_IFS
27238
27239fi
27240fi
27241STRIP=$ac_cv_prog_STRIP
27242if test -n "$STRIP"; then
27243 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
27244$as_echo "$STRIP" >&6; }
27245else
27246 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27247$as_echo "no" >&6; }
27248fi
27249
27250
27251fi
27252if test -z "$ac_cv_prog_STRIP"; then
27253 ac_ct_STRIP=$STRIP
27254 # Extract the first word of "strip", so it can be a program name with args.
27255set dummy strip; ac_word=$2
27256{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27257$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27258if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
c971b7fa
PA
27259 $as_echo_n "(cached) " >&6
27260else
27261 if test -n "$ac_ct_STRIP"; then
27262 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
27263else
27264as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27265for as_dir in $PATH
27266do
27267 IFS=$as_save_IFS
27268 test -z "$as_dir" && as_dir=.
27269 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27270 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27271 ac_cv_prog_ac_ct_STRIP="strip"
27272 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27273 break 2
27274 fi
27275done
27276 done
27277IFS=$as_save_IFS
27278
27279fi
27280fi
27281ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
27282if test -n "$ac_ct_STRIP"; then
27283 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
27284$as_echo "$ac_ct_STRIP" >&6; }
27285else
27286 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27287$as_echo "no" >&6; }
27288fi
27289
27290 if test "x$ac_ct_STRIP" = x; then
27291 STRIP=":"
27292 else
27293 case $cross_compiling:$ac_tool_warned in
27294yes:)
27295{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
27296$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
27297ac_tool_warned=yes ;;
27298esac
27299 STRIP=$ac_ct_STRIP
27300 fi
27301else
27302 STRIP="$ac_cv_prog_STRIP"
27303fi
27304
27305fi
27306INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
27307
c971b7fa
PA
27308for ac_prog in gawk mawk nawk awk
27309do
27310 # Extract the first word of "$ac_prog", so it can be a program name with args.
27311set dummy $ac_prog; ac_word=$2
27312{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27313$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27314if ${ac_cv_prog_AWK+:} false; then :
c971b7fa
PA
27315 $as_echo_n "(cached) " >&6
27316else
27317 if test -n "$AWK"; then
27318 ac_cv_prog_AWK="$AWK" # Let the user override the test.
27319else
27320as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27321for as_dir in $PATH
27322do
27323 IFS=$as_save_IFS
27324 test -z "$as_dir" && as_dir=.
27325 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27326 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27327 ac_cv_prog_AWK="$ac_prog"
27328 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27329 break 2
27330 fi
27331done
27332 done
27333IFS=$as_save_IFS
27334
27335fi
27336fi
27337AWK=$ac_cv_prog_AWK
27338if test -n "$AWK"; then
27339 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
27340$as_echo "$AWK" >&6; }
27341else
27342 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27343$as_echo "no" >&6; }
27344fi
27345
27346
27347 test -n "$AWK" && break
27348done
27349
27350{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
27351$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
27352set x ${MAKE-make}
27353ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
d0ac1c44 27354if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
c971b7fa
PA
27355 $as_echo_n "(cached) " >&6
27356else
27357 cat >conftest.make <<\_ACEOF
27358SHELL = /bin/sh
27359all:
27360 @echo '@@@%%%=$(MAKE)=@@@%%%'
27361_ACEOF
d0ac1c44 27362# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
c971b7fa
PA
27363case `${MAKE-make} -f conftest.make 2>/dev/null` in
27364 *@@@%%%=?*=@@@%%%*)
27365 eval ac_cv_prog_make_${ac_make}_set=yes;;
27366 *)
27367 eval ac_cv_prog_make_${ac_make}_set=no;;
27368esac
27369rm -f conftest.make
27370fi
27371if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
27372 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
27373$as_echo "yes" >&6; }
27374 SET_MAKE=
27375else
27376 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27377$as_echo "no" >&6; }
27378 SET_MAKE="MAKE=${MAKE-make}"
27379fi
27380
27381rm -rf .tst 2>/dev/null
27382mkdir .tst 2>/dev/null
27383if test -d .tst; then
27384 am__leading_dot=.
27385else
27386 am__leading_dot=_
27387fi
27388rmdir .tst 2>/dev/null
27389
27390DEPDIR="${am__leading_dot}deps"
27391
27392ac_config_commands="$ac_config_commands depfiles"
27393
27394
27395am_make=${MAKE-make}
27396cat > confinc << 'END'
27397am__doit:
27398 @echo this is the am__doit target
27399.PHONY: am__doit
27400END
27401# If we don't find an include directive, just comment out the code.
27402{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
27403$as_echo_n "checking for style of include used by $am_make... " >&6; }
27404am__include="#"
27405am__quote=
27406_am_result=none
27407# First try GNU make style include.
27408echo "include confinc" > confmf
d0ac1c44 27409# Ignore all kinds of additional output from 'make'.
c971b7fa
PA
27410case `$am_make -s -f confmf 2> /dev/null` in #(
27411*the\ am__doit\ target*)
27412 am__include=include
27413 am__quote=
27414 _am_result=GNU
27415 ;;
27416esac
27417# Now try BSD make style include.
27418if test "$am__include" = "#"; then
27419 echo '.include "confinc"' > confmf
27420 case `$am_make -s -f confmf 2> /dev/null` in #(
27421 *the\ am__doit\ target*)
27422 am__include=.include
27423 am__quote="\""
27424 _am_result=BSD
27425 ;;
27426 esac
27427fi
27428
27429
27430{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
27431$as_echo "$_am_result" >&6; }
27432rm -f confinc confmf
27433
27434# Check whether --enable-dependency-tracking was given.
27435if test "${enable_dependency_tracking+set}" = set; then :
27436 enableval=$enable_dependency_tracking;
27437fi
27438
27439if test "x$enable_dependency_tracking" != xno; then
27440 am_depcomp="$ac_aux_dir/depcomp"
27441 AMDEPBACKSLASH='\'
d0ac1c44 27442 am__nodep='_no'
c971b7fa
PA
27443fi
27444 if test "x$enable_dependency_tracking" != xno; then
27445 AMDEP_TRUE=
27446 AMDEP_FALSE='#'
27447else
27448 AMDEP_TRUE='#'
27449 AMDEP_FALSE=
27450fi
27451
27452
d0ac1c44
SM
27453# Check whether --enable-silent-rules was given.
27454if test "${enable_silent_rules+set}" = set; then :
27455 enableval=$enable_silent_rules;
27456fi
27457
27458case $enable_silent_rules in # (((
27459 yes) AM_DEFAULT_VERBOSITY=0;;
27460 no) AM_DEFAULT_VERBOSITY=1;;
27461 *) AM_DEFAULT_VERBOSITY=1;;
27462esac
27463am_make=${MAKE-make}
27464{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
27465$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
27466if ${am_cv_make_support_nested_variables+:} false; then :
27467 $as_echo_n "(cached) " >&6
27468else
27469 if $as_echo 'TRUE=$(BAR$(V))
27470BAR0=false
27471BAR1=true
27472V=1
27473am__doit:
27474 @$(TRUE)
27475.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
27476 am_cv_make_support_nested_variables=yes
27477else
27478 am_cv_make_support_nested_variables=no
27479fi
27480fi
27481{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
27482$as_echo "$am_cv_make_support_nested_variables" >&6; }
27483if test $am_cv_make_support_nested_variables = yes; then
27484 AM_V='$(V)'
27485 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
27486else
27487 AM_V=$AM_DEFAULT_VERBOSITY
27488 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
27489fi
27490AM_BACKSLASH='\'
27491
c971b7fa
PA
27492if test "`cd $srcdir && pwd`" != "`pwd`"; then
27493 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
27494 # is not polluted with repeated "-I."
27495 am__isrc=' -I$(srcdir)'
27496 # test to see if srcdir already configured
27497 if test -f $srcdir/config.status; then
d0ac1c44 27498 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
c971b7fa
PA
27499 fi
27500fi
27501
27502# test whether we have cygpath
27503if test -z "$CYGPATH_W"; then
27504 if (cygpath --version) >/dev/null 2>/dev/null; then
27505 CYGPATH_W='cygpath -w'
27506 else
27507 CYGPATH_W=echo
27508 fi
27509fi
27510
27511
27512# Define the identity of the package.
d0ac1c44
SM
27513 PACKAGE='libgnu'
27514 VERSION='UNUSED-VERSION'
c971b7fa
PA
27515
27516
27517# Some tools Automake needs.
27518
27519ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
27520
27521
27522AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
27523
27524
27525AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
27526
27527
27528AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
27529
27530
27531MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
27532
d0ac1c44
SM
27533# For better backward compatibility. To be removed once Automake 1.9.x
27534# dies out for good. For more background, see:
27535# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
27536# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
27537mkdir_p='$(MKDIR_P)'
27538
27539# We need awk for the "check" target (and possibly the TAP driver). The
27540# system "awk" is bad on some platforms.
27541# Always define AMTAR for backward compatibility. Yes, it's still used
27542# in the wild :-( We should find a proper way to deprecate it ...
27543AMTAR='$${TAR-tar}'
27544
27545
27546# We'll loop over all known methods to create a tar archive until one works.
27547_am_tools='gnutar pax cpio none'
c971b7fa 27548
d0ac1c44 27549am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
c971b7fa 27550
c971b7fa
PA
27551
27552
27553
27554
27555depcc="$CC" am_compiler_list=
27556
27557{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
27558$as_echo_n "checking dependency style of $depcc... " >&6; }
d0ac1c44 27559if ${am_cv_CC_dependencies_compiler_type+:} false; then :
c971b7fa
PA
27560 $as_echo_n "(cached) " >&6
27561else
27562 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
27563 # We make a subdir and do the tests there. Otherwise we can end up
27564 # making bogus files that we don't know about and never remove. For
27565 # instance it was reported that on HP-UX the gcc test will end up
d0ac1c44
SM
27566 # making a dummy file named 'D' -- because '-MD' means "put the output
27567 # in D".
27568 rm -rf conftest.dir
c971b7fa
PA
27569 mkdir conftest.dir
27570 # Copy depcomp to subdir because otherwise we won't find it if we're
27571 # using a relative directory.
27572 cp "$am_depcomp" conftest.dir
27573 cd conftest.dir
27574 # We will build objects and dependencies in a subdirectory because
27575 # it helps to detect inapplicable dependency modes. For instance
27576 # both Tru64's cc and ICC support -MD to output dependencies as a
27577 # side effect of compilation, but ICC will put the dependencies in
27578 # the current directory while Tru64 will put them in the object
27579 # directory.
27580 mkdir sub
27581
27582 am_cv_CC_dependencies_compiler_type=none
27583 if test "$am_compiler_list" = ""; then
27584 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
27585 fi
27586 am__universal=false
27587 case " $depcc " in #(
27588 *\ -arch\ *\ -arch\ *) am__universal=true ;;
27589 esac
27590
27591 for depmode in $am_compiler_list; do
27592 # Setup a source with many dependencies, because some compilers
27593 # like to wrap large dependency lists on column 80 (with \), and
27594 # we should not choose a depcomp mode which is confused by this.
27595 #
27596 # We need to recreate these files for each test, as the compiler may
27597 # overwrite some of them when testing with obscure command lines.
27598 # This happens at least with the AIX C compiler.
27599 : > sub/conftest.c
27600 for i in 1 2 3 4 5 6; do
27601 echo '#include "conftst'$i'.h"' >> sub/conftest.c
d0ac1c44
SM
27602 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
27603 # Solaris 10 /bin/sh.
27604 echo '/* dummy */' > sub/conftst$i.h
c971b7fa
PA
27605 done
27606 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
27607
d0ac1c44 27608 # We check with '-c' and '-o' for the sake of the "dashmstdout"
c971b7fa 27609 # mode. It turns out that the SunPro C++ compiler does not properly
d0ac1c44
SM
27610 # handle '-M -o', and we need to detect this. Also, some Intel
27611 # versions had trouble with output in subdirs.
c971b7fa
PA
27612 am__obj=sub/conftest.${OBJEXT-o}
27613 am__minus_obj="-o $am__obj"
27614 case $depmode in
27615 gcc)
27616 # This depmode causes a compiler race in universal mode.
27617 test "$am__universal" = false || continue
27618 ;;
27619 nosideeffect)
d0ac1c44
SM
27620 # After this tag, mechanisms are not by side-effect, so they'll
27621 # only be used when explicitly requested.
c971b7fa
PA
27622 if test "x$enable_dependency_tracking" = xyes; then
27623 continue
27624 else
27625 break
27626 fi
27627 ;;
d0ac1c44
SM
27628 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
27629 # This compiler won't grok '-c -o', but also, the minuso test has
c971b7fa
PA
27630 # not run yet. These depmodes are late enough in the game, and
27631 # so weak that their functioning should not be impacted.
27632 am__obj=conftest.${OBJEXT-o}
27633 am__minus_obj=
27634 ;;
27635 none) break ;;
27636 esac
27637 if depmode=$depmode \
27638 source=sub/conftest.c object=$am__obj \
27639 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27640 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
27641 >/dev/null 2>conftest.err &&
27642 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27643 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27644 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27645 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27646 # icc doesn't choke on unknown options, it will just issue warnings
27647 # or remarks (even with -Werror). So we grep stderr for any message
27648 # that says an option was ignored or not supported.
27649 # When given -MP, icc 7.0 and 7.1 complain thusly:
27650 # icc: Command line warning: ignoring option '-M'; no argument required
27651 # The diagnosis changed in icc 8.0:
27652 # icc: Command line remark: option '-MP' not supported
27653 if (grep 'ignoring option' conftest.err ||
27654 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
27655 am_cv_CC_dependencies_compiler_type=$depmode
27656 break
27657 fi
27658 fi
27659 done
27660
27661 cd ..
27662 rm -rf conftest.dir
27663else
27664 am_cv_CC_dependencies_compiler_type=none
27665fi
27666
27667fi
27668{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
27669$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
27670CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
27671
27672 if
27673 test "x$enable_dependency_tracking" != xno \
27674 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
27675 am__fastdepCC_TRUE=
27676 am__fastdepCC_FALSE='#'
27677else
27678 am__fastdepCC_TRUE='#'
27679 am__fastdepCC_FALSE=
27680fi
27681
27682
27683
d0ac1c44
SM
27684# POSIX will say in a future version that running "rm -f" with no argument
27685# is OK; and we want to be able to make that assumption in our Makefile
27686# recipes. So use an aggressive probe to check that the usage we want is
27687# actually supported "in the wild" to an acceptable degree.
27688# See automake bug#10828.
27689# To make any issue more visible, cause the running configure to be aborted
27690# by default if the 'rm' program in use doesn't match our expectations; the
27691# user can still override this though.
27692if rm -f && rm -fr && rm -rf; then : OK; else
27693 cat >&2 <<'END'
27694Oops!
27695
27696Your 'rm' program seems unable to run without file operands specified
27697on the command line, even when the '-f' option is present. This is contrary
27698to the behaviour of most rm programs out there, and not conforming with
27699the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
27700
27701Please tell bug-automake@gnu.org about your system, including the value
27702of your $PATH and any error possibly output before this message. This
27703can help us improve future automake versions.
27704
27705END
27706 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
27707 echo 'Configuration will proceed anyway, since you have set the' >&2
27708 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
27709 echo >&2
27710 else
27711 cat >&2 <<'END'
27712Aborting the configuration process, to ensure you take notice of the issue.
27713
27714You can download and install GNU coreutils to get an 'rm' implementation
27715that behaves properly: <http://www.gnu.org/software/coreutils/>.
27716
27717If you want to complete the configuration process using your problematic
27718'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
27719to "yes", and re-run configure.
27720
27721END
27722 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
27723 fi
27724fi
27725
c971b7fa 27726
39be3c7e
SM
27727# Check whether --enable-silent-rules was given.
27728if test "${enable_silent_rules+set}" = set; then :
27729 enableval=$enable_silent_rules;
27730fi
27731
d0ac1c44
SM
27732case $enable_silent_rules in # (((
27733 yes) AM_DEFAULT_VERBOSITY=0;;
27734 no) AM_DEFAULT_VERBOSITY=1;;
27735 *) AM_DEFAULT_VERBOSITY=0;;
39be3c7e 27736esac
d0ac1c44
SM
27737am_make=${MAKE-make}
27738{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
27739$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
27740if ${am_cv_make_support_nested_variables+:} false; then :
27741 $as_echo_n "(cached) " >&6
27742else
27743 if $as_echo 'TRUE=$(BAR$(V))
27744BAR0=false
27745BAR1=true
27746V=1
27747am__doit:
27748 @$(TRUE)
27749.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
27750 am_cv_make_support_nested_variables=yes
27751else
27752 am_cv_make_support_nested_variables=no
27753fi
27754fi
27755{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
27756$as_echo "$am_cv_make_support_nested_variables" >&6; }
27757if test $am_cv_make_support_nested_variables = yes; then
27758 AM_V='$(V)'
27759 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
27760else
27761 AM_V=$AM_DEFAULT_VERBOSITY
27762 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
27763fi
39be3c7e
SM
27764AM_BACKSLASH='\'
27765
27766
c971b7fa
PA
27767# --------------------- #
27768# Checks for programs. #
27769# --------------------- #
27770
27771
27772{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
27773$as_echo_n "checking whether ln -s works... " >&6; }
27774LN_S=$as_ln_s
27775if test "$LN_S" = "ln -s"; then
27776 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
27777$as_echo "yes" >&6; }
27778else
27779 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
27780$as_echo "no, using $LN_S" >&6; }
27781fi
27782
27783if test -n "$ac_tool_prefix"; then
27784 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
27785set dummy ${ac_tool_prefix}ranlib; ac_word=$2
27786{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27787$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27788if ${ac_cv_prog_RANLIB+:} false; then :
c971b7fa
PA
27789 $as_echo_n "(cached) " >&6
27790else
27791 if test -n "$RANLIB"; then
27792 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
27793else
27794as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27795for as_dir in $PATH
27796do
27797 IFS=$as_save_IFS
27798 test -z "$as_dir" && as_dir=.
27799 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27800 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27801 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
27802 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27803 break 2
27804 fi
27805done
27806 done
27807IFS=$as_save_IFS
27808
27809fi
27810fi
27811RANLIB=$ac_cv_prog_RANLIB
27812if test -n "$RANLIB"; then
27813 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
27814$as_echo "$RANLIB" >&6; }
27815else
27816 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27817$as_echo "no" >&6; }
27818fi
27819
27820
27821fi
27822if test -z "$ac_cv_prog_RANLIB"; then
27823 ac_ct_RANLIB=$RANLIB
27824 # Extract the first word of "ranlib", so it can be a program name with args.
27825set dummy ranlib; ac_word=$2
27826{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27827$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27828if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
27829 $as_echo_n "(cached) " >&6
27830else
27831 if test -n "$ac_ct_RANLIB"; then
27832 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
27833else
27834as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27835for as_dir in $PATH
27836do
27837 IFS=$as_save_IFS
27838 test -z "$as_dir" && as_dir=.
27839 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27840 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27841 ac_cv_prog_ac_ct_RANLIB="ranlib"
27842 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27843 break 2
27844 fi
27845done
27846 done
27847IFS=$as_save_IFS
27848
27849fi
27850fi
27851ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
27852if test -n "$ac_ct_RANLIB"; then
27853 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
27854$as_echo "$ac_ct_RANLIB" >&6; }
27855else
27856 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27857$as_echo "no" >&6; }
27858fi
27859
27860 if test "x$ac_ct_RANLIB" = x; then
27861 RANLIB=":"
27862 else
27863 case $cross_compiling:$ac_tool_warned in
27864yes:)
27865{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
27866$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
27867ac_tool_warned=yes ;;
27868esac
27869 RANLIB=$ac_ct_RANLIB
27870 fi
27871else
27872 RANLIB="$ac_cv_prog_RANLIB"
27873fi
27874
27875
27876if test -n "$ac_tool_prefix"; then
27877 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
27878set dummy ${ac_tool_prefix}ar; ac_word=$2
27879{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27880$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27881if ${ac_cv_prog_AR+:} false; then :
c971b7fa
PA
27882 $as_echo_n "(cached) " >&6
27883else
27884 if test -n "$AR"; then
27885 ac_cv_prog_AR="$AR" # Let the user override the test.
27886else
27887as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27888for as_dir in $PATH
27889do
27890 IFS=$as_save_IFS
27891 test -z "$as_dir" && as_dir=.
27892 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27893 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27894 ac_cv_prog_AR="${ac_tool_prefix}ar"
27895 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27896 break 2
27897 fi
27898done
27899 done
27900IFS=$as_save_IFS
27901
27902fi
27903fi
27904AR=$ac_cv_prog_AR
27905if test -n "$AR"; then
27906 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
27907$as_echo "$AR" >&6; }
27908else
27909 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27910$as_echo "no" >&6; }
27911fi
27912
27913
27914fi
27915if test -z "$ac_cv_prog_AR"; then
27916 ac_ct_AR=$AR
27917 # Extract the first word of "ar", so it can be a program name with args.
27918set dummy ar; ac_word=$2
27919{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27920$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27921if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
27922 $as_echo_n "(cached) " >&6
27923else
27924 if test -n "$ac_ct_AR"; then
27925 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
27926else
27927as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27928for as_dir in $PATH
27929do
27930 IFS=$as_save_IFS
27931 test -z "$as_dir" && as_dir=.
27932 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27933 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27934 ac_cv_prog_ac_ct_AR="ar"
27935 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27936 break 2
27937 fi
27938done
27939 done
27940IFS=$as_save_IFS
27941
27942fi
27943fi
27944ac_ct_AR=$ac_cv_prog_ac_ct_AR
27945if test -n "$ac_ct_AR"; then
27946 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
27947$as_echo "$ac_ct_AR" >&6; }
27948else
27949 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27950$as_echo "no" >&6; }
27951fi
27952
27953 if test "x$ac_ct_AR" = x; then
27954 AR=""
27955 else
27956 case $cross_compiling:$ac_tool_warned in
27957yes:)
27958{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
27959$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
27960ac_tool_warned=yes ;;
27961esac
27962 AR=$ac_ct_AR
27963 fi
27964else
27965 AR="$ac_cv_prog_AR"
27966fi
27967
27968
27969# ---------------------- #
27970# Checks for libraries. #
27971# ---------------------- #
27972
27973ac_config_files="$ac_config_files Makefile import/Makefile"
27974
27975ac_config_commands="$ac_config_commands default"
27976
27977cat >confcache <<\_ACEOF
27978# This file is a shell script that caches the results of configure
27979# tests run on this system so they can be shared between configure
27980# scripts and configure runs, see configure's option --config-cache.
27981# It is not useful on other systems. If it contains results you don't
27982# want to keep, you may remove or edit it.
27983#
27984# config.status only pays attention to the cache file if you give it
27985# the --recheck option to rerun configure.
27986#
27987# `ac_cv_env_foo' variables (set or unset) will be overridden when
27988# loading this file, other *unset* `ac_cv_foo' will be assigned the
27989# following values.
27990
27991_ACEOF
27992
27993# The following way of writing the cache mishandles newlines in values,
27994# but we know of no workaround that is simple, portable, and efficient.
27995# So, we kill variables containing newlines.
27996# Ultrix sh set writes to stderr and can't be redirected directly,
27997# and sets the high bit in the cache file unless we assign to the vars.
27998(
27999 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
28000 eval ac_val=\$$ac_var
28001 case $ac_val in #(
28002 *${as_nl}*)
28003 case $ac_var in #(
28004 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
28005$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
28006 esac
28007 case $ac_var in #(
28008 _ | IFS | as_nl) ;; #(
28009 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
28010 *) { eval $ac_var=; unset $ac_var;} ;;
28011 esac ;;
28012 esac
28013 done
28014
28015 (set) 2>&1 |
28016 case $as_nl`(ac_space=' '; set) 2>&1` in #(
28017 *${as_nl}ac_space=\ *)
28018 # `set' does not quote correctly, so add quotes: double-quote
28019 # substitution turns \\\\ into \\, and sed turns \\ into \.
28020 sed -n \
28021 "s/'/'\\\\''/g;
28022 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
28023 ;; #(
28024 *)
28025 # `set' quotes correctly as required by POSIX, so do not add quotes.
28026 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
28027 ;;
28028 esac |
28029 sort
28030) |
28031 sed '
28032 /^ac_cv_env_/b end
28033 t clear
28034 :clear
28035 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
28036 t end
28037 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
28038 :end' >>confcache
28039if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
28040 if test -w "$cache_file"; then
d0ac1c44 28041 if test "x$cache_file" != "x/dev/null"; then
c971b7fa
PA
28042 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
28043$as_echo "$as_me: updating cache $cache_file" >&6;}
d0ac1c44
SM
28044 if test ! -f "$cache_file" || test -h "$cache_file"; then
28045 cat confcache >"$cache_file"
28046 else
28047 case $cache_file in #(
28048 */* | ?:*)
28049 mv -f confcache "$cache_file"$$ &&
28050 mv -f "$cache_file"$$ "$cache_file" ;; #(
28051 *)
28052 mv -f confcache "$cache_file" ;;
28053 esac
28054 fi
28055 fi
c971b7fa
PA
28056 else
28057 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
28058$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
28059 fi
28060fi
28061rm -f confcache
28062
28063test "x$prefix" = xNONE && prefix=$ac_default_prefix
28064# Let make expand exec_prefix.
28065test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
28066
28067DEFS=-DHAVE_CONFIG_H
28068
28069ac_libobjs=
28070ac_ltlibobjs=
28071for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
28072 # 1. Remove the extension, and $U if already installed.
28073 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
28074 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
28075 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
28076 # will be set to the directory where LIBOBJS objects are built.
28077 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
28078 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
28079done
28080LIBOBJS=$ac_libobjs
28081
28082LTLIBOBJS=$ac_ltlibobjs
28083
28084
28085if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
d0ac1c44 28086 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
c971b7fa
PA
28087Usually this means the macro was only invoked conditionally." "$LINENO" 5
28088fi
28089if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
d0ac1c44 28090 as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
c971b7fa
PA
28091Usually this means the macro was only invoked conditionally." "$LINENO" 5
28092fi
8690e634 28093if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
d0ac1c44 28094 as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
8690e634
JK
28095Usually this means the macro was only invoked conditionally." "$LINENO" 5
28096fi
18848e28 28097if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
d0ac1c44 28098 as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
18848e28
GF
28099Usually this means the macro was only invoked conditionally." "$LINENO" 5
28100fi
88b48903 28101if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
d0ac1c44 28102 as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
88b48903
WN
28103Usually this means the macro was only invoked conditionally." "$LINENO" 5
28104fi
8690e634 28105if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
d0ac1c44 28106 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
8690e634
JK
28107Usually this means the macro was only invoked conditionally." "$LINENO" 5
28108fi
c0c3707f
CB
28109if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
28110 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
28111Usually this means the macro was only invoked conditionally." "$LINENO" 5
28112fi
28113if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
28114 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
28115Usually this means the macro was only invoked conditionally." "$LINENO" 5
28116fi
6ec2e0f5 28117if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
d0ac1c44 28118 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
6ec2e0f5
SDJ
28119Usually this means the macro was only invoked conditionally." "$LINENO" 5
28120fi
49e4877c 28121if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 28122 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
28123Usually this means the macro was only invoked conditionally." "$LINENO" 5
28124fi
28125if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 28126 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
28127Usually this means the macro was only invoked conditionally." "$LINENO" 5
28128fi
c971b7fa 28129if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
d0ac1c44 28130 as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
c971b7fa
PA
28131Usually this means the macro was only invoked conditionally." "$LINENO" 5
28132fi
88b48903
WN
28133
28134
725e2999
JB
28135if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
28136 as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined.
28137Usually this means the macro was only invoked conditionally." "$LINENO" 5
28138fi
28139if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
28140 as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
28141Usually this means the macro was only invoked conditionally." "$LINENO" 5
28142fi
8690e634 28143if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
d0ac1c44 28144 as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
8690e634
JK
28145Usually this means the macro was only invoked conditionally." "$LINENO" 5
28146fi
c971b7fa 28147if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
d0ac1c44 28148 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
c971b7fa
PA
28149Usually this means the macro was only invoked conditionally." "$LINENO" 5
28150fi
28151
28152 gl_libobjs=
28153 gl_ltlibobjs=
28154 if test -n "$gl_LIBOBJS"; then
28155 # Remove the extension.
28156 sed_drop_objext='s/\.o$//;s/\.obj$//'
28157 for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
28158 gl_libobjs="$gl_libobjs $i.$ac_objext"
28159 gl_ltlibobjs="$gl_ltlibobjs $i.lo"
28160 done
28161 fi
28162 gl_LIBOBJS=$gl_libobjs
28163
28164 gl_LTLIBOBJS=$gl_ltlibobjs
28165
28166
28167
28168 gltests_libobjs=
28169 gltests_ltlibobjs=
28170 if test -n "$gltests_LIBOBJS"; then
28171 # Remove the extension.
28172 sed_drop_objext='s/\.o$//;s/\.obj$//'
28173 for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
28174 gltests_libobjs="$gltests_libobjs $i.$ac_objext"
28175 gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
28176 done
28177 fi
28178 gltests_LIBOBJS=$gltests_libobjs
28179
28180 gltests_LTLIBOBJS=$gltests_ltlibobjs
28181
28182
d0ac1c44
SM
28183{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
28184$as_echo_n "checking that generated files are newer than configure... " >&6; }
28185 if test -n "$am_sleep_pid"; then
28186 # Hide warnings about reused PIDs.
28187 wait $am_sleep_pid 2>/dev/null
28188 fi
28189 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
28190$as_echo "done" >&6; }
c971b7fa 28191if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
d0ac1c44 28192 as_fn_error $? "conditional \"AMDEP\" was never defined.
c971b7fa
PA
28193Usually this means the macro was only invoked conditionally." "$LINENO" 5
28194fi
28195if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
d0ac1c44 28196 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
c971b7fa
PA
28197Usually this means the macro was only invoked conditionally." "$LINENO" 5
28198fi
28199 if test -n "$EXEEXT"; then
28200 am__EXEEXT_TRUE=
28201 am__EXEEXT_FALSE='#'
28202else
28203 am__EXEEXT_TRUE='#'
28204 am__EXEEXT_FALSE=
28205fi
28206
28207
d0ac1c44 28208: "${CONFIG_STATUS=./config.status}"
c971b7fa
PA
28209ac_write_fail=0
28210ac_clean_files_save=$ac_clean_files
28211ac_clean_files="$ac_clean_files $CONFIG_STATUS"
28212{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
28213$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
28214as_write_fail=0
28215cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
28216#! $SHELL
28217# Generated by $as_me.
28218# Run this file to recreate the current configuration.
28219# Compiler output produced by configure, useful for debugging
28220# configure, is in config.log if it exists.
28221
28222debug=false
28223ac_cs_recheck=false
28224ac_cs_silent=false
28225
28226SHELL=\${CONFIG_SHELL-$SHELL}
28227export SHELL
28228_ASEOF
28229cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
28230## -------------------- ##
28231## M4sh Initialization. ##
28232## -------------------- ##
28233
28234# Be more Bourne compatible
28235DUALCASE=1; export DUALCASE # for MKS sh
28236if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
28237 emulate sh
28238 NULLCMD=:
28239 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
28240 # is contrary to our usage. Disable this feature.
28241 alias -g '${1+"$@"}'='"$@"'
28242 setopt NO_GLOB_SUBST
28243else
28244 case `(set -o) 2>/dev/null` in #(
28245 *posix*) :
28246 set -o posix ;; #(
28247 *) :
28248 ;;
28249esac
28250fi
28251
28252
28253as_nl='
28254'
28255export as_nl
28256# Printing a long string crashes Solaris 7 /usr/bin/printf.
28257as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
28258as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
28259as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
28260# Prefer a ksh shell builtin over an external printf program on Solaris,
28261# but without wasting forks for bash or zsh.
28262if test -z "$BASH_VERSION$ZSH_VERSION" \
28263 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
28264 as_echo='print -r --'
28265 as_echo_n='print -rn --'
28266elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
28267 as_echo='printf %s\n'
28268 as_echo_n='printf %s'
28269else
28270 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
28271 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
28272 as_echo_n='/usr/ucb/echo -n'
28273 else
28274 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
28275 as_echo_n_body='eval
28276 arg=$1;
28277 case $arg in #(
28278 *"$as_nl"*)
28279 expr "X$arg" : "X\\(.*\\)$as_nl";
28280 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
28281 esac;
28282 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
28283 '
28284 export as_echo_n_body
28285 as_echo_n='sh -c $as_echo_n_body as_echo'
28286 fi
28287 export as_echo_body
28288 as_echo='sh -c $as_echo_body as_echo'
28289fi
28290
28291# The user is always right.
28292if test "${PATH_SEPARATOR+set}" != set; then
28293 PATH_SEPARATOR=:
28294 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
28295 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
28296 PATH_SEPARATOR=';'
28297 }
28298fi
28299
28300
28301# IFS
28302# We need space, tab and new line, in precisely that order. Quoting is
28303# there to prevent editors from complaining about space-tab.
28304# (If _AS_PATH_WALK were called with IFS unset, it would disable word
28305# splitting by setting IFS to empty value.)
28306IFS=" "" $as_nl"
28307
28308# Find who we are. Look in the path if we contain no directory separator.
d0ac1c44 28309as_myself=
c971b7fa
PA
28310case $0 in #((
28311 *[\\/]* ) as_myself=$0 ;;
28312 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
28313for as_dir in $PATH
28314do
28315 IFS=$as_save_IFS
28316 test -z "$as_dir" && as_dir=.
28317 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
28318 done
28319IFS=$as_save_IFS
28320
28321 ;;
28322esac
28323# We did not find ourselves, most probably we were run as `sh COMMAND'
28324# in which case we are not to be found in the path.
28325if test "x$as_myself" = x; then
28326 as_myself=$0
28327fi
28328if test ! -f "$as_myself"; then
28329 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
28330 exit 1
28331fi
28332
28333# Unset variables that we do not need and which cause bugs (e.g. in
28334# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
28335# suppresses any "Segmentation fault" message there. '((' could
28336# trigger a bug in pdksh 5.2.14.
28337for as_var in BASH_ENV ENV MAIL MAILPATH
28338do eval test x\${$as_var+set} = xset \
28339 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
28340done
28341PS1='$ '
28342PS2='> '
28343PS4='+ '
28344
28345# NLS nuisances.
28346LC_ALL=C
28347export LC_ALL
28348LANGUAGE=C
28349export LANGUAGE
28350
28351# CDPATH.
28352(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
28353
28354
d0ac1c44
SM
28355# as_fn_error STATUS ERROR [LINENO LOG_FD]
28356# ----------------------------------------
c971b7fa
PA
28357# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
28358# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
d0ac1c44 28359# script with STATUS, using 1 if that was 0.
c971b7fa
PA
28360as_fn_error ()
28361{
d0ac1c44
SM
28362 as_status=$1; test $as_status -eq 0 && as_status=1
28363 if test "$4"; then
28364 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
28365 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
c971b7fa 28366 fi
d0ac1c44 28367 $as_echo "$as_me: error: $2" >&2
c971b7fa
PA
28368 as_fn_exit $as_status
28369} # as_fn_error
28370
28371
28372# as_fn_set_status STATUS
28373# -----------------------
28374# Set $? to STATUS, without forking.
28375as_fn_set_status ()
28376{
28377 return $1
28378} # as_fn_set_status
28379
28380# as_fn_exit STATUS
28381# -----------------
28382# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
28383as_fn_exit ()
28384{
28385 set +e
28386 as_fn_set_status $1
28387 exit $1
28388} # as_fn_exit
28389
28390# as_fn_unset VAR
28391# ---------------
28392# Portably unset VAR.
28393as_fn_unset ()
28394{
28395 { eval $1=; unset $1;}
28396}
28397as_unset=as_fn_unset
28398# as_fn_append VAR VALUE
28399# ----------------------
28400# Append the text in VALUE to the end of the definition contained in VAR. Take
28401# advantage of any shell optimizations that allow amortized linear growth over
28402# repeated appends, instead of the typical quadratic growth present in naive
28403# implementations.
28404if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
28405 eval 'as_fn_append ()
28406 {
28407 eval $1+=\$2
28408 }'
28409else
28410 as_fn_append ()
28411 {
28412 eval $1=\$$1\$2
28413 }
28414fi # as_fn_append
28415
28416# as_fn_arith ARG...
28417# ------------------
28418# Perform arithmetic evaluation on the ARGs, and store the result in the
28419# global $as_val. Take advantage of shells that can avoid forks. The arguments
28420# must be portable across $(()) and expr.
28421if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
28422 eval 'as_fn_arith ()
28423 {
28424 as_val=$(( $* ))
28425 }'
28426else
28427 as_fn_arith ()
28428 {
28429 as_val=`expr "$@" || test $? -eq 1`
28430 }
28431fi # as_fn_arith
28432
28433
28434if expr a : '\(a\)' >/dev/null 2>&1 &&
28435 test "X`expr 00001 : '.*\(...\)'`" = X001; then
28436 as_expr=expr
28437else
28438 as_expr=false
28439fi
28440
28441if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
28442 as_basename=basename
28443else
28444 as_basename=false
28445fi
28446
28447if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
28448 as_dirname=dirname
28449else
28450 as_dirname=false
28451fi
28452
28453as_me=`$as_basename -- "$0" ||
28454$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
28455 X"$0" : 'X\(//\)$' \| \
28456 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
28457$as_echo X/"$0" |
28458 sed '/^.*\/\([^/][^/]*\)\/*$/{
28459 s//\1/
28460 q
28461 }
28462 /^X\/\(\/\/\)$/{
28463 s//\1/
28464 q
28465 }
28466 /^X\/\(\/\).*/{
28467 s//\1/
28468 q
28469 }
28470 s/.*/./; q'`
28471
28472# Avoid depending upon Character Ranges.
28473as_cr_letters='abcdefghijklmnopqrstuvwxyz'
28474as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
28475as_cr_Letters=$as_cr_letters$as_cr_LETTERS
28476as_cr_digits='0123456789'
28477as_cr_alnum=$as_cr_Letters$as_cr_digits
28478
28479ECHO_C= ECHO_N= ECHO_T=
28480case `echo -n x` in #(((((
28481-n*)
28482 case `echo 'xy\c'` in
28483 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
28484 xy) ECHO_C='\c';;
28485 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
28486 ECHO_T=' ';;
28487 esac;;
28488*)
28489 ECHO_N='-n';;
28490esac
28491
28492rm -f conf$$ conf$$.exe conf$$.file
28493if test -d conf$$.dir; then
28494 rm -f conf$$.dir/conf$$.file
28495else
28496 rm -f conf$$.dir
28497 mkdir conf$$.dir 2>/dev/null
28498fi
28499if (echo >conf$$.file) 2>/dev/null; then
28500 if ln -s conf$$.file conf$$ 2>/dev/null; then
28501 as_ln_s='ln -s'
28502 # ... but there are two gotchas:
28503 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
28504 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
d0ac1c44 28505 # In both cases, we have to default to `cp -pR'.
c971b7fa 28506 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
d0ac1c44 28507 as_ln_s='cp -pR'
c971b7fa
PA
28508 elif ln conf$$.file conf$$ 2>/dev/null; then
28509 as_ln_s=ln
28510 else
d0ac1c44 28511 as_ln_s='cp -pR'
c971b7fa
PA
28512 fi
28513else
d0ac1c44 28514 as_ln_s='cp -pR'
c971b7fa
PA
28515fi
28516rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
28517rmdir conf$$.dir 2>/dev/null
28518
28519
28520# as_fn_mkdir_p
28521# -------------
28522# Create "$as_dir" as a directory, including parents if necessary.
28523as_fn_mkdir_p ()
28524{
28525
28526 case $as_dir in #(
28527 -*) as_dir=./$as_dir;;
28528 esac
28529 test -d "$as_dir" || eval $as_mkdir_p || {
28530 as_dirs=
28531 while :; do
28532 case $as_dir in #(
28533 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
28534 *) as_qdir=$as_dir;;
28535 esac
28536 as_dirs="'$as_qdir' $as_dirs"
28537 as_dir=`$as_dirname -- "$as_dir" ||
28538$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
28539 X"$as_dir" : 'X\(//\)[^/]' \| \
28540 X"$as_dir" : 'X\(//\)$' \| \
28541 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
28542$as_echo X"$as_dir" |
28543 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
28544 s//\1/
28545 q
28546 }
28547 /^X\(\/\/\)[^/].*/{
28548 s//\1/
28549 q
28550 }
28551 /^X\(\/\/\)$/{
28552 s//\1/
28553 q
28554 }
28555 /^X\(\/\).*/{
28556 s//\1/
28557 q
28558 }
28559 s/.*/./; q'`
28560 test -d "$as_dir" && break
28561 done
28562 test -z "$as_dirs" || eval "mkdir $as_dirs"
d0ac1c44 28563 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
c971b7fa
PA
28564
28565
28566} # as_fn_mkdir_p
28567if mkdir -p . 2>/dev/null; then
28568 as_mkdir_p='mkdir -p "$as_dir"'
28569else
28570 test -d ./-p && rmdir ./-p
28571 as_mkdir_p=false
28572fi
28573
d0ac1c44
SM
28574
28575# as_fn_executable_p FILE
28576# -----------------------
28577# Test if FILE is an executable regular file.
28578as_fn_executable_p ()
28579{
28580 test -f "$1" && test -x "$1"
28581} # as_fn_executable_p
28582as_test_x='test -x'
28583as_executable_p=as_fn_executable_p
c971b7fa
PA
28584
28585# Sed expression to map a string onto a valid CPP name.
28586as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
28587
28588# Sed expression to map a string onto a valid variable name.
28589as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
28590
28591
28592exec 6>&1
28593## ----------------------------------- ##
28594## Main body of $CONFIG_STATUS script. ##
28595## ----------------------------------- ##
28596_ASEOF
28597test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
28598
28599cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28600# Save the log message, to keep $0 and so on meaningful, and to
28601# report actual input values of CONFIG_FILES etc. instead of their
28602# values after options handling.
28603ac_log="
d0ac1c44
SM
28604This file was extended by libgnu $as_me UNUSED-VERSION, which was
28605generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
28606
28607 CONFIG_FILES = $CONFIG_FILES
28608 CONFIG_HEADERS = $CONFIG_HEADERS
28609 CONFIG_LINKS = $CONFIG_LINKS
28610 CONFIG_COMMANDS = $CONFIG_COMMANDS
28611 $ $0 $@
28612
28613on `(hostname || uname -n) 2>/dev/null | sed 1q`
28614"
28615
28616_ACEOF
28617
28618case $ac_config_files in *"
28619"*) set x $ac_config_files; shift; ac_config_files=$*;;
28620esac
28621
28622case $ac_config_headers in *"
28623"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
28624esac
28625
28626
28627cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
28628# Files that config.status was made for.
28629config_files="$ac_config_files"
28630config_headers="$ac_config_headers"
28631config_commands="$ac_config_commands"
28632
28633_ACEOF
28634
28635cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28636ac_cs_usage="\
28637\`$as_me' instantiates files and other configuration actions
28638from templates according to the current configuration. Unless the files
28639and actions are specified as TAGs, all are instantiated by default.
28640
28641Usage: $0 [OPTION]... [TAG]...
28642
28643 -h, --help print this help, then exit
28644 -V, --version print version number and configuration settings, then exit
d0ac1c44 28645 --config print configuration, then exit
c971b7fa
PA
28646 -q, --quiet, --silent
28647 do not print progress messages
28648 -d, --debug don't remove temporary files
28649 --recheck update $as_me by reconfiguring in the same conditions
28650 --file=FILE[:TEMPLATE]
28651 instantiate the configuration file FILE
28652 --header=FILE[:TEMPLATE]
28653 instantiate the configuration header FILE
28654
28655Configuration files:
28656$config_files
28657
28658Configuration headers:
28659$config_headers
28660
28661Configuration commands:
28662$config_commands
28663
28664Report bugs to the package provider."
28665
28666_ACEOF
28667cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 28668ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
c971b7fa 28669ac_cs_version="\\
d0ac1c44
SM
28670libgnu config.status UNUSED-VERSION
28671configured by $0, generated by GNU Autoconf 2.69,
28672 with options \\"\$ac_cs_config\\"
c971b7fa 28673
d0ac1c44 28674Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
28675This config.status script is free software; the Free Software Foundation
28676gives unlimited permission to copy, distribute and modify it."
28677
28678ac_pwd='$ac_pwd'
28679srcdir='$srcdir'
28680INSTALL='$INSTALL'
28681MKDIR_P='$MKDIR_P'
28682AWK='$AWK'
28683test -n "\$AWK" || AWK=awk
28684_ACEOF
28685
28686cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28687# The default lists apply if the user does not specify any file.
28688ac_need_defaults=:
28689while test $# != 0
28690do
28691 case $1 in
d0ac1c44 28692 --*=?*)
c971b7fa
PA
28693 ac_option=`expr "X$1" : 'X\([^=]*\)='`
28694 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
28695 ac_shift=:
28696 ;;
d0ac1c44
SM
28697 --*=)
28698 ac_option=`expr "X$1" : 'X\([^=]*\)='`
28699 ac_optarg=
28700 ac_shift=:
28701 ;;
c971b7fa
PA
28702 *)
28703 ac_option=$1
28704 ac_optarg=$2
28705 ac_shift=shift
28706 ;;
28707 esac
28708
28709 case $ac_option in
28710 # Handling of the options.
28711 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
28712 ac_cs_recheck=: ;;
28713 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
28714 $as_echo "$ac_cs_version"; exit ;;
d0ac1c44
SM
28715 --config | --confi | --conf | --con | --co | --c )
28716 $as_echo "$ac_cs_config"; exit ;;
c971b7fa
PA
28717 --debug | --debu | --deb | --de | --d | -d )
28718 debug=: ;;
28719 --file | --fil | --fi | --f )
28720 $ac_shift
28721 case $ac_optarg in
28722 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
d0ac1c44 28723 '') as_fn_error $? "missing file argument" ;;
c971b7fa
PA
28724 esac
28725 as_fn_append CONFIG_FILES " '$ac_optarg'"
28726 ac_need_defaults=false;;
28727 --header | --heade | --head | --hea )
28728 $ac_shift
28729 case $ac_optarg in
28730 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
28731 esac
28732 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
28733 ac_need_defaults=false;;
28734 --he | --h)
28735 # Conflict between --help and --header
d0ac1c44 28736 as_fn_error $? "ambiguous option: \`$1'
c971b7fa
PA
28737Try \`$0 --help' for more information.";;
28738 --help | --hel | -h )
28739 $as_echo "$ac_cs_usage"; exit ;;
28740 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
28741 | -silent | --silent | --silen | --sile | --sil | --si | --s)
28742 ac_cs_silent=: ;;
28743
28744 # This is an error.
d0ac1c44 28745 -*) as_fn_error $? "unrecognized option: \`$1'
c971b7fa
PA
28746Try \`$0 --help' for more information." ;;
28747
28748 *) as_fn_append ac_config_targets " $1"
28749 ac_need_defaults=false ;;
28750
28751 esac
28752 shift
28753done
28754
28755ac_configure_extra_args=
28756
28757if $ac_cs_silent; then
28758 exec 6>/dev/null
28759 ac_configure_extra_args="$ac_configure_extra_args --silent"
28760fi
28761
28762_ACEOF
28763cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
28764if \$ac_cs_recheck; then
d0ac1c44 28765 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
c971b7fa
PA
28766 shift
28767 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
28768 CONFIG_SHELL='$SHELL'
28769 export CONFIG_SHELL
28770 exec "\$@"
28771fi
28772
28773_ACEOF
28774cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28775exec 5>>config.log
28776{
28777 echo
28778 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
28779## Running $as_me. ##
28780_ASBOX
28781 $as_echo "$ac_log"
28782} >&5
28783
28784_ACEOF
28785cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
28786#
28787# INIT-COMMANDS
28788#
28789AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
28790
28791_ACEOF
28792
28793cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28794
28795# Handling of arguments.
28796for ac_config_target in $ac_config_targets
28797do
28798 case $ac_config_target in
28799 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
28800 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
28801 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
28802 "import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;;
28803 "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
28804
d0ac1c44 28805 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
c971b7fa
PA
28806 esac
28807done
28808
28809
28810# If the user did not use the arguments to specify the items to instantiate,
28811# then the envvar interface is used. Set only those that are not.
28812# We use the long form for the default assignment because of an extremely
28813# bizarre bug on SunOS 4.1.3.
28814if $ac_need_defaults; then
28815 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
28816 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
28817 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
28818fi
28819
28820# Have a temporary directory for convenience. Make it in the build tree
28821# simply because there is no reason against having it here, and in addition,
28822# creating and moving files from /tmp can sometimes cause problems.
28823# Hook for its removal unless debugging.
28824# Note that there is a small window in which the directory will not be cleaned:
28825# after its creation but before its name has been assigned to `$tmp'.
28826$debug ||
28827{
d0ac1c44 28828 tmp= ac_tmp=
c971b7fa 28829 trap 'exit_status=$?
d0ac1c44
SM
28830 : "${ac_tmp:=$tmp}"
28831 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
c971b7fa
PA
28832' 0
28833 trap 'as_fn_exit 1' 1 2 13 15
28834}
28835# Create a (secure) tmp directory for tmp files.
28836
28837{
28838 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
d0ac1c44 28839 test -d "$tmp"
c971b7fa
PA
28840} ||
28841{
28842 tmp=./conf$$-$RANDOM
28843 (umask 077 && mkdir "$tmp")
d0ac1c44
SM
28844} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
28845ac_tmp=$tmp
c971b7fa
PA
28846
28847# Set up the scripts for CONFIG_FILES section.
28848# No need to generate them if there are no CONFIG_FILES.
28849# This happens for instance with `./config.status config.h'.
28850if test -n "$CONFIG_FILES"; then
28851
28852
28853ac_cr=`echo X | tr X '\015'`
28854# On cygwin, bash can eat \r inside `` if the user requested igncr.
28855# But we know of no other shell where ac_cr would be empty at this
28856# point, so we can use a bashism as a fallback.
28857if test "x$ac_cr" = x; then
28858 eval ac_cr=\$\'\\r\'
28859fi
28860ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
28861if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
d0ac1c44 28862 ac_cs_awk_cr='\\r'
c971b7fa
PA
28863else
28864 ac_cs_awk_cr=$ac_cr
28865fi
28866
d0ac1c44 28867echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
c971b7fa
PA
28868_ACEOF
28869
28870
28871{
28872 echo "cat >conf$$subs.awk <<_ACEOF" &&
28873 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
28874 echo "_ACEOF"
28875} >conf$$subs.sh ||
d0ac1c44
SM
28876 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
28877ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
c971b7fa
PA
28878ac_delim='%!_!# '
28879for ac_last_try in false false false false false :; do
28880 . ./conf$$subs.sh ||
d0ac1c44 28881 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
28882
28883 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
28884 if test $ac_delim_n = $ac_delim_num; then
28885 break
28886 elif $ac_last_try; then
d0ac1c44 28887 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
28888 else
28889 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
28890 fi
28891done
28892rm -f conf$$subs.sh
28893
28894cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 28895cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
c971b7fa
PA
28896_ACEOF
28897sed -n '
28898h
28899s/^/S["/; s/!.*/"]=/
28900p
28901g
28902s/^[^!]*!//
28903:repl
28904t repl
28905s/'"$ac_delim"'$//
28906t delim
28907:nl
28908h
d0ac1c44 28909s/\(.\{148\}\)..*/\1/
c971b7fa
PA
28910t more1
28911s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
28912p
28913n
28914b repl
28915:more1
28916s/["\\]/\\&/g; s/^/"/; s/$/"\\/
28917p
28918g
28919s/.\{148\}//
28920t nl
28921:delim
28922h
d0ac1c44 28923s/\(.\{148\}\)..*/\1/
c971b7fa
PA
28924t more2
28925s/["\\]/\\&/g; s/^/"/; s/$/"/
28926p
28927b
28928:more2
28929s/["\\]/\\&/g; s/^/"/; s/$/"\\/
28930p
28931g
28932s/.\{148\}//
28933t delim
28934' <conf$$subs.awk | sed '
28935/^[^""]/{
28936 N
28937 s/\n//
28938}
28939' >>$CONFIG_STATUS || ac_write_fail=1
28940rm -f conf$$subs.awk
28941cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
28942_ACAWK
d0ac1c44 28943cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
c971b7fa
PA
28944 for (key in S) S_is_set[key] = 1
28945 FS = "\a"
28946
28947}
28948{
28949 line = $ 0
28950 nfields = split(line, field, "@")
28951 substed = 0
28952 len = length(field[1])
28953 for (i = 2; i < nfields; i++) {
28954 key = field[i]
28955 keylen = length(key)
28956 if (S_is_set[key]) {
28957 value = S[key]
28958 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
28959 len += length(value) + length(field[++i])
28960 substed = 1
28961 } else
28962 len += 1 + keylen
28963 }
28964
28965 print line
28966}
28967
28968_ACAWK
28969_ACEOF
28970cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28971if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
28972 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
28973else
28974 cat
d0ac1c44
SM
28975fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
28976 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
c971b7fa
PA
28977_ACEOF
28978
d0ac1c44
SM
28979# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
28980# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
c971b7fa
PA
28981# trailing colons and then remove the whole line if VPATH becomes empty
28982# (actually we leave an empty line to preserve line numbers).
28983if test "x$srcdir" = x.; then
d0ac1c44
SM
28984 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
28985h
28986s///
28987s/^/:/
28988s/[ ]*$/:/
28989s/:\$(srcdir):/:/g
28990s/:\${srcdir}:/:/g
28991s/:@srcdir@:/:/g
28992s/^:*//
c971b7fa 28993s/:*$//
d0ac1c44
SM
28994x
28995s/\(=[ ]*\).*/\1/
28996G
28997s/\n//
c971b7fa
PA
28998s/^[^=]*=[ ]*$//
28999}'
29000fi
29001
29002cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
29003fi # test -n "$CONFIG_FILES"
29004
29005# Set up the scripts for CONFIG_HEADERS section.
29006# No need to generate them if there are no CONFIG_HEADERS.
29007# This happens for instance with `./config.status Makefile'.
29008if test -n "$CONFIG_HEADERS"; then
d0ac1c44 29009cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
c971b7fa
PA
29010BEGIN {
29011_ACEOF
29012
29013# Transform confdefs.h into an awk script `defines.awk', embedded as
29014# here-document in config.status, that substitutes the proper values into
29015# config.h.in to produce config.h.
29016
29017# Create a delimiter string that does not exist in confdefs.h, to ease
29018# handling of long lines.
29019ac_delim='%!_!# '
29020for ac_last_try in false false :; do
d0ac1c44
SM
29021 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
29022 if test -z "$ac_tt"; then
c971b7fa
PA
29023 break
29024 elif $ac_last_try; then
d0ac1c44 29025 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
c971b7fa
PA
29026 else
29027 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
29028 fi
29029done
29030
29031# For the awk script, D is an array of macro values keyed by name,
29032# likewise P contains macro parameters if any. Preserve backslash
29033# newline sequences.
29034
29035ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
29036sed -n '
29037s/.\{148\}/&'"$ac_delim"'/g
29038t rset
29039:rset
29040s/^[ ]*#[ ]*define[ ][ ]*/ /
29041t def
29042d
29043:def
29044s/\\$//
29045t bsnl
29046s/["\\]/\\&/g
29047s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
29048D["\1"]=" \3"/p
29049s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
29050d
29051:bsnl
29052s/["\\]/\\&/g
29053s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
29054D["\1"]=" \3\\\\\\n"\\/p
29055t cont
29056s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
29057t cont
29058d
29059:cont
29060n
29061s/.\{148\}/&'"$ac_delim"'/g
29062t clear
29063:clear
29064s/\\$//
29065t bsnlc
29066s/["\\]/\\&/g; s/^/"/; s/$/"/p
29067d
29068:bsnlc
29069s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
29070b cont
29071' <confdefs.h | sed '
29072s/'"$ac_delim"'/"\\\
29073"/g' >>$CONFIG_STATUS || ac_write_fail=1
29074
29075cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
29076 for (key in D) D_is_set[key] = 1
29077 FS = "\a"
29078}
29079/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
29080 line = \$ 0
29081 split(line, arg, " ")
29082 if (arg[1] == "#") {
29083 defundef = arg[2]
29084 mac1 = arg[3]
29085 } else {
29086 defundef = substr(arg[1], 2)
29087 mac1 = arg[2]
29088 }
29089 split(mac1, mac2, "(") #)
29090 macro = mac2[1]
29091 prefix = substr(line, 1, index(line, defundef) - 1)
29092 if (D_is_set[macro]) {
29093 # Preserve the white space surrounding the "#".
29094 print prefix "define", macro P[macro] D[macro]
29095 next
29096 } else {
29097 # Replace #undef with comments. This is necessary, for example,
29098 # in the case of _POSIX_SOURCE, which is predefined and required
29099 # on some systems where configure will not decide to define it.
29100 if (defundef == "undef") {
29101 print "/*", prefix defundef, macro, "*/"
29102 next
29103 }
29104 }
29105}
29106{ print }
29107_ACAWK
29108_ACEOF
29109cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
d0ac1c44 29110 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
c971b7fa
PA
29111fi # test -n "$CONFIG_HEADERS"
29112
29113
29114eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
29115shift
29116for ac_tag
29117do
29118 case $ac_tag in
29119 :[FHLC]) ac_mode=$ac_tag; continue;;
29120 esac
29121 case $ac_mode$ac_tag in
29122 :[FHL]*:*);;
d0ac1c44 29123 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
c971b7fa
PA
29124 :[FH]-) ac_tag=-:-;;
29125 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
29126 esac
29127 ac_save_IFS=$IFS
29128 IFS=:
29129 set x $ac_tag
29130 IFS=$ac_save_IFS
29131 shift
29132 ac_file=$1
29133 shift
29134
29135 case $ac_mode in
29136 :L) ac_source=$1;;
29137 :[FH])
29138 ac_file_inputs=
29139 for ac_f
29140 do
29141 case $ac_f in
d0ac1c44 29142 -) ac_f="$ac_tmp/stdin";;
c971b7fa
PA
29143 *) # Look for the file first in the build tree, then in the source tree
29144 # (if the path is not absolute). The absolute path cannot be DOS-style,
29145 # because $ac_f cannot contain `:'.
29146 test -f "$ac_f" ||
29147 case $ac_f in
29148 [\\/$]*) false;;
29149 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
29150 esac ||
d0ac1c44 29151 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
c971b7fa
PA
29152 esac
29153 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
29154 as_fn_append ac_file_inputs " '$ac_f'"
29155 done
29156
29157 # Let's still pretend it is `configure' which instantiates (i.e., don't
29158 # use $as_me), people would be surprised to read:
29159 # /* config.h. Generated by config.status. */
29160 configure_input='Generated from '`
29161 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
29162 `' by configure.'
29163 if test x"$ac_file" != x-; then
29164 configure_input="$ac_file. $configure_input"
29165 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
29166$as_echo "$as_me: creating $ac_file" >&6;}
29167 fi
29168 # Neutralize special characters interpreted by sed in replacement strings.
29169 case $configure_input in #(
29170 *\&* | *\|* | *\\* )
29171 ac_sed_conf_input=`$as_echo "$configure_input" |
29172 sed 's/[\\\\&|]/\\\\&/g'`;; #(
29173 *) ac_sed_conf_input=$configure_input;;
29174 esac
29175
29176 case $ac_tag in
d0ac1c44
SM
29177 *:-:* | *:-) cat >"$ac_tmp/stdin" \
29178 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
c971b7fa
PA
29179 esac
29180 ;;
29181 esac
29182
29183 ac_dir=`$as_dirname -- "$ac_file" ||
29184$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
29185 X"$ac_file" : 'X\(//\)[^/]' \| \
29186 X"$ac_file" : 'X\(//\)$' \| \
29187 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
29188$as_echo X"$ac_file" |
29189 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
29190 s//\1/
29191 q
29192 }
29193 /^X\(\/\/\)[^/].*/{
29194 s//\1/
29195 q
29196 }
29197 /^X\(\/\/\)$/{
29198 s//\1/
29199 q
29200 }
29201 /^X\(\/\).*/{
29202 s//\1/
29203 q
29204 }
29205 s/.*/./; q'`
29206 as_dir="$ac_dir"; as_fn_mkdir_p
29207 ac_builddir=.
29208
29209case "$ac_dir" in
29210.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
29211*)
29212 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
29213 # A ".." for each directory in $ac_dir_suffix.
29214 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
29215 case $ac_top_builddir_sub in
29216 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
29217 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
29218 esac ;;
29219esac
29220ac_abs_top_builddir=$ac_pwd
29221ac_abs_builddir=$ac_pwd$ac_dir_suffix
29222# for backward compatibility:
29223ac_top_builddir=$ac_top_build_prefix
29224
29225case $srcdir in
29226 .) # We are building in place.
29227 ac_srcdir=.
29228 ac_top_srcdir=$ac_top_builddir_sub
29229 ac_abs_top_srcdir=$ac_pwd ;;
29230 [\\/]* | ?:[\\/]* ) # Absolute name.
29231 ac_srcdir=$srcdir$ac_dir_suffix;
29232 ac_top_srcdir=$srcdir
29233 ac_abs_top_srcdir=$srcdir ;;
29234 *) # Relative name.
29235 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
29236 ac_top_srcdir=$ac_top_build_prefix$srcdir
29237 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
29238esac
29239ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
29240
29241
29242 case $ac_mode in
29243 :F)
29244 #
29245 # CONFIG_FILE
29246 #
29247
29248 case $INSTALL in
29249 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
29250 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
29251 esac
29252 ac_MKDIR_P=$MKDIR_P
29253 case $MKDIR_P in
29254 [\\/$]* | ?:[\\/]* ) ;;
29255 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
29256 esac
29257_ACEOF
29258
29259cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
29260# If the template does not know about datarootdir, expand it.
29261# FIXME: This hack should be removed a few years after 2.60.
29262ac_datarootdir_hack=; ac_datarootdir_seen=
29263ac_sed_dataroot='
29264/datarootdir/ {
29265 p
29266 q
29267}
29268/@datadir@/p
29269/@docdir@/p
29270/@infodir@/p
29271/@localedir@/p
29272/@mandir@/p'
29273case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
29274*datarootdir*) ac_datarootdir_seen=yes;;
29275*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
29276 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
29277$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
29278_ACEOF
29279cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
29280 ac_datarootdir_hack='
29281 s&@datadir@&$datadir&g
29282 s&@docdir@&$docdir&g
29283 s&@infodir@&$infodir&g
29284 s&@localedir@&$localedir&g
29285 s&@mandir@&$mandir&g
29286 s&\\\${datarootdir}&$datarootdir&g' ;;
29287esac
29288_ACEOF
29289
29290# Neutralize VPATH when `$srcdir' = `.'.
29291# Shell code in configure.ac might set extrasub.
29292# FIXME: do we really want to maintain this feature?
29293cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
29294ac_sed_extra="$ac_vpsub
29295$extrasub
29296_ACEOF
29297cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
29298:t
29299/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
29300s|@configure_input@|$ac_sed_conf_input|;t t
29301s&@top_builddir@&$ac_top_builddir_sub&;t t
29302s&@top_build_prefix@&$ac_top_build_prefix&;t t
29303s&@srcdir@&$ac_srcdir&;t t
29304s&@abs_srcdir@&$ac_abs_srcdir&;t t
29305s&@top_srcdir@&$ac_top_srcdir&;t t
29306s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
29307s&@builddir@&$ac_builddir&;t t
29308s&@abs_builddir@&$ac_abs_builddir&;t t
29309s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
29310s&@INSTALL@&$ac_INSTALL&;t t
29311s&@MKDIR_P@&$ac_MKDIR_P&;t t
29312$ac_datarootdir_hack
29313"
d0ac1c44
SM
29314eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
29315 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
29316
29317test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
d0ac1c44
SM
29318 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
29319 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
29320 "$ac_tmp/out"`; test -z "$ac_out"; } &&
c971b7fa 29321 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 29322which seems to be undefined. Please make sure it is defined" >&5
c971b7fa 29323$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 29324which seems to be undefined. Please make sure it is defined" >&2;}
c971b7fa 29325
d0ac1c44 29326 rm -f "$ac_tmp/stdin"
c971b7fa 29327 case $ac_file in
d0ac1c44
SM
29328 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
29329 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
c971b7fa 29330 esac \
d0ac1c44 29331 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
29332 ;;
29333 :H)
29334 #
29335 # CONFIG_HEADER
29336 #
29337 if test x"$ac_file" != x-; then
29338 {
29339 $as_echo "/* $configure_input */" \
d0ac1c44
SM
29340 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
29341 } >"$ac_tmp/config.h" \
29342 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
29343 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
c971b7fa
PA
29344 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
29345$as_echo "$as_me: $ac_file is unchanged" >&6;}
29346 else
29347 rm -f "$ac_file"
d0ac1c44
SM
29348 mv "$ac_tmp/config.h" "$ac_file" \
29349 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
29350 fi
29351 else
29352 $as_echo "/* $configure_input */" \
d0ac1c44
SM
29353 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
29354 || as_fn_error $? "could not create -" "$LINENO" 5
c971b7fa
PA
29355 fi
29356# Compute "$ac_file"'s index in $config_headers.
29357_am_arg="$ac_file"
29358_am_stamp_count=1
29359for _am_header in $config_headers :; do
29360 case $_am_header in
29361 $_am_arg | $_am_arg:* )
29362 break ;;
29363 * )
29364 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
29365 esac
29366done
29367echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
29368$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
29369 X"$_am_arg" : 'X\(//\)[^/]' \| \
29370 X"$_am_arg" : 'X\(//\)$' \| \
29371 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
29372$as_echo X"$_am_arg" |
29373 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
29374 s//\1/
29375 q
29376 }
29377 /^X\(\/\/\)[^/].*/{
29378 s//\1/
29379 q
29380 }
29381 /^X\(\/\/\)$/{
29382 s//\1/
29383 q
29384 }
29385 /^X\(\/\).*/{
29386 s//\1/
29387 q
29388 }
29389 s/.*/./; q'`/stamp-h$_am_stamp_count
29390 ;;
29391
29392 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
29393$as_echo "$as_me: executing $ac_file commands" >&6;}
29394 ;;
29395 esac
29396
29397
29398 case $ac_file$ac_mode in
29399 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
d0ac1c44 29400 # Older Autoconf quotes --file arguments for eval, but not when files
c971b7fa
PA
29401 # are listed without --file. Let's play safe and only enable the eval
29402 # if we detect the quoting.
29403 case $CONFIG_FILES in
29404 *\'*) eval set x "$CONFIG_FILES" ;;
29405 *) set x $CONFIG_FILES ;;
29406 esac
29407 shift
29408 for mf
29409 do
29410 # Strip MF so we end up with the name of the file.
29411 mf=`echo "$mf" | sed -e 's/:.*$//'`
29412 # Check whether this is an Automake generated Makefile or not.
d0ac1c44 29413 # We used to match only the files named 'Makefile.in', but
c971b7fa
PA
29414 # some people rename them; so instead we look at the file content.
29415 # Grep'ing the first line is not enough: some people post-process
29416 # each Makefile.in and add a new line on top of each file to say so.
29417 # Grep'ing the whole file is not good either: AIX grep has a line
29418 # limit of 2048, but all sed's we know have understand at least 4000.
29419 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
29420 dirpart=`$as_dirname -- "$mf" ||
29421$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
29422 X"$mf" : 'X\(//\)[^/]' \| \
29423 X"$mf" : 'X\(//\)$' \| \
29424 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
29425$as_echo X"$mf" |
29426 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
29427 s//\1/
29428 q
29429 }
29430 /^X\(\/\/\)[^/].*/{
29431 s//\1/
29432 q
29433 }
29434 /^X\(\/\/\)$/{
29435 s//\1/
29436 q
29437 }
29438 /^X\(\/\).*/{
29439 s//\1/
29440 q
29441 }
29442 s/.*/./; q'`
29443 else
29444 continue
29445 fi
29446 # Extract the definition of DEPDIR, am__include, and am__quote
d0ac1c44 29447 # from the Makefile without running 'make'.
c971b7fa
PA
29448 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
29449 test -z "$DEPDIR" && continue
29450 am__include=`sed -n 's/^am__include = //p' < "$mf"`
d0ac1c44 29451 test -z "$am__include" && continue
c971b7fa 29452 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
c971b7fa
PA
29453 # Find all dependency output files, they are included files with
29454 # $(DEPDIR) in their names. We invoke sed twice because it is the
29455 # simplest approach to changing $(DEPDIR) to its actual value in the
29456 # expansion.
29457 for file in `sed -n "
29458 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
d0ac1c44 29459 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
c971b7fa
PA
29460 # Make sure the directory exists.
29461 test -f "$dirpart/$file" && continue
29462 fdir=`$as_dirname -- "$file" ||
29463$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
29464 X"$file" : 'X\(//\)[^/]' \| \
29465 X"$file" : 'X\(//\)$' \| \
29466 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
29467$as_echo X"$file" |
29468 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
29469 s//\1/
29470 q
29471 }
29472 /^X\(\/\/\)[^/].*/{
29473 s//\1/
29474 q
29475 }
29476 /^X\(\/\/\)$/{
29477 s//\1/
29478 q
29479 }
29480 /^X\(\/\).*/{
29481 s//\1/
29482 q
29483 }
29484 s/.*/./; q'`
29485 as_dir=$dirpart/$fdir; as_fn_mkdir_p
29486 # echo "creating $dirpart/$file"
29487 echo '# dummy' > "$dirpart/$file"
29488 done
29489 done
29490}
29491 ;;
29492 "default":C)
29493case x$CONFIG_HEADERS in
29494xconfig.h:config.in)
29495echo > stamp-h ;;
29496esac
29497 ;;
29498
29499 esac
29500done # for ac_tag
29501
29502
29503as_fn_exit 0
29504_ACEOF
29505ac_clean_files=$ac_clean_files_save
29506
29507test $ac_write_fail = 0 ||
d0ac1c44 29508 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
29509
29510
29511# configure is writing to config.log, and then calls config.status.
29512# config.status does its own redirection, appending to config.log.
29513# Unfortunately, on DOS this fails, as config.log is still kept open
29514# by configure, so config.status won't be able to write to it; its
29515# output is simply discarded. So we exec the FD to /dev/null,
29516# effectively closing config.log, so it can be properly (re)opened and
29517# appended to by config.status. When coming back to configure, we
29518# need to make the FD available again.
29519if test "$no_create" != yes; then
29520 ac_cs_success=:
29521 ac_config_status_args=
29522 test "$silent" = yes &&
29523 ac_config_status_args="$ac_config_status_args --quiet"
29524 exec 5>/dev/null
29525 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
29526 exec 5>>config.log
29527 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
29528 # would make configure fail if this is the last instruction.
d0ac1c44 29529 $ac_cs_success || as_fn_exit 1
c971b7fa
PA
29530fi
29531if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
29532 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
29533$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
29534fi
29535
29536
29537exit 0
This page took 2.274104 seconds and 4 git commands to generate.