Update Gnulib to the latest git version
[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:
6ec2e0f5
SDJ
6237 # Code from module d-ino:
6238 # Code from module d-type:
e26b6bb0 6239 # Code from module dirent:
18848e28 6240 # Code from module dirfd:
6a29c58e 6241 # Code from module dirname-lgpl:
2196f55f 6242 # Code from module dosname:
6a29c58e 6243 # Code from module double-slash-root:
6ec2e0f5
SDJ
6244 # Code from module dup:
6245 # Code from module dup2:
3d99e817 6246 # Code from module environ:
18848e28 6247 # Code from module errno:
6ec2e0f5
SDJ
6248 # Code from module error:
6249 # Code from module exitfail:
c971b7fa 6250 # Code from module extensions:
a512b375 6251 # Code from module extern-inline:
6ec2e0f5
SDJ
6252 # Code from module fchdir:
6253 # Code from module fcntl:
6254 # Code from module fcntl-h:
6255 # Code from module fd-hook:
c0c3707f 6256 # Code from module fd-safer-flag:
6ec2e0f5
SDJ
6257 # Code from module fdopendir:
6258 # Code from module filename:
6259 # Code from module filenamecat-lgpl:
49e4877c 6260 # Code from module flexmember:
88b48903 6261 # Code from module float:
8690e634
JK
6262 # Code from module fnmatch:
6263 # Code from module fnmatch-gnu:
c0c3707f 6264 # Code from module fnmatch-h:
88b48903
WN
6265 # Code from module fpieee:
6266
6267 # Code from module fpucw:
6268 # Code from module frexp:
6269 # Code from module frexpl:
6ec2e0f5
SDJ
6270 # Code from module fstat:
6271 # Code from module fstatat:
6272 # Code from module getcwd:
6273 # Code from module getcwd-lgpl:
6274 # Code from module getdtablesize:
6275 # Code from module getlogin_r:
6276 # Code from module getprogname:
6277 # Code from module gettext-h:
4a626d0a 6278 # Code from module gettimeofday:
6ec2e0f5 6279 # Code from module glob:
c0c3707f 6280 # Code from module glob-h:
49e4877c 6281 # Code from module hard-locale:
5abebf3c 6282 # Code from module havelib:
c971b7fa 6283 # Code from module include_next:
725e2999 6284 # Code from module inet_ntop:
6ec2e0f5 6285 # Code from module intprops:
c971b7fa
PA
6286 # Code from module inttypes:
6287 # Code from module inttypes-incomplete:
88b48903
WN
6288 # Code from module isnand-nolibm:
6289 # Code from module isnanl-nolibm:
2196f55f
YQ
6290 # Code from module largefile:
6291
c0c3707f 6292 # Code from module libc-config:
49e4877c 6293 # Code from module limits-h:
8690e634 6294 # Code from module localcharset:
c0c3707f 6295 # Code from module localtime-buffer:
5abebf3c 6296 # Code from module lock:
f45c62c4 6297 # Code from module lstat:
6a29c58e 6298 # Code from module malloc-posix:
98399780 6299 # Code from module malloca:
88b48903 6300 # Code from module math:
8690e634
JK
6301 # Code from module mbrtowc:
6302 # Code from module mbsinit:
6303 # Code from module mbsrtowcs:
c971b7fa
PA
6304 # Code from module memchr:
6305 # Code from module memmem:
6306 # Code from module memmem-simple:
6ec2e0f5
SDJ
6307 # Code from module mempcpy:
6308 # Code from module memrchr:
8a99096f 6309 # Code from module mkdir:
e8d8cce6 6310 # Code from module mkdtemp:
b3279b60 6311 # Code from module mkostemp:
6ec2e0f5
SDJ
6312 # Code from module msvc-inval:
6313 # Code from module msvc-nothrow:
c971b7fa 6314 # Code from module multiarch:
725e2999 6315 # Code from module netinet_in:
98399780 6316 # Code from module nocrash:
6ec2e0f5
SDJ
6317 # Code from module open:
6318 # Code from module openat:
6319 # Code from module openat-die:
6320 # Code from module openat-h:
6321 # Code from module opendir:
38ec2207 6322 # Code from module pathmax:
8424cc97 6323 # Code from module rawmemchr:
6ec2e0f5 6324 # Code from module readdir:
2196f55f 6325 # Code from module readlink:
6ec2e0f5 6326 # Code from module realloc-posix:
6a29c58e 6327 # Code from module rename:
6ec2e0f5 6328 # Code from module rewinddir:
6a29c58e
YQ
6329 # Code from module rmdir:
6330 # Code from module same-inode:
6ec2e0f5 6331 # Code from module save-cwd:
c0c3707f 6332 # Code from module scratch_buffer:
3d99e817 6333 # Code from module setenv:
0750520d 6334 # Code from module signal-h:
98399780 6335 # Code from module snippet/_Noreturn:
c971b7fa
PA
6336 # Code from module snippet/arg-nonnull:
6337 # Code from module snippet/c++defs:
6338 # Code from module snippet/warn-on-use:
725e2999 6339 # Code from module socklen:
8839a007 6340 # Code from module ssize_t:
2196f55f 6341 # Code from module stat:
c0c3707f
CB
6342 # Code from module stat-time:
6343 # Code from module std-gnu11:
725e2999 6344 # Code from module stdalign:
8690e634 6345 # Code from module stdbool:
c971b7fa
PA
6346 # Code from module stddef:
6347 # Code from module stdint:
6a29c58e 6348 # Code from module stdio:
98399780 6349 # Code from module stdlib:
8424cc97 6350 # Code from module strchrnul:
6ec2e0f5 6351 # Code from module strdup-posix:
8690e634 6352 # Code from module streq:
6ec2e0f5
SDJ
6353 # Code from module strerror:
6354 # Code from module strerror-override:
5abebf3c 6355 # Code from module strerror_r-posix:
c971b7fa 6356 # Code from module string:
8690e634 6357 # Code from module strnlen1:
63ce7108
TT
6358 # Code from module strstr:
6359 # Code from module strstr-simple:
421693b0 6360 # Code from module strtok_r:
725e2999 6361 # Code from module sys_socket:
09607c9e 6362 # Code from module sys_stat:
4a626d0a 6363 # Code from module sys_time:
8839a007 6364 # Code from module sys_types:
725e2999 6365 # Code from module sys_uio:
2d8adcbd 6366 # Code from module tempname:
5abebf3c
CB
6367 # Code from module threadlib:
6368
6369
6370
09607c9e 6371 # Code from module time:
f8e27d88 6372 # Code from module time_r:
8839a007 6373 # Code from module unistd:
6ec2e0f5 6374 # Code from module unistd-safer:
3d99e817 6375 # Code from module unsetenv:
c971b7fa 6376 # Code from module update-copyright:
8690e634
JK
6377 # Code from module verify:
6378 # Code from module wchar:
6379 # Code from module wctype-h:
c0c3707f
CB
6380 # Code from module windows-mutex:
6381 # Code from module windows-once:
6382 # Code from module windows-recmutex:
6383 # Code from module windows-rwlock:
6384 # Code from module xalloc-oversized:
c971b7fa 6385
c971b7fa 6386
c0c3707f 6387am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
c971b7fa 6388
c971b7fa 6389
c0c3707f
CB
6390{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
6391$as_echo_n "checking target system type... " >&6; }
6392if ${ac_cv_target+:} false; then :
c971b7fa
PA
6393 $as_echo_n "(cached) " >&6
6394else
c0c3707f
CB
6395 if test "x$target_alias" = x; then
6396 ac_cv_target=$ac_cv_host
5e8754f9 6397else
c0c3707f
CB
6398 ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
6399 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
5e8754f9 6400fi
7a6dbc2f 6401
c971b7fa 6402fi
c0c3707f
CB
6403{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
6404$as_echo "$ac_cv_target" >&6; }
6405case $ac_cv_target in
6406*-*-*) ;;
6407*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
6408esac
6409target=$ac_cv_target
6410ac_save_IFS=$IFS; IFS='-'
6411set x $ac_cv_target
6412shift
6413target_cpu=$1
6414target_vendor=$2
6415shift; shift
6416# Remember, the first character of IFS is used to create $*,
6417# except with old shells:
6418target_os=$*
6419IFS=$ac_save_IFS
6420case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
7a6dbc2f 6421
5e8754f9 6422
c0c3707f
CB
6423# The aliases save the names the user supplied, while $host etc.
6424# will get canonicalized.
6425test -n "$target_alias" &&
6426 test "$program_prefix$program_suffix$program_transform_name" = \
6427 NONENONEs,x,x, &&
6428 program_prefix=${target_alias}-
7a6dbc2f 6429
c0c3707f
CB
6430# The tests for host and target for $enable_largefile require
6431# canonical names.
7a6dbc2f 6432
5e8754f9 6433
c0c3707f
CB
6434
6435# As the $enable_largefile decision depends on --enable-plugins we must set it
6436# even in directories otherwise not depending on the $plugins option.
7a6dbc2f 6437
7a6dbc2f 6438
c0c3707f
CB
6439 maybe_plugins=no
6440 for ac_header in dlfcn.h
6441do :
6442 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
6443"
6444if test "x$ac_cv_header_dlfcn_h" = xyes; then :
6445 cat >>confdefs.h <<_ACEOF
6446#define HAVE_DLFCN_H 1
6447_ACEOF
6448 maybe_plugins=yes
c971b7fa 6449fi
c0c3707f 6450
5e8754f9 6451done
5e8754f9 6452
c0c3707f
CB
6453 for ac_header in windows.h
6454do :
6455 ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
6456"
6457if test "x$ac_cv_header_windows_h" = xyes; then :
6458 cat >>confdefs.h <<_ACEOF
6459#define HAVE_WINDOWS_H 1
6460_ACEOF
6461 maybe_plugins=yes
c971b7fa 6462fi
7a6dbc2f 6463
c0c3707f
CB
6464done
6465
6466
6467 # Check whether --enable-plugins was given.
6468if test "${enable_plugins+set}" = set; then :
6469 enableval=$enable_plugins; case "${enableval}" in
6470 no) plugins=no ;;
6471 *) plugins=yes
6472 if test "$maybe_plugins" != "yes" ; then
6473 as_fn_error $? "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
6474 fi ;;
6475 esac
6476else
6477 plugins=$maybe_plugins
5e8754f9 6478
5e8754f9 6479fi
c0c3707f
CB
6480
6481 if test "$plugins" = "yes"; then
6482 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5
6483$as_echo_n "checking for library containing dlsym... " >&6; }
6484if ${ac_cv_search_dlsym+:} false; then :
c971b7fa
PA
6485 $as_echo_n "(cached) " >&6
6486else
c0c3707f
CB
6487 ac_func_search_save_LIBS=$LIBS
6488cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6489/* end confdefs.h. */
6490
6491/* Override any GCC internal prototype to avoid an error.
6492 Use char because int might match the return type of a GCC
6493 builtin and then its argument prototype would still apply. */
6494#ifdef __cplusplus
6495extern "C"
6496#endif
6497char dlsym ();
6498int
6499main ()
6500{
6501return dlsym ();
6502 ;
6503 return 0;
6504}
6505_ACEOF
6506for ac_lib in '' dl; do
6507 if test -z "$ac_lib"; then
6508 ac_res="none required"
6509 else
6510 ac_res=-l$ac_lib
6511 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
5e8754f9 6512 fi
c0c3707f
CB
6513 if ac_fn_c_try_link "$LINENO"; then :
6514 ac_cv_search_dlsym=$ac_res
6515fi
6516rm -f core conftest.err conftest.$ac_objext \
6517 conftest$ac_exeext
6518 if ${ac_cv_search_dlsym+:} false; then :
6519 break
6520fi
5e8754f9 6521done
c0c3707f 6522if ${ac_cv_search_dlsym+:} false; then :
5e8754f9 6523
c0c3707f
CB
6524else
6525 ac_cv_search_dlsym=no
5e8754f9 6526fi
c0c3707f
CB
6527rm conftest.$ac_ext
6528LIBS=$ac_func_search_save_LIBS
5e8754f9 6529fi
c0c3707f
CB
6530{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5
6531$as_echo "$ac_cv_search_dlsym" >&6; }
6532ac_res=$ac_cv_search_dlsym
6533if test "$ac_res" != no; then :
6534 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6535
5e8754f9
SDJ
6536fi
6537
c0c3707f 6538 fi
5e8754f9 6539
5e8754f9 6540
c0c3707f
CB
6541case "${host}" in
6542 sparc-*-solaris*|i[3-7]86-*-solaris*)
6543 # On native 32bit sparc and ia32 solaris, large-file and procfs support
6544 # are mutually exclusive; and without procfs support, the bfd/ elf module
6545 # cannot provide certain routines such as elfcore_write_prpsinfo
6546 # or elfcore_write_prstatus. So unless the user explicitly requested
6547 # large-file support through the --enable-largefile switch, disable
6548 # large-file support in favor of procfs support.
6549 test "${target}" = "${host}" -a "x$plugins" = xno \
6550 && : ${enable_largefile="no"}
6551 ;;
5e8754f9 6552esac
5e8754f9 6553
c0c3707f
CB
6554# Check whether --enable-largefile was given.
6555if test "${enable_largefile+set}" = set; then :
6556 enableval=$enable_largefile;
5e8754f9
SDJ
6557fi
6558
c0c3707f 6559if test "$enable_largefile" != no; then
5e8754f9 6560
c0c3707f
CB
6561 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
6562$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
6563if ${ac_cv_sys_largefile_CC+:} false; then :
5e8754f9 6564 $as_echo_n "(cached) " >&6
7a6dbc2f 6565else
c0c3707f
CB
6566 ac_cv_sys_largefile_CC=no
6567 if test "$GCC" != yes; then
6568 ac_save_CC=$CC
6569 while :; do
6570 # IRIX 6.2 and later do not support large files by default,
6571 # so use the C compiler's -n32 option if that helps.
6572 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 6573/* end confdefs.h. */
c0c3707f
CB
6574#include <sys/types.h>
6575 /* Check that off_t can represent 2**63 - 1 correctly.
6576 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6577 since some C++ compilers masquerading as C compilers
6578 incorrectly reject 9223372036854775807. */
6579#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6580 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6581 && LARGE_OFF_T % 2147483647 == 1)
6582 ? 1 : -1];
c971b7fa 6583int
5e8754f9 6584main ()
c971b7fa 6585{
5e8754f9
SDJ
6586
6587 ;
6588 return 0;
c971b7fa
PA
6589}
6590_ACEOF
c0c3707f
CB
6591 if ac_fn_c_try_compile "$LINENO"; then :
6592 break
c971b7fa 6593fi
c0c3707f
CB
6594rm -f core conftest.err conftest.$ac_objext
6595 CC="$CC -n32"
6596 if ac_fn_c_try_compile "$LINENO"; then :
6597 ac_cv_sys_largefile_CC=' -n32'; break
c971b7fa 6598fi
c0c3707f
CB
6599rm -f core conftest.err conftest.$ac_objext
6600 break
6601 done
6602 CC=$ac_save_CC
6603 rm -f conftest.$ac_ext
6604 fi
d0ac1c44 6605fi
c0c3707f
CB
6606{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
6607$as_echo "$ac_cv_sys_largefile_CC" >&6; }
6608 if test "$ac_cv_sys_largefile_CC" != no; then
6609 CC=$CC$ac_cv_sys_largefile_CC
6610 fi
6611
6612 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
6613$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
6614if ${ac_cv_sys_file_offset_bits+:} false; then :
5e8754f9
SDJ
6615 $as_echo_n "(cached) " >&6
6616else
c0c3707f
CB
6617 while :; do
6618 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 6619/* end confdefs.h. */
c0c3707f
CB
6620#include <sys/types.h>
6621 /* Check that off_t can represent 2**63 - 1 correctly.
6622 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6623 since some C++ compilers masquerading as C compilers
6624 incorrectly reject 9223372036854775807. */
6625#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6626 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6627 && LARGE_OFF_T % 2147483647 == 1)
6628 ? 1 : -1];
5e8754f9
SDJ
6629int
6630main ()
6631{
c971b7fa 6632
5e8754f9
SDJ
6633 ;
6634 return 0;
6635}
6636_ACEOF
6637if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
6638 ac_cv_sys_file_offset_bits=no; break
6639fi
6640rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6641 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 6642/* end confdefs.h. */
c0c3707f
CB
6643#define _FILE_OFFSET_BITS 64
6644#include <sys/types.h>
6645 /* Check that off_t can represent 2**63 - 1 correctly.
6646 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6647 since some C++ compilers masquerading as C compilers
6648 incorrectly reject 9223372036854775807. */
6649#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6650 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6651 && LARGE_OFF_T % 2147483647 == 1)
6652 ? 1 : -1];
5e8754f9
SDJ
6653int
6654main ()
6655{
c971b7fa 6656
5e8754f9
SDJ
6657 ;
6658 return 0;
6659}
6660_ACEOF
6661if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
6662 ac_cv_sys_file_offset_bits=64; break
6663fi
6664rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6665 ac_cv_sys_file_offset_bits=unknown
6666 break
6667done
6668fi
6669{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
6670$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
6671case $ac_cv_sys_file_offset_bits in #(
6672 no | unknown) ;;
6673 *)
6674cat >>confdefs.h <<_ACEOF
6675#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
6676_ACEOF
6677;;
6678esac
6679rm -rf conftest*
6680 if test $ac_cv_sys_file_offset_bits = unknown; then
6681 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
6682$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
6683if ${ac_cv_sys_large_files+:} false; then :
6684 $as_echo_n "(cached) " >&6
5e8754f9 6685else
c0c3707f
CB
6686 while :; do
6687 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 6688/* end confdefs.h. */
c0c3707f
CB
6689#include <sys/types.h>
6690 /* Check that off_t can represent 2**63 - 1 correctly.
6691 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6692 since some C++ compilers masquerading as C compilers
6693 incorrectly reject 9223372036854775807. */
6694#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6695 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6696 && LARGE_OFF_T % 2147483647 == 1)
6697 ? 1 : -1];
5e8754f9
SDJ
6698int
6699main ()
6700{
c971b7fa 6701
5e8754f9
SDJ
6702 ;
6703 return 0;
6704}
7a6dbc2f 6705_ACEOF
5e8754f9 6706if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 6707 ac_cv_sys_large_files=no; break
5e8754f9
SDJ
6708fi
6709rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f
CB
6710 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6711/* end confdefs.h. */
6712#define _LARGE_FILES 1
6713#include <sys/types.h>
6714 /* Check that off_t can represent 2**63 - 1 correctly.
6715 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6716 since some C++ compilers masquerading as C compilers
6717 incorrectly reject 9223372036854775807. */
6718#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
6719 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6720 && LARGE_OFF_T % 2147483647 == 1)
6721 ? 1 : -1];
6722int
6723main ()
6724{
6725
6726 ;
6727 return 0;
6728}
6729_ACEOF
6730if ac_fn_c_try_compile "$LINENO"; then :
6731 ac_cv_sys_large_files=1; break
5e8754f9
SDJ
6732fi
6733rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f
CB
6734 ac_cv_sys_large_files=unknown
6735 break
6736done
5e8754f9 6737fi
c0c3707f
CB
6738{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
6739$as_echo "$ac_cv_sys_large_files" >&6; }
6740case $ac_cv_sys_large_files in #(
6741 no | unknown) ;;
6742 *)
6743cat >>confdefs.h <<_ACEOF
6744#define _LARGE_FILES $ac_cv_sys_large_files
6745_ACEOF
6746;;
6747esac
6748rm -rf conftest*
5e8754f9 6749 fi
c0c3707f
CB
6750
6751
6752$as_echo "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h
6753
5e8754f9 6754fi
c971b7fa
PA
6755
6756
6757
c0c3707f
CB
6758ac_aux_dir=
6759for ac_dir in .. "$srcdir"/..; do
6760 if test -f "$ac_dir/install-sh"; then
6761 ac_aux_dir=$ac_dir
6762 ac_install_sh="$ac_aux_dir/install-sh -c"
6763 break
6764 elif test -f "$ac_dir/install.sh"; then
6765 ac_aux_dir=$ac_dir
6766 ac_install_sh="$ac_aux_dir/install.sh -c"
6767 break
6768 elif test -f "$ac_dir/shtool"; then
6769 ac_aux_dir=$ac_dir
6770 ac_install_sh="$ac_aux_dir/shtool install -c"
6771 break
6772 fi
6773done
6774if test -z "$ac_aux_dir"; then
6775 as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5
6776fi
6777
6778# These three variables are undocumented and unsupported,
6779# and are intended to be withdrawn in a future Autoconf release.
6780# They can cause serious problems if a builder's source tree is in a directory
6781# whose full name contains unusual characters.
6782ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
6783ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
6784ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795 # Check whether --enable-cross-guesses was given.
6796if test "${enable_cross_guesses+set}" = set; then :
6797 enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
6798 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5
6799$as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;}
6800 enableval=conservative
6801 fi
6802 gl_cross_guesses="$enableval"
6803else
6804 gl_cross_guesses=conservative
6805fi
6806
6807 if test $gl_cross_guesses = risky; then
6808 gl_cross_guess_normal="guessing yes"
6809 gl_cross_guess_inverted="guessing no"
6810 else
6811 gl_cross_guess_normal="guessing no"
6812 gl_cross_guess_inverted="guessing yes"
6813 fi
6814 LIBC_FATAL_STDERR_=1
6815 export LIBC_FATAL_STDERR_
6816
6817ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
6818if test "x$ac_cv_type_size_t" = xyes; then :
6819
6820else
6821
6822cat >>confdefs.h <<_ACEOF
6823#define size_t unsigned int
6824_ACEOF
6825
6826fi
6827
6828# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
6829# for constant arguments. Useless!
6830{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
6831$as_echo_n "checking for working alloca.h... " >&6; }
6832if ${ac_cv_working_alloca_h+:} false; then :
6833 $as_echo_n "(cached) " >&6
6834else
6835 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6836/* end confdefs.h. */
6837#include <alloca.h>
5e8754f9
SDJ
6838int
6839main ()
6840{
c0c3707f
CB
6841char *p = (char *) alloca (2 * sizeof (int));
6842 if (p) return 0;
5e8754f9
SDJ
6843 ;
6844 return 0;
6845}
6846_ACEOF
c0c3707f
CB
6847if ac_fn_c_try_link "$LINENO"; then :
6848 ac_cv_working_alloca_h=yes
6849else
6850 ac_cv_working_alloca_h=no
5e8754f9 6851fi
c0c3707f
CB
6852rm -f core conftest.err conftest.$ac_objext \
6853 conftest$ac_exeext conftest.$ac_ext
5e8754f9 6854fi
c0c3707f
CB
6855{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
6856$as_echo "$ac_cv_working_alloca_h" >&6; }
6857if test $ac_cv_working_alloca_h = yes; then
c971b7fa 6858
c0c3707f 6859$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
c971b7fa 6860
c0c3707f 6861fi
d0ac1c44 6862
c0c3707f
CB
6863{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
6864$as_echo_n "checking for alloca... " >&6; }
6865if ${ac_cv_func_alloca_works+:} false; then :
5e8754f9
SDJ
6866 $as_echo_n "(cached) " >&6
6867else
6868 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6869/* end confdefs.h. */
c0c3707f
CB
6870#ifdef __GNUC__
6871# define alloca __builtin_alloca
6872#else
6873# ifdef _MSC_VER
6874# include <malloc.h>
6875# define alloca _alloca
6876# else
6877# ifdef HAVE_ALLOCA_H
6878# include <alloca.h>
6879# else
6880# ifdef _AIX
6881 #pragma alloca
6882# else
6883# ifndef alloca /* predefined by HP cc +Olibcalls */
6884void *alloca (size_t);
6885# endif
6886# endif
6887# endif
6888# endif
6889#endif
d0ac1c44 6890
5e8754f9
SDJ
6891int
6892main ()
6893{
c0c3707f
CB
6894char *p = (char *) alloca (1);
6895 if (p) return 0;
5e8754f9
SDJ
6896 ;
6897 return 0;
6898}
6899_ACEOF
c0c3707f
CB
6900if ac_fn_c_try_link "$LINENO"; then :
6901 ac_cv_func_alloca_works=yes
6902else
6903 ac_cv_func_alloca_works=no
5e8754f9 6904fi
c0c3707f
CB
6905rm -f core conftest.err conftest.$ac_objext \
6906 conftest$ac_exeext conftest.$ac_ext
6907fi
6908{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
6909$as_echo "$ac_cv_func_alloca_works" >&6; }
7a6dbc2f 6910
c0c3707f 6911if test $ac_cv_func_alloca_works = yes; then
7a6dbc2f 6912
c0c3707f 6913$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
7a6dbc2f 6914
5e8754f9 6915else
c0c3707f
CB
6916 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
6917# that cause trouble. Some versions do not even contain alloca or
6918# contain a buggy version. If you still want to use their alloca,
6919# use ar to extract alloca.o from them instead of compiling alloca.c.
c971b7fa
PA
6920
6921
7a6dbc2f 6922
73cc7272
TT
6923
6924
c0c3707f 6925ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
73cc7272 6926
c0c3707f 6927$as_echo "#define C_ALLOCA 1" >>confdefs.h
73cc7272
TT
6928
6929
c0c3707f
CB
6930{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
6931$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
6932if ${ac_cv_os_cray+:} false; then :
6933 $as_echo_n "(cached) " >&6
6934else
6935 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6936/* end confdefs.h. */
6937#if defined CRAY && ! defined CRAY2
6938webecray
6939#else
6940wenotbecray
6941#endif
73cc7272 6942
73cc7272 6943_ACEOF
c0c3707f
CB
6944if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6945 $EGREP "webecray" >/dev/null 2>&1; then :
6946 ac_cv_os_cray=yes
6947else
6948 ac_cv_os_cray=no
73cc7272 6949fi
c0c3707f 6950rm -f conftest*
73cc7272 6951
c0c3707f
CB
6952fi
6953{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
6954$as_echo "$ac_cv_os_cray" >&6; }
6955if test $ac_cv_os_cray = yes; then
6956 for ac_func in _getb67 GETB67 getb67; do
6957 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
6958ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
6959if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
73cc7272 6960
c0c3707f
CB
6961cat >>confdefs.h <<_ACEOF
6962#define CRAY_STACKSEG_END $ac_func
6963_ACEOF
73cc7272 6964
c0c3707f
CB
6965 break
6966fi
73cc7272 6967
c0c3707f 6968 done
73cc7272
TT
6969fi
6970
c0c3707f
CB
6971{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
6972$as_echo_n "checking stack direction for C alloca... " >&6; }
6973if ${ac_cv_c_stack_direction+:} false; then :
73cc7272
TT
6974 $as_echo_n "(cached) " >&6
6975else
c0c3707f
CB
6976 if test "$cross_compiling" = yes; then :
6977 ac_cv_c_stack_direction=0
6978else
6979 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 6980/* end confdefs.h. */
c0c3707f
CB
6981$ac_includes_default
6982int
6983find_stack_direction (int *addr, int depth)
6984{
6985 int dir, dummy = 0;
6986 if (! addr)
6987 addr = &dummy;
6988 *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
6989 dir = depth ? find_stack_direction (addr, depth - 1) : 0;
6990 return dir + dummy;
6991}
73cc7272 6992
73cc7272 6993int
c0c3707f 6994main (int argc, char **argv)
73cc7272 6995{
c0c3707f 6996 return find_stack_direction (0, argc + !argv + 20) < 0;
73cc7272
TT
6997}
6998_ACEOF
c0c3707f
CB
6999if ac_fn_c_try_run "$LINENO"; then :
7000 ac_cv_c_stack_direction=1
7001else
7002 ac_cv_c_stack_direction=-1
73cc7272 7003fi
c0c3707f
CB
7004rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7005 conftest.$ac_objext conftest.beam conftest.$ac_ext
73cc7272 7006fi
73cc7272 7007
73cc7272 7008fi
c0c3707f
CB
7009{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
7010$as_echo "$ac_cv_c_stack_direction" >&6; }
7011cat >>confdefs.h <<_ACEOF
7012#define STACK_DIRECTION $ac_cv_c_stack_direction
7013_ACEOF
7014
73cc7272
TT
7015
7016fi
7017
73cc7272 7018
c0c3707f
CB
7019 GNULIB_INET_NTOP=0;
7020 GNULIB_INET_PTON=0;
7021 HAVE_DECL_INET_NTOP=1;
7022 HAVE_DECL_INET_PTON=1;
7023 REPLACE_INET_NTOP=0;
7024 REPLACE_INET_PTON=0;
73cc7272 7025
73cc7272 7026
c0c3707f
CB
7027
7028
7029 for ac_header in $ac_header_list
7030do :
7031 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7032ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7033"
7034if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7035 cat >>confdefs.h <<_ACEOF
7036#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7037_ACEOF
7038
73cc7272
TT
7039fi
7040
c0c3707f 7041done
73cc7272 7042
c0c3707f
CB
7043
7044
7045
7046
7047 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
7048$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
7049if ${gl_cv_have_include_next+:} false; then :
73cc7272
TT
7050 $as_echo_n "(cached) " >&6
7051else
c0c3707f
CB
7052 rm -rf conftestd1a conftestd1b conftestd2
7053 mkdir conftestd1a conftestd1b conftestd2
7054 cat <<EOF > conftestd1a/conftest.h
7055#define DEFINED_IN_CONFTESTD1
7056#include_next <conftest.h>
7057#ifdef DEFINED_IN_CONFTESTD2
7058int foo;
7059#else
7060#error "include_next doesn't work"
7061#endif
7062EOF
7063 cat <<EOF > conftestd1b/conftest.h
7064#define DEFINED_IN_CONFTESTD1
7065#include <stdio.h>
7066#include_next <conftest.h>
7067#ifdef DEFINED_IN_CONFTESTD2
7068int foo;
7069#else
7070#error "include_next doesn't work"
7071#endif
7072EOF
7073 cat <<EOF > conftestd2/conftest.h
7074#ifndef DEFINED_IN_CONFTESTD1
7075#error "include_next test doesn't work"
7076#endif
7077#define DEFINED_IN_CONFTESTD2
7078EOF
7079 gl_save_CPPFLAGS="$CPPFLAGS"
7080 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
7081 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7082/* end confdefs.h. */
c0c3707f 7083#include <conftest.h>
73cc7272 7084_ACEOF
c0c3707f
CB
7085if ac_fn_c_try_compile "$LINENO"; then :
7086 gl_cv_have_include_next=yes
7087else
7088 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
7089 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7090/* end confdefs.h. */
7091#include <conftest.h>
7092_ACEOF
7093if ac_fn_c_try_compile "$LINENO"; then :
7094 gl_cv_have_include_next=buggy
7095else
7096 gl_cv_have_include_next=no
73cc7272 7097fi
c0c3707f
CB
7098rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7099
73cc7272 7100fi
c0c3707f
CB
7101rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7102 CPPFLAGS="$gl_save_CPPFLAGS"
7103 rm -rf conftestd1a conftestd1b conftestd2
7104
73cc7272 7105fi
c0c3707f
CB
7106{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
7107$as_echo "$gl_cv_have_include_next" >&6; }
7108 PRAGMA_SYSTEM_HEADER=
7109 if test $gl_cv_have_include_next = yes; then
7110 INCLUDE_NEXT=include_next
7111 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7112 if test -n "$GCC"; then
7113 PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
7114 fi
7115 else
7116 if test $gl_cv_have_include_next = buggy; then
7117 INCLUDE_NEXT=include
7118 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
7119 else
7120 INCLUDE_NEXT=include
7121 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
7122 fi
73cc7272
TT
7123 fi
7124
73cc7272 7125
73cc7272 7126
c0c3707f
CB
7127 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5
7128$as_echo_n "checking whether system header files limit the line length... " >&6; }
7129if ${gl_cv_pragma_columns+:} false; then :
73cc7272
TT
7130 $as_echo_n "(cached) " >&6
7131else
c0c3707f 7132 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
73cc7272 7133/* end confdefs.h. */
73cc7272 7134
c0c3707f
CB
7135#ifdef __TANDEM
7136choke me
7137#endif
73cc7272 7138
73cc7272 7139_ACEOF
c0c3707f
CB
7140if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7141 $EGREP "choke me" >/dev/null 2>&1; then :
7142 gl_cv_pragma_columns=yes
7143else
7144 gl_cv_pragma_columns=no
73cc7272 7145fi
c0c3707f 7146rm -f conftest*
73cc7272 7147
73cc7272
TT
7148
7149fi
c0c3707f
CB
7150{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5
7151$as_echo "$gl_cv_pragma_columns" >&6; }
7152 if test $gl_cv_pragma_columns = yes; then
7153 PRAGMA_COLUMNS="#pragma COLUMNS 10000"
7154 else
7155 PRAGMA_COLUMNS=
7156 fi
73cc7272
TT
7157
7158
7159
73cc7272 7160
73cc7272
TT
7161
7162
c0c3707f
CB
7163 if test $ac_cv_header_features_h = yes; then
7164 HAVE_FEATURES_H=1
7165 else
7166 HAVE_FEATURES_H=0
7167 fi
73cc7272 7168
7a6dbc2f
SDJ
7169
7170
7171
7172
c0c3707f
CB
7173 if test $ac_cv_header_sys_socket_h = no; then
7174 for ac_header in ws2tcpip.h
7175do :
7176 ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
7177if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
7178 cat >>confdefs.h <<_ACEOF
7179#define HAVE_WS2TCPIP_H 1
7180_ACEOF
7a6dbc2f 7181
c0c3707f 7182fi
7a6dbc2f 7183
c0c3707f 7184done
7a6dbc2f 7185
c0c3707f 7186 fi
7a6dbc2f 7187
c0c3707f
CB
7188{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7189$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7190if test -z "$MKDIR_P"; then
7191 if ${ac_cv_path_mkdir+:} false; then :
7192 $as_echo_n "(cached) " >&6
5e8754f9 7193else
c0c3707f
CB
7194 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7195for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7196do
7197 IFS=$as_save_IFS
7198 test -z "$as_dir" && as_dir=.
7199 for ac_prog in mkdir gmkdir; do
7200 for ac_exec_ext in '' $ac_executable_extensions; do
7201 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7202 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7203 'mkdir (GNU coreutils) '* | \
7204 'mkdir (coreutils) '* | \
7205 'mkdir (fileutils) '4.1*)
7206 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7207 break 3;;
7208 esac
7209 done
7210 done
7211 done
7212IFS=$as_save_IFS
7a6dbc2f 7213
5e8754f9 7214fi
7a6dbc2f 7215
c0c3707f
CB
7216 test -d ./--version && rmdir ./--version
7217 if test "${ac_cv_path_mkdir+set}" = set; then
7218 MKDIR_P="$ac_cv_path_mkdir -p"
7219 else
7220 # As a last resort, use the slow shell script. Don't cache a
7221 # value for MKDIR_P within a source directory, because that will
7222 # break other packages using the cache if that directory is
7223 # removed, or if the value is a relative name.
7224 MKDIR_P="$ac_install_sh -d"
7225 fi
5e8754f9 7226fi
c0c3707f
CB
7227{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7228$as_echo "$MKDIR_P" >&6; }
7a6dbc2f 7229
5e8754f9 7230
c0c3707f
CB
7231 GNULIB__EXIT=0;
7232 GNULIB_ATOLL=0;
7233 GNULIB_CALLOC_POSIX=0;
7234 GNULIB_CANONICALIZE_FILE_NAME=0;
7235 GNULIB_GETLOADAVG=0;
7236 GNULIB_GETSUBOPT=0;
7237 GNULIB_GRANTPT=0;
7238 GNULIB_MALLOC_POSIX=0;
7239 GNULIB_MBTOWC=0;
7240 GNULIB_MKDTEMP=0;
7241 GNULIB_MKOSTEMP=0;
7242 GNULIB_MKOSTEMPS=0;
7243 GNULIB_MKSTEMP=0;
7244 GNULIB_MKSTEMPS=0;
7245 GNULIB_POSIX_OPENPT=0;
7246 GNULIB_PTSNAME=0;
7247 GNULIB_PTSNAME_R=0;
7248 GNULIB_PUTENV=0;
7249 GNULIB_QSORT_R=0;
7250 GNULIB_RANDOM=0;
7251 GNULIB_RANDOM_R=0;
7252 GNULIB_REALLOCARRAY=0;
7253 GNULIB_REALLOC_POSIX=0;
7254 GNULIB_REALPATH=0;
7255 GNULIB_RPMATCH=0;
7256 GNULIB_SECURE_GETENV=0;
7257 GNULIB_SETENV=0;
7258 GNULIB_STRTOD=0;
7259 GNULIB_STRTOLD=0;
7260 GNULIB_STRTOLL=0;
7261 GNULIB_STRTOULL=0;
7262 GNULIB_SYSTEM_POSIX=0;
7263 GNULIB_UNLOCKPT=0;
7264 GNULIB_UNSETENV=0;
7265 GNULIB_WCTOMB=0;
7266 HAVE__EXIT=1;
7267 HAVE_ATOLL=1;
7268 HAVE_CANONICALIZE_FILE_NAME=1;
7269 HAVE_DECL_GETLOADAVG=1;
7270 HAVE_GETSUBOPT=1;
7271 HAVE_GRANTPT=1;
7272 HAVE_INITSTATE=1;
7273 HAVE_DECL_INITSTATE=1;
7274 HAVE_MBTOWC=1;
7275 HAVE_MKDTEMP=1;
7276 HAVE_MKOSTEMP=1;
7277 HAVE_MKOSTEMPS=1;
7278 HAVE_MKSTEMP=1;
7279 HAVE_MKSTEMPS=1;
7280 HAVE_POSIX_OPENPT=1;
7281 HAVE_PTSNAME=1;
7282 HAVE_PTSNAME_R=1;
7283 HAVE_QSORT_R=1;
7284 HAVE_RANDOM=1;
7285 HAVE_RANDOM_H=1;
7286 HAVE_RANDOM_R=1;
7287 HAVE_REALLOCARRAY=1;
7288 HAVE_REALPATH=1;
7289 HAVE_RPMATCH=1;
7290 HAVE_SECURE_GETENV=1;
7291 HAVE_SETENV=1;
7292 HAVE_DECL_SETENV=1;
7293 HAVE_SETSTATE=1;
7294 HAVE_DECL_SETSTATE=1;
7295 HAVE_STRTOD=1;
7296 HAVE_STRTOLD=1;
7297 HAVE_STRTOLL=1;
7298 HAVE_STRTOULL=1;
7299 HAVE_STRUCT_RANDOM_DATA=1;
7300 HAVE_SYS_LOADAVG_H=0;
7301 HAVE_UNLOCKPT=1;
7302 HAVE_DECL_UNSETENV=1;
7303 REPLACE_CALLOC=0;
7304 REPLACE_CANONICALIZE_FILE_NAME=0;
7305 REPLACE_INITSTATE=0;
7306 REPLACE_MALLOC=0;
7307 REPLACE_MBTOWC=0;
7308 REPLACE_MKSTEMP=0;
7309 REPLACE_PTSNAME=0;
7310 REPLACE_PTSNAME_R=0;
7311 REPLACE_PUTENV=0;
7312 REPLACE_QSORT_R=0;
7313 REPLACE_RANDOM=0;
7314 REPLACE_RANDOM_R=0;
7315 REPLACE_REALLOC=0;
7316 REPLACE_REALPATH=0;
7317 REPLACE_SETENV=0;
7318 REPLACE_SETSTATE=0;
7319 REPLACE_STRTOD=0;
7320 REPLACE_STRTOLD=0;
7321 REPLACE_UNSETENV=0;
7322 REPLACE_WCTOMB=0;
7a6dbc2f 7323
7a6dbc2f 7324
98399780 7325
98399780 7326
c0c3707f
CB
7327 for ac_func in $ac_func_list
7328do :
7329 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
7330ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
7331if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
7332 cat >>confdefs.h <<_ACEOF
7333#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
7334_ACEOF
472fa5ee 7335
c0c3707f
CB
7336fi
7337done
472fa5ee
SM
7338
7339
7340
7341
7342
7343
7344
7345
7346
c0c3707f
CB
7347 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
7348$as_echo_n "checking whether // is distinct from /... " >&6; }
7349if ${gl_cv_double_slash_root+:} false; then :
7350 $as_echo_n "(cached) " >&6
5e8754f9 7351else
c0c3707f
CB
7352 if test x"$cross_compiling" = xyes ; then
7353 # When cross-compiling, there is no way to tell whether // is special
7354 # short of a list of hosts. However, the only known hosts to date
7355 # that have a distinct // are Apollo DomainOS (too old to port to),
7356 # Cygwin, and z/OS. If anyone knows of another system for which // has
7357 # special semantics and is distinct from /, please report it to
7358 # <bug-gnulib@gnu.org>.
7359 case $host in
7360 *-cygwin | i370-ibm-openedition)
7361 gl_cv_double_slash_root=yes ;;
7362 *)
7363 # Be optimistic and assume that / and // are the same when we
7364 # don't know.
7365 gl_cv_double_slash_root='unknown, assuming no' ;;
7366 esac
7367 else
7368 set x `ls -di / // 2>/dev/null`
7369 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
7370 gl_cv_double_slash_root=no
7371 else
7372 gl_cv_double_slash_root=yes
7373 fi
7374 fi
5e8754f9 7375fi
c0c3707f
CB
7376{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
7377$as_echo "$gl_cv_double_slash_root" >&6; }
7378 if test "$gl_cv_double_slash_root" = yes; then
472fa5ee 7379
c0c3707f 7380$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
472fa5ee 7381
c0c3707f 7382 fi
472fa5ee
SM
7383
7384
472fa5ee 7385
c0c3707f
CB
7386
7387
7388 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5
7389$as_echo_n "checking whether realpath works... " >&6; }
7390if ${gl_cv_func_realpath_works+:} false; then :
5e8754f9
SDJ
7391 $as_echo_n "(cached) " >&6
7392else
c0c3707f
CB
7393
7394 touch conftest.a
7395 mkdir conftest.d
7396 if test "$cross_compiling" = yes; then :
7397 case "$host_os" in
7398 # Guess yes on glibc systems.
7399 *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
7400 # Guess yes on musl systems.
7401 *-musl*) gl_cv_func_realpath_works="guessing yes" ;;
7402 # Guess no on native Windows.
7403 mingw*) gl_cv_func_realpath_works="guessing no" ;;
7404 # If we don't know, obey --enable-cross-guesses.
7405 *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
7406 esac
7407
5e8754f9
SDJ
7408else
7409 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7410/* end confdefs.h. */
c0c3707f
CB
7411
7412
7413
7414#include <stdlib.h>
7415#if defined __MACH__ && defined __APPLE__
7416/* Avoid a crash on Mac OS X. */
7417#include <mach/mach.h>
7418#include <mach/mach_error.h>
7419#include <mach/thread_status.h>
7420#include <mach/exception.h>
7421#include <mach/task.h>
7422#include <pthread.h>
7423/* The exception port on which our thread listens. */
7424static mach_port_t our_exception_port;
7425/* The main function of the thread listening for exceptions of type
7426 EXC_BAD_ACCESS. */
7427static void *
7428mach_exception_thread (void *arg)
5e8754f9 7429{
c0c3707f
CB
7430 /* Buffer for a message to be received. */
7431 struct {
7432 mach_msg_header_t head;
7433 mach_msg_body_t msgh_body;
7434 char data[1024];
7435 } msg;
7436 mach_msg_return_t retval;
7437 /* Wait for a message on the exception port. */
7438 retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
7439 our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
7440 if (retval != MACH_MSG_SUCCESS)
7441 abort ();
7442 exit (1);
7443}
7444static void
7445nocrash_init (void)
7446{
7447 mach_port_t self = mach_task_self ();
7448 /* Allocate a port on which the thread shall listen for exceptions. */
7449 if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
7450 == KERN_SUCCESS) {
7451 /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
7452 if (mach_port_insert_right (self, our_exception_port, our_exception_port,
7453 MACH_MSG_TYPE_MAKE_SEND)
7454 == KERN_SUCCESS) {
7455 /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
7456 for us. */
7457 exception_mask_t mask = EXC_MASK_BAD_ACCESS;
7458 /* Create the thread listening on the exception port. */
7459 pthread_attr_t attr;
7460 pthread_t thread;
7461 if (pthread_attr_init (&attr) == 0
7462 && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
7463 && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
7464 pthread_attr_destroy (&attr);
7465 /* Replace the exception port info for these exceptions with our own.
7466 Note that we replace the exception port for the entire task, not only
7467 for a particular thread. This has the effect that when our exception
7468 port gets the message, the thread specific exception port has already
7469 been asked, and we don't need to bother about it.
7470 See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
7471 task_set_exception_ports (self, mask, our_exception_port,
7472 EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
7473 }
7474 }
7475 }
7476}
7477#elif defined _WIN32 && ! defined __CYGWIN__
7478/* Avoid a crash on native Windows. */
7479#define WIN32_LEAN_AND_MEAN
7480#include <windows.h>
7481#include <winerror.h>
7482static LONG WINAPI
7483exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
7484{
7485 switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
7486 {
7487 case EXCEPTION_ACCESS_VIOLATION:
7488 case EXCEPTION_IN_PAGE_ERROR:
7489 case EXCEPTION_STACK_OVERFLOW:
7490 case EXCEPTION_GUARD_PAGE:
7491 case EXCEPTION_PRIV_INSTRUCTION:
7492 case EXCEPTION_ILLEGAL_INSTRUCTION:
7493 case EXCEPTION_DATATYPE_MISALIGNMENT:
7494 case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
7495 case EXCEPTION_NONCONTINUABLE_EXCEPTION:
7496 exit (1);
7497 }
7498 return EXCEPTION_CONTINUE_SEARCH;
7499}
7500static void
7501nocrash_init (void)
7502{
7503 SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
7504}
7505#else
7506/* Avoid a crash on POSIX systems. */
7507#include <signal.h>
7508#include <unistd.h>
7509/* A POSIX signal handler. */
7510static void
7511exception_handler (int sig)
7512{
7513 _exit (1);
7514}
7515static void
7516nocrash_init (void)
7517{
7518#ifdef SIGSEGV
7519 signal (SIGSEGV, exception_handler);
7520#endif
7521#ifdef SIGBUS
7522 signal (SIGBUS, exception_handler);
7523#endif
5e8754f9 7524}
c0c3707f
CB
7525#endif
7526
7527 #include <stdlib.h>
7528 #include <string.h>
472fa5ee 7529
5e8754f9 7530int
c0c3707f 7531main ()
5e8754f9 7532{
c0c3707f
CB
7533
7534 int result = 0;
7535 {
7536 char *name = realpath ("conftest.a", NULL);
7537 if (!(name && *name == '/'))
7538 result |= 1;
7539 free (name);
7540 }
7541 {
7542 char *name = realpath ("conftest.b/../conftest.a", NULL);
7543 if (name != NULL)
7544 result |= 2;
7545 free (name);
7546 }
7547 {
7548 char *name = realpath ("conftest.a/", NULL);
7549 if (name != NULL)
7550 result |= 4;
7551 free (name);
7552 }
7553 {
7554 char *name1 = realpath (".", NULL);
7555 char *name2 = realpath ("conftest.d//./..", NULL);
7556 if (! name1 || ! name2 || strcmp (name1, name2))
7557 result |= 8;
7558 free (name1);
7559 free (name2);
7560 }
7561 return result;
7562
7563 ;
7564 return 0;
5e8754f9 7565}
c0c3707f 7566
5e8754f9
SDJ
7567_ACEOF
7568if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 7569 gl_cv_func_realpath_works=yes
5e8754f9 7570else
c0c3707f 7571 gl_cv_func_realpath_works=no
5e8754f9
SDJ
7572fi
7573rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7574 conftest.$ac_objext conftest.beam conftest.$ac_ext
7575fi
472fa5ee 7576
c0c3707f 7577 rm -rf conftest.a conftest.d
98399780 7578
5e8754f9 7579fi
c0c3707f
CB
7580{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
7581$as_echo "$gl_cv_func_realpath_works" >&6; }
7582 case "$gl_cv_func_realpath_works" in
7583 *yes)
98399780 7584
c0c3707f 7585$as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
98399780 7586
c0c3707f
CB
7587 ;;
7588 esac
725e2999
JB
7589
7590
725e2999 7591
725e2999 7592
725e2999
JB
7593
7594
7595
7596
7597
7598
7599
c0c3707f
CB
7600 GNULIB_ACCESS=0;
7601 GNULIB_CHDIR=0;
7602 GNULIB_CHOWN=0;
7603 GNULIB_CLOSE=0;
7604 GNULIB_COPY_FILE_RANGE=0;
7605 GNULIB_DUP=0;
7606 GNULIB_DUP2=0;
7607 GNULIB_DUP3=0;
7608 GNULIB_ENVIRON=0;
7609 GNULIB_EUIDACCESS=0;
7610 GNULIB_FACCESSAT=0;
7611 GNULIB_FCHDIR=0;
7612 GNULIB_FCHOWNAT=0;
7613 GNULIB_FDATASYNC=0;
7614 GNULIB_FSYNC=0;
7615 GNULIB_FTRUNCATE=0;
7616 GNULIB_GETCWD=0;
7617 GNULIB_GETDOMAINNAME=0;
7618 GNULIB_GETDTABLESIZE=0;
7619 GNULIB_GETGROUPS=0;
7620 GNULIB_GETHOSTNAME=0;
7621 GNULIB_GETLOGIN=0;
7622 GNULIB_GETLOGIN_R=0;
7623 GNULIB_GETPAGESIZE=0;
7624 GNULIB_GETPASS=0;
7625 GNULIB_GETUSERSHELL=0;
7626 GNULIB_GROUP_MEMBER=0;
7627 GNULIB_ISATTY=0;
7628 GNULIB_LCHOWN=0;
7629 GNULIB_LINK=0;
7630 GNULIB_LINKAT=0;
7631 GNULIB_LSEEK=0;
7632 GNULIB_PIPE=0;
7633 GNULIB_PIPE2=0;
7634 GNULIB_PREAD=0;
7635 GNULIB_PWRITE=0;
7636 GNULIB_READ=0;
7637 GNULIB_READLINK=0;
7638 GNULIB_READLINKAT=0;
7639 GNULIB_RMDIR=0;
7640 GNULIB_SETHOSTNAME=0;
7641 GNULIB_SLEEP=0;
7642 GNULIB_SYMLINK=0;
7643 GNULIB_SYMLINKAT=0;
7644 GNULIB_TRUNCATE=0;
7645 GNULIB_TTYNAME_R=0;
7646 GNULIB_UNISTD_H_NONBLOCKING=0;
7647 GNULIB_UNISTD_H_SIGPIPE=0;
7648 GNULIB_UNLINK=0;
7649 GNULIB_UNLINKAT=0;
7650 GNULIB_USLEEP=0;
7651 GNULIB_WRITE=0;
7652 HAVE_CHOWN=1;
7653 HAVE_COPY_FILE_RANGE=1;
7654 HAVE_DUP2=1;
7655 HAVE_DUP3=1;
7656 HAVE_EUIDACCESS=1;
7657 HAVE_FACCESSAT=1;
7658 HAVE_FCHDIR=1;
7659 HAVE_FCHOWNAT=1;
7660 HAVE_FDATASYNC=1;
7661 HAVE_FSYNC=1;
7662 HAVE_FTRUNCATE=1;
7663 HAVE_GETDTABLESIZE=1;
7664 HAVE_GETGROUPS=1;
7665 HAVE_GETHOSTNAME=1;
7666 HAVE_GETLOGIN=1;
7667 HAVE_GETPAGESIZE=1;
7668 HAVE_GETPASS=1;
7669 HAVE_GROUP_MEMBER=1;
7670 HAVE_LCHOWN=1;
7671 HAVE_LINK=1;
7672 HAVE_LINKAT=1;
7673 HAVE_PIPE=1;
7674 HAVE_PIPE2=1;
7675 HAVE_PREAD=1;
7676 HAVE_PWRITE=1;
7677 HAVE_READLINK=1;
7678 HAVE_READLINKAT=1;
7679 HAVE_SETHOSTNAME=1;
7680 HAVE_SLEEP=1;
7681 HAVE_SYMLINK=1;
7682 HAVE_SYMLINKAT=1;
7683 HAVE_UNLINKAT=1;
7684 HAVE_USLEEP=1;
7685 HAVE_DECL_ENVIRON=1;
7686 HAVE_DECL_FCHDIR=1;
7687 HAVE_DECL_FDATASYNC=1;
7688 HAVE_DECL_GETDOMAINNAME=1;
7689 HAVE_DECL_GETLOGIN=1;
7690 HAVE_DECL_GETLOGIN_R=1;
7691 HAVE_DECL_GETPAGESIZE=1;
7692 HAVE_DECL_GETUSERSHELL=1;
7693 HAVE_DECL_SETHOSTNAME=1;
7694 HAVE_DECL_TRUNCATE=1;
7695 HAVE_DECL_TTYNAME_R=1;
7696 HAVE_OS_H=0;
7697 HAVE_SYS_PARAM_H=0;
7698 REPLACE_ACCESS=0;
7699 REPLACE_CHOWN=0;
7700 REPLACE_CLOSE=0;
7701 REPLACE_DUP=0;
7702 REPLACE_DUP2=0;
7703 REPLACE_FACCESSAT=0;
7704 REPLACE_FCHOWNAT=0;
7705 REPLACE_FTRUNCATE=0;
7706 REPLACE_GETCWD=0;
7707 REPLACE_GETDOMAINNAME=0;
7708 REPLACE_GETDTABLESIZE=0;
7709 REPLACE_GETLOGIN_R=0;
7710 REPLACE_GETGROUPS=0;
7711 REPLACE_GETPAGESIZE=0;
7712 REPLACE_GETPASS=0;
7713 REPLACE_ISATTY=0;
7714 REPLACE_LCHOWN=0;
7715 REPLACE_LINK=0;
7716 REPLACE_LINKAT=0;
7717 REPLACE_LSEEK=0;
7718 REPLACE_PREAD=0;
7719 REPLACE_PWRITE=0;
7720 REPLACE_READ=0;
7721 REPLACE_READLINK=0;
7722 REPLACE_READLINKAT=0;
7723 REPLACE_RMDIR=0;
7724 REPLACE_SLEEP=0;
7725 REPLACE_SYMLINK=0;
7726 REPLACE_SYMLINKAT=0;
7727 REPLACE_TRUNCATE=0;
7728 REPLACE_TTYNAME_R=0;
7729 REPLACE_UNLINK=0;
7730 REPLACE_UNLINKAT=0;
7731 REPLACE_USLEEP=0;
7732 REPLACE_WRITE=0;
7733 UNISTD_H_HAVE_WINSOCK2_H=0;
7734 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
725e2999 7735
725e2999 7736
725e2999
JB
7737
7738
7739
725e2999 7740
725e2999 7741
725e2999
JB
7742
7743
c0c3707f
CB
7744
7745
7746 if test $ac_cv_func__set_invalid_parameter_handler = yes; then
7747 HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
7748
7749$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
7750
725e2999 7751 else
c0c3707f 7752 HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
725e2999
JB
7753 fi
7754
7755
7756
7757
7758
c0c3707f
CB
7759 GNULIB_OPENDIR=0;
7760 GNULIB_READDIR=0;
7761 GNULIB_REWINDDIR=0;
7762 GNULIB_CLOSEDIR=0;
7763 GNULIB_DIRFD=0;
7764 GNULIB_FDOPENDIR=0;
7765 GNULIB_SCANDIR=0;
7766 GNULIB_ALPHASORT=0;
7767 HAVE_OPENDIR=1;
7768 HAVE_READDIR=1;
7769 HAVE_REWINDDIR=1;
7770 HAVE_CLOSEDIR=1;
7771 HAVE_DECL_DIRFD=1;
7772 HAVE_DECL_FDOPENDIR=1;
7773 HAVE_FDOPENDIR=1;
7774 HAVE_SCANDIR=1;
7775 HAVE_ALPHASORT=1;
7776 REPLACE_OPENDIR=0;
7777 REPLACE_CLOSEDIR=0;
7778 REPLACE_DIRFD=0;
7779 REPLACE_FDOPENDIR=0;
725e2999
JB
7780
7781
7782
7783
725e2999
JB
7784
7785
7786
7787
725e2999
JB
7788
7789
c0c3707f
CB
7790 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
7791$as_echo_n "checking if environ is properly declared... " >&6; }
7792if ${gt_cv_var_environ_declaration+:} false; then :
725e2999
JB
7793 $as_echo_n "(cached) " >&6
7794else
c0c3707f
CB
7795 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7796/* end confdefs.h. */
7797#if HAVE_UNISTD_H
7798 #include <unistd.h>
7799 #endif
7800 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
7801 #include <stdlib.h>
725e2999 7802
c0c3707f
CB
7803 extern struct { int foo; } environ;
7804int
7805main ()
7806{
7807environ.foo = 1;
7808 ;
7809 return 0;
7810}
7811_ACEOF
7812if ac_fn_c_try_compile "$LINENO"; then :
7813 gt_cv_var_environ_declaration=no
7814else
7815 gt_cv_var_environ_declaration=yes
725e2999 7816fi
c0c3707f
CB
7817rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7818fi
7819{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
7820$as_echo "$gt_cv_var_environ_declaration" >&6; }
7821 if test $gt_cv_var_environ_declaration = yes; then
7822
7823$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
725e2999 7824
725e2999 7825 fi
725e2999
JB
7826
7827
c0c3707f
CB
7828 if test $gt_cv_var_environ_declaration != yes; then
7829 HAVE_DECL_ENVIRON=0
7830 fi
6ec2e0f5
SDJ
7831
7832
7833
c0c3707f
CB
7834 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
7835$as_echo_n "checking for complete errno.h... " >&6; }
7836if ${gl_cv_header_errno_h_complete+:} false; then :
7837 $as_echo_n "(cached) " >&6
7838else
6ec2e0f5 7839
c0c3707f
CB
7840 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7841/* end confdefs.h. */
472fa5ee 7842
c0c3707f
CB
7843#include <errno.h>
7844#if !defined ETXTBSY
7845booboo
7846#endif
7847#if !defined ENOMSG
7848booboo
7849#endif
7850#if !defined EIDRM
7851booboo
7852#endif
7853#if !defined ENOLINK
7854booboo
7855#endif
7856#if !defined EPROTO
7857booboo
7858#endif
7859#if !defined EMULTIHOP
7860booboo
7861#endif
7862#if !defined EBADMSG
7863booboo
7864#endif
7865#if !defined EOVERFLOW
7866booboo
7867#endif
7868#if !defined ENOTSUP
7869booboo
7870#endif
7871#if !defined ENETRESET
7872booboo
7873#endif
7874#if !defined ECONNABORTED
7875booboo
7876#endif
7877#if !defined ESTALE
7878booboo
7879#endif
7880#if !defined EDQUOT
7881booboo
7882#endif
7883#if !defined ECANCELED
7884booboo
7885#endif
7886#if !defined EOWNERDEAD
7887booboo
7888#endif
7889#if !defined ENOTRECOVERABLE
7890booboo
7891#endif
7892#if !defined EILSEQ
7893booboo
7894#endif
472fa5ee 7895
c0c3707f
CB
7896_ACEOF
7897if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7898 $EGREP "booboo" >/dev/null 2>&1; then :
7899 gl_cv_header_errno_h_complete=no
7900else
7901 gl_cv_header_errno_h_complete=yes
5e8754f9 7902fi
c0c3707f 7903rm -f conftest*
472fa5ee
SM
7904
7905
c0c3707f
CB
7906fi
7907{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
7908$as_echo "$gl_cv_header_errno_h_complete" >&6; }
7909 if test $gl_cv_header_errno_h_complete = yes; then
7910 ERRNO_H=''
7911 else
472fa5ee
SM
7912
7913
7914
7915
7916
472fa5ee
SM
7917
7918
7919
c0c3707f
CB
7920 if test $gl_cv_have_include_next = yes; then
7921 gl_cv_next_errno_h='<'errno.h'>'
7922 else
7923 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
7924$as_echo_n "checking absolute name of <errno.h>... " >&6; }
7925if ${gl_cv_next_errno_h+:} false; then :
5e8754f9
SDJ
7926 $as_echo_n "(cached) " >&6
7927else
6ec2e0f5 7928
6ec2e0f5 7929
6ec2e0f5 7930
c0c3707f
CB
7931 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7932/* end confdefs.h. */
7933#include <errno.h>
7934_ACEOF
7935 case "$host_os" in
7936 aix*) gl_absname_cpp="$ac_cpp -C" ;;
7937 *) gl_absname_cpp="$ac_cpp" ;;
7938 esac
6ec2e0f5 7939
c0c3707f
CB
7940 case "$host_os" in
7941 mingw*)
7942 gl_dirsep_regex='[/\\]'
7943 ;;
7944 *)
7945 gl_dirsep_regex='\/'
7946 ;;
7947 esac
7948 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
7949 gl_header_literal_regex=`echo 'errno.h' \
7950 | sed -e "$gl_make_literal_regex_sed"`
7951 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
7952 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
7953 s|^/[^/]|//&|
7954 p
7955 q
7956 }'
6ec2e0f5 7957
c0c3707f
CB
7958 gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
7959 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 7960
c0c3707f
CB
7961 gl_header=$gl_cv_absolute_errno_h
7962 gl_cv_next_errno_h='"'$gl_header'"'
6ec2e0f5
SDJ
7963
7964
c0c3707f
CB
7965fi
7966{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
7967$as_echo "$gl_cv_next_errno_h" >&6; }
7968 fi
7969 NEXT_ERRNO_H=$gl_cv_next_errno_h
6ec2e0f5 7970
c0c3707f
CB
7971 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
7972 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
7973 gl_next_as_first_directive='<'errno.h'>'
7974 else
7975 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
7976 gl_next_as_first_directive=$gl_cv_next_errno_h
7977 fi
7978 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
6ec2e0f5 7979
472fa5ee
SM
7980
7981
7982
c0c3707f
CB
7983 ERRNO_H='errno.h'
7984 fi
472fa5ee 7985
c0c3707f
CB
7986 if test -n "$ERRNO_H"; then
7987 GL_GENERATE_ERRNO_H_TRUE=
7988 GL_GENERATE_ERRNO_H_FALSE='#'
5e8754f9 7989else
c0c3707f
CB
7990 GL_GENERATE_ERRNO_H_TRUE='#'
7991 GL_GENERATE_ERRNO_H_FALSE=
7992fi
472fa5ee
SM
7993
7994
c0c3707f
CB
7995 if test -n "$ERRNO_H"; then
7996 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
7997$as_echo_n "checking for EMULTIHOP value... " >&6; }
7998if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
7999 $as_echo_n "(cached) " >&6
5e8754f9 8000else
e26b6bb0 8001
c0c3707f
CB
8002 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8003/* end confdefs.h. */
e26b6bb0 8004
c0c3707f
CB
8005#include <errno.h>
8006#ifdef EMULTIHOP
8007yes
88b48903 8008#endif
88b48903 8009
c0c3707f
CB
8010_ACEOF
8011if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8012 $EGREP "yes" >/dev/null 2>&1; then :
8013 gl_cv_header_errno_h_EMULTIHOP=yes
8014else
8015 gl_cv_header_errno_h_EMULTIHOP=no
8016fi
8017rm -f conftest*
88b48903 8018
c0c3707f
CB
8019 if test $gl_cv_header_errno_h_EMULTIHOP = no; then
8020 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8021/* end confdefs.h. */
88b48903 8022
c0c3707f
CB
8023#define _XOPEN_SOURCE_EXTENDED 1
8024#include <errno.h>
8025#ifdef EMULTIHOP
8026yes
8027#endif
88b48903
WN
8028
8029_ACEOF
c0c3707f
CB
8030if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8031 $EGREP "yes" >/dev/null 2>&1; then :
8032 gl_cv_header_errno_h_EMULTIHOP=hidden
88b48903 8033fi
c0c3707f 8034rm -f conftest*
88b48903 8035
c0c3707f
CB
8036 if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
8037 if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" "
8038#define _XOPEN_SOURCE_EXTENDED 1
8039#include <errno.h>
8040/* The following two lines are a workaround against an autoconf-2.52 bug. */
8041#include <stdio.h>
8042#include <stdlib.h>
8043"; then :
88b48903
WN
8044
8045fi
88b48903 8046
c0c3707f
CB
8047 fi
8048 fi
88b48903 8049
c0c3707f
CB
8050fi
8051{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
8052$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
8053 case $gl_cv_header_errno_h_EMULTIHOP in
8054 yes | no)
8055 EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
8056 ;;
8057 *)
8058 EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
8059 ;;
8060 esac
88b48903 8061
e26b6bb0 8062
c0c3707f 8063 fi
e26b6bb0 8064
3d99e817 8065
c0c3707f
CB
8066 if test -n "$ERRNO_H"; then
8067 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
8068$as_echo_n "checking for ENOLINK value... " >&6; }
8069if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
8070 $as_echo_n "(cached) " >&6
8071else
472fa5ee 8072
c0c3707f
CB
8073 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8074/* end confdefs.h. */
472fa5ee 8075
c0c3707f
CB
8076#include <errno.h>
8077#ifdef ENOLINK
8078yes
8079#endif
472fa5ee 8080
c0c3707f
CB
8081_ACEOF
8082if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8083 $EGREP "yes" >/dev/null 2>&1; then :
8084 gl_cv_header_errno_h_ENOLINK=yes
8085else
8086 gl_cv_header_errno_h_ENOLINK=no
8087fi
8088rm -f conftest*
472fa5ee 8089
c0c3707f
CB
8090 if test $gl_cv_header_errno_h_ENOLINK = no; then
8091 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8092/* end confdefs.h. */
3d99e817 8093
c0c3707f
CB
8094#define _XOPEN_SOURCE_EXTENDED 1
8095#include <errno.h>
8096#ifdef ENOLINK
8097yes
8098#endif
3d99e817 8099
c0c3707f
CB
8100_ACEOF
8101if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8102 $EGREP "yes" >/dev/null 2>&1; then :
8103 gl_cv_header_errno_h_ENOLINK=hidden
8104fi
8105rm -f conftest*
3d99e817 8106
c0c3707f
CB
8107 if test $gl_cv_header_errno_h_ENOLINK = hidden; then
8108 if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" "
8109#define _XOPEN_SOURCE_EXTENDED 1
8110#include <errno.h>
8111/* The following two lines are a workaround against an autoconf-2.52 bug. */
8112#include <stdio.h>
8113#include <stdlib.h>
8114"; then :
3d99e817 8115
c0c3707f 8116fi
3d99e817 8117
c0c3707f
CB
8118 fi
8119 fi
3d99e817 8120
c0c3707f
CB
8121fi
8122{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
8123$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
8124 case $gl_cv_header_errno_h_ENOLINK in
8125 yes | no)
8126 ENOLINK_HIDDEN=0; ENOLINK_VALUE=
8127 ;;
8128 *)
8129 ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
8130 ;;
8131 esac
18848e28 8132
18848e28 8133
c0c3707f 8134 fi
18848e28 8135
18848e28 8136
c0c3707f
CB
8137 if test -n "$ERRNO_H"; then
8138 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
8139$as_echo_n "checking for EOVERFLOW value... " >&6; }
8140if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
8141 $as_echo_n "(cached) " >&6
8142else
18848e28 8143
c0c3707f
CB
8144 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8145/* end confdefs.h. */
18848e28 8146
c0c3707f
CB
8147#include <errno.h>
8148#ifdef EOVERFLOW
8149yes
8150#endif
18848e28 8151
c0c3707f
CB
8152_ACEOF
8153if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8154 $EGREP "yes" >/dev/null 2>&1; then :
8155 gl_cv_header_errno_h_EOVERFLOW=yes
8156else
8157 gl_cv_header_errno_h_EOVERFLOW=no
8158fi
8159rm -f conftest*
18848e28 8160
c0c3707f
CB
8161 if test $gl_cv_header_errno_h_EOVERFLOW = no; then
8162 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8163/* end confdefs.h. */
18848e28 8164
c0c3707f
CB
8165#define _XOPEN_SOURCE_EXTENDED 1
8166#include <errno.h>
8167#ifdef EOVERFLOW
8168yes
8169#endif
18848e28 8170
c0c3707f
CB
8171_ACEOF
8172if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8173 $EGREP "yes" >/dev/null 2>&1; then :
8174 gl_cv_header_errno_h_EOVERFLOW=hidden
8175fi
8176rm -f conftest*
18848e28 8177
c0c3707f
CB
8178 if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
8179 if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" "
8180#define _XOPEN_SOURCE_EXTENDED 1
8181#include <errno.h>
8182/* The following two lines are a workaround against an autoconf-2.52 bug. */
8183#include <stdio.h>
8184#include <stdlib.h>
8185"; then :
18848e28 8186
c0c3707f 8187fi
18848e28 8188
c0c3707f
CB
8189 fi
8190 fi
18848e28 8191
c0c3707f
CB
8192fi
8193{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
8194$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
8195 case $gl_cv_header_errno_h_EOVERFLOW in
8196 yes | no)
8197 EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
8198 ;;
8199 *)
8200 EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
8201 ;;
8202 esac
4a626d0a
PA
8203
8204
c0c3707f 8205 fi
18848e28 8206
4a626d0a 8207
c0c3707f
CB
8208ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
8209if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
8210 ac_have_decl=1
8211else
8212 ac_have_decl=0
8213fi
4a626d0a 8214
c0c3707f
CB
8215cat >>confdefs.h <<_ACEOF
8216#define HAVE_DECL_STRERROR_R $ac_have_decl
8217_ACEOF
4a626d0a 8218
c0c3707f
CB
8219for ac_func in strerror_r
8220do :
8221 ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
8222if test "x$ac_cv_func_strerror_r" = xyes; then :
8223 cat >>confdefs.h <<_ACEOF
8224#define HAVE_STRERROR_R 1
8225_ACEOF
4a626d0a 8226
c0c3707f
CB
8227fi
8228done
18848e28 8229
c0c3707f
CB
8230{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
8231$as_echo_n "checking whether strerror_r returns char *... " >&6; }
8232if ${ac_cv_func_strerror_r_char_p+:} false; then :
8233 $as_echo_n "(cached) " >&6
8234else
18848e28 8235
c0c3707f
CB
8236 ac_cv_func_strerror_r_char_p=no
8237 if test $ac_cv_have_decl_strerror_r = yes; then
8238 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8239/* end confdefs.h. */
8240$ac_includes_default
8241int
8242main ()
8243{
18848e28 8244
c0c3707f
CB
8245 char buf[100];
8246 char x = *strerror_r (0, buf, sizeof buf);
8247 char *p = strerror_r (0, buf, sizeof buf);
8248 return !p || x;
18848e28 8249
c0c3707f
CB
8250 ;
8251 return 0;
8252}
8253_ACEOF
8254if ac_fn_c_try_compile "$LINENO"; then :
8255 ac_cv_func_strerror_r_char_p=yes
8256fi
8257rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8258 else
8259 # strerror_r is not declared. Choose between
8260 # systems that have relatively inaccessible declarations for the
8261 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
8262 # former has a strerror_r that returns char*, while the latter
8263 # has a strerror_r that returns `int'.
8264 # This test should segfault on the DEC system.
8265 if test "$cross_compiling" = yes; then :
8266 :
8267else
8268 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8269/* end confdefs.h. */
8270$ac_includes_default
8271 extern char *strerror_r ();
8272int
8273main ()
8274{
8275char buf[100];
8276 char x = *strerror_r (0, buf, sizeof buf);
8277 return ! isalpha (x);
8278 ;
8279 return 0;
8280}
8281_ACEOF
8282if ac_fn_c_try_run "$LINENO"; then :
8283 ac_cv_func_strerror_r_char_p=yes
8284fi
8285rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8286 conftest.$ac_objext conftest.beam conftest.$ac_ext
8287fi
18848e28 8288
c0c3707f 8289 fi
18848e28 8290
c0c3707f
CB
8291fi
8292{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
8293$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
8294if test $ac_cv_func_strerror_r_char_p = yes; then
18848e28 8295
c0c3707f 8296$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
18848e28 8297
c0c3707f 8298fi
18848e28 8299
18848e28 8300
18848e28 8301
18848e28 8302
c0c3707f
CB
8303ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default"
8304if test "x$ac_cv_have_decl_fchdir" = xyes; then :
8305 ac_have_decl=1
8306else
8307 ac_have_decl=0
8308fi
18848e28 8309
c0c3707f
CB
8310cat >>confdefs.h <<_ACEOF
8311#define HAVE_DECL_FCHDIR $ac_have_decl
8312_ACEOF
18848e28 8313
18848e28 8314
c0c3707f
CB
8315 GNULIB_CREAT=0;
8316 GNULIB_FCNTL=0;
8317 GNULIB_NONBLOCKING=0;
8318 GNULIB_OPEN=0;
8319 GNULIB_OPENAT=0;
8320 HAVE_FCNTL=1;
8321 HAVE_OPENAT=1;
8322 REPLACE_CREAT=0;
8323 REPLACE_FCNTL=0;
8324 REPLACE_OPEN=0;
8325 REPLACE_OPENAT=0;
18848e28 8326
18848e28 8327
18848e28 8328
18848e28
GF
8329
8330
18848e28
GF
8331
8332
18848e28 8333
18848e28 8334
18848e28 8335
c0c3707f
CB
8336 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
8337$as_echo_n "checking for working fcntl.h... " >&6; }
8338if ${gl_cv_header_working_fcntl_h+:} false; then :
8339 $as_echo_n "(cached) " >&6
8340else
8341 if test "$cross_compiling" = yes; then :
8342 case "$host_os" in
8343 # Guess 'no' on native Windows.
8344 mingw*) gl_cv_header_working_fcntl_h='no' ;;
8345 *) gl_cv_header_working_fcntl_h=cross-compiling ;;
8346 esac
18848e28 8347
c0c3707f
CB
8348else
8349 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8350/* end confdefs.h. */
8351#include <sys/types.h>
8352 #include <sys/stat.h>
8353 #if HAVE_UNISTD_H
8354 # include <unistd.h>
8355 #else /* on Windows with MSVC */
8356 # include <io.h>
8357 # include <stdlib.h>
8358 # defined sleep(n) _sleep ((n) * 1000)
8359 #endif
8360 #include <fcntl.h>
8361 #ifndef O_NOATIME
8362 #define O_NOATIME 0
8363 #endif
8364 #ifndef O_NOFOLLOW
8365 #define O_NOFOLLOW 0
8366 #endif
8367 static int const constants[] =
8368 {
8369 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
8370 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
8371 };
18848e28 8372
c0c3707f
CB
8373int
8374main ()
8375{
18848e28 8376
c0c3707f
CB
8377 int result = !constants;
8378 #if HAVE_SYMLINK
8379 {
8380 static char const sym[] = "conftest.sym";
8381 if (symlink ("/dev/null", sym) != 0)
8382 result |= 2;
8383 else
8384 {
8385 int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
8386 if (fd >= 0)
8387 {
8388 close (fd);
8389 result |= 4;
8390 }
8391 }
8392 if (unlink (sym) != 0 || symlink (".", sym) != 0)
8393 result |= 2;
8394 else
8395 {
8396 int fd = open (sym, O_RDONLY | O_NOFOLLOW);
8397 if (fd >= 0)
8398 {
8399 close (fd);
8400 result |= 4;
8401 }
8402 }
8403 unlink (sym);
8404 }
8405 #endif
8406 {
8407 static char const file[] = "confdefs.h";
8408 int fd = open (file, O_RDONLY | O_NOATIME);
8409 if (fd < 0)
8410 result |= 8;
8411 else
8412 {
8413 struct stat st0;
8414 if (fstat (fd, &st0) != 0)
8415 result |= 16;
8416 else
8417 {
8418 char c;
8419 sleep (1);
8420 if (read (fd, &c, 1) != 1)
8421 result |= 24;
8422 else
8423 {
8424 if (close (fd) != 0)
8425 result |= 32;
8426 else
8427 {
8428 struct stat st1;
8429 if (stat (file, &st1) != 0)
8430 result |= 40;
8431 else
8432 if (st0.st_atime != st1.st_atime)
8433 result |= 64;
8434 }
8435 }
8436 }
8437 }
8438 }
8439 return result;
8440 ;
8441 return 0;
8442}
8443_ACEOF
8444if ac_fn_c_try_run "$LINENO"; then :
8445 gl_cv_header_working_fcntl_h=yes
8446else
8447 case $? in #(
8448 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
8449 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
8450 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
8451 *) gl_cv_header_working_fcntl_h='no';;
8452 esac
8453fi
8454rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8455 conftest.$ac_objext conftest.beam conftest.$ac_ext
8456fi
18848e28 8457
18848e28 8458
c0c3707f
CB
8459fi
8460{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
8461$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
18848e28 8462
c0c3707f
CB
8463 case $gl_cv_header_working_fcntl_h in #(
8464 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
8465 *) ac_val=1;;
8466 esac
18848e28 8467
c0c3707f
CB
8468cat >>confdefs.h <<_ACEOF
8469#define HAVE_WORKING_O_NOATIME $ac_val
8470_ACEOF
18848e28
GF
8471
8472
c0c3707f
CB
8473 case $gl_cv_header_working_fcntl_h in #(
8474 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
8475 *) ac_val=1;;
8476 esac
18848e28 8477
c0c3707f
CB
8478cat >>confdefs.h <<_ACEOF
8479#define HAVE_WORKING_O_NOFOLLOW $ac_val
8480_ACEOF
18848e28 8481
63ce7108 8482
c0c3707f
CB
8483ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
8484if test "x$ac_cv_type_pid_t" = xyes; then :
63ce7108 8485
c0c3707f 8486else
63ce7108 8487
c0c3707f
CB
8488cat >>confdefs.h <<_ACEOF
8489#define pid_t int
8490_ACEOF
63ce7108 8491
c0c3707f 8492fi
63ce7108 8493
c0c3707f
CB
8494ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
8495if test "x$ac_cv_type_mode_t" = xyes; then :
63ce7108 8496
c0c3707f 8497else
63ce7108 8498
c0c3707f
CB
8499cat >>confdefs.h <<_ACEOF
8500#define mode_t int
8501_ACEOF
63ce7108 8502
c0c3707f 8503fi
63ce7108 8504
472fa5ee
SM
8505
8506
8507
8508
8509
c0c3707f
CB
8510 GNULIB_FNMATCH=0;
8511 HAVE_FNMATCH=1;
8512 REPLACE_FNMATCH=0;
472fa5ee
SM
8513
8514
8515
8516
8517
8518
472fa5ee
SM
8519
8520
472fa5ee
SM
8521
8522
8523
8524
8525
8526
8527
8528
7a6dbc2f 8529 if test $gl_cv_have_include_next = yes; then
c0c3707f 8530 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
7a6dbc2f 8531 else
c0c3707f
CB
8532 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fnmatch.h>" >&5
8533$as_echo_n "checking absolute name of <fnmatch.h>... " >&6; }
8534if ${gl_cv_next_fnmatch_h+:} false; then :
7a6dbc2f
SDJ
8535 $as_echo_n "(cached) " >&6
8536else
472fa5ee 8537
c0c3707f
CB
8538 if test $ac_cv_header_fnmatch_h = yes; then
8539
8540
472fa5ee
SM
8541
8542
7a6dbc2f
SDJ
8543 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8544/* end confdefs.h. */
c0c3707f 8545#include <fnmatch.h>
7a6dbc2f
SDJ
8546_ACEOF
8547 case "$host_os" in
8548 aix*) gl_absname_cpp="$ac_cpp -C" ;;
8549 *) gl_absname_cpp="$ac_cpp" ;;
8550 esac
472fa5ee 8551
7a6dbc2f
SDJ
8552 case "$host_os" in
8553 mingw*)
8554 gl_dirsep_regex='[/\\]'
8555 ;;
8556 *)
8557 gl_dirsep_regex='\/'
8558 ;;
8559 esac
8560 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 8561 gl_header_literal_regex=`echo 'fnmatch.h' \
7a6dbc2f
SDJ
8562 | sed -e "$gl_make_literal_regex_sed"`
8563 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
8564 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
8565 s|^/[^/]|//&|
8566 p
8567 q
8568 }'
8569
c0c3707f 8570 gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
7a6dbc2f
SDJ
8571 sed -n "$gl_absolute_header_sed"`
8572
c0c3707f
CB
8573 gl_header=$gl_cv_absolute_fnmatch_h
8574 gl_cv_next_fnmatch_h='"'$gl_header'"'
8575 else
8576 gl_cv_next_fnmatch_h='<'fnmatch.h'>'
8577 fi
7a6dbc2f
SDJ
8578
8579
8580fi
c0c3707f
CB
8581{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5
8582$as_echo "$gl_cv_next_fnmatch_h" >&6; }
7a6dbc2f 8583 fi
c0c3707f 8584 NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h
7a6dbc2f
SDJ
8585
8586 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
8587 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 8588 gl_next_as_first_directive='<'fnmatch.h'>'
7a6dbc2f
SDJ
8589 else
8590 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 8591 gl_next_as_first_directive=$gl_cv_next_fnmatch_h
7a6dbc2f 8592 fi
c0c3707f 8593 NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive
7a6dbc2f
SDJ
8594
8595
8596
8597
7a6dbc2f 8598
7a6dbc2f
SDJ
8599
8600
c0c3707f
CB
8601 if test $ac_cv_header_fnmatch_h = yes; then
8602 HAVE_FNMATCH_H=1
8603 else
8604 HAVE_FNMATCH_H=0
8605 fi
7a6dbc2f
SDJ
8606
8607
c0c3707f
CB
8608 FNMATCH_H=''
8609 if false; then
8610 FNMATCH_H=fnmatch.h
8611 else
8612 if test $ac_cv_header_fnmatch_h != yes; then
8613 FNMATCH_H=fnmatch.h
8614 fi
8615 fi
7a6dbc2f 8616
c0c3707f
CB
8617
8618 if test -n "$FNMATCH_H"; then
8619 GL_GENERATE_FNMATCH_H_TRUE=
8620 GL_GENERATE_FNMATCH_H_FALSE='#'
7a6dbc2f 8621else
c0c3707f
CB
8622 GL_GENERATE_FNMATCH_H_TRUE='#'
8623 GL_GENERATE_FNMATCH_H_FALSE=
7a6dbc2f 8624fi
7a6dbc2f 8625
7a6dbc2f 8626
7a6dbc2f 8627
7a6dbc2f
SDJ
8628
8629
8630
8631
8632
8633
8634
c0c3707f
CB
8635 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
8636$as_echo_n "checking for mbstate_t... " >&6; }
8637if ${ac_cv_type_mbstate_t+:} false; then :
5e8754f9
SDJ
8638 $as_echo_n "(cached) " >&6
8639else
c0c3707f 8640 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 8641/* end confdefs.h. */
c0c3707f
CB
8642$ac_includes_default
8643/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
8644 <wchar.h>.
8645 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
8646 included before <wchar.h>. */
8647#include <stddef.h>
8648#include <stdio.h>
8649#include <time.h>
8650#include <wchar.h>
8651int
8652main ()
8653{
8654mbstate_t x; return sizeof x;
8655 ;
8656 return 0;
8657}
5e8754f9 8658_ACEOF
c0c3707f
CB
8659if ac_fn_c_try_compile "$LINENO"; then :
8660 ac_cv_type_mbstate_t=yes
5e8754f9 8661else
c0c3707f 8662 ac_cv_type_mbstate_t=no
5e8754f9 8663fi
c0c3707f
CB
8664rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8665fi
8666{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
8667$as_echo "$ac_cv_type_mbstate_t" >&6; }
8668 if test $ac_cv_type_mbstate_t = yes; then
5e8754f9 8669
c0c3707f 8670$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
5e8754f9 8671
c0c3707f 8672 else
5e8754f9 8673
c0c3707f 8674$as_echo "#define mbstate_t int" >>confdefs.h
5e8754f9 8675
c0c3707f 8676 fi
5e8754f9
SDJ
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695 GNULIB_ACOSF=0;
8696 GNULIB_ACOSL=0;
8697 GNULIB_ASINF=0;
8698 GNULIB_ASINL=0;
8699 GNULIB_ATANF=0;
8700 GNULIB_ATANL=0;
8701 GNULIB_ATAN2F=0;
8702 GNULIB_CBRT=0;
8703 GNULIB_CBRTF=0;
8704 GNULIB_CBRTL=0;
8705 GNULIB_CEIL=0;
8706 GNULIB_CEILF=0;
8707 GNULIB_CEILL=0;
8708 GNULIB_COPYSIGN=0;
8709 GNULIB_COPYSIGNF=0;
8710 GNULIB_COPYSIGNL=0;
8711 GNULIB_COSF=0;
8712 GNULIB_COSL=0;
8713 GNULIB_COSHF=0;
8714 GNULIB_EXPF=0;
8715 GNULIB_EXPL=0;
8716 GNULIB_EXP2=0;
8717 GNULIB_EXP2F=0;
8718 GNULIB_EXP2L=0;
8719 GNULIB_EXPM1=0;
8720 GNULIB_EXPM1F=0;
8721 GNULIB_EXPM1L=0;
8722 GNULIB_FABSF=0;
8723 GNULIB_FABSL=0;
8724 GNULIB_FLOOR=0;
8725 GNULIB_FLOORF=0;
8726 GNULIB_FLOORL=0;
8727 GNULIB_FMA=0;
8728 GNULIB_FMAF=0;
8729 GNULIB_FMAL=0;
8730 GNULIB_FMOD=0;
8731 GNULIB_FMODF=0;
8732 GNULIB_FMODL=0;
8733 GNULIB_FREXPF=0;
8734 GNULIB_FREXP=0;
8735 GNULIB_FREXPL=0;
8736 GNULIB_HYPOT=0;
8737 GNULIB_HYPOTF=0;
8738 GNULIB_HYPOTL=0;
8739 GNULIB_ILOGB=0;
8740 GNULIB_ILOGBF=0;
8741 GNULIB_ILOGBL=0;
8742 GNULIB_ISFINITE=0;
8743 GNULIB_ISINF=0;
8744 GNULIB_ISNAN=0;
8745 GNULIB_ISNANF=0;
8746 GNULIB_ISNAND=0;
8747 GNULIB_ISNANL=0;
8748 GNULIB_LDEXPF=0;
8749 GNULIB_LDEXPL=0;
8750 GNULIB_LOG=0;
8751 GNULIB_LOGF=0;
8752 GNULIB_LOGL=0;
8753 GNULIB_LOG10=0;
8754 GNULIB_LOG10F=0;
8755 GNULIB_LOG10L=0;
8756 GNULIB_LOG1P=0;
8757 GNULIB_LOG1PF=0;
8758 GNULIB_LOG1PL=0;
8759 GNULIB_LOG2=0;
8760 GNULIB_LOG2F=0;
8761 GNULIB_LOG2L=0;
8762 GNULIB_LOGB=0;
8763 GNULIB_LOGBF=0;
8764 GNULIB_LOGBL=0;
8765 GNULIB_MODF=0;
8766 GNULIB_MODFF=0;
8767 GNULIB_MODFL=0;
8768 GNULIB_POWF=0;
8769 GNULIB_REMAINDER=0;
8770 GNULIB_REMAINDERF=0;
8771 GNULIB_REMAINDERL=0;
8772 GNULIB_RINT=0;
8773 GNULIB_RINTF=0;
8774 GNULIB_RINTL=0;
8775 GNULIB_ROUND=0;
8776 GNULIB_ROUNDF=0;
8777 GNULIB_ROUNDL=0;
8778 GNULIB_SIGNBIT=0;
8779 GNULIB_SINF=0;
8780 GNULIB_SINL=0;
8781 GNULIB_SINHF=0;
8782 GNULIB_SQRTF=0;
8783 GNULIB_SQRTL=0;
8784 GNULIB_TANF=0;
8785 GNULIB_TANL=0;
8786 GNULIB_TANHF=0;
8787 GNULIB_TRUNC=0;
8788 GNULIB_TRUNCF=0;
8789 GNULIB_TRUNCL=0;
8790 HAVE_ACOSF=1;
8791 HAVE_ACOSL=1;
8792 HAVE_ASINF=1;
8793 HAVE_ASINL=1;
8794 HAVE_ATANF=1;
8795 HAVE_ATANL=1;
8796 HAVE_ATAN2F=1;
8797 HAVE_CBRT=1;
8798 HAVE_CBRTF=1;
8799 HAVE_CBRTL=1;
8800 HAVE_COPYSIGN=1;
8801 HAVE_COPYSIGNL=1;
8802 HAVE_COSF=1;
8803 HAVE_COSL=1;
8804 HAVE_COSHF=1;
8805 HAVE_EXPF=1;
8806 HAVE_EXPL=1;
8807 HAVE_EXPM1=1;
8808 HAVE_EXPM1F=1;
8809 HAVE_FABSF=1;
8810 HAVE_FABSL=1;
8811 HAVE_FMA=1;
8812 HAVE_FMAF=1;
8813 HAVE_FMAL=1;
8814 HAVE_FMODF=1;
8815 HAVE_FMODL=1;
8816 HAVE_FREXPF=1;
8817 HAVE_HYPOTF=1;
8818 HAVE_HYPOTL=1;
8819 HAVE_ILOGB=1;
8820 HAVE_ILOGBF=1;
8821 HAVE_ILOGBL=1;
8822 HAVE_ISNANF=1;
8823 HAVE_ISNAND=1;
8824 HAVE_ISNANL=1;
8825 HAVE_LDEXPF=1;
8826 HAVE_LOGF=1;
8827 HAVE_LOGL=1;
8828 HAVE_LOG10F=1;
8829 HAVE_LOG10L=1;
8830 HAVE_LOG1P=1;
8831 HAVE_LOG1PF=1;
8832 HAVE_LOG1PL=1;
8833 HAVE_LOGBF=1;
8834 HAVE_LOGBL=1;
8835 HAVE_MODFF=1;
8836 HAVE_MODFL=1;
8837 HAVE_POWF=1;
8838 HAVE_REMAINDER=1;
8839 HAVE_REMAINDERF=1;
8840 HAVE_RINT=1;
8841 HAVE_RINTL=1;
8842 HAVE_SINF=1;
8843 HAVE_SINL=1;
8844 HAVE_SINHF=1;
8845 HAVE_SQRTF=1;
8846 HAVE_SQRTL=1;
8847 HAVE_TANF=1;
8848 HAVE_TANL=1;
8849 HAVE_TANHF=1;
8850 HAVE_DECL_ACOSL=1;
8851 HAVE_DECL_ASINL=1;
8852 HAVE_DECL_ATANL=1;
8853 HAVE_DECL_CBRTF=1;
8854 HAVE_DECL_CBRTL=1;
8855 HAVE_DECL_CEILF=1;
8856 HAVE_DECL_CEILL=1;
8857 HAVE_DECL_COPYSIGNF=1;
8858 HAVE_DECL_COSL=1;
8859 HAVE_DECL_EXPL=1;
8860 HAVE_DECL_EXP2=1;
8861 HAVE_DECL_EXP2F=1;
8862 HAVE_DECL_EXP2L=1;
8863 HAVE_DECL_EXPM1L=1;
8864 HAVE_DECL_FLOORF=1;
8865 HAVE_DECL_FLOORL=1;
8866 HAVE_DECL_FREXPL=1;
8867 HAVE_DECL_LDEXPL=1;
8868 HAVE_DECL_LOGL=1;
8869 HAVE_DECL_LOG10L=1;
8870 HAVE_DECL_LOG2=1;
8871 HAVE_DECL_LOG2F=1;
8872 HAVE_DECL_LOG2L=1;
8873 HAVE_DECL_LOGB=1;
8874 HAVE_DECL_REMAINDER=1;
8875 HAVE_DECL_REMAINDERL=1;
8876 HAVE_DECL_RINTF=1;
8877 HAVE_DECL_ROUND=1;
8878 HAVE_DECL_ROUNDF=1;
8879 HAVE_DECL_ROUNDL=1;
8880 HAVE_DECL_SINL=1;
8881 HAVE_DECL_SQRTL=1;
8882 HAVE_DECL_TANL=1;
8883 HAVE_DECL_TRUNC=1;
8884 HAVE_DECL_TRUNCF=1;
8885 HAVE_DECL_TRUNCL=1;
c0c3707f
CB
8886 REPLACE_ACOSF=0;
8887 REPLACE_ASINF=0;
8888 REPLACE_ATANF=0;
8889 REPLACE_ATAN2F=0;
5e8754f9
SDJ
8890 REPLACE_CBRTF=0;
8891 REPLACE_CBRTL=0;
8892 REPLACE_CEIL=0;
8893 REPLACE_CEILF=0;
8894 REPLACE_CEILL=0;
c0c3707f
CB
8895 REPLACE_COSF=0;
8896 REPLACE_COSHF=0;
8897 REPLACE_EXPF=0;
8898 REPLACE_EXPL=0;
5e8754f9
SDJ
8899 REPLACE_EXPM1=0;
8900 REPLACE_EXPM1F=0;
c0c3707f 8901 REPLACE_EXPM1L=0;
5e8754f9
SDJ
8902 REPLACE_EXP2=0;
8903 REPLACE_EXP2L=0;
8904 REPLACE_FABSL=0;
8905 REPLACE_FLOOR=0;
8906 REPLACE_FLOORF=0;
8907 REPLACE_FLOORL=0;
8908 REPLACE_FMA=0;
8909 REPLACE_FMAF=0;
8910 REPLACE_FMAL=0;
8911 REPLACE_FMOD=0;
8912 REPLACE_FMODF=0;
8913 REPLACE_FMODL=0;
8914 REPLACE_FREXPF=0;
8915 REPLACE_FREXP=0;
8916 REPLACE_FREXPL=0;
8917 REPLACE_HUGE_VAL=0;
8918 REPLACE_HYPOT=0;
8919 REPLACE_HYPOTF=0;
8920 REPLACE_HYPOTL=0;
8921 REPLACE_ILOGB=0;
8922 REPLACE_ILOGBF=0;
c0c3707f 8923 REPLACE_ILOGBL=0;
5e8754f9
SDJ
8924 REPLACE_ISFINITE=0;
8925 REPLACE_ISINF=0;
8926 REPLACE_ISNAN=0;
8927 REPLACE_LDEXPL=0;
8928 REPLACE_LOG=0;
8929 REPLACE_LOGF=0;
8930 REPLACE_LOGL=0;
8931 REPLACE_LOG10=0;
8932 REPLACE_LOG10F=0;
8933 REPLACE_LOG10L=0;
8934 REPLACE_LOG1P=0;
8935 REPLACE_LOG1PF=0;
8936 REPLACE_LOG1PL=0;
8937 REPLACE_LOG2=0;
8938 REPLACE_LOG2F=0;
8939 REPLACE_LOG2L=0;
8940 REPLACE_LOGB=0;
8941 REPLACE_LOGBF=0;
8942 REPLACE_LOGBL=0;
8943 REPLACE_MODF=0;
8944 REPLACE_MODFF=0;
8945 REPLACE_MODFL=0;
8946 REPLACE_NAN=0;
8947 REPLACE_REMAINDER=0;
8948 REPLACE_REMAINDERF=0;
8949 REPLACE_REMAINDERL=0;
c0c3707f 8950 REPLACE_RINTL=0;
5e8754f9 8951 REPLACE_ROUND=0;
c0c3707f
CB
8952 REPLACE_ROUNDF=0;
8953 REPLACE_ROUNDL=0;
8954 REPLACE_SIGNBIT=0;
8955 REPLACE_SIGNBIT_USING_GCC=0;
8956 REPLACE_SINF=0;
8957 REPLACE_SINHF=0;
8958 REPLACE_SQRTF=0;
8959 REPLACE_SQRTL=0;
8960 REPLACE_TANF=0;
8961 REPLACE_TANHF=0;
8962 REPLACE_TRUNC=0;
8963 REPLACE_TRUNCF=0;
8964 REPLACE_TRUNCL=0;
49e4877c 8965
49e4877c 8966
c0c3707f
CB
8967 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
8968$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
8969if ${gl_cv_func_frexp_no_libm+:} false; then :
8970 $as_echo_n "(cached) " >&6
8971else
8690e634 8972
c0c3707f
CB
8973 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8974/* end confdefs.h. */
8975#include <math.h>
8976 double x;
8977int
8978main ()
8979{
8980int e; return frexp (x, &e) > 0;
8981 ;
8982 return 0;
8983}
8984_ACEOF
8985if ac_fn_c_try_link "$LINENO"; then :
8986 gl_cv_func_frexp_no_libm=yes
8987else
8988 gl_cv_func_frexp_no_libm=no
8989fi
8990rm -f core conftest.err conftest.$ac_objext \
8991 conftest$ac_exeext conftest.$ac_ext
8690e634 8992
c0c3707f
CB
8993fi
8994{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
8995$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
8690e634 8996
c0c3707f
CB
8997ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
8998if test "x$ac_cv_have_decl_alarm" = xyes; then :
8999 ac_have_decl=1
9000else
9001 ac_have_decl=0
9002fi
472fa5ee 9003
c0c3707f
CB
9004cat >>confdefs.h <<_ACEOF
9005#define HAVE_DECL_ALARM $ac_have_decl
9006_ACEOF
472fa5ee
SM
9007
9008
9009
9010
c0c3707f
CB
9011 FREXP_LIBM=
9012 if test $gl_cv_func_frexp_no_libm = no; then
9013 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5
9014$as_echo_n "checking whether frexp() can be used with libm... " >&6; }
9015if ${gl_cv_func_frexp_in_libm+:} false; then :
9016 $as_echo_n "(cached) " >&6
9017else
8690e634 9018
c0c3707f
CB
9019 save_LIBS="$LIBS"
9020 LIBS="$LIBS -lm"
9021 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9022/* end confdefs.h. */
9023#include <math.h>
9024 double x;
9025int
9026main ()
9027{
9028int e; return frexp (x, &e) > 0;
9029 ;
9030 return 0;
9031}
9032_ACEOF
9033if ac_fn_c_try_link "$LINENO"; then :
9034 gl_cv_func_frexp_in_libm=yes
9035else
9036 gl_cv_func_frexp_in_libm=no
9037fi
9038rm -f core conftest.err conftest.$ac_objext \
9039 conftest$ac_exeext conftest.$ac_ext
9040 LIBS="$save_LIBS"
8690e634 9041
c0c3707f
CB
9042fi
9043{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5
9044$as_echo "$gl_cv_func_frexp_in_libm" >&6; }
9045 if test $gl_cv_func_frexp_in_libm = yes; then
9046 FREXP_LIBM=-lm
9047 fi
6ec2e0f5 9048 fi
c0c3707f
CB
9049 if test $gl_cv_func_frexp_no_libm = yes \
9050 || test $gl_cv_func_frexp_in_libm = yes; then
9051 save_LIBS="$LIBS"
9052 LIBS="$LIBS $FREXP_LIBM"
8690e634
JK
9053
9054
8690e634 9055
c0c3707f
CB
9056 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
9057$as_echo_n "checking whether frexp works... " >&6; }
9058if ${gl_cv_func_frexp_works+:} false; then :
9059 $as_echo_n "(cached) " >&6
9060else
8690e634 9061
c0c3707f
CB
9062 if test "$cross_compiling" = yes; then :
9063 case "$host_os" in
9064 netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
9065 mingw*) # Guess yes with MSVC, no with mingw.
9066 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9067/* end confdefs.h. */
8690e634 9068
c0c3707f
CB
9069#ifdef _MSC_VER
9070 Good
9071#endif
8690e634 9072
c0c3707f
CB
9073_ACEOF
9074if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9075 $EGREP "Good" >/dev/null 2>&1; then :
9076 gl_cv_func_frexp_works="guessing yes"
9077else
9078 gl_cv_func_frexp_works="guessing no"
9079fi
9080rm -f conftest*
8690e634 9081
c0c3707f
CB
9082 ;;
9083 *) gl_cv_func_frexp_works="guessing yes" ;;
9084 esac
8690e634 9085
c0c3707f
CB
9086else
9087 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9088/* end confdefs.h. */
8690e634 9089
c0c3707f
CB
9090#include <float.h>
9091#include <math.h>
9092#include <string.h>
9093#if HAVE_DECL_ALARM
9094# include <signal.h>
9095# include <unistd.h>
9096#endif
9097/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
9098 ICC 10.0 has a bug when optimizing the expression -zero.
9099 The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
9100 to PowerPC on Mac OS X 10.5. */
9101#if defined __hpux || defined __sgi || defined __ICC
9102static double
9103compute_minus_zero (void)
9104{
9105 return -DBL_MIN * DBL_MIN;
9106}
9107# define minus_zero compute_minus_zero ()
9108#else
9109double minus_zero = -0.0;
9110#endif
9111int main()
9112{
9113 int result = 0;
9114 int i;
9115 volatile double x;
9116 double zero = 0.0;
9117#if HAVE_DECL_ALARM
9118 /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
9119 number. Let the test fail in this case. */
9120 signal (SIGALRM, SIG_DFL);
9121 alarm (5);
9122#endif
9123 /* Test on denormalized numbers. */
9124 for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
9125 ;
9126 if (x > 0.0)
9127 {
9128 int exp;
9129 double y = frexp (x, &exp);
9130 /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
9131 On NetBSD: y = 0.75. Correct: y = 0.5. */
9132 if (y != 0.5)
9133 result |= 1;
9134 }
9135 /* Test on infinite numbers. */
9136 x = 1.0 / zero;
9137 {
9138 int exp;
9139 double y = frexp (x, &exp);
9140 if (y != x)
9141 result |= 2;
9142 }
9143 /* Test on negative zero. */
9144 x = minus_zero;
9145 {
9146 int exp;
9147 double y = frexp (x, &exp);
9148 if (memcmp (&y, &x, sizeof x))
9149 result |= 4;
9150 }
9151 return result;
9152}
9153_ACEOF
9154if ac_fn_c_try_run "$LINENO"; then :
9155 gl_cv_func_frexp_works=yes
9156else
9157 gl_cv_func_frexp_works=no
9158fi
9159rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9160 conftest.$ac_objext conftest.beam conftest.$ac_ext
9161fi
472fa5ee
SM
9162
9163
c0c3707f
CB
9164fi
9165{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
9166$as_echo "$gl_cv_func_frexp_works" >&6; }
472fa5ee 9167
c0c3707f
CB
9168 LIBS="$save_LIBS"
9169 case "$gl_cv_func_frexp_works" in
9170 *yes) gl_func_frexp=yes ;;
9171 *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;;
9172 esac
9173 else
9174 gl_func_frexp=no
9175 fi
9176 if test $gl_func_frexp = yes; then
472fa5ee 9177
c0c3707f 9178$as_echo "#define HAVE_FREXP 1" >>confdefs.h
472fa5ee 9179
c0c3707f 9180 fi
8690e634 9181
6ec2e0f5
SDJ
9182
9183
c0c3707f
CB
9184 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
9185$as_echo_n "checking whether long double and double are the same... " >&6; }
9186if ${gl_cv_long_double_equals_double+:} false; then :
8690e634
JK
9187 $as_echo_n "(cached) " >&6
9188else
c0c3707f
CB
9189 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9190/* end confdefs.h. */
9191#include <float.h>
9192int
9193main ()
9194{
9195typedef int check[sizeof (long double) == sizeof (double)
9196 && LDBL_MANT_DIG == DBL_MANT_DIG
9197 && LDBL_MAX_EXP == DBL_MAX_EXP
9198 && LDBL_MIN_EXP == DBL_MIN_EXP
9199 ? 1 : -1];
8690e634 9200
c0c3707f
CB
9201 ;
9202 return 0;
9203}
9204_ACEOF
9205if ac_fn_c_try_compile "$LINENO"; then :
9206 gl_cv_long_double_equals_double=yes
9207else
9208 gl_cv_long_double_equals_double=no
9209fi
9210rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9211
c0c3707f
CB
9212fi
9213{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
9214$as_echo "$gl_cv_long_double_equals_double" >&6; }
9215 if test $gl_cv_long_double_equals_double = yes; then
8690e634 9216
c0c3707f 9217$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
6ec2e0f5 9218
c0c3707f
CB
9219 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
9220 else
9221 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
9222 fi
8690e634 9223
6ec2e0f5 9224
6ec2e0f5 9225
6ec2e0f5
SDJ
9226
9227
6ec2e0f5 9228
8690e634
JK
9229
9230
c0c3707f
CB
9231 ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
9232"
9233if test "x$ac_cv_have_decl_frexpl" = xyes; then :
8690e634 9234
c0c3707f
CB
9235else
9236 HAVE_DECL_FREXPL=0
9237fi
8690e634 9238
6ec2e0f5 9239
c0c3707f
CB
9240 FREXPL_LIBM=
9241 if test $HAVE_DECL_FREXPL = 1; then
6ec2e0f5 9242
c0c3707f
CB
9243 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
9244$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
9245if ${gl_cv_func_frexpl_no_libm+:} false; then :
8690e634
JK
9246 $as_echo_n "(cached) " >&6
9247else
c0c3707f
CB
9248
9249 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 9250/* end confdefs.h. */
c0c3707f
CB
9251#include <math.h>
9252 long double x;
9253int
9254main ()
9255{
9256int e; return frexpl (x, &e) > 0;
9257 ;
9258 return 0;
9259}
9260_ACEOF
9261if ac_fn_c_try_link "$LINENO"; then :
9262 gl_cv_func_frexpl_no_libm=yes
9263else
9264 gl_cv_func_frexpl_no_libm=no
9265fi
9266rm -f core conftest.err conftest.$ac_objext \
9267 conftest$ac_exeext conftest.$ac_ext
8690e634 9268
c0c3707f
CB
9269fi
9270{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
9271$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
6ec2e0f5 9272
c0c3707f
CB
9273 if test $gl_cv_func_frexpl_no_libm = no; then
9274 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5
9275$as_echo_n "checking whether frexpl() can be used with libm... " >&6; }
9276if ${gl_cv_func_frexpl_in_libm+:} false; then :
9277 $as_echo_n "(cached) " >&6
9278else
6ec2e0f5 9279
c0c3707f
CB
9280 save_LIBS="$LIBS"
9281 LIBS="$LIBS -lm"
9282 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9283/* end confdefs.h. */
9284#include <math.h>
9285 long double x;
9286int
9287main ()
9288{
9289int e; return frexpl (x, &e) > 0;
9290 ;
9291 return 0;
9292}
9293_ACEOF
9294if ac_fn_c_try_link "$LINENO"; then :
9295 gl_cv_func_frexpl_in_libm=yes
9296else
9297 gl_cv_func_frexpl_in_libm=no
9298fi
9299rm -f core conftest.err conftest.$ac_objext \
9300 conftest$ac_exeext conftest.$ac_ext
9301 LIBS="$save_LIBS"
6ec2e0f5 9302
c0c3707f
CB
9303fi
9304{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5
9305$as_echo "$gl_cv_func_frexpl_in_libm" >&6; }
9306 if test $gl_cv_func_frexpl_in_libm = yes; then
9307 FREXPL_LIBM=-lm
9308 fi
9309 fi
9310 if test $gl_cv_func_frexpl_no_libm = yes \
9311 || test $gl_cv_func_frexpl_in_libm = yes; then
9312 save_LIBS="$LIBS"
9313 LIBS="$LIBS $FREXPL_LIBM"
8690e634 9314
8690e634 9315
c0c3707f
CB
9316 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
9317$as_echo_n "checking whether frexpl works... " >&6; }
9318if ${gl_cv_func_frexpl_works+:} false; then :
9319 $as_echo_n "(cached) " >&6
9320else
8690e634 9321
c0c3707f 9322 if test "$cross_compiling" = yes; then :
8690e634 9323
c0c3707f
CB
9324 case "$host_os" in
9325 aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
9326 gl_cv_func_frexpl_works="guessing no";;
9327 *) gl_cv_func_frexpl_works="guessing yes";;
9328 esac
8690e634 9329
c0c3707f
CB
9330else
9331 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9332/* end confdefs.h. */
8690e634 9333
c0c3707f
CB
9334#include <float.h>
9335#include <math.h>
9336/* Override the values of <float.h>, like done in float.in.h. */
9337#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
9338# undef LDBL_MIN_EXP
9339# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9340#endif
c0c3707f
CB
9341#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
9342# undef LDBL_MIN_EXP
9343# define LDBL_MIN_EXP (-16381)
6ec2e0f5 9344#endif
c0c3707f
CB
9345#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
9346# undef LDBL_MIN_EXP
9347# define LDBL_MIN_EXP DBL_MIN_EXP
6ec2e0f5 9348#endif
c0c3707f
CB
9349#if defined __sgi && (LDBL_MANT_DIG >= 106)
9350# if defined __GNUC__
9351# undef LDBL_MIN_EXP
9352# define LDBL_MIN_EXP DBL_MIN_EXP
9353# endif
6ec2e0f5 9354#endif
c0c3707f
CB
9355extern
9356#ifdef __cplusplus
9357"C"
9358#endif
9359long double frexpl (long double, int *);
9360int main()
8690e634 9361{
c0c3707f
CB
9362 int result = 0;
9363 volatile long double x;
9364 /* Test on finite numbers that fails on AIX 5.1. */
9365 x = 16.0L;
9366 {
9367 int exp = -9999;
9368 frexpl (x, &exp);
9369 if (exp != 5)
9370 result |= 1;
9371 }
9372 /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
9373 function returns an invalid (incorrectly normalized) value: it returns
9374 y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
9375 but the correct result is
9376 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */
9377 x = 1.01L;
9378 {
9379 int exp = -9999;
9380 long double y = frexpl (x, &exp);
9381 if (!(exp == 1 && y == 0.505L))
9382 result |= 2;
9383 }
9384 /* Test on large finite numbers. This fails on BeOS at i = 16322, while
9385 LDBL_MAX_EXP = 16384.
9386 In the loop end test, we test x against Infinity, rather than comparing
9387 i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */
9388 {
9389 int i;
9390 for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
9391 {
9392 int exp = -9999;
9393 frexpl (x, &exp);
9394 if (exp != i)
9395 {
9396 result |= 4;
9397 break;
9398 }
9399 }
9400 }
9401 /* Test on denormalized numbers. */
9402 {
9403 int i;
9404 for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
9405 ;
9406 if (x > 0.0L)
9407 {
9408 int exp;
9409 long double y = frexpl (x, &exp);
9410 /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
9411 exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
9412 if (exp != LDBL_MIN_EXP - 1)
9413 result |= 8;
9414 }
9415 }
9416 /* Test on infinite numbers. */
9417 x = 1.0L / 0.0L;
9418 {
9419 int exp;
9420 long double y = frexpl (x, &exp);
9421 if (y != x)
9422 result |= 16;
9423 }
9424 return result;
8690e634
JK
9425}
9426_ACEOF
c0c3707f
CB
9427if ac_fn_c_try_run "$LINENO"; then :
9428 gl_cv_func_frexpl_works=yes
6ec2e0f5 9429else
c0c3707f
CB
9430 gl_cv_func_frexpl_works=no
9431fi
9432rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9433 conftest.$ac_objext conftest.beam conftest.$ac_ext
9434fi
8690e634 9435
8690e634 9436
c0c3707f
CB
9437fi
9438{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
9439$as_echo "$gl_cv_func_frexpl_works" >&6; }
8690e634 9440
c0c3707f
CB
9441 LIBS="$save_LIBS"
9442 case "$gl_cv_func_frexpl_works" in
9443 *yes) gl_func_frexpl=yes ;;
9444 *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
9445 esac
9446 else
9447 gl_func_frexpl=no
9448 fi
9449 if test $gl_func_frexpl = yes; then
8690e634 9450
c0c3707f 9451$as_echo "#define HAVE_FREXPL 1" >>confdefs.h
8690e634 9452
c0c3707f
CB
9453 fi
9454 fi
9455 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
9456 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
8690e634 9457
c0c3707f
CB
9458 FREXPL_LIBM="$FREXP_LIBM"
9459 else
9460 FREXPL_LIBM=
9461 fi
9462 fi
6ec2e0f5 9463
6ec2e0f5 9464
6ec2e0f5 9465
c0c3707f
CB
9466 GNULIB_FCHMODAT=0;
9467 GNULIB_FSTAT=0;
9468 GNULIB_FSTATAT=0;
9469 GNULIB_FUTIMENS=0;
9470 GNULIB_LCHMOD=0;
9471 GNULIB_LSTAT=0;
9472 GNULIB_MKDIRAT=0;
9473 GNULIB_MKFIFO=0;
9474 GNULIB_MKFIFOAT=0;
9475 GNULIB_MKNOD=0;
9476 GNULIB_MKNODAT=0;
9477 GNULIB_STAT=0;
9478 GNULIB_UTIMENSAT=0;
9479 GNULIB_OVERRIDES_STRUCT_STAT=0;
9480 HAVE_FCHMODAT=1;
9481 HAVE_FSTATAT=1;
9482 HAVE_FUTIMENS=1;
9483 HAVE_LCHMOD=1;
9484 HAVE_LSTAT=1;
9485 HAVE_MKDIRAT=1;
9486 HAVE_MKFIFO=1;
9487 HAVE_MKFIFOAT=1;
9488 HAVE_MKNOD=1;
9489 HAVE_MKNODAT=1;
9490 HAVE_UTIMENSAT=1;
9491 REPLACE_FSTAT=0;
9492 REPLACE_FSTATAT=0;
9493 REPLACE_FUTIMENS=0;
9494 REPLACE_LSTAT=0;
9495 REPLACE_MKDIR=0;
9496 REPLACE_MKFIFO=0;
9497 REPLACE_MKNOD=0;
9498 REPLACE_STAT=0;
9499 REPLACE_UTIMENSAT=0;
9500
9501{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
9502$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
9503if ${ac_cv_header_stat_broken+:} false; then :
9504 $as_echo_n "(cached) " >&6
9505else
9506 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9507/* end confdefs.h. */
9508#include <sys/types.h>
9509#include <sys/stat.h>
9510
9511#if defined S_ISBLK && defined S_IFDIR
9512extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
9513#endif
9514
9515#if defined S_ISBLK && defined S_IFCHR
9516extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
9517#endif
9518
9519#if defined S_ISLNK && defined S_IFREG
9520extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
9521#endif
8690e634 9522
c0c3707f
CB
9523#if defined S_ISSOCK && defined S_IFREG
9524extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
9525#endif
8690e634 9526
c0c3707f
CB
9527_ACEOF
9528if ac_fn_c_try_compile "$LINENO"; then :
9529 ac_cv_header_stat_broken=no
9530else
9531 ac_cv_header_stat_broken=yes
6ec2e0f5
SDJ
9532fi
9533rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 9534fi
c0c3707f
CB
9535{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
9536$as_echo "$ac_cv_header_stat_broken" >&6; }
9537if test $ac_cv_header_stat_broken = yes; then
8690e634 9538
c0c3707f 9539$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
49e4877c 9540
c0c3707f 9541fi
49e4877c
PA
9542
9543
9544
9545
8690e634 9546
c0c3707f
CB
9547 case "$host_os" in
9548 mingw*)
9549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
9550$as_echo_n "checking for 64-bit off_t... " >&6; }
9551if ${gl_cv_type_off_t_64+:} false; then :
9552 $as_echo_n "(cached) " >&6
9553else
9554 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9555/* end confdefs.h. */
9556#include <sys/types.h>
9557 int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
8690e634 9558
6ec2e0f5
SDJ
9559int
9560main ()
9561{
8690e634 9562
6ec2e0f5
SDJ
9563 ;
9564 return 0;
9565}
9566_ACEOF
9567if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
9568 gl_cv_type_off_t_64=yes
9569else
9570 gl_cv_type_off_t_64=no
6ec2e0f5
SDJ
9571fi
9572rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9573
c0c3707f
CB
9574fi
9575{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
9576$as_echo "$gl_cv_type_off_t_64" >&6; }
9577 if test $gl_cv_type_off_t_64 = no; then
9578 WINDOWS_64_BIT_OFF_T=1
9579 else
9580 WINDOWS_64_BIT_OFF_T=0
9581 fi
9582 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5
9583$as_echo_n "checking for 64-bit st_size... " >&6; }
9584if ${gl_cv_member_st_size_64+:} false; then :
6ec2e0f5
SDJ
9585 $as_echo_n "(cached) " >&6
9586else
c0c3707f 9587 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 9588/* end confdefs.h. */
c0c3707f
CB
9589#include <sys/types.h>
9590 struct stat buf;
9591 int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
8690e634 9592
6ec2e0f5
SDJ
9593int
9594main ()
9595{
8690e634 9596
6ec2e0f5
SDJ
9597 ;
9598 return 0;
9599}
9600_ACEOF
9601if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
9602 gl_cv_member_st_size_64=yes
9603else
9604 gl_cv_member_st_size_64=no
6ec2e0f5
SDJ
9605fi
9606rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9607
6ec2e0f5 9608fi
c0c3707f
CB
9609{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5
9610$as_echo "$gl_cv_member_st_size_64" >&6; }
9611 if test $gl_cv_member_st_size_64 = no; then
9612 WINDOWS_64_BIT_ST_SIZE=1
9613 else
9614 WINDOWS_64_BIT_ST_SIZE=0
9615 fi
9616 ;;
9617 *)
9618 WINDOWS_64_BIT_OFF_T=0
9619 WINDOWS_64_BIT_ST_SIZE=0
9620 ;;
9621 esac
8690e634
JK
9622
9623
9624
9625
9626
9627
c0c3707f
CB
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637 if test $gl_cv_have_include_next = yes; then
9638 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
9639 else
9640 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
9641$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
9642if ${gl_cv_next_sys_stat_h+:} false; then :
8690e634
JK
9643 $as_echo_n "(cached) " >&6
9644else
9645
c0c3707f 9646 if test $ac_cv_header_sys_stat_h = yes; then
4a626d0a
PA
9647
9648
4a626d0a 9649
c0c3707f
CB
9650
9651 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9652/* end confdefs.h. */
9653#include <sys/stat.h>
6ec2e0f5 9654_ACEOF
c0c3707f
CB
9655 case "$host_os" in
9656 aix*) gl_absname_cpp="$ac_cpp -C" ;;
9657 *) gl_absname_cpp="$ac_cpp" ;;
9658 esac
9659
9660 case "$host_os" in
9661 mingw*)
9662 gl_dirsep_regex='[/\\]'
9663 ;;
9664 *)
9665 gl_dirsep_regex='\/'
9666 ;;
9667 esac
9668 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
9669 gl_header_literal_regex=`echo 'sys/stat.h' \
9670 | sed -e "$gl_make_literal_regex_sed"`
9671 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
9672 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
9673 s|^/[^/]|//&|
9674 p
9675 q
9676 }'
9677
9678 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
9679 sed -n "$gl_absolute_header_sed"`
9680
9681 gl_header=$gl_cv_absolute_sys_stat_h
9682 gl_cv_next_sys_stat_h='"'$gl_header'"'
9683 else
9684 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
9685 fi
9686
9687
9688fi
9689{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
9690$as_echo "$gl_cv_next_sys_stat_h" >&6; }
9691 fi
9692 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
9693
9694 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
9695 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
9696 gl_next_as_first_directive='<'sys/stat.h'>'
9697 else
9698 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
9699 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
9700 fi
9701 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
9702
9703
9704
9705
9706
9707
9708
9709
9710 WINDOWS_STAT_TIMESPEC=0
9711
9712
9713
9714
4a626d0a 9715
4a626d0a 9716
8690e634
JK
9717
9718
c0c3707f
CB
9719 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
9720 #include <sys/stat.h>
9721"
9722if test "x$ac_cv_type_nlink_t" = xyes; then :
8690e634 9723
6ec2e0f5 9724else
8690e634 9725
c0c3707f 9726$as_echo "#define nlink_t int" >>confdefs.h
6ec2e0f5 9727
6ec2e0f5 9728fi
8690e634
JK
9729
9730
9731
9732
9733
9734
9735
c0c3707f
CB
9736 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
9737$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
9738if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
8690e634 9739 $as_echo_n "(cached) " >&6
c0c3707f
CB
9740else
9741 rm -f conftest.sym conftest.file
9742 echo >conftest.file
9743 if test "$cross_compiling" = yes; then :
9744 case "$host_os" in
9745 linux-* | linux)
9746 # Guess yes on Linux systems.
9747 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
9748 *-gnu* | gnu*)
9749 # Guess yes on glibc systems.
9750 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
9751 mingw*)
9752 # Guess no on native Windows.
9753 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
9754 *)
9755 # If we don't know, obey --enable-cross-guesses.
9756 gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
9757 esac
9758
8690e634
JK
9759else
9760 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9761/* end confdefs.h. */
c0c3707f 9762$ac_includes_default
8690e634
JK
9763int
9764main ()
9765{
c0c3707f
CB
9766struct stat sbuf;
9767 if (symlink ("conftest.file", "conftest.sym") != 0)
9768 return 1;
9769 /* Linux will dereference the symlink and fail, as required by
9770 POSIX. That is better in the sense that it means we will not
9771 have to compile and use the lstat wrapper. */
9772 return lstat ("conftest.sym/", &sbuf) == 0;
6ec2e0f5 9773
8690e634
JK
9774 ;
9775 return 0;
9776}
9777_ACEOF
c0c3707f
CB
9778if ac_fn_c_try_run "$LINENO"; then :
9779 gl_cv_func_lstat_dereferences_slashed_symlink=yes
8690e634 9780else
c0c3707f 9781 gl_cv_func_lstat_dereferences_slashed_symlink=no
8690e634 9782fi
c0c3707f
CB
9783rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9784 conftest.$ac_objext conftest.beam conftest.$ac_ext
9785fi
9786
9787 rm -f conftest.sym conftest.file
6ec2e0f5 9788
8690e634 9789fi
c0c3707f
CB
9790{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
9791$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
9792 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
9793 *yes)
9794
9795cat >>confdefs.h <<_ACEOF
9796#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
8690e634
JK
9797_ACEOF
9798
c0c3707f
CB
9799 ;;
9800 esac
8690e634 9801
8690e634 9802
8690e634 9803
8690e634 9804
c0c3707f
CB
9805
9806 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
9807$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
9808if ${gl_cv_func_getcwd_null+:} false; then :
8690e634
JK
9809 $as_echo_n "(cached) " >&6
9810else
c0c3707f
CB
9811 if test "$cross_compiling" = yes; then :
9812 case "$host_os" in
9813 # Guess yes on glibc systems.
9814 *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
9815 # Guess yes on musl systems.
9816 *-musl*) gl_cv_func_getcwd_null="guessing yes";;
9817 # Guess yes on Cygwin.
9818 cygwin*) gl_cv_func_getcwd_null="guessing yes";;
9819 # If we don't know, obey --enable-cross-guesses.
9820 *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
9821 esac
9822
9823else
9824 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
9825/* end confdefs.h. */
9826
c0c3707f
CB
9827# include <stdlib.h>
9828# if HAVE_UNISTD_H
9829# include <unistd.h>
9830# else /* on Windows with MSVC */
9831# include <direct.h>
9832# endif
9833# ifndef getcwd
9834 char *getcwd ();
9835# endif
8690e634
JK
9836
9837int
9838main ()
9839{
9840
c0c3707f
CB
9841#if defined _WIN32 && ! defined __CYGWIN__
9842/* mingw cwd does not start with '/', but getcwd does allocate.
9843 However, mingw fails to honor non-zero size. */
9844#else
9845 if (chdir ("/") != 0)
9846 return 1;
9847 else
9848 {
9849 char *f = getcwd (NULL, 0);
9850 if (! f)
9851 return 2;
9852 if (f[0] != '/')
9853 { free (f); return 3; }
9854 if (f[1] != '\0')
9855 { free (f); return 4; }
9856 free (f);
9857 return 0;
9858 }
9859#endif
9860
8690e634
JK
9861 ;
9862 return 0;
9863}
9864_ACEOF
c0c3707f
CB
9865if ac_fn_c_try_run "$LINENO"; then :
9866 gl_cv_func_getcwd_null=yes
9867else
9868 gl_cv_func_getcwd_null=no
8690e634 9869fi
c0c3707f
CB
9870rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9871 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 9872fi
8690e634 9873
c0c3707f
CB
9874fi
9875{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
9876$as_echo "$gl_cv_func_getcwd_null" >&6; }
8690e634 9877
6ec2e0f5 9878
c0c3707f
CB
9879 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
9880$as_echo_n "checking for getcwd with POSIX signature... " >&6; }
9881if ${gl_cv_func_getcwd_posix_signature+:} false; then :
8690e634
JK
9882 $as_echo_n "(cached) " >&6
9883else
c0c3707f 9884 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 9885/* end confdefs.h. */
c0c3707f 9886#include <unistd.h>
88b48903
WN
9887int
9888main ()
9889{
c0c3707f
CB
9890extern
9891 #ifdef __cplusplus
9892 "C"
9893 #endif
9894 char *getcwd (char *, size_t);
88b48903
WN
9895
9896 ;
9897 return 0;
9898}
c0c3707f 9899
88b48903
WN
9900_ACEOF
9901if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f
CB
9902 gl_cv_func_getcwd_posix_signature=yes
9903else
9904 gl_cv_func_getcwd_posix_signature=no
8690e634 9905fi
88b48903 9906rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 9907
c0c3707f
CB
9908fi
9909{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
9910$as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
8690e634 9911
c0c3707f
CB
9912ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default"
9913if test "x$ac_cv_have_decl_getcwd" = xyes; then :
9914 ac_have_decl=1
9915else
9916 ac_have_decl=0
9917fi
8690e634 9918
c0c3707f
CB
9919cat >>confdefs.h <<_ACEOF
9920#define HAVE_DECL_GETCWD $ac_have_decl
9921_ACEOF
8690e634
JK
9922
9923
7a6dbc2f 9924
c0c3707f
CB
9925ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
9926if test "x$ac_cv_have_decl_getdtablesize" = xyes; then :
9927 ac_have_decl=1
88b48903 9928else
c0c3707f 9929 ac_have_decl=0
88b48903 9930fi
8690e634 9931
c0c3707f
CB
9932cat >>confdefs.h <<_ACEOF
9933#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
9934_ACEOF
8690e634 9935
c0c3707f
CB
9936ac_fn_c_check_decl "$LINENO" "getlogin_r" "ac_cv_have_decl_getlogin_r" "$ac_includes_default"
9937if test "x$ac_cv_have_decl_getlogin_r" = xyes; then :
9938 ac_have_decl=1
9939else
9940 ac_have_decl=0
9941fi
8690e634 9942
c0c3707f
CB
9943cat >>confdefs.h <<_ACEOF
9944#define HAVE_DECL_GETLOGIN_R $ac_have_decl
9945_ACEOF
8690e634
JK
9946
9947
6ec2e0f5 9948
c0c3707f
CB
9949ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default"
9950if test "x$ac_cv_have_decl_getlogin" = xyes; then :
9951 ac_have_decl=1
6ec2e0f5 9952else
c0c3707f 9953 ac_have_decl=0
88b48903 9954fi
8690e634 9955
c0c3707f
CB
9956cat >>confdefs.h <<_ACEOF
9957#define HAVE_DECL_GETLOGIN $ac_have_decl
9958_ACEOF
8690e634
JK
9959
9960
9961
c0c3707f
CB
9962 case $host_os in
9963 mingw*)
9964 LIB_GETLOGIN='-ladvapi32' ;;
9965 *)
9966 LIB_GETLOGIN= ;;
9967 esac
6ec2e0f5 9968
472fa5ee
SM
9969
9970
9971
6ec2e0f5
SDJ
9972
9973
9974
c0c3707f
CB
9975 GNULIB_GETTIMEOFDAY=0;
9976 HAVE_GETTIMEOFDAY=1;
9977 HAVE_STRUCT_TIMEVAL=1;
9978 HAVE_SYS_TIME_H=1;
9979 REPLACE_GETTIMEOFDAY=0;
9980 REPLACE_STRUCT_TIMEVAL=0;
472fa5ee 9981
c0c3707f
CB
9982{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
9983$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
9984if ${ac_cv_c_restrict+:} false; then :
9985 $as_echo_n "(cached) " >&6
9986else
9987 ac_cv_c_restrict=no
9988 # The order here caters to the fact that C++ does not require restrict.
9989 for ac_kw in __restrict __restrict__ _Restrict restrict; do
9990 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9991/* end confdefs.h. */
9992typedef int *int_ptr;
9993 int foo (int_ptr $ac_kw ip) { return ip[0]; }
9994 int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
9995 int bar (int ip[$ac_kw]) { return ip[0]; }
472fa5ee 9996
c0c3707f
CB
9997int
9998main ()
9999{
10000int s[1];
10001 int *$ac_kw t = s;
10002 t[0] = 0;
10003 return foo (t) + bar (t);
472fa5ee 10004
c0c3707f
CB
10005 ;
10006 return 0;
10007}
10008_ACEOF
10009if ac_fn_c_try_compile "$LINENO"; then :
10010 ac_cv_c_restrict=$ac_kw
10011fi
10012rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10013 test "$ac_cv_c_restrict" != no && break
10014 done
472fa5ee 10015
c0c3707f
CB
10016fi
10017{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
10018$as_echo "$ac_cv_c_restrict" >&6; }
472fa5ee 10019
c0c3707f
CB
10020 case $ac_cv_c_restrict in
10021 restrict) ;;
10022 no) $as_echo "#define restrict /**/" >>confdefs.h
10023 ;;
10024 *) cat >>confdefs.h <<_ACEOF
10025#define restrict $ac_cv_c_restrict
10026_ACEOF
10027 ;;
10028 esac
472fa5ee
SM
10029
10030
6ec2e0f5
SDJ
10031
10032
10033
10034
10035
10036
472fa5ee
SM
10037
10038
10039
6ec2e0f5
SDJ
10040
10041
10042
10043
10044
10045 if test $gl_cv_have_include_next = yes; then
c0c3707f 10046 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10047 else
c0c3707f
CB
10048 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
10049$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
10050if ${gl_cv_next_sys_time_h+:} false; then :
6ec2e0f5 10051 $as_echo_n "(cached) " >&6
88b48903 10052else
8690e634 10053
c0c3707f 10054 if test $ac_cv_header_sys_time_h = yes; then
8690e634
JK
10055
10056
8690e634
JK
10057
10058
6ec2e0f5
SDJ
10059 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10060/* end confdefs.h. */
c0c3707f 10061#include <sys/time.h>
88b48903 10062_ACEOF
6ec2e0f5
SDJ
10063 case "$host_os" in
10064 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10065 *) gl_absname_cpp="$ac_cpp" ;;
10066 esac
8690e634 10067
6ec2e0f5
SDJ
10068 case "$host_os" in
10069 mingw*)
10070 gl_dirsep_regex='[/\\]'
10071 ;;
10072 *)
10073 gl_dirsep_regex='\/'
88b48903
WN
10074 ;;
10075 esac
6ec2e0f5 10076 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 10077 gl_header_literal_regex=`echo 'sys/time.h' \
6ec2e0f5
SDJ
10078 | sed -e "$gl_make_literal_regex_sed"`
10079 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10080 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10081 s|^/[^/]|//&|
10082 p
10083 q
10084 }'
8690e634 10085
c0c3707f 10086 gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5 10087 sed -n "$gl_absolute_header_sed"`
8690e634 10088
c0c3707f
CB
10089 gl_header=$gl_cv_absolute_sys_time_h
10090 gl_cv_next_sys_time_h='"'$gl_header'"'
6ec2e0f5 10091 else
c0c3707f 10092 gl_cv_next_sys_time_h='<'sys/time.h'>'
6ec2e0f5 10093 fi
88b48903 10094
88b48903 10095
88b48903 10096fi
c0c3707f
CB
10097{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
10098$as_echo "$gl_cv_next_sys_time_h" >&6; }
6ec2e0f5 10099 fi
c0c3707f 10100 NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
88b48903 10101
6ec2e0f5
SDJ
10102 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10103 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 10104 gl_next_as_first_directive='<'sys/time.h'>'
6ec2e0f5
SDJ
10105 else
10106 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f
CB
10107 gl_next_as_first_directive=$gl_cv_next_sys_time_h
10108 fi
10109 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
6ec2e0f5 10110
6ec2e0f5
SDJ
10111
10112
10113
6ec2e0f5 10114
c0c3707f
CB
10115 if test $ac_cv_header_sys_time_h != yes; then
10116 HAVE_SYS_TIME_H=0
10117 fi
6ec2e0f5 10118
6ec2e0f5 10119
6ec2e0f5 10120
6ec2e0f5 10121
6ec2e0f5 10122
c0c3707f
CB
10123 if test $ac_cv_header_sys_socket_h != yes; then
10124 for ac_header in winsock2.h
10125do :
10126 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
10127if test "x$ac_cv_header_winsock2_h" = xyes; then :
10128 cat >>confdefs.h <<_ACEOF
10129#define HAVE_WINSOCK2_H 1
6ec2e0f5 10130_ACEOF
6ec2e0f5 10131
6ec2e0f5 10132fi
6ec2e0f5 10133
c0c3707f 10134done
6ec2e0f5 10135
c0c3707f
CB
10136 fi
10137 if test "$ac_cv_header_winsock2_h" = yes; then
10138 HAVE_WINSOCK2_H=1
10139 UNISTD_H_HAVE_WINSOCK2_H=1
10140 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
10141 else
10142 HAVE_WINSOCK2_H=0
10143 fi
10144
10145
10146 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
10147$as_echo_n "checking for struct timeval... " >&6; }
10148if ${gl_cv_sys_struct_timeval+:} false; then :
10149 $as_echo_n "(cached) " >&6
10150else
10151 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 10152/* end confdefs.h. */
c0c3707f
CB
10153#if HAVE_SYS_TIME_H
10154 #include <sys/time.h>
10155 #endif
10156 #include <time.h>
10157 #if HAVE_WINSOCK2_H
10158 # include <winsock2.h>
10159 #endif
6ec2e0f5
SDJ
10160
10161int
10162main ()
10163{
c0c3707f 10164static struct timeval x; x.tv_sec = x.tv_usec;
6ec2e0f5
SDJ
10165 ;
10166 return 0;
10167}
10168_ACEOF
10169if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10170 gl_cv_sys_struct_timeval=yes
6ec2e0f5 10171else
c0c3707f 10172 gl_cv_sys_struct_timeval=no
6ec2e0f5
SDJ
10173fi
10174rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
88b48903 10175
c0c3707f
CB
10176fi
10177{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
10178$as_echo "$gl_cv_sys_struct_timeval" >&6; }
10179 if test $gl_cv_sys_struct_timeval != yes; then
10180 HAVE_STRUCT_TIMEVAL=0
10181 else
10182 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
10183$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
10184if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then :
10185 $as_echo_n "(cached) " >&6
10186else
10187 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88b48903 10188/* end confdefs.h. */
c0c3707f
CB
10189#if HAVE_SYS_TIME_H
10190 #include <sys/time.h>
10191 #endif
10192 #include <time.h>
10193 #if HAVE_WINSOCK2_H
10194 # include <winsock2.h>
10195 #endif
88b48903
WN
10196
10197int
10198main ()
10199{
c0c3707f
CB
10200static struct timeval x;
10201 typedef int verify_tv_sec_type[
10202 sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
10203 ];
88b48903
WN
10204
10205 ;
10206 return 0;
10207}
10208_ACEOF
10209if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10210 gl_cv_sys_struct_timeval_tv_sec=yes
88b48903 10211else
c0c3707f 10212 gl_cv_sys_struct_timeval_tv_sec=no
88b48903
WN
10213fi
10214rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10215
88b48903 10216fi
c0c3707f
CB
10217{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
10218$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
10219 if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
10220 REPLACE_STRUCT_TIMEVAL=1
88b48903 10221 fi
c0c3707f 10222 fi
88b48903 10223
c0c3707f
CB
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234 NEED_LOCALTIME_BUFFER=0
10235
10236
10237 GNULIB_CTIME=0;
10238 GNULIB_MKTIME=0;
10239 GNULIB_LOCALTIME=0;
10240 GNULIB_NANOSLEEP=0;
10241 GNULIB_STRFTIME=0;
10242 GNULIB_STRPTIME=0;
10243 GNULIB_TIMEGM=0;
10244 GNULIB_TIME_R=0;
10245 GNULIB_TIME_RZ=0;
10246 GNULIB_TZSET=0;
10247 HAVE_DECL_LOCALTIME_R=1;
10248 HAVE_NANOSLEEP=1;
10249 HAVE_STRPTIME=1;
10250 HAVE_TIMEGM=1;
10251 HAVE_TZSET=1;
10252 HAVE_TIMEZONE_T=0;
10253 REPLACE_CTIME=GNULIB_PORTCHECK;
10254 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
10255 REPLACE_MKTIME=GNULIB_PORTCHECK;
10256 REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
10257 REPLACE_STRFTIME=GNULIB_PORTCHECK;
10258 REPLACE_TIMEGM=GNULIB_PORTCHECK;
10259 REPLACE_TZSET=GNULIB_PORTCHECK;
10260
10261 : ${GNULIB_GETTIMEOFDAY=0};
10262 REPLACE_GMTIME=0;
10263 REPLACE_LOCALTIME=0;
10264
10265
10266 GNULIB_GLOB=0;
10267 HAVE_GLOB=1;
10268 HAVE_GLOB_PATTERN_P=1;
10269 REPLACE_GLOB=0;
10270 REPLACE_GLOB_PATTERN_P=0;
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288 if test $gl_cv_have_include_next = yes; then
10289 gl_cv_next_glob_h='<'glob.h'>'
10290 else
10291 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <glob.h>" >&5
10292$as_echo_n "checking absolute name of <glob.h>... " >&6; }
10293if ${gl_cv_next_glob_h+:} false; then :
10294 $as_echo_n "(cached) " >&6
88b48903 10295else
c0c3707f
CB
10296
10297 if test $ac_cv_header_glob_h = yes; then
10298
10299
10300
10301
88b48903
WN
10302 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10303/* end confdefs.h. */
c0c3707f
CB
10304#include <glob.h>
10305_ACEOF
10306 case "$host_os" in
10307 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10308 *) gl_absname_cpp="$ac_cpp" ;;
10309 esac
88b48903 10310
c0c3707f
CB
10311 case "$host_os" in
10312 mingw*)
10313 gl_dirsep_regex='[/\\]'
10314 ;;
10315 *)
10316 gl_dirsep_regex='\/'
10317 ;;
10318 esac
10319 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10320 gl_header_literal_regex=`echo 'glob.h' \
10321 | sed -e "$gl_make_literal_regex_sed"`
10322 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10323 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10324 s|^/[^/]|//&|
10325 p
10326 q
10327 }'
10328
10329 gl_cv_absolute_glob_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10330 sed -n "$gl_absolute_header_sed"`
10331
10332 gl_header=$gl_cv_absolute_glob_h
10333 gl_cv_next_glob_h='"'$gl_header'"'
10334 else
10335 gl_cv_next_glob_h='<'glob.h'>'
10336 fi
88b48903 10337
88b48903 10338
88b48903 10339fi
c0c3707f
CB
10340{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_glob_h" >&5
10341$as_echo "$gl_cv_next_glob_h" >&6; }
10342 fi
10343 NEXT_GLOB_H=$gl_cv_next_glob_h
88b48903 10344
c0c3707f
CB
10345 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10346 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10347 gl_next_as_first_directive='<'glob.h'>'
10348 else
10349 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10350 gl_next_as_first_directive=$gl_cv_next_glob_h
10351 fi
10352 NEXT_AS_FIRST_DIRECTIVE_GLOB_H=$gl_next_as_first_directive
88b48903 10353
88b48903
WN
10354
10355
10356
2196f55f 10357
c0c3707f
CB
10358 if test $ac_cv_header_glob_h = yes; then
10359 HAVE_GLOB_H=1
10360 else
10361 HAVE_GLOB_H=0
10362 fi
2196f55f 10363
6ec2e0f5 10364
c0c3707f
CB
10365 GLOB_H=''
10366 if false; then
10367 GLOB_H=glob.h
10368 else
10369 if test $ac_cv_header_glob_h != yes; then
10370 GLOB_H=glob.h
10371 fi
10372 fi
10373
10374
10375 if test -n "$GLOB_H"; then
10376 GL_GENERATE_GLOB_H_TRUE=
10377 GL_GENERATE_GLOB_H_FALSE='#'
88b48903 10378else
c0c3707f
CB
10379 GL_GENERATE_GLOB_H_TRUE='#'
10380 GL_GENERATE_GLOB_H_FALSE=
6ec2e0f5
SDJ
10381fi
10382
88b48903 10383
88b48903 10384
88b48903 10385
88b48903
WN
10386
10387
10388
10389
10390
10391
10392
10393
8690e634 10394
c0c3707f
CB
10395
10396
10397 GNULIB_SOCKET=0;
10398 GNULIB_CONNECT=0;
10399 GNULIB_ACCEPT=0;
10400 GNULIB_BIND=0;
10401 GNULIB_GETPEERNAME=0;
10402 GNULIB_GETSOCKNAME=0;
10403 GNULIB_GETSOCKOPT=0;
10404 GNULIB_LISTEN=0;
10405 GNULIB_RECV=0;
10406 GNULIB_SEND=0;
10407 GNULIB_RECVFROM=0;
10408 GNULIB_SENDTO=0;
10409 GNULIB_SETSOCKOPT=0;
10410 GNULIB_SHUTDOWN=0;
10411 GNULIB_ACCEPT4=0;
10412 HAVE_STRUCT_SOCKADDR_STORAGE=1;
10413 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
10414
10415 HAVE_SA_FAMILY_T=1;
10416 HAVE_ACCEPT4=1;
10417
10418
10419
10420
10421
10422 case "$host_os" in
10423 osf*)
10424
10425$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h
10426
10427 ;;
10428 esac
10429
10430 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
10431$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
10432if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then :
10433 $as_echo_n "(cached) " >&6
10434else
10435
10436 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10437/* end confdefs.h. */
10438#include <sys/socket.h>
8690e634
JK
10439int
10440main ()
10441{
10442
8690e634
JK
10443 ;
10444 return 0;
10445}
10446_ACEOF
6ec2e0f5 10447if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10448 gl_cv_header_sys_socket_h_selfcontained=yes
8690e634 10449else
c0c3707f 10450 gl_cv_header_sys_socket_h_selfcontained=no
8690e634 10451fi
6ec2e0f5 10452rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10453
8690e634 10454fi
c0c3707f
CB
10455{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
10456$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
10457 if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
10458 for ac_func in shutdown
10459do :
10460 ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
10461if test "x$ac_cv_func_shutdown" = xyes; then :
10462 cat >>confdefs.h <<_ACEOF
10463#define HAVE_SHUTDOWN 1
10464_ACEOF
6ec2e0f5 10465
c0c3707f
CB
10466fi
10467done
6ec2e0f5 10468
c0c3707f
CB
10469 if test $ac_cv_func_shutdown = yes; then
10470 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
10471$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
10472if ${gl_cv_header_sys_socket_h_shut+:} false; then :
10473 $as_echo_n "(cached) " >&6
10474else
8690e634 10475
c0c3707f
CB
10476 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10477/* end confdefs.h. */
10478#include <sys/socket.h>
6ec2e0f5
SDJ
10479int
10480main ()
10481{
c0c3707f 10482int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
6ec2e0f5
SDJ
10483 ;
10484 return 0;
10485}
10486_ACEOF
10487if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 10488 gl_cv_header_sys_socket_h_shut=yes
6ec2e0f5 10489else
c0c3707f 10490 gl_cv_header_sys_socket_h_shut=no
8690e634 10491fi
6ec2e0f5 10492rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 10493
6ec2e0f5 10494fi
c0c3707f
CB
10495{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
10496$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
10497 if test $gl_cv_header_sys_socket_h_shut = no; then
10498 SYS_SOCKET_H='sys/socket.h'
10499 fi
6ec2e0f5 10500 fi
c0c3707f
CB
10501 fi
10502 # We need to check for ws2tcpip.h now.
8690e634 10503
c0c3707f
CB
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514 if test $gl_cv_have_include_next = yes; then
10515 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
10516 else
10517 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
10518$as_echo_n "checking absolute name of <sys/socket.h>... " >&6; }
10519if ${gl_cv_next_sys_socket_h+:} false; then :
10520 $as_echo_n "(cached) " >&6
6ec2e0f5 10521else
c0c3707f
CB
10522
10523 if test $ac_cv_header_sys_socket_h = yes; then
10524
10525
10526
10527
6ec2e0f5
SDJ
10528 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10529/* end confdefs.h. */
c0c3707f
CB
10530#include <sys/socket.h>
10531_ACEOF
10532 case "$host_os" in
10533 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10534 *) gl_absname_cpp="$ac_cpp" ;;
10535 esac
8690e634 10536
c0c3707f
CB
10537 case "$host_os" in
10538 mingw*)
10539 gl_dirsep_regex='[/\\]'
10540 ;;
10541 *)
10542 gl_dirsep_regex='\/'
10543 ;;
10544 esac
10545 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10546 gl_header_literal_regex=`echo 'sys/socket.h' \
10547 | sed -e "$gl_make_literal_regex_sed"`
10548 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10549 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10550 s|^/[^/]|//&|
10551 p
10552 q
10553 }'
10554
10555 gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10556 sed -n "$gl_absolute_header_sed"`
10557
10558 gl_header=$gl_cv_absolute_sys_socket_h
10559 gl_cv_next_sys_socket_h='"'$gl_header'"'
10560 else
10561 gl_cv_next_sys_socket_h='<'sys/socket.h'>'
10562 fi
6ec2e0f5 10563
6ec2e0f5 10564
6ec2e0f5 10565fi
c0c3707f
CB
10566{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
10567$as_echo "$gl_cv_next_sys_socket_h" >&6; }
10568 fi
10569 NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
8690e634 10570
c0c3707f
CB
10571 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10572 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10573 gl_next_as_first_directive='<'sys/socket.h'>'
10574 else
10575 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10576 gl_next_as_first_directive=$gl_cv_next_sys_socket_h
10577 fi
10578 NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
8690e634 10579
8690e634 10580
6ec2e0f5
SDJ
10581
10582
c0c3707f
CB
10583 if test $ac_cv_header_sys_socket_h = yes; then
10584 HAVE_SYS_SOCKET_H=1
10585 else
10586 HAVE_SYS_SOCKET_H=0
10587 fi
6ec2e0f5 10588
6ec2e0f5 10589
8690e634 10590
c0c3707f
CB
10591 if test $ac_cv_header_sys_socket_h = yes; then
10592 HAVE_WS2TCPIP_H=0
10593 else
10594 if test $ac_cv_header_ws2tcpip_h = yes; then
10595 HAVE_WS2TCPIP_H=1
10596 else
10597 HAVE_WS2TCPIP_H=0
10598 fi
6ec2e0f5 10599 fi
8690e634 10600
472fa5ee 10601
c0c3707f
CB
10602
10603 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
10604 /* sys/types.h is not needed according to POSIX, but the
10605 sys/socket.h in i386-unknown-freebsd4.10 and
10606 powerpc-apple-darwin5.5 required it. */
10607#include <sys/types.h>
10608#ifdef HAVE_SYS_SOCKET_H
10609#include <sys/socket.h>
10610#endif
10611#ifdef HAVE_WS2TCPIP_H
10612#include <ws2tcpip.h>
10613#endif
10614
10615"
10616if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
10617
10618cat >>confdefs.h <<_ACEOF
10619#define HAVE_STRUCT_SOCKADDR_STORAGE 1
10620_ACEOF
10621
10622
5e8754f9 10623fi
c0c3707f
CB
10624ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "
10625 /* sys/types.h is not needed according to POSIX, but the
10626 sys/socket.h in i386-unknown-freebsd4.10 and
10627 powerpc-apple-darwin5.5 required it. */
10628#include <sys/types.h>
10629#ifdef HAVE_SYS_SOCKET_H
10630#include <sys/socket.h>
10631#endif
10632#ifdef HAVE_WS2TCPIP_H
10633#include <ws2tcpip.h>
10634#endif
10635
10636"
10637if test "x$ac_cv_type_sa_family_t" = xyes; then :
5e8754f9
SDJ
10638
10639cat >>confdefs.h <<_ACEOF
c0c3707f 10640#define HAVE_SA_FAMILY_T 1
5e8754f9
SDJ
10641_ACEOF
10642
10643
c0c3707f 10644fi
5e8754f9 10645
c0c3707f
CB
10646 if test $ac_cv_type_struct_sockaddr_storage = no; then
10647 HAVE_STRUCT_SOCKADDR_STORAGE=0
10648 fi
10649 if test $ac_cv_type_sa_family_t = no; then
10650 HAVE_SA_FAMILY_T=0
10651 fi
10652 if test $ac_cv_type_struct_sockaddr_storage != no; then
10653 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
10654 #ifdef HAVE_SYS_SOCKET_H
10655 #include <sys/socket.h>
10656 #endif
10657 #ifdef HAVE_WS2TCPIP_H
10658 #include <ws2tcpip.h>
10659 #endif
5abebf3c 10660
c0c3707f
CB
10661"
10662if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
5abebf3c 10663
c0c3707f
CB
10664cat >>confdefs.h <<_ACEOF
10665#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
5abebf3c 10666_ACEOF
c0c3707f
CB
10667
10668
5abebf3c 10669else
c0c3707f 10670 HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
5abebf3c 10671fi
c0c3707f
CB
10672
10673 fi
10674 if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
10675 || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
10676 SYS_SOCKET_H='sys/socket.h'
10677 fi
5abebf3c
CB
10678
10679
10680
5abebf3c 10681
c0c3707f
CB
10682 if test $ac_cv_header_sys_socket_h != yes; then
10683 for ac_header in winsock2.h
10684do :
10685 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
10686if test "x$ac_cv_header_winsock2_h" = xyes; then :
10687 cat >>confdefs.h <<_ACEOF
10688#define HAVE_WINSOCK2_H 1
10689_ACEOF
5abebf3c 10690
c0c3707f 10691fi
5abebf3c 10692
c0c3707f 10693done
5abebf3c 10694
5abebf3c 10695 fi
c0c3707f
CB
10696 if test "$ac_cv_header_winsock2_h" = yes; then
10697 HAVE_WINSOCK2_H=1
10698 UNISTD_H_HAVE_WINSOCK2_H=1
10699 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
5abebf3c 10700 else
c0c3707f 10701 HAVE_WINSOCK2_H=0
5abebf3c 10702 fi
5abebf3c
CB
10703
10704
10705
5abebf3c 10706
5abebf3c 10707
c0c3707f
CB
10708
10709
10710
10711
10712
10713
10714
10715
10716 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
10717$as_echo_n "checking for IPv4 sockets... " >&6; }
10718if ${gl_cv_socket_ipv4+:} false; then :
5abebf3c
CB
10719 $as_echo_n "(cached) " >&6
10720else
c0c3707f
CB
10721 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10722/* end confdefs.h. */
10723#include <sys/types.h>
10724#ifdef HAVE_SYS_SOCKET_H
10725#include <sys/socket.h>
10726#endif
10727#ifdef HAVE_NETINET_IN_H
10728#include <netinet/in.h>
10729#endif
10730#ifdef HAVE_WINSOCK2_H
10731#include <winsock2.h>
10732#endif
10733int
10734main ()
10735{
10736int x = AF_INET; struct in_addr y; struct sockaddr_in z;
10737 if (&x && &y && &z) return 0;
10738 ;
10739 return 0;
10740}
10741_ACEOF
10742if ac_fn_c_try_compile "$LINENO"; then :
10743 gl_cv_socket_ipv4=yes
5abebf3c 10744else
c0c3707f 10745 gl_cv_socket_ipv4=no
5abebf3c 10746fi
c0c3707f 10747rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 10748fi
c0c3707f
CB
10749{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
10750$as_echo "$gl_cv_socket_ipv4" >&6; }
10751 if test $gl_cv_socket_ipv4 = yes; then
5abebf3c 10752
c0c3707f
CB
10753$as_echo "#define HAVE_IPV4 1" >>confdefs.h
10754
10755 fi
10756
10757 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
10758$as_echo_n "checking for IPv6 sockets... " >&6; }
10759if ${gl_cv_socket_ipv6+:} false; then :
5abebf3c
CB
10760 $as_echo_n "(cached) " >&6
10761else
c0c3707f
CB
10762 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10763/* end confdefs.h. */
10764#include <sys/types.h>
10765#ifdef HAVE_SYS_SOCKET_H
10766#include <sys/socket.h>
10767#endif
10768#ifdef HAVE_NETINET_IN_H
10769#include <netinet/in.h>
10770#endif
10771#ifdef HAVE_WINSOCK2_H
10772#include <winsock2.h>
10773#endif
10774#ifdef HAVE_WS2TCPIP_H
10775#include <ws2tcpip.h>
10776#endif
10777int
10778main ()
10779{
10780int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
10781 if (&x && &y && &z) return 0;
10782 ;
10783 return 0;
10784}
10785_ACEOF
10786if ac_fn_c_try_compile "$LINENO"; then :
10787 gl_cv_socket_ipv6=yes
10788else
10789 gl_cv_socket_ipv6=no
10790fi
10791rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 10792fi
c0c3707f
CB
10793{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
10794$as_echo "$gl_cv_socket_ipv6" >&6; }
10795 if test $gl_cv_socket_ipv6 = yes; then
10796
10797$as_echo "#define HAVE_IPV6 1" >>confdefs.h
5abebf3c 10798
c0c3707f 10799 fi
5abebf3c
CB
10800
10801
10802
5abebf3c 10803
5abebf3c 10804
5abebf3c
CB
10805
10806
10807
10808
c0c3707f
CB
10809
10810
10811
10812
10813 if test $gl_cv_have_include_next = yes; then
10814 gl_cv_next_limits_h='<'limits.h'>'
10815 else
10816 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
10817$as_echo_n "checking absolute name of <limits.h>... " >&6; }
10818if ${gl_cv_next_limits_h+:} false; then :
5abebf3c
CB
10819 $as_echo_n "(cached) " >&6
10820else
5abebf3c 10821
c0c3707f 10822 if test $ac_cv_header_limits_h = yes; then
5abebf3c 10823
5abebf3c
CB
10824
10825
c0c3707f
CB
10826
10827 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10828/* end confdefs.h. */
10829#include <limits.h>
10830_ACEOF
10831 case "$host_os" in
10832 aix*) gl_absname_cpp="$ac_cpp -C" ;;
10833 *) gl_absname_cpp="$ac_cpp" ;;
10834 esac
10835
10836 case "$host_os" in
10837 mingw*)
10838 gl_dirsep_regex='[/\\]'
5abebf3c
CB
10839 ;;
10840 *)
c0c3707f 10841 gl_dirsep_regex='\/'
5abebf3c
CB
10842 ;;
10843 esac
c0c3707f
CB
10844 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10845 gl_header_literal_regex=`echo 'limits.h' \
10846 | sed -e "$gl_make_literal_regex_sed"`
10847 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10848 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10849 s|^/[^/]|//&|
10850 p
10851 q
10852 }'
5abebf3c 10853
c0c3707f
CB
10854 gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10855 sed -n "$gl_absolute_header_sed"`
5abebf3c 10856
c0c3707f
CB
10857 gl_header=$gl_cv_absolute_limits_h
10858 gl_cv_next_limits_h='"'$gl_header'"'
10859 else
10860 gl_cv_next_limits_h='<'limits.h'>'
10861 fi
5abebf3c 10862
5abebf3c 10863
5abebf3c 10864fi
c0c3707f
CB
10865{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
10866$as_echo "$gl_cv_next_limits_h" >&6; }
10867 fi
10868 NEXT_LIMITS_H=$gl_cv_next_limits_h
10869
10870 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10871 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10872 gl_next_as_first_directive='<'limits.h'>'
10873 else
10874 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10875 gl_next_as_first_directive=$gl_cv_next_limits_h
10876 fi
10877 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
5abebf3c
CB
10878
10879
c0c3707f
CB
10880
10881
10882
10883 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5
10884$as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; }
10885if ${gl_cv_header_limits_width+:} false; then :
10886 $as_echo_n "(cached) " >&6
5abebf3c
CB
10887else
10888 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10889/* end confdefs.h. */
c0c3707f
CB
10890#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
10891 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
10892 #endif
10893 #include <limits.h>
10894 long long llm = LLONG_MAX;
10895 int wb = WORD_BIT;
10896 int ullw = ULLONG_WIDTH;
5abebf3c 10897
c0c3707f
CB
10898int
10899main ()
5abebf3c 10900{
c0c3707f
CB
10901
10902 ;
10903 return 0;
5abebf3c
CB
10904}
10905_ACEOF
c0c3707f
CB
10906if ac_fn_c_try_compile "$LINENO"; then :
10907 gl_cv_header_limits_width=yes
5abebf3c 10908else
c0c3707f 10909 gl_cv_header_limits_width=no
5abebf3c 10910fi
c0c3707f 10911rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 10912fi
c0c3707f
CB
10913{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
10914$as_echo "$gl_cv_header_limits_width" >&6; }
10915 if test "$gl_cv_header_limits_width" = yes; then
10916 LIMITS_H=
10917 else
10918 LIMITS_H=limits.h
10919 fi
5abebf3c 10920
c0c3707f
CB
10921 if test -n "$LIMITS_H"; then
10922 GL_GENERATE_LIMITS_H_TRUE=
10923 GL_GENERATE_LIMITS_H_FALSE='#'
5abebf3c 10924else
c0c3707f
CB
10925 GL_GENERATE_LIMITS_H_TRUE='#'
10926 GL_GENERATE_LIMITS_H_FALSE=
5abebf3c
CB
10927fi
10928
10929
5abebf3c 10930
c0c3707f
CB
10931 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
10932$as_echo_n "checking for wint_t... " >&6; }
10933if ${gt_cv_c_wint_t+:} false; then :
5abebf3c
CB
10934 $as_echo_n "(cached) " >&6
10935else
c0c3707f 10936 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c
CB
10937/* end confdefs.h. */
10938
c0c3707f
CB
10939/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
10940 <wchar.h>.
10941 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
10942 before <wchar.h>. */
10943#include <stddef.h>
10944#include <stdio.h>
10945#include <time.h>
10946#include <wchar.h>
10947 wint_t foo = (wchar_t)'\0';
5abebf3c
CB
10948int
10949main ()
10950{
c0c3707f 10951
5abebf3c
CB
10952 ;
10953 return 0;
10954}
10955_ACEOF
c0c3707f
CB
10956if ac_fn_c_try_compile "$LINENO"; then :
10957 gt_cv_c_wint_t=yes
5abebf3c 10958else
c0c3707f 10959 gt_cv_c_wint_t=no
5abebf3c 10960fi
c0c3707f 10961rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 10962fi
c0c3707f
CB
10963{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
10964$as_echo "$gt_cv_c_wint_t" >&6; }
10965 if test $gt_cv_c_wint_t = yes; then
5abebf3c 10966
c0c3707f 10967$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
5abebf3c 10968
5abebf3c 10969
c0c3707f
CB
10970 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5
10971$as_echo_n "checking whether wint_t is too small... " >&6; }
10972if ${gl_cv_type_wint_t_too_small+:} false; then :
5abebf3c
CB
10973 $as_echo_n "(cached) " >&6
10974else
c0c3707f 10975 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c
CB
10976/* end confdefs.h. */
10977
c0c3707f
CB
10978/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
10979 <wchar.h>.
10980 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
10981 included before <wchar.h>. */
10982#if !(defined __GLIBC__ && !defined __UCLIBC__)
10983# include <stddef.h>
10984# include <stdio.h>
10985# include <time.h>
5abebf3c 10986#endif
c0c3707f
CB
10987#include <wchar.h>
10988 int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
10989
5abebf3c
CB
10990int
10991main ()
10992{
c0c3707f 10993
5abebf3c
CB
10994 ;
10995 return 0;
10996}
10997_ACEOF
c0c3707f
CB
10998if ac_fn_c_try_compile "$LINENO"; then :
10999 gl_cv_type_wint_t_too_small=no
5abebf3c 11000else
c0c3707f 11001 gl_cv_type_wint_t_too_small=yes
5abebf3c 11002fi
c0c3707f 11003rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5abebf3c 11004fi
c0c3707f
CB
11005{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5
11006$as_echo "$gl_cv_type_wint_t_too_small" >&6; }
11007 if test $gl_cv_type_wint_t_too_small = yes; then
11008 GNULIB_OVERRIDES_WINT_T=1
11009 else
11010 GNULIB_OVERRIDES_WINT_T=0
11011 fi
11012 else
11013 GNULIB_OVERRIDES_WINT_T=0
11014 fi
5abebf3c 11015
c0c3707f
CB
11016
11017
11018 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
11019$as_echo_n "checking for unsigned long long int... " >&6; }
11020if ${ac_cv_type_unsigned_long_long_int+:} false; then :
5abebf3c
CB
11021 $as_echo_n "(cached) " >&6
11022else
c0c3707f
CB
11023 ac_cv_type_unsigned_long_long_int=yes
11024 if test "x${ac_cv_prog_cc_c99-no}" = xno; then
11025 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c
CB
11026/* end confdefs.h. */
11027
c0c3707f
CB
11028 /* For now, do not test the preprocessor; as of 2007 there are too many
11029 implementations with broken preprocessors. Perhaps this can
11030 be revisited in 2012. In the meantime, code should not expect
11031 #if to work with literals wider than 32 bits. */
11032 /* Test literals. */
11033 long long int ll = 9223372036854775807ll;
11034 long long int nll = -9223372036854775807LL;
11035 unsigned long long int ull = 18446744073709551615ULL;
11036 /* Test constant expressions. */
11037 typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
11038 ? 1 : -1)];
11039 typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
11040 ? 1 : -1)];
11041 int i = 63;
5abebf3c
CB
11042int
11043main ()
11044{
c0c3707f
CB
11045/* Test availability of runtime routines for shift and division. */
11046 long long int llmax = 9223372036854775807ll;
11047 unsigned long long int ullmax = 18446744073709551615ull;
11048 return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
11049 | (llmax / ll) | (llmax % ll)
11050 | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
11051 | (ullmax / ull) | (ullmax % ull));
5abebf3c
CB
11052 ;
11053 return 0;
11054}
c0c3707f 11055
5abebf3c
CB
11056_ACEOF
11057if ac_fn_c_try_link "$LINENO"; then :
c0c3707f 11058
5abebf3c 11059else
c0c3707f 11060 ac_cv_type_unsigned_long_long_int=no
5abebf3c
CB
11061fi
11062rm -f core conftest.err conftest.$ac_objext \
11063 conftest$ac_exeext conftest.$ac_ext
c0c3707f 11064 fi
5abebf3c 11065fi
c0c3707f
CB
11066{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
11067$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
11068 if test $ac_cv_type_unsigned_long_long_int = yes; then
5abebf3c 11069
c0c3707f 11070$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 11071
c0c3707f 11072 fi
5abebf3c 11073
5abebf3c 11074
5abebf3c 11075
c0c3707f
CB
11076 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
11077$as_echo_n "checking for long long int... " >&6; }
11078if ${ac_cv_type_long_long_int+:} false; then :
11079 $as_echo_n "(cached) " >&6
11080else
11081 ac_cv_type_long_long_int=yes
11082 if test "x${ac_cv_prog_cc_c99-no}" = xno; then
11083 ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
11084 if test $ac_cv_type_long_long_int = yes; then
11085 if test "$cross_compiling" = yes; then :
11086 :
11087else
11088 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11089/* end confdefs.h. */
c0c3707f
CB
11090#include <limits.h>
11091 #ifndef LLONG_MAX
11092 # define HALF \
11093 (1LL << (sizeof (long long int) * CHAR_BIT - 2))
11094 # define LLONG_MAX (HALF - 1 + HALF)
11095 #endif
5abebf3c
CB
11096int
11097main ()
11098{
c0c3707f
CB
11099long long int n = 1;
11100 int i;
11101 for (i = 0; ; i++)
11102 {
11103 long long int m = n << i;
11104 if (m >> i != n)
11105 return 1;
11106 if (LLONG_MAX / 2 < m)
11107 break;
11108 }
11109 return 0;
5abebf3c
CB
11110 ;
11111 return 0;
11112}
11113_ACEOF
c0c3707f 11114if ac_fn_c_try_run "$LINENO"; then :
5abebf3c 11115
c0c3707f
CB
11116else
11117 ac_cv_type_long_long_int=no
11118fi
11119rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11120 conftest.$ac_objext conftest.beam conftest.$ac_ext
11121fi
5abebf3c 11122
5abebf3c
CB
11123 fi
11124 fi
c0c3707f
CB
11125fi
11126{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
11127$as_echo "$ac_cv_type_long_long_int" >&6; }
11128 if test $ac_cv_type_long_long_int = yes; then
5abebf3c 11129
c0c3707f 11130$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
5abebf3c 11131
c0c3707f 11132 fi
5abebf3c 11133
5abebf3c
CB
11134
11135
11136
11137
11138
c0c3707f
CB
11139 gl_cv_c_multiarch=no
11140 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11141/* end confdefs.h. */
11142#ifndef __APPLE_CC__
11143 not a universal capable compiler
11144 #endif
11145 typedef int dummy;
5abebf3c 11146
c0c3707f
CB
11147_ACEOF
11148if ac_fn_c_try_compile "$LINENO"; then :
5abebf3c 11149
c0c3707f
CB
11150 arch=
11151 prev=
11152 for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
11153 if test -n "$prev"; then
11154 case $word in
11155 i?86 | x86_64 | ppc | ppc64)
11156 if test -z "$arch" || test "$arch" = "$word"; then
11157 arch="$word"
11158 else
11159 gl_cv_c_multiarch=yes
11160 fi
11161 ;;
11162 esac
11163 prev=
11164 else
11165 if test "x$word" = "x-arch"; then
11166 prev=arch
11167 fi
11168 fi
11169 done
5abebf3c 11170
c0c3707f
CB
11171fi
11172rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11173 if test $gl_cv_c_multiarch = yes; then
11174 APPLE_UNIVERSAL_BUILD=1
11175 else
11176 APPLE_UNIVERSAL_BUILD=0
11177 fi
5abebf3c 11178
5abebf3c 11179
5abebf3c 11180
5abebf3c
CB
11181
11182
5abebf3c 11183
5abebf3c 11184
5abebf3c 11185
c0c3707f
CB
11186 if test $ac_cv_type_long_long_int = yes; then
11187 HAVE_LONG_LONG_INT=1
11188 else
11189 HAVE_LONG_LONG_INT=0
11190 fi
5abebf3c 11191
5abebf3c 11192
c0c3707f
CB
11193 if test $ac_cv_type_unsigned_long_long_int = yes; then
11194 HAVE_UNSIGNED_LONG_LONG_INT=1
11195 else
11196 HAVE_UNSIGNED_LONG_LONG_INT=0
11197 fi
5abebf3c 11198
c0c3707f
CB
11199
11200
11201 if test $ac_cv_header_wchar_h = yes; then
11202 HAVE_WCHAR_H=1
11203 else
11204 HAVE_WCHAR_H=0
5abebf3c 11205 fi
c0c3707f
CB
11206
11207
11208 if test $ac_cv_header_inttypes_h = yes; then
11209 HAVE_INTTYPES_H=1
11210 else
11211 HAVE_INTTYPES_H=0
5abebf3c
CB
11212 fi
11213
11214
c0c3707f
CB
11215 if test $ac_cv_header_sys_types_h = yes; then
11216 HAVE_SYS_TYPES_H=1
11217 else
11218 HAVE_SYS_TYPES_H=0
11219 fi
11220
5abebf3c
CB
11221
11222
11223
11224
5abebf3c 11225
5abebf3c 11226
5abebf3c 11227
5abebf3c 11228
5abebf3c
CB
11229
11230
c0c3707f
CB
11231 if test $gl_cv_have_include_next = yes; then
11232 gl_cv_next_stdint_h='<'stdint.h'>'
11233 else
11234 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
11235$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
11236if ${gl_cv_next_stdint_h+:} false; then :
11237 $as_echo_n "(cached) " >&6
11238else
5abebf3c 11239
c0c3707f 11240 if test $ac_cv_header_stdint_h = yes; then
5abebf3c 11241
5abebf3c
CB
11242
11243
11244
c0c3707f 11245 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 11246/* end confdefs.h. */
c0c3707f 11247#include <stdint.h>
5abebf3c 11248_ACEOF
c0c3707f
CB
11249 case "$host_os" in
11250 aix*) gl_absname_cpp="$ac_cpp -C" ;;
11251 *) gl_absname_cpp="$ac_cpp" ;;
11252 esac
5abebf3c 11253
c0c3707f
CB
11254 case "$host_os" in
11255 mingw*)
11256 gl_dirsep_regex='[/\\]'
11257 ;;
11258 *)
11259 gl_dirsep_regex='\/'
11260 ;;
11261 esac
11262 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
11263 gl_header_literal_regex=`echo 'stdint.h' \
11264 | sed -e "$gl_make_literal_regex_sed"`
11265 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11266 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11267 s|^/[^/]|//&|
11268 p
11269 q
11270 }'
5abebf3c 11271
c0c3707f
CB
11272 gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
11273 sed -n "$gl_absolute_header_sed"`
5abebf3c 11274
c0c3707f
CB
11275 gl_header=$gl_cv_absolute_stdint_h
11276 gl_cv_next_stdint_h='"'$gl_header'"'
11277 else
11278 gl_cv_next_stdint_h='<'stdint.h'>'
11279 fi
5abebf3c 11280
5abebf3c 11281
c0c3707f
CB
11282fi
11283{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
11284$as_echo "$gl_cv_next_stdint_h" >&6; }
11285 fi
11286 NEXT_STDINT_H=$gl_cv_next_stdint_h
5abebf3c 11287
c0c3707f
CB
11288 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11289 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
11290 gl_next_as_first_directive='<'stdint.h'>'
11291 else
11292 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
11293 gl_next_as_first_directive=$gl_cv_next_stdint_h
11294 fi
11295 NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
5abebf3c 11296
5e8754f9 11297
5e8754f9 11298
5e8754f9 11299
c0c3707f
CB
11300 if test $ac_cv_header_stdint_h = yes; then
11301 HAVE_STDINT_H=1
11302 else
11303 HAVE_STDINT_H=0
11304 fi
5e8754f9
SDJ
11305
11306
c0c3707f
CB
11307 if test $ac_cv_header_stdint_h = yes; then
11308 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
11309$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
11310if ${gl_cv_header_working_stdint_h+:} false; then :
11311 $as_echo_n "(cached) " >&6
11312else
11313 gl_cv_header_working_stdint_h=no
11314 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11315/* end confdefs.h. */
5e8754f9 11316
5e8754f9 11317
c0c3707f
CB
11318#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
11319#define __STDC_CONSTANT_MACROS 1
11320#define __STDC_LIMIT_MACROS 1
11321#include <stdint.h>
11322/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
11323#if !(defined WCHAR_MIN && defined WCHAR_MAX)
11324#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
11325#endif
5e8754f9
SDJ
11326
11327
c0c3707f
CB
11328 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11329 included before <wchar.h>. */
11330 #include <stddef.h>
11331 #include <signal.h>
11332 #if HAVE_WCHAR_H
11333 # include <stdio.h>
11334 # include <time.h>
11335 # include <wchar.h>
11336 #endif
f45c62c4
YQ
11337
11338
c0c3707f
CB
11339#ifdef INT8_MAX
11340int8_t a1 = INT8_MAX;
11341int8_t a1min = INT8_MIN;
11342#endif
11343#ifdef INT16_MAX
11344int16_t a2 = INT16_MAX;
11345int16_t a2min = INT16_MIN;
11346#endif
11347#ifdef INT32_MAX
11348int32_t a3 = INT32_MAX;
11349int32_t a3min = INT32_MIN;
11350#endif
11351#ifdef INT64_MAX
11352int64_t a4 = INT64_MAX;
11353int64_t a4min = INT64_MIN;
11354#endif
11355#ifdef UINT8_MAX
11356uint8_t b1 = UINT8_MAX;
11357#else
11358typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
11359#endif
11360#ifdef UINT16_MAX
11361uint16_t b2 = UINT16_MAX;
11362#endif
11363#ifdef UINT32_MAX
11364uint32_t b3 = UINT32_MAX;
11365#endif
11366#ifdef UINT64_MAX
11367uint64_t b4 = UINT64_MAX;
11368#endif
11369int_least8_t c1 = INT8_C (0x7f);
11370int_least8_t c1max = INT_LEAST8_MAX;
11371int_least8_t c1min = INT_LEAST8_MIN;
11372int_least16_t c2 = INT16_C (0x7fff);
11373int_least16_t c2max = INT_LEAST16_MAX;
11374int_least16_t c2min = INT_LEAST16_MIN;
11375int_least32_t c3 = INT32_C (0x7fffffff);
11376int_least32_t c3max = INT_LEAST32_MAX;
11377int_least32_t c3min = INT_LEAST32_MIN;
11378int_least64_t c4 = INT64_C (0x7fffffffffffffff);
11379int_least64_t c4max = INT_LEAST64_MAX;
11380int_least64_t c4min = INT_LEAST64_MIN;
11381uint_least8_t d1 = UINT8_C (0xff);
11382uint_least8_t d1max = UINT_LEAST8_MAX;
11383uint_least16_t d2 = UINT16_C (0xffff);
11384uint_least16_t d2max = UINT_LEAST16_MAX;
11385uint_least32_t d3 = UINT32_C (0xffffffff);
11386uint_least32_t d3max = UINT_LEAST32_MAX;
11387uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
11388uint_least64_t d4max = UINT_LEAST64_MAX;
11389int_fast8_t e1 = INT_FAST8_MAX;
11390int_fast8_t e1min = INT_FAST8_MIN;
11391int_fast16_t e2 = INT_FAST16_MAX;
11392int_fast16_t e2min = INT_FAST16_MIN;
11393int_fast32_t e3 = INT_FAST32_MAX;
11394int_fast32_t e3min = INT_FAST32_MIN;
11395int_fast64_t e4 = INT_FAST64_MAX;
11396int_fast64_t e4min = INT_FAST64_MIN;
11397uint_fast8_t f1 = UINT_FAST8_MAX;
11398uint_fast16_t f2 = UINT_FAST16_MAX;
11399uint_fast32_t f3 = UINT_FAST32_MAX;
11400uint_fast64_t f4 = UINT_FAST64_MAX;
11401#ifdef INTPTR_MAX
11402intptr_t g = INTPTR_MAX;
11403intptr_t gmin = INTPTR_MIN;
11404#endif
11405#ifdef UINTPTR_MAX
11406uintptr_t h = UINTPTR_MAX;
11407#endif
11408intmax_t i = INTMAX_MAX;
11409uintmax_t j = UINTMAX_MAX;
472fa5ee 11410
c0c3707f
CB
11411/* Check that SIZE_MAX has the correct type, if possible. */
11412#if 201112 <= __STDC_VERSION__
11413int k = _Generic (SIZE_MAX, size_t: 0);
11414#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
11415 || (0x5110 <= __SUNPRO_C && !__STDC__))
11416extern size_t k;
11417extern __typeof__ (SIZE_MAX) k;
11418#endif
472fa5ee 11419
c0c3707f
CB
11420#include <limits.h> /* for CHAR_BIT */
11421#define TYPE_MINIMUM(t) \
11422 ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
11423#define TYPE_MAXIMUM(t) \
11424 ((t) ((t) 0 < (t) -1 \
11425 ? (t) -1 \
11426 : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
11427struct s {
11428 int check_PTRDIFF:
11429 PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
11430 && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
11431 ? 1 : -1;
11432 /* Detect bug in FreeBSD 6.0 / ia64. */
11433 int check_SIG_ATOMIC:
11434 SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
11435 && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
11436 ? 1 : -1;
11437 int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
11438 int check_WCHAR:
11439 WCHAR_MIN == TYPE_MINIMUM (wchar_t)
11440 && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
11441 ? 1 : -1;
11442 /* Detect bug in mingw. */
11443 int check_WINT:
11444 WINT_MIN == TYPE_MINIMUM (wint_t)
11445 && WINT_MAX == TYPE_MAXIMUM (wint_t)
11446 ? 1 : -1;
472fa5ee 11447
c0c3707f
CB
11448 /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
11449 int check_UINT8_C:
11450 (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
11451 int check_UINT16_C:
11452 (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
f45c62c4 11453
c0c3707f
CB
11454 /* Detect bugs in OpenBSD 3.9 stdint.h. */
11455#ifdef UINT8_MAX
11456 int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
11457#endif
11458#ifdef UINT16_MAX
11459 int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
11460#endif
11461#ifdef UINT32_MAX
11462 int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
11463#endif
11464#ifdef UINT64_MAX
11465 int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
11466#endif
11467 int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
11468 int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
11469 int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
11470 int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
11471 int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
11472 int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
11473 int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
11474 int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
11475 int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
11476 int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
11477 int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
11478};
6ec2e0f5 11479
f45c62c4
YQ
11480int
11481main ()
11482{
f45c62c4
YQ
11483
11484 ;
11485 return 0;
11486}
11487_ACEOF
6ec2e0f5 11488if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 11489 if test "$cross_compiling" = yes; then :
6a29c58e 11490 case "$host_os" in
c0c3707f
CB
11491 # Guess yes on native Windows.
11492 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
11493 # In general, assume it works.
11494 *) gl_cv_header_working_stdint_h="guessing yes" ;;
11495 esac
6a29c58e 11496
98399780
YQ
11497else
11498 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11499/* end confdefs.h. */
98399780
YQ
11500
11501
c0c3707f
CB
11502#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
11503#define __STDC_CONSTANT_MACROS 1
11504#define __STDC_LIMIT_MACROS 1
11505#include <stdint.h>
98399780 11506
88b48903 11507
c0c3707f
CB
11508 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11509 included before <wchar.h>. */
11510 #include <stddef.h>
11511 #include <signal.h>
11512 #if HAVE_WCHAR_H
11513 # include <stdio.h>
11514 # include <time.h>
11515 # include <wchar.h>
11516 #endif
88b48903 11517
472fa5ee 11518
c0c3707f
CB
11519#include <stdio.h>
11520#include <string.h>
11521#define MVAL(macro) MVAL1(macro)
11522#define MVAL1(expression) #expression
11523static const char *macro_values[] =
11524 {
11525#ifdef INT8_MAX
11526 MVAL (INT8_MAX),
11527#endif
11528#ifdef INT16_MAX
11529 MVAL (INT16_MAX),
11530#endif
11531#ifdef INT32_MAX
11532 MVAL (INT32_MAX),
11533#endif
11534#ifdef INT64_MAX
11535 MVAL (INT64_MAX),
11536#endif
11537#ifdef UINT8_MAX
11538 MVAL (UINT8_MAX),
11539#endif
11540#ifdef UINT16_MAX
11541 MVAL (UINT16_MAX),
11542#endif
11543#ifdef UINT32_MAX
11544 MVAL (UINT32_MAX),
11545#endif
11546#ifdef UINT64_MAX
11547 MVAL (UINT64_MAX),
11548#endif
11549 NULL
11550 };
472fa5ee 11551
c0c3707f
CB
11552int
11553main ()
11554{
472fa5ee 11555
c0c3707f
CB
11556 const char **mv;
11557 for (mv = macro_values; *mv != NULL; mv++)
11558 {
11559 const char *value = *mv;
11560 /* Test whether it looks like a cast expression. */
11561 if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
11562 || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
11563 || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
11564 || strncmp (value, "((int)"/*)*/, 6) == 0
11565 || strncmp (value, "((signed short)"/*)*/, 15) == 0
11566 || strncmp (value, "((signed char)"/*)*/, 14) == 0)
11567 return mv - macro_values + 1;
11568 }
11569 return 0;
11570
11571 ;
11572 return 0;
11573}
11574_ACEOF
11575if ac_fn_c_try_run "$LINENO"; then :
11576 gl_cv_header_working_stdint_h=yes
11577fi
11578rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11579 conftest.$ac_objext conftest.beam conftest.$ac_ext
11580fi
11581
11582
11583fi
11584rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 11585
c0c3707f
CB
11586fi
11587{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
11588$as_echo "$gl_cv_header_working_stdint_h" >&6; }
11589 fi
8690e634 11590
c0c3707f
CB
11591 HAVE_C99_STDINT_H=0
11592 HAVE_SYS_BITYPES_H=0
11593 HAVE_SYS_INTTYPES_H=0
11594 STDINT_H=stdint.h
11595 case "$gl_cv_header_working_stdint_h" in
11596 *yes)
11597 HAVE_C99_STDINT_H=1
11598 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5
11599$as_echo_n "checking whether stdint.h predates C++11... " >&6; }
11600if ${gl_cv_header_stdint_predates_cxx11_h+:} false; then :
11601 $as_echo_n "(cached) " >&6
11602else
11603 gl_cv_header_stdint_predates_cxx11_h=yes
11604 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11605/* end confdefs.h. */
8690e634
JK
11606
11607
c0c3707f
CB
11608#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
11609#include <stdint.h>
8690e634
JK
11610
11611
c0c3707f
CB
11612 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11613 included before <wchar.h>. */
11614 #include <stddef.h>
11615 #include <signal.h>
11616 #if HAVE_WCHAR_H
11617 # include <stdio.h>
11618 # include <time.h>
11619 # include <wchar.h>
11620 #endif
8690e634
JK
11621
11622
c0c3707f
CB
11623intmax_t im = INTMAX_MAX;
11624int32_t i32 = INT32_C (0x7fffffff);
472fa5ee 11625
c0c3707f
CB
11626int
11627main ()
11628{
472fa5ee 11629
c0c3707f
CB
11630 ;
11631 return 0;
11632}
11633_ACEOF
11634if ac_fn_c_try_compile "$LINENO"; then :
11635 gl_cv_header_stdint_predates_cxx11_h=no
11636fi
11637rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11638fi
11639{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5
11640$as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; }
472fa5ee 11641
c0c3707f 11642 if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
472fa5ee 11643
c0c3707f 11644$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
472fa5ee
SM
11645
11646
c0c3707f
CB
11647$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
11648
11649 fi
11650 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
11651$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
11652if ${gl_cv_header_stdint_width+:} false; then :
8690e634
JK
11653 $as_echo_n "(cached) " >&6
11654else
c0c3707f
CB
11655 gl_cv_header_stdint_width=no
11656 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
11657/* end confdefs.h. */
11658
c0c3707f
CB
11659 /* Work if build is not clean. */
11660 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
11661 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
11662 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
11663 #endif
11664 #include <stdint.h>
11665
11666 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11667 included before <wchar.h>. */
11668 #include <stddef.h>
11669 #include <signal.h>
11670 #if HAVE_WCHAR_H
11671 # include <stdio.h>
11672 # include <time.h>
11673 # include <wchar.h>
11674 #endif
11675
11676 int iw = UINTMAX_WIDTH;
11677
11678int
11679main ()
8690e634 11680{
c0c3707f
CB
11681
11682 ;
8690e634
JK
11683 return 0;
11684}
8690e634 11685_ACEOF
c0c3707f
CB
11686if ac_fn_c_try_compile "$LINENO"; then :
11687 gl_cv_header_stdint_width=yes
11688fi
11689rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11690fi
11691{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
11692$as_echo "$gl_cv_header_stdint_width" >&6; }
11693 if test "$gl_cv_header_stdint_width" = yes; then
11694 STDINT_H=
11695 fi
11696 ;;
11697 *)
11698 for ac_header in sys/inttypes.h sys/bitypes.h
11699do :
11700 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
11701ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
11702if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
11703 cat >>confdefs.h <<_ACEOF
11704#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
11705_ACEOF
11706
11707fi
11708
11709done
11710
11711 if test $ac_cv_header_sys_inttypes_h = yes; then
11712 HAVE_SYS_INTTYPES_H=1
11713 fi
11714 if test $ac_cv_header_sys_bitypes_h = yes; then
11715 HAVE_SYS_BITYPES_H=1
11716 fi
11717
11718
11719 if test $APPLE_UNIVERSAL_BUILD = 0; then
11720
11721
11722 for gltype in ptrdiff_t size_t ; do
11723 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
11724$as_echo_n "checking for bit size of $gltype... " >&6; }
11725if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
11726 $as_echo_n "(cached) " >&6
11727else
11728 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
11729 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11730 included before <wchar.h>. */
11731 #include <stddef.h>
11732 #include <signal.h>
11733 #if HAVE_WCHAR_H
11734 # include <stdio.h>
11735 # include <time.h>
11736 # include <wchar.h>
11737 #endif
11738
11739#include <limits.h>"; then :
11740
11741else
11742 result=unknown
11743fi
11744
11745 eval gl_cv_bitsizeof_${gltype}=\$result
11746
11747fi
11748eval ac_res=\$gl_cv_bitsizeof_${gltype}
11749 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
11750$as_echo "$ac_res" >&6; }
11751 eval result=\$gl_cv_bitsizeof_${gltype}
11752 if test $result = unknown; then
11753 result=0
8690e634 11754 fi
c0c3707f
CB
11755 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
11756 cat >>confdefs.h <<_ACEOF
11757#define BITSIZEOF_${GLTYPE} $result
11758_ACEOF
8690e634 11759
c0c3707f
CB
11760 eval BITSIZEOF_${GLTYPE}=\$result
11761 done
8690e634
JK
11762
11763
c0c3707f 11764 fi
8690e634
JK
11765
11766
c0c3707f
CB
11767 for gltype in sig_atomic_t wchar_t wint_t ; do
11768 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
11769$as_echo_n "checking for bit size of $gltype... " >&6; }
11770if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
8690e634
JK
11771 $as_echo_n "(cached) " >&6
11772else
c0c3707f
CB
11773 if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
11774 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11775 included before <wchar.h>. */
11776 #include <stddef.h>
11777 #include <signal.h>
11778 #if HAVE_WCHAR_H
11779 # include <stdio.h>
11780 # include <time.h>
11781 # include <wchar.h>
11782 #endif
8690e634 11783
c0c3707f 11784#include <limits.h>"; then :
8690e634 11785
c0c3707f
CB
11786else
11787 result=unknown
11788fi
8690e634 11789
c0c3707f 11790 eval gl_cv_bitsizeof_${gltype}=\$result
8690e634
JK
11791
11792fi
c0c3707f
CB
11793eval ac_res=\$gl_cv_bitsizeof_${gltype}
11794 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
11795$as_echo "$ac_res" >&6; }
11796 eval result=\$gl_cv_bitsizeof_${gltype}
11797 if test $result = unknown; then
11798 result=0
11799 fi
11800 GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
11801 cat >>confdefs.h <<_ACEOF
11802#define BITSIZEOF_${GLTYPE} $result
11803_ACEOF
11804
11805 eval BITSIZEOF_${GLTYPE}=\$result
11806 done
8690e634
JK
11807
11808
11809
11810
c0c3707f
CB
11811 for gltype in sig_atomic_t wchar_t wint_t ; do
11812 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
11813$as_echo_n "checking whether $gltype is signed... " >&6; }
11814if eval \${gl_cv_type_${gltype}_signed+:} false; then :
8690e634
JK
11815 $as_echo_n "(cached) " >&6
11816else
c0c3707f 11817 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
11818/* end confdefs.h. */
11819
c0c3707f
CB
11820 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11821 included before <wchar.h>. */
11822 #include <stddef.h>
11823 #include <signal.h>
11824 #if HAVE_WCHAR_H
11825 # include <stdio.h>
11826 # include <time.h>
11827 # include <wchar.h>
11828 #endif
11829
11830 int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
11831int
11832main ()
11833{
11834
11835 ;
8690e634
JK
11836 return 0;
11837}
c0c3707f
CB
11838_ACEOF
11839if ac_fn_c_try_compile "$LINENO"; then :
11840 result=yes
11841else
11842 result=no
11843fi
11844rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11845 eval gl_cv_type_${gltype}_signed=\$result
8690e634 11846
c0c3707f
CB
11847fi
11848eval ac_res=\$gl_cv_type_${gltype}_signed
11849 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
11850$as_echo "$ac_res" >&6; }
11851 eval result=\$gl_cv_type_${gltype}_signed
11852 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
11853 if test "$result" = yes; then
11854 cat >>confdefs.h <<_ACEOF
11855#define HAVE_SIGNED_${GLTYPE} 1
8690e634 11856_ACEOF
c0c3707f
CB
11857
11858 eval HAVE_SIGNED_${GLTYPE}=1
11859 else
11860 eval HAVE_SIGNED_${GLTYPE}=0
8690e634 11861 fi
c0c3707f
CB
11862 done
11863
11864
11865 gl_cv_type_ptrdiff_t_signed=yes
11866 gl_cv_type_size_t_signed=no
11867 if test $APPLE_UNIVERSAL_BUILD = 0; then
11868
11869
11870 for gltype in ptrdiff_t size_t ; do
11871 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
11872$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
11873if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
11874 $as_echo_n "(cached) " >&6
11875else
11876 eval gl_cv_type_${gltype}_suffix=no
11877 eval result=\$gl_cv_type_${gltype}_signed
11878 if test "$result" = yes; then
11879 glsufu=
11880 else
11881 glsufu=u
11882 fi
11883 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
11884 case $glsuf in
11885 '') gltype1='int';;
11886 l) gltype1='long int';;
11887 ll) gltype1='long long int';;
11888 i64) gltype1='__int64';;
11889 u) gltype1='unsigned int';;
11890 ul) gltype1='unsigned long int';;
11891 ull) gltype1='unsigned long long int';;
11892 ui64)gltype1='unsigned __int64';;
11893 esac
11894 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11895/* end confdefs.h. */
11896
11897 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11898 included before <wchar.h>. */
11899 #include <stddef.h>
11900 #include <signal.h>
11901 #if HAVE_WCHAR_H
11902 # include <stdio.h>
11903 # include <time.h>
11904 # include <wchar.h>
11905 #endif
8690e634 11906
c0c3707f
CB
11907 extern $gltype foo;
11908 extern $gltype1 foo;
11909int
11910main ()
11911{
11912
11913 ;
11914 return 0;
11915}
11916_ACEOF
11917if ac_fn_c_try_compile "$LINENO"; then :
11918 eval gl_cv_type_${gltype}_suffix=\$glsuf
8690e634 11919fi
c0c3707f
CB
11920rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11921 eval result=\$gl_cv_type_${gltype}_suffix
11922 test "$result" != no && break
11923 done
11924fi
11925eval ac_res=\$gl_cv_type_${gltype}_suffix
11926 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
11927$as_echo "$ac_res" >&6; }
11928 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
11929 eval result=\$gl_cv_type_${gltype}_suffix
11930 test "$result" = no && result=
11931 eval ${GLTYPE}_SUFFIX=\$result
11932 cat >>confdefs.h <<_ACEOF
11933#define ${GLTYPE}_SUFFIX $result
11934_ACEOF
8690e634 11935
c0c3707f 11936 done
8690e634
JK
11937
11938
c0c3707f 11939 fi
8690e634
JK
11940
11941
c0c3707f
CB
11942 for gltype in sig_atomic_t wchar_t wint_t ; do
11943 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
11944$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
11945if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
8690e634
JK
11946 $as_echo_n "(cached) " >&6
11947else
c0c3707f
CB
11948 eval gl_cv_type_${gltype}_suffix=no
11949 eval result=\$gl_cv_type_${gltype}_signed
11950 if test "$result" = yes; then
11951 glsufu=
11952 else
11953 glsufu=u
11954 fi
11955 for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
11956 case $glsuf in
11957 '') gltype1='int';;
11958 l) gltype1='long int';;
11959 ll) gltype1='long long int';;
11960 i64) gltype1='__int64';;
11961 u) gltype1='unsigned int';;
11962 ul) gltype1='unsigned long int';;
11963 ull) gltype1='unsigned long long int';;
11964 ui64)gltype1='unsigned __int64';;
11965 esac
11966 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
11967/* end confdefs.h. */
11968
c0c3707f
CB
11969 /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11970 included before <wchar.h>. */
11971 #include <stddef.h>
11972 #include <signal.h>
11973 #if HAVE_WCHAR_H
11974 # include <stdio.h>
11975 # include <time.h>
11976 # include <wchar.h>
11977 #endif
11978
11979 extern $gltype foo;
11980 extern $gltype1 foo;
11981int
11982main ()
11983{
11984
11985 ;
5e8754f9 11986 return 0;
8690e634 11987}
c0c3707f
CB
11988_ACEOF
11989if ac_fn_c_try_compile "$LINENO"; then :
11990 eval gl_cv_type_${gltype}_suffix=\$glsuf
11991fi
11992rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11993 eval result=\$gl_cv_type_${gltype}_suffix
11994 test "$result" != no && break
11995 done
11996fi
11997eval ac_res=\$gl_cv_type_${gltype}_suffix
11998 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
11999$as_echo "$ac_res" >&6; }
12000 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
12001 eval result=\$gl_cv_type_${gltype}_suffix
12002 test "$result" = no && result=
12003 eval ${GLTYPE}_SUFFIX=\$result
12004 cat >>confdefs.h <<_ACEOF
12005#define ${GLTYPE}_SUFFIX $result
12006_ACEOF
12007
12008 done
12009
12010
12011
12012 if test $GNULIB_OVERRIDES_WINT_T = 1; then
12013 BITSIZEOF_WINT_T=32
12014 fi
12015
12016 ;;
12017 esac
8690e634 12018
8690e634 12019
c0c3707f
CB
12020
12021 LIMITS_H='limits.h'
12022 if test -n "$LIMITS_H"; then
12023 GL_GENERATE_LIMITS_H_TRUE=
12024 GL_GENERATE_LIMITS_H_FALSE='#'
12025else
12026 GL_GENERATE_LIMITS_H_TRUE='#'
12027 GL_GENERATE_LIMITS_H_FALSE=
8690e634 12028fi
6ec2e0f5
SDJ
12029
12030
12031
12032
12033
12034
12035
c0c3707f
CB
12036 if test -n "$STDINT_H"; then
12037 GL_GENERATE_STDINT_H_TRUE=
12038 GL_GENERATE_STDINT_H_FALSE='#'
12039else
12040 GL_GENERATE_STDINT_H_TRUE='#'
12041 GL_GENERATE_STDINT_H_FALSE=
12042fi
472fa5ee
SM
12043
12044
12045
12046
12047
c0c3707f
CB
12048 GNULIB_IMAXABS=0;
12049 GNULIB_IMAXDIV=0;
12050 GNULIB_STRTOIMAX=0;
12051 GNULIB_STRTOUMAX=0;
12052 HAVE_DECL_IMAXABS=1;
12053 HAVE_DECL_IMAXDIV=1;
12054 HAVE_DECL_STRTOIMAX=1;
12055 HAVE_DECL_STRTOUMAX=1;
12056 HAVE_IMAXDIV_T=1;
12057 REPLACE_STRTOIMAX=0;
12058 REPLACE_STRTOUMAX=0;
12059 INT32_MAX_LT_INTMAX_MAX=1;
12060 INT64_MAX_EQ_LONG_MAX='defined _LP64';
12061 PRI_MACROS_BROKEN=0;
12062 PRIPTR_PREFIX=__PRIPTR_PREFIX;
12063 UINT32_MAX_LT_UINTMAX_MAX=1;
12064 UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
472fa5ee 12065
6ec2e0f5
SDJ
12066
12067
12068
12069
12070
6ec2e0f5
SDJ
12071
12072
6ec2e0f5 12073
6ec2e0f5 12074
6ec2e0f5 12075
6ec2e0f5 12076
6ec2e0f5 12077
c0c3707f
CB
12078
12079
12080 if test $gl_cv_have_include_next = yes; then
12081 gl_cv_next_inttypes_h='<'inttypes.h'>'
12082 else
12083 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
12084$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
12085if ${gl_cv_next_inttypes_h+:} false; then :
12086 $as_echo_n "(cached) " >&6
12087else
12088
12089 if test $ac_cv_header_inttypes_h = yes; then
12090
12091
12092
12093
12094 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12095/* end confdefs.h. */
12096#include <inttypes.h>
6ec2e0f5 12097_ACEOF
c0c3707f
CB
12098 case "$host_os" in
12099 aix*) gl_absname_cpp="$ac_cpp -C" ;;
12100 *) gl_absname_cpp="$ac_cpp" ;;
12101 esac
6ec2e0f5 12102
c0c3707f
CB
12103 case "$host_os" in
12104 mingw*)
12105 gl_dirsep_regex='[/\\]'
12106 ;;
12107 *)
12108 gl_dirsep_regex='\/'
12109 ;;
12110 esac
12111 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
12112 gl_header_literal_regex=`echo 'inttypes.h' \
12113 | sed -e "$gl_make_literal_regex_sed"`
12114 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
12115 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12116 s|^/[^/]|//&|
12117 p
12118 q
12119 }'
6ec2e0f5 12120
c0c3707f
CB
12121 gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12122 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 12123
c0c3707f
CB
12124 gl_header=$gl_cv_absolute_inttypes_h
12125 gl_cv_next_inttypes_h='"'$gl_header'"'
12126 else
12127 gl_cv_next_inttypes_h='<'inttypes.h'>'
12128 fi
6ec2e0f5 12129
6ec2e0f5 12130
c0c3707f
CB
12131fi
12132{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
12133$as_echo "$gl_cv_next_inttypes_h" >&6; }
12134 fi
12135 NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
6ec2e0f5 12136
c0c3707f
CB
12137 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12138 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12139 gl_next_as_first_directive='<'inttypes.h'>'
12140 else
12141 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12142 gl_next_as_first_directive=$gl_cv_next_inttypes_h
12143 fi
12144 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
6ec2e0f5 12145
472fa5ee
SM
12146
12147
12148
12149
12150
12151
472fa5ee
SM
12152
12153
12154
12155
6ec2e0f5 12156
c0c3707f
CB
12157 for ac_header in inttypes.h
12158do :
12159 ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
12160if test "x$ac_cv_header_inttypes_h" = xyes; then :
12161 cat >>confdefs.h <<_ACEOF
12162#define HAVE_INTTYPES_H 1
12163_ACEOF
6ec2e0f5 12164
c0c3707f 12165fi
6ec2e0f5 12166
c0c3707f 12167done
6ec2e0f5 12168
c0c3707f
CB
12169 if test $ac_cv_header_inttypes_h = yes; then
12170 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5
12171$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; }
12172if ${gt_cv_inttypes_pri_broken+:} false; then :
6ec2e0f5
SDJ
12173 $as_echo_n "(cached) " >&6
12174else
c0c3707f
CB
12175
12176 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
12177/* end confdefs.h. */
12178
c0c3707f
CB
12179#include <inttypes.h>
12180#ifdef PRId32
12181char *p = PRId32;
6ec2e0f5
SDJ
12182#endif
12183
12184int
12185main ()
12186{
12187
6ec2e0f5
SDJ
12188 ;
12189 return 0;
12190}
12191_ACEOF
c0c3707f
CB
12192if ac_fn_c_try_compile "$LINENO"; then :
12193 gt_cv_inttypes_pri_broken=no
6ec2e0f5 12194else
c0c3707f 12195 gt_cv_inttypes_pri_broken=yes
6ec2e0f5 12196fi
c0c3707f 12197rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5
SDJ
12198
12199fi
c0c3707f
CB
12200{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5
12201$as_echo "$gt_cv_inttypes_pri_broken" >&6; }
6ec2e0f5 12202 fi
c0c3707f 12203 if test "$gt_cv_inttypes_pri_broken" = yes; then
6ec2e0f5
SDJ
12204
12205cat >>confdefs.h <<_ACEOF
c0c3707f 12206#define PRI_MACROS_BROKEN 1
6ec2e0f5
SDJ
12207_ACEOF
12208
c0c3707f 12209 PRI_MACROS_BROKEN=1
6ec2e0f5 12210 else
c0c3707f 12211 PRI_MACROS_BROKEN=0
6ec2e0f5
SDJ
12212 fi
12213
472fa5ee
SM
12214
12215
c0c3707f
CB
12216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
12217$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
12218if ${gl_cv_cc_double_expbit0+:} false; then :
6ec2e0f5
SDJ
12219 $as_echo_n "(cached) " >&6
12220else
c0c3707f
CB
12221
12222 if test "$cross_compiling" = yes; then :
12223
12224 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
12225/* end confdefs.h. */
12226
c0c3707f
CB
12227#if defined arm || defined __arm || defined __arm__
12228 mixed_endianness
6ec2e0f5
SDJ
12229#endif
12230
12231_ACEOF
12232if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
c0c3707f
CB
12233 $EGREP "mixed_endianness" >/dev/null 2>&1; then :
12234 gl_cv_cc_double_expbit0="unknown"
6ec2e0f5 12235else
6ec2e0f5 12236
c0c3707f
CB
12237 :
12238if ${ac_cv_c_bigendian+:} false; then :
12239 $as_echo_n "(cached) " >&6
6ec2e0f5 12240else
c0c3707f
CB
12241 ac_cv_c_bigendian=unknown
12242 # See if we're dealing with a universal compiler.
12243 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 12244/* end confdefs.h. */
c0c3707f
CB
12245#ifndef __APPLE_CC__
12246 not a universal capable compiler
12247 #endif
12248 typedef int dummy;
6ec2e0f5 12249
c0c3707f
CB
12250_ACEOF
12251if ac_fn_c_try_compile "$LINENO"; then :
12252
12253 # Check for potential -arch flags. It is not universal unless
12254 # there are at least two -arch flags with different values.
12255 ac_arch=
12256 ac_prev=
12257 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
12258 if test -n "$ac_prev"; then
12259 case $ac_word in
12260 i?86 | x86_64 | ppc | ppc64)
12261 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
12262 ac_arch=$ac_word
12263 else
12264 ac_cv_c_bigendian=universal
12265 break
12266 fi
12267 ;;
12268 esac
12269 ac_prev=
12270 elif test "x$ac_word" = "x-arch"; then
12271 ac_prev=arch
12272 fi
12273 done
12274fi
12275rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12276 if test $ac_cv_c_bigendian = unknown; then
12277 # See if sys/param.h defines the BYTE_ORDER macro.
12278 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12279/* end confdefs.h. */
12280#include <sys/types.h>
12281 #include <sys/param.h>
6ec2e0f5
SDJ
12282
12283int
12284main ()
12285{
c0c3707f
CB
12286#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
12287 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
12288 && LITTLE_ENDIAN)
12289 bogus endian macros
12290 #endif
6ec2e0f5 12291
c0c3707f
CB
12292 ;
12293 return 0;
12294}
12295_ACEOF
12296if ac_fn_c_try_compile "$LINENO"; then :
12297 # It does; now see whether it defined to BIG_ENDIAN or not.
12298 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12299/* end confdefs.h. */
12300#include <sys/types.h>
12301 #include <sys/param.h>
12302
12303int
12304main ()
12305{
12306#if BYTE_ORDER != BIG_ENDIAN
12307 not big endian
12308 #endif
6ec2e0f5
SDJ
12309
12310 ;
12311 return 0;
12312}
12313_ACEOF
c0c3707f
CB
12314if ac_fn_c_try_compile "$LINENO"; then :
12315 ac_cv_c_bigendian=yes
6ec2e0f5 12316else
c0c3707f 12317 ac_cv_c_bigendian=no
6ec2e0f5 12318fi
c0c3707f 12319rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 12320fi
c0c3707f
CB
12321rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12322 fi
12323 if test $ac_cv_c_bigendian = unknown; then
12324 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
12325 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12326/* end confdefs.h. */
12327#include <limits.h>
472fa5ee 12328
c0c3707f
CB
12329int
12330main ()
12331{
12332#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
12333 bogus endian macros
12334 #endif
6ec2e0f5 12335
c0c3707f
CB
12336 ;
12337 return 0;
12338}
6ec2e0f5 12339_ACEOF
c0c3707f
CB
12340if ac_fn_c_try_compile "$LINENO"; then :
12341 # It does; now see whether it defined to _BIG_ENDIAN or not.
12342 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 12343/* end confdefs.h. */
c0c3707f
CB
12344#include <limits.h>
12345
6ec2e0f5
SDJ
12346int
12347main ()
12348{
c0c3707f
CB
12349#ifndef _BIG_ENDIAN
12350 not big endian
12351 #endif
12352
6ec2e0f5
SDJ
12353 ;
12354 return 0;
12355}
12356_ACEOF
12357if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 12358 ac_cv_c_bigendian=yes
6ec2e0f5 12359else
c0c3707f 12360 ac_cv_c_bigendian=no
6ec2e0f5
SDJ
12361fi
12362rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6ec2e0f5 12363fi
c0c3707f
CB
12364rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12365 fi
12366 if test $ac_cv_c_bigendian = unknown; then
12367 # Compile a test program.
12368 if test "$cross_compiling" = yes; then :
12369 # Try to guess by grepping values from an object file.
12370 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12371/* end confdefs.h. */
12372short int ascii_mm[] =
12373 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
12374 short int ascii_ii[] =
12375 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
12376 int use_ascii (int i) {
12377 return ascii_mm[i] + ascii_ii[i];
12378 }
12379 short int ebcdic_ii[] =
12380 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
12381 short int ebcdic_mm[] =
12382 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
12383 int use_ebcdic (int i) {
12384 return ebcdic_mm[i] + ebcdic_ii[i];
12385 }
12386 extern int foo;
6ec2e0f5 12387
c0c3707f
CB
12388int
12389main ()
12390{
12391return use_ascii (foo) == use_ebcdic (foo);
12392 ;
12393 return 0;
12394}
6ec2e0f5 12395_ACEOF
c0c3707f
CB
12396if ac_fn_c_try_compile "$LINENO"; then :
12397 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
12398 ac_cv_c_bigendian=yes
12399 fi
12400 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
12401 if test "$ac_cv_c_bigendian" = unknown; then
12402 ac_cv_c_bigendian=no
12403 else
12404 # finding both strings is unlikely to happen, but who knows?
12405 ac_cv_c_bigendian=unknown
12406 fi
12407 fi
12408fi
12409rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12410else
12411 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12412/* end confdefs.h. */
12413$ac_includes_default
12414int
12415main ()
12416{
6ec2e0f5 12417
c0c3707f
CB
12418 /* Are we little or big endian? From Harbison&Steele. */
12419 union
12420 {
12421 long int l;
12422 char c[sizeof (long int)];
12423 } u;
12424 u.l = 1;
12425 return u.c[sizeof (long int) - 1] == 1;
6ec2e0f5 12426
c0c3707f
CB
12427 ;
12428 return 0;
12429}
12430_ACEOF
12431if ac_fn_c_try_run "$LINENO"; then :
12432 ac_cv_c_bigendian=no
12433else
12434 ac_cv_c_bigendian=yes
12435fi
12436rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12437 conftest.$ac_objext conftest.beam conftest.$ac_ext
12438fi
6ec2e0f5 12439
c0c3707f
CB
12440 fi
12441fi
12442:
12443 case $ac_cv_c_bigendian in #(
12444 yes)
12445 gl_cv_cc_double_expbit0="word 0 bit 20";; #(
12446 no)
12447 gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
12448 universal)
6ec2e0f5 12449
c0c3707f 12450$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
6ec2e0f5 12451
c0c3707f
CB
12452 ;; #(
12453 *)
12454 gl_cv_cc_double_expbit0="unknown" ;;
12455 esac
472fa5ee
SM
12456
12457
c0c3707f
CB
12458fi
12459rm -f conftest*
5e8754f9
SDJ
12460
12461
c0c3707f
CB
12462else
12463 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12464/* end confdefs.h. */
5e8754f9 12465
c0c3707f
CB
12466#include <float.h>
12467#include <stddef.h>
12468#include <stdio.h>
12469#include <string.h>
12470#define NWORDS \
12471 ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
12472typedef union { double value; unsigned int word[NWORDS]; } memory_double;
12473static unsigned int ored_words[NWORDS];
12474static unsigned int anded_words[NWORDS];
12475static void add_to_ored_words (double x)
12476{
12477 memory_double m;
12478 size_t i;
12479 /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
12480 memset (&m, 0, sizeof (memory_double));
12481 m.value = x;
12482 for (i = 0; i < NWORDS; i++)
12483 {
12484 ored_words[i] |= m.word[i];
12485 anded_words[i] &= m.word[i];
12486 }
12487}
12488int main ()
12489{
12490 size_t j;
12491 FILE *fp = fopen ("conftest.out", "w");
12492 if (fp == NULL)
12493 return 1;
12494 for (j = 0; j < NWORDS; j++)
12495 anded_words[j] = ~ (unsigned int) 0;
12496 add_to_ored_words (0.25);
12497 add_to_ored_words (0.5);
12498 add_to_ored_words (1.0);
12499 add_to_ored_words (2.0);
12500 add_to_ored_words (4.0);
12501 /* Remove bits that are common (e.g. if representation of the first mantissa
12502 bit is explicit). */
12503 for (j = 0; j < NWORDS; j++)
12504 ored_words[j] &= ~anded_words[j];
12505 /* Now find the nonzero word. */
12506 for (j = 0; j < NWORDS; j++)
12507 if (ored_words[j] != 0)
12508 break;
12509 if (j < NWORDS)
12510 {
12511 size_t i;
12512 for (i = j + 1; i < NWORDS; i++)
12513 if (ored_words[i] != 0)
12514 {
12515 fprintf (fp, "unknown");
12516 return (fclose (fp) != 0);
12517 }
12518 for (i = 0; ; i++)
12519 if ((ored_words[j] >> i) & 1)
12520 {
12521 fprintf (fp, "word %d bit %d", (int) j, (int) i);
12522 return (fclose (fp) != 0);
12523 }
12524 }
12525 fprintf (fp, "unknown");
12526 return (fclose (fp) != 0);
12527}
5e8754f9 12528
c0c3707f
CB
12529_ACEOF
12530if ac_fn_c_try_run "$LINENO"; then :
12531 gl_cv_cc_double_expbit0=`cat conftest.out`
12532else
12533 gl_cv_cc_double_expbit0="unknown"
12534fi
12535rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12536 conftest.$ac_objext conftest.beam conftest.$ac_ext
12537fi
5e8754f9 12538
c0c3707f 12539 rm -f conftest.out
5e8754f9 12540
c0c3707f
CB
12541fi
12542{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
12543$as_echo "$gl_cv_cc_double_expbit0" >&6; }
12544 case "$gl_cv_cc_double_expbit0" in
12545 word*bit*)
12546 word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
12547 bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
5e8754f9 12548
c0c3707f
CB
12549cat >>confdefs.h <<_ACEOF
12550#define DBL_EXPBIT0_WORD $word
12551_ACEOF
5e8754f9
SDJ
12552
12553
c0c3707f
CB
12554cat >>confdefs.h <<_ACEOF
12555#define DBL_EXPBIT0_BIT $bit
12556_ACEOF
5e8754f9 12557
c0c3707f
CB
12558 ;;
12559 esac
5e8754f9
SDJ
12560
12561
c0c3707f
CB
12562 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
12563$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
12564if ${ac_cv_c_bigendian+:} false; then :
12565 $as_echo_n "(cached) " >&6
12566else
12567 ac_cv_c_bigendian=unknown
12568 # See if we're dealing with a universal compiler.
12569 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12570/* end confdefs.h. */
12571#ifndef __APPLE_CC__
12572 not a universal capable compiler
12573 #endif
12574 typedef int dummy;
5e8754f9 12575
c0c3707f
CB
12576_ACEOF
12577if ac_fn_c_try_compile "$LINENO"; then :
5e8754f9 12578
c0c3707f
CB
12579 # Check for potential -arch flags. It is not universal unless
12580 # there are at least two -arch flags with different values.
12581 ac_arch=
12582 ac_prev=
12583 for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
12584 if test -n "$ac_prev"; then
12585 case $ac_word in
12586 i?86 | x86_64 | ppc | ppc64)
12587 if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
12588 ac_arch=$ac_word
12589 else
12590 ac_cv_c_bigendian=universal
12591 break
12592 fi
12593 ;;
12594 esac
12595 ac_prev=
12596 elif test "x$ac_word" = "x-arch"; then
12597 ac_prev=arch
12598 fi
12599 done
12600fi
12601rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12602 if test $ac_cv_c_bigendian = unknown; then
12603 # See if sys/param.h defines the BYTE_ORDER macro.
12604 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12605/* end confdefs.h. */
12606#include <sys/types.h>
12607 #include <sys/param.h>
5e8754f9 12608
c0c3707f
CB
12609int
12610main ()
12611{
12612#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
12613 && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
12614 && LITTLE_ENDIAN)
12615 bogus endian macros
12616 #endif
5e8754f9 12617
c0c3707f
CB
12618 ;
12619 return 0;
12620}
12621_ACEOF
12622if ac_fn_c_try_compile "$LINENO"; then :
12623 # It does; now see whether it defined to BIG_ENDIAN or not.
12624 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12625/* end confdefs.h. */
12626#include <sys/types.h>
12627 #include <sys/param.h>
5e8754f9 12628
c0c3707f
CB
12629int
12630main ()
12631{
12632#if BYTE_ORDER != BIG_ENDIAN
12633 not big endian
12634 #endif
5e8754f9 12635
c0c3707f
CB
12636 ;
12637 return 0;
12638}
12639_ACEOF
12640if ac_fn_c_try_compile "$LINENO"; then :
12641 ac_cv_c_bigendian=yes
12642else
12643 ac_cv_c_bigendian=no
12644fi
12645rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12646fi
12647rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12648 fi
12649 if test $ac_cv_c_bigendian = unknown; then
12650 # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
12651 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12652/* end confdefs.h. */
12653#include <limits.h>
5e8754f9 12654
c0c3707f
CB
12655int
12656main ()
12657{
12658#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
12659 bogus endian macros
12660 #endif
5e8754f9 12661
c0c3707f
CB
12662 ;
12663 return 0;
12664}
12665_ACEOF
12666if ac_fn_c_try_compile "$LINENO"; then :
12667 # It does; now see whether it defined to _BIG_ENDIAN or not.
12668 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12669/* end confdefs.h. */
12670#include <limits.h>
5e8754f9 12671
c0c3707f
CB
12672int
12673main ()
12674{
12675#ifndef _BIG_ENDIAN
12676 not big endian
12677 #endif
5e8754f9 12678
c0c3707f
CB
12679 ;
12680 return 0;
12681}
12682_ACEOF
12683if ac_fn_c_try_compile "$LINENO"; then :
12684 ac_cv_c_bigendian=yes
12685else
12686 ac_cv_c_bigendian=no
12687fi
12688rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12689fi
12690rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12691 fi
12692 if test $ac_cv_c_bigendian = unknown; then
12693 # Compile a test program.
12694 if test "$cross_compiling" = yes; then :
12695 # Try to guess by grepping values from an object file.
12696 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12697/* end confdefs.h. */
12698short int ascii_mm[] =
12699 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
12700 short int ascii_ii[] =
12701 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
12702 int use_ascii (int i) {
12703 return ascii_mm[i] + ascii_ii[i];
12704 }
12705 short int ebcdic_ii[] =
12706 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
12707 short int ebcdic_mm[] =
12708 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
12709 int use_ebcdic (int i) {
12710 return ebcdic_mm[i] + ebcdic_ii[i];
12711 }
12712 extern int foo;
5e8754f9 12713
c0c3707f
CB
12714int
12715main ()
12716{
12717return use_ascii (foo) == use_ebcdic (foo);
12718 ;
12719 return 0;
12720}
12721_ACEOF
12722if ac_fn_c_try_compile "$LINENO"; then :
12723 if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
12724 ac_cv_c_bigendian=yes
12725 fi
12726 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
12727 if test "$ac_cv_c_bigendian" = unknown; then
12728 ac_cv_c_bigendian=no
12729 else
12730 # finding both strings is unlikely to happen, but who knows?
12731 ac_cv_c_bigendian=unknown
12732 fi
12733 fi
12734fi
12735rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12736else
12737 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12738/* end confdefs.h. */
12739$ac_includes_default
12740int
12741main ()
12742{
5e8754f9 12743
c0c3707f
CB
12744 /* Are we little or big endian? From Harbison&Steele. */
12745 union
12746 {
12747 long int l;
12748 char c[sizeof (long int)];
12749 } u;
12750 u.l = 1;
12751 return u.c[sizeof (long int) - 1] == 1;
5e8754f9 12752
c0c3707f
CB
12753 ;
12754 return 0;
12755}
12756_ACEOF
12757if ac_fn_c_try_run "$LINENO"; then :
12758 ac_cv_c_bigendian=no
6ec2e0f5 12759else
c0c3707f
CB
12760 ac_cv_c_bigendian=yes
12761fi
12762rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12763 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5
SDJ
12764fi
12765
c0c3707f
CB
12766 fi
12767fi
12768{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
12769$as_echo "$ac_cv_c_bigendian" >&6; }
12770 case $ac_cv_c_bigendian in #(
12771 yes)
12772 $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
12773;; #(
12774 no)
12775 ;; #(
12776 universal)
472fa5ee 12777
c0c3707f 12778$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
472fa5ee 12779
c0c3707f
CB
12780 ;; #(
12781 *)
12782 as_fn_error $? "unknown endianness
12783 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
12784 esac
472fa5ee 12785
472fa5ee
SM
12786
12787
c0c3707f
CB
12788 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
12789$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
12790if ${am_cv_langinfo_codeset+:} false; then :
12791 $as_echo_n "(cached) " >&6
12792else
12793 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12794/* end confdefs.h. */
12795#include <langinfo.h>
12796int
12797main ()
12798{
12799char* cs = nl_langinfo(CODESET); return !cs;
12800 ;
12801 return 0;
12802}
12803_ACEOF
12804if ac_fn_c_try_link "$LINENO"; then :
12805 am_cv_langinfo_codeset=yes
12806else
12807 am_cv_langinfo_codeset=no
12808fi
12809rm -f core conftest.err conftest.$ac_objext \
12810 conftest$ac_exeext conftest.$ac_ext
472fa5ee 12811
c0c3707f
CB
12812fi
12813{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
12814$as_echo "$am_cv_langinfo_codeset" >&6; }
12815 if test $am_cv_langinfo_codeset = yes; then
472fa5ee 12816
c0c3707f 12817$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
472fa5ee 12818
6ec2e0f5
SDJ
12819 fi
12820
472fa5ee
SM
12821
12822
12823
12824
c0c3707f
CB
12825 gl_threads_api=none
12826 LIBTHREAD=
12827 LTLIBTHREAD=
12828 LIBMULTITHREAD=
12829 LTLIBMULTITHREAD=
12830 if test "$gl_use_threads" != no; then
472fa5ee 12831
c0c3707f
CB
12832 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
12833$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
12834if ${gl_cv_have_weak+:} false; then :
12835 $as_echo_n "(cached) " >&6
12836else
12837 gl_cv_have_weak=no
12838 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12839/* end confdefs.h. */
12840extern void xyzzy ();
12841#pragma weak xyzzy
12842int
12843main ()
12844{
12845xyzzy();
12846 ;
12847 return 0;
12848}
12849_ACEOF
12850if ac_fn_c_try_link "$LINENO"; then :
12851 gl_cv_have_weak=maybe
12852fi
12853rm -f core conftest.err conftest.$ac_objext \
12854 conftest$ac_exeext conftest.$ac_ext
12855 if test $gl_cv_have_weak = maybe; then
12856 if test "$cross_compiling" = yes; then :
12857 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12858/* end confdefs.h. */
12859#ifdef __ELF__
12860 Extensible Linking Format
12861 #endif
6ec2e0f5 12862
c0c3707f
CB
12863_ACEOF
12864if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12865 $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
12866 gl_cv_have_weak="guessing yes"
12867else
12868 gl_cv_have_weak="guessing no"
12869fi
12870rm -f conftest*
6ec2e0f5
SDJ
12871
12872
c0c3707f
CB
12873else
12874 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12875/* end confdefs.h. */
6ec2e0f5 12876
c0c3707f
CB
12877#include <stdio.h>
12878#pragma weak fputs
12879int main ()
12880{
12881 return (fputs == NULL);
12882}
6ec2e0f5 12883_ACEOF
c0c3707f
CB
12884if ac_fn_c_try_run "$LINENO"; then :
12885 gl_cv_have_weak=yes
12886else
12887 gl_cv_have_weak=no
12888fi
12889rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12890 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5
SDJ
12891fi
12892
c0c3707f
CB
12893 fi
12894 case " $LDFLAGS " in
12895 *" -static "*) gl_cv_have_weak=no ;;
12896 esac
6ec2e0f5
SDJ
12897
12898fi
c0c3707f
CB
12899{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
12900$as_echo "$gl_cv_have_weak" >&6; }
12901 case "$gl_cv_have_weak" in
12902 *yes)
6ec2e0f5 12903
c0c3707f 12904$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
6ec2e0f5 12905
c0c3707f
CB
12906 ;;
12907 esac
6ec2e0f5 12908
c0c3707f 12909 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
6ec2e0f5 12910
c0c3707f
CB
12911 :
12912 fi
12913 if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
6ec2e0f5 12914
c0c3707f
CB
12915 if test $ac_cv_header_threads_h = yes; then
12916 gl_have_isoc_threads=
12917 # Test whether both mtx_lock and cnd_timedwait exist in libc.
12918 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12919/* end confdefs.h. */
12920#include <threads.h>
12921 #include <stddef.h>
12922 mtx_t m;
12923 cnd_t c;
6ec2e0f5 12924
c0c3707f
CB
12925int
12926main ()
12927{
12928mtx_lock (&m);
12929 cnd_timedwait (&c, &m, NULL);
12930 ;
12931 return 0;
12932}
12933_ACEOF
12934if ac_fn_c_try_link "$LINENO"; then :
12935 gl_have_isoc_threads=yes
12936fi
12937rm -f core conftest.err conftest.$ac_objext \
12938 conftest$ac_exeext conftest.$ac_ext
12939 fi
12940 fi
12941 if test "$gl_use_threads" = yes \
12942 || test "$gl_use_threads" = posix \
12943 || test "$gl_use_threads" = isoc+posix; then
12944
12945
12946 if test -z "$gl_threadlib_body_done"; then
12947 gl_pthread_api=no
12948 LIBPTHREAD=
12949 LIBPMULTITHREAD=
12950 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
12951 # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
12952 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
12953if test "x$ac_cv_header_pthread_h" = xyes; then :
12954 gl_have_pthread_h=yes
12955else
12956 gl_have_pthread_h=no
12957fi
6ec2e0f5 12958
6ec2e0f5 12959
c0c3707f
CB
12960 if test "$gl_have_pthread_h" = yes; then
12961 # Other possible tests:
12962 # -lpthreads (FSU threads, PCthreads)
12963 # -lgthreads
12964 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
12965 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
12966 # the second one only in libpthread, and lock.c needs it.
12967 #
12968 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
12969 # needs -pthread for some reason. See:
12970 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
12971 save_LIBS=$LIBS
12972 for gl_pthread in '' '-pthread'; do
12973 LIBS="$LIBS $gl_pthread"
12974 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12975/* end confdefs.h. */
12976#include <pthread.h>
12977 pthread_mutex_t m;
12978 pthread_mutexattr_t ma;
6ec2e0f5 12979
c0c3707f
CB
12980int
12981main ()
12982{
12983pthread_mutex_lock (&m);
12984 pthread_mutexattr_init (&ma);
12985 ;
12986 return 0;
12987}
6ec2e0f5 12988_ACEOF
c0c3707f
CB
12989if ac_fn_c_try_link "$LINENO"; then :
12990 gl_pthread_api=yes
12991 LIBPTHREAD=$gl_pthread
12992 LIBPMULTITHREAD=$gl_pthread
6ec2e0f5 12993fi
c0c3707f
CB
12994rm -f core conftest.err conftest.$ac_objext \
12995 conftest$ac_exeext conftest.$ac_ext
12996 LIBS=$save_LIBS
12997 test $gl_pthread_api = yes && break
12998 done
6ec2e0f5 12999
c0c3707f
CB
13000 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
13001 # since it is defined as a macro on OSF/1.)
13002 if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
13003 # The program links fine without libpthread. But it may actually
13004 # need to link with libpthread in order to create multiple threads.
13005 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
13006$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
13007if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
6ec2e0f5
SDJ
13008 $as_echo_n "(cached) " >&6
13009else
c0c3707f
CB
13010 ac_check_lib_save_LIBS=$LIBS
13011LIBS="-lpthread $LIBS"
13012cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13013/* end confdefs.h. */
6ec2e0f5 13014
c0c3707f
CB
13015/* Override any GCC internal prototype to avoid an error.
13016 Use char because int might match the return type of a GCC
13017 builtin and then its argument prototype would still apply. */
13018#ifdef __cplusplus
13019extern "C"
13020#endif
13021char pthread_kill ();
13022int
13023main ()
13024{
13025return pthread_kill ();
13026 ;
13027 return 0;
13028}
6ec2e0f5 13029_ACEOF
c0c3707f
CB
13030if ac_fn_c_try_link "$LINENO"; then :
13031 ac_cv_lib_pthread_pthread_kill=yes
6ec2e0f5 13032else
c0c3707f 13033 ac_cv_lib_pthread_pthread_kill=no
6ec2e0f5 13034fi
c0c3707f
CB
13035rm -f core conftest.err conftest.$ac_objext \
13036 conftest$ac_exeext conftest.$ac_ext
13037LIBS=$ac_check_lib_save_LIBS
6ec2e0f5 13038fi
c0c3707f
CB
13039{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
13040$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
13041if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
13042 LIBPMULTITHREAD=-lpthread
13043 # On Solaris and HP-UX, most pthread functions exist also in libc.
13044 # Therefore pthread_in_use() needs to actually try to create a
13045 # thread: pthread_create from libc will fail, whereas
13046 # pthread_create will actually create a thread.
13047 # On Solaris 10 or newer, this test is no longer needed, because
13048 # libc contains the fully functional pthread functions.
13049 case "$host_os" in
13050 solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
6ec2e0f5 13051
c0c3707f 13052$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
6ec2e0f5 13053
c0c3707f 13054 esac
6ec2e0f5
SDJ
13055
13056fi
13057
c0c3707f
CB
13058 elif test $gl_pthread_api != yes; then
13059 # Some library is needed. Try libpthread and libc_r.
13060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
13061$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
13062if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
6ec2e0f5
SDJ
13063 $as_echo_n "(cached) " >&6
13064else
c0c3707f
CB
13065 ac_check_lib_save_LIBS=$LIBS
13066LIBS="-lpthread $LIBS"
13067cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
13068/* end confdefs.h. */
13069
c0c3707f
CB
13070/* Override any GCC internal prototype to avoid an error.
13071 Use char because int might match the return type of a GCC
13072 builtin and then its argument prototype would still apply. */
13073#ifdef __cplusplus
13074extern "C"
13075#endif
13076char pthread_kill ();
6ec2e0f5
SDJ
13077int
13078main ()
13079{
c0c3707f
CB
13080return pthread_kill ();
13081 ;
13082 return 0;
13083}
13084_ACEOF
13085if ac_fn_c_try_link "$LINENO"; then :
13086 ac_cv_lib_pthread_pthread_kill=yes
13087else
13088 ac_cv_lib_pthread_pthread_kill=no
13089fi
13090rm -f core conftest.err conftest.$ac_objext \
13091 conftest$ac_exeext conftest.$ac_ext
13092LIBS=$ac_check_lib_save_LIBS
13093fi
13094{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
13095$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
13096if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
13097 gl_pthread_api=yes
13098 LIBPTHREAD=-lpthread
13099 LIBPMULTITHREAD=-lpthread
13100fi
6ec2e0f5 13101
c0c3707f
CB
13102 if test $gl_pthread_api != yes; then
13103 # For FreeBSD 4.
13104 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
13105$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
13106if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
13107 $as_echo_n "(cached) " >&6
13108else
13109 ac_check_lib_save_LIBS=$LIBS
13110LIBS="-lc_r $LIBS"
13111cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13112/* end confdefs.h. */
6ec2e0f5 13113
c0c3707f
CB
13114/* Override any GCC internal prototype to avoid an error.
13115 Use char because int might match the return type of a GCC
13116 builtin and then its argument prototype would still apply. */
13117#ifdef __cplusplus
13118extern "C"
13119#endif
13120char pthread_kill ();
13121int
13122main ()
13123{
13124return pthread_kill ();
6ec2e0f5
SDJ
13125 ;
13126 return 0;
13127}
13128_ACEOF
c0c3707f
CB
13129if ac_fn_c_try_link "$LINENO"; then :
13130 ac_cv_lib_c_r_pthread_kill=yes
6ec2e0f5 13131else
c0c3707f 13132 ac_cv_lib_c_r_pthread_kill=no
6ec2e0f5 13133fi
c0c3707f
CB
13134rm -f core conftest.err conftest.$ac_objext \
13135 conftest$ac_exeext conftest.$ac_ext
13136LIBS=$ac_check_lib_save_LIBS
13137fi
13138{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
13139$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
13140if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
13141 gl_pthread_api=yes
13142 LIBPTHREAD=-lc_r
13143 LIBPMULTITHREAD=-lc_r
6ec2e0f5 13144fi
6ec2e0f5 13145
c0c3707f
CB
13146 fi
13147 fi
13148 fi
13149 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
13150$as_echo_n "checking whether POSIX threads API is available... " >&6; }
13151 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
13152$as_echo "$gl_pthread_api" >&6; }
6ec2e0f5
SDJ
13153
13154
c0c3707f 13155 if test $gl_pthread_api = yes; then
6ec2e0f5 13156
c0c3707f 13157$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
6ec2e0f5 13158
c0c3707f
CB
13159 fi
13160 gl_threadlib_body_done=done
13161 fi
6ec2e0f5 13162
c0c3707f
CB
13163 LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
13164 LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
13165 if test $gl_pthread_api = yes; then
13166 if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
13167 gl_threads_api='isoc+posix'
6ec2e0f5 13168
c0c3707f 13169$as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h
6ec2e0f5 13170
c0c3707f
CB
13171 LIBTHREAD= LTLIBTHREAD=
13172 else
13173 gl_threads_api=posix
13174
13175$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
13176
13177 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
13178 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
13179
13180$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
13181
13182 LIBTHREAD= LTLIBTHREAD=
13183 fi
13184 fi
13185 fi
13186 fi
13187 fi
13188 if test $gl_threads_api = none; then
13189 if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
13190 gl_threads_api=isoc
13191
13192$as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h
13193
13194 fi
13195 fi
13196 if test $gl_threads_api = none; then
13197 case "$gl_use_threads" in
13198 yes | windows | win32) # The 'win32' is for backward compatibility.
13199 if { case "$host_os" in
13200 mingw*) true;;
13201 *) false;;
13202 esac
13203 }; then
13204 gl_threads_api=windows
13205
13206$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
13207
13208 fi
13209 ;;
13210 esac
13211 fi
13212 fi
13213 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
13214$as_echo_n "checking for multithread API to use... " >&6; }
13215 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
13216$as_echo "$gl_threads_api" >&6; }
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
13230$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
13231if ${gl_cv_func_malloc_posix+:} false; then :
6ec2e0f5
SDJ
13232 $as_echo_n "(cached) " >&6
13233else
c0c3707f
CB
13234
13235 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 13236/* end confdefs.h. */
c0c3707f 13237
6ec2e0f5
SDJ
13238int
13239main ()
13240{
c0c3707f
CB
13241#if defined _WIN32 && ! defined __CYGWIN__
13242 choke me
13243 #endif
6ec2e0f5
SDJ
13244
13245 ;
13246 return 0;
13247}
13248_ACEOF
13249if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 13250 gl_cv_func_malloc_posix=yes
6ec2e0f5 13251else
c0c3707f 13252 gl_cv_func_malloc_posix=no
6ec2e0f5
SDJ
13253fi
13254rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
472fa5ee 13255
c0c3707f
CB
13256fi
13257{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
13258$as_echo "$gl_cv_func_malloc_posix" >&6; }
472fa5ee
SM
13259
13260
6ec2e0f5 13261
c0c3707f
CB
13262 for ac_header in stdlib.h
13263do :
13264 ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
13265if test "x$ac_cv_header_stdlib_h" = xyes; then :
13266 cat >>confdefs.h <<_ACEOF
13267#define HAVE_STDLIB_H 1
6ec2e0f5
SDJ
13268_ACEOF
13269
c0c3707f 13270fi
6ec2e0f5 13271
c0c3707f 13272done
472fa5ee 13273
c0c3707f
CB
13274 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
13275$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
13276if ${ac_cv_func_malloc_0_nonnull+:} false; then :
6ec2e0f5
SDJ
13277 $as_echo_n "(cached) " >&6
13278else
13279 if test "$cross_compiling" = yes; then :
13280 case "$host_os" in
c0c3707f
CB
13281 # Guess yes on platforms where we know the result.
13282 *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
13283 | hpux* | solaris* | cygwin* | mingw*)
13284 ac_cv_func_malloc_0_nonnull="guessing yes" ;;
13285 # If we don't know, obey --enable-cross-guesses.
13286 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
13287 esac
6ec2e0f5
SDJ
13288
13289else
13290 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13291/* end confdefs.h. */
c0c3707f
CB
13292#if defined STDC_HEADERS || defined HAVE_STDLIB_H
13293 # include <stdlib.h>
13294 #else
13295 char *malloc ();
13296 #endif
6ec2e0f5
SDJ
13297
13298int
13299main ()
13300{
c0c3707f
CB
13301char *p = malloc (0);
13302 int result = !p;
13303 free (p);
13304 return result;
6ec2e0f5
SDJ
13305 ;
13306 return 0;
13307}
c0c3707f 13308
6ec2e0f5
SDJ
13309_ACEOF
13310if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 13311 ac_cv_func_malloc_0_nonnull=yes
6ec2e0f5 13312else
c0c3707f 13313 ac_cv_func_malloc_0_nonnull=no
6ec2e0f5
SDJ
13314fi
13315rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13316 conftest.$ac_objext conftest.beam conftest.$ac_ext
13317fi
13318
13319
13320fi
c0c3707f
CB
13321{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
13322$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
13323 case "$ac_cv_func_malloc_0_nonnull" in
13324 *yes)
13325 gl_cv_func_malloc_0_nonnull=1
13326 ;;
6ec2e0f5 13327 *)
c0c3707f 13328 gl_cv_func_malloc_0_nonnull=0
6ec2e0f5
SDJ
13329 ;;
13330 esac
13331
13332
c0c3707f
CB
13333cat >>confdefs.h <<_ACEOF
13334#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
13335_ACEOF
13336
13337
13338
13339
13340
13341 GNULIB_BTOWC=0;
13342 GNULIB_WCTOB=0;
13343 GNULIB_MBSINIT=0;
13344 GNULIB_MBRTOWC=0;
13345 GNULIB_MBRLEN=0;
13346 GNULIB_MBSRTOWCS=0;
13347 GNULIB_MBSNRTOWCS=0;
13348 GNULIB_WCRTOMB=0;
13349 GNULIB_WCSRTOMBS=0;
13350 GNULIB_WCSNRTOMBS=0;
13351 GNULIB_WCWIDTH=0;
13352 GNULIB_WMEMCHR=0;
13353 GNULIB_WMEMCMP=0;
13354 GNULIB_WMEMCPY=0;
13355 GNULIB_WMEMMOVE=0;
13356 GNULIB_WMEMSET=0;
13357 GNULIB_WCSLEN=0;
13358 GNULIB_WCSNLEN=0;
13359 GNULIB_WCSCPY=0;
13360 GNULIB_WCPCPY=0;
13361 GNULIB_WCSNCPY=0;
13362 GNULIB_WCPNCPY=0;
13363 GNULIB_WCSCAT=0;
13364 GNULIB_WCSNCAT=0;
13365 GNULIB_WCSCMP=0;
13366 GNULIB_WCSNCMP=0;
13367 GNULIB_WCSCASECMP=0;
13368 GNULIB_WCSNCASECMP=0;
13369 GNULIB_WCSCOLL=0;
13370 GNULIB_WCSXFRM=0;
13371 GNULIB_WCSDUP=0;
13372 GNULIB_WCSCHR=0;
13373 GNULIB_WCSRCHR=0;
13374 GNULIB_WCSCSPN=0;
13375 GNULIB_WCSSPN=0;
13376 GNULIB_WCSPBRK=0;
13377 GNULIB_WCSSTR=0;
13378 GNULIB_WCSTOK=0;
13379 GNULIB_WCSWIDTH=0;
13380 GNULIB_WCSFTIME=0;
13381 HAVE_BTOWC=1;
13382 HAVE_MBSINIT=1;
13383 HAVE_MBRTOWC=1;
13384 HAVE_MBRLEN=1;
13385 HAVE_MBSRTOWCS=1;
13386 HAVE_MBSNRTOWCS=1;
13387 HAVE_WCRTOMB=1;
13388 HAVE_WCSRTOMBS=1;
13389 HAVE_WCSNRTOMBS=1;
13390 HAVE_WMEMCHR=1;
13391 HAVE_WMEMCMP=1;
13392 HAVE_WMEMCPY=1;
13393 HAVE_WMEMMOVE=1;
13394 HAVE_WMEMSET=1;
13395 HAVE_WCSLEN=1;
13396 HAVE_WCSNLEN=1;
13397 HAVE_WCSCPY=1;
13398 HAVE_WCPCPY=1;
13399 HAVE_WCSNCPY=1;
13400 HAVE_WCPNCPY=1;
13401 HAVE_WCSCAT=1;
13402 HAVE_WCSNCAT=1;
13403 HAVE_WCSCMP=1;
13404 HAVE_WCSNCMP=1;
13405 HAVE_WCSCASECMP=1;
13406 HAVE_WCSNCASECMP=1;
13407 HAVE_WCSCOLL=1;
13408 HAVE_WCSXFRM=1;
13409 HAVE_WCSDUP=1;
13410 HAVE_WCSCHR=1;
13411 HAVE_WCSRCHR=1;
13412 HAVE_WCSCSPN=1;
13413 HAVE_WCSSPN=1;
13414 HAVE_WCSPBRK=1;
13415 HAVE_WCSSTR=1;
13416 HAVE_WCSTOK=1;
13417 HAVE_WCSWIDTH=1;
13418 HAVE_WCSFTIME=1;
13419 HAVE_DECL_WCTOB=1;
13420 HAVE_DECL_WCWIDTH=1;
13421 REPLACE_MBSTATE_T=0;
13422 REPLACE_BTOWC=0;
13423 REPLACE_WCTOB=0;
13424 REPLACE_MBSINIT=0;
13425 REPLACE_MBRTOWC=0;
13426 REPLACE_MBRLEN=0;
13427 REPLACE_MBSRTOWCS=0;
13428 REPLACE_MBSNRTOWCS=0;
13429 REPLACE_WCRTOMB=0;
13430 REPLACE_WCSRTOMBS=0;
13431 REPLACE_WCSNRTOMBS=0;
13432 REPLACE_WCWIDTH=0;
13433 REPLACE_WCSWIDTH=0;
13434 REPLACE_WCSFTIME=0;
13435 REPLACE_WCSTOK=0;
13436
13437
6ec2e0f5
SDJ
13438
13439
13440
13441
13442
13443
c0c3707f
CB
13444 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
13445$as_echo_n "checking for a traditional japanese locale... " >&6; }
13446if ${gt_cv_locale_ja+:} false; then :
13447 $as_echo_n "(cached) " >&6
13448else
13449
13450 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13451/* end confdefs.h. */
6ec2e0f5 13452
c0c3707f
CB
13453#include <locale.h>
13454#include <time.h>
13455#if HAVE_LANGINFO_CODESET
13456# include <langinfo.h>
13457#endif
13458#include <stdlib.h>
13459#include <string.h>
13460struct tm t;
13461char buf[16];
13462int main ()
13463{
13464 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
13465 imitates locale dependent behaviour by looking at the environment
13466 variables, and all locales use the UTF-8 encoding. */
13467#if defined __BEOS__ || defined __HAIKU__
13468 return 1;
13469#else
13470 /* Check whether the given locale name is recognized by the system. */
13471# if defined _WIN32 && !defined __CYGWIN__
13472 /* On native Windows, setlocale(category, "") looks at the system settings,
13473 not at the environment variables. Also, when an encoding suffix such
13474 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
13475 category of the locale to "C". */
13476 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
13477 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
13478 return 1;
13479# else
13480 if (setlocale (LC_ALL, "") == NULL) return 1;
13481# endif
13482 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
13483 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
13484 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
13485 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
13486 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
13487 some unit tests fail.
13488 On MirBSD 10, when an unsupported locale is specified, setlocale()
13489 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
13490# if HAVE_LANGINFO_CODESET
13491 {
13492 const char *cs = nl_langinfo (CODESET);
13493 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
13494 || strcmp (cs, "UTF-8") == 0)
13495 return 1;
13496 }
13497# endif
13498# ifdef __CYGWIN__
13499 /* On Cygwin, avoid locale names without encoding suffix, because the
13500 locale_charset() function relies on the encoding suffix. Note that
13501 LC_ALL is set on the command line. */
13502 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
13503# endif
13504 /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
13505 on Cygwin 1.5.x. */
13506 if (MB_CUR_MAX == 1)
13507 return 1;
13508 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
13509 This excludes the UTF-8 encoding (except on MirBSD). */
13510 {
13511 const char *p;
13512 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
13513 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
13514 for (p = buf; *p != '\0'; p++)
13515 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
13516 return 1;
13517 }
13518 return 0;
13519#endif
13520}
6ec2e0f5 13521
c0c3707f
CB
13522_ACEOF
13523 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13524 (eval $ac_link) 2>&5
13525 ac_status=$?
13526 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13527 test $ac_status = 0; } && test -s conftest$ac_exeext; then
13528 case "$host_os" in
13529 # Handle native Windows specially, because there setlocale() interprets
13530 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
13531 # "fr" or "fra" as "French" or "French_France.1252",
13532 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
13533 # "ja" as "Japanese" or "Japanese_Japan.932",
13534 # and similar.
13535 mingw*)
13536 # Note that on native Windows, the Japanese locale is
13537 # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
13538 # cannot use it here.
13539 gt_cv_locale_ja=none
13540 ;;
13541 *)
13542 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
13543 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
13544 # configure script would override the LC_ALL setting. Likewise for
13545 # LC_CTYPE, which is also set at the beginning of the configure script.
13546 # Test for the AIX locale name.
13547 if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13548 gt_cv_locale_ja=ja_JP
13549 else
13550 # Test for the locale name with explicit encoding suffix.
13551 if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13552 gt_cv_locale_ja=ja_JP.EUC-JP
13553 else
13554 # Test for the HP-UX, OSF/1, NetBSD locale name.
13555 if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13556 gt_cv_locale_ja=ja_JP.eucJP
13557 else
13558 # Test for the IRIX, FreeBSD locale name.
13559 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13560 gt_cv_locale_ja=ja_JP.EUC
13561 else
13562 # Test for the Solaris 7 locale name.
13563 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13564 gt_cv_locale_ja=ja
13565 else
13566 # Special test for NetBSD 1.6.
13567 if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
13568 gt_cv_locale_ja=ja_JP.eucJP
13569 else
13570 # None found.
13571 gt_cv_locale_ja=none
13572 fi
13573 fi
13574 fi
13575 fi
13576 fi
13577 fi
13578 ;;
13579 esac
13580 fi
13581 rm -fr conftest*
5abebf3c
CB
13582
13583fi
c0c3707f
CB
13584{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
13585$as_echo "$gt_cv_locale_ja" >&6; }
13586 LOCALE_JA=$gt_cv_locale_ja
5abebf3c 13587
5abebf3c 13588
5abebf3c 13589
5abebf3c 13590
c0c3707f
CB
13591 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
13592$as_echo_n "checking for a french Unicode locale... " >&6; }
13593if ${gt_cv_locale_fr_utf8+:} false; then :
5abebf3c
CB
13594 $as_echo_n "(cached) " >&6
13595else
5abebf3c 13596
c0c3707f 13597 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 13598/* end confdefs.h. */
5abebf3c 13599
c0c3707f
CB
13600#include <locale.h>
13601#include <time.h>
13602#if HAVE_LANGINFO_CODESET
13603# include <langinfo.h>
13604#endif
13605#include <stdlib.h>
13606#include <string.h>
13607struct tm t;
13608char buf[16];
13609int main () {
13610 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
13611 imitates locale dependent behaviour by looking at the environment
13612 variables, and all locales use the UTF-8 encoding. */
13613#if !(defined __BEOS__ || defined __HAIKU__)
13614 /* Check whether the given locale name is recognized by the system. */
13615# if defined _WIN32 && !defined __CYGWIN__
13616 /* On native Windows, setlocale(category, "") looks at the system settings,
13617 not at the environment variables. Also, when an encoding suffix such
13618 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
13619 category of the locale to "C". */
13620 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
13621 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
13622 return 1;
13623# else
13624 if (setlocale (LC_ALL, "") == NULL) return 1;
13625# endif
13626 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
13627 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
13628 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
13629 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
13630 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
13631 some unit tests fail. */
13632# if HAVE_LANGINFO_CODESET
13633 {
13634 const char *cs = nl_langinfo (CODESET);
13635 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
13636 return 1;
13637 }
13638# endif
13639# ifdef __CYGWIN__
13640 /* On Cygwin, avoid locale names without encoding suffix, because the
13641 locale_charset() function relies on the encoding suffix. Note that
13642 LC_ALL is set on the command line. */
13643 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
13644# endif
13645 /* Check whether in the abbreviation of the second month, the second
13646 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
13647 two bytes long, with UTF-8 encoding. */
13648 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
13649 if (strftime (buf, sizeof (buf), "%b", &t) < 4
13650 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
13651 return 1;
13652#endif
13653#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
13654 /* Check whether the decimal separator is a comma.
13655 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
13656 are nl_langinfo(RADIXCHAR) are both ".". */
13657 if (localeconv () ->decimal_point[0] != ',') return 1;
13658#endif
5abebf3c
CB
13659 return 0;
13660}
5abebf3c 13661
c0c3707f
CB
13662_ACEOF
13663 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13664 (eval $ac_link) 2>&5
13665 ac_status=$?
13666 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13667 test $ac_status = 0; } && test -s conftest$ac_exeext; then
13668 case "$host_os" in
13669 # Handle native Windows specially, because there setlocale() interprets
13670 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
13671 # "fr" or "fra" as "French" or "French_France.1252",
13672 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
13673 # "ja" as "Japanese" or "Japanese_Japan.932",
13674 # and similar.
13675 mingw*)
13676 # Test for the hypothetical native Windows locale name.
13677 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13678 gt_cv_locale_fr_utf8=French_France.65001
13679 else
13680 # None found.
13681 gt_cv_locale_fr_utf8=none
13682 fi
13683 ;;
13684 *)
13685 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
13686 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
13687 # configure script would override the LC_ALL setting. Likewise for
13688 # LC_CTYPE, which is also set at the beginning of the configure script.
13689 # Test for the usual locale name.
13690 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13691 gt_cv_locale_fr_utf8=fr_FR
13692 else
13693 # Test for the locale name with explicit encoding suffix.
13694 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13695 gt_cv_locale_fr_utf8=fr_FR.UTF-8
13696 else
13697 # Test for the Solaris 7 locale name.
13698 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13699 gt_cv_locale_fr_utf8=fr.UTF-8
13700 else
13701 # None found.
13702 gt_cv_locale_fr_utf8=none
13703 fi
13704 fi
13705 fi
13706 ;;
13707 esac
13708 fi
13709 rm -fr conftest*
5abebf3c
CB
13710
13711fi
c0c3707f
CB
13712{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
13713$as_echo "$gt_cv_locale_fr_utf8" >&6; }
13714 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
5abebf3c
CB
13715
13716
13717
13718
13719
c0c3707f
CB
13720 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
13721$as_echo_n "checking for a transitional chinese locale... " >&6; }
13722if ${gt_cv_locale_zh_CN+:} false; then :
5abebf3c
CB
13723 $as_echo_n "(cached) " >&6
13724else
5abebf3c 13725
c0c3707f 13726 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5abebf3c 13727/* end confdefs.h. */
5abebf3c 13728
c0c3707f
CB
13729#include <locale.h>
13730#include <stdlib.h>
13731#include <time.h>
13732#if HAVE_LANGINFO_CODESET
13733# include <langinfo.h>
13734#endif
13735#include <stdlib.h>
13736#include <string.h>
13737struct tm t;
13738char buf[16];
13739int main ()
5abebf3c 13740{
c0c3707f
CB
13741 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
13742 imitates locale dependent behaviour by looking at the environment
13743 variables, and all locales use the UTF-8 encoding. */
13744#if defined __BEOS__ || defined __HAIKU__
13745 return 1;
13746#else
13747 /* Check whether the given locale name is recognized by the system. */
13748# if defined _WIN32 && !defined __CYGWIN__
13749 /* On native Windows, setlocale(category, "") looks at the system settings,
13750 not at the environment variables. Also, when an encoding suffix such
13751 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
13752 category of the locale to "C". */
13753 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
13754 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
13755 return 1;
13756# else
13757 if (setlocale (LC_ALL, "") == NULL) return 1;
13758# endif
13759 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
13760 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
13761 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
13762 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
13763 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
13764 some unit tests fail.
13765 On MirBSD 10, when an unsupported locale is specified, setlocale()
13766 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
13767# if HAVE_LANGINFO_CODESET
13768 {
13769 const char *cs = nl_langinfo (CODESET);
13770 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
13771 || strcmp (cs, "UTF-8") == 0)
13772 return 1;
13773 }
13774# endif
13775# ifdef __CYGWIN__
13776 /* On Cygwin, avoid locale names without encoding suffix, because the
13777 locale_charset() function relies on the encoding suffix. Note that
13778 LC_ALL is set on the command line. */
13779 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
13780# endif
13781 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
13782 This excludes the UTF-8 encoding (except on MirBSD). */
13783 {
13784 const char *p;
13785 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
13786 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
13787 for (p = buf; *p != '\0'; p++)
13788 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
13789 return 1;
13790 }
13791 /* Check whether a typical GB18030 multibyte sequence is recognized as a
13792 single wide character. This excludes the GB2312 and GBK encodings. */
13793 if (mblen ("\203\062\332\066", 5) != 4)
13794 return 1;
5abebf3c 13795 return 0;
c0c3707f 13796#endif
5abebf3c 13797}
c0c3707f 13798
5abebf3c 13799_ACEOF
c0c3707f
CB
13800 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13801 (eval $ac_link) 2>&5
13802 ac_status=$?
13803 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13804 test $ac_status = 0; } && test -s conftest$ac_exeext; then
13805 case "$host_os" in
13806 # Handle native Windows specially, because there setlocale() interprets
13807 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
13808 # "fr" or "fra" as "French" or "French_France.1252",
13809 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
13810 # "ja" as "Japanese" or "Japanese_Japan.932",
13811 # and similar.
13812 mingw*)
13813 # Test for the hypothetical native Windows locale name.
13814 if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13815 gt_cv_locale_zh_CN=Chinese_China.54936
13816 else
13817 # None found.
13818 gt_cv_locale_zh_CN=none
13819 fi
13820 ;;
13821 solaris2.8)
13822 # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
13823 # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
13824 # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
13825 gt_cv_locale_zh_CN=none
13826 ;;
13827 *)
13828 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
13829 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
13830 # configure script would override the LC_ALL setting. Likewise for
13831 # LC_CTYPE, which is also set at the beginning of the configure script.
13832 # Test for the locale name without encoding suffix.
13833 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13834 gt_cv_locale_zh_CN=zh_CN
13835 else
13836 # Test for the locale name with explicit encoding suffix.
13837 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13838 gt_cv_locale_zh_CN=zh_CN.GB18030
13839 else
13840 # None found.
13841 gt_cv_locale_zh_CN=none
13842 fi
13843 fi
13844 ;;
13845 esac
13846 else
13847 # If there was a link error, due to mblen(), the system is so old that
13848 # it certainly doesn't have a chinese locale.
13849 gt_cv_locale_zh_CN=none
13850 fi
13851 rm -fr conftest*
13852
5abebf3c 13853fi
c0c3707f
CB
13854{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
13855$as_echo "$gt_cv_locale_zh_CN" >&6; }
13856 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
13857
13858
13859{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
13860$as_echo_n "checking for inline... " >&6; }
13861if ${ac_cv_c_inline+:} false; then :
13862 $as_echo_n "(cached) " >&6
13863else
13864 ac_cv_c_inline=no
13865for ac_kw in inline __inline__ __inline; do
13866 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13867/* end confdefs.h. */
13868#ifndef __cplusplus
13869typedef int foo_t;
13870static $ac_kw foo_t static_foo () {return 0; }
13871$ac_kw foo_t foo () {return 0; }
13872#endif
5abebf3c 13873
c0c3707f
CB
13874_ACEOF
13875if ac_fn_c_try_compile "$LINENO"; then :
13876 ac_cv_c_inline=$ac_kw
13877fi
13878rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13879 test "$ac_cv_c_inline" != no && break
13880done
5abebf3c
CB
13881
13882fi
c0c3707f
CB
13883{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
13884$as_echo "$ac_cv_c_inline" >&6; }
5abebf3c 13885
c0c3707f
CB
13886case $ac_cv_c_inline in
13887 inline | yes) ;;
13888 *)
13889 case $ac_cv_c_inline in
13890 no) ac_val=;;
13891 *) ac_val=$ac_cv_c_inline;;
13892 esac
13893 cat >>confdefs.h <<_ACEOF
13894#ifndef __cplusplus
13895#define inline $ac_val
13896#endif
13897_ACEOF
13898 ;;
13899esac
5abebf3c
CB
13900
13901
13902
13903
c0c3707f
CB
13904 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
13905$as_echo_n "checking for a traditional french locale... " >&6; }
13906if ${gt_cv_locale_fr+:} false; then :
13907 $as_echo_n "(cached) " >&6
13908else
5abebf3c 13909
c0c3707f
CB
13910 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13911/* end confdefs.h. */
5abebf3c 13912
c0c3707f
CB
13913#include <locale.h>
13914#include <time.h>
13915#if HAVE_LANGINFO_CODESET
13916# include <langinfo.h>
13917#endif
13918#include <stdlib.h>
13919#include <string.h>
13920struct tm t;
13921char buf[16];
13922int main () {
13923 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
13924 imitates locale dependent behaviour by looking at the environment
13925 variables, and all locales use the UTF-8 encoding. */
13926#if defined __BEOS__ || defined __HAIKU__
13927 return 1;
13928#else
13929 /* Check whether the given locale name is recognized by the system. */
13930# if defined _WIN32 && !defined __CYGWIN__
13931 /* On native Windows, setlocale(category, "") looks at the system settings,
13932 not at the environment variables. Also, when an encoding suffix such
13933 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
13934 category of the locale to "C". */
13935 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
13936 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
13937 return 1;
13938# else
13939 if (setlocale (LC_ALL, "") == NULL) return 1;
13940# endif
13941 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
13942 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
13943 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
13944 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
13945 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
13946 some unit tests fail.
13947 On MirBSD 10, when an unsupported locale is specified, setlocale()
13948 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
13949# if HAVE_LANGINFO_CODESET
13950 {
13951 const char *cs = nl_langinfo (CODESET);
13952 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
13953 || strcmp (cs, "UTF-8") == 0)
13954 return 1;
13955 }
13956# endif
13957# ifdef __CYGWIN__
13958 /* On Cygwin, avoid locale names without encoding suffix, because the
13959 locale_charset() function relies on the encoding suffix. Note that
13960 LC_ALL is set on the command line. */
13961 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
13962# endif
13963 /* Check whether in the abbreviation of the second month, the second
13964 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
13965 one byte long. This excludes the UTF-8 encoding. */
13966 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
13967 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
13968# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
13969 /* Check whether the decimal separator is a comma.
13970 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
13971 are nl_langinfo(RADIXCHAR) are both ".". */
13972 if (localeconv () ->decimal_point[0] != ',') return 1;
13973# endif
13974 return 0;
13975#endif
13976}
5abebf3c 13977
c0c3707f
CB
13978_ACEOF
13979 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
13980 (eval $ac_link) 2>&5
13981 ac_status=$?
13982 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13983 test $ac_status = 0; } && test -s conftest$ac_exeext; then
13984 case "$host_os" in
13985 # Handle native Windows specially, because there setlocale() interprets
13986 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
13987 # "fr" or "fra" as "French" or "French_France.1252",
13988 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
13989 # "ja" as "Japanese" or "Japanese_Japan.932",
13990 # and similar.
13991 mingw*)
13992 # Test for the native Windows locale name.
13993 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
13994 gt_cv_locale_fr=French_France.1252
13995 else
13996 # None found.
13997 gt_cv_locale_fr=none
13998 fi
13999 ;;
14000 *)
14001 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
14002 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
14003 # configure script would override the LC_ALL setting. Likewise for
14004 # LC_CTYPE, which is also set at the beginning of the configure script.
14005 # Test for the usual locale name.
14006 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14007 gt_cv_locale_fr=fr_FR
14008 else
14009 # Test for the locale name with explicit encoding suffix.
14010 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14011 gt_cv_locale_fr=fr_FR.ISO-8859-1
14012 else
14013 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
14014 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14015 gt_cv_locale_fr=fr_FR.ISO8859-1
14016 else
14017 # Test for the HP-UX locale name.
14018 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14019 gt_cv_locale_fr=fr_FR.iso88591
14020 else
14021 # Test for the Solaris 7 locale name.
14022 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
14023 gt_cv_locale_fr=fr
14024 else
14025 # None found.
14026 gt_cv_locale_fr=none
14027 fi
14028 fi
14029 fi
14030 fi
14031 fi
14032 ;;
14033 esac
14034 fi
14035 rm -fr conftest*
5abebf3c 14036
c0c3707f
CB
14037fi
14038{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
14039$as_echo "$gt_cv_locale_fr" >&6; }
14040 LOCALE_FR=$gt_cv_locale_fr
5abebf3c
CB
14041
14042
14043
14044
14045
14046
14047
c0c3707f
CB
14048 GNULIB_EXPLICIT_BZERO=0;
14049 GNULIB_FFSL=0;
14050 GNULIB_FFSLL=0;
14051 GNULIB_MEMCHR=0;
14052 GNULIB_MEMMEM=0;
14053 GNULIB_MEMPCPY=0;
14054 GNULIB_MEMRCHR=0;
14055 GNULIB_RAWMEMCHR=0;
14056 GNULIB_STPCPY=0;
14057 GNULIB_STPNCPY=0;
14058 GNULIB_STRCHRNUL=0;
14059 GNULIB_STRDUP=0;
14060 GNULIB_STRNCAT=0;
14061 GNULIB_STRNDUP=0;
14062 GNULIB_STRNLEN=0;
14063 GNULIB_STRPBRK=0;
14064 GNULIB_STRSEP=0;
14065 GNULIB_STRSTR=0;
14066 GNULIB_STRCASESTR=0;
14067 GNULIB_STRTOK_R=0;
14068 GNULIB_MBSLEN=0;
14069 GNULIB_MBSNLEN=0;
14070 GNULIB_MBSCHR=0;
14071 GNULIB_MBSRCHR=0;
14072 GNULIB_MBSSTR=0;
14073 GNULIB_MBSCASECMP=0;
14074 GNULIB_MBSNCASECMP=0;
14075 GNULIB_MBSPCASECMP=0;
14076 GNULIB_MBSCASESTR=0;
14077 GNULIB_MBSCSPN=0;
14078 GNULIB_MBSPBRK=0;
14079 GNULIB_MBSSPN=0;
14080 GNULIB_MBSSEP=0;
14081 GNULIB_MBSTOK_R=0;
14082 GNULIB_STRERROR=0;
14083 GNULIB_STRERROR_R=0;
14084 GNULIB_STRSIGNAL=0;
14085 GNULIB_STRVERSCMP=0;
14086 HAVE_MBSLEN=0;
14087 HAVE_EXPLICIT_BZERO=1;
14088 HAVE_FFSL=1;
14089 HAVE_FFSLL=1;
14090 HAVE_MEMCHR=1;
14091 HAVE_DECL_MEMMEM=1;
14092 HAVE_MEMPCPY=1;
14093 HAVE_DECL_MEMRCHR=1;
14094 HAVE_RAWMEMCHR=1;
14095 HAVE_STPCPY=1;
14096 HAVE_STPNCPY=1;
14097 HAVE_STRCHRNUL=1;
14098 HAVE_DECL_STRDUP=1;
14099 HAVE_DECL_STRNDUP=1;
14100 HAVE_DECL_STRNLEN=1;
14101 HAVE_STRPBRK=1;
14102 HAVE_STRSEP=1;
14103 HAVE_STRCASESTR=1;
14104 HAVE_DECL_STRTOK_R=1;
14105 HAVE_DECL_STRERROR_R=1;
14106 HAVE_DECL_STRSIGNAL=1;
14107 HAVE_STRVERSCMP=1;
14108 REPLACE_MEMCHR=0;
14109 REPLACE_MEMMEM=0;
14110 REPLACE_STPNCPY=0;
14111 REPLACE_STRCHRNUL=0;
14112 REPLACE_STRDUP=0;
14113 REPLACE_STRNCAT=0;
14114 REPLACE_STRNDUP=0;
14115 REPLACE_STRNLEN=0;
14116 REPLACE_STRSTR=0;
14117 REPLACE_STRCASESTR=0;
14118 REPLACE_STRTOK_R=0;
14119 REPLACE_STRERROR=0;
14120 REPLACE_STRERROR_R=0;
14121 REPLACE_STRSIGNAL=0;
14122 UNDEFINE_STRTOK_R=0;
5abebf3c
CB
14123
14124
14125
14126
6ec2e0f5
SDJ
14127
14128
c0c3707f
CB
14129 # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
14130 # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
14131 # irrelevant for anonymous mappings.
14132 ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
14133if test "x$ac_cv_func_mmap" = xyes; then :
14134 gl_have_mmap=yes
6ec2e0f5 14135else
c0c3707f
CB
14136 gl_have_mmap=no
14137fi
6ec2e0f5
SDJ
14138
14139
c0c3707f
CB
14140 # Try to allow MAP_ANONYMOUS.
14141 gl_have_mmap_anonymous=no
14142 if test $gl_have_mmap = yes; then
14143 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
14144$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
14145 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14146/* end confdefs.h. */
6ec2e0f5 14147
c0c3707f
CB
14148#include <sys/mman.h>
14149#ifdef MAP_ANONYMOUS
14150 I cannot identify this map
14151#endif
6ec2e0f5 14152
c0c3707f
CB
14153_ACEOF
14154if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14155 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
14156 gl_have_mmap_anonymous=yes
6ec2e0f5 14157fi
c0c3707f 14158rm -f conftest*
6ec2e0f5 14159
c0c3707f
CB
14160 if test $gl_have_mmap_anonymous != yes; then
14161 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14162/* end confdefs.h. */
6ec2e0f5 14163
c0c3707f
CB
14164#include <sys/mman.h>
14165#ifdef MAP_ANON
14166 I cannot identify this map
14167#endif
6ec2e0f5 14168
c0c3707f
CB
14169_ACEOF
14170if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14171 $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
6ec2e0f5 14172
c0c3707f 14173$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
5e8754f9 14174
c0c3707f 14175 gl_have_mmap_anonymous=yes
5e8754f9 14176fi
c0c3707f
CB
14177rm -f conftest*
14178
14179 fi
14180 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
14181$as_echo "$gl_have_mmap_anonymous" >&6; }
14182 if test $gl_have_mmap_anonymous = yes; then
6ec2e0f5 14183
c0c3707f 14184$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
6ec2e0f5 14185
c0c3707f
CB
14186 fi
14187 fi
6ec2e0f5
SDJ
14188
14189
14190
14191
6ec2e0f5 14192
6ec2e0f5 14193
c0c3707f
CB
14194 if test $HAVE_MEMCHR = 1; then
14195 # Detect platform-specific bugs in some versions of glibc:
14196 # memchr should not dereference anything with length 0
14197 # https://bugzilla.redhat.com/show_bug.cgi?id=499689
14198 # memchr should not dereference overestimated length after a match
14199 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
14200 # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
14201 # memchr should cast the second argument to 'unsigned char'.
14202 # This bug exists in Android 4.3.
14203 # Assume that memchr works on platforms that lack mprotect.
14204 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
14205$as_echo_n "checking whether memchr works... " >&6; }
14206if ${gl_cv_func_memchr_works+:} false; then :
14207 $as_echo_n "(cached) " >&6
6ec2e0f5 14208else
c0c3707f
CB
14209 if test "$cross_compiling" = yes; then :
14210 case "$host_os" in
14211 # Guess no on Android.
14212 linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
14213 # Guess yes on native Windows.
14214 mingw*) gl_cv_func_memchr_works="guessing yes" ;;
14215 # If we don't know, obey --enable-cross-guesses.
14216 *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
14217 esac
6ec2e0f5
SDJ
14218
14219else
14220 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14221/* end confdefs.h. */
14222
c0c3707f
CB
14223#include <string.h>
14224#if HAVE_SYS_MMAN_H
14225# include <fcntl.h>
14226# include <unistd.h>
14227# include <sys/types.h>
14228# include <sys/mman.h>
14229# ifndef MAP_FILE
14230# define MAP_FILE 0
14231# endif
14232#endif
6ec2e0f5
SDJ
14233
14234int
14235main ()
14236{
c0c3707f
CB
14237
14238 int result = 0;
14239 char *fence = NULL;
14240#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
14241# if HAVE_MAP_ANONYMOUS
14242 const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
14243 const int fd = -1;
14244# else /* !HAVE_MAP_ANONYMOUS */
14245 const int flags = MAP_FILE | MAP_PRIVATE;
14246 int fd = open ("/dev/zero", O_RDONLY, 0666);
14247 if (fd >= 0)
14248# endif
14249 {
14250 int pagesize = getpagesize ();
14251 char *two_pages =
14252 (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
14253 flags, fd, 0);
14254 if (two_pages != (char *)(-1)
14255 && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
14256 fence = two_pages + pagesize;
14257 }
14258#endif
14259 if (fence)
14260 {
14261 if (memchr (fence, 0, 0))
14262 result |= 1;
14263 strcpy (fence - 9, "12345678");
14264 if (memchr (fence - 9, 0, 79) != fence - 1)
14265 result |= 2;
14266 if (memchr (fence - 1, 0, 3) != fence - 1)
14267 result |= 4;
14268 }
14269 /* Test against bug on Android 4.3. */
14270 {
14271 char input[3];
14272 input[0] = 'a';
14273 input[1] = 'b';
14274 input[2] = 'c';
14275 if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
14276 result |= 8;
14277 }
14278 return result;
6ec2e0f5
SDJ
14279
14280 ;
14281 return 0;
14282}
14283_ACEOF
14284if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 14285 gl_cv_func_memchr_works=yes
6ec2e0f5 14286else
c0c3707f 14287 gl_cv_func_memchr_works=no
6ec2e0f5
SDJ
14288fi
14289rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14290 conftest.$ac_objext conftest.beam conftest.$ac_ext
14291fi
14292
14293
14294fi
c0c3707f
CB
14295{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
14296$as_echo "$gl_cv_func_memchr_works" >&6; }
14297 case "$gl_cv_func_memchr_works" in
6ec2e0f5 14298 *yes) ;;
c0c3707f 14299 *) REPLACE_MEMCHR=1 ;;
6ec2e0f5
SDJ
14300 esac
14301 fi
14302
c0c3707f
CB
14303ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default"
14304if test "x$ac_cv_have_decl_memmem" = xyes; then :
6ec2e0f5
SDJ
14305 ac_have_decl=1
14306else
14307 ac_have_decl=0
14308fi
14309
14310cat >>confdefs.h <<_ACEOF
c0c3707f 14311#define HAVE_DECL_MEMMEM $ac_have_decl
6ec2e0f5
SDJ
14312_ACEOF
14313
472fa5ee 14314
6ec2e0f5
SDJ
14315
14316
14317
c0c3707f
CB
14318 for ac_func in memmem
14319do :
14320 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
14321if test "x$ac_cv_func_memmem" = xyes; then :
14322 cat >>confdefs.h <<_ACEOF
14323#define HAVE_MEMMEM 1
14324_ACEOF
6ec2e0f5 14325
c0c3707f
CB
14326fi
14327done
6ec2e0f5 14328
c0c3707f
CB
14329 if test $ac_cv_func_memmem = yes; then
14330 HAVE_MEMMEM=1
14331 else
14332 HAVE_MEMMEM=0
14333 fi
6ec2e0f5 14334
c0c3707f
CB
14335 if test $ac_cv_have_decl_memmem = no; then
14336 HAVE_DECL_MEMMEM=0
14337 else
14338 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
14339$as_echo_n "checking whether memmem works... " >&6; }
14340if ${gl_cv_func_memmem_works_always+:} false; then :
6ec2e0f5
SDJ
14341 $as_echo_n "(cached) " >&6
14342else
c0c3707f
CB
14343 if test "$cross_compiling" = yes; then :
14344 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5 14345/* end confdefs.h. */
472fa5ee 14346
c0c3707f
CB
14347#ifdef __GNU_LIBRARY__
14348 #include <features.h>
14349 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
14350 || __GLIBC_MINOR__ > 12)) \
14351 || (__GLIBC__ > 2)) \
14352 || defined __UCLIBC__
14353 Lucky user
14354 #endif
14355#elif defined __CYGWIN__
14356 #include <cygwin/version.h>
14357 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
14358 Lucky user
14359 #endif
14360#else
14361 Lucky user
14362#endif
472fa5ee 14363
c0c3707f
CB
14364_ACEOF
14365if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14366 $EGREP "Lucky user" >/dev/null 2>&1; then :
14367 gl_cv_func_memmem_works_always="guessing yes"
14368else
14369 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
14370fi
14371rm -f conftest*
472fa5ee
SM
14372
14373
6ec2e0f5
SDJ
14374else
14375 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14376/* end confdefs.h. */
c0c3707f
CB
14377
14378#include <string.h> /* for memmem */
14379#define P "_EF_BF_BD"
14380#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
14381#define NEEDLE P P P P P
6ec2e0f5
SDJ
14382
14383int
14384main ()
14385{
c0c3707f
CB
14386
14387 int result = 0;
14388 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
14389 result |= 1;
14390 /* Check for empty needle behavior. */
14391 {
14392 const char *haystack = "AAA";
14393 if (memmem (haystack, 3, NULL, 0) != haystack)
14394 result |= 2;
14395 }
14396 return result;
14397
6ec2e0f5
SDJ
14398 ;
14399 return 0;
14400}
14401_ACEOF
c0c3707f
CB
14402if ac_fn_c_try_run "$LINENO"; then :
14403 gl_cv_func_memmem_works_always=yes
6ec2e0f5 14404else
c0c3707f 14405 gl_cv_func_memmem_works_always=no
6ec2e0f5 14406fi
c0c3707f
CB
14407rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14408 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5 14409fi
6ec2e0f5 14410
c0c3707f
CB
14411
14412fi
14413{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
14414$as_echo "$gl_cv_func_memmem_works_always" >&6; }
14415 case "$gl_cv_func_memmem_works_always" in
14416 *yes) ;;
14417 *)
14418 REPLACE_MEMMEM=1
14419 ;;
14420 esac
14421 fi
14422 :
14423
14424ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
14425if test "x$ac_cv_have_decl_memrchr" = xyes; then :
14426 ac_have_decl=1
14427else
14428 ac_have_decl=0
14429fi
14430
14431cat >>confdefs.h <<_ACEOF
14432#define HAVE_DECL_MEMRCHR $ac_have_decl
14433_ACEOF
14434
14435
14436
14437
14438
14439
14440
14441 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
14442$as_echo_n "checking for O_CLOEXEC... " >&6; }
14443if ${gl_cv_macro_O_CLOEXEC+:} false; then :
6ec2e0f5
SDJ
14444 $as_echo_n "(cached) " >&6
14445else
14446 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14447/* end confdefs.h. */
c0c3707f
CB
14448#include <fcntl.h>
14449 #ifndef O_CLOEXEC
14450 choke me;
14451 #endif
6ec2e0f5
SDJ
14452
14453int
14454main ()
14455{
c0c3707f 14456return O_CLOEXEC;
6ec2e0f5
SDJ
14457 ;
14458 return 0;
14459}
14460_ACEOF
14461if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 14462 gl_cv_macro_O_CLOEXEC=yes
6ec2e0f5 14463else
c0c3707f 14464 gl_cv_macro_O_CLOEXEC=no
6ec2e0f5
SDJ
14465fi
14466rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14467fi
c0c3707f
CB
14468{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5
14469$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; }
14470
14471
14472
14473 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
14474$as_echo_n "checking for promoted mode_t type... " >&6; }
14475if ${gl_cv_promoted_mode_t+:} false; then :
6ec2e0f5
SDJ
14476 $as_echo_n "(cached) " >&6
14477else
6ec2e0f5 14478
c0c3707f
CB
14479 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14480/* end confdefs.h. */
14481#include <sys/types.h>
6ec2e0f5
SDJ
14482int
14483main ()
14484{
c0c3707f 14485typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
6ec2e0f5
SDJ
14486 ;
14487 return 0;
14488}
14489_ACEOF
14490if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 14491 gl_cv_promoted_mode_t='int'
6ec2e0f5 14492else
c0c3707f 14493 gl_cv_promoted_mode_t='mode_t'
6ec2e0f5
SDJ
14494fi
14495rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c0c3707f 14496
6ec2e0f5 14497fi
c0c3707f
CB
14498{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
14499$as_echo "$gl_cv_promoted_mode_t" >&6; }
6ec2e0f5 14500
c0c3707f
CB
14501cat >>confdefs.h <<_ACEOF
14502#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
6ec2e0f5 14503_ACEOF
c0c3707f
CB
14504
14505
14506
14507
14508
14509 GNULIB_DPRINTF=0;
14510 GNULIB_FCLOSE=0;
14511 GNULIB_FDOPEN=0;
14512 GNULIB_FFLUSH=0;
14513 GNULIB_FGETC=0;
14514 GNULIB_FGETS=0;
14515 GNULIB_FOPEN=0;
14516 GNULIB_FPRINTF=0;
14517 GNULIB_FPRINTF_POSIX=0;
14518 GNULIB_FPURGE=0;
14519 GNULIB_FPUTC=0;
14520 GNULIB_FPUTS=0;
14521 GNULIB_FREAD=0;
14522 GNULIB_FREOPEN=0;
14523 GNULIB_FSCANF=0;
14524 GNULIB_FSEEK=0;
14525 GNULIB_FSEEKO=0;
14526 GNULIB_FTELL=0;
14527 GNULIB_FTELLO=0;
14528 GNULIB_FWRITE=0;
14529 GNULIB_GETC=0;
14530 GNULIB_GETCHAR=0;
14531 GNULIB_GETDELIM=0;
14532 GNULIB_GETLINE=0;
14533 GNULIB_OBSTACK_PRINTF=0;
14534 GNULIB_OBSTACK_PRINTF_POSIX=0;
14535 GNULIB_PCLOSE=0;
14536 GNULIB_PERROR=0;
14537 GNULIB_POPEN=0;
14538 GNULIB_PRINTF=0;
14539 GNULIB_PRINTF_POSIX=0;
14540 GNULIB_PUTC=0;
14541 GNULIB_PUTCHAR=0;
14542 GNULIB_PUTS=0;
14543 GNULIB_REMOVE=0;
14544 GNULIB_RENAME=0;
14545 GNULIB_RENAMEAT=0;
14546 GNULIB_SCANF=0;
14547 GNULIB_SNPRINTF=0;
14548 GNULIB_SPRINTF_POSIX=0;
14549 GNULIB_STDIO_H_NONBLOCKING=0;
14550 GNULIB_STDIO_H_SIGPIPE=0;
14551 GNULIB_TMPFILE=0;
14552 GNULIB_VASPRINTF=0;
14553 GNULIB_VFSCANF=0;
14554 GNULIB_VSCANF=0;
14555 GNULIB_VDPRINTF=0;
14556 GNULIB_VFPRINTF=0;
14557 GNULIB_VFPRINTF_POSIX=0;
14558 GNULIB_VPRINTF=0;
14559 GNULIB_VPRINTF_POSIX=0;
14560 GNULIB_VSNPRINTF=0;
14561 GNULIB_VSPRINTF_POSIX=0;
14562 HAVE_DECL_FPURGE=1;
14563 HAVE_DECL_FSEEKO=1;
14564 HAVE_DECL_FTELLO=1;
14565 HAVE_DECL_GETDELIM=1;
14566 HAVE_DECL_GETLINE=1;
14567 HAVE_DECL_OBSTACK_PRINTF=1;
14568 HAVE_DECL_SNPRINTF=1;
14569 HAVE_DECL_VSNPRINTF=1;
14570 HAVE_DPRINTF=1;
14571 HAVE_FSEEKO=1;
14572 HAVE_FTELLO=1;
14573 HAVE_PCLOSE=1;
14574 HAVE_POPEN=1;
14575 HAVE_RENAMEAT=1;
14576 HAVE_VASPRINTF=1;
14577 HAVE_VDPRINTF=1;
14578 REPLACE_DPRINTF=0;
14579 REPLACE_FCLOSE=0;
14580 REPLACE_FDOPEN=0;
14581 REPLACE_FFLUSH=0;
14582 REPLACE_FOPEN=0;
14583 REPLACE_FPRINTF=0;
14584 REPLACE_FPURGE=0;
14585 REPLACE_FREOPEN=0;
14586 REPLACE_FSEEK=0;
14587 REPLACE_FSEEKO=0;
14588 REPLACE_FTELL=0;
14589 REPLACE_FTELLO=0;
14590 REPLACE_GETDELIM=0;
14591 REPLACE_GETLINE=0;
14592 REPLACE_OBSTACK_PRINTF=0;
14593 REPLACE_PERROR=0;
14594 REPLACE_POPEN=0;
14595 REPLACE_PRINTF=0;
14596 REPLACE_REMOVE=0;
14597 REPLACE_RENAME=0;
14598 REPLACE_RENAMEAT=0;
14599 REPLACE_SNPRINTF=0;
14600 REPLACE_SPRINTF=0;
14601 REPLACE_STDIO_READ_FUNCS=0;
14602 REPLACE_STDIO_WRITE_FUNCS=0;
14603 REPLACE_TMPFILE=0;
14604 REPLACE_VASPRINTF=0;
14605 REPLACE_VDPRINTF=0;
14606 REPLACE_VFPRINTF=0;
14607 REPLACE_VPRINTF=0;
14608 REPLACE_VSNPRINTF=0;
14609 REPLACE_VSPRINTF=0;
14610
14611
14612
14613ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
14614if test "x$ac_cv_have_decl_setenv" = xyes; then :
14615 ac_have_decl=1
6ec2e0f5 14616else
c0c3707f 14617 ac_have_decl=0
6ec2e0f5 14618fi
c0c3707f
CB
14619
14620cat >>confdefs.h <<_ACEOF
14621#define HAVE_DECL_SETENV $ac_have_decl
14622_ACEOF
14623
14624
14625
14626
14627
14628
14629 if test $ac_cv_have_decl_setenv = no; then
14630 HAVE_DECL_SETENV=0
6ec2e0f5
SDJ
14631 fi
14632
14633
14634
14635
14636
c0c3707f
CB
14637 for ac_header in search.h
14638do :
14639 ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
14640if test "x$ac_cv_header_search_h" = xyes; then :
14641 cat >>confdefs.h <<_ACEOF
14642#define HAVE_SEARCH_H 1
14643_ACEOF
6ec2e0f5 14644
c0c3707f 14645fi
6ec2e0f5 14646
c0c3707f 14647done
6ec2e0f5 14648
c0c3707f
CB
14649 for ac_func in tsearch
14650do :
14651 ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
14652if test "x$ac_cv_func_tsearch" = xyes; then :
14653 cat >>confdefs.h <<_ACEOF
14654#define HAVE_TSEARCH 1
14655_ACEOF
6ec2e0f5 14656
c0c3707f
CB
14657fi
14658done
6ec2e0f5
SDJ
14659
14660
14661
14662
c0c3707f
CB
14663 GNULIB_PTHREAD_SIGMASK=0;
14664 GNULIB_RAISE=0;
14665 GNULIB_SIGNAL_H_SIGPIPE=0;
14666 GNULIB_SIGPROCMASK=0;
14667 GNULIB_SIGACTION=0;
14668 HAVE_POSIX_SIGNALBLOCKING=1;
14669 HAVE_PTHREAD_SIGMASK=1;
14670 HAVE_RAISE=1;
14671 HAVE_SIGSET_T=1;
14672 HAVE_SIGINFO_T=1;
14673 HAVE_SIGACTION=1;
14674 HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
6ec2e0f5 14675
c0c3707f 14676 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
6ec2e0f5 14677
c0c3707f
CB
14678 HAVE_SIGHANDLER_T=1;
14679 REPLACE_PTHREAD_SIGMASK=0;
14680 REPLACE_RAISE=0;
6ec2e0f5 14681
6ec2e0f5 14682
c0c3707f
CB
14683 ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
14684 #include <signal.h>
14685 /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
14686 #include <sys/types.h>
14687
14688"
14689if test "x$ac_cv_type_sigset_t" = xyes; then :
14690
14691cat >>confdefs.h <<_ACEOF
14692#define HAVE_SIGSET_T 1
14693_ACEOF
14694
14695gl_cv_type_sigset_t=yes
14696else
14697 gl_cv_type_sigset_t=no
14698fi
6ec2e0f5 14699
c0c3707f
CB
14700 if test $gl_cv_type_sigset_t != yes; then
14701 HAVE_SIGSET_T=0
14702 fi
6ec2e0f5 14703
c0c3707f
CB
14704{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
14705$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
14706if ${ac_cv_type_uid_t+:} false; then :
14707 $as_echo_n "(cached) " >&6
14708else
6ec2e0f5
SDJ
14709 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14710/* end confdefs.h. */
c0c3707f
CB
14711#include <sys/types.h>
14712
6ec2e0f5 14713_ACEOF
c0c3707f
CB
14714if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14715 $EGREP "uid_t" >/dev/null 2>&1; then :
14716 ac_cv_type_uid_t=yes
14717else
14718 ac_cv_type_uid_t=no
14719fi
14720rm -f conftest*
6ec2e0f5 14721
c0c3707f
CB
14722fi
14723{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
14724$as_echo "$ac_cv_type_uid_t" >&6; }
14725if test $ac_cv_type_uid_t = no; then
6ec2e0f5 14726
c0c3707f 14727$as_echo "#define uid_t int" >>confdefs.h
6ec2e0f5 14728
6ec2e0f5 14729
c0c3707f 14730$as_echo "#define gid_t int" >>confdefs.h
6ec2e0f5
SDJ
14731
14732fi
6ec2e0f5 14733
c0c3707f
CB
14734{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
14735$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
14736if ${ac_cv_header_stdbool_h+:} false; then :
14737 $as_echo_n "(cached) " >&6
14738else
14739 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14740/* end confdefs.h. */
14741
14742 #include <stdbool.h>
14743
14744 #ifdef __cplusplus
14745 typedef bool Bool;
14746 #else
14747 typedef _Bool Bool;
14748 #ifndef bool
14749 "error: bool is not defined"
14750 #endif
14751 #ifndef false
14752 "error: false is not defined"
14753 #endif
14754 #if false
14755 "error: false is not 0"
14756 #endif
14757 #ifndef true
14758 "error: true is not defined"
14759 #endif
14760 #if true != 1
14761 "error: true is not 1"
14762 #endif
14763 #endif
14764
14765 #ifndef __bool_true_false_are_defined
14766 "error: __bool_true_false_are_defined is not defined"
14767 #endif
14768
14769 struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
14770
14771 char a[true == 1 ? 1 : -1];
14772 char b[false == 0 ? 1 : -1];
14773 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
14774 char d[(bool) 0.5 == true ? 1 : -1];
14775 /* See body of main program for 'e'. */
14776 char f[(Bool) 0.0 == false ? 1 : -1];
14777 char g[true];
14778 char h[sizeof (Bool)];
14779 char i[sizeof s.t];
14780 enum { j = false, k = true, l = false * true, m = true * 256 };
14781 /* The following fails for
14782 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
14783 Bool n[m];
14784 char o[sizeof n == m * sizeof n[0] ? 1 : -1];
14785 char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
14786 /* Catch a bug in an HP-UX C compiler. See
14787 https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
14788 https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
14789 */
14790 Bool q = true;
14791 Bool *pq = &q;
14792 bool *qq = &q;
6ec2e0f5 14793
c0c3707f
CB
14794int
14795main ()
14796{
6ec2e0f5 14797
c0c3707f
CB
14798 bool e = &s;
14799 *pq |= q; *pq |= ! q;
14800 *qq |= q; *qq |= ! q;
14801 /* Refer to every declared value, to avoid compiler optimizations. */
14802 return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
14803 + !m + !n + !o + !p + !q + !pq + !qq);
6ec2e0f5 14804
c0c3707f
CB
14805 ;
14806 return 0;
14807}
14808_ACEOF
14809if ac_fn_c_try_compile "$LINENO"; then :
14810 ac_cv_header_stdbool_h=yes
14811else
14812 ac_cv_header_stdbool_h=no
14813fi
14814rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14815fi
14816{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
14817$as_echo "$ac_cv_header_stdbool_h" >&6; }
14818 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
14819if test "x$ac_cv_type__Bool" = xyes; then :
6ec2e0f5 14820
c0c3707f
CB
14821cat >>confdefs.h <<_ACEOF
14822#define HAVE__BOOL 1
14823_ACEOF
6ec2e0f5
SDJ
14824
14825
c0c3707f 14826fi
6ec2e0f5
SDJ
14827
14828
472fa5ee 14829
c0c3707f
CB
14830 REPLACE_NULL=0;
14831 HAVE_MAX_ALIGN_T=1;
14832 HAVE_WCHAR_T=1;
472fa5ee
SM
14833
14834
c0c3707f
CB
14835 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
14836$as_echo_n "checking for wchar_t... " >&6; }
14837if ${gt_cv_c_wchar_t+:} false; then :
14838 $as_echo_n "(cached) " >&6
14839else
14840 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14841/* end confdefs.h. */
14842#include <stddef.h>
14843 wchar_t foo = (wchar_t)'\0';
14844int
14845main ()
14846{
472fa5ee 14847
c0c3707f
CB
14848 ;
14849 return 0;
14850}
14851_ACEOF
14852if ac_fn_c_try_compile "$LINENO"; then :
14853 gt_cv_c_wchar_t=yes
14854else
14855 gt_cv_c_wchar_t=no
14856fi
14857rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14858fi
14859{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
14860$as_echo "$gt_cv_c_wchar_t" >&6; }
14861 if test $gt_cv_c_wchar_t = yes; then
f8e27d88 14862
c0c3707f 14863$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
f8e27d88 14864
c0c3707f 14865 fi
f8e27d88
CB
14866
14867
14868
c0c3707f
CB
14869ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
14870if test "x$ac_cv_have_decl_strdup" = xyes; then :
6ec2e0f5
SDJ
14871 ac_have_decl=1
14872else
14873 ac_have_decl=0
14874fi
14875
14876cat >>confdefs.h <<_ACEOF
c0c3707f 14877#define HAVE_DECL_STRDUP $ac_have_decl
6ec2e0f5
SDJ
14878_ACEOF
14879
14880
c0c3707f
CB
14881 REPLACE_STRERROR_0=0
14882 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
14883$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
14884if ${gl_cv_func_strerror_0_works+:} false; then :
6ec2e0f5
SDJ
14885 $as_echo_n "(cached) " >&6
14886else
c0c3707f
CB
14887 if test "$cross_compiling" = yes; then :
14888 case "$host_os" in
14889 # Guess yes on glibc systems.
14890 *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
14891 # Guess yes on musl systems.
14892 *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
14893 # Guess yes on native Windows.
14894 mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
14895 # If we don't know, obey --enable-cross-guesses.
14896 *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
14897 esac
6ec2e0f5 14898
5e8754f9
SDJ
14899else
14900 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14901/* end confdefs.h. */
c0c3707f
CB
14902#include <string.h>
14903 #include <errno.h>
6ec2e0f5 14904
5e8754f9
SDJ
14905int
14906main ()
14907{
c0c3707f
CB
14908int result = 0;
14909 char *str;
14910 errno = 0;
14911 str = strerror (0);
14912 if (!*str) result |= 1;
14913 if (errno) result |= 2;
14914 if (strstr (str, "nknown") || strstr (str, "ndefined"))
14915 result |= 4;
14916 return result;
5e8754f9
SDJ
14917 ;
14918 return 0;
14919}
14920_ACEOF
c0c3707f
CB
14921if ac_fn_c_try_run "$LINENO"; then :
14922 gl_cv_func_strerror_0_works=yes
5e8754f9 14923else
c0c3707f 14924 gl_cv_func_strerror_0_works=no
5e8754f9 14925fi
c0c3707f
CB
14926rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14927 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 14928fi
6ec2e0f5 14929
6ec2e0f5 14930
c0c3707f
CB
14931fi
14932{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
14933$as_echo "$gl_cv_func_strerror_0_works" >&6; }
14934 case "$gl_cv_func_strerror_0_works" in
14935 *yes) ;;
14936 *)
14937 REPLACE_STRERROR_0=1
6ec2e0f5 14938
c0c3707f 14939$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
6ec2e0f5 14940
c0c3707f
CB
14941 ;;
14942 esac
6ec2e0f5
SDJ
14943
14944
14945
14946
472fa5ee
SM
14947
14948
14949
725e2999 14950
725e2999
JB
14951
14952
c0c3707f
CB
14953 if test $ac_cv_func_strerror_r = yes; then
14954 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
14955 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
14956$as_echo_n "checking for strerror_r with POSIX signature... " >&6; }
14957if ${gl_cv_func_strerror_r_posix_signature+:} false; then :
14958 $as_echo_n "(cached) " >&6
14959else
14960 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14961/* end confdefs.h. */
14962#include <string.h>
14963 int strerror_r (int, char *, size_t);
725e2999 14964
c0c3707f
CB
14965int
14966main ()
14967{
725e2999 14968
c0c3707f
CB
14969 ;
14970 return 0;
14971}
14972_ACEOF
14973if ac_fn_c_try_compile "$LINENO"; then :
14974 gl_cv_func_strerror_r_posix_signature=yes
14975else
14976 gl_cv_func_strerror_r_posix_signature=no
14977fi
14978rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
725e2999 14979
c0c3707f
CB
14980fi
14981{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
14982$as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; }
14983 if test $gl_cv_func_strerror_r_posix_signature = yes; then
14984 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
14985$as_echo_n "checking whether strerror_r works... " >&6; }
14986if ${gl_cv_func_strerror_r_works+:} false; then :
14987 $as_echo_n "(cached) " >&6
14988else
14989 if test "$cross_compiling" = yes; then :
725e2999 14990
c0c3707f
CB
14991 case "$host_os" in
14992 # Guess no on AIX.
14993 aix*) gl_cv_func_strerror_r_works="guessing no";;
14994 # Guess no on HP-UX.
14995 hpux*) gl_cv_func_strerror_r_works="guessing no";;
14996 # Guess no on BSD variants.
14997 *bsd*) gl_cv_func_strerror_r_works="guessing no";;
14998 # Guess yes otherwise.
14999 *) gl_cv_func_strerror_r_works="guessing yes";;
15000 esac
725e2999 15001
c0c3707f
CB
15002else
15003 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15004/* end confdefs.h. */
15005#include <errno.h>
15006 #include <string.h>
725e2999 15007
c0c3707f
CB
15008int
15009main ()
15010{
15011int result = 0;
15012 char buf[79];
15013 if (strerror_r (EACCES, buf, 0) < 0)
15014 result |= 1;
15015 errno = 0;
15016 if (strerror_r (EACCES, buf, sizeof buf) != 0)
15017 result |= 2;
15018 strcpy (buf, "Unknown");
15019 if (strerror_r (0, buf, sizeof buf) != 0)
15020 result |= 4;
15021 if (errno)
15022 result |= 8;
15023 if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
15024 result |= 0x10;
15025 errno = 0;
15026 *buf = 0;
15027 if (strerror_r (-3, buf, sizeof buf) < 0)
15028 result |= 0x20;
15029 if (errno)
15030 result |= 0x40;
15031 if (!*buf)
15032 result |= 0x80;
15033 return result;
725e2999 15034
c0c3707f
CB
15035 ;
15036 return 0;
15037}
15038_ACEOF
15039if ac_fn_c_try_run "$LINENO"; then :
15040 gl_cv_func_strerror_r_works=yes
15041else
15042 gl_cv_func_strerror_r_works=no
15043fi
15044rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15045 conftest.$ac_objext conftest.beam conftest.$ac_ext
15046fi
725e2999
JB
15047
15048
c0c3707f
CB
15049fi
15050{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
15051$as_echo "$gl_cv_func_strerror_r_works" >&6; }
15052 else
725e2999 15053
c0c3707f
CB
15054 if test $ac_cv_func___xpg_strerror_r = yes; then
15055 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
15056$as_echo_n "checking whether __xpg_strerror_r works... " >&6; }
15057if ${gl_cv_func_strerror_r_works+:} false; then :
725e2999
JB
15058 $as_echo_n "(cached) " >&6
15059else
c0c3707f
CB
15060 if test "$cross_compiling" = yes; then :
15061 gl_cv_func_strerror_r_works="$gl_cross_guess_normal"
725e2999 15062
c0c3707f
CB
15063else
15064 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
725e2999 15065/* end confdefs.h. */
c0c3707f
CB
15066#include <errno.h>
15067 #include <string.h>
15068 extern
15069 #ifdef __cplusplus
15070 "C"
15071 #endif
15072 int __xpg_strerror_r(int, char *, size_t);
725e2999 15073
c0c3707f
CB
15074int
15075main ()
15076{
15077int result = 0;
15078 char buf[256] = "^";
15079 char copy[256];
15080 char *str = strerror (-1);
15081 strcpy (copy, str);
15082 if (__xpg_strerror_r (-2, buf, 1) == 0)
15083 result |= 1;
15084 if (*buf)
15085 result |= 2;
15086 __xpg_strerror_r (-2, buf, 256);
15087 if (strcmp (str, copy))
15088 result |= 4;
15089 return result;
725e2999 15090
c0c3707f
CB
15091 ;
15092 return 0;
15093}
725e2999 15094_ACEOF
c0c3707f
CB
15095if ac_fn_c_try_run "$LINENO"; then :
15096 gl_cv_func_strerror_r_works=yes
725e2999 15097else
c0c3707f 15098 gl_cv_func_strerror_r_works=no
725e2999 15099fi
c0c3707f
CB
15100rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15101 conftest.$ac_objext conftest.beam conftest.$ac_ext
725e2999 15102fi
725e2999 15103
725e2999 15104
c0c3707f
CB
15105fi
15106{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
15107$as_echo "$gl_cv_func_strerror_r_works" >&6; }
15108 fi
15109 fi
725e2999 15110 fi
725e2999
JB
15111 fi
15112
c0c3707f
CB
15113ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
15114if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
15115 ac_have_decl=1
725e2999 15116else
c0c3707f 15117 ac_have_decl=0
725e2999
JB
15118fi
15119
c0c3707f
CB
15120cat >>confdefs.h <<_ACEOF
15121#define HAVE_DECL_STRERROR_R $ac_have_decl
15122_ACEOF
725e2999
JB
15123
15124
15125
15126
15127
725e2999
JB
15128
15129
15130
725e2999
JB
15131
15132
15133
15134
15135
15136
15137
15138
15139 if test $gl_cv_have_include_next = yes; then
c0c3707f 15140 gl_cv_next_string_h='<'string.h'>'
725e2999 15141 else
c0c3707f
CB
15142 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
15143$as_echo_n "checking absolute name of <string.h>... " >&6; }
15144if ${gl_cv_next_string_h+:} false; then :
725e2999
JB
15145 $as_echo_n "(cached) " >&6
15146else
15147
725e2999
JB
15148
15149
15150 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15151/* end confdefs.h. */
c0c3707f 15152#include <string.h>
725e2999
JB
15153_ACEOF
15154 case "$host_os" in
15155 aix*) gl_absname_cpp="$ac_cpp -C" ;;
15156 *) gl_absname_cpp="$ac_cpp" ;;
15157 esac
15158
15159 case "$host_os" in
15160 mingw*)
15161 gl_dirsep_regex='[/\\]'
15162 ;;
15163 *)
15164 gl_dirsep_regex='\/'
15165 ;;
15166 esac
15167 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 15168 gl_header_literal_regex=`echo 'string.h' \
725e2999
JB
15169 | sed -e "$gl_make_literal_regex_sed"`
15170 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
15171 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
15172 s|^/[^/]|//&|
15173 p
15174 q
15175 }'
6ec2e0f5 15176
c0c3707f 15177 gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
725e2999 15178 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 15179
c0c3707f
CB
15180 gl_header=$gl_cv_absolute_string_h
15181 gl_cv_next_string_h='"'$gl_header'"'
6ec2e0f5
SDJ
15182
15183
725e2999 15184fi
c0c3707f
CB
15185{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
15186$as_echo "$gl_cv_next_string_h" >&6; }
725e2999 15187 fi
c0c3707f 15188 NEXT_STRING_H=$gl_cv_next_string_h
6ec2e0f5 15189
725e2999
JB
15190 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
15191 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
c0c3707f 15192 gl_next_as_first_directive='<'string.h'>'
725e2999
JB
15193 else
15194 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
c0c3707f 15195 gl_next_as_first_directive=$gl_cv_next_string_h
725e2999 15196 fi
c0c3707f
CB
15197 NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
15198
15199
15200
6ec2e0f5
SDJ
15201
15202
15203
15204
15205
6ec2e0f5
SDJ
15206
15207
6ec2e0f5 15208
c0c3707f
CB
15209
15210 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
15211 REPLACE_STRSTR=1
15212 else
15213 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
15214$as_echo_n "checking whether strstr works... " >&6; }
15215if ${gl_cv_func_strstr_works_always+:} false; then :
6ec2e0f5
SDJ
15216 $as_echo_n "(cached) " >&6
15217else
c0c3707f
CB
15218 if test "$cross_compiling" = yes; then :
15219 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
15220/* end confdefs.h. */
15221
c0c3707f
CB
15222#ifdef __GNU_LIBRARY__
15223 #include <features.h>
15224 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
15225 || defined __UCLIBC__
15226 Lucky user
15227 #endif
15228#elif defined __CYGWIN__
15229 #include <cygwin/version.h>
15230 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
15231 Lucky user
15232 #endif
15233#else
15234 Lucky user
6ec2e0f5 15235#endif
c0c3707f
CB
15236
15237_ACEOF
15238if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15239 $EGREP "Lucky user" >/dev/null 2>&1; then :
15240 gl_cv_func_strstr_works_always="guessing yes"
15241else
15242 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
15243fi
15244rm -f conftest*
15245
15246
15247else
15248 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15249/* end confdefs.h. */
15250
15251#include <string.h> /* for strstr */
15252#ifdef __GNU_LIBRARY__
15253 #include <features.h>
15254 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
15255 Unlucky user
15256 #endif
725e2999 15257#endif
c0c3707f
CB
15258#define P "_EF_BF_BD"
15259#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
15260#define NEEDLE P P P P P
6ec2e0f5 15261
725e2999
JB
15262int
15263main ()
15264{
c0c3707f
CB
15265return !!strstr (HAYSTACK, NEEDLE);
15266
725e2999
JB
15267 ;
15268 return 0;
15269}
6ec2e0f5 15270_ACEOF
c0c3707f
CB
15271if ac_fn_c_try_run "$LINENO"; then :
15272 gl_cv_func_strstr_works_always=yes
6ec2e0f5 15273else
c0c3707f 15274 gl_cv_func_strstr_works_always=no
6ec2e0f5 15275fi
c0c3707f
CB
15276rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15277 conftest.$ac_objext conftest.beam conftest.$ac_ext
6ec2e0f5 15278fi
6ec2e0f5
SDJ
15279
15280
c0c3707f
CB
15281fi
15282{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
15283$as_echo "$gl_cv_func_strstr_works_always" >&6; }
15284 case "$gl_cv_func_strstr_works_always" in
15285 *yes) ;;
15286 *)
15287 REPLACE_STRSTR=1
15288 ;;
15289 esac
15290 fi
6ec2e0f5 15291
c0c3707f
CB
15292ac_fn_c_check_decl "$LINENO" "strtok_r" "ac_cv_have_decl_strtok_r" "$ac_includes_default"
15293if test "x$ac_cv_have_decl_strtok_r" = xyes; then :
15294 ac_have_decl=1
15295else
15296 ac_have_decl=0
15297fi
6ec2e0f5 15298
c0c3707f
CB
15299cat >>confdefs.h <<_ACEOF
15300#define HAVE_DECL_STRTOK_R $ac_have_decl
15301_ACEOF
6ec2e0f5
SDJ
15302
15303
15304
15305
6ec2e0f5
SDJ
15306
15307
15308
15309
15310
15311
15312
c0c3707f 15313$as_echo "#define _USE_STD_STAT 1" >>confdefs.h
6ec2e0f5 15314
6ec2e0f5
SDJ
15315
15316
15317
15318
15319
6ec2e0f5
SDJ
15320
15321
15322
15323
15324
c0c3707f
CB
15325 if test $gl_cv_have_include_next = yes; then
15326 gl_cv_next_sys_types_h='<'sys/types.h'>'
15327 else
15328 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
15329$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
15330if ${gl_cv_next_sys_types_h+:} false; then :
6ec2e0f5
SDJ
15331 $as_echo_n "(cached) " >&6
15332else
6ec2e0f5 15333
6ec2e0f5 15334
c0c3707f
CB
15335
15336 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15337/* end confdefs.h. */
15338#include <sys/types.h>
6ec2e0f5 15339_ACEOF
c0c3707f
CB
15340 case "$host_os" in
15341 aix*) gl_absname_cpp="$ac_cpp -C" ;;
15342 *) gl_absname_cpp="$ac_cpp" ;;
15343 esac
6ec2e0f5 15344
c0c3707f
CB
15345 case "$host_os" in
15346 mingw*)
15347 gl_dirsep_regex='[/\\]'
15348 ;;
15349 *)
15350 gl_dirsep_regex='\/'
15351 ;;
15352 esac
15353 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
15354 gl_header_literal_regex=`echo 'sys/types.h' \
15355 | sed -e "$gl_make_literal_regex_sed"`
15356 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
15357 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
15358 s|^/[^/]|//&|
15359 p
15360 q
15361 }'
6ec2e0f5 15362
c0c3707f
CB
15363 gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
15364 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 15365
c0c3707f
CB
15366 gl_header=$gl_cv_absolute_sys_types_h
15367 gl_cv_next_sys_types_h='"'$gl_header'"'
6ec2e0f5
SDJ
15368
15369
c0c3707f
CB
15370fi
15371{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
15372$as_echo "$gl_cv_next_sys_types_h" >&6; }
15373 fi
15374 NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
6ec2e0f5 15375
c0c3707f
CB
15376 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
15377 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
15378 gl_next_as_first_directive='<'sys/types.h'>'
15379 else
15380 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
15381 gl_next_as_first_directive=$gl_cv_next_sys_types_h
15382 fi
15383 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
15384
15385
15386
15387
6ec2e0f5 15388
6ec2e0f5
SDJ
15389
15390
6ec2e0f5
SDJ
15391
15392
15393
15394
15395
c0c3707f 15396 WINDOWS_STAT_INODES=0
6ec2e0f5
SDJ
15397
15398
15399
15400
15401
472fa5ee
SM
15402
15403
15404
15405
c0c3707f
CB
15406 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
15407$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
15408if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
15409 $as_echo_n "(cached) " >&6
15410else
15411 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15412/* end confdefs.h. */
15413#include <time.h>
472fa5ee 15414
c0c3707f
CB
15415int
15416main ()
15417{
15418static struct timespec x; x.tv_sec = x.tv_nsec;
15419 ;
15420 return 0;
15421}
6ec2e0f5 15422_ACEOF
c0c3707f
CB
15423if ac_fn_c_try_compile "$LINENO"; then :
15424 gl_cv_sys_struct_timespec_in_time_h=yes
15425else
15426 gl_cv_sys_struct_timespec_in_time_h=no
6ec2e0f5 15427fi
c0c3707f
CB
15428rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15429fi
15430{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
15431$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
6ec2e0f5 15432
c0c3707f
CB
15433 TIME_H_DEFINES_STRUCT_TIMESPEC=0
15434 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
15435 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
15436 UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
15437 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
15438 TIME_H_DEFINES_STRUCT_TIMESPEC=1
6ec2e0f5 15439 else
c0c3707f
CB
15440 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
15441$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
15442if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
15443 $as_echo_n "(cached) " >&6
15444else
15445 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15446/* end confdefs.h. */
15447#include <sys/time.h>
472fa5ee 15448
c0c3707f
CB
15449int
15450main ()
15451{
15452static struct timespec x; x.tv_sec = x.tv_nsec;
15453 ;
15454 return 0;
15455}
15456_ACEOF
15457if ac_fn_c_try_compile "$LINENO"; then :
15458 gl_cv_sys_struct_timespec_in_sys_time_h=yes
15459else
15460 gl_cv_sys_struct_timespec_in_sys_time_h=no
15461fi
15462rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15463fi
15464{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
15465$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
15466 if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
15467 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
15468 else
15469 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
15470$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
15471if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
15472 $as_echo_n "(cached) " >&6
15473else
15474 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15475/* end confdefs.h. */
15476#include <pthread.h>
472fa5ee 15477
c0c3707f
CB
15478int
15479main ()
15480{
15481static struct timespec x; x.tv_sec = x.tv_nsec;
15482 ;
15483 return 0;
15484}
15485_ACEOF
15486if ac_fn_c_try_compile "$LINENO"; then :
15487 gl_cv_sys_struct_timespec_in_pthread_h=yes
15488else
15489 gl_cv_sys_struct_timespec_in_pthread_h=no
15490fi
15491rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15492fi
15493{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
15494$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
15495 if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
15496 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
15497 else
15498 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
15499$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; }
15500if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then :
15501 $as_echo_n "(cached) " >&6
15502else
15503 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15504/* end confdefs.h. */
15505#include <unistd.h>
6ec2e0f5 15506
c0c3707f
CB
15507int
15508main ()
15509{
15510static struct timespec x; x.tv_sec = x.tv_nsec;
15511 ;
15512 return 0;
15513}
15514_ACEOF
15515if ac_fn_c_try_compile "$LINENO"; then :
15516 gl_cv_sys_struct_timespec_in_unistd_h=yes
15517else
15518 gl_cv_sys_struct_timespec_in_unistd_h=no
15519fi
15520rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15521fi
15522{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
15523$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
15524 if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
15525 UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
15526 fi
6ec2e0f5
SDJ
15527 fi
15528 fi
c0c3707f 15529 fi
6ec2e0f5
SDJ
15530
15531
15532
15533
15534
15535
6ec2e0f5 15536
6ec2e0f5
SDJ
15537
15538
15539
15540
15541
6ec2e0f5
SDJ
15542
15543
15544
15545
c0c3707f
CB
15546 if test $gl_cv_have_include_next = yes; then
15547 gl_cv_next_time_h='<'time.h'>'
15548 else
15549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
15550$as_echo_n "checking absolute name of <time.h>... " >&6; }
15551if ${gl_cv_next_time_h+:} false; then :
15552 $as_echo_n "(cached) " >&6
15553else
6ec2e0f5 15554
6ec2e0f5
SDJ
15555
15556
c0c3707f
CB
15557 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15558/* end confdefs.h. */
15559#include <time.h>
15560_ACEOF
15561 case "$host_os" in
15562 aix*) gl_absname_cpp="$ac_cpp -C" ;;
15563 *) gl_absname_cpp="$ac_cpp" ;;
15564 esac
6ec2e0f5 15565
c0c3707f
CB
15566 case "$host_os" in
15567 mingw*)
15568 gl_dirsep_regex='[/\\]'
15569 ;;
15570 *)
15571 gl_dirsep_regex='\/'
15572 ;;
15573 esac
15574 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
15575 gl_header_literal_regex=`echo 'time.h' \
15576 | sed -e "$gl_make_literal_regex_sed"`
15577 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
15578 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
15579 s|^/[^/]|//&|
15580 p
15581 q
15582 }'
6ec2e0f5 15583
c0c3707f
CB
15584 gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
15585 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 15586
c0c3707f
CB
15587 gl_header=$gl_cv_absolute_time_h
15588 gl_cv_next_time_h='"'$gl_header'"'
6ec2e0f5 15589
6ec2e0f5
SDJ
15590
15591fi
c0c3707f
CB
15592{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
15593$as_echo "$gl_cv_next_time_h" >&6; }
15594 fi
15595 NEXT_TIME_H=$gl_cv_next_time_h
6ec2e0f5 15596
c0c3707f
CB
15597 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
15598 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
15599 gl_next_as_first_directive='<'time.h'>'
15600 else
15601 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
15602 gl_next_as_first_directive=$gl_cv_next_time_h
15603 fi
15604 NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
6ec2e0f5 15605
472fa5ee
SM
15606
15607
15608
15609
15610
6ec2e0f5 15611
6ec2e0f5 15612
6ec2e0f5 15613
6ec2e0f5 15614
c0c3707f
CB
15615ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
15616if test "x$ac_cv_have_decl_unsetenv" = xyes; then :
15617 ac_have_decl=1
15618else
15619 ac_have_decl=0
15620fi
6ec2e0f5 15621
c0c3707f
CB
15622cat >>confdefs.h <<_ACEOF
15623#define HAVE_DECL_UNSETENV $ac_have_decl
15624_ACEOF
6ec2e0f5
SDJ
15625
15626
c0c3707f
CB
15627 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
15628$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
15629if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
15630 $as_echo_n "(cached) " >&6
15631else
15632 gl_cv_header_wchar_h_correct_inline=yes
15633 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15634/* end confdefs.h. */
6ec2e0f5 15635
c0c3707f
CB
15636 #define wcstod renamed_wcstod
15637/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
15638 <wchar.h>.
15639 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
15640 included before <wchar.h>. */
15641#include <stddef.h>
15642#include <stdio.h>
15643#include <time.h>
15644#include <wchar.h>
15645extern int zero (void);
15646int main () { return zero(); }
6ec2e0f5 15647
c0c3707f
CB
15648_ACEOF
15649 save_ac_compile="$ac_compile"
15650 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
15651 if echo '#include "conftest.c"' >conftest1.c &&
15652 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
15653 (eval $ac_compile) 2>&5
15654 ac_status=$?
15655 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15656 test $ac_status = 0; }; then
15657 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15658/* end confdefs.h. */
6ec2e0f5 15659
c0c3707f
CB
15660 #define wcstod renamed_wcstod
15661/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
15662 <wchar.h>.
15663 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
15664 included before <wchar.h>. */
15665#include <stddef.h>
15666#include <stdio.h>
15667#include <time.h>
15668#include <wchar.h>
15669int zero (void) { return 0; }
6ec2e0f5 15670
c0c3707f
CB
15671_ACEOF
15672 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
15673 if echo '#include "conftest.c"' >conftest2.c &&
15674 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
15675 (eval $ac_compile) 2>&5
15676 ac_status=$?
15677 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15678 test $ac_status = 0; }; then
15679 if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
15680 :
15681 else
15682 gl_cv_header_wchar_h_correct_inline=no
15683 fi
15684 fi
15685 fi
15686 ac_compile="$save_ac_compile"
15687 rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext
6ec2e0f5 15688
c0c3707f
CB
15689fi
15690{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
15691$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
15692 if test $gl_cv_header_wchar_h_correct_inline = no; then
15693 as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
15694This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
15695C99 mode. You have four options:
15696 - Add the flag -fgnu89-inline to CC and reconfigure, or
15697 - Fix your include files, using parts of
15698 <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
15699 - Use a gcc version older than 4.3, or
15700 - Don't use the flags -std=c99 or -std=gnu99.
15701Configuration aborted." "$LINENO" 5
6ec2e0f5
SDJ
15702 fi
15703
15704
15705
15706
15707
c0c3707f
CB
15708 if test $ac_cv_header_crtdefs_h = yes; then
15709 HAVE_CRTDEFS_H=1
15710 else
15711 HAVE_CRTDEFS_H=0
5e8754f9 15712 fi
5e8754f9 15713
5e8754f9 15714
5e8754f9 15715
c0c3707f
CB
15716 GNULIB_ISWBLANK=0;
15717 GNULIB_WCTYPE=0;
15718 GNULIB_ISWCTYPE=0;
15719 GNULIB_WCTRANS=0;
15720 GNULIB_TOWCTRANS=0;
15721 HAVE_ISWBLANK=1;
15722 HAVE_WCTYPE_T=1;
15723 HAVE_WCTRANS_T=1;
15724 REPLACE_ISWBLANK=0;
5e8754f9 15725
5e8754f9 15726
5e8754f9 15727
5e8754f9 15728
c0c3707f
CB
15729 if false; then
15730 GL_COND_LIBTOOL_TRUE=
15731 GL_COND_LIBTOOL_FALSE='#'
15732else
15733 GL_COND_LIBTOOL_TRUE='#'
15734 GL_COND_LIBTOOL_FALSE=
15735fi
5e8754f9 15736
c0c3707f
CB
15737 gl_cond_libtool=false
15738 gl_libdeps=
15739 gl_ltlibdeps=
15740 gl_m4_base='import/m4'
5e8754f9 15741
5e8754f9
SDJ
15742
15743
6ec2e0f5 15744
6ec2e0f5 15745
6ec2e0f5 15746
6ec2e0f5 15747
6ec2e0f5 15748
6ec2e0f5 15749
c0c3707f
CB
15750 gl_source_base='import'
15751
6ec2e0f5 15752
c0c3707f
CB
15753 if test $ac_cv_func_alloca_works = no; then
15754 :
15755 fi
6ec2e0f5 15756
c0c3707f
CB
15757 # Define an additional variable used in the Makefile substitution.
15758 if test $ac_cv_working_alloca_h = yes; then
15759 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
15760$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
15761if ${gl_cv_rpl_alloca+:} false; then :
6ec2e0f5
SDJ
15762 $as_echo_n "(cached) " >&6
15763else
c0c3707f
CB
15764
15765 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6ec2e0f5
SDJ
15766/* end confdefs.h. */
15767
c0c3707f
CB
15768#if defined __GNUC__ || defined _AIX || defined _MSC_VER
15769 Need own alloca
15770#endif
6ec2e0f5 15771
6ec2e0f5 15772_ACEOF
c0c3707f
CB
15773if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15774 $EGREP "Need own alloca" >/dev/null 2>&1; then :
15775 gl_cv_rpl_alloca=yes
6ec2e0f5 15776else
c0c3707f 15777 gl_cv_rpl_alloca=no
6ec2e0f5 15778fi
c0c3707f 15779rm -f conftest*
6ec2e0f5
SDJ
15780
15781
15782fi
c0c3707f
CB
15783{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
15784$as_echo "$gl_cv_rpl_alloca" >&6; }
15785 if test $gl_cv_rpl_alloca = yes; then
6ec2e0f5 15786
c0c3707f 15787$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
6ec2e0f5 15788
c0c3707f
CB
15789 ALLOCA_H=alloca.h
15790 else
15791 ALLOCA_H=
15792 fi
15793 else
15794 ALLOCA_H=alloca.h
15795 fi
6ec2e0f5 15796
c0c3707f
CB
15797 if test -n "$ALLOCA_H"; then
15798 GL_GENERATE_ALLOCA_H_TRUE=
15799 GL_GENERATE_ALLOCA_H_FALSE='#'
15800else
15801 GL_GENERATE_ALLOCA_H_TRUE='#'
15802 GL_GENERATE_ALLOCA_H_FALSE=
15803fi
6ec2e0f5
SDJ
15804
15805
c0c3707f
CB
15806 if test $ac_cv_working_alloca_h = yes; then
15807 HAVE_ALLOCA_H=1
15808 else
15809 HAVE_ALLOCA_H=0
15810 fi
6ec2e0f5
SDJ
15811
15812
15813
15814
15815
15816
c0c3707f
CB
15817 if test $ac_cv_header_arpa_inet_h = yes; then
15818 HAVE_ARPA_INET_H=1
15819 else
15820 HAVE_ARPA_INET_H=0
15821 fi
6ec2e0f5
SDJ
15822
15823
472fa5ee
SM
15824
15825
15826
15827
15828
6ec2e0f5
SDJ
15829
15830
15831
15832 if test $gl_cv_have_include_next = yes; then
c0c3707f 15833 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5 15834 else
c0c3707f
CB
15835 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
15836$as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; }
15837if ${gl_cv_next_arpa_inet_h+:} false; then :
6ec2e0f5
SDJ
15838 $as_echo_n "(cached) " >&6
15839else
15840
c0c3707f 15841 if test $ac_cv_header_arpa_inet_h = yes; then
6ec2e0f5
SDJ
15842
15843
15844
15845
15846 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15847/* end confdefs.h. */
c0c3707f 15848#include <arpa/inet.h>
6ec2e0f5
SDJ
15849_ACEOF
15850 case "$host_os" in
15851 aix*) gl_absname_cpp="$ac_cpp -C" ;;
15852 *) gl_absname_cpp="$ac_cpp" ;;
15853 esac
15854
15855 case "$host_os" in
15856 mingw*)
15857 gl_dirsep_regex='[/\\]'
15858 ;;
15859 *)
15860 gl_dirsep_regex='\/'
15861 ;;
15862 esac
15863 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
c0c3707f 15864 gl_header_literal_regex=`echo 'arpa/inet.h' \
6ec2e0f5
SDJ
15865 | sed -e "$gl_make_literal_regex_sed"`
15866 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
15867 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
15868 s|^/[^/]|//&|
15869 p
15870 q
15871 }'
15872
c0c3707f 15873 gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
6ec2e0f5
SDJ
15874 sed -n "$gl_absolute_header_sed"`
15875
c0c3707f
CB
15876 gl_header=$gl_cv_absolute_arpa_inet_h
15877 gl_cv_next_arpa_inet_h='"'$gl_header'"'
6ec2e0f5 15878 else
c0c3707f 15879 gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
6ec2e0f5
SDJ
15880 fi
15881
c0c3707f 15882
6ec2e0f5 15883fi
c0c3707f
CB
15884{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
15885$as_echo "$gl_cv_next_arpa_inet_h" >&6; }
15886 fi
15887 NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
6ec2e0f5 15888
c0c3707f
CB
15889 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
15890 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
15891 gl_next_as_first_directive='<'arpa/inet.h'>'
15892 else
15893 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
15894 gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
15895 fi
15896 NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
6ec2e0f5
SDJ
15897
15898
6ec2e0f5 15899
6ec2e0f5 15900
6ec2e0f5
SDJ
15901
15902
6ec2e0f5
SDJ
15903
15904
15905
c0c3707f
CB
15906 if test $ac_cv_header_sys_socket_h = yes; then
15907 HAVE_WS2TCPIP_H=0
15908 else
15909 if test $ac_cv_header_ws2tcpip_h = yes; then
15910 HAVE_WS2TCPIP_H=1
15911 else
15912 HAVE_WS2TCPIP_H=0
15913 fi
15914 fi
15915
15916
6ec2e0f5
SDJ
15917
15918
6ec2e0f5
SDJ
15919
15920
15921
15922
15923
6ec2e0f5
SDJ
15924
15925
15926
15927
15928
15929
15930
c0c3707f 15931 gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext"
6ec2e0f5
SDJ
15932
15933
c0c3707f
CB
15934 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
15935$as_echo_n "checking for __builtin_expect... " >&6; }
15936if ${gl_cv___builtin_expect+:} false; then :
6ec2e0f5
SDJ
15937 $as_echo_n "(cached) " >&6
15938else
c0c3707f
CB
15939 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15940/* end confdefs.h. */
15941
15942 int
15943 main (int argc, char **argv)
15944 {
15945 argc = __builtin_expect (argc, 100);
15946 return argv[argc != 100][0];
15947 }
15948_ACEOF
15949if ac_fn_c_try_link "$LINENO"; then :
15950 gl_cv___builtin_expect=yes
15951else
15952 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15953/* end confdefs.h. */
15954
15955 #include <builtins.h>
15956 int
15957 main (int argc, char **argv)
15958 {
15959 argc = __builtin_expect (argc, 100);
15960 return argv[argc != 100][0];
15961 }
15962_ACEOF
15963if ac_fn_c_try_link "$LINENO"; then :
15964 gl_cv___builtin_expect="in <builtins.h>"
15965else
15966 gl_cv___builtin_expect=no
6ec2e0f5 15967fi
c0c3707f
CB
15968rm -f core conftest.err conftest.$ac_objext \
15969 conftest$ac_exeext conftest.$ac_ext
15970fi
15971rm -f core conftest.err conftest.$ac_objext \
15972 conftest$ac_exeext conftest.$ac_ext
15973fi
15974{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
15975$as_echo "$gl_cv___builtin_expect" >&6; }
15976 if test "$gl_cv___builtin_expect" = yes; then
15977 $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
8690e634 15978
c0c3707f
CB
15979 elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
15980 $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
8690e634 15981
6ec2e0f5 15982 fi
8690e634
JK
15983
15984
15985
15986
c0c3707f
CB
15987
15988 if test $ac_cv_func_canonicalize_file_name = no; then
15989 HAVE_CANONICALIZE_FILE_NAME=0
15990 if test $ac_cv_func_realpath = no; then
15991 HAVE_REALPATH=0
15992 else
15993 case "$gl_cv_func_realpath_works" in
15994 *yes) ;;
15995 *) REPLACE_REALPATH=1 ;;
15996 esac
15997 fi
15998 else
15999 case "$gl_cv_func_realpath_works" in
16000 *yes)
16001 ;;
16002 *)
16003 REPLACE_CANONICALIZE_FILE_NAME=1
16004 REPLACE_REALPATH=1
16005 ;;
16006 esac
5e8754f9 16007 fi
8690e634 16008
c0c3707f 16009 if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
8690e634
JK
16010
16011
16012
472fa5ee
SM
16013
16014
16015
16016
16017
c0c3707f
CB
16018 gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext"
16019
6ec2e0f5 16020 fi
8690e634
JK
16021
16022
c0c3707f
CB
16023cat >>confdefs.h <<_ACEOF
16024#define GNULIB_CANONICALIZE_LGPL 1
16025_ACEOF
8690e634 16026
8690e634 16027
8690e634 16028
8690e634 16029
8690e634 16030
8690e634 16031
8690e634 16032
c0c3707f 16033 GNULIB_CANONICALIZE_FILE_NAME=1
8690e634 16034
8690e634 16035
8690e634 16036
6ec2e0f5
SDJ
16037
16038
c0c3707f 16039$as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
6ec2e0f5 16040
6ec2e0f5 16041
8690e634
JK
16042
16043
8690e634
JK
16044
16045
16046
16047
c0c3707f 16048 GNULIB_REALPATH=1
6ec2e0f5
SDJ
16049
16050
16051
16052
6ec2e0f5 16053
c0c3707f 16054$as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
6ec2e0f5
SDJ
16055
16056
16057
16058
16059
16060
16061
6ec2e0f5 16062
c0c3707f 16063 GNULIB_CHDIR=1
6ec2e0f5 16064
8690e634 16065
8690e634 16066
6ec2e0f5 16067
6ec2e0f5 16068
c0c3707f
CB
16069$as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
16070
16071
16072
16073
16074
16075 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system has an arbitrary file name length limit" >&5
16076$as_echo_n "checking whether this system has an arbitrary file name length limit... " >&6; }
16077if ${gl_cv_have_arbitrary_file_name_length_limit+:} false; then :
16078 $as_echo_n "(cached) " >&6
8690e634 16079else
c0c3707f
CB
16080 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16081/* end confdefs.h. */
8690e634 16082
c0c3707f
CB
16083/* Arrange to define PATH_MAX, like "pathmax.h" does. */
16084#if HAVE_UNISTD_H
16085# include <unistd.h>
16086#endif
16087#include <limits.h>
16088#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
16089# include <sys/param.h>
16090#endif
16091#if !defined PATH_MAX && defined MAXPATHLEN
16092# define PATH_MAX MAXPATHLEN
16093#endif
16094#ifdef __hpux
16095# undef PATH_MAX
16096# define PATH_MAX 1024
16097#endif
16098#if defined _WIN32 && ! defined __CYGWIN__
16099# undef PATH_MAX
16100# define PATH_MAX 260
16101#endif
6ec2e0f5 16102
c0c3707f
CB
16103#ifdef PATH_MAX
16104have_arbitrary_file_name_length_limit
16105#endif
6ec2e0f5 16106_ACEOF
c0c3707f
CB
16107if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16108 $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then :
16109 gl_cv_have_arbitrary_file_name_length_limit=yes
16110else
16111 gl_cv_have_arbitrary_file_name_length_limit=no
16112fi
16113rm -f conftest*
6ec2e0f5
SDJ
16114
16115fi
c0c3707f
CB
16116{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5
16117$as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; }
6ec2e0f5 16118
c0c3707f 16119 if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then
6ec2e0f5
SDJ
16120
16121
16122
16123
472fa5ee
SM
16124
16125
16126
16127
c0c3707f 16128 gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext"
472fa5ee 16129
c0c3707f 16130 :
8690e634
JK
16131 fi
16132
8690e634 16133
c0c3707f 16134$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
8690e634
JK
16135
16136
16137
16138
16139
8690e634 16140
c0c3707f
CB
16141 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
16142 REPLACE_CLOSE=1
16143 fi
8690e634 16144
6ec2e0f5
SDJ
16145
16146
6ec2e0f5
SDJ
16147
16148
8690e634 16149
c0c3707f
CB
16150 if test $ac_cv_header_sys_socket_h != yes; then
16151 for ac_header in winsock2.h
16152do :
16153 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
16154if test "x$ac_cv_header_winsock2_h" = xyes; then :
16155 cat >>confdefs.h <<_ACEOF
16156#define HAVE_WINSOCK2_H 1
16157_ACEOF
8690e634 16158
c0c3707f 16159fi
8690e634 16160
c0c3707f 16161done
8690e634 16162
c0c3707f
CB
16163 fi
16164 if test "$ac_cv_header_winsock2_h" = yes; then
16165 HAVE_WINSOCK2_H=1
16166 UNISTD_H_HAVE_WINSOCK2_H=1
16167 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
16168 else
16169 HAVE_WINSOCK2_H=0
16170 fi
8690e634 16171
6ec2e0f5 16172
c0c3707f
CB
16173 if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
16174 REPLACE_CLOSE=1
16175 fi
6ec2e0f5
SDJ
16176
16177
c0c3707f 16178 if test $REPLACE_CLOSE = 0; then
6ec2e0f5
SDJ
16179
16180
6ec2e0f5 16181
c0c3707f
CB
16182 if test $ac_cv_func_fchdir = no; then
16183 HAVE_FCHDIR=0
16184 fi
6ec2e0f5 16185
c0c3707f
CB
16186 if test $HAVE_FCHDIR = 0; then
16187 REPLACE_CLOSE=1
16188 fi
16189 fi
6ec2e0f5
SDJ
16190
16191
c0c3707f 16192 if test $REPLACE_CLOSE = 1; then
6ec2e0f5
SDJ
16193
16194
16195
16196
16197
6ec2e0f5
SDJ
16198
16199
16200
c0c3707f 16201 gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
6ec2e0f5 16202
c0c3707f 16203 fi
6ec2e0f5 16204
6ec2e0f5
SDJ
16205
16206
16207
16208
c0c3707f 16209 GNULIB_CLOSE=1
6ec2e0f5 16210
6ec2e0f5 16211
6ec2e0f5
SDJ
16212
16213
16214
c0c3707f 16215$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
6ec2e0f5
SDJ
16216
16217
16218
16219
16220
c0c3707f
CB
16221
16222 for ac_func in closedir
16223do :
16224 ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
16225if test "x$ac_cv_func_closedir" = xyes; then :
16226 cat >>confdefs.h <<_ACEOF
16227#define HAVE_CLOSEDIR 1
16228_ACEOF
16229
16230fi
16231done
16232
16233 if test $ac_cv_func_closedir = no; then
16234 HAVE_CLOSEDIR=0
16235 fi
6ec2e0f5 16236
8690e634
JK
16237
16238
8690e634 16239
c0c3707f
CB
16240 if test $ac_cv_func_fchdir = no; then
16241 HAVE_FCHDIR=0
6ec2e0f5 16242 fi
6a29c58e 16243
c0c3707f
CB
16244 if test $HAVE_FCHDIR = 0; then
16245 if test $HAVE_CLOSEDIR = 1; then
16246 REPLACE_CLOSEDIR=1
16247 fi
16248 fi
6a29c58e 16249
c0c3707f
CB
16250 case $host_os,$HAVE_CLOSEDIR in
16251 os2*,1)
16252 REPLACE_CLOSEDIR=1;;
16253 esac
d0ac1c44 16254
c0c3707f 16255 if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
d0ac1c44
SM
16256
16257
d0ac1c44
SM
16258
16259
6a29c58e
YQ
16260
16261
3d99e817 16262
6ec2e0f5 16263
c0c3707f 16264 gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext"
6ec2e0f5 16265
6ec2e0f5
SDJ
16266 fi
16267
16268
6ec2e0f5
SDJ
16269
16270
3d99e817 16271
c0c3707f 16272 GNULIB_CLOSEDIR=1
3d99e817
AK
16273
16274
16275
16276
16277
c0c3707f 16278$as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
3d99e817
AK
16279
16280
16281
c0c3707f
CB
16282 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
16283$as_echo_n "checking for d_ino member in directory struct... " >&6; }
16284if ${gl_cv_struct_dirent_d_ino+:} false; then :
6ec2e0f5
SDJ
16285 $as_echo_n "(cached) " >&6
16286else
16287 if test "$cross_compiling" = yes; then :
16288 case "$host_os" in
c0c3707f
CB
16289 # Guess yes on glibc systems with Linux kernel.
16290 linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
16291 # Guess yes on musl systems with Linux kernel.
16292 linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
16293 # Guess no on native Windows.
16294 mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
16295 # If we don't know, obey --enable-cross-guesses.
16296 *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
16297 esac
3d99e817 16298
6ec2e0f5
SDJ
16299else
16300 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16301/* end confdefs.h. */
c0c3707f
CB
16302#include <sys/types.h>
16303 #include <sys/stat.h>
16304 #include <dirent.h>
3d99e817 16305
6ec2e0f5
SDJ
16306int
16307main ()
16308{
c0c3707f
CB
16309DIR *dp = opendir (".");
16310 struct dirent *e;
16311 struct stat st;
16312 if (! dp)
16313 return 1;
16314 e = readdir (dp);
16315 if (! e)
16316 { closedir (dp); return 2; }
16317 if (lstat (e->d_name, &st) != 0)
16318 { closedir (dp); return 3; }
16319 if (e->d_ino != st.st_ino)
16320 { closedir (dp); return 4; }
16321 closedir (dp);
16322 return 0;
16323
6ec2e0f5
SDJ
16324 ;
16325 return 0;
16326}
3d99e817 16327_ACEOF
6ec2e0f5 16328if ac_fn_c_try_run "$LINENO"; then :
c0c3707f
CB
16329 gl_cv_struct_dirent_d_ino=yes
16330else
16331 gl_cv_struct_dirent_d_ino=no
16332fi
16333rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16334 conftest.$ac_objext conftest.beam conftest.$ac_ext
16335fi
16336
16337fi
16338{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
16339$as_echo "$gl_cv_struct_dirent_d_ino" >&6; }
16340 case "$gl_cv_struct_dirent_d_ino" in
16341 *yes)
16342
16343$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
16344
16345 ;;
16346 esac
16347
16348
16349 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5
16350$as_echo_n "checking for d_type member in directory struct... " >&6; }
16351if ${gl_cv_struct_dirent_d_type+:} false; then :
16352 $as_echo_n "(cached) " >&6
16353else
16354 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16355/* end confdefs.h. */
16356
16357#include <sys/types.h>
16358#include <dirent.h>
16359
16360int
16361main ()
16362{
16363struct dirent dp; dp.d_type = 0;
16364 ;
16365 return 0;
16366}
16367_ACEOF
16368if ac_fn_c_try_link "$LINENO"; then :
16369 gl_cv_struct_dirent_d_type=yes
6ec2e0f5 16370else
c0c3707f 16371 gl_cv_struct_dirent_d_type=no
3d99e817 16372fi
c0c3707f
CB
16373rm -f core conftest.err conftest.$ac_objext \
16374 conftest$ac_exeext conftest.$ac_ext
3d99e817 16375
3d99e817 16376
c0c3707f
CB
16377fi
16378{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5
16379$as_echo "$gl_cv_struct_dirent_d_type" >&6; }
16380 if test $gl_cv_struct_dirent_d_type = yes; then
3d99e817 16381
c0c3707f 16382$as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h
3d99e817 16383
c0c3707f 16384 fi
3d99e817 16385
0750520d 16386
0750520d 16387
0750520d 16388
0750520d
PA
16389
16390
0750520d 16391
0750520d 16392
0750520d 16393
0750520d 16394
0750520d 16395
0750520d 16396
0750520d 16397
0750520d 16398
c0c3707f
CB
16399 if test $gl_cv_have_include_next = yes; then
16400 gl_cv_next_dirent_h='<'dirent.h'>'
16401 else
16402 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
16403$as_echo_n "checking absolute name of <dirent.h>... " >&6; }
16404if ${gl_cv_next_dirent_h+:} false; then :
16405 $as_echo_n "(cached) " >&6
16406else
0750520d 16407
c0c3707f 16408 if test $ac_cv_header_dirent_h = yes; then
6ec2e0f5 16409
472fa5ee
SM
16410
16411
16412
c0c3707f
CB
16413 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16414/* end confdefs.h. */
16415#include <dirent.h>
16416_ACEOF
16417 case "$host_os" in
16418 aix*) gl_absname_cpp="$ac_cpp -C" ;;
16419 *) gl_absname_cpp="$ac_cpp" ;;
16420 esac
472fa5ee 16421
c0c3707f
CB
16422 case "$host_os" in
16423 mingw*)
16424 gl_dirsep_regex='[/\\]'
16425 ;;
16426 *)
16427 gl_dirsep_regex='\/'
16428 ;;
16429 esac
16430 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
16431 gl_header_literal_regex=`echo 'dirent.h' \
16432 | sed -e "$gl_make_literal_regex_sed"`
16433 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16434 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16435 s|^/[^/]|//&|
16436 p
16437 q
16438 }'
472fa5ee 16439
c0c3707f
CB
16440 gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
16441 sed -n "$gl_absolute_header_sed"`
6ec2e0f5 16442
c0c3707f
CB
16443 gl_header=$gl_cv_absolute_dirent_h
16444 gl_cv_next_dirent_h='"'$gl_header'"'
16445 else
16446 gl_cv_next_dirent_h='<'dirent.h'>'
16447 fi
6ec2e0f5
SDJ
16448
16449
c0c3707f
CB
16450fi
16451{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
16452$as_echo "$gl_cv_next_dirent_h" >&6; }
16453 fi
16454 NEXT_DIRENT_H=$gl_cv_next_dirent_h
472fa5ee 16455
c0c3707f
CB
16456 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16457 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
16458 gl_next_as_first_directive='<'dirent.h'>'
16459 else
16460 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
16461 gl_next_as_first_directive=$gl_cv_next_dirent_h
16462 fi
16463 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
472fa5ee
SM
16464
16465
16466
16467
c0c3707f
CB
16468 if test $ac_cv_header_dirent_h = yes; then
16469 HAVE_DIRENT_H=1
6ec2e0f5 16470 else
c0c3707f 16471 HAVE_DIRENT_H=0
6ec2e0f5
SDJ
16472 fi
16473
6ec2e0f5 16474
0750520d 16475
0750520d 16476
0750520d 16477
472fa5ee
SM
16478
16479
16480
16481
16482
0750520d 16483
c0c3707f
CB
16484 for ac_func in dirfd
16485do :
16486 ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
16487if test "x$ac_cv_func_dirfd" = xyes; then :
16488 cat >>confdefs.h <<_ACEOF
16489#define HAVE_DIRFD 1
16490_ACEOF
0750520d 16491
c0c3707f
CB
16492fi
16493done
0750520d 16494
c0c3707f
CB
16495 ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
16496 #include <dirent.h>
16497"
16498if test "x$ac_cv_have_decl_dirfd" = xyes; then :
16499 ac_have_decl=1
8690e634 16500else
c0c3707f
CB
16501 ac_have_decl=0
16502fi
8690e634 16503
c0c3707f
CB
16504cat >>confdefs.h <<_ACEOF
16505#define HAVE_DECL_DIRFD $ac_have_decl
16506_ACEOF
49e4877c 16507
c0c3707f
CB
16508 if test $ac_cv_have_decl_dirfd = no; then
16509 HAVE_DECL_DIRFD=0
16510 fi
8690e634 16511
c0c3707f
CB
16512 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
16513$as_echo_n "checking whether dirfd is a macro... " >&6; }
16514if ${gl_cv_func_dirfd_macro+:} false; then :
16515 $as_echo_n "(cached) " >&6
16516else
6ec2e0f5
SDJ
16517 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16518/* end confdefs.h. */
8690e634 16519
c0c3707f
CB
16520#include <sys/types.h>
16521#include <dirent.h>
16522#ifdef dirfd
16523 dirent_header_defines_dirfd
6ec2e0f5 16524#endif
8690e634 16525_ACEOF
c0c3707f
CB
16526if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16527 $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then :
16528 gl_cv_func_dirfd_macro=yes
6ec2e0f5 16529else
c0c3707f 16530 gl_cv_func_dirfd_macro=no
6ec2e0f5 16531fi
c0c3707f 16532rm -f conftest*
472fa5ee 16533
c0c3707f
CB
16534fi
16535{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
16536$as_echo "$gl_cv_func_dirfd_macro" >&6; }
472fa5ee 16537
c0c3707f
CB
16538 # Use the replacement if we have no function or macro with that name,
16539 # or if OS/2 kLIBC whose dirfd() does not work.
16540 # Replace only if the system declares dirfd already.
16541 case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
16542 no,no,*,yes | *,*,os2*,yes)
16543 REPLACE_DIRFD=1
472fa5ee 16544
c0c3707f
CB
16545$as_echo "#define REPLACE_DIRFD 1" >>confdefs.h
16546;;
16547 esac
472fa5ee 16548
c0c3707f
CB
16549 if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
16550 || test $REPLACE_DIRFD = 1; then
6ec2e0f5 16551
6ec2e0f5
SDJ
16552
16553
16554
16555
472fa5ee
SM
16556
16557
16558
c0c3707f 16559 gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext"
472fa5ee
SM
16560
16561
c0c3707f
CB
16562 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
16563$as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; }
16564if ${gl_cv_sys_dir_fd_member_name+:} false; then :
16565 $as_echo_n "(cached) " >&6
16566else
6ec2e0f5 16567
c0c3707f
CB
16568 dirfd_save_CFLAGS=$CFLAGS
16569 for ac_expr in d_fd dd_fd; do
6ec2e0f5 16570
c0c3707f
CB
16571 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
16572 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16573/* end confdefs.h. */
6ec2e0f5 16574
c0c3707f
CB
16575 #include <sys/types.h>
16576 #include <dirent.h>
16577int
16578main ()
16579{
16580DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;
16581 ;
16582 return 0;
16583}
16584_ACEOF
16585if ac_fn_c_try_compile "$LINENO"; then :
16586 dir_fd_found=yes
6ec2e0f5 16587
c0c3707f
CB
16588fi
16589rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16590 CFLAGS=$dirfd_save_CFLAGS
16591 test "$dir_fd_found" = yes && break
16592 done
16593 test "$dir_fd_found" = yes || ac_expr=no_such_member
472fa5ee 16594
c0c3707f 16595 gl_cv_sys_dir_fd_member_name=$ac_expr
472fa5ee
SM
16596
16597
c0c3707f
CB
16598fi
16599{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
16600$as_echo "$gl_cv_sys_dir_fd_member_name" >&6; }
16601 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
472fa5ee 16602
c0c3707f
CB
16603cat >>confdefs.h <<_ACEOF
16604#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name
16605_ACEOF
472fa5ee 16606
6ec2e0f5
SDJ
16607 fi
16608
6ec2e0f5 16609
c0c3707f 16610 fi
6ec2e0f5
SDJ
16611
16612
16613
16614
16615
c0c3707f 16616 GNULIB_DIRFD=1
6ec2e0f5
SDJ
16617
16618
16619
6ec2e0f5 16620
8690e634 16621
c0c3707f 16622$as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
8690e634
JK
16623
16624
8690e634
JK
16625
16626
16627
8690e634
JK
16628
16629
8690e634 16630
8690e634 16631
c0c3707f
CB
16632 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
16633$as_echo_n "checking whether // is distinct from /... " >&6; }
16634if ${gl_cv_double_slash_root+:} false; then :
16635 $as_echo_n "(cached) " >&6
16636else
16637 if test x"$cross_compiling" = xyes ; then
16638 # When cross-compiling, there is no way to tell whether // is special
16639 # short of a list of hosts. However, the only known hosts to date
16640 # that have a distinct // are Apollo DomainOS (too old to port to),
16641 # Cygwin, and z/OS. If anyone knows of another system for which // has
16642 # special semantics and is distinct from /, please report it to
16643 # <bug-gnulib@gnu.org>.
16644 case $host in
16645 *-cygwin | i370-ibm-openedition)
16646 gl_cv_double_slash_root=yes ;;
16647 *)
16648 # Be optimistic and assume that / and // are the same when we
16649 # don't know.
16650 gl_cv_double_slash_root='unknown, assuming no' ;;
16651 esac
16652 else
16653 set x `ls -di / // 2>/dev/null`
16654 if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
16655 gl_cv_double_slash_root=no
16656 else
16657 gl_cv_double_slash_root=yes
16658 fi
16659 fi
16660fi
16661{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
16662$as_echo "$gl_cv_double_slash_root" >&6; }
16663 if test "$gl_cv_double_slash_root" = yes; then
6ec2e0f5 16664
c0c3707f 16665$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
8690e634 16666
c0c3707f 16667 fi
8690e634 16668
63ce7108
TT
16669
16670
16671
16672
c0c3707f
CB
16673 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
16674 REPLACE_DUP=1
16675 fi
8690e634
JK
16676
16677
16678
16679
16680
c0c3707f
CB
16681 if test $ac_cv_func_fchdir = no; then
16682 HAVE_FCHDIR=0
16683 fi
8690e634 16684
c0c3707f
CB
16685 if test $HAVE_FCHDIR = 0; then
16686 REPLACE_DUP=1
16687 fi
8690e634 16688
c0c3707f
CB
16689 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5
16690$as_echo_n "checking whether dup works... " >&6; }
16691if ${gl_cv_func_dup_works+:} false; then :
8690e634
JK
16692 $as_echo_n "(cached) " >&6
16693else
c0c3707f
CB
16694 if test "$cross_compiling" = yes; then :
16695 case "$host_os" in
16696 # Guess no on native Windows.
16697 mingw*) gl_cv_func_dup_works="guessing no" ;;
16698 *) gl_cv_func_dup_works="guessing yes" ;;
16699 esac
8690e634 16700
c0c3707f 16701else
4a626d0a 16702 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 16703/* end confdefs.h. */
c0c3707f
CB
16704#include <unistd.h>
16705 #include <fcntl.h>
16706 #include <errno.h>
16707int
16708main ()
16709{
16710/* On OS/2 kLIBC, dup does not work on a directory fd. */
16711 int fd = open (".", O_RDONLY);
16712 return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
8690e634 16713
c0c3707f
CB
16714 ;
16715 return 0;
16716}
8690e634 16717
c0c3707f
CB
16718_ACEOF
16719if ac_fn_c_try_run "$LINENO"; then :
16720 gl_cv_func_dup_works=yes
16721else
16722 gl_cv_func_dup_works=no
16723fi
16724rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16725 conftest.$ac_objext conftest.beam conftest.$ac_ext
8690e634 16726fi
8690e634 16727
8690e634 16728
c0c3707f
CB
16729fi
16730{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5
16731$as_echo "$gl_cv_func_dup_works" >&6; }
16732 case "$gl_cv_func_dup_works" in
16733 *yes) ;;
16734 *)
16735 REPLACE_DUP=1
16736 ;;
16737 esac
8690e634 16738
c0c3707f 16739 if test $REPLACE_DUP = 1; then
8690e634
JK
16740
16741
16742
16743
6ec2e0f5
SDJ
16744
16745
16746
16747
c0c3707f 16748 gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext"
8690e634 16749
c0c3707f
CB
16750 :
16751 fi
8690e634 16752
5e8754f9 16753
8690e634
JK
16754
16755
8839a007 16756
c0c3707f 16757 GNULIB_DUP=1
63ce7108 16758
63ce7108 16759
63ce7108 16760
6ec2e0f5 16761
6ec2e0f5 16762
c0c3707f 16763$as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h
6ec2e0f5 16764
63ce7108
TT
16765
16766
472fa5ee
SM
16767
16768
16769
16770
16771
c0c3707f
CB
16772$as_echo "#define HAVE_DUP2 1" >>confdefs.h
16773
16774
16775 if test $HAVE_DUP2 = 1; then
16776 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
16777$as_echo_n "checking whether dup2 works... " >&6; }
16778if ${gl_cv_func_dup2_works+:} false; then :
6ec2e0f5
SDJ
16779 $as_echo_n "(cached) " >&6
16780else
16781 if test "$cross_compiling" = yes; then :
16782 case "$host_os" in
c0c3707f
CB
16783 mingw*) # on this platform, dup2 always returns 0 for success
16784 gl_cv_func_dup2_works="guessing no" ;;
16785 cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
16786 gl_cv_func_dup2_works="guessing no" ;;
16787 aix* | freebsd*)
16788 # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
16789 # not EBADF.
16790 gl_cv_func_dup2_works="guessing no" ;;
16791 haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
16792 gl_cv_func_dup2_works="guessing no" ;;
16793 *-android*) # implemented using dup3(), which fails if oldfd == newfd
16794 gl_cv_func_dup2_works="guessing no" ;;
16795 os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
16796 gl_cv_func_dup2_works="guessing no" ;;
16797 *) gl_cv_func_dup2_works="guessing yes" ;;
16798 esac
63ce7108
TT
16799else
16800 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16801/* end confdefs.h. */
16802
c0c3707f
CB
16803 #include <errno.h>
16804 #include <fcntl.h>
16805 #include <limits.h>
16806 #include <sys/resource.h>
16807 #include <unistd.h>
16808 #ifndef RLIM_SAVED_CUR
16809 # define RLIM_SAVED_CUR RLIM_INFINITY
16810 #endif
16811 #ifndef RLIM_SAVED_MAX
16812 # define RLIM_SAVED_MAX RLIM_INFINITY
16813 #endif
63ce7108
TT
16814
16815int
16816main ()
16817{
6ec2e0f5 16818int result = 0;
c0c3707f
CB
16819 int bad_fd = INT_MAX;
16820 struct rlimit rlim;
16821 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
16822 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
16823 && rlim.rlim_cur != RLIM_INFINITY
16824 && rlim.rlim_cur != RLIM_SAVED_MAX
16825 && rlim.rlim_cur != RLIM_SAVED_CUR)
16826 bad_fd = rlim.rlim_cur;
16827 #ifdef FD_CLOEXEC
16828 if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
16829 result |= 1;
16830 #endif
16831 if (dup2 (1, 1) != 1)
16832 result |= 2;
16833 #ifdef FD_CLOEXEC
16834 if (fcntl (1, F_GETFD) != FD_CLOEXEC)
16835 result |= 4;
16836 #endif
16837 close (0);
16838 if (dup2 (0, 0) != -1)
16839 result |= 8;
16840 /* Many gnulib modules require POSIX conformance of EBADF. */
16841 if (dup2 (2, bad_fd) == -1 && errno != EBADF)
16842 result |= 16;
16843 /* Flush out some cygwin core dumps. */
16844 if (dup2 (2, -1) != -1 || errno != EBADF)
16845 result |= 32;
16846 dup2 (2, 255);
16847 dup2 (2, 256);
16848 /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
16849 {
16850 int fd = open (".", O_RDONLY);
16851 if (fd == -1)
16852 result |= 64;
16853 else if (dup2 (fd, fd + 1) == -1)
16854 result |= 128;
16855
16856 close (fd);
16857 }
16858 return result;
63ce7108
TT
16859 ;
16860 return 0;
16861}
c0c3707f 16862
63ce7108
TT
16863_ACEOF
16864if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 16865 gl_cv_func_dup2_works=yes
63ce7108 16866else
c0c3707f 16867 gl_cv_func_dup2_works=no
63ce7108
TT
16868fi
16869rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16870 conftest.$ac_objext conftest.beam conftest.$ac_ext
16871fi
16872
c0c3707f 16873
63ce7108 16874fi
c0c3707f
CB
16875{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
16876$as_echo "$gl_cv_func_dup2_works" >&6; }
16877 case "$gl_cv_func_dup2_works" in
63ce7108
TT
16878 *yes) ;;
16879 *)
c0c3707f
CB
16880 REPLACE_DUP2=1
16881 for ac_func in setdtablesize
16882do :
16883 ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
16884if test "x$ac_cv_func_setdtablesize" = xyes; then :
16885 cat >>confdefs.h <<_ACEOF
16886#define HAVE_SETDTABLESIZE 1
16887_ACEOF
16888
16889fi
16890done
16891
63ce7108
TT
16892 ;;
16893 esac
16894 fi
16895
09607c9e
TT
16896
16897
16898
c0c3707f
CB
16899 if test $ac_cv_func_fchdir = no; then
16900 HAVE_FCHDIR=0
16901 fi
4a626d0a 16902
c0c3707f
CB
16903 if test $HAVE_FCHDIR = 0; then
16904 if test $HAVE_DUP2 = 1; then
16905 REPLACE_DUP2=1
16906 fi
16907 fi
4a626d0a
PA
16908
16909
c0c3707f 16910 if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
4a626d0a
PA
16911
16912
16913
16914
16915
16916
4a626d0a 16917
4a626d0a 16918
c0c3707f 16919 gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
4a626d0a
PA
16920
16921
c0c3707f 16922 fi
4a626d0a
PA
16923
16924
16925
16926
16927
c0c3707f 16928 GNULIB_DUP2=1
4a626d0a
PA
16929
16930
16931
16932
09607c9e 16933
c0c3707f 16934$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
09607c9e
TT
16935
16936
472fa5ee
SM
16937
16938
16939
16940
16941
09607c9e 16942
6ec2e0f5 16943
c0c3707f 16944 GNULIB_ENVIRON=1
6ec2e0f5 16945
09607c9e 16946
09607c9e 16947
6ec2e0f5
SDJ
16948
16949
c0c3707f 16950$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
6ec2e0f5
SDJ
16951
16952
6ec2e0f5 16953
5e8754f9 16954
6ec2e0f5 16955
c0c3707f
CB
16956 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
16957$as_echo_n "checking for error_at_line... " >&6; }
16958if ${ac_cv_lib_error_at_line+:} false; then :
09607c9e 16959 $as_echo_n "(cached) " >&6
4a626d0a
PA
16960else
16961 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16962/* end confdefs.h. */
c0c3707f
CB
16963#include <error.h>
16964int
16965main ()
16966{
16967error_at_line (0, 0, "", 0, "an error occurred");
16968 ;
4a626d0a
PA
16969 return 0;
16970}
16971_ACEOF
c0c3707f
CB
16972if ac_fn_c_try_link "$LINENO"; then :
16973 ac_cv_lib_error_at_line=yes
4a626d0a 16974else
c0c3707f 16975 ac_cv_lib_error_at_line=no
6ec2e0f5 16976fi
c0c3707f
CB
16977rm -f core conftest.err conftest.$ac_objext \
16978 conftest$ac_exeext conftest.$ac_ext
6ec2e0f5 16979fi
c0c3707f
CB
16980{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
16981$as_echo "$ac_cv_lib_error_at_line" >&6; }
09607c9e 16982
c0c3707f 16983 if test $ac_cv_lib_error_at_line = no; then
09607c9e
TT
16984
16985
16986
16987
16988
16989
16990
16991
c0c3707f 16992 gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
09607c9e 16993
4a626d0a 16994
09607c9e 16995
c0c3707f 16996 :
4a626d0a 16997
c0c3707f 16998 fi
4a626d0a 16999
4a626d0a 17000
09607c9e 17001
09607c9e 17002
09607c9e
TT
17003
17004
09607c9e 17005
c0c3707f
CB
17006 if test $ac_cv_have_decl_fchdir = no; then
17007 HAVE_DECL_FCHDIR=0
17008 fi
09607c9e
TT
17009
17010
c0c3707f 17011 if test $HAVE_FCHDIR = 0; then
09607c9e
TT
17012
17013
17014
c0c3707f
CB
17015
17016
17017
17018
17019
17020 gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext"
17021
17022 :
17023
17024$as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h
17025
17026 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
17027$as_echo_n "checking whether open can visit directories... " >&6; }
17028if ${gl_cv_func_open_directory_works+:} false; then :
17029 $as_echo_n "(cached) " >&6
3d99e817 17030else
c0c3707f
CB
17031 if test "$cross_compiling" = yes; then :
17032 case "$host_os" in
17033 # Guess yes on Linux systems.
17034 linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
17035 # Guess yes on glibc systems.
17036 *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
17037 # Guess no on native Windows.
17038 mingw*) gl_cv_func_open_directory_works="guessing no" ;;
17039 # If we don't know, obey --enable-cross-guesses.
17040 *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
17041 esac
17042
17043else
17044 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17045/* end confdefs.h. */
17046#include <fcntl.h>
17047
17048int
17049main ()
17050{
17051return open(".", O_RDONLY) < 0;
17052 ;
17053 return 0;
17054}
17055_ACEOF
17056if ac_fn_c_try_run "$LINENO"; then :
17057 gl_cv_func_open_directory_works=yes
17058else
17059 gl_cv_func_open_directory_works=no
17060fi
17061rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17062 conftest.$ac_objext conftest.beam conftest.$ac_ext
3d99e817
AK
17063fi
17064
c0c3707f
CB
17065fi
17066{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
17067$as_echo "$gl_cv_func_open_directory_works" >&6; }
17068 case "$gl_cv_func_open_directory_works" in
17069 *yes) ;;
17070 *)
3d99e817 17071
c0c3707f 17072$as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
09607c9e 17073
c0c3707f
CB
17074 ;;
17075 esac
17076 fi
8690e634 17077
8690e634 17078
8690e634 17079
8690e634 17080
8690e634 17081
6ec2e0f5 17082
c0c3707f 17083 GNULIB_FCHDIR=1
6ec2e0f5
SDJ
17084
17085
6ec2e0f5 17086
8690e634
JK
17087
17088
c0c3707f 17089$as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h
8690e634
JK
17090
17091
17092
6ec2e0f5
SDJ
17093
17094
17095
6ec2e0f5 17096
8690e634 17097
c0c3707f 17098 if test $ac_cv_func_fcntl = no; then
8690e634
JK
17099
17100
6ec2e0f5 17101
c0c3707f
CB
17102 if test $ac_cv_func_fcntl = no; then
17103 HAVE_FCNTL=0
17104 else
17105 REPLACE_FCNTL=1
17106 fi
5e8754f9 17107
c0c3707f
CB
17108 else
17109 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
17110$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
17111if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
8690e634 17112 $as_echo_n "(cached) " >&6
6ec2e0f5 17113else
c0c3707f
CB
17114 if test "$cross_compiling" = yes; then :
17115 case $host_os in
17116 aix* | cygwin* | haiku*)
17117 gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
17118 *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
17119 esac
17120else
17121 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17122/* end confdefs.h. */
17123#include <errno.h>
17124 #include <fcntl.h>
17125 #include <limits.h>
17126 #include <sys/resource.h>
17127 #include <unistd.h>
17128 #ifndef RLIM_SAVED_CUR
17129 # define RLIM_SAVED_CUR RLIM_INFINITY
17130 #endif
17131 #ifndef RLIM_SAVED_MAX
17132 # define RLIM_SAVED_MAX RLIM_INFINITY
17133 #endif
17134
17135int
17136main ()
17137{
17138int result = 0;
17139 int bad_fd = INT_MAX;
17140 struct rlimit rlim;
17141 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
17142 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
17143 && rlim.rlim_cur != RLIM_INFINITY
17144 && rlim.rlim_cur != RLIM_SAVED_MAX
17145 && rlim.rlim_cur != RLIM_SAVED_CUR)
17146 bad_fd = rlim.rlim_cur;
17147 if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
17148 if (errno != EINVAL) result |= 2;
17149 if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
17150 if (errno != EINVAL) result |= 8;
17151 /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
17152 {
17153 int fd;
17154 fd = open (".", O_RDONLY);
17155 if (fd == -1)
17156 result |= 16;
17157 else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
17158 result |= 32;
17159
17160 close (fd);
17161 }
17162 return result;
17163 ;
17164 return 0;
17165}
17166_ACEOF
17167if ac_fn_c_try_run "$LINENO"; then :
17168 gl_cv_func_fcntl_f_dupfd_works=yes
17169else
17170 gl_cv_func_fcntl_f_dupfd_works=no
17171fi
17172rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17173 conftest.$ac_objext conftest.beam conftest.$ac_ext
17174fi
17175
17176fi
17177{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
17178$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
17179 case $gl_cv_func_fcntl_f_dupfd_works in
17180 *yes) ;;
17181 *)
17182
17183
17184 if test $ac_cv_func_fcntl = no; then
17185 HAVE_FCNTL=0
17186 else
17187 REPLACE_FCNTL=1
17188 fi
17189
17190
17191$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
17192 ;;
17193 esac
17194
17195 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
17196$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
17197if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
17198 $as_echo_n "(cached) " >&6
8690e634
JK
17199else
17200 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17201/* end confdefs.h. */
c0c3707f
CB
17202
17203#include <fcntl.h>
17204#ifndef F_DUPFD_CLOEXEC
17205choke me
17206#endif
17207
17208int
17209main ()
17210{
17211
17212 ;
17213 return 0;
17214}
17215_ACEOF
17216if ac_fn_c_try_compile "$LINENO"; then :
17217 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17218/* end confdefs.h. */
17219
17220#ifdef __linux__
17221/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
17222 it to support the semantics on older kernels that failed with EINVAL. */
17223choke me
17224#endif
8690e634 17225
8690e634
JK
17226int
17227main ()
17228{
17229
17230 ;
17231 return 0;
17232}
17233_ACEOF
c0c3707f
CB
17234if ac_fn_c_try_compile "$LINENO"; then :
17235 gl_cv_func_fcntl_f_dupfd_cloexec=yes
8690e634 17236else
c0c3707f 17237 gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
8690e634 17238fi
c0c3707f
CB
17239rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17240else
17241 gl_cv_func_fcntl_f_dupfd_cloexec=no
17242fi
17243rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8690e634 17244fi
c0c3707f
CB
17245{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
17246$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
17247 if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
8690e634 17248
8690e634 17249
c0c3707f
CB
17250
17251 if test $ac_cv_func_fcntl = no; then
17252 HAVE_FCNTL=0
5e8754f9 17253 else
c0c3707f
CB
17254 REPLACE_FCNTL=1
17255 fi
17256
17257 fi
8690e634
JK
17258 fi
17259
17260
8690e634 17261
8690e634 17262
c0c3707f
CB
17263 if test $ac_cv_func_fchdir = no; then
17264 HAVE_FCHDIR=0
17265 fi
6ec2e0f5 17266
c0c3707f 17267 if test $HAVE_FCHDIR = 0; then
6ec2e0f5
SDJ
17268
17269
17270
c0c3707f
CB
17271 if test $ac_cv_func_fcntl = no; then
17272 HAVE_FCNTL=0
17273 else
17274 REPLACE_FCNTL=1
17275 fi
6ec2e0f5 17276
c0c3707f 17277 fi
6ec2e0f5
SDJ
17278
17279
c0c3707f 17280 if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
6ec2e0f5 17281
6ec2e0f5
SDJ
17282
17283
5e8754f9
SDJ
17284
17285
8690e634 17286
8690e634
JK
17287
17288
c0c3707f 17289 gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
472fa5ee 17290
c0c3707f 17291 fi
472fa5ee
SM
17292
17293
17294
17295
17296
c0c3707f 17297 GNULIB_FCNTL=1
472fa5ee
SM
17298
17299
17300
17301
17302
c0c3707f 17303$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
472fa5ee
SM
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
c0c3707f
CB
17318 if test $gl_cv_have_include_next = yes; then
17319 gl_cv_next_fcntl_h='<'fcntl.h'>'
17320 else
17321 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
17322$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
17323if ${gl_cv_next_fcntl_h+:} false; then :
17324 $as_echo_n "(cached) " >&6
17325else
472fa5ee
SM
17326
17327
472fa5ee 17328
c0c3707f
CB
17329 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17330/* end confdefs.h. */
17331#include <fcntl.h>
17332_ACEOF
17333 case "$host_os" in
17334 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17335 *) gl_absname_cpp="$ac_cpp" ;;
17336 esac
472fa5ee 17337
c0c3707f
CB
17338 case "$host_os" in
17339 mingw*)
17340 gl_dirsep_regex='[/\\]'
17341 ;;
17342 *)
17343 gl_dirsep_regex='\/'
17344 ;;
17345 esac
17346 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17347 gl_header_literal_regex=`echo 'fcntl.h' \
17348 | sed -e "$gl_make_literal_regex_sed"`
17349 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17350 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17351 s|^/[^/]|//&|
17352 p
17353 q
17354 }'
472fa5ee 17355
c0c3707f
CB
17356 gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17357 sed -n "$gl_absolute_header_sed"`
472fa5ee 17358
c0c3707f
CB
17359 gl_header=$gl_cv_absolute_fcntl_h
17360 gl_cv_next_fcntl_h='"'$gl_header'"'
8690e634
JK
17361
17362
c0c3707f
CB
17363fi
17364{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
17365$as_echo "$gl_cv_next_fcntl_h" >&6; }
17366 fi
17367 NEXT_FCNTL_H=$gl_cv_next_fcntl_h
8690e634 17368
c0c3707f
CB
17369 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17370 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17371 gl_next_as_first_directive='<'fcntl.h'>'
17372 else
17373 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17374 gl_next_as_first_directive=$gl_cv_next_fcntl_h
17375 fi
17376 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
8690e634
JK
17377
17378
17379
17380
5e8754f9
SDJ
17381
17382
17383
17384
472fa5ee
SM
17385
17386
17387
17388
17389
17390
17391
5e8754f9 17392cat >>confdefs.h <<_ACEOF
c0c3707f 17393#define GNULIB_FD_SAFER_FLAG 1
5e8754f9 17394_ACEOF
472fa5ee
SM
17395
17396
c0c3707f
CB
17397
17398
17399
17400
17401
17402 ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
17403#include <dirent.h>
17404
5e8754f9 17405"
c0c3707f 17406if test "x$ac_cv_have_decl_fdopendir" = xyes; then :
5e8754f9
SDJ
17407 ac_have_decl=1
17408else
17409 ac_have_decl=0
17410fi
472fa5ee 17411
5e8754f9 17412cat >>confdefs.h <<_ACEOF
c0c3707f 17413#define HAVE_DECL_FDOPENDIR $ac_have_decl
5e8754f9 17414_ACEOF
c0c3707f 17415if test $ac_have_decl = 1; then :
472fa5ee 17416
c0c3707f
CB
17417else
17418 HAVE_DECL_FDOPENDIR=0
17419fi
472fa5ee
SM
17420
17421
c0c3707f
CB
17422 if test $ac_cv_func_fdopendir = no; then
17423 HAVE_FDOPENDIR=0
17424 else
17425 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
17426$as_echo_n "checking whether fdopendir works... " >&6; }
17427if ${gl_cv_func_fdopendir_works+:} false; then :
17428 $as_echo_n "(cached) " >&6
17429else
17430 if test "$cross_compiling" = yes; then :
17431 case "$host_os" in
17432 # Guess yes on glibc systems.
17433 *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
17434 # Guess yes on musl systems.
17435 *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
17436 # If we don't know, obey --enable-cross-guesses.
17437 *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
17438 esac
472fa5ee 17439
c0c3707f
CB
17440else
17441 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17442/* end confdefs.h. */
472fa5ee 17443
c0c3707f
CB
17444#include <dirent.h>
17445#include <fcntl.h>
17446#include <unistd.h>
17447#if !HAVE_DECL_FDOPENDIR
17448extern
17449# ifdef __cplusplus
17450"C"
17451# endif
17452DIR *fdopendir (int);
17453#endif
472fa5ee 17454
c0c3707f
CB
17455int
17456main ()
17457{
17458int result = 0;
17459 int fd = open ("conftest.c", O_RDONLY);
17460 if (fd < 0) result |= 1;
17461 if (fdopendir (fd)) result |= 2;
17462 if (close (fd)) result |= 4;
17463 return result;
17464 ;
17465 return 0;
17466}
17467_ACEOF
17468if ac_fn_c_try_run "$LINENO"; then :
17469 gl_cv_func_fdopendir_works=yes
17470else
17471 gl_cv_func_fdopendir_works=no
17472fi
17473rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17474 conftest.$ac_objext conftest.beam conftest.$ac_ext
17475fi
472fa5ee 17476
c0c3707f
CB
17477fi
17478{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
17479$as_echo "$gl_cv_func_fdopendir_works" >&6; }
17480 case "$gl_cv_func_fdopendir_works" in
17481 *yes) ;;
17482 *)
17483 REPLACE_FDOPENDIR=1
17484 ;;
17485 esac
17486 fi
472fa5ee 17487
c0c3707f 17488 if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
472fa5ee
SM
17489
17490
17491
17492
17493
98399780 17494
5e8754f9
SDJ
17495
17496
c0c3707f 17497 gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
5e8754f9 17498
c0c3707f 17499 fi
5e8754f9
SDJ
17500
17501
17502
17503
17504
c0c3707f 17505 GNULIB_FDOPENDIR=1
5e8754f9
SDJ
17506
17507
17508
17509
17510
c0c3707f 17511$as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h
5e8754f9
SDJ
17512
17513
5e8754f9
SDJ
17514
17515
17516
c0c3707f
CB
17517cat >>confdefs.h <<_ACEOF
17518#define GNULIB_FDOPENDIR 1
17519_ACEOF
5e8754f9
SDJ
17520
17521
17522
5e8754f9
SDJ
17523
17524
17525
c0c3707f
CB
17526 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
17527$as_echo_n "checking for flexible array member... " >&6; }
17528if ${ac_cv_c_flexmember+:} false; then :
5e8754f9 17529 $as_echo_n "(cached) " >&6
6ec2e0f5 17530else
c0c3707f 17531 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 17532/* end confdefs.h. */
c0c3707f
CB
17533#include <stdlib.h>
17534 #include <stdio.h>
17535 #include <stddef.h>
17536 struct m { struct m *next, **list; char name[]; };
17537 struct s { struct s *p; struct m *m; int n; double d[]; };
5e8754f9
SDJ
17538int
17539main ()
17540{
c0c3707f
CB
17541int m = getchar ();
17542 size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
17543 nbytes += sizeof (struct s) - 1;
17544 nbytes -= nbytes % sizeof (struct s);
17545 struct s *p = malloc (nbytes);
17546 p->p = p;
17547 p->m = NULL;
17548 p->d[0] = 0.0;
17549 return p->d != (double *) NULL;
5e8754f9
SDJ
17550 ;
17551 return 0;
17552}
7a6dbc2f 17553_ACEOF
c0c3707f
CB
17554if ac_fn_c_try_compile "$LINENO"; then :
17555 ac_cv_c_flexmember=yes
5e8754f9 17556else
c0c3707f 17557 ac_cv_c_flexmember=no
5e8754f9 17558fi
c0c3707f 17559rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5e8754f9 17560fi
c0c3707f
CB
17561{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
17562$as_echo "$ac_cv_c_flexmember" >&6; }
17563 if test $ac_cv_c_flexmember = yes; then
17564
17565$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
5e8754f9 17566
c0c3707f
CB
17567 else
17568 $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
98399780 17569
c0c3707f 17570 fi
98399780 17571
472fa5ee
SM
17572
17573
17574
c0c3707f
CB
17575 FLOAT_H=
17576 REPLACE_FLOAT_LDBL=0
17577 case "$host_os" in
17578 aix* | beos* | openbsd* | mirbsd* | irix*)
17579 FLOAT_H=float.h
17580 ;;
17581 freebsd* | dragonfly*)
17582 case "$host_cpu" in
17583 i[34567]86 )
17584 FLOAT_H=float.h
17585 ;;
17586 x86_64 )
17587 # On x86_64 systems, the C compiler may still be generating
17588 # 32-bit code.
17589 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17590/* end confdefs.h. */
17591#if defined __LP64__ || defined __x86_64__ || defined __amd64__
17592 int ok;
17593 #else
17594 error fail
17595 #endif
472fa5ee 17596
c0c3707f
CB
17597_ACEOF
17598if ac_fn_c_try_compile "$LINENO"; then :
472fa5ee 17599
c0c3707f
CB
17600else
17601 FLOAT_H=float.h
17602fi
17603rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17604 ;;
17605 esac
17606 ;;
17607 linux*)
17608 case "$host_cpu" in
17609 powerpc*)
17610 FLOAT_H=float.h
17611 ;;
17612 esac
17613 ;;
17614 esac
17615 case "$host_os" in
17616 aix* | freebsd* | dragonfly* | linux*)
17617 if test -n "$FLOAT_H"; then
17618 REPLACE_FLOAT_LDBL=1
17619 fi
17620 ;;
17621 esac
17622
17623 REPLACE_ITOLD=0
17624 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
17625$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
17626if ${gl_cv_func_itold_works+:} false; then :
5e8754f9
SDJ
17627 $as_echo_n "(cached) " >&6
17628else
17629
17630 if test "$cross_compiling" = yes; then :
c0c3707f
CB
17631 case "$host" in
17632 sparc*-*-linux*)
17633 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17634/* end confdefs.h. */
17635#if defined __LP64__ || defined __arch64__
17636 int ok;
17637 #else
17638 error fail
17639 #endif
17640
17641_ACEOF
17642if ac_fn_c_try_compile "$LINENO"; then :
17643 gl_cv_func_itold_works="guessing no"
17644else
17645 gl_cv_func_itold_works="guessing yes"
17646fi
17647rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17648 ;;
17649 # Guess yes on native Windows.
17650 mingw*) gl_cv_func_itold_works="guessing yes" ;;
17651 *) gl_cv_func_itold_works="guessing yes" ;;
5e8754f9
SDJ
17652 esac
17653
17654else
17655 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17656/* end confdefs.h. */
17657
c0c3707f
CB
17658int i = -1;
17659volatile long double ld;
17660int main ()
5e8754f9 17661{
c0c3707f
CB
17662 ld += i * 1.0L;
17663 if (ld > 0)
17664 return 1;
17665 return 0;
5e8754f9
SDJ
17666}
17667_ACEOF
17668if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 17669 gl_cv_func_itold_works=yes
5e8754f9 17670else
c0c3707f 17671 gl_cv_func_itold_works=no
5e8754f9
SDJ
17672fi
17673rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17674 conftest.$ac_objext conftest.beam conftest.$ac_ext
17675fi
17676
98399780 17677
5e8754f9 17678fi
c0c3707f
CB
17679{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
17680$as_echo "$gl_cv_func_itold_works" >&6; }
17681 case "$gl_cv_func_itold_works" in
17682 *no)
17683 REPLACE_ITOLD=1
17684 FLOAT_H=float.h
17685 ;;
17686 esac
98399780 17687
c0c3707f 17688 if test -n "$FLOAT_H"; then
98399780
YQ
17689
17690
17691
17692
6a29c58e
YQ
17693
17694
17695
17696
c0c3707f
CB
17697 if test $gl_cv_have_include_next = yes; then
17698 gl_cv_next_float_h='<'float.h'>'
17699 else
17700 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
17701$as_echo_n "checking absolute name of <float.h>... " >&6; }
17702if ${gl_cv_next_float_h+:} false; then :
17703 $as_echo_n "(cached) " >&6
17704else
17705
17706
17707
17708 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17709/* end confdefs.h. */
17710#include <float.h>
17711_ACEOF
17712 case "$host_os" in
17713 aix*) gl_absname_cpp="$ac_cpp -C" ;;
17714 *) gl_absname_cpp="$ac_cpp" ;;
17715 esac
17716
17717 case "$host_os" in
17718 mingw*)
17719 gl_dirsep_regex='[/\\]'
17720 ;;
17721 *)
17722 gl_dirsep_regex='\/'
17723 ;;
17724 esac
17725 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17726 gl_header_literal_regex=`echo 'float.h' \
17727 | sed -e "$gl_make_literal_regex_sed"`
17728 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17729 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17730 s|^/[^/]|//&|
17731 p
17732 q
17733 }'
17734
17735 gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17736 sed -n "$gl_absolute_header_sed"`
17737
17738 gl_header=$gl_cv_absolute_float_h
17739 gl_cv_next_float_h='"'$gl_header'"'
17740
17741
17742fi
17743{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
17744$as_echo "$gl_cv_next_float_h" >&6; }
17745 fi
17746 NEXT_FLOAT_H=$gl_cv_next_float_h
17747
17748 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17749 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17750 gl_next_as_first_directive='<'float.h'>'
17751 else
17752 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17753 gl_next_as_first_directive=$gl_cv_next_float_h
17754 fi
17755 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
17756
17757
17758
6a29c58e 17759
c0c3707f 17760 fi
6a29c58e 17761
c0c3707f
CB
17762 if test -n "$FLOAT_H"; then
17763 GL_GENERATE_FLOAT_H_TRUE=
17764 GL_GENERATE_FLOAT_H_FALSE='#'
17765else
17766 GL_GENERATE_FLOAT_H_TRUE='#'
17767 GL_GENERATE_FLOAT_H_FALSE=
17768fi
6a29c58e
YQ
17769
17770
8690e634 17771
c0c3707f 17772 if test $REPLACE_FLOAT_LDBL = 1; then
8690e634 17773
8690e634 17774
8690e634 17775
8690e634 17776
8690e634 17777
8690e634 17778
8690e634 17779
4a626d0a 17780
c0c3707f 17781 gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
8690e634 17782
c0c3707f
CB
17783 fi
17784 if test $REPLACE_ITOLD = 1; then
8690e634
JK
17785
17786
17787
17788
17789
17790
63ce7108 17791
e26b6bb0 17792
c0c3707f 17793 gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
e26b6bb0 17794
c0c3707f 17795 fi
e26b6bb0
TT
17796
17797
17798
17799
c0c3707f
CB
17800 gl_fnmatch_required_lowercase=`
17801 echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
17802 `
e26b6bb0 17803
c0c3707f
CB
17804 if test $ac_cv_func_fnmatch = no; then
17805 HAVE_FNMATCH=0
17806 else
17807 gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
17808 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5
17809$as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; }
17810if eval \${$gl_fnmatch_cache_var+:} false; then :
5e8754f9
SDJ
17811 $as_echo_n "(cached) " >&6
17812else
c0c3707f
CB
17813 if test $gl_fnmatch_required = GNU; then
17814 gl_fnmatch_gnu_start=
17815 gl_fnmatch_gnu_end=
17816 else
17817 gl_fnmatch_gnu_start='#if 0'
17818 gl_fnmatch_gnu_end='#endif'
17819 fi
17820 if test "$cross_compiling" = yes; then :
17821 case "$host_os" in
17822 # Guess yes on musl systems.
17823 *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;;
17824 # Guess no otherwise, even on glibc systems.
17825 *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;;
17826 esac
e26b6bb0 17827
c0c3707f
CB
17828else
17829 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5e8754f9 17830/* end confdefs.h. */
c0c3707f
CB
17831#include <fnmatch.h>
17832 static int
17833 y (char const *pattern, char const *string, int flags)
17834 {
17835 return fnmatch (pattern, string, flags) == 0;
17836 }
17837 static int
17838 n (char const *pattern, char const *string, int flags)
17839 {
17840 return fnmatch (pattern, string, flags) == FNM_NOMATCH;
17841 }
17842
5e8754f9
SDJ
17843int
17844main ()
17845{
c0c3707f
CB
17846char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
17847 char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]";
17848 static char const A_1[] = { 'A' - 1, 0 };
17849 static char const A01[] = { 'A' + 1, 0 };
17850 static char const a_1[] = { 'a' - 1, 0 };
17851 static char const a01[] = { 'a' + 1, 0 };
17852 static char const bs_1[] = { '\\\\' - 1, 0 };
17853 static char const bs01[] = { '\\\\' + 1, 0 };
17854 int result = 0;
17855 if (!n ("a*", "", 0))
17856 return 1;
17857 if (!y ("a*", "abc", 0))
17858 return 1;
17859 if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
17860 return 1;
17861 if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
17862 return 2;
17863 if (!y ("a\\\\bc", "abc", 0))
17864 return 3;
17865 if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
17866 return 3;
17867 if (!y ("*x", ".x", 0))
17868 return 4;
17869 if (!n ("*x", ".x", FNM_PERIOD))
17870 return 4;
17871 if (!y (Apat, "\\\\", 0))
17872 return 5;
17873 if (!y (Apat, "A", 0))
17874 return 5;
17875 if (!y (apat, "\\\\", 0))
17876 return 5;
17877 if (!y (apat, "a", 0))
17878 return 5;
17879 if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
17880 return 5;
17881 if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
17882 return 5;
17883 if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
17884 return 5;
17885 if (!(y (apat, a01, 0) == ('a' < '\\\\')))
17886 return 5;
17887 if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
17888 return 5;
17889 if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
17890 return 5;
17891 if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
17892 return 5;
17893 if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
17894 return 5;
17895 $gl_fnmatch_gnu_start
17896 if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
17897 result |= 8;
17898 if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
17899 result |= 16;
17900 if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
17901 result |= 32;
17902 if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
17903 result |= 64;
17904 if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
17905 result |= 64;
17906 if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
17907 result |= 64;
17908 $gl_fnmatch_gnu_end
17909 return result;
17910
5e8754f9
SDJ
17911 ;
17912 return 0;
17913}
17914_ACEOF
c0c3707f
CB
17915if ac_fn_c_try_run "$LINENO"; then :
17916 eval "$gl_fnmatch_cache_var=yes"
5e8754f9 17917else
c0c3707f
CB
17918 eval "$gl_fnmatch_cache_var=no"
17919fi
17920rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17921 conftest.$ac_objext conftest.beam conftest.$ac_ext
5e8754f9 17922fi
c0c3707f 17923
e26b6bb0 17924
5e8754f9 17925fi
c0c3707f
CB
17926eval ac_res=\$$gl_fnmatch_cache_var
17927 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17928$as_echo "$ac_res" >&6; }
17929 eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
17930 case "$gl_fnmatch_result" in
17931 *yes) ;;
17932 *) REPLACE_FNMATCH=1 ;;
17933 esac
17934 fi
17935 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
e26b6bb0 17936
e26b6bb0 17937
c0c3707f
CB
17938 FNMATCH_H='fnmatch.h'
17939 if test -n "$FNMATCH_H"; then
17940 GL_GENERATE_FNMATCH_H_TRUE=
17941 GL_GENERATE_FNMATCH_H_FALSE='#'
5e8754f9 17942else
c0c3707f
CB
17943 GL_GENERATE_FNMATCH_H_TRUE='#'
17944 GL_GENERATE_FNMATCH_H_FALSE=
5e8754f9 17945fi
e26b6bb0 17946
18848e28 17947
c0c3707f 17948 fi
18848e28 17949
c0c3707f 17950 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
18848e28 17951
18848e28 17952
18848e28 17953
c0c3707f
CB
17954
17955
17956
17957
17958
17959 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
17960
17961
17962
17963 ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
17964"
17965if test "x$ac_cv_have_decl_isblank" = xyes; then :
17966 ac_have_decl=1
5e8754f9 17967else
c0c3707f
CB
17968 ac_have_decl=0
17969fi
18848e28 17970
c0c3707f
CB
17971cat >>confdefs.h <<_ACEOF
17972#define HAVE_DECL_ISBLANK $ac_have_decl
5e8754f9 17973_ACEOF
c0c3707f
CB
17974
17975
17976
17977
17978 fi
17979
17980
17981
17982
17983
17984 GNULIB_FNMATCH=1
17985
17986
17987
17988
17989
17990$as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h
17991
17992
17993
17994
17995
17996
17997
17998
17999 if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
18000
18001
18002
18003
18004
18005
18006
18007
18008 gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
18009
18010
18011
18012 ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
18013"
18014if test "x$ac_cv_have_decl_isblank" = xyes; then :
18015 ac_have_decl=1
5e8754f9 18016else
c0c3707f 18017 ac_have_decl=0
5e8754f9 18018fi
18848e28 18019
c0c3707f
CB
18020cat >>confdefs.h <<_ACEOF
18021#define HAVE_DECL_ISBLANK $ac_have_decl
18022_ACEOF
18848e28
GF
18023
18024
18025
18848e28 18026
5e8754f9 18027 fi
18848e28 18028
18848e28 18029
c0c3707f
CB
18030cat >>confdefs.h <<_ACEOF
18031#define GNULIB_FNMATCH_GNU 1
18032_ACEOF
18848e28 18033
18848e28 18034
18848e28 18035
18848e28 18036
c0c3707f
CB
18037 if test $gl_func_frexp != yes; then
18038
18039
18848e28
GF
18040
18041
18848e28 18042
18848e28 18043
18848e28 18044
c0c3707f
CB
18045
18046 gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext"
18848e28
GF
18047
18048 fi
18049
18050
18051
18052
18053
c0c3707f 18054 GNULIB_FREXP=1
18848e28
GF
18055
18056
18057
18058
18059
c0c3707f 18060$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h
18848e28
GF
18061
18062
18063
18064
c0c3707f
CB
18065 if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
18066
18067
18068
18848e28
GF
18069
18070
18071
5e8754f9
SDJ
18072
18073
c0c3707f
CB
18074 gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext"
18075
5e8754f9 18076 fi
18848e28 18077
6a29c58e 18078
6a29c58e 18079
6a29c58e 18080
6ec2e0f5 18081
c0c3707f
CB
18082 GNULIB_FREXPL=1
18083
18084
18085
18086
18087
18088$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
18089
18090
18091
18092
18093
18094
18095
18096 case "$host_os" in
18097 mingw* | solaris*)
18098 REPLACE_FSTAT=1
18099 ;;
18100 esac
472fa5ee
SM
18101
18102
18103
18104
18105
6ec2e0f5
SDJ
18106 if test $ac_cv_func_fchdir = no; then
18107 HAVE_FCHDIR=0
6a29c58e
YQ
18108 fi
18109
6ec2e0f5
SDJ
18110 if test $HAVE_FCHDIR = 0; then
18111 case "$gl_cv_func_open_directory_works" in
18112 *yes) ;;
18113 *)
18114 REPLACE_FSTAT=1
18115 ;;
18116 esac
18117 fi
6a29c58e
YQ
18118
18119
6ec2e0f5 18120 if test $REPLACE_FSTAT = 1; then
6a29c58e 18121
3d99e817
AK
18122
18123
18124
3d99e817
AK
18125
18126
18127
18128
6ec2e0f5 18129 gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext"
3d99e817 18130
c0c3707f
CB
18131 case "$host_os" in
18132 mingw*)
3d99e817
AK
18133
18134
18135
18136
18137
18138
49e4877c 18139
49e4877c 18140
c0c3707f 18141 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
49e4877c 18142
c0c3707f
CB
18143 ;;
18144 esac
49e4877c
PA
18145
18146
c0c3707f
CB
18147 :
18148
18149 fi
6a29c58e
YQ
18150
18151
88b48903 18152
8690e634 18153
a512b375 18154
c0c3707f
CB
18155 GNULIB_FSTAT=1
18156
18157
18158
18159
18160
18161$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
18162
18163
88b48903 18164
88b48903 18165
472fa5ee
SM
18166
18167
18168
18169
18170
6ec2e0f5
SDJ
18171
18172 if test $ac_cv_func_fstatat = no; then
18173 HAVE_FSTATAT=0
18174 else
18175 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5
18176$as_echo_n "checking whether fstatat (..., 0) works... " >&6; }
d0ac1c44 18177if ${gl_cv_func_fstatat_zero_flag+:} false; then :
6ec2e0f5
SDJ
18178 $as_echo_n "(cached) " >&6
18179else
18180 if test "$cross_compiling" = yes; then :
18181 case "$host_os" in
18182 aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
18183 *) gl_cv_func_fstatat_zero_flag="guessing yes";;
18184 esac
88b48903 18185
8690e634
JK
18186else
18187 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18188/* end confdefs.h. */
8690e634 18189
6ec2e0f5
SDJ
18190 #include <fcntl.h>
18191 #include <sys/stat.h>
18192 int
18193 main (void)
18194 {
18195 struct stat a;
18196 return fstatat (AT_FDCWD, ".", &a, 0) != 0;
18197 }
18198
88b48903
WN
18199_ACEOF
18200if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 18201 gl_cv_func_fstatat_zero_flag=yes
88b48903 18202else
6ec2e0f5 18203 gl_cv_func_fstatat_zero_flag=no
88b48903
WN
18204fi
18205rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18206 conftest.$ac_objext conftest.beam conftest.$ac_ext
18207fi
18208
18209
18210fi
6ec2e0f5
SDJ
18211{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5
18212$as_echo "$gl_cv_func_fstatat_zero_flag" >&6; }
88b48903 18213
6ec2e0f5
SDJ
18214 case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
18215 *yes+*yes) ;;
c0c3707f
CB
18216 *) REPLACE_FSTATAT=1 ;;
18217 esac
18218
18219 case $host_os in
18220 solaris*)
18221 REPLACE_FSTATAT=1 ;;
18222 esac
18223
18224 case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
18225 1,*yes)
88b48903 18226
6ec2e0f5 18227$as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h
88b48903 18228
7a6dbc2f 18229 ;;
6ec2e0f5
SDJ
18230 esac
18231 fi
88b48903 18232
6ec2e0f5 18233 if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
88b48903
WN
18234
18235
18236
18237
18238
88b48903 18239
4a626d0a
PA
18240
18241
6ec2e0f5
SDJ
18242 gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext"
18243
18244 fi
18245
18246
18247
4a626d0a 18248
6ec2e0f5
SDJ
18249
18250 GNULIB_FSTATAT=1
18251
18252
18253
18254
18255
18256$as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h
18257
18258
18259
18260
18261
18262
18263
18264
18265 gl_abort_bug=no
4a626d0a
PA
18266 case "$host_os" in
18267 mingw*)
6ec2e0f5 18268 gl_cv_func_getcwd_path_max=yes
4a626d0a
PA
18269 ;;
18270 *)
88b48903 18271
88b48903 18272
88b48903
WN
18273
18274
88b48903 18275
6ec2e0f5
SDJ
18276 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5
18277$as_echo_n "checking whether getcwd handles long file names properly... " >&6; }
d0ac1c44 18278if ${gl_cv_func_getcwd_path_max+:} false; then :
6ec2e0f5
SDJ
18279 $as_echo_n "(cached) " >&6
18280else
18281 # Arrange for deletion of the temporary directory this test creates.
18282 ac_clean_files="$ac_clean_files confdir3"
18283 if test "$cross_compiling" = yes; then :
b567ca63 18284 # Cross-compilation guesses:
c0c3707f
CB
18285 case "$host_os" in
18286 aix*) # On AIX, it has the AIX bug.
18287 gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
18288 gnu*) # On Hurd, it is 'yes'.
18289 gl_cv_func_getcwd_path_max='guessing yes' ;;
18290 linux* | kfreebsd*)
18291 # On older Linux+glibc it's 'no, but it is partly working',
18292 # on newer Linux+glibc it's 'yes'.
18293 # On Linux+musl libc, it's 'no, but it is partly working'.
18294 # On kFreeBSD+glibc, it's 'no, but it is partly working'.
18295 gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
18296 *) # If we don't know, obey --enable-cross-guesses.
18297 gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
18298 esac
b567ca63 18299
6ec2e0f5
SDJ
18300else
18301 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18302/* end confdefs.h. */
88b48903 18303
6ec2e0f5
SDJ
18304#include <errno.h>
18305#include <stdlib.h>
18306#if HAVE_UNISTD_H
18307# include <unistd.h>
18308#else
18309# include <direct.h>
18310#endif
18311#include <string.h>
18312#include <limits.h>
18313#include <sys/stat.h>
18314#include <sys/types.h>
18315#include <fcntl.h>
88b48903
WN
18316
18317
6ec2e0f5
SDJ
18318/* Arrange to define PATH_MAX, like "pathmax.h" does. */
18319#if HAVE_UNISTD_H
18320# include <unistd.h>
18321#endif
18322#include <limits.h>
18323#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
18324# include <sys/param.h>
18325#endif
18326#if !defined PATH_MAX && defined MAXPATHLEN
18327# define PATH_MAX MAXPATHLEN
18328#endif
18329#ifdef __hpux
18330# undef PATH_MAX
18331# define PATH_MAX 1024
18332#endif
c0c3707f 18333#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
18334# undef PATH_MAX
18335# define PATH_MAX 260
18336#endif
88b48903 18337
88b48903 18338
6ec2e0f5
SDJ
18339#ifndef AT_FDCWD
18340# define AT_FDCWD 0
18341#endif
18342#ifdef ENAMETOOLONG
18343# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
18344#else
18345# define is_ENAMETOOLONG(x) 0
18346#endif
88b48903 18347
6ec2e0f5
SDJ
18348/* Use the getcwd function, not any macro. */
18349#undef getcwd
88b48903 18350
6ec2e0f5
SDJ
18351/* Don't get link errors because mkdir is redefined to rpl_mkdir. */
18352#undef mkdir
88b48903 18353
6ec2e0f5
SDJ
18354#ifndef S_IRWXU
18355# define S_IRWXU 0700
18356#endif
88b48903 18357
6ec2e0f5
SDJ
18358/* The length of this name must be 8. */
18359#define DIR_NAME "confdir3"
18360#define DIR_NAME_LEN 8
18361#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
88b48903 18362
6ec2e0f5
SDJ
18363/* The length of "../". */
18364#define DOTDOTSLASH_LEN 3
88b48903 18365
6ec2e0f5
SDJ
18366/* Leftover bytes in the buffer, to work around library or OS bugs. */
18367#define BUF_SLOP 20
88b48903 18368
6ec2e0f5
SDJ
18369int
18370main ()
18371{
18372#ifndef PATH_MAX
18373 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
18374 at least not on a local file system. And if we were to start worrying
18375 about remote file systems, we'd have to enable the wrapper function
18376 all of the time, just to be safe. That's not worth the cost. */
18377 exit (0);
18378#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
18379 - DIR_NAME_SIZE - BUF_SLOP) \
18380 <= PATH_MAX)
18381 /* FIXME: Assuming there's a system for which this is true,
18382 this should be done in a compile test. */
18383 exit (0);
18384#else
18385 char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
18386 + DIR_NAME_SIZE + BUF_SLOP];
18387 char *cwd = getcwd (buf, PATH_MAX);
18388 size_t initial_cwd_len;
18389 size_t cwd_len;
18390 int fail = 0;
18391 size_t n_chdirs = 0;
88b48903 18392
6ec2e0f5
SDJ
18393 if (cwd == NULL)
18394 exit (10);
88b48903 18395
6ec2e0f5 18396 cwd_len = initial_cwd_len = strlen (cwd);
88b48903 18397
6ec2e0f5
SDJ
18398 while (1)
18399 {
18400 size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
18401 char *c = NULL;
18402
18403 cwd_len += DIR_NAME_SIZE;
18404 /* If mkdir or chdir fails, it could be that this system cannot create
18405 any file with an absolute name longer than PATH_MAX, such as cygwin.
18406 If so, leave fail as 0, because the current working directory can't
c0c3707f
CB
18407 be too long for getcwd if it can't even be created. On Linux with
18408 the 9p file system, mkdir fails with error EINVAL when cwd_len gets
18409 too long; ignore this failure because the getcwd() system call
18410 produces good results whereas the gnulib substitute calls getdents64
18411 which fails with error EPROTO.
18412 For other errors, be pessimistic and consider that as a failure,
18413 too. */
6ec2e0f5
SDJ
18414 if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
18415 {
18416 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
c0c3707f
CB
18417 #ifdef __linux__
18418 if (! (errno == EINVAL))
18419 #endif
18420 fail = 20;
6ec2e0f5
SDJ
18421 break;
18422 }
88b48903 18423
6ec2e0f5
SDJ
18424 if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
18425 {
18426 struct stat sb;
88b48903 18427
6ec2e0f5
SDJ
18428 c = getcwd (buf, PATH_MAX);
18429 if (!c && errno == ENOENT)
18430 {
18431 fail = 11;
18432 break;
18433 }
18434 if (c)
18435 {
18436 fail = 31;
18437 break;
18438 }
18439 if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
18440 {
18441 fail = 21;
18442 break;
18443 }
88b48903 18444
6ec2e0f5
SDJ
18445 /* Our replacement needs to be able to stat() long ../../paths,
18446 so generate a path larger than PATH_MAX to check,
18447 avoiding the replacement if we can't stat(). */
18448 c = getcwd (buf, cwd_len + 1);
18449 if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
18450 {
18451 fail = 32;
18452 break;
18453 }
18454 }
88b48903 18455
6ec2e0f5
SDJ
18456 if (dotdot_max <= cwd_len - initial_cwd_len)
18457 {
18458 if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
18459 break;
18460 c = getcwd (buf, cwd_len + 1);
18461 if (!c)
18462 {
18463 if (! (errno == ERANGE || errno == ENOENT
18464 || is_ENAMETOOLONG (errno)))
18465 {
18466 fail = 22;
18467 break;
18468 }
18469 if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
18470 {
18471 fail = 12;
18472 break;
18473 }
18474 }
18475 }
88b48903 18476
6ec2e0f5
SDJ
18477 if (c && strlen (c) != cwd_len)
18478 {
18479 fail = 23;
18480 break;
18481 }
18482 ++n_chdirs;
18483 }
88b48903 18484
6ec2e0f5
SDJ
18485 /* Leaving behind such a deep directory is not polite.
18486 So clean up here, right away, even though the driving
18487 shell script would also clean up. */
18488 {
18489 size_t i;
88b48903 18490
6ec2e0f5
SDJ
18491 /* Try rmdir first, in case the chdir failed. */
18492 rmdir (DIR_NAME);
18493 for (i = 0; i <= n_chdirs; i++)
18494 {
18495 if (chdir ("..") < 0)
18496 break;
18497 if (rmdir (DIR_NAME) != 0)
18498 break;
18499 }
18500 }
88b48903 18501
6ec2e0f5
SDJ
18502 exit (fail);
18503#endif
18504}
88b48903 18505
6ec2e0f5
SDJ
18506_ACEOF
18507if ac_fn_c_try_run "$LINENO"; then :
18508 gl_cv_func_getcwd_path_max=yes
18509else
18510 case $? in
c0c3707f
CB
18511 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
18512 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
18513 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
18514 *) gl_cv_func_getcwd_path_max=no;;
18515 esac
6ec2e0f5
SDJ
18516fi
18517rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18518 conftest.$ac_objext conftest.beam conftest.$ac_ext
18519fi
88b48903 18520
88b48903 18521
6ec2e0f5
SDJ
18522fi
18523{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5
18524$as_echo "$gl_cv_func_getcwd_path_max" >&6; }
88b48903 18525
6ec2e0f5
SDJ
18526 case "$gl_cv_func_getcwd_null" in
18527 *yes)
88b48903
WN
18528
18529
472fa5ee
SM
18530
18531
18532
472fa5ee 18533
c0c3707f
CB
18534 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
18535$as_echo_n "checking for getpagesize... " >&6; }
18536if ${gl_cv_func_getpagesize+:} false; then :
18537 $as_echo_n "(cached) " >&6
18538else
18539 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18540/* end confdefs.h. */
18541#include <unistd.h>
18542int
18543main ()
18544{
18545return getpagesize();
18546 ;
18547 return 0;
18548}
472fa5ee 18549
c0c3707f
CB
18550_ACEOF
18551if ac_fn_c_try_link "$LINENO"; then :
18552 gl_cv_func_getpagesize=yes
18553else
18554 gl_cv_func_getpagesize=no
18555fi
18556rm -f core conftest.err conftest.$ac_objext \
18557 conftest$ac_exeext conftest.$ac_ext
472fa5ee 18558
c0c3707f
CB
18559fi
18560{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
18561$as_echo "$gl_cv_func_getpagesize" >&6; }
88b48903 18562
c0c3707f 18563 if test $gl_cv_func_getpagesize = yes; then
88b48903 18564
c0c3707f 18565cat >>confdefs.h <<_ACEOF
7a6dbc2f
SDJ
18566#define HAVE_GETPAGESIZE 1
18567_ACEOF
18568
c0c3707f 18569 fi
6ec2e0f5
SDJ
18570
18571 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5
18572$as_echo_n "checking whether getcwd aborts when 4k < cwd_length < 16k... " >&6; }
d0ac1c44 18573if ${gl_cv_func_getcwd_abort_bug+:} false; then :
88b48903
WN
18574 $as_echo_n "(cached) " >&6
18575else
6ec2e0f5
SDJ
18576 # Remove any remnants of a previous test.
18577 rm -rf confdir-14B---
18578 # Arrange for deletion of the temporary directory this test creates.
18579 ac_clean_files="$ac_clean_files confdir-14B---"
18580 if test "$cross_compiling" = yes; then :
c0c3707f
CB
18581 case "$host_os" in
18582 # Guess no on musl systems.
18583 *-musl*) gl_cv_func_getcwd_abort_bug="guessing no" ;;
18584 # Guess yes otherwise, even on glibc systems.
18585 *) gl_cv_func_getcwd_abort_bug="guessing yes"
18586 esac
18587
88b48903
WN
18588else
18589 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18590/* end confdefs.h. */
6ec2e0f5
SDJ
18591
18592#include <errno.h>
18593#include <stdlib.h>
18594#if HAVE_UNISTD_H
18595# include <unistd.h>
18596#else /* on Windows with MSVC */
18597# include <direct.h>
18598#endif
18599#include <string.h>
18600#include <sys/stat.h>
18601
18602
18603/* Arrange to define PATH_MAX, like "pathmax.h" does. */
18604#if HAVE_UNISTD_H
18605# include <unistd.h>
18606#endif
18607#include <limits.h>
18608#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
18609# include <sys/param.h>
18610#endif
18611#if !defined PATH_MAX && defined MAXPATHLEN
18612# define PATH_MAX MAXPATHLEN
18613#endif
18614#ifdef __hpux
18615# undef PATH_MAX
18616# define PATH_MAX 1024
18617#endif
c0c3707f 18618#if defined _WIN32 && ! defined __CYGWIN__
6ec2e0f5
SDJ
18619# undef PATH_MAX
18620# define PATH_MAX 260
18621#endif
18622
18623
18624/* Don't get link errors because mkdir is redefined to rpl_mkdir. */
18625#undef mkdir
18626
18627#ifndef S_IRWXU
18628# define S_IRWXU 0700
18629#endif
18630
18631/* FIXME: skip the run-test altogether on systems without getpagesize. */
18632#if ! HAVE_GETPAGESIZE
18633# define getpagesize() 0
18634#endif
18635
18636/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
18637 the 16kB pagesize on ia64 linux. Those conditions make the code below
18638 trigger a bug in glibc's getcwd implementation before 2.4.90-10. */
18639#define TARGET_LEN (5 * 1024)
88b48903
WN
18640
18641int
18642main ()
18643{
6ec2e0f5
SDJ
18644 char *cwd;
18645 size_t initial_cwd_len;
18646 int fail = 0;
18647
18648 /* The bug is triggered when PATH_MAX < getpagesize (), so skip
18649 this relatively expensive and invasive test if that's not true. */
18650#ifdef PATH_MAX
18651 int bug_possible = PATH_MAX < getpagesize ();
18652#else
18653 int bug_possible = 0;
18654#endif
18655 if (! bug_possible)
18656 return 0;
8690e634 18657
6ec2e0f5
SDJ
18658 cwd = getcwd (NULL, 0);
18659 if (cwd == NULL)
18660 return 2;
18661
18662 initial_cwd_len = strlen (cwd);
18663 free (cwd);
18664
18665 if (1)
18666 {
18667 static char const dir_name[] = "confdir-14B---";
18668 size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
18669 / sizeof dir_name);
18670 size_t d;
18671 for (d = 0; d < desired_depth; d++)
18672 {
18673 if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
18674 {
18675 if (! (errno == ERANGE || errno == ENAMETOOLONG
18676 || errno == ENOENT))
18677 fail = 3; /* Unable to construct deep hierarchy. */
18678 break;
18679 }
18680 }
18681
18682 /* If libc has the bug in question, this invocation of getcwd
18683 results in a failed assertion. */
18684 cwd = getcwd (NULL, 0);
18685 if (cwd == NULL)
18686 fail = 4; /* getcwd didn't assert, but it failed for a long name
18687 where the answer could have been learned. */
18688 free (cwd);
18689
18690 /* Call rmdir first, in case the above chdir failed. */
18691 rmdir (dir_name);
18692 while (0 < d--)
18693 {
18694 if (chdir ("..") < 0)
18695 {
18696 fail = 5;
18697 break;
18698 }
18699 rmdir (dir_name);
18700 }
18701 }
18702
18703 return fail;
8690e634 18704}
6ec2e0f5 18705
8690e634
JK
18706_ACEOF
18707if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 18708 gl_cv_func_getcwd_abort_bug=no
8690e634 18709else
c0c3707f
CB
18710 ret=$?
18711 if test $ret -ge 128 || test $ret = 4; then
18712 gl_cv_func_getcwd_abort_bug=yes
18713 else
18714 gl_cv_func_getcwd_abort_bug=no
18715 fi
18716
8690e634
JK
18717fi
18718rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18719 conftest.$ac_objext conftest.beam conftest.$ac_ext
18720fi
18721
18722
18723fi
6ec2e0f5
SDJ
18724{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_abort_bug" >&5
18725$as_echo "$gl_cv_func_getcwd_abort_bug" >&6; }
c0c3707f
CB
18726 case "$gl_cv_func_getcwd_abort_bug" in
18727 *yes)
18728 gl_abort_bug=yes
18729 ;;
18730 *)
18731
18732 ;;
18733 esac
6ec2e0f5
SDJ
18734
18735 ;;
18736 esac
18737 ;;
18738 esac
18739 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 18740 *"no" | *"no, it has the AIX bug") ;;
6ec2e0f5
SDJ
18741 *)
18742
18743$as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h
18744
18745 ;;
18746 esac
18747 case "$gl_cv_func_getcwd_path_max" in
c0c3707f 18748 *"no, but it is partly working")
6ec2e0f5
SDJ
18749
18750$as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h
18751
18752 ;;
c0c3707f 18753 *"yes, but with shorter paths")
6ec2e0f5
SDJ
18754
18755$as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h
18756
18757 ;;
18758 esac
18759
18760 if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
18761 || test $gl_cv_func_getcwd_posix_signature != yes \
18762 || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \
18763 || test $gl_abort_bug = yes; then
18764 REPLACE_GETCWD=1
8690e634
JK
18765 fi
18766
6ec2e0f5 18767 if test $REPLACE_GETCWD = 1; then
8690e634
JK
18768
18769
8690e634
JK
18770
18771
18772
18773
18774
18775
6ec2e0f5 18776 gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext"
8690e634
JK
18777
18778
8690e634
JK
18779
18780
6ec2e0f5
SDJ
18781 :
18782
18783 fi
18784
8690e634
JK
18785
18786cat >>confdefs.h <<_ACEOF
6ec2e0f5 18787#define GNULIB_GETCWD 1
8690e634
JK
18788_ACEOF
18789
18790
8690e634 18791
8690e634
JK
18792
18793
c971b7fa 18794
c971b7fa 18795
6ec2e0f5
SDJ
18796 GNULIB_GETCWD=1
18797
18798
18799
18800
18801
18802$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
18803
c971b7fa 18804
c971b7fa 18805
c971b7fa 18806
c971b7fa 18807
c971b7fa 18808
c971b7fa 18809
c971b7fa 18810
6ec2e0f5
SDJ
18811 case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
18812 *yes,yes) ;;
18813 *)
18814 REPLACE_GETCWD=1
18815 ;;
18816 esac
c971b7fa 18817
6ec2e0f5 18818 if test $REPLACE_GETCWD = 1; then
c971b7fa 18819
c971b7fa
PA
18820
18821
c971b7fa
PA
18822
18823
c971b7fa 18824
c971b7fa 18825
c971b7fa 18826
6ec2e0f5 18827 gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext"
c971b7fa 18828
6ec2e0f5 18829 fi
c971b7fa 18830
c971b7fa 18831
c971b7fa 18832
c971b7fa 18833
8690e634 18834
6ec2e0f5 18835 GNULIB_GETCWD=1
c971b7fa 18836
88b48903
WN
18837
18838
18839
88b48903 18840
6ec2e0f5 18841$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
88b48903 18842
88b48903
WN
18843
18844
18845
6ec2e0f5
SDJ
18846
18847
18848
18849
18850 if test $ac_cv_func_getdtablesize = yes &&
18851 test $ac_cv_have_decl_getdtablesize = yes; then
6ec2e0f5
SDJ
18852 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
18853$as_echo_n "checking whether getdtablesize works... " >&6; }
d0ac1c44 18854if ${gl_cv_func_getdtablesize_works+:} false; then :
88b48903
WN
18855 $as_echo_n "(cached) " >&6
18856else
c0c3707f
CB
18857 case "$host_os" in
18858 vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
18859 *)
18860 if test "$cross_compiling" = yes; then :
88b48903 18861 case "$host_os" in
c0c3707f
CB
18862 cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
18863 gl_cv_func_getdtablesize_works="guessing no" ;;
18864 *) gl_cv_func_getdtablesize_works="guessing yes" ;;
18865 esac
18866
88b48903
WN
18867else
18868 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18869/* end confdefs.h. */
18870
c0c3707f 18871 #include <unistd.h>
6ec2e0f5
SDJ
18872int
18873main ()
88b48903 18874{
6ec2e0f5 18875int size = getdtablesize();
c0c3707f
CB
18876 if (dup2 (0, getdtablesize()) != -1)
18877 return 1;
18878 if (size != getdtablesize())
18879 return 2;
6ec2e0f5
SDJ
18880
18881 ;
18882 return 0;
88b48903
WN
18883}
18884_ACEOF
18885if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 18886 gl_cv_func_getdtablesize_works=yes
88b48903 18887else
6ec2e0f5 18888 gl_cv_func_getdtablesize_works=no
88b48903
WN
18889fi
18890rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18891 conftest.$ac_objext conftest.beam conftest.$ac_ext
18892fi
18893
c0c3707f
CB
18894 ;;
18895 esac
88b48903
WN
18896
18897fi
6ec2e0f5
SDJ
18898{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
18899$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
18900 case "$gl_cv_func_getdtablesize_works" in
c0c3707f 18901 *yes | "no (limitation)") ;;
6ec2e0f5 18902 *) REPLACE_GETDTABLESIZE=1 ;;
88b48903
WN
18903 esac
18904 else
6ec2e0f5 18905 HAVE_GETDTABLESIZE=0
88b48903
WN
18906 fi
18907
6ec2e0f5 18908 if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
88b48903
WN
18909
18910
18911
18912
18913
18914
18915
18916
6ec2e0f5 18917 gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext"
88b48903 18918
6ec2e0f5 18919 :
88b48903
WN
18920 fi
18921
18922
18923
18924
18925
6ec2e0f5 18926 GNULIB_GETDTABLESIZE=1
88b48903
WN
18927
18928
18929
88b48903 18930
88b48903 18931
6ec2e0f5 18932$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
88b48903 18933
88b48903 18934
88b48903 18935
88b48903 18936
88b48903 18937
88b48903 18938
88b48903 18939
88b48903
WN
18940
18941
6ec2e0f5
SDJ
18942 if test $ac_cv_have_decl_getlogin_r = no; then
18943 HAVE_DECL_GETLOGIN_R=0
18944 fi
88b48903 18945
88b48903 18946
6ec2e0f5
SDJ
18947 if test $ac_cv_func_getlogin_r = no; then
18948 HAVE_GETLOGIN_R=0
18949 else
18950 HAVE_GETLOGIN_R=1
18951
18952 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getlogin_r works with small buffers" >&5
18953$as_echo_n "checking whether getlogin_r works with small buffers... " >&6; }
d0ac1c44 18954if ${gl_cv_func_getlogin_r_works+:} false; then :
6ec2e0f5
SDJ
18955 $as_echo_n "(cached) " >&6
18956else
88b48903 18957
6ec2e0f5 18958 case "$host_os" in
c0c3707f
CB
18959 # Guess no on Mac OS X, OSF/1.
18960 darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;;
18961 # Guess yes otherwise.
18962 *) gl_cv_func_getlogin_r_works="guessing yes" ;;
6ec2e0f5
SDJ
18963 esac
18964 if test "$cross_compiling" = yes; then :
18965 :
88b48903
WN
18966else
18967 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18968/* end confdefs.h. */
18969
6ec2e0f5 18970#include <stddef.h>
c0c3707f 18971#include <string.h>
6ec2e0f5
SDJ
18972#include <unistd.h>
18973#if !HAVE_DECL_GETLOGIN_R
88b48903 18974extern
6ec2e0f5 18975# ifdef __cplusplus
88b48903 18976"C"
6ec2e0f5
SDJ
18977# endif
18978int getlogin_r (char *, size_t);
88b48903 18979#endif
6ec2e0f5
SDJ
18980int
18981main (void)
88b48903
WN
18982{
18983 int result = 0;
6ec2e0f5
SDJ
18984 char buf[100];
18985
18986 if (getlogin_r (buf, 0) == 0)
c0c3707f 18987 result |= 1;
6ec2e0f5 18988 if (getlogin_r (buf, 1) == 0)
c0c3707f
CB
18989 result |= 2;
18990 if (getlogin_r (buf, 100) == 0)
18991 {
18992 size_t n = strlen (buf);
18993 if (getlogin_r (buf, n) == 0)
18994 result |= 4;
18995 }
88b48903
WN
18996 return result;
18997}
18998_ACEOF
18999if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 19000 gl_cv_func_getlogin_r_works=yes
88b48903 19001else
c0c3707f 19002 gl_cv_func_getlogin_r_works=no
88b48903
WN
19003fi
19004rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19005 conftest.$ac_objext conftest.beam conftest.$ac_ext
19006fi
19007
19008
4a626d0a 19009fi
6ec2e0f5
SDJ
19010{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getlogin_r_works" >&5
19011$as_echo "$gl_cv_func_getlogin_r_works" >&6; }
19012 case "$gl_cv_func_getlogin_r_works" in
19013 *yes) ;;
19014 *) REPLACE_GETLOGIN_R=1 ;;
19015 esac
19016 fi
19017
19018 if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then
19019
19020
19021
19022
19023
19024
19025
19026
19027 gl_LIBOBJS="$gl_LIBOBJS getlogin_r.$ac_objext"
4a626d0a 19028
4a626d0a 19029
4a626d0a 19030
4a626d0a 19031
4a626d0a
PA
19032 fi
19033
19034
4a626d0a
PA
19035
19036
19037
6ec2e0f5 19038 GNULIB_GETLOGIN_R=1
4a626d0a
PA
19039
19040
19041
19042
19043
6ec2e0f5 19044$as_echo "#define GNULIB_TEST_GETLOGIN_R 1" >>confdefs.h
4a626d0a 19045
4a626d0a
PA
19046
19047
19048
19049
472fa5ee 19050
4a626d0a 19051
6ec2e0f5
SDJ
19052 ac_found=0
19053 ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
19054"
d0ac1c44 19055if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
6ec2e0f5
SDJ
19056 ac_have_decl=1
19057else
19058 ac_have_decl=0
19059fi
19060
19061cat >>confdefs.h <<_ACEOF
19062#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
19063_ACEOF
19064if test $ac_have_decl = 1; then :
19065 ac_found=1
19066fi
19067
19068 ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
19069"
d0ac1c44 19070if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
6ec2e0f5
SDJ
19071 ac_have_decl=1
19072else
19073 ac_have_decl=0
19074fi
19075
19076cat >>confdefs.h <<_ACEOF
19077#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
19078_ACEOF
19079if test $ac_have_decl = 1; then :
19080 ac_found=1
19081fi
4a626d0a 19082
6ec2e0f5
SDJ
19083 ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
19084"
d0ac1c44 19085if test "x$ac_cv_have_decl___argv" = xyes; then :
6ec2e0f5
SDJ
19086 ac_have_decl=1
19087else
19088 ac_have_decl=0
19089fi
4a626d0a 19090
6ec2e0f5
SDJ
19091cat >>confdefs.h <<_ACEOF
19092#define HAVE_DECL___ARGV $ac_have_decl
19093_ACEOF
19094if test $ac_have_decl = 1; then :
19095 ac_found=1
19096fi
4a626d0a
PA
19097
19098
6ec2e0f5
SDJ
19099 # Incur the cost of this test only if none of the above worked.
19100 if test $ac_found = 0; then
19101 # On OpenBSD 5.1, using the global __progname variable appears to be
19102 # the only way to implement getprogname.
19103 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
19104$as_echo_n "checking whether __progname is defined in default libraries... " >&6; }
d0ac1c44 19105if ${gl_cv_var___progname+:} false; then :
6ec2e0f5
SDJ
19106 $as_echo_n "(cached) " >&6
19107else
4a626d0a 19108
6ec2e0f5
SDJ
19109 gl_cv_var___progname=
19110 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19111/* end confdefs.h. */
19112extern char *__progname;
19113int
19114main ()
19115{
19116return *__progname;
19117
19118 ;
19119 return 0;
19120}
19121_ACEOF
19122if ac_fn_c_try_link "$LINENO"; then :
19123 gl_cv_var___progname=yes
19124
19125fi
19126rm -f core conftest.err conftest.$ac_objext \
19127 conftest$ac_exeext conftest.$ac_ext
19128
19129
19130fi
19131{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
19132$as_echo "$gl_cv_var___progname" >&6; }
19133 if test "$gl_cv_var___progname" = yes; then
19134
19135$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
19136
19137 fi
19138 fi
4a626d0a
PA
19139
19140
19141
19142
19143
19144
19145
19146
472fa5ee 19147
4a626d0a
PA
19148
19149 gl_gettimeofday_timezone=void
19150 if test $ac_cv_func_gettimeofday != yes; then
19151 HAVE_GETTIMEOFDAY=0
19152 else
19153
19154
19155
c0c3707f 19156
4a626d0a
PA
19157 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
19158$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
d0ac1c44 19159if ${gl_cv_func_gettimeofday_clobber+:} false; then :
4a626d0a
PA
19160 $as_echo_n "(cached) " >&6
19161else
19162 if test "$cross_compiling" = yes; then :
19163 # When cross-compiling:
19164 case "$host_os" in
c0c3707f
CB
19165 # Guess all is fine on glibc systems.
19166 *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
19167 # Guess all is fine on musl systems.
19168 *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
19169 # Guess no on native Windows.
19170 mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
19171 # If we don't know, obey --enable-cross-guesses.
19172 *) gl_cv_func_gettimeofday_clobber="$gl_cross_guess_inverted" ;;
4a626d0a
PA
19173 esac
19174
19175else
19176 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19177/* end confdefs.h. */
19178#include <string.h>
19179 #include <sys/time.h>
19180 #include <time.h>
19181 #include <stdlib.h>
19182
19183int
19184main ()
19185{
19186
19187 time_t t = 0;
19188 struct tm *lt;
19189 struct tm saved_lt;
19190 struct timeval tv;
19191 lt = localtime (&t);
19192 saved_lt = *lt;
19193 gettimeofday (&tv, NULL);
19194 return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
19195
19196 ;
19197 return 0;
19198}
19199_ACEOF
19200if ac_fn_c_try_run "$LINENO"; then :
19201 gl_cv_func_gettimeofday_clobber=no
19202else
19203 gl_cv_func_gettimeofday_clobber=yes
19204fi
19205rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19206 conftest.$ac_objext conftest.beam conftest.$ac_ext
19207fi
19208
19209fi
19210{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5
19211$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
19212
19213 case "$gl_cv_func_gettimeofday_clobber" in
19214 *yes)
19215 REPLACE_GETTIMEOFDAY=1
19216
c0c3707f 19217$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
4a626d0a 19218
5e8754f9 19219
c0c3707f
CB
19220
19221
19222 NEED_LOCALTIME_BUFFER=1
19223 REPLACE_GMTIME=1
19224 REPLACE_LOCALTIME=1
5e8754f9 19225
4a626d0a
PA
19226 ;;
19227 esac
19228
19229 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
19230$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
d0ac1c44 19231if ${gl_cv_func_gettimeofday_posix_signature+:} false; then :
4a626d0a
PA
19232 $as_echo_n "(cached) " >&6
19233else
19234 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19235/* end confdefs.h. */
19236#include <sys/time.h>
19237 struct timeval c;
19238 int gettimeofday (struct timeval *restrict, void *restrict);
19239
19240int
19241main ()
19242{
19243/* glibc uses struct timezone * rather than the POSIX void *
19244 if _GNU_SOURCE is defined. However, since the only portable
19245 use of gettimeofday uses NULL as the second parameter, and
19246 since the glibc definition is actually more typesafe, it is
19247 not worth wrapping this to get a compliant signature. */
19248 int (*f) (struct timeval *restrict, void *restrict)
19249 = gettimeofday;
19250 int x = f (&c, 0);
19251 return !(x | c.tv_sec | c.tv_usec);
19252
19253 ;
19254 return 0;
19255}
19256_ACEOF
19257if ac_fn_c_try_compile "$LINENO"; then :
19258 gl_cv_func_gettimeofday_posix_signature=yes
19259else
19260 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19261/* end confdefs.h. */
19262#include <sys/time.h>
19263int gettimeofday (struct timeval *restrict, struct timezone *restrict);
19264
19265int
19266main ()
19267{
19268
19269 ;
19270 return 0;
19271}
19272_ACEOF
19273if ac_fn_c_try_compile "$LINENO"; then :
19274 gl_cv_func_gettimeofday_posix_signature=almost
19275else
19276 gl_cv_func_gettimeofday_posix_signature=no
19277fi
19278rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19279fi
19280rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19281fi
19282{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
19283$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
19284 if test $gl_cv_func_gettimeofday_posix_signature = almost; then
19285 gl_gettimeofday_timezone='struct timezone'
19286 elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
19287 REPLACE_GETTIMEOFDAY=1
19288 fi
19289 if test $REPLACE_STRUCT_TIMEVAL = 1; then
19290 REPLACE_GETTIMEOFDAY=1
19291 fi
c0c3707f
CB
19292 case "$host_os" in
19293 mingw*) REPLACE_GETTIMEOFDAY=1 ;;
19294 esac
4a626d0a
PA
19295 fi
19296
19297cat >>confdefs.h <<_ACEOF
c0c3707f
CB
19298#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
19299_ACEOF
88b48903
WN
19300
19301
c0c3707f 19302 if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
88b48903 19303
6ec2e0f5 19304
6ec2e0f5 19305
6ec2e0f5 19306
6ec2e0f5 19307
6ec2e0f5
SDJ
19308
19309
6ec2e0f5 19310
c0c3707f 19311 gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
6ec2e0f5 19312
c0c3707f 19313 :
5e8754f9 19314 fi
6ec2e0f5
SDJ
19315
19316
19317
6ec2e0f5
SDJ
19318
19319
5e8754f9 19320 GNULIB_GETTIMEOFDAY=1
6ec2e0f5
SDJ
19321
19322
19323
7a6dbc2f
SDJ
19324
19325
5e8754f9 19326$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
6ec2e0f5
SDJ
19327
19328
19329
6ec2e0f5 19330
6ec2e0f5 19331
6ec2e0f5
SDJ
19332
19333
c0c3707f
CB
19334 if test $ac_cv_func_glob = no; then
19335 HAVE_GLOB=0
19336 else
19337
19338 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU glob interface version 1 or 2" >&5
19339$as_echo_n "checking for GNU glob interface version 1 or 2... " >&6; }
19340if ${gl_cv_gnu_glob_interface_version_1_2+:} false; then :
6ec2e0f5
SDJ
19341 $as_echo_n "(cached) " >&6
19342else
19343 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19344/* end confdefs.h. */
19345#include <gnu-versions.h>
c0c3707f 19346char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1];
6ec2e0f5
SDJ
19347_ACEOF
19348if ac_fn_c_try_compile "$LINENO"; then :
c0c3707f 19349 gl_cv_gnu_glob_interface_version_1_2=yes
6ec2e0f5 19350else
c0c3707f 19351 gl_cv_gnu_glob_interface_version_1_2=no
6ec2e0f5
SDJ
19352fi
19353rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19354fi
c0c3707f
CB
19355{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_gnu_glob_interface_version_1_2" >&5
19356$as_echo "$gl_cv_gnu_glob_interface_version_1_2" >&6; }
19357 if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then
19358 REPLACE_GLOB=1
6ec2e0f5 19359 fi
6ec2e0f5 19360
c0c3707f
CB
19361 if test $REPLACE_GLOB = 0; then
19362 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether glob lists broken symlinks" >&5
6ec2e0f5 19363$as_echo_n "checking whether glob lists broken symlinks... " >&6; }
d0ac1c44 19364if ${gl_cv_glob_lists_symlinks+:} false; then :
6ec2e0f5
SDJ
19365 $as_echo_n "(cached) " >&6
19366else
c0c3707f
CB
19367 if test $cross_compiling != yes; then
19368 if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
19369 gl_cv_glob_lists_symlinks=maybe
19370 else
19371 # If we can't make a symlink, then we cannot test this issue. Be
19372 # pessimistic about this.
19373 gl_cv_glob_lists_symlinks=no
19374 fi
19375 if test $gl_cv_glob_lists_symlinks = maybe; then
19376 if test "$cross_compiling" = yes; then :
19377 :
5e8754f9 19378
6ec2e0f5
SDJ
19379else
19380 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19381/* end confdefs.h. */
6ec2e0f5 19382#include <stddef.h>
c0c3707f 19383 #include <glob.h>
6ec2e0f5
SDJ
19384int
19385main ()
19386{
19387glob_t found;
c0c3707f
CB
19388 if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
19389 return 1;
19390
6ec2e0f5
SDJ
19391 ;
19392 return 0;
19393}
4a626d0a 19394_ACEOF
6ec2e0f5
SDJ
19395if ac_fn_c_try_run "$LINENO"; then :
19396 gl_cv_glob_lists_symlinks=yes
19397else
19398 gl_cv_glob_lists_symlinks=no
19399fi
19400rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19401 conftest.$ac_objext conftest.beam conftest.$ac_ext
19402fi
88b48903 19403
c0c3707f
CB
19404 fi
19405 rm -f conf$$-globtest
19406 else
19407 gl_cv_glob_lists_symlinks="$gl_cross_guess_normal"
19408 fi
19409
4a626d0a 19410fi
6ec2e0f5
SDJ
19411{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_glob_lists_symlinks" >&5
19412$as_echo "$gl_cv_glob_lists_symlinks" >&6; }
c0c3707f
CB
19413 case "$gl_cv_glob_lists_symlinks" in
19414 *yes) ;;
19415 *) REPLACE_GLOB=1 ;;
19416 esac
19417 fi
19418
19419 fi
88b48903 19420
c0c3707f
CB
19421 if test $ac_cv_func_glob_pattern_p = no; then
19422 HAVE_GLOB_PATTERN_P=0
19423 else
19424 if test $REPLACE_GLOB = 1; then
19425 REPLACE_GLOB_PATTERN_P=1
6ec2e0f5
SDJ
19426 fi
19427 fi
4a626d0a 19428
c0c3707f 19429 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
4a626d0a 19430
88b48903 19431
c0c3707f 19432 GLOB_H='glob.h'
6ec2e0f5
SDJ
19433 if test -n "$GLOB_H"; then
19434 GL_GENERATE_GLOB_H_TRUE=
19435 GL_GENERATE_GLOB_H_FALSE='#'
19436else
19437 GL_GENERATE_GLOB_H_TRUE='#'
19438 GL_GENERATE_GLOB_H_FALSE=
19439fi
88b48903 19440
88b48903 19441
c0c3707f
CB
19442 fi
19443
19444 if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
472fa5ee
SM
19445
19446
19447
19448
19449
19450
19451
19452
19453 gl_LIBOBJS="$gl_LIBOBJS glob.$ac_objext"
19454
19455
19456
7a6dbc2f
SDJ
19457
19458
19459
472fa5ee 19460
472fa5ee 19461
88b48903 19462
c0c3707f 19463 gl_LIBOBJS="$gl_LIBOBJS globfree.$ac_objext"
88b48903
WN
19464
19465
19466
725e2999
JB
19467
19468
19469
c0c3707f
CB
19470 fi
19471 if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then
19472
725e2999
JB
19473
19474
19475
19476
19477
19478
19479
c0c3707f 19480 gl_LIBOBJS="$gl_LIBOBJS glob_pattern_p.$ac_objext"
725e2999
JB
19481
19482 fi
19483
725e2999
JB
19484
19485
19486
19487
c0c3707f
CB
19488 GNULIB_GLOB=1
19489
19490
19491
19492
19493
19494$as_echo "#define GNULIB_TEST_GLOB 1" >>confdefs.h
19495
19496
725e2999
JB
19497
19498
19499
19500
725e2999
JB
19501
19502
19503
19504
725e2999 19505
c0c3707f
CB
19506 HAVE_INET_NTOP=1
19507 INET_NTOP_LIB=
725e2999
JB
19508
19509
19510
19511
19512 if test $ac_cv_header_sys_socket_h != yes; then
19513 for ac_header in winsock2.h
19514do :
19515 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
19516if test "x$ac_cv_header_winsock2_h" = xyes; then :
19517 cat >>confdefs.h <<_ACEOF
19518#define HAVE_WINSOCK2_H 1
19519_ACEOF
19520
19521fi
19522
19523done
19524
19525 fi
19526 if test "$ac_cv_header_winsock2_h" = yes; then
19527 HAVE_WINSOCK2_H=1
19528 UNISTD_H_HAVE_WINSOCK2_H=1
19529 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
19530 else
19531 HAVE_WINSOCK2_H=0
19532 fi
19533
19534
19535 if test $HAVE_WINSOCK2_H = 1; then
c0c3707f 19536 REPLACE_INET_NTOP=1
725e2999
JB
19537 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
19538"
19539if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
19540 ac_have_decl=1
19541else
19542 ac_have_decl=0
19543fi
19544
19545cat >>confdefs.h <<_ACEOF
19546#define HAVE_DECL_INET_NTOP $ac_have_decl
19547_ACEOF
19548
19549 if test $ac_cv_have_decl_inet_ntop = yes; then
725e2999
JB
19550 INET_NTOP_LIB="-lws2_32"
19551 else
19552 HAVE_DECL_INET_NTOP=0
725e2999
JB
19553 fi
19554 else
19555 gl_save_LIBS=$LIBS
19556 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
19557$as_echo_n "checking for library containing inet_ntop... " >&6; }
19558if ${ac_cv_search_inet_ntop+:} false; then :
19559 $as_echo_n "(cached) " >&6
19560else
19561 ac_func_search_save_LIBS=$LIBS
19562cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19563/* end confdefs.h. */
19564
19565/* Override any GCC internal prototype to avoid an error.
19566 Use char because int might match the return type of a GCC
19567 builtin and then its argument prototype would still apply. */
19568#ifdef __cplusplus
19569extern "C"
19570#endif
19571char inet_ntop ();
19572int
19573main ()
19574{
19575return inet_ntop ();
19576 ;
19577 return 0;
19578}
19579_ACEOF
c0c3707f 19580for ac_lib in '' nsl resolv network; do
725e2999
JB
19581 if test -z "$ac_lib"; then
19582 ac_res="none required"
19583 else
19584 ac_res=-l$ac_lib
19585 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
19586 fi
19587 if ac_fn_c_try_link "$LINENO"; then :
19588 ac_cv_search_inet_ntop=$ac_res
19589fi
19590rm -f core conftest.err conftest.$ac_objext \
19591 conftest$ac_exeext
19592 if ${ac_cv_search_inet_ntop+:} false; then :
19593 break
19594fi
19595done
19596if ${ac_cv_search_inet_ntop+:} false; then :
19597
19598else
19599 ac_cv_search_inet_ntop=no
19600fi
19601rm conftest.$ac_ext
19602LIBS=$ac_func_search_save_LIBS
19603fi
19604{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
19605$as_echo "$ac_cv_search_inet_ntop" >&6; }
19606ac_res=$ac_cv_search_inet_ntop
19607if test "$ac_res" != no; then :
19608 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
19609
19610else
19611 for ac_func in inet_ntop
19612do :
19613 ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
19614if test "x$ac_cv_func_inet_ntop" = xyes; then :
19615 cat >>confdefs.h <<_ACEOF
19616#define HAVE_INET_NTOP 1
19617_ACEOF
19618
19619fi
19620done
19621
19622 if test $ac_cv_func_inet_ntop = no; then
19623 HAVE_INET_NTOP=0
19624 fi
19625
19626fi
19627
19628 LIBS=$gl_save_LIBS
19629
19630 if test "$ac_cv_search_inet_ntop" != "no" \
19631 && test "$ac_cv_search_inet_ntop" != "none required"; then
19632 INET_NTOP_LIB="$ac_cv_search_inet_ntop"
19633 fi
19634
19635
725e2999
JB
19636 ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
19637 #if HAVE_NETDB_H
19638 # include <netdb.h>
19639 #endif
19640
19641"
19642if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
19643 ac_have_decl=1
19644else
19645 ac_have_decl=0
19646fi
19647
19648cat >>confdefs.h <<_ACEOF
19649#define HAVE_DECL_INET_NTOP $ac_have_decl
19650_ACEOF
19651
19652 if test $ac_cv_have_decl_inet_ntop = no; then
19653 HAVE_DECL_INET_NTOP=0
19654 fi
19655 fi
19656
19657
19658 if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
19659
19660
19661
19662
19663
19664
19665
7a6dbc2f 19666
725e2999 19667 gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext"
7a6dbc2f
SDJ
19668
19669
19670
7a6dbc2f 19671
725e2999 19672 fi
7a6dbc2f
SDJ
19673
19674
19675
19676
7a6dbc2f 19677
725e2999
JB
19678 GNULIB_INET_NTOP=1
19679
7a6dbc2f
SDJ
19680
19681
49e4877c
PA
19682
19683
88b48903
WN
19684
19685
19686
19687
19688 PRIPTR_PREFIX=
19689 if test -n "$STDINT_H"; then
19690 PRIPTR_PREFIX='"l"'
19691 else
19692 for glpfx in '' l ll I64; do
19693 case $glpfx in
19694 '') gltype1='int';;
19695 l) gltype1='long int';;
19696 ll) gltype1='long long int';;
19697 I64) gltype1='__int64';;
19698 esac
19699 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19700/* end confdefs.h. */
19701#include <stdint.h>
19702 extern intptr_t foo;
19703 extern $gltype1 foo;
19704int
19705main ()
19706{
19707
19708 ;
19709 return 0;
19710}
19711_ACEOF
19712if ac_fn_c_try_compile "$LINENO"; then :
19713 PRIPTR_PREFIX='"'$glpfx'"'
19714fi
19715rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19716 test -n "$PRIPTR_PREFIX" && break
19717 done
19718 fi
19719
19720
19721
19722 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
19723$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
d0ac1c44 19724if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then :
88b48903
WN
19725 $as_echo_n "(cached) " >&6
19726else
19727 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19728/* end confdefs.h. */
19729/* Work also in C++ mode. */
19730 #define __STDC_LIMIT_MACROS 1
19731
19732 /* Work if build is not clean. */
19733 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
19734
19735 #include <limits.h>
19736 #if HAVE_STDINT_H
19737 #include <stdint.h>
19738 #endif
19739
19740 #if defined INT32_MAX && defined INTMAX_MAX
19741 #define CONDITION (INT32_MAX < INTMAX_MAX)
19742 #elif HAVE_LONG_LONG_INT
19743 #define CONDITION (sizeof (int) < sizeof (long long int))
19744 #else
19745 #define CONDITION 0
19746 #endif
19747 int test[CONDITION ? 1 : -1];
19748int
19749main ()
19750{
19751
19752 ;
19753 return 0;
19754}
19755_ACEOF
19756if ac_fn_c_try_compile "$LINENO"; then :
19757 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
19758else
19759 gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
19760fi
19761rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19762fi
19763{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
19764$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
19765 if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
19766 INT32_MAX_LT_INTMAX_MAX=1;
19767 else
19768 INT32_MAX_LT_INTMAX_MAX=0;
19769 fi
19770
19771
19772 if test $APPLE_UNIVERSAL_BUILD = 0; then
19773
19774 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
19775$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; }
d0ac1c44 19776if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then :
88b48903
WN
19777 $as_echo_n "(cached) " >&6
19778else
19779 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19780/* end confdefs.h. */
19781/* Work also in C++ mode. */
19782 #define __STDC_LIMIT_MACROS 1
19783
19784 /* Work if build is not clean. */
19785 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
19786
19787 #include <limits.h>
19788 #if HAVE_STDINT_H
19789 #include <stdint.h>
19790 #endif
19791
19792 #if defined INT64_MAX
19793 #define CONDITION (INT64_MAX == LONG_MAX)
19794 #elif HAVE_LONG_LONG_INT
19795 #define CONDITION (sizeof (long long int) == sizeof (long int))
19796 #else
19797 #define CONDITION 0
19798 #endif
19799 int test[CONDITION ? 1 : -1];
19800int
19801main ()
19802{
19803
19804 ;
19805 return 0;
19806}
19807_ACEOF
19808if ac_fn_c_try_compile "$LINENO"; then :
19809 gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
19810else
19811 gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
19812fi
19813rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19814fi
19815{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
19816$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
19817 if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
19818 INT64_MAX_EQ_LONG_MAX=1;
19819 else
19820 INT64_MAX_EQ_LONG_MAX=0;
19821 fi
19822
19823
19824 else
19825 INT64_MAX_EQ_LONG_MAX=-1
19826 fi
19827
19828 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
19829$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
d0ac1c44 19830if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then :
88b48903
WN
19831 $as_echo_n "(cached) " >&6
19832else
19833 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19834/* end confdefs.h. */
19835/* Work also in C++ mode. */
19836 #define __STDC_LIMIT_MACROS 1
19837
19838 /* Work if build is not clean. */
19839 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
19840
19841 #include <limits.h>
19842 #if HAVE_STDINT_H
19843 #include <stdint.h>
19844 #endif
19845
19846 #if defined UINT32_MAX && defined UINTMAX_MAX
19847 #define CONDITION (UINT32_MAX < UINTMAX_MAX)
19848 #elif HAVE_LONG_LONG_INT
19849 #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
19850 #else
19851 #define CONDITION 0
19852 #endif
19853 int test[CONDITION ? 1 : -1];
19854int
19855main ()
19856{
19857
19858 ;
19859 return 0;
19860}
19861_ACEOF
19862if ac_fn_c_try_compile "$LINENO"; then :
19863 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
19864else
19865 gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
19866fi
19867rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19868fi
19869{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
19870$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
19871 if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
19872 UINT32_MAX_LT_UINTMAX_MAX=1;
19873 else
19874 UINT32_MAX_LT_UINTMAX_MAX=0;
19875 fi
19876
19877
19878 if test $APPLE_UNIVERSAL_BUILD = 0; then
19879
19880 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
19881$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
d0ac1c44 19882if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then :
88b48903
WN
19883 $as_echo_n "(cached) " >&6
19884else
19885 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19886/* end confdefs.h. */
19887/* Work also in C++ mode. */
19888 #define __STDC_LIMIT_MACROS 1
19889
19890 /* Work if build is not clean. */
19891 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
19892
19893 #include <limits.h>
19894 #if HAVE_STDINT_H
19895 #include <stdint.h>
19896 #endif
19897
19898 #if defined UINT64_MAX
19899 #define CONDITION (UINT64_MAX == ULONG_MAX)
19900 #elif HAVE_LONG_LONG_INT
19901 #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
19902 #else
19903 #define CONDITION 0
19904 #endif
19905 int test[CONDITION ? 1 : -1];
19906int
19907main ()
19908{
19909
19910 ;
19911 return 0;
19912}
19913_ACEOF
19914if ac_fn_c_try_compile "$LINENO"; then :
19915 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
19916else
19917 gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
19918fi
19919rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19920fi
19921{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
19922$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
19923 if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
19924 UINT64_MAX_EQ_ULONG_MAX=1;
19925 else
19926 UINT64_MAX_EQ_ULONG_MAX=0;
19927 fi
19928
19929
19930 else
19931 UINT64_MAX_EQ_ULONG_MAX=-1
19932 fi
19933
19934
19935
19936
19937
19938 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
19939$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
d0ac1c44 19940if ${gl_cv_func_isnand_no_libm+:} false; then :
88b48903
WN
19941 $as_echo_n "(cached) " >&6
19942else
19943
19944 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19945/* end confdefs.h. */
19946#include <math.h>
19947 #if __GNUC__ >= 4
19948 # undef isnand
19949 # define isnand(x) __builtin_isnan ((double)(x))
19950 #else
19951 # undef isnand
19952 # define isnand(x) isnan ((double)(x))
19953 #endif
19954 double x;
19955int
19956main ()
19957{
19958return isnand (x);
19959 ;
19960 return 0;
19961}
19962_ACEOF
19963if ac_fn_c_try_link "$LINENO"; then :
19964 gl_cv_func_isnand_no_libm=yes
19965else
19966 gl_cv_func_isnand_no_libm=no
19967fi
19968rm -f core conftest.err conftest.$ac_objext \
19969 conftest$ac_exeext conftest.$ac_ext
19970
19971fi
19972{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
19973$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
19974
19975 gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
19976 if test $gl_cv_func_isnand_no_libm = yes; then
19977
19978$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
19979
19980 fi
19981
19982 if test $gl_func_isnand_no_libm != yes; then
19983
19984
19985
19986
19987
19988
19989
19990
19991 gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext"
19992
19993
19994
19995
19996 fi
19997
19998
19999 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
20000$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; }
d0ac1c44 20001if ${gl_cv_func_isnanl_no_libm+:} false; then :
88b48903
WN
20002 $as_echo_n "(cached) " >&6
20003else
20004
20005 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20006/* end confdefs.h. */
20007#include <math.h>
20008 #if __GNUC__ >= 4
20009 # undef isnanl
20010 # define isnanl(x) __builtin_isnanl ((long double)(x))
20011 #elif defined isnan
20012 # undef isnanl
20013 # define isnanl(x) isnan ((long double)(x))
20014 #endif
20015 long double x;
20016int
20017main ()
20018{
20019return isnanl (x);
20020 ;
20021 return 0;
20022}
20023_ACEOF
20024if ac_fn_c_try_link "$LINENO"; then :
20025 gl_cv_func_isnanl_no_libm=yes
20026else
20027 gl_cv_func_isnanl_no_libm=no
20028fi
20029rm -f core conftest.err conftest.$ac_objext \
20030 conftest$ac_exeext conftest.$ac_ext
20031
20032fi
20033{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5
20034$as_echo "$gl_cv_func_isnanl_no_libm" >&6; }
20035
20036 gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
20037 if test $gl_func_isnanl_no_libm = yes; then
20038
20039
20040
20041
20042 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
20043$as_echo_n "checking whether isnanl works... " >&6; }
d0ac1c44 20044if ${gl_cv_func_isnanl_works+:} false; then :
88b48903
WN
20045 $as_echo_n "(cached) " >&6
20046else
20047
20048 if test "$cross_compiling" = yes; then :
c0c3707f
CB
20049 case "$host_os" in
20050 mingw*) # Guess yes on mingw, no on MSVC.
20051 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20052/* end confdefs.h. */
20053
20054#ifdef __MINGW32__
20055 Known
20056#endif
20057
20058_ACEOF
20059if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20060 $EGREP "Known" >/dev/null 2>&1; then :
4a626d0a 20061 gl_cv_func_isnanl_works="guessing yes"
c0c3707f
CB
20062else
20063 gl_cv_func_isnanl_works="guessing no"
20064fi
20065rm -f conftest*
20066
20067 ;;
20068 *) gl_cv_func_isnanl_works="guessing yes" ;;
20069 esac
20070
88b48903
WN
20071else
20072 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20073/* end confdefs.h. */
20074
20075#include <float.h>
20076#include <limits.h>
20077#include <math.h>
20078#if __GNUC__ >= 4
20079# undef isnanl
20080# define isnanl(x) __builtin_isnanl ((long double)(x))
20081#elif defined isnan
20082# undef isnanl
20083# define isnanl(x) isnan ((long double)(x))
20084#endif
20085#define NWORDS \
20086 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
20087typedef union { unsigned int word[NWORDS]; long double value; }
20088 memory_long_double;
20089/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
20090 runtime type conversion. */
20091#ifdef __sgi
20092static long double NaNl ()
20093{
20094 double zero = 0.0;
20095 return zero / zero;
20096}
20097#else
20098# define NaNl() (0.0L / 0.0L)
20099#endif
20100int main ()
20101{
20102 int result = 0;
20103
20104 if (!isnanl (NaNl ()))
20105 result |= 1;
20106
20107 {
20108 memory_long_double m;
20109 unsigned int i;
20110
20111 /* The isnanl function should be immune against changes in the sign bit and
20112 in the mantissa bits. The xor operation twiddles a bit that can only be
20113 a sign bit or a mantissa bit (since the exponent never extends to
20114 bit 31). */
20115 m.value = NaNl ();
20116 m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
20117 for (i = 0; i < NWORDS; i++)
20118 m.word[i] |= 1;
20119 if (!isnanl (m.value))
20120 result |= 1;
20121 }
20122
20123#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
20124/* Representation of an 80-bit 'long double' as an initializer for a sequence
20125 of 'unsigned int' words. */
20126# ifdef WORDS_BIGENDIAN
20127# define LDBL80_WORDS(exponent,manthi,mantlo) \
20128 { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
4a626d0a 20129 ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
88b48903
WN
20130 (unsigned int) (mantlo) << 16 \
20131 }
20132# else
20133# define LDBL80_WORDS(exponent,manthi,mantlo) \
20134 { mantlo, manthi, exponent }
20135# endif
20136 { /* Quiet NaN. */
20137 static memory_long_double x =
20138 { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
20139 if (!isnanl (x.value))
20140 result |= 2;
20141 }
20142 {
20143 /* Signalling NaN. */
20144 static memory_long_double x =
20145 { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
20146 if (!isnanl (x.value))
20147 result |= 2;
20148 }
4a626d0a 20149 /* isnanl should return something even for noncanonical values. */
88b48903
WN
20150 { /* Pseudo-NaN. */
20151 static memory_long_double x =
20152 { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
4a626d0a 20153 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
20154 result |= 4;
20155 }
20156 { /* Pseudo-Infinity. */
20157 static memory_long_double x =
20158 { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
4a626d0a 20159 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
20160 result |= 8;
20161 }
20162 { /* Pseudo-Zero. */
20163 static memory_long_double x =
20164 { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
4a626d0a 20165 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
20166 result |= 16;
20167 }
20168 { /* Unnormalized number. */
20169 static memory_long_double x =
20170 { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
4a626d0a 20171 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
20172 result |= 32;
20173 }
20174 { /* Pseudo-Denormal. */
20175 static memory_long_double x =
20176 { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
4a626d0a 20177 if (isnanl (x.value) && !isnanl (x.value))
88b48903
WN
20178 result |= 64;
20179 }
20180#endif
20181
20182 return result;
20183}
20184_ACEOF
20185if ac_fn_c_try_run "$LINENO"; then :
20186 gl_cv_func_isnanl_works=yes
20187else
20188 gl_cv_func_isnanl_works=no
20189fi
20190rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20191 conftest.$ac_objext conftest.beam conftest.$ac_ext
20192fi
20193
20194
20195fi
20196{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5
20197$as_echo "$gl_cv_func_isnanl_works" >&6; }
20198
20199 case "$gl_cv_func_isnanl_works" in
20200 *yes) ;;
20201 *) gl_func_isnanl_no_libm=no ;;
20202 esac
20203 fi
20204 if test $gl_func_isnanl_no_libm = yes; then
20205
20206$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
20207
20208 fi
20209
20210 if test $gl_func_isnanl_no_libm != yes; then
20211
20212
20213
20214
20215
20216
20217
20218
20219 gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext"
20220
20221
20222
20223
c0c3707f 20224 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
88b48903 20225$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
d0ac1c44 20226if ${gl_cv_cc_long_double_expbit0+:} false; then :
88b48903
WN
20227 $as_echo_n "(cached) " >&6
20228else
20229
20230 if test "$cross_compiling" = yes; then :
20231
20232 gl_cv_cc_long_double_expbit0="unknown"
c0c3707f
CB
20233 case "$host_os" in
20234 mingw*) # On native Windows (little-endian), we know the result
20235 # in two cases: mingw, MSVC.
20236 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20237/* end confdefs.h. */
20238
20239#ifdef __MINGW32__
20240 Known
20241#endif
20242
20243_ACEOF
20244if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20245 $EGREP "Known" >/dev/null 2>&1; then :
20246 gl_cv_cc_long_double_expbit0="word 2 bit 0"
20247fi
20248rm -f conftest*
20249
20250 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20251/* end confdefs.h. */
20252
20253#ifdef _MSC_VER
20254 Known
20255#endif
20256
20257_ACEOF
20258if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20259 $EGREP "Known" >/dev/null 2>&1; then :
20260 gl_cv_cc_long_double_expbit0="word 1 bit 20"
20261fi
20262rm -f conftest*
20263
20264 ;;
20265 esac
88b48903
WN
20266
20267else
20268 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20269/* end confdefs.h. */
20270
20271#include <float.h>
20272#include <stddef.h>
20273#include <stdio.h>
20274#include <string.h>
20275#define NWORDS \
20276 ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
20277typedef union { long double value; unsigned int word[NWORDS]; }
20278 memory_long_double;
20279static unsigned int ored_words[NWORDS];
20280static unsigned int anded_words[NWORDS];
20281static void add_to_ored_words (long double x)
20282{
20283 memory_long_double m;
20284 size_t i;
20285 /* Clear it first, in case
20286 sizeof (long double) < sizeof (memory_long_double). */
20287 memset (&m, 0, sizeof (memory_long_double));
20288 m.value = x;
20289 for (i = 0; i < NWORDS; i++)
20290 {
20291 ored_words[i] |= m.word[i];
20292 anded_words[i] &= m.word[i];
20293 }
20294}
20295int main ()
20296{
20297 size_t j;
20298 FILE *fp = fopen ("conftest.out", "w");
20299 if (fp == NULL)
20300 return 1;
20301 for (j = 0; j < NWORDS; j++)
20302 anded_words[j] = ~ (unsigned int) 0;
20303 add_to_ored_words (0.25L);
20304 add_to_ored_words (0.5L);
20305 add_to_ored_words (1.0L);
20306 add_to_ored_words (2.0L);
20307 add_to_ored_words (4.0L);
20308 /* Remove bits that are common (e.g. if representation of the first mantissa
20309 bit is explicit). */
20310 for (j = 0; j < NWORDS; j++)
20311 ored_words[j] &= ~anded_words[j];
20312 /* Now find the nonzero word. */
20313 for (j = 0; j < NWORDS; j++)
20314 if (ored_words[j] != 0)
20315 break;
20316 if (j < NWORDS)
20317 {
20318 size_t i;
20319 for (i = j + 1; i < NWORDS; i++)
20320 if (ored_words[i] != 0)
20321 {
20322 fprintf (fp, "unknown");
20323 return (fclose (fp) != 0);
20324 }
20325 for (i = 0; ; i++)
20326 if ((ored_words[j] >> i) & 1)
20327 {
20328 fprintf (fp, "word %d bit %d", (int) j, (int) i);
20329 return (fclose (fp) != 0);
20330 }
20331 }
20332 fprintf (fp, "unknown");
20333 return (fclose (fp) != 0);
20334}
20335
20336_ACEOF
20337if ac_fn_c_try_run "$LINENO"; then :
20338 gl_cv_cc_long_double_expbit0=`cat conftest.out`
20339else
20340 gl_cv_cc_long_double_expbit0="unknown"
20341fi
20342rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20343 conftest.$ac_objext conftest.beam conftest.$ac_ext
20344fi
20345
20346 rm -f conftest.out
20347
20348fi
20349{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
20350$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
20351 case "$gl_cv_cc_long_double_expbit0" in
20352 word*bit*)
20353 word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
20354 bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
20355
20356cat >>confdefs.h <<_ACEOF
20357#define LDBL_EXPBIT0_WORD $word
20358_ACEOF
20359
20360
20361cat >>confdefs.h <<_ACEOF
20362#define LDBL_EXPBIT0_BIT $bit
20363_ACEOF
20364
20365 ;;
20366 esac
20367
20368
20369
20370 fi
20371
20372
c0c3707f
CB
20373 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5
20374$as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; }
20375if ${gl_cv_c___inline+:} false; then :
20376 $as_echo_n "(cached) " >&6
20377else
20378 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20379/* end confdefs.h. */
20380typedef int foo_t;
20381 static __inline foo_t foo (void) { return 0; }
20382int
20383main ()
20384{
20385return foo ();
20386 ;
20387 return 0;
20388}
20389_ACEOF
20390if ac_fn_c_try_compile "$LINENO"; then :
20391 gl_cv_c___inline=yes
20392else
20393 gl_cv_c___inline=no
20394fi
20395rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20396fi
20397{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5
20398$as_echo "$gl_cv_c___inline" >&6; }
20399 if test $gl_cv_c___inline = yes; then
20400
20401$as_echo "#define HAVE___INLINE 1" >>confdefs.h
20402
20403 fi
88b48903
WN
20404
20405
88b48903
WN
20406
20407
472fa5ee 20408
c0c3707f 20409 LOCALCHARSET_TESTS_ENVIRONMENT=
472fa5ee
SM
20410
20411
20412
20413
88b48903
WN
20414
20415
2196f55f 20416
49e4877c 20417
c0c3707f
CB
20418
20419
20420 gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext"
88b48903
WN
20421
20422
20423
5abebf3c
CB
20424 if test "$gl_threads_api" = posix; then
20425 # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
20426 # pthread_rwlock_* functions.
c0c3707f 20427 has_rwlock=false
5abebf3c
CB
20428 ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
20429"
20430if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
c0c3707f 20431 has_rwlock=true
5abebf3c
CB
20432
20433$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
20434
20435fi
20436
c0c3707f
CB
20437 if $has_rwlock; then
20438
20439
20440 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5
20441$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; }
20442if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then :
20443 $as_echo_n "(cached) " >&6
20444else
20445 save_LIBS="$LIBS"
20446 LIBS="$LIBS $LIBMULTITHREAD"
20447 if test "$cross_compiling" = yes; then :
20448 case "$host_os" in
20449 # Guess no on glibc systems.
20450 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
20451 # Guess no on musl systems.
20452 *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
20453 # Guess no on bionic systems.
20454 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
20455 # Guess yes on native Windows with the mingw-w64 winpthreads library.
20456 # Guess no on native Windows with the gnulib windows-rwlock module.
20457 mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
20458 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
20459 else
20460 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
20461 fi
20462 ;;
20463 # If we don't know, obey --enable-cross-guesses.
20464 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
20465 esac
20466
20467else
20468 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20469/* end confdefs.h. */
20470
20471#include <errno.h>
20472#include <pthread.h>
20473#include <stdlib.h>
20474#include <unistd.h>
20475
20476#define SUCCEED() exit (0)
20477#define FAILURE() exit (1)
20478#define UNEXPECTED(n) (exit (10 + (n)))
20479
20480/* The main thread creates the waiting writer and the requesting reader threads
20481 in the default way; this guarantees that they have the same priority.
20482 We can reuse the main thread as first reader thread. */
20483
20484static pthread_rwlock_t lock;
20485static pthread_t reader1;
20486static pthread_t writer;
20487static pthread_t reader2;
20488static pthread_t timer;
20489/* Used to pass control from writer to reader2 and from reader2 to timer,
20490 as in a relay race.
20491 Passing control from one running thread to another running thread
20492 is most likely faster than to create the second thread. */
20493static pthread_mutex_t baton;
20494
20495static void *
20496timer_func (void *ignored)
20497{
20498 /* Step 13 (can be before or after step 12):
20499 The timer thread takes the baton, then waits a moment to make sure
20500 it can tell whether the second reader thread is blocked at step 12. */
20501 if (pthread_mutex_lock (&baton))
20502 UNEXPECTED (13);
20503 usleep (100000);
20504 /* By the time we get here, it's clear that the second reader thread is
20505 blocked at step 12. This is the desired behaviour. */
20506 SUCCEED ();
20507}
20508
20509static void *
20510reader2_func (void *ignored)
20511{
20512 int err;
20513
20514 /* Step 8 (can be before or after step 7):
20515 The second reader thread takes the baton, then waits a moment to make sure
20516 the writer thread has reached step 7. */
20517 if (pthread_mutex_lock (&baton))
20518 UNEXPECTED (8);
20519 usleep (100000);
20520 /* Step 9: The second reader thread requests the lock. */
20521 err = pthread_rwlock_tryrdlock (&lock);
20522 if (err == 0)
20523 FAILURE ();
20524 else if (err != EBUSY)
20525 UNEXPECTED (9);
20526 /* Step 10: Launch a timer, to test whether the next call blocks. */
20527 if (pthread_create (&timer, NULL, timer_func, NULL))
20528 UNEXPECTED (10);
20529 /* Step 11: Release the baton. */
20530 if (pthread_mutex_unlock (&baton))
20531 UNEXPECTED (11);
20532 /* Step 12: The second reader thread requests the lock. */
20533 err = pthread_rwlock_rdlock (&lock);
20534 if (err == 0)
20535 FAILURE ();
20536 else
20537 UNEXPECTED (12);
20538}
20539
20540static void *
20541writer_func (void *ignored)
20542{
20543 /* Step 4: Take the baton, so that the second reader thread does not go ahead
20544 too early. */
20545 if (pthread_mutex_lock (&baton))
20546 UNEXPECTED (4);
20547 /* Step 5: Create the second reader thread. */
20548 if (pthread_create (&reader2, NULL, reader2_func, NULL))
20549 UNEXPECTED (5);
20550 /* Step 6: Release the baton. */
20551 if (pthread_mutex_unlock (&baton))
20552 UNEXPECTED (6);
20553 /* Step 7: The writer thread requests the lock. */
20554 if (pthread_rwlock_wrlock (&lock))
20555 UNEXPECTED (7);
20556 return NULL;
20557}
20558
20559int
20560main ()
20561{
20562 reader1 = pthread_self ();
20563
20564 /* Step 1: The main thread initializes the lock and the baton. */
20565 if (pthread_rwlock_init (&lock, NULL))
20566 UNEXPECTED (1);
20567 if (pthread_mutex_init (&baton, NULL))
20568 UNEXPECTED (1);
20569 /* Step 2: The main thread acquires the lock as a reader. */
20570 if (pthread_rwlock_rdlock (&lock))
20571 UNEXPECTED (2);
20572 /* Step 3: Create the writer thread. */
20573 if (pthread_create (&writer, NULL, writer_func, NULL))
20574 UNEXPECTED (3);
20575 /* Job done. Go to sleep. */
20576 for (;;)
20577 {
20578 sleep (1);
20579 }
20580}
20581
20582_ACEOF
20583if ac_fn_c_try_run "$LINENO"; then :
20584 gl_cv_pthread_rwlock_rdlock_prefer_writer=yes
20585else
20586 gl_cv_pthread_rwlock_rdlock_prefer_writer=no
20587fi
20588rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20589 conftest.$ac_objext conftest.beam conftest.$ac_ext
20590fi
20591
20592 LIBS="$save_LIBS"
20593
20594fi
20595{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5
20596$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; }
20597 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
20598 *yes)
20599
20600$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h
20601
20602 ;;
20603 esac
20604
20605 fi
5abebf3c
CB
20606 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
20607 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20608/* end confdefs.h. */
20609
20610 #include <pthread.h>
20611int
20612main ()
20613{
20614
20615#if __FreeBSD__ == 4
20616error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
20617#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
20618 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
20619error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
20620#else
20621int x = (int)PTHREAD_MUTEX_RECURSIVE;
20622return !x;
20623#endif
20624
20625 ;
20626 return 0;
20627}
20628_ACEOF
20629if ac_fn_c_try_compile "$LINENO"; then :
20630
20631$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
20632
20633fi
20634rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20635 fi
20636 :
20637
20638
20639
20640cat >>confdefs.h <<_ACEOF
20641#define GNULIB_LOCK 1
20642_ACEOF
20643
20644
20645
20646
88b48903 20647
472fa5ee 20648
f45c62c4
YQ
20649 if test $ac_cv_func_lstat = yes; then
20650
c0c3707f
CB
20651 case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
20652 solaris* | *no)
f45c62c4
YQ
20653 REPLACE_LSTAT=1
20654 ;;
20655 esac
20656 else
20657 HAVE_LSTAT=0
20658 fi
20659
20660 if test $REPLACE_LSTAT = 1; then
20661
20662
20663
20664
20665
20666
20667
20668
20669 gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
20670
20671 :
20672 fi
20673
20674
20675
20676
20677
20678 GNULIB_LSTAT=1
20679
20680
20681
20682
20683
20684$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
20685
20686
20687
20688
20689
20690
6a29c58e
YQ
20691 if test $gl_cv_func_malloc_posix = yes; then
20692
20693$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
20694
20695 else
20696 REPLACE_MALLOC=1
20697 fi
20698
20699 if test $REPLACE_MALLOC = 1; then
20700
20701
20702
20703
20704
20705
20706
20707
20708 gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
20709
20710 fi
20711
20712
20713
20714
20715
20716 GNULIB_MALLOC_POSIX=1
20717
20718
20719
20720
20721
20722$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
20723
20724
20725
20726
20727
20728
88b48903
WN
20729
20730
20731
20732
20733
88b48903 20734
c971b7fa 20735
c971b7fa 20736
98399780
YQ
20737
20738
20739
20740
88b48903
WN
20741 if test $gl_cv_have_include_next = yes; then
20742 gl_cv_next_math_h='<'math.h'>'
20743 else
20744 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
20745$as_echo_n "checking absolute name of <math.h>... " >&6; }
d0ac1c44 20746if ${gl_cv_next_math_h+:} false; then :
88b48903
WN
20747 $as_echo_n "(cached) " >&6
20748else
c971b7fa 20749
88b48903 20750 if test $ac_cv_header_math_h = yes; then
c971b7fa
PA
20751
20752
4a626d0a
PA
20753
20754
20755 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634 20756/* end confdefs.h. */
88b48903 20757#include <math.h>
8690e634 20758_ACEOF
4a626d0a
PA
20759 case "$host_os" in
20760 aix*) gl_absname_cpp="$ac_cpp -C" ;;
20761 *) gl_absname_cpp="$ac_cpp" ;;
20762 esac
20763
20764 case "$host_os" in
20765 mingw*)
20766 gl_dirsep_regex='[/\\]'
20767 ;;
20768 *)
20769 gl_dirsep_regex='\/'
20770 ;;
20771 esac
20772 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
20773 gl_header_literal_regex=`echo 'math.h' \
20774 | sed -e "$gl_make_literal_regex_sed"`
20775 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
20776 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
20777 s|^/[^/]|//&|
20778 p
20779 q
20780 }'
20781
20782 gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
20783 sed -n "$gl_absolute_header_sed"`
20784
20785 gl_header=$gl_cv_absolute_math_h
20786 gl_cv_next_math_h='"'$gl_header'"'
88b48903
WN
20787 else
20788 gl_cv_next_math_h='<'math.h'>'
20789 fi
8690e634 20790
c971b7fa 20791
88b48903
WN
20792fi
20793{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
20794$as_echo "$gl_cv_next_math_h" >&6; }
20795 fi
20796 NEXT_MATH_H=$gl_cv_next_math_h
c971b7fa 20797
88b48903
WN
20798 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
20799 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
20800 gl_next_as_first_directive='<'math.h'>'
20801 else
20802 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
20803 gl_next_as_first_directive=$gl_cv_next_math_h
20804 fi
20805 NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
8690e634 20806
c971b7fa 20807
c971b7fa
PA
20808
20809
c971b7fa 20810
88b48903
WN
20811 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
20812$as_echo_n "checking whether NAN macro works... " >&6; }
d0ac1c44 20813if ${gl_cv_header_math_nan_works+:} false; then :
c971b7fa
PA
20814 $as_echo_n "(cached) " >&6
20815else
8690e634
JK
20816 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20817/* end confdefs.h. */
88b48903 20818#include <math.h>
c971b7fa
PA
20819int
20820main ()
20821{
88b48903
WN
20822/* Solaris 10 has a broken definition of NAN. Other platforms
20823 fail to provide NAN, or provide it only in C99 mode; this
20824 test only needs to fail when NAN is provided but wrong. */
20825 float f = 1.0f;
20826#ifdef NAN
20827 f = NAN;
20828#endif
20829 return f == 0;
c971b7fa
PA
20830 ;
20831 return 0;
20832}
20833_ACEOF
20834if ac_fn_c_try_compile "$LINENO"; then :
88b48903 20835 gl_cv_header_math_nan_works=yes
8690e634 20836else
88b48903 20837 gl_cv_header_math_nan_works=no
c971b7fa
PA
20838fi
20839rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 20840fi
88b48903
WN
20841{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
20842$as_echo "$gl_cv_header_math_nan_works" >&6; }
20843 if test $gl_cv_header_math_nan_works = no; then
20844 REPLACE_NAN=1
c971b7fa 20845 fi
88b48903
WN
20846 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
20847$as_echo_n "checking whether HUGE_VAL works... " >&6; }
d0ac1c44 20848if ${gl_cv_header_math_huge_val_works+:} false; then :
c971b7fa
PA
20849 $as_echo_n "(cached) " >&6
20850else
8690e634 20851 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 20852/* end confdefs.h. */
88b48903 20853#include <math.h>
c971b7fa
PA
20854int
20855main ()
20856{
88b48903
WN
20857/* Solaris 10 has a broken definition of HUGE_VAL. */
20858 double d = HUGE_VAL;
20859 return d == 0;
c971b7fa
PA
20860 ;
20861 return 0;
20862}
20863_ACEOF
20864if ac_fn_c_try_compile "$LINENO"; then :
88b48903 20865 gl_cv_header_math_huge_val_works=yes
8690e634 20866else
88b48903 20867 gl_cv_header_math_huge_val_works=no
c971b7fa
PA
20868fi
20869rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 20870fi
88b48903
WN
20871{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
20872$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
20873 if test $gl_cv_header_math_huge_val_works = no; then
20874 REPLACE_HUGE_VAL=1
8690e634 20875 fi
c971b7fa 20876
c971b7fa 20877
c971b7fa
PA
20878
20879
20880
20881
20882
20883
c971b7fa 20884
c971b7fa 20885
c971b7fa 20886
c971b7fa
PA
20887
20888
c971b7fa 20889
472fa5ee 20890
c0c3707f 20891 if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
472fa5ee
SM
20892
20893
20894
20895
c0c3707f
CB
20896 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
20897$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
20898if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
20899 $as_echo_n "(cached) " >&6
20900else
472fa5ee 20901
c0c3707f
CB
20902 case "$host_os" in
20903 # Guess no on AIX and OSF/1.
20904 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
20905 # Guess yes otherwise.
20906 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
20907 esac
20908 if test $LOCALE_JA != none; then
20909 if test "$cross_compiling" = yes; then :
472fa5ee 20910 :
c0c3707f
CB
20911else
20912 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20913/* end confdefs.h. */
472fa5ee 20914
c0c3707f
CB
20915#include <locale.h>
20916#include <string.h>
20917/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20918 <wchar.h>.
20919 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
20920 included before <wchar.h>. */
20921#include <stddef.h>
20922#include <stdio.h>
20923#include <time.h>
20924#include <wchar.h>
20925int main ()
20926{
20927 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
20928 {
20929 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
20930 mbstate_t state;
20931 wchar_t wc;
472fa5ee 20932
c0c3707f
CB
20933 memset (&state, '\0', sizeof (mbstate_t));
20934 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
20935 if (mbsinit (&state))
20936 return 2;
20937 }
20938 return 0;
20939}
20940_ACEOF
20941if ac_fn_c_try_run "$LINENO"; then :
20942 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 20943else
c0c3707f
CB
20944 gl_cv_func_mbrtowc_incomplete_state=no
20945fi
20946rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20947 conftest.$ac_objext conftest.beam conftest.$ac_ext
20948fi
8690e634 20949
c0c3707f
CB
20950 else
20951 if test $LOCALE_FR_UTF8 != none; then
20952 if test "$cross_compiling" = yes; then :
8690e634
JK
20953 :
20954else
c971b7fa
PA
20955 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20956/* end confdefs.h. */
c971b7fa 20957
8690e634
JK
20958#include <locale.h>
20959#include <string.h>
20960/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20961 <wchar.h>.
20962 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
20963 included before <wchar.h>. */
20964#include <stddef.h>
20965#include <stdio.h>
20966#include <time.h>
20967#include <wchar.h>
20968int main ()
c971b7fa 20969{
c0c3707f 20970 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
8690e634 20971 {
c0c3707f 20972 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
8690e634
JK
20973 mbstate_t state;
20974 wchar_t wc;
20975
20976 memset (&state, '\0', sizeof (mbstate_t));
20977 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
20978 if (mbsinit (&state))
c0c3707f 20979 return 2;
8690e634 20980 }
c971b7fa
PA
20981 return 0;
20982}
20983_ACEOF
8690e634
JK
20984if ac_fn_c_try_run "$LINENO"; then :
20985 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 20986else
8690e634 20987 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa 20988fi
8690e634
JK
20989rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20990 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 20991fi
c971b7fa 20992
c0c3707f 20993 fi
8690e634 20994 fi
c971b7fa 20995
8690e634
JK
20996fi
20997{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
20998$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa 20999
c971b7fa 21000
c971b7fa 21001
c971b7fa 21002
8690e634
JK
21003 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
21004$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 21005if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
21006 $as_echo_n "(cached) " >&6
21007else
21008
8690e634
JK
21009 case "$host_os" in
21010 # Guess no on Solaris 8.
21011 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
21012 # Guess yes otherwise.
21013 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
21014 esac
21015 if test $LOCALE_ZH_CN != none; then
21016 if test "$cross_compiling" = yes; then :
21017 :
21018else
21019 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
21020/* end confdefs.h. */
21021
8690e634
JK
21022#include <locale.h>
21023#include <stdlib.h>
21024#include <string.h>
21025/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21026 <wchar.h>.
21027 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21028 included before <wchar.h>. */
21029#include <stddef.h>
21030#include <stdio.h>
21031#include <time.h>
21032#include <wchar.h>
21033int main ()
c971b7fa 21034{
8690e634
JK
21035 /* This fails on Solaris 8:
21036 mbrtowc returns 2, and sets wc to 0x00F0.
21037 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
21038 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
21039 {
21040 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
21041 mbstate_t state;
21042 wchar_t wc;
21043
21044 memset (&state, '\0', sizeof (mbstate_t));
21045 if (mbrtowc (&wc, input + 3, 6, &state) != 4
21046 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 21047 return 2;
8690e634 21048 }
c971b7fa
PA
21049 return 0;
21050}
21051_ACEOF
8690e634
JK
21052if ac_fn_c_try_run "$LINENO"; then :
21053 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 21054else
8690e634 21055 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 21056fi
8690e634
JK
21057rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21058 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 21059fi
c971b7fa 21060
8690e634 21061 fi
c971b7fa 21062
8690e634
JK
21063fi
21064{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
21065$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
21066
21067 REPLACE_MBSTATE_T=0
21068 case "$gl_cv_func_mbrtowc_incomplete_state" in
21069 *yes) ;;
21070 *) REPLACE_MBSTATE_T=1 ;;
21071 esac
21072 case "$gl_cv_func_mbrtowc_sanitycheck" in
21073 *yes) ;;
21074 *) REPLACE_MBSTATE_T=1 ;;
21075 esac
c971b7fa 21076 else
8690e634 21077 REPLACE_MBSTATE_T=1
c971b7fa
PA
21078 fi
21079
21080
21081
8690e634
JK
21082 if test $ac_cv_func_mbrtowc = no; then
21083 HAVE_MBRTOWC=0
21084 ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
21085/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21086 <wchar.h>.
21087 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21088 included before <wchar.h>. */
21089#include <stddef.h>
21090#include <stdio.h>
21091#include <time.h>
21092#include <wchar.h>
c971b7fa 21093
8690e634 21094"
d0ac1c44 21095if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
8690e634
JK
21096 ac_have_decl=1
21097else
21098 ac_have_decl=0
c971b7fa 21099fi
c971b7fa 21100
8690e634
JK
21101cat >>confdefs.h <<_ACEOF
21102#define HAVE_DECL_MBRTOWC $ac_have_decl
21103_ACEOF
c971b7fa 21104
8690e634
JK
21105 if test $ac_cv_have_decl_mbrtowc = yes; then
21106 REPLACE_MBRTOWC=1
21107 fi
21108 else
21109 if test $REPLACE_MBSTATE_T = 1; then
21110 REPLACE_MBRTOWC=1
21111 else
c971b7fa
PA
21112
21113
21114
8690e634
JK
21115 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
21116$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
d0ac1c44 21117if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
8690e634 21118 $as_echo_n "(cached) " >&6
c971b7fa 21119else
c971b7fa 21120
8690e634
JK
21121 case "$host_os" in
21122 # Guess no on Solaris.
21123 solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
21124 # Guess yes otherwise.
21125 *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
21126 esac
21127 if test $LOCALE_FR_UTF8 != none; then
21128 if test "$cross_compiling" = yes; then :
21129 :
21130else
21131 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
21132/* end confdefs.h. */
21133
8690e634
JK
21134#include <locale.h>
21135#include <stdlib.h>
21136#include <string.h>
21137/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21138 <wchar.h>.
21139 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21140 included before <wchar.h>. */
21141#include <stddef.h>
21142#include <stdio.h>
21143#include <time.h>
21144#include <wchar.h>
21145int main ()
21146{
21147 int result = 0;
21148
21149 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
21150 {
21151 char input[] = "\303\237er";
21152 mbstate_t state;
21153 wchar_t wc;
21154 size_t ret;
21155
21156 memset (&state, '\0', sizeof (mbstate_t));
21157 wc = (wchar_t) 0xBADFACE;
21158 ret = mbrtowc (&wc, input, 5, &state);
21159 if (ret != 2)
21160 result |= 1;
21161 if (!mbsinit (&state))
21162 result |= 2;
c971b7fa 21163
8690e634
JK
21164 memset (&state, '\0', sizeof (mbstate_t));
21165 ret = mbrtowc (NULL, input, 5, &state);
21166 if (ret != 2) /* Solaris 7 fails here: ret is -1. */
21167 result |= 4;
21168 if (!mbsinit (&state))
21169 result |= 8;
21170 }
21171 return result;
21172}
c971b7fa 21173_ACEOF
8690e634
JK
21174if ac_fn_c_try_run "$LINENO"; then :
21175 gl_cv_func_mbrtowc_null_arg1=yes
21176else
21177 gl_cv_func_mbrtowc_null_arg1=no
21178fi
21179rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21180 conftest.$ac_objext conftest.beam conftest.$ac_ext
21181fi
c971b7fa 21182
8690e634 21183 fi
c971b7fa 21184
c971b7fa 21185fi
8690e634
JK
21186{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
21187$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
c971b7fa 21188
c971b7fa 21189
c971b7fa 21190
c971b7fa 21191
8690e634
JK
21192 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
21193$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
d0ac1c44 21194if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
8690e634
JK
21195 $as_echo_n "(cached) " >&6
21196else
c971b7fa 21197
8690e634
JK
21198 case "$host_os" in
21199 # Guess no on OSF/1.
21200 osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
21201 # Guess yes otherwise.
21202 *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
21203 esac
21204 if test $LOCALE_FR_UTF8 != none; then
21205 if test "$cross_compiling" = yes; then :
c971b7fa 21206 :
8690e634
JK
21207else
21208 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21209/* end confdefs.h. */
21210
21211#include <locale.h>
21212#include <string.h>
21213/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21214 <wchar.h>.
21215 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21216 included before <wchar.h>. */
21217#include <stddef.h>
21218#include <stdio.h>
21219#include <time.h>
21220#include <wchar.h>
21221int main ()
21222{
21223 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
21224 {
21225 mbstate_t state;
21226 wchar_t wc;
21227 int ret;
21228
21229 memset (&state, '\0', sizeof (mbstate_t));
21230 wc = (wchar_t) 0xBADFACE;
21231 mbrtowc (&wc, NULL, 5, &state);
21232 /* Check that wc was not modified. */
21233 if (wc != (wchar_t) 0xBADFACE)
c0c3707f 21234 return 2;
8690e634
JK
21235 }
21236 return 0;
21237}
21238_ACEOF
21239if ac_fn_c_try_run "$LINENO"; then :
21240 gl_cv_func_mbrtowc_null_arg2=yes
21241else
21242 gl_cv_func_mbrtowc_null_arg2=no
21243fi
21244rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21245 conftest.$ac_objext conftest.beam conftest.$ac_ext
21246fi
21247
21248 fi
21249
21250fi
21251{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
21252$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
c971b7fa
PA
21253
21254
21255
21256
21257
21258
8690e634
JK
21259 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
21260$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
d0ac1c44 21261if ${gl_cv_func_mbrtowc_retval+:} false; then :
8690e634
JK
21262 $as_echo_n "(cached) " >&6
21263else
21264
21265 case "$host_os" in
21266 # Guess no on HP-UX, Solaris, native Windows.
21267 hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
21268 # Guess yes otherwise.
21269 *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
21270 esac
21271 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
21272 || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
21273 if test "$cross_compiling" = yes; then :
c971b7fa 21274 :
8690e634
JK
21275else
21276 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21277/* end confdefs.h. */
c971b7fa 21278
8690e634
JK
21279#include <locale.h>
21280#include <string.h>
21281/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21282 <wchar.h>.
21283 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21284 included before <wchar.h>. */
21285#include <stddef.h>
21286#include <stdio.h>
21287#include <time.h>
21288#include <wchar.h>
21289int main ()
21290{
21291 int result = 0;
21292 int found_some_locale = 0;
21293 /* This fails on Solaris. */
21294 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
21295 {
21296 char input[] = "B\303\274\303\237er"; /* "Büßer" */
21297 mbstate_t state;
21298 wchar_t wc;
21299
21300 memset (&state, '\0', sizeof (mbstate_t));
21301 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
21302 {
21303 input[1] = '\0';
21304 if (mbrtowc (&wc, input + 2, 5, &state) != 1)
21305 result |= 1;
21306 }
21307 found_some_locale = 1;
21308 }
21309 /* This fails on HP-UX 11.11. */
21310 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
21311 {
21312 char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
21313 mbstate_t state;
21314 wchar_t wc;
21315
21316 memset (&state, '\0', sizeof (mbstate_t));
21317 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
21318 {
21319 input[1] = '\0';
21320 if (mbrtowc (&wc, input + 2, 5, &state) != 2)
21321 result |= 2;
21322 }
21323 found_some_locale = 1;
21324 }
21325 /* This fails on native Windows. */
21326 if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
21327 {
21328 char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
21329 mbstate_t state;
21330 wchar_t wc;
21331
21332 memset (&state, '\0', sizeof (mbstate_t));
21333 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
21334 {
21335 input[3] = '\0';
21336 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
21337 result |= 4;
21338 }
21339 found_some_locale = 1;
21340 }
21341 if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
21342 {
21343 char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
21344 mbstate_t state;
21345 wchar_t wc;
21346
21347 memset (&state, '\0', sizeof (mbstate_t));
21348 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
21349 {
21350 input[3] = '\0';
21351 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
21352 result |= 8;
21353 }
21354 found_some_locale = 1;
21355 }
21356 if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
21357 {
21358 char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
21359 mbstate_t state;
21360 wchar_t wc;
21361
21362 memset (&state, '\0', sizeof (mbstate_t));
21363 if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
21364 {
21365 input[3] = '\0';
21366 if (mbrtowc (&wc, input + 4, 4, &state) != 1)
21367 result |= 16;
21368 }
21369 found_some_locale = 1;
21370 }
21371 return (found_some_locale ? result : 77);
21372}
21373_ACEOF
21374if ac_fn_c_try_run "$LINENO"; then :
21375 gl_cv_func_mbrtowc_retval=yes
21376else
21377 if test $? != 77; then
21378 gl_cv_func_mbrtowc_retval=no
21379 fi
c971b7fa 21380
8690e634
JK
21381fi
21382rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21383 conftest.$ac_objext conftest.beam conftest.$ac_ext
21384fi
c971b7fa 21385
8690e634 21386 fi
c971b7fa 21387
8690e634
JK
21388fi
21389{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
21390$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
c971b7fa
PA
21391
21392
21393
21394
8690e634
JK
21395 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
21396$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
d0ac1c44 21397if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
c971b7fa
PA
21398 $as_echo_n "(cached) " >&6
21399else
8690e634
JK
21400
21401 case "$host_os" in
21402 # Guess no on Solaris 8 and 9.
21403 solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
21404 # Guess yes otherwise.
21405 *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
21406 esac
21407 if test $LOCALE_ZH_CN != none; then
21408 if test "$cross_compiling" = yes; then :
21409 :
c971b7fa
PA
21410else
21411 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21412/* end confdefs.h. */
21413
8690e634 21414#include <locale.h>
c971b7fa 21415#include <string.h>
8690e634
JK
21416/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21417 <wchar.h>.
21418 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21419 included before <wchar.h>. */
21420#include <stddef.h>
21421#include <stdio.h>
21422#include <time.h>
21423#include <wchar.h>
21424int main ()
c971b7fa 21425{
8690e634
JK
21426 /* This fails on Solaris 8 and 9. */
21427 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
c971b7fa 21428 {
8690e634
JK
21429 mbstate_t state;
21430 wchar_t wc;
c971b7fa 21431
8690e634
JK
21432 memset (&state, '\0', sizeof (mbstate_t));
21433 if (mbrtowc (&wc, "", 1, &state) != 0)
c0c3707f 21434 return 2;
8690e634 21435 }
c971b7fa
PA
21436 return 0;
21437}
21438_ACEOF
21439if ac_fn_c_try_run "$LINENO"; then :
8690e634 21440 gl_cv_func_mbrtowc_nul_retval=yes
c971b7fa 21441else
8690e634 21442 gl_cv_func_mbrtowc_nul_retval=no
c971b7fa
PA
21443fi
21444rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21445 conftest.$ac_objext conftest.beam conftest.$ac_ext
21446fi
21447
8690e634
JK
21448 fi
21449
c971b7fa 21450fi
8690e634
JK
21451{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
21452$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
21453
4a626d0a
PA
21454
21455
21456 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
21457$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
d0ac1c44 21458if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
4a626d0a
PA
21459 $as_echo_n "(cached) " >&6
21460else
21461
21462 case "$host_os" in
c0c3707f
CB
21463 # Guess no on AIX and glibc systems.
21464 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
21465 # Guess yes on native Windows.
21466 mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
21467 *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
4a626d0a
PA
21468 esac
21469 if test "$cross_compiling" = yes; then :
21470 :
21471else
21472 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21473/* end confdefs.h. */
21474
21475 #include <wchar.h>
21476 static wchar_t wc;
21477 static mbstate_t mbs;
21478 int
21479 main (void)
21480 {
49e4877c 21481 return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
4a626d0a
PA
21482 }
21483_ACEOF
21484if ac_fn_c_try_run "$LINENO"; then :
4a626d0a 21485 gl_cv_func_mbrtowc_empty_input=yes
49e4877c
PA
21486else
21487 gl_cv_func_mbrtowc_empty_input=no
4a626d0a
PA
21488fi
21489rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21490 conftest.$ac_objext conftest.beam conftest.$ac_ext
21491fi
21492
21493
21494fi
21495{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
21496$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
21497
49e4877c 21498
c0c3707f 21499 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
49e4877c 21500$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
d0ac1c44 21501if ${gl_cv_C_locale_sans_EILSEQ+:} false; then :
49e4877c
PA
21502 $as_echo_n "(cached) " >&6
21503else
21504
c0c3707f 21505 gl_cv_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
49e4877c
PA
21506
21507 if test "$cross_compiling" = yes; then :
c0c3707f
CB
21508 case "$host_os" in
21509 # Guess yes on native Windows.
21510 mingw*) gl_cv_C_locale_sans_EILSEQ="guessing yes" ;;
21511 esac
21512
49e4877c
PA
21513else
21514 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21515/* end confdefs.h. */
21516#include <limits.h>
21517 #include <locale.h>
21518 #include <wchar.h>
21519
21520int
21521main ()
21522{
21523
21524 int i;
21525 char *locale = setlocale (LC_ALL, "C");
21526 if (! locale)
c0c3707f 21527 return 2;
49e4877c
PA
21528 for (i = CHAR_MIN; i <= CHAR_MAX; i++)
21529 {
21530 char c = i;
21531 wchar_t wc;
21532 mbstate_t mbs = { 0, };
21533 size_t ss = mbrtowc (&wc, &c, 1, &mbs);
21534 if (1 < ss)
c0c3707f 21535 return 3;
49e4877c
PA
21536 }
21537 return 0;
21538
6ec2e0f5
SDJ
21539 ;
21540 return 0;
21541}
21542_ACEOF
21543if ac_fn_c_try_run "$LINENO"; then :
21544 gl_cv_C_locale_sans_EILSEQ=yes
21545else
21546 gl_cv_C_locale_sans_EILSEQ=no
21547fi
21548rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21549 conftest.$ac_objext conftest.beam conftest.$ac_ext
21550fi
21551
c0c3707f 21552
6ec2e0f5
SDJ
21553fi
21554{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5
21555$as_echo "$gl_cv_C_locale_sans_EILSEQ" >&6; }
21556
21557 case "$gl_cv_func_mbrtowc_null_arg1" in
21558 *yes) ;;
21559 *)
21560$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
21561
21562 REPLACE_MBRTOWC=1
21563 ;;
21564 esac
21565 case "$gl_cv_func_mbrtowc_null_arg2" in
21566 *yes) ;;
21567 *)
21568$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
21569
21570 REPLACE_MBRTOWC=1
21571 ;;
21572 esac
21573 case "$gl_cv_func_mbrtowc_retval" in
21574 *yes) ;;
21575 *)
21576$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
21577
21578 REPLACE_MBRTOWC=1
21579 ;;
21580 esac
21581 case "$gl_cv_func_mbrtowc_nul_retval" in
21582 *yes) ;;
21583 *)
21584$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
21585
21586 REPLACE_MBRTOWC=1
21587 ;;
21588 esac
21589 case "$gl_cv_func_mbrtowc_empty_input" in
21590 *yes) ;;
21591 *)
21592$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
21593
21594 REPLACE_MBRTOWC=1
21595 ;;
21596 esac
21597 case $gl_cv_C_locale_sans_EILSEQ in
21598 *yes) ;;
21599 *)
21600$as_echo "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
21601
21602 REPLACE_MBRTOWC=1
21603 ;;
21604 esac
21605 fi
21606 fi
21607
21608 if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
21609
21610
21611
21612
21613
21614
21615
21616
21617 gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
21618
21619
c0c3707f 21620
6ec2e0f5
SDJ
21621 :
21622
21623 fi
21624
21625
21626
21627
21628
21629 GNULIB_MBRTOWC=1
21630
21631
21632
21633
21634
21635$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650 if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
21651
21652
21653
c0c3707f 21654
6ec2e0f5
SDJ
21655 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
21656$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 21657if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
6ec2e0f5
SDJ
21658 $as_echo_n "(cached) " >&6
21659else
21660
21661 case "$host_os" in
21662 # Guess no on AIX and OSF/1.
21663 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
21664 # Guess yes otherwise.
21665 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
21666 esac
21667 if test $LOCALE_JA != none; then
21668 if test "$cross_compiling" = yes; then :
21669 :
21670else
21671 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21672/* end confdefs.h. */
21673
21674#include <locale.h>
21675#include <string.h>
21676/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21677 <wchar.h>.
21678 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21679 included before <wchar.h>. */
21680#include <stddef.h>
21681#include <stdio.h>
21682#include <time.h>
21683#include <wchar.h>
21684int main ()
21685{
21686 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
21687 {
21688 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
21689 mbstate_t state;
21690 wchar_t wc;
21691
21692 memset (&state, '\0', sizeof (mbstate_t));
21693 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
21694 if (mbsinit (&state))
c0c3707f
CB
21695 return 2;
21696 }
21697 return 0;
21698}
21699_ACEOF
21700if ac_fn_c_try_run "$LINENO"; then :
21701 gl_cv_func_mbrtowc_incomplete_state=yes
21702else
21703 gl_cv_func_mbrtowc_incomplete_state=no
21704fi
21705rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21706 conftest.$ac_objext conftest.beam conftest.$ac_ext
21707fi
21708
21709 else
21710 if test $LOCALE_FR_UTF8 != none; then
21711 if test "$cross_compiling" = yes; then :
21712 :
21713else
21714 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21715/* end confdefs.h. */
21716
21717#include <locale.h>
21718#include <string.h>
21719/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21720 <wchar.h>.
21721 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21722 included before <wchar.h>. */
21723#include <stddef.h>
21724#include <stdio.h>
21725#include <time.h>
21726#include <wchar.h>
21727int main ()
21728{
21729 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
21730 {
21731 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
21732 mbstate_t state;
21733 wchar_t wc;
21734
21735 memset (&state, '\0', sizeof (mbstate_t));
21736 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
21737 if (mbsinit (&state))
21738 return 2;
6ec2e0f5
SDJ
21739 }
21740 return 0;
21741}
21742_ACEOF
21743if ac_fn_c_try_run "$LINENO"; then :
21744 gl_cv_func_mbrtowc_incomplete_state=yes
21745else
21746 gl_cv_func_mbrtowc_incomplete_state=no
21747fi
21748rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21749 conftest.$ac_objext conftest.beam conftest.$ac_ext
21750fi
21751
c0c3707f 21752 fi
6ec2e0f5
SDJ
21753 fi
21754
21755fi
21756{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
21757$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
21758
21759
21760
21761
21762 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
21763$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 21764if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
6ec2e0f5
SDJ
21765 $as_echo_n "(cached) " >&6
21766else
21767
21768 case "$host_os" in
21769 # Guess no on Solaris 8.
21770 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
21771 # Guess yes otherwise.
21772 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
21773 esac
21774 if test $LOCALE_ZH_CN != none; then
21775 if test "$cross_compiling" = yes; then :
21776 :
21777else
21778 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21779/* end confdefs.h. */
21780
21781#include <locale.h>
21782#include <stdlib.h>
21783#include <string.h>
21784/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21785 <wchar.h>.
21786 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21787 included before <wchar.h>. */
21788#include <stddef.h>
21789#include <stdio.h>
21790#include <time.h>
21791#include <wchar.h>
21792int main ()
21793{
21794 /* This fails on Solaris 8:
21795 mbrtowc returns 2, and sets wc to 0x00F0.
21796 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
21797 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
21798 {
21799 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
21800 mbstate_t state;
21801 wchar_t wc;
21802
21803 memset (&state, '\0', sizeof (mbstate_t));
21804 if (mbrtowc (&wc, input + 3, 6, &state) != 4
21805 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 21806 return 2;
6ec2e0f5 21807 }
49e4877c
PA
21808 return 0;
21809}
21810_ACEOF
21811if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 21812 gl_cv_func_mbrtowc_sanitycheck=yes
49e4877c 21813else
6ec2e0f5 21814 gl_cv_func_mbrtowc_sanitycheck=no
49e4877c
PA
21815fi
21816rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21817 conftest.$ac_objext conftest.beam conftest.$ac_ext
21818fi
21819
6ec2e0f5
SDJ
21820 fi
21821
49e4877c 21822fi
6ec2e0f5
SDJ
21823{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
21824$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
49e4877c 21825
6ec2e0f5
SDJ
21826 REPLACE_MBSTATE_T=0
21827 case "$gl_cv_func_mbrtowc_incomplete_state" in
21828 *yes) ;;
21829 *) REPLACE_MBSTATE_T=1 ;;
21830 esac
21831 case "$gl_cv_func_mbrtowc_sanitycheck" in
21832 *yes) ;;
21833 *) REPLACE_MBSTATE_T=1 ;;
21834 esac
21835 else
21836 REPLACE_MBSTATE_T=1
21837 fi
8690e634 21838
8690e634 21839
8690e634 21840
6ec2e0f5
SDJ
21841 if test $ac_cv_func_mbsinit = no; then
21842 HAVE_MBSINIT=0
21843 ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
21844/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21845 <wchar.h>.
21846 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21847 included before <wchar.h>. */
21848#include <stddef.h>
21849#include <stdio.h>
21850#include <time.h>
21851#include <wchar.h>
8690e634 21852
6ec2e0f5 21853"
d0ac1c44 21854if test "x$ac_cv_have_decl_mbsinit" = xyes; then :
6ec2e0f5
SDJ
21855 ac_have_decl=1
21856else
21857 ac_have_decl=0
21858fi
4a626d0a 21859
6ec2e0f5
SDJ
21860cat >>confdefs.h <<_ACEOF
21861#define HAVE_DECL_MBSINIT $ac_have_decl
21862_ACEOF
49e4877c 21863
6ec2e0f5
SDJ
21864 if test $ac_cv_have_decl_mbsinit = yes; then
21865 REPLACE_MBSINIT=1
21866 fi
21867 else
21868 if test $REPLACE_MBSTATE_T = 1; then
21869 REPLACE_MBSINIT=1
21870 else
21871 case "$host_os" in
21872 mingw*) REPLACE_MBSINIT=1 ;;
8690e634 21873 esac
c971b7fa
PA
21874 fi
21875 fi
21876
6ec2e0f5 21877 if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
c971b7fa 21878
c971b7fa 21879
c971b7fa
PA
21880
21881
21882
21883
21884
21885
6ec2e0f5 21886 gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
8690e634
JK
21887
21888
21889 :
c971b7fa 21890
a512b375 21891 fi
c971b7fa 21892
8690e634
JK
21893
21894
21895
21896
6ec2e0f5 21897 GNULIB_MBSINIT=1
8690e634
JK
21898
21899
21900
21901
8690e634 21902
6ec2e0f5 21903$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
8690e634
JK
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
c971b7fa 21915
c971b7fa 21916
8690e634 21917 if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
c971b7fa 21918
8690e634
JK
21919
21920
c0c3707f 21921
8690e634
JK
21922 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
21923$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
d0ac1c44 21924if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
8690e634
JK
21925 $as_echo_n "(cached) " >&6
21926else
21927
21928 case "$host_os" in
21929 # Guess no on AIX and OSF/1.
21930 aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
21931 # Guess yes otherwise.
21932 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
21933 esac
21934 if test $LOCALE_JA != none; then
21935 if test "$cross_compiling" = yes; then :
21936 :
c971b7fa
PA
21937else
21938 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21939/* end confdefs.h. */
21940
8690e634
JK
21941#include <locale.h>
21942#include <string.h>
21943/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21944 <wchar.h>.
21945 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21946 included before <wchar.h>. */
21947#include <stddef.h>
21948#include <stdio.h>
21949#include <time.h>
21950#include <wchar.h>
21951int main ()
c971b7fa 21952{
8690e634 21953 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
c971b7fa 21954 {
8690e634
JK
21955 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
21956 mbstate_t state;
21957 wchar_t wc;
21958
21959 memset (&state, '\0', sizeof (mbstate_t));
21960 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
21961 if (mbsinit (&state))
c0c3707f
CB
21962 return 2;
21963 }
21964 return 0;
21965}
21966_ACEOF
21967if ac_fn_c_try_run "$LINENO"; then :
21968 gl_cv_func_mbrtowc_incomplete_state=yes
21969else
21970 gl_cv_func_mbrtowc_incomplete_state=no
21971fi
21972rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21973 conftest.$ac_objext conftest.beam conftest.$ac_ext
21974fi
21975
21976 else
21977 if test $LOCALE_FR_UTF8 != none; then
21978 if test "$cross_compiling" = yes; then :
21979 :
21980else
21981 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21982/* end confdefs.h. */
21983
21984#include <locale.h>
21985#include <string.h>
21986/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
21987 <wchar.h>.
21988 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
21989 included before <wchar.h>. */
21990#include <stddef.h>
21991#include <stdio.h>
21992#include <time.h>
21993#include <wchar.h>
21994int main ()
21995{
21996 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
21997 {
21998 const char input[] = "B\303\274\303\237er"; /* "Büßer" */
21999 mbstate_t state;
22000 wchar_t wc;
22001
22002 memset (&state, '\0', sizeof (mbstate_t));
22003 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
22004 if (mbsinit (&state))
22005 return 2;
c971b7fa 22006 }
c971b7fa
PA
22007 return 0;
22008}
22009_ACEOF
22010if ac_fn_c_try_run "$LINENO"; then :
8690e634 22011 gl_cv_func_mbrtowc_incomplete_state=yes
c971b7fa 22012else
8690e634 22013 gl_cv_func_mbrtowc_incomplete_state=no
c971b7fa
PA
22014fi
22015rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22016 conftest.$ac_objext conftest.beam conftest.$ac_ext
22017fi
22018
c0c3707f 22019 fi
8690e634 22020 fi
c971b7fa
PA
22021
22022fi
8690e634
JK
22023{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
22024$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
c971b7fa
PA
22025
22026
c971b7fa
PA
22027
22028
8690e634
JK
22029 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
22030$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
d0ac1c44 22031if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
c971b7fa
PA
22032 $as_echo_n "(cached) " >&6
22033else
8690e634
JK
22034
22035 case "$host_os" in
22036 # Guess no on Solaris 8.
22037 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
22038 # Guess yes otherwise.
22039 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
22040 esac
22041 if test $LOCALE_ZH_CN != none; then
22042 if test "$cross_compiling" = yes; then :
22043 :
22044else
c971b7fa
PA
22045 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22046/* end confdefs.h. */
8690e634
JK
22047
22048#include <locale.h>
22049#include <stdlib.h>
22050#include <string.h>
22051/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22052 <wchar.h>.
22053 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22054 included before <wchar.h>. */
c971b7fa 22055#include <stddef.h>
8690e634
JK
22056#include <stdio.h>
22057#include <time.h>
22058#include <wchar.h>
22059int main ()
c971b7fa 22060{
8690e634
JK
22061 /* This fails on Solaris 8:
22062 mbrtowc returns 2, and sets wc to 0x00F0.
22063 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
22064 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
22065 {
22066 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
22067 mbstate_t state;
22068 wchar_t wc;
22069
22070 memset (&state, '\0', sizeof (mbstate_t));
22071 if (mbrtowc (&wc, input + 3, 6, &state) != 4
22072 && mbtowc (&wc, input + 3, 6) == 4)
c0c3707f 22073 return 2;
8690e634 22074 }
c971b7fa
PA
22075 return 0;
22076}
22077_ACEOF
8690e634
JK
22078if ac_fn_c_try_run "$LINENO"; then :
22079 gl_cv_func_mbrtowc_sanitycheck=yes
c971b7fa 22080else
8690e634 22081 gl_cv_func_mbrtowc_sanitycheck=no
c971b7fa 22082fi
8690e634
JK
22083rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22084 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 22085fi
c971b7fa 22086
8690e634
JK
22087 fi
22088
22089fi
22090{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
22091$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
c971b7fa 22092
8690e634
JK
22093 REPLACE_MBSTATE_T=0
22094 case "$gl_cv_func_mbrtowc_incomplete_state" in
22095 *yes) ;;
22096 *) REPLACE_MBSTATE_T=1 ;;
22097 esac
22098 case "$gl_cv_func_mbrtowc_sanitycheck" in
22099 *yes) ;;
22100 *) REPLACE_MBSTATE_T=1 ;;
22101 esac
22102 else
22103 REPLACE_MBSTATE_T=1
c971b7fa
PA
22104 fi
22105
c971b7fa 22106
8690e634 22107
6ec2e0f5
SDJ
22108 if test $ac_cv_func_mbsrtowcs = no; then
22109 HAVE_MBSRTOWCS=0
22110 ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" "
8690e634
JK
22111/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22112 <wchar.h>.
22113 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22114 included before <wchar.h>. */
22115#include <stddef.h>
22116#include <stdio.h>
22117#include <time.h>
22118#include <wchar.h>
22119
22120"
d0ac1c44 22121if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then :
8690e634
JK
22122 ac_have_decl=1
22123else
22124 ac_have_decl=0
c971b7fa 22125fi
c971b7fa 22126
8690e634 22127cat >>confdefs.h <<_ACEOF
6ec2e0f5 22128#define HAVE_DECL_MBSRTOWCS $ac_have_decl
c971b7fa 22129_ACEOF
c971b7fa 22130
6ec2e0f5
SDJ
22131 if test $ac_cv_have_decl_mbsrtowcs = yes; then
22132 REPLACE_MBSRTOWCS=1
8690e634
JK
22133 fi
22134 else
22135 if test $REPLACE_MBSTATE_T = 1; then
6ec2e0f5 22136 REPLACE_MBSRTOWCS=1
8690e634 22137 else
6ec2e0f5
SDJ
22138
22139
22140
22141
22142
22143
22144 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5
22145$as_echo_n "checking whether mbsrtowcs works... " >&6; }
d0ac1c44 22146if ${gl_cv_func_mbsrtowcs_works+:} false; then :
6ec2e0f5
SDJ
22147 $as_echo_n "(cached) " >&6
22148else
22149
22150 case "$host_os" in
22151 # Guess no on HP-UX, Solaris, mingw.
22152 hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
22153 # Guess yes otherwise.
22154 *) gl_cv_func_mbsrtowcs_works="guessing yes" ;;
22155 esac
22156 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
22157 if test "$cross_compiling" = yes; then :
22158 :
22159else
22160 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22161/* end confdefs.h. */
22162
22163#include <locale.h>
22164#include <string.h>
22165/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
22166 <wchar.h>.
22167 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
22168 included before <wchar.h>. */
22169#include <stddef.h>
22170#include <stdio.h>
22171#include <time.h>
22172#include <wchar.h>
22173int main ()
22174{
22175 int result = 0;
22176 /* Test whether the function supports a NULL destination argument.
22177 This fails on native Windows. */
22178 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
22179 {
22180 const char input[] = "\337er";
22181 const char *src = input;
22182 mbstate_t state;
22183
22184 memset (&state, '\0', sizeof (mbstate_t));
22185 if (mbsrtowcs (NULL, &src, 1, &state) != 3
22186 || src != input)
22187 result |= 1;
22188 }
22189 /* Test whether the function works when started with a conversion state
22190 in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */
22191 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
22192 {
22193 const char input[] = "B\303\274\303\237er";
22194 mbstate_t state;
22195
22196 memset (&state, '\0', sizeof (mbstate_t));
22197 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
22198 if (!mbsinit (&state))
22199 {
22200 const char *src = input + 2;
22201 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
22202 result |= 2;
22203 }
22204 }
22205 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
22206 {
22207 const char input[] = "<\306\374\313\334\270\354>";
22208 mbstate_t state;
22209
22210 memset (&state, '\0', sizeof (mbstate_t));
22211 if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2))
22212 if (!mbsinit (&state))
22213 {
22214 const char *src = input + 4;
22215 if (mbsrtowcs (NULL, &src, 10, &state) != 3)
22216 result |= 4;
22217 }
22218 }
22219 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
22220 {
22221 const char input[] = "B\250\271\201\060\211\070er";
22222 mbstate_t state;
22223
22224 memset (&state, '\0', sizeof (mbstate_t));
22225 if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
22226 if (!mbsinit (&state))
22227 {
22228 const char *src = input + 2;
22229 if (mbsrtowcs (NULL, &src, 10, &state) != 4)
22230 result |= 8;
22231 }
22232 }
22233 return result;
22234}
22235_ACEOF
22236if ac_fn_c_try_run "$LINENO"; then :
22237 gl_cv_func_mbsrtowcs_works=yes
22238else
22239 gl_cv_func_mbsrtowcs_works=no
22240fi
22241rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22242 conftest.$ac_objext conftest.beam conftest.$ac_ext
22243fi
22244
22245 fi
22246
22247fi
22248{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5
22249$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
22250
22251 case "$gl_cv_func_mbsrtowcs_works" in
22252 *yes) ;;
22253 *) REPLACE_MBSRTOWCS=1 ;;
8690e634
JK
22254 esac
22255 fi
22256 fi
c971b7fa 22257
6ec2e0f5 22258 if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
c971b7fa
PA
22259
22260
22261
22262
22263
22264
22265
22266
6ec2e0f5
SDJ
22267 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext"
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277 gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext"
c971b7fa
PA
22278
22279
8690e634 22280 :
c971b7fa 22281
a512b375 22282 fi
c971b7fa 22283
c971b7fa 22284
c971b7fa 22285
c971b7fa
PA
22286
22287
6ec2e0f5 22288 GNULIB_MBSRTOWCS=1
c971b7fa 22289
c971b7fa
PA
22290
22291
22292
22293
6ec2e0f5 22294$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
c971b7fa
PA
22295
22296
c971b7fa 22297
c971b7fa 22298
6ec2e0f5 22299 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
c971b7fa
PA
22300
22301
22302
c971b7fa 22303
c971b7fa
PA
22304
22305
22306
22307
6ec2e0f5 22308 gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
8690e634 22309
c971b7fa 22310
6ec2e0f5
SDJ
22311 for ac_header in bp-sym.h
22312do :
22313 ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
d0ac1c44 22314if test "x$ac_cv_header_bp_sym_h" = xyes; then :
6ec2e0f5
SDJ
22315 cat >>confdefs.h <<_ACEOF
22316#define HAVE_BP_SYM_H 1
22317_ACEOF
c971b7fa 22318
6ec2e0f5 22319fi
c971b7fa 22320
6ec2e0f5
SDJ
22321done
22322
22323
22324 fi
22325
22326
22327
22328
22329
22330 GNULIB_MEMCHR=1
22331
22332
22333
22334
22335
22336$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
22337
22338
22339
22340
22341
22342 if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
22343 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works in linear time" >&5
22344$as_echo_n "checking whether memmem works in linear time... " >&6; }
d0ac1c44 22345if ${gl_cv_func_memmem_works_fast+:} false; then :
8690e634
JK
22346 $as_echo_n "(cached) " >&6
22347else
6ec2e0f5
SDJ
22348 if test "$cross_compiling" = yes; then :
22349 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22350/* end confdefs.h. */
22351
22352#include <features.h>
22353#ifdef __GNU_LIBRARY__
22354 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \
22355 && !defined __UCLIBC__
22356 Lucky user
22357 #endif
22358#endif
22359#ifdef __CYGWIN__
22360 #include <cygwin/version.h>
22361 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0)
22362 Lucky user
22363 #endif
22364#endif
22365
22366_ACEOF
22367if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22368 $EGREP "Lucky user" >/dev/null 2>&1; then :
22369 gl_cv_func_memmem_works_fast="guessing yes"
22370else
c0c3707f 22371 gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"
6ec2e0f5
SDJ
22372fi
22373rm -f conftest*
22374
c971b7fa 22375
8690e634
JK
22376else
22377 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 22378/* end confdefs.h. */
c971b7fa 22379
6ec2e0f5
SDJ
22380#include <signal.h> /* for signal */
22381#include <string.h> /* for memmem */
22382#include <stdlib.h> /* for malloc */
22383#include <unistd.h> /* for alarm */
22384static void quit (int sig) { _exit (sig + 128); }
22385
22386int
22387main ()
8690e634 22388{
8690e634 22389
6ec2e0f5
SDJ
22390 int result = 0;
22391 size_t m = 1000000;
22392 char *haystack = (char *) malloc (2 * m + 1);
22393 char *needle = (char *) malloc (m + 1);
22394 /* Failure to compile this test due to missing alarm is okay,
22395 since all such platforms (mingw) also lack memmem. */
22396 signal (SIGALRM, quit);
22397 alarm (5);
22398 /* Check for quadratic performance. */
22399 if (haystack && needle)
22400 {
22401 memset (haystack, 'A', 2 * m);
22402 haystack[2 * m] = 'B';
22403 memset (needle, 'A', m);
22404 needle[m] = 'B';
22405 if (!memmem (haystack, 2 * m + 1, needle, m + 1))
22406 result |= 1;
22407 }
c0c3707f
CB
22408 /* Free allocated memory, in case some sanitizer is watching. */
22409 free (haystack);
22410 free (needle);
6ec2e0f5
SDJ
22411 return result;
22412
22413 ;
c971b7fa
PA
22414 return 0;
22415}
22416_ACEOF
8690e634 22417if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 22418 gl_cv_func_memmem_works_fast=yes
8690e634 22419else
6ec2e0f5 22420 gl_cv_func_memmem_works_fast=no
8690e634
JK
22421fi
22422rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22423 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 22424fi
c971b7fa
PA
22425
22426
8690e634 22427fi
6ec2e0f5
SDJ
22428{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_fast" >&5
22429$as_echo "$gl_cv_func_memmem_works_fast" >&6; }
22430 case "$gl_cv_func_memmem_works_fast" in
22431 *yes) ;;
22432 *)
22433 REPLACE_MEMMEM=1
22434 ;;
22435 esac
22436 fi
c971b7fa 22437
6ec2e0f5 22438 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
8690e634
JK
22439
22440
22441
6ec2e0f5
SDJ
22442
22443
22444
22445
22446
22447 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
22448
22449 fi
22450
22451
22452
22453
22454 for ac_func in memmem
22455do :
22456 ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
d0ac1c44 22457if test "x$ac_cv_func_memmem" = xyes; then :
6ec2e0f5
SDJ
22458 cat >>confdefs.h <<_ACEOF
22459#define HAVE_MEMMEM 1
22460_ACEOF
22461
22462fi
22463done
22464
22465 if test $ac_cv_func_memmem = yes; then
22466 HAVE_MEMMEM=1
22467 else
22468 HAVE_MEMMEM=0
22469 fi
22470
22471 if test $ac_cv_have_decl_memmem = no; then
22472 HAVE_DECL_MEMMEM=0
22473 else
22474 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5
22475$as_echo_n "checking whether memmem works... " >&6; }
d0ac1c44 22476if ${gl_cv_func_memmem_works_always+:} false; then :
c971b7fa
PA
22477 $as_echo_n "(cached) " >&6
22478else
6ec2e0f5
SDJ
22479 if test "$cross_compiling" = yes; then :
22480 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22481/* end confdefs.h. */
22482
22483#ifdef __GNU_LIBRARY__
22484 #include <features.h>
22485 #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
22486 || __GLIBC_MINOR__ > 12)) \
22487 || (__GLIBC__ > 2)) \
22488 || defined __UCLIBC__
22489 Lucky user
22490 #endif
22491#elif defined __CYGWIN__
22492 #include <cygwin/version.h>
22493 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
22494 Lucky user
22495 #endif
22496#else
22497 Lucky user
22498#endif
22499
22500_ACEOF
22501if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22502 $EGREP "Lucky user" >/dev/null 2>&1; then :
22503 gl_cv_func_memmem_works_always="guessing yes"
22504else
c0c3707f 22505 gl_cv_func_memmem_works_always="$gl_cross_guess_normal"
6ec2e0f5
SDJ
22506fi
22507rm -f conftest*
22508
8690e634 22509
8690e634 22510else
c971b7fa
PA
22511 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22512/* end confdefs.h. */
c971b7fa 22513
6ec2e0f5
SDJ
22514#include <string.h> /* for memmem */
22515#define P "_EF_BF_BD"
22516#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
22517#define NEEDLE P P P P P
22518
22519int
22520main ()
c971b7fa 22521{
8690e634 22522
6ec2e0f5
SDJ
22523 int result = 0;
22524 if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
22525 result |= 1;
22526 /* Check for empty needle behavior. */
22527 {
22528 const char *haystack = "AAA";
22529 if (memmem (haystack, 3, NULL, 0) != haystack)
22530 result |= 2;
8690e634 22531 }
6ec2e0f5
SDJ
22532 return result;
22533
22534 ;
c971b7fa
PA
22535 return 0;
22536}
22537_ACEOF
8690e634 22538if ac_fn_c_try_run "$LINENO"; then :
6ec2e0f5 22539 gl_cv_func_memmem_works_always=yes
c971b7fa 22540else
6ec2e0f5 22541 gl_cv_func_memmem_works_always=no
c971b7fa 22542fi
8690e634
JK
22543rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22544 conftest.$ac_objext conftest.beam conftest.$ac_ext
c971b7fa 22545fi
8690e634 22546
8690e634
JK
22547
22548fi
6ec2e0f5
SDJ
22549{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5
22550$as_echo "$gl_cv_func_memmem_works_always" >&6; }
22551 case "$gl_cv_func_memmem_works_always" in
8690e634 22552 *yes) ;;
6ec2e0f5
SDJ
22553 *)
22554 REPLACE_MEMMEM=1
22555 ;;
8690e634 22556 esac
c971b7fa 22557 fi
6ec2e0f5 22558 :
c971b7fa 22559
6ec2e0f5 22560 if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
c971b7fa 22561
c971b7fa 22562
8690e634 22563
c971b7fa 22564
6ec2e0f5
SDJ
22565
22566
22567
22568
22569 gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
22570
22571 fi
22572
22573
22574
22575
22576
22577 GNULIB_MEMMEM=1
22578
22579
22580
22581
22582
22583$as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593 for ac_func in mempcpy
22594do :
22595 ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
d0ac1c44 22596if test "x$ac_cv_func_mempcpy" = xyes; then :
6ec2e0f5
SDJ
22597 cat >>confdefs.h <<_ACEOF
22598#define HAVE_MEMPCPY 1
8690e634 22599_ACEOF
c971b7fa 22600
6ec2e0f5
SDJ
22601fi
22602done
c971b7fa 22603
6ec2e0f5
SDJ
22604 if test $ac_cv_func_mempcpy = no; then
22605 HAVE_MEMPCPY=0
22606 fi
8690e634 22607
6ec2e0f5 22608 if test $HAVE_MEMPCPY = 0; then
8690e634
JK
22609
22610
22611
22612
8690e634 22613
6ec2e0f5
SDJ
22614
22615
22616
22617 gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext"
22618
22619
8690e634 22620 :
c971b7fa 22621
6ec2e0f5 22622 fi
c971b7fa 22623
8690e634 22624
8690e634 22625
8690e634 22626
6ec2e0f5
SDJ
22627
22628 GNULIB_MEMPCPY=1
22629
22630
22631
22632
22633
22634$as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
22635
22636
22637
22638
22639
22640
22641
22642
22643 if test $ac_cv_have_decl_memrchr = no; then
22644 HAVE_DECL_MEMRCHR=0
22645 fi
22646
22647 for ac_func in memrchr
22648do :
22649 ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
d0ac1c44 22650if test "x$ac_cv_func_memrchr" = xyes; then :
6ec2e0f5
SDJ
22651 cat >>confdefs.h <<_ACEOF
22652#define HAVE_MEMRCHR 1
c971b7fa 22653_ACEOF
6ec2e0f5 22654
c971b7fa 22655fi
6ec2e0f5 22656done
8690e634 22657
8690e634 22658
6ec2e0f5 22659 if test $ac_cv_func_memrchr = no; then
8690e634 22660
6ec2e0f5
SDJ
22661
22662
22663
22664
22665
22666
22667
22668 gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext"
22669
22670 :
c971b7fa
PA
22671 fi
22672
22673
c971b7fa 22674
c971b7fa 22675
c971b7fa 22676
6ec2e0f5
SDJ
22677 GNULIB_MEMRCHR=1
22678
22679
22680
22681
22682
22683$as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h
22684
22685
22686
22687
2d8adcbd 22688
8a99096f
SM
22689 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5
22690$as_echo_n "checking whether mkdir handles trailing slash... " >&6; }
22691if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then :
22692 $as_echo_n "(cached) " >&6
22693else
22694 rm -rf conftest.dir
22695 if test "$cross_compiling" = yes; then :
22696 case "$host_os" in
c0c3707f
CB
22697 # Guess yes on Linux systems.
22698 linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
22699 # Guess yes on glibc systems.
22700 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
22701 # Guess yes on MSVC, no on mingw.
22702 mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22703/* end confdefs.h. */
22704
22705#ifdef _MSC_VER
22706 Known
22707#endif
22708
22709_ACEOF
22710if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22711 $EGREP "Known" >/dev/null 2>&1; then :
22712 gl_cv_func_mkdir_trailing_slash_works="guessing yes"
22713else
22714 gl_cv_func_mkdir_trailing_slash_works="guessing no"
22715fi
22716rm -f conftest*
22717
22718 ;;
22719 # If we don't know, obey --enable-cross-guesses.
22720 *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
8a99096f
SM
22721 esac
22722
22723else
22724 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22725/* end confdefs.h. */
22726
22727# include <sys/types.h>
22728# include <sys/stat.h>
22729
22730int
22731main ()
22732{
22733return mkdir ("conftest.dir/", 0700);
22734 ;
22735 return 0;
22736}
22737_ACEOF
22738if ac_fn_c_try_run "$LINENO"; then :
22739 gl_cv_func_mkdir_trailing_slash_works=yes
22740else
22741 gl_cv_func_mkdir_trailing_slash_works=no
22742fi
22743rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22744 conftest.$ac_objext conftest.beam conftest.$ac_ext
22745fi
22746
22747 rm -rf conftest.dir
22748
22749
22750fi
22751{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5
22752$as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; }
22753 case "$gl_cv_func_mkdir_trailing_slash_works" in
22754 *yes) ;;
22755 *)
22756 REPLACE_MKDIR=1
22757 ;;
22758 esac
22759
22760 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5
22761$as_echo_n "checking whether mkdir handles trailing dot... " >&6; }
22762if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then :
22763 $as_echo_n "(cached) " >&6
22764else
22765 rm -rf conftest.dir
22766 if test "$cross_compiling" = yes; then :
22767 case "$host_os" in
c0c3707f
CB
22768 # Guess yes on glibc systems.
22769 *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
22770 # Guess yes on musl systems.
22771 *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
22772 # Guess no on native Windows.
22773 mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
22774 # If we don't know, obey --enable-cross-guesses.
22775 *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
8a99096f
SM
22776 esac
22777
22778else
22779 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22780/* end confdefs.h. */
22781
22782# include <sys/types.h>
22783# include <sys/stat.h>
22784
22785int
22786main ()
22787{
22788return !mkdir ("conftest.dir/./", 0700);
22789 ;
22790 return 0;
22791}
22792_ACEOF
22793if ac_fn_c_try_run "$LINENO"; then :
22794 gl_cv_func_mkdir_trailing_dot_works=yes
22795else
22796 gl_cv_func_mkdir_trailing_dot_works=no
22797fi
22798rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22799 conftest.$ac_objext conftest.beam conftest.$ac_ext
22800fi
22801
22802 rm -rf conftest.dir
22803
22804
22805fi
22806{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5
22807$as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; }
22808 case "$gl_cv_func_mkdir_trailing_dot_works" in
22809 *yes) ;;
22810 *)
22811 REPLACE_MKDIR=1
22812
22813$as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h
22814
22815 ;;
22816 esac
22817
22818 if test $REPLACE_MKDIR = 1; then
22819
22820
22821
22822
22823
22824
22825
22826
22827 gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext"
22828
22829 fi
22830
22831
e8d8cce6
SM
22832 for ac_func in mkdtemp
22833do :
22834 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
22835if test "x$ac_cv_func_mkdtemp" = xyes; then :
22836 cat >>confdefs.h <<_ACEOF
22837#define HAVE_MKDTEMP 1
22838_ACEOF
22839
22840fi
22841done
22842
22843 if test $ac_cv_func_mkdtemp = no; then
22844 HAVE_MKDTEMP=0
22845 fi
22846
22847 if test $HAVE_MKDTEMP = 0; then
22848
22849
22850
22851
22852
22853
22854
22855
22856 gl_LIBOBJS="$gl_LIBOBJS mkdtemp.$ac_objext"
22857
22858 :
22859
22860 fi
22861
22862
22863
22864
22865
22866 GNULIB_MKDTEMP=1
22867
22868
22869
22870
22871
22872$as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h
22873
22874
22875
22876
22877
2d8adcbd
MM
22878
22879
b3279b60
TT
22880
22881
b3279b60
TT
22882 if test $ac_cv_func_mkostemp != yes; then
22883 HAVE_MKOSTEMP=0
22884 fi
2d8adcbd 22885
b3279b60 22886 if test $HAVE_MKOSTEMP = 0; then
2d8adcbd 22887
2d8adcbd 22888
2d8adcbd 22889
2d8adcbd 22890
2d8adcbd
MM
22891
22892
22893
22894
b3279b60 22895 gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext"
2d8adcbd
MM
22896
22897
22898
b3279b60 22899 fi
2d8adcbd 22900
2d8adcbd 22901
b3279b60
TT
22902cat >>confdefs.h <<_ACEOF
22903#define GNULIB_MKOSTEMP 1
22904_ACEOF
2d8adcbd
MM
22905
22906
2d8adcbd
MM
22907
22908
22909
22910
22911
b3279b60 22912 GNULIB_MKOSTEMP=1
2d8adcbd
MM
22913
22914
22915
22916
22917
b3279b60 22918$as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h
2d8adcbd
MM
22919
22920
22921
22922
6ec2e0f5
SDJ
22923 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
22924
22925
22926
c971b7fa 22927
c971b7fa 22928
c971b7fa
PA
22929
22930
8690e634 22931
6ec2e0f5 22932 gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext"
8690e634 22933
6ec2e0f5 22934 fi
8690e634 22935
6ec2e0f5 22936 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
8690e634
JK
22937
22938
22939
22940
22941
22942
8690e634
JK
22943
22944
6ec2e0f5 22945 gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext"
8690e634 22946
a512b375 22947 fi
8690e634
JK
22948
22949
c0c3707f
CB
22950cat >>confdefs.h <<_ACEOF
22951#define GNULIB_MSVC_NOTHROW 1
22952_ACEOF
22953
22954
22955
22956
725e2999
JB
22957 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
22958$as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
22959if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then :
22960 $as_echo_n "(cached) " >&6
22961else
22962
22963 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22964/* end confdefs.h. */
22965#include <netinet/in.h>
22966int
22967main ()
22968{
22969
22970 ;
22971 return 0;
22972}
22973_ACEOF
22974if ac_fn_c_try_compile "$LINENO"; then :
22975 gl_cv_header_netinet_in_h_selfcontained=yes
22976else
22977 gl_cv_header_netinet_in_h_selfcontained=no
22978fi
22979rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22980
22981fi
22982{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
22983$as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
22984 if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
22985 NETINET_IN_H=''
22986 else
22987 NETINET_IN_H='netinet/in.h'
22988 for ac_header in netinet/in.h
22989do :
22990 ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
22991if test "x$ac_cv_header_netinet_in_h" = xyes; then :
22992 cat >>confdefs.h <<_ACEOF
22993#define HAVE_NETINET_IN_H 1
22994_ACEOF
22995
22996fi
22997
22998done
22999
23000
23001
23002
23003
23004
23005
725e2999
JB
23006
23007
23008
23009 if test $gl_cv_have_include_next = yes; then
23010 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
23011 else
23012 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
23013$as_echo_n "checking absolute name of <netinet/in.h>... " >&6; }
23014if ${gl_cv_next_netinet_in_h+:} false; then :
23015 $as_echo_n "(cached) " >&6
23016else
23017
23018 if test $ac_cv_header_netinet_in_h = yes; then
23019
23020
23021
23022
23023 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23024/* end confdefs.h. */
23025#include <netinet/in.h>
23026_ACEOF
23027 case "$host_os" in
23028 aix*) gl_absname_cpp="$ac_cpp -C" ;;
23029 *) gl_absname_cpp="$ac_cpp" ;;
23030 esac
23031
23032 case "$host_os" in
23033 mingw*)
23034 gl_dirsep_regex='[/\\]'
23035 ;;
23036 *)
23037 gl_dirsep_regex='\/'
23038 ;;
23039 esac
23040 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
23041 gl_header_literal_regex=`echo 'netinet/in.h' \
23042 | sed -e "$gl_make_literal_regex_sed"`
23043 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
23044 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
23045 s|^/[^/]|//&|
23046 p
23047 q
23048 }'
23049
23050 gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
23051 sed -n "$gl_absolute_header_sed"`
23052
23053 gl_header=$gl_cv_absolute_netinet_in_h
23054 gl_cv_next_netinet_in_h='"'$gl_header'"'
23055 else
23056 gl_cv_next_netinet_in_h='<'netinet/in.h'>'
23057 fi
23058
23059
23060fi
23061{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
23062$as_echo "$gl_cv_next_netinet_in_h" >&6; }
23063 fi
23064 NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
23065
23066 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
23067 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
23068 gl_next_as_first_directive='<'netinet/in.h'>'
23069 else
23070 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
23071 gl_next_as_first_directive=$gl_cv_next_netinet_in_h
23072 fi
23073 NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
23074
23075
23076
23077
23078 if test $ac_cv_header_netinet_in_h = yes; then
23079 HAVE_NETINET_IN_H=1
23080 else
23081 HAVE_NETINET_IN_H=0
23082 fi
23083
23084 fi
23085
23086 if test -n "$NETINET_IN_H"; then
23087 GL_GENERATE_NETINET_IN_H_TRUE=
23088 GL_GENERATE_NETINET_IN_H_FALSE='#'
23089else
23090 GL_GENERATE_NETINET_IN_H_TRUE='#'
23091 GL_GENERATE_NETINET_IN_H_FALSE=
23092fi
23093
23094
23095
23096
8690e634 23097
c0c3707f 23098
6ec2e0f5
SDJ
23099 case "$host_os" in
23100 mingw* | pw*)
23101 REPLACE_OPEN=1
23102 ;;
23103 *)
23104
c0c3707f
CB
23105 if test "$gl_cv_macro_O_CLOEXEC" != yes; then
23106 REPLACE_OPEN=1
23107 fi
472fa5ee
SM
23108
23109
c0c3707f 23110 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
6ec2e0f5 23111$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
d0ac1c44 23112if ${gl_cv_func_open_slash+:} false; then :
6ec2e0f5
SDJ
23113 $as_echo_n "(cached) " >&6
23114else
23115 # Assume that if we have lstat, we can also check symlinks.
c0c3707f
CB
23116 if test $ac_cv_func_lstat = yes; then
23117 touch conftest.tmp
23118 ln -s conftest.tmp conftest.lnk
23119 fi
23120 if test "$cross_compiling" = yes; then :
8690e634 23121
c0c3707f
CB
23122 case "$host_os" in
23123 freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
23124 gl_cv_func_open_slash="guessing no" ;;
23125 *)
23126 gl_cv_func_open_slash="guessing yes" ;;
23127 esac
8690e634 23128
6ec2e0f5
SDJ
23129else
23130 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23131/* end confdefs.h. */
23132
23133#include <fcntl.h>
23134#if HAVE_UNISTD_H
23135# include <unistd.h>
23136#endif
23137int main ()
23138{
23139 int result = 0;
23140#if HAVE_LSTAT
23141 if (open ("conftest.lnk/", O_RDONLY) != -1)
23142 result |= 1;
23143#endif
23144 if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
23145 result |= 2;
23146 return result;
23147}
23148_ACEOF
23149if ac_fn_c_try_run "$LINENO"; then :
23150 gl_cv_func_open_slash=yes
23151else
23152 gl_cv_func_open_slash=no
23153fi
23154rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23155 conftest.$ac_objext conftest.beam conftest.$ac_ext
23156fi
8690e634 23157
c0c3707f 23158 rm -f conftest.sl conftest.tmp conftest.lnk
8690e634 23159
6ec2e0f5
SDJ
23160fi
23161{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
23162$as_echo "$gl_cv_func_open_slash" >&6; }
c0c3707f
CB
23163 case "$gl_cv_func_open_slash" in
23164 *no)
8690e634 23165
6ec2e0f5 23166$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
8690e634 23167
6ec2e0f5
SDJ
23168 ;;
23169 esac
8690e634 23170
c0c3707f
CB
23171 case "$gl_cv_func_open_slash" in
23172 *no)
23173 REPLACE_OPEN=1
23174 ;;
23175 esac
23176 ;;
23177 esac
472fa5ee 23178
c0c3707f 23179 if test $REPLACE_OPEN = 0; then
472fa5ee
SM
23180
23181
23182
6ec2e0f5
SDJ
23183 if test $ac_cv_func_fchdir = no; then
23184 HAVE_FCHDIR=0
23185 fi
c971b7fa 23186
6ec2e0f5
SDJ
23187 if test $HAVE_FCHDIR = 0; then
23188 REPLACE_OPEN=1
23189 fi
23190 fi
c971b7fa
PA
23191
23192
23193
6ec2e0f5 23194 if test $REPLACE_OPEN = 1; then
c971b7fa
PA
23195
23196
23197
23198
23199
c971b7fa
PA
23200
23201
c971b7fa 23202
6ec2e0f5 23203 gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
c971b7fa 23204
c971b7fa
PA
23205
23206
6ec2e0f5
SDJ
23207 :
23208
a512b375 23209 fi
c971b7fa
PA
23210
23211
23212
23213
23214
6ec2e0f5 23215 GNULIB_OPEN=1
c971b7fa
PA
23216
23217
23218
23219
23220
6ec2e0f5 23221$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
c971b7fa
PA
23222
23223
23224
23225
23226
c971b7fa 23227
c971b7fa 23228
472fa5ee 23229
63ce7108 23230
c0c3707f
CB
23231 case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
23232 yes+*yes+yes)
6ec2e0f5
SDJ
23233 ;;
23234 yes+*)
c0c3707f 23235 # Solaris 10 lacks O_CLOEXEC.
6ec2e0f5
SDJ
23236 # Solaris 9 has *at functions, but uniformly mishandles trailing
23237 # slash in all of them.
23238 REPLACE_OPENAT=1
23239 ;;
23240 *)
23241 HAVE_OPENAT=0
23242 ;;
23243 esac
63ce7108 23244
6ec2e0f5 23245 if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
63ce7108 23246
63ce7108 23247
63ce7108 23248
63ce7108 23249
63ce7108
TT
23250
23251
63ce7108 23252
63ce7108 23253
6ec2e0f5 23254 gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext"
63ce7108
TT
23255
23256
23257
6ec2e0f5 23258 :
63ce7108 23259
6ec2e0f5 23260 fi
63ce7108
TT
23261
23262
6ec2e0f5
SDJ
23263cat >>confdefs.h <<_ACEOF
23264#define GNULIB_OPENAT 1
23265_ACEOF
63ce7108 23266
63ce7108 23267
63ce7108
TT
23268
23269
23270
23271
6ec2e0f5 23272 GNULIB_OPENAT=1
63ce7108 23273
63ce7108 23274
63ce7108 23275
63ce7108 23276
63ce7108 23277
6ec2e0f5 23278$as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h
63ce7108
TT
23279
23280
63ce7108 23281
63ce7108 23282
63ce7108 23283
63ce7108 23284
6ec2e0f5
SDJ
23285 for ac_func in opendir
23286do :
23287 ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
d0ac1c44 23288if test "x$ac_cv_func_opendir" = xyes; then :
6ec2e0f5
SDJ
23289 cat >>confdefs.h <<_ACEOF
23290#define HAVE_OPENDIR 1
63ce7108 23291_ACEOF
6ec2e0f5 23292
63ce7108 23293fi
6ec2e0f5 23294done
63ce7108 23295
6ec2e0f5
SDJ
23296 if test $ac_cv_func_opendir = no; then
23297 HAVE_OPENDIR=0
23298 fi
63ce7108 23299
6ec2e0f5
SDJ
23300
23301
23302
23303 if test $ac_cv_func_fchdir = no; then
23304 HAVE_FCHDIR=0
63ce7108 23305 fi
63ce7108 23306
6ec2e0f5
SDJ
23307 if test $HAVE_FCHDIR = 0; then
23308 if test $HAVE_OPENDIR = 1; then
23309 REPLACE_OPENDIR=1
23310 fi
23311 fi
23312
23313 case $host_os,$HAVE_OPENDIR in
23314 os2*,1)
23315 REPLACE_OPENDIR=1;;
23316 esac
23317
23318 if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
63ce7108
TT
23319
23320
23321
23322
23323
23324
23325
23326
6ec2e0f5 23327 gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext"
63ce7108
TT
23328
23329 fi
23330
23331
23332
23333
23334
6ec2e0f5 23335 GNULIB_OPENDIR=1
63ce7108
TT
23336
23337
23338
23339
63ce7108 23340
6ec2e0f5 23341$as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
63ce7108
TT
23342
23343
23344
23345
23346
23347
23348
2196f55f
YQ
23349
23350
8424cc97
SM
23351
23352 for ac_func in rawmemchr
23353do :
23354 ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr"
d0ac1c44 23355if test "x$ac_cv_func_rawmemchr" = xyes; then :
8424cc97
SM
23356 cat >>confdefs.h <<_ACEOF
23357#define HAVE_RAWMEMCHR 1
23358_ACEOF
23359
23360fi
23361done
23362
23363 if test $ac_cv_func_rawmemchr = no; then
23364 HAVE_RAWMEMCHR=0
23365 fi
23366
23367 if test $HAVE_RAWMEMCHR = 0; then
23368
23369
23370
23371
23372
23373
23374
23375
23376 gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext"
23377
23378 :
23379 fi
23380
23381
23382
23383
23384
23385 GNULIB_RAWMEMCHR=1
23386
23387
23388
23389
23390
23391$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
23392
23393
23394
23395
23396
23397
6ec2e0f5
SDJ
23398 for ac_func in readdir
23399do :
23400 ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
d0ac1c44 23401if test "x$ac_cv_func_readdir" = xyes; then :
6ec2e0f5
SDJ
23402 cat >>confdefs.h <<_ACEOF
23403#define HAVE_READDIR 1
23404_ACEOF
23405
23406fi
23407done
23408
23409 if test $ac_cv_func_readdir = no; then
23410 HAVE_READDIR=0
23411 fi
23412
23413 if test $HAVE_READDIR = 0; then
23414
23415
23416
23417
23418
23419
23420
23421
23422 gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext"
23423
23424 fi
23425
23426
23427
23428
23429
23430 GNULIB_READDIR=1
23431
23432
23433
23434
23435
23436$as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h
23437
23438
23439
23440
23441
23442
2196f55f
YQ
23443 if test $ac_cv_func_readlink = no; then
23444 HAVE_READLINK=0
23445 else
23446 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
23447$as_echo_n "checking whether readlink signature is correct... " >&6; }
d0ac1c44 23448if ${gl_cv_decl_readlink_works+:} false; then :
2196f55f
YQ
23449 $as_echo_n "(cached) " >&6
23450else
23451 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23452/* end confdefs.h. */
23453#include <unistd.h>
23454 /* Cause compilation failure if original declaration has wrong type. */
23455 ssize_t readlink (const char *, char *, size_t);
23456int
23457main ()
23458{
23459
23460 ;
23461 return 0;
23462}
23463_ACEOF
23464if ac_fn_c_try_compile "$LINENO"; then :
23465 gl_cv_decl_readlink_works=yes
23466else
23467 gl_cv_decl_readlink_works=no
23468fi
23469rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23470fi
23471{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
23472$as_echo "$gl_cv_decl_readlink_works" >&6; }
23473 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
23474$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
d0ac1c44 23475if ${gl_cv_func_readlink_works+:} false; then :
2196f55f
YQ
23476 $as_echo_n "(cached) " >&6
23477else
23478 # We have readlink, so assume ln -s works.
23479 ln -s conftest.no-such conftest.link
23480 ln -s conftest.link conftest.lnk2
23481 if test "$cross_compiling" = yes; then :
23482 case "$host_os" in
c0c3707f
CB
23483 # Guess yes on Linux systems.
23484 linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;;
23485 # Guess yes on glibc systems.
23486 *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;;
23487 # If we don't know, obey --enable-cross-guesses.
23488 *) gl_cv_func_readlink_works="$gl_cross_guess_normal" ;;
2196f55f
YQ
23489 esac
23490
23491else
23492 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23493/* end confdefs.h. */
23494#include <unistd.h>
23495
23496int
23497main ()
23498{
23499char buf[20];
23500 return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
23501 ;
23502 return 0;
23503}
23504_ACEOF
23505if ac_fn_c_try_run "$LINENO"; then :
23506 gl_cv_func_readlink_works=yes
23507else
23508 gl_cv_func_readlink_works=no
23509fi
23510rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23511 conftest.$ac_objext conftest.beam conftest.$ac_ext
23512fi
23513
23514 rm -f conftest.link conftest.lnk2
23515fi
23516{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5
23517$as_echo "$gl_cv_func_readlink_works" >&6; }
23518 case "$gl_cv_func_readlink_works" in
23519 *yes)
23520 if test "$gl_cv_decl_readlink_works" != yes; then
23521 REPLACE_READLINK=1
23522 fi
23523 ;;
23524 *)
23525
23526$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
23527
23528 REPLACE_READLINK=1
23529 ;;
23530 esac
23531 fi
23532
23533 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
23534
23535
23536
23537
23538
23539
23540
23541
23542 gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
23543
23544
23545 :
23546
23547 fi
23548
23549
23550
23551
23552
23553 GNULIB_READLINK=1
23554
23555
23556
23557
23558
23559$as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
23560
23561
23562
23563
6a29c58e
YQ
23564
23565
6ec2e0f5
SDJ
23566 if test $gl_cv_func_malloc_posix = yes; then
23567
23568$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
23569
23570 else
23571 REPLACE_REALLOC=1
23572 fi
23573
23574 if test $REPLACE_REALLOC = 1; then
23575
23576
23577
23578
23579
23580
23581
23582
23583 gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
23584
23585 fi
23586
23587
23588
23589
23590
23591 GNULIB_REALLOC_POSIX=1
23592
23593
23594
23595
23596
23597$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
23598
23599
23600
23601
23602
23603
6a29c58e
YQ
23604
23605
23606 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5
23607$as_echo_n "checking whether rename honors trailing slash on destination... " >&6; }
d0ac1c44 23608if ${gl_cv_func_rename_slash_dst_works+:} false; then :
6a29c58e
YQ
23609 $as_echo_n "(cached) " >&6
23610else
23611 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
23612 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 23613 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
23614 # Assume that if we have lstat, we can also check symlinks.
23615 if test $ac_cv_func_lstat = yes; then
23616 ln -s conftest.f conftest.lnk
23617 fi
23618 if test "$cross_compiling" = yes; then :
23619 case "$host_os" in
c0c3707f
CB
23620 # Guess yes on Linux systems.
23621 linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
23622 # Guess yes on glibc systems.
23623 *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
23624 # Guess no on native Windows.
23625 mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
23626 # If we don't know, obey --enable-cross-guesses.
23627 *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
23628 esac
23629
23630else
23631 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23632/* end confdefs.h. */
23633
23634# include <stdio.h>
23635# include <stdlib.h>
23636
23637int
23638main ()
23639{
23640int result = 0;
23641 if (rename ("conftest.f1", "conftest.f2/") == 0)
23642 result |= 1;
23643 if (rename ("conftest.d1", "conftest.d2/") != 0)
23644 result |= 2;
23645#if HAVE_LSTAT
23646 if (rename ("conftest.f", "conftest.lnk/") == 0)
23647 result |= 4;
23648#endif
23649 return result;
23650
23651 ;
23652 return 0;
23653}
23654_ACEOF
23655if ac_fn_c_try_run "$LINENO"; then :
23656 gl_cv_func_rename_slash_dst_works=yes
23657else
23658 gl_cv_func_rename_slash_dst_works=no
23659fi
23660rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23661 conftest.$ac_objext conftest.beam conftest.$ac_ext
23662fi
23663
23664 rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
23665
23666fi
23667{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5
23668$as_echo "$gl_cv_func_rename_slash_dst_works" >&6; }
23669 case "$gl_cv_func_rename_slash_dst_works" in
23670 *yes) ;;
23671 *)
23672 REPLACE_RENAME=1
23673
23674$as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h
23675
23676 ;;
23677 esac
23678
23679 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5
23680$as_echo_n "checking whether rename honors trailing slash on source... " >&6; }
d0ac1c44 23681if ${gl_cv_func_rename_slash_src_works+:} false; then :
6a29c58e
YQ
23682 $as_echo_n "(cached) " >&6
23683else
23684 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
23685 touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
d0ac1c44 23686 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
23687 # Assume that if we have lstat, we can also check symlinks.
23688 if test $ac_cv_func_lstat = yes; then
23689 ln -s conftest.f conftest.lnk
23690 fi
23691 if test "$cross_compiling" = yes; then :
23692 case "$host_os" in
c0c3707f
CB
23693 # Guess yes on Linux systems.
23694 linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
23695 # Guess yes on glibc systems.
23696 *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
23697 # Guess yes on native Windows.
23698 mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
23699 # If we don't know, obey --enable-cross-guesses.
23700 *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
23701 esac
23702
23703else
23704 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23705/* end confdefs.h. */
23706
23707# include <stdio.h>
23708# include <stdlib.h>
23709
23710int
23711main ()
23712{
23713int result = 0;
23714 if (rename ("conftest.f1/", "conftest.d3") == 0)
23715 result |= 1;
23716 if (rename ("conftest.d1/", "conftest.d2") != 0)
23717 result |= 2;
23718#if HAVE_LSTAT
23719 if (rename ("conftest.lnk/", "conftest.f") == 0)
23720 result |= 4;
23721#endif
23722 return result;
23723
23724 ;
23725 return 0;
23726}
23727_ACEOF
23728if ac_fn_c_try_run "$LINENO"; then :
23729 gl_cv_func_rename_slash_src_works=yes
23730else
23731 gl_cv_func_rename_slash_src_works=no
23732fi
23733rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23734 conftest.$ac_objext conftest.beam conftest.$ac_ext
23735fi
23736
23737 rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
23738
23739fi
23740{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5
23741$as_echo "$gl_cv_func_rename_slash_src_works" >&6; }
23742 case "$gl_cv_func_rename_slash_src_works" in
23743 *yes) ;;
23744 *)
23745 REPLACE_RENAME=1
23746
23747$as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h
23748
23749 ;;
23750 esac
23751
23752
23753 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5
23754$as_echo_n "checking whether rename manages hard links correctly... " >&6; }
d0ac1c44 23755if ${gl_cv_func_rename_link_works+:} false; then :
6a29c58e
YQ
23756 $as_echo_n "(cached) " >&6
23757else
23758 if test $ac_cv_func_link = yes; then
c0c3707f
CB
23759 if test $cross_compiling != yes; then
23760 rm -rf conftest.f conftest.f1 conftest.f2
23761 if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
23762 set x `ls -i conftest.f conftest.f1` && test "" = ""; then
23763 if test "$cross_compiling" = yes; then :
23764 :
6a29c58e
YQ
23765
23766else
23767 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23768/* end confdefs.h. */
23769
c0c3707f
CB
23770# include <errno.h>
23771# include <stdio.h>
23772# include <stdlib.h>
23773# include <unistd.h>
6a29c58e
YQ
23774
23775int
23776main ()
23777{
23778int result = 0;
c0c3707f
CB
23779 if (rename ("conftest.f", "conftest.f1"))
23780 result |= 1;
23781 if (unlink ("conftest.f1"))
23782 result |= 2;
23783
23784 /* Allow either the POSIX-required behavior, where the
23785 previous rename kept conftest.f, or the (better) NetBSD
23786 behavior, where it removed conftest.f. */
23787 if (rename ("conftest.f", "conftest.f") != 0
23788 && errno != ENOENT)
23789 result |= 4;
23790
23791 if (rename ("conftest.f1", "conftest.f1") == 0)
23792 result |= 8;
23793 if (rename ("conftest.f2", "conftest.f2") != 0)
23794 result |= 16;
23795 return result;
6a29c58e
YQ
23796
23797 ;
23798 return 0;
23799}
23800_ACEOF
23801if ac_fn_c_try_run "$LINENO"; then :
23802 gl_cv_func_rename_link_works=yes
23803else
23804 gl_cv_func_rename_link_works=no
23805fi
23806rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23807 conftest.$ac_objext conftest.beam conftest.$ac_ext
23808fi
23809
c0c3707f
CB
23810 else
23811 gl_cv_func_rename_link_works="guessing no"
23812 fi
23813 rm -rf conftest.f conftest.f1 conftest.f2
6a29c58e 23814 else
c0c3707f
CB
23815 case "$host_os" in
23816 # Guess yes on Linux systems.
23817 linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
23818 # Guess yes on glibc systems.
23819 *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
23820 # Guess yes on native Windows.
23821 mingw*) gl_cv_func_rename_link_works="guessing yes" ;;
23822 # If we don't know, obey --enable-cross-guesses.
23823 *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
23824 esac
6a29c58e 23825 fi
6a29c58e
YQ
23826 else
23827 gl_cv_func_rename_link_works=yes
23828 fi
23829
23830fi
23831{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5
23832$as_echo "$gl_cv_func_rename_link_works" >&6; }
23833 case "$gl_cv_func_rename_link_works" in
23834 *yes) ;;
23835 *)
23836 REPLACE_RENAME=1
23837
23838$as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h
23839
23840 ;;
23841 esac
23842
23843 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5
23844$as_echo_n "checking whether rename manages existing destinations correctly... " >&6; }
d0ac1c44 23845if ${gl_cv_func_rename_dest_works+:} false; then :
6a29c58e
YQ
23846 $as_echo_n "(cached) " >&6
23847else
23848 rm -rf conftest.f conftest.d1 conftest.d2
23849 touch conftest.f && mkdir conftest.d1 conftest.d2 ||
d0ac1c44 23850 as_fn_error $? "cannot create temporary files" "$LINENO" 5
6a29c58e
YQ
23851 if test "$cross_compiling" = yes; then :
23852 case "$host_os" in
c0c3707f
CB
23853 # Guess yes on Linux systems.
23854 linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
23855 # Guess yes on glibc systems.
23856 *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
23857 # Guess no on native Windows.
23858 mingw*) gl_cv_func_rename_dest_works="guessing no" ;;
23859 # If we don't know, obey --enable-cross-guesses.
23860 *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
23861 esac
23862
23863else
23864 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23865/* end confdefs.h. */
23866
23867# include <stdio.h>
23868# include <stdlib.h>
23869
23870int
23871main ()
23872{
23873int result = 0;
23874 if (rename ("conftest.d1", "conftest.d2") != 0)
23875 result |= 1;
23876 if (rename ("conftest.d2", "conftest.f") == 0)
23877 result |= 2;
23878 return result;
23879
23880 ;
23881 return 0;
23882}
23883_ACEOF
23884if ac_fn_c_try_run "$LINENO"; then :
23885 gl_cv_func_rename_dest_works=yes
23886else
23887 gl_cv_func_rename_dest_works=no
23888fi
23889rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23890 conftest.$ac_objext conftest.beam conftest.$ac_ext
23891fi
23892
23893 rm -rf conftest.f conftest.d1 conftest.d2
23894
23895fi
23896{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5
23897$as_echo "$gl_cv_func_rename_dest_works" >&6; }
23898 case "$gl_cv_func_rename_dest_works" in
23899 *yes) ;;
23900 *)
23901 REPLACE_RENAME=1
23902
23903$as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
23904
23905 ;;
23906 esac
23907
23908 if test $REPLACE_RENAME = 1; then
23909
23910
23911
23912
23913
23914
23915
23916
23917 gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext"
23918
23919 fi
23920
23921
23922
23923
23924
23925 GNULIB_RENAME=1
23926
23927
23928
23929
23930
23931$as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h
23932
23933
23934
23935
23936
23937
6ec2e0f5
SDJ
23938 for ac_func in rewinddir
23939do :
23940 ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir"
d0ac1c44 23941if test "x$ac_cv_func_rewinddir" = xyes; then :
6ec2e0f5
SDJ
23942 cat >>confdefs.h <<_ACEOF
23943#define HAVE_REWINDDIR 1
23944_ACEOF
23945
23946fi
23947done
23948
23949 if test $ac_cv_func_rewinddir = no; then
23950 HAVE_REWINDDIR=0
23951 fi
23952
23953 if test $HAVE_REWINDDIR = 0; then
23954
23955
23956
23957
23958
23959
23960
23961
23962 gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext"
23963
23964 fi
23965
23966
23967
23968
23969
23970 GNULIB_REWINDDIR=1
23971
23972
23973
23974
23975
23976$as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h
23977
23978
23979
23980
23981
23982
6a29c58e
YQ
23983 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
23984$as_echo_n "checking whether rmdir works... " >&6; }
d0ac1c44 23985if ${gl_cv_func_rmdir_works+:} false; then :
6a29c58e
YQ
23986 $as_echo_n "(cached) " >&6
23987else
23988 mkdir conftest.dir
23989 touch conftest.file
23990 if test "$cross_compiling" = yes; then :
23991 case "$host_os" in
c0c3707f
CB
23992 # Guess yes on Linux systems.
23993 linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
23994 # Guess yes on glibc systems.
23995 *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
23996 # Guess no on native Windows.
23997 mingw*) gl_cv_func_rmdir_works="guessing no" ;;
23998 # If we don't know, obey --enable-cross-guesses.
23999 *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
6a29c58e
YQ
24000 esac
24001
24002else
24003 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24004/* end confdefs.h. */
24005#include <stdio.h>
24006 #include <errno.h>
24007 #if HAVE_UNISTD_H
24008 # include <unistd.h>
24009 #else /* on Windows with MSVC */
24010 # include <direct.h>
24011 #endif
24012
24013int
24014main ()
24015{
24016int result = 0;
24017 if (!rmdir ("conftest.file/"))
24018 result |= 1;
24019 else if (errno != ENOTDIR)
24020 result |= 2;
24021 if (!rmdir ("conftest.dir/./"))
24022 result |= 4;
24023 return result;
24024
24025 ;
24026 return 0;
24027}
24028_ACEOF
24029if ac_fn_c_try_run "$LINENO"; then :
24030 gl_cv_func_rmdir_works=yes
24031else
24032 gl_cv_func_rmdir_works=no
24033fi
24034rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24035 conftest.$ac_objext conftest.beam conftest.$ac_ext
24036fi
24037
24038 rm -rf conftest.dir conftest.file
24039fi
24040{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
24041$as_echo "$gl_cv_func_rmdir_works" >&6; }
24042 case "$gl_cv_func_rmdir_works" in
24043 *yes) ;;
24044 *)
24045 REPLACE_RMDIR=1
24046 ;;
24047 esac
24048
24049 if test $REPLACE_RMDIR = 1; then
24050
24051
24052
24053
24054
24055
24056
24057
24058 gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext"
24059
24060 fi
24061
24062
24063
24064
24065
24066 GNULIB_RMDIR=1
24067
24068
24069
24070
24071
24072$as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
24073
24074
24075
24076
0750520d 24077
5e8754f9
SDJ
24078
24079
24080
3d99e817
AK
24081 if test $ac_cv_func_setenv = no; then
24082 HAVE_SETENV=0
24083 else
24084 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
24085$as_echo_n "checking whether setenv validates arguments... " >&6; }
d0ac1c44 24086if ${gl_cv_func_setenv_works+:} false; then :
3d99e817
AK
24087 $as_echo_n "(cached) " >&6
24088else
24089 if test "$cross_compiling" = yes; then :
24090 case "$host_os" in
c0c3707f
CB
24091 # Guess yes on glibc systems.
24092 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
24093 # Guess yes on musl systems.
24094 *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
24095 # If we don't know, obey --enable-cross-guesses.
24096 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
24097 esac
24098
24099else
24100 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24101/* end confdefs.h. */
24102
24103 #include <stdlib.h>
24104 #include <errno.h>
24105 #include <string.h>
24106
24107int
24108main ()
24109{
24110
24111 int result = 0;
24112 {
24113 if (setenv ("", "", 0) != -1)
24114 result |= 1;
24115 else if (errno != EINVAL)
24116 result |= 2;
24117 }
24118 {
24119 if (setenv ("a", "=", 1) != 0)
24120 result |= 4;
24121 else if (strcmp (getenv ("a"), "=") != 0)
24122 result |= 8;
24123 }
24124 return result;
24125
24126 ;
24127 return 0;
24128}
24129_ACEOF
24130if ac_fn_c_try_run "$LINENO"; then :
24131 gl_cv_func_setenv_works=yes
24132else
24133 gl_cv_func_setenv_works=no
24134fi
24135rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24136 conftest.$ac_objext conftest.beam conftest.$ac_ext
24137fi
24138
24139fi
24140{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
24141$as_echo "$gl_cv_func_setenv_works" >&6; }
24142 case "$gl_cv_func_setenv_works" in
24143 *yes) ;;
24144 *)
24145 REPLACE_SETENV=1
24146 ;;
24147 esac
24148 fi
24149
24150 if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
24151
24152
24153
24154
24155
24156
24157
24158
24159 gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext"
24160
24161 fi
24162
24163
24164
24165
24166
24167 GNULIB_SETENV=1
24168
24169
24170
24171
24172
24173$as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
24174
24175
24176
24177
24178
0750520d
PA
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188 if test $gl_cv_have_include_next = yes; then
24189 gl_cv_next_signal_h='<'signal.h'>'
24190 else
24191 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
24192$as_echo_n "checking absolute name of <signal.h>... " >&6; }
d0ac1c44 24193if ${gl_cv_next_signal_h+:} false; then :
0750520d
PA
24194 $as_echo_n "(cached) " >&6
24195else
24196
24197
24198
24199 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24200/* end confdefs.h. */
24201#include <signal.h>
24202_ACEOF
24203 case "$host_os" in
24204 aix*) gl_absname_cpp="$ac_cpp -C" ;;
24205 *) gl_absname_cpp="$ac_cpp" ;;
24206 esac
24207
24208 case "$host_os" in
24209 mingw*)
24210 gl_dirsep_regex='[/\\]'
24211 ;;
24212 *)
24213 gl_dirsep_regex='\/'
24214 ;;
24215 esac
24216 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
24217 gl_header_literal_regex=`echo 'signal.h' \
24218 | sed -e "$gl_make_literal_regex_sed"`
24219 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
24220 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
24221 s|^/[^/]|//&|
24222 p
24223 q
24224 }'
24225
24226 gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
24227 sed -n "$gl_absolute_header_sed"`
24228
24229 gl_header=$gl_cv_absolute_signal_h
24230 gl_cv_next_signal_h='"'$gl_header'"'
24231
24232
24233fi
24234{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
24235$as_echo "$gl_cv_next_signal_h" >&6; }
24236 fi
24237 NEXT_SIGNAL_H=$gl_cv_next_signal_h
24238
24239 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
24240 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
24241 gl_next_as_first_directive='<'signal.h'>'
24242 else
24243 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
24244 gl_next_as_first_directive=$gl_cv_next_signal_h
24245 fi
24246 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
24247
24248
24249
24250
24251
24252# AIX declares sig_atomic_t to already include volatile, and C89 compilers
24253# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
24254 ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
24255#include <signal.h>
24256
24257"
d0ac1c44 24258if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then :
0750520d
PA
24259
24260else
24261 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
24262fi
24263
24264
24265
24266
24267
24268
24269
24270 ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
24271#include <signal.h>
24272
24273"
d0ac1c44 24274if test "x$ac_cv_type_sighandler_t" = xyes; then :
0750520d
PA
24275
24276else
24277 HAVE_SIGHANDLER_T=0
24278fi
24279
24280
24281
0750520d 24282
0750520d
PA
24283
24284
725e2999
JB
24285 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
24286/* <sys/types.h> is not needed according to POSIX, but the
24287 <sys/socket.h> in i386-unknown-freebsd4.10 and
24288 powerpc-apple-darwin5.5 required it. */
24289#include <sys/types.h>
24290#if HAVE_SYS_SOCKET_H
24291# include <sys/socket.h>
24292#elif HAVE_WS2TCPIP_H
24293# include <ws2tcpip.h>
24294#endif
24295
24296"
24297if test "x$ac_cv_type_socklen_t" = xyes; then :
24298
24299else
24300 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
24301$as_echo_n "checking for socklen_t equivalent... " >&6; }
c0c3707f 24302if ${gl_cv_socklen_t_equiv+:} false; then :
725e2999
JB
24303 $as_echo_n "(cached) " >&6
24304else
24305 # Systems have either "struct sockaddr *" or
24306 # "void *" as the second argument to getpeername
24307 gl_cv_socklen_t_equiv=
24308 for arg2 in "struct sockaddr" void; do
24309 for t in int size_t "unsigned int" "long int" "unsigned long int"; do
24310 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24311/* end confdefs.h. */
24312#include <sys/types.h>
24313 #include <sys/socket.h>
24314
24315 int getpeername (int, $arg2 *, $t *);
24316int
24317main ()
24318{
24319$t len;
24320 getpeername (0, 0, &len);
24321 ;
24322 return 0;
24323}
24324_ACEOF
24325if ac_fn_c_try_compile "$LINENO"; then :
24326 gl_cv_socklen_t_equiv="$t"
24327fi
24328rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24329 test "$gl_cv_socklen_t_equiv" != "" && break
24330 done
24331 test "$gl_cv_socklen_t_equiv" != "" && break
24332 done
c0c3707f
CB
24333 if test "$gl_cv_socklen_t_equiv" = ""; then
24334 as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
24335 fi
725e2999
JB
24336
24337fi
c0c3707f 24338{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
725e2999
JB
24339$as_echo "$gl_cv_socklen_t_equiv" >&6; }
24340
24341cat >>confdefs.h <<_ACEOF
24342#define socklen_t $gl_cv_socklen_t_equiv
24343_ACEOF
24344
24345fi
24346
0750520d 24347
63ce7108
TT
24348 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
24349$as_echo_n "checking for ssize_t... " >&6; }
d0ac1c44 24350if ${gt_cv_ssize_t+:} false; then :
63ce7108
TT
24351 $as_echo_n "(cached) " >&6
24352else
24353 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24354/* end confdefs.h. */
24355#include <sys/types.h>
24356int
24357main ()
24358{
24359int x = sizeof (ssize_t *) + sizeof (ssize_t);
24360 return !x;
24361 ;
24362 return 0;
24363}
24364_ACEOF
24365if ac_fn_c_try_compile "$LINENO"; then :
24366 gt_cv_ssize_t=yes
24367else
24368 gt_cv_ssize_t=no
24369fi
24370rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24371fi
24372{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
24373$as_echo "$gt_cv_ssize_t" >&6; }
24374 if test $gt_cv_ssize_t = no; then
24375
24376$as_echo "#define ssize_t int" >>confdefs.h
24377
24378 fi
24379
24380
24381
24382
472fa5ee 24383
c0c3707f
CB
24384 case "$host_os" in
24385 mingw*)
24386 REPLACE_STAT=1
24387 ;;
24388 *)
24389 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
24390$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
24391if ${gl_cv_func_stat_file_slash+:} false; then :
2196f55f
YQ
24392 $as_echo_n "(cached) " >&6
24393else
c0c3707f
CB
24394 touch conftest.tmp
24395 # Assume that if we have lstat, we can also check symlinks.
24396 if test $ac_cv_func_lstat = yes; then
24397 ln -s conftest.tmp conftest.lnk
24398 fi
24399 if test "$cross_compiling" = yes; then :
24400 case "$host_os" in
24401 # Guess yes on Linux systems.
24402 linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
24403 # Guess yes on glibc systems.
24404 *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
24405 # If we don't know, obey --enable-cross-guesses.
24406 *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
24407 esac
24408
2196f55f
YQ
24409else
24410 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24411/* end confdefs.h. */
24412#include <sys/stat.h>
24413
24414int
24415main ()
24416{
c0c3707f
CB
24417int result = 0;
24418 struct stat st;
24419 if (!stat ("conftest.tmp/", &st))
24420 result |= 1;
24421#if HAVE_LSTAT
24422 if (!stat ("conftest.lnk/", &st))
24423 result |= 2;
24424#endif
24425 return result;
24426
2196f55f
YQ
24427 ;
24428 return 0;
24429}
24430_ACEOF
24431if ac_fn_c_try_run "$LINENO"; then :
c0c3707f 24432 gl_cv_func_stat_file_slash=yes
2196f55f 24433else
c0c3707f 24434 gl_cv_func_stat_file_slash=no
2196f55f
YQ
24435fi
24436rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24437 conftest.$ac_objext conftest.beam conftest.$ac_ext
24438fi
24439
c0c3707f 24440 rm -f conftest.tmp conftest.lnk
2196f55f 24441fi
c0c3707f
CB
24442{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
24443$as_echo "$gl_cv_func_stat_file_slash" >&6; }
24444 case $gl_cv_func_stat_file_slash in
24445 *no)
24446 REPLACE_STAT=1
24447
24448$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
24449;;
24450 esac
24451 case $host_os in
24452 solaris*)
24453 REPLACE_FSTAT=1 ;;
24454 esac
24455 ;;
24456 esac
24457
24458 if test $REPLACE_STAT = 1; then
24459
24460
24461
24462
24463
24464
24465
24466
24467 gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
24468
24469 case "$host_os" in
24470 mingw*)
24471
24472
24473
24474
24475
24476
24477
24478
24479 gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
24480
24481 ;;
24482 esac
24483
24484
24485 :
24486
24487 fi
24488
24489
24490
24491
24492
24493 GNULIB_STAT=1
24494
24495
24496
24497
24498
24499$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
24500
24501
24502
24503
7a6dbc2f 24504
c0c3707f
CB
24505
24506
24507 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>
24508 #include <sys/stat.h>
24509"
24510if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
24511
24512cat >>confdefs.h <<_ACEOF
24513#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
24514_ACEOF
24515
24516{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
24517$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
24518if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
24519 $as_echo_n "(cached) " >&6
2196f55f 24520else
5e8754f9
SDJ
24521 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24522/* end confdefs.h. */
c0c3707f
CB
24523
24524 #include <sys/types.h>
24525 #include <sys/stat.h>
24526 #if HAVE_SYS_TIME_H
24527 # include <sys/time.h>
24528 #endif
24529 #include <time.h>
24530 struct timespec ts;
24531 struct stat st;
7a6dbc2f 24532
5e8754f9
SDJ
24533int
24534main ()
24535{
c0c3707f
CB
24536
24537 st.st_atim = ts;
7a6dbc2f 24538
5e8754f9
SDJ
24539 ;
24540 return 0;
24541}
24542_ACEOF
c0c3707f
CB
24543if ac_fn_c_try_compile "$LINENO"; then :
24544 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
5e8754f9 24545else
c0c3707f 24546 ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
2196f55f 24547fi
c0c3707f 24548rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2196f55f 24549fi
c0c3707f
CB
24550{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
24551$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
24552 if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
2196f55f 24553
c0c3707f 24554$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
2196f55f 24555
c0c3707f
CB
24556 fi
24557else
24558 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>
24559 #include <sys/stat.h>
24560"
24561if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
2196f55f 24562
c0c3707f
CB
24563cat >>confdefs.h <<_ACEOF
24564#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
24565_ACEOF
2196f55f 24566
c0c3707f
CB
24567
24568else
24569 ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
24570 #include <sys/stat.h>
24571"
24572if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
24573
24574cat >>confdefs.h <<_ACEOF
24575#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
24576_ACEOF
2196f55f
YQ
24577
24578
c0c3707f
CB
24579else
24580 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>
24581 #include <sys/stat.h>
24582"
24583if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
2196f55f 24584
c0c3707f
CB
24585cat >>confdefs.h <<_ACEOF
24586#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
24587_ACEOF
2196f55f
YQ
24588
24589
c0c3707f 24590fi
2196f55f 24591
c0c3707f 24592fi
2196f55f 24593
c0c3707f 24594fi
2196f55f 24595
c0c3707f 24596fi
2196f55f
YQ
24597
24598
24599
24600
24601
c0c3707f
CB
24602 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>
24603 #include <sys/stat.h>
24604"
24605if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then :
2196f55f 24606
c0c3707f
CB
24607cat >>confdefs.h <<_ACEOF
24608#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
24609_ACEOF
2196f55f
YQ
24610
24611
c0c3707f
CB
24612else
24613 ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
24614 #include <sys/stat.h>
24615"
24616if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then :
2196f55f 24617
c0c3707f
CB
24618cat >>confdefs.h <<_ACEOF
24619#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
24620_ACEOF
2196f55f 24621
2196f55f 24622
c0c3707f
CB
24623else
24624 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>
24625 #include <sys/stat.h>
24626"
24627if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then :
24628
24629cat >>confdefs.h <<_ACEOF
24630#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
24631_ACEOF
24632
24633
24634fi
24635
24636fi
5e8754f9 24637
c0c3707f 24638fi
2196f55f
YQ
24639
24640
24641
725e2999
JB
24642 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
24643$as_echo_n "checking for working stdalign.h... " >&6; }
24644if ${gl_cv_header_working_stdalign_h+:} false; then :
24645 $as_echo_n "(cached) " >&6
24646else
24647 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24648/* end confdefs.h. */
24649#include <stdalign.h>
24650 #include <stddef.h>
24651
24652 /* Test that alignof yields a result consistent with offsetof.
24653 This catches GCC bug 52023
c0c3707f 24654 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
725e2999
JB
24655 #ifdef __cplusplus
24656 template <class t> struct alignof_helper { char a; t b; };
24657 # define ao(type) offsetof (alignof_helper<type>, b)
24658 #else
24659 # define ao(type) offsetof (struct { char a; type b; }, b)
24660 #endif
24661 char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
24662 char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
24663 char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
24664
24665 /* Test _Alignas only on platforms where gnulib can help. */
24666 #if \
24667 ((defined __cplusplus && 201103 <= __cplusplus) \
24668 || (defined __APPLE__ && defined __MACH__ \
24669 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
24670 : __GNUC__) \
c0c3707f
CB
24671 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
24672 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
725e2999
JB
24673 || 1300 <= _MSC_VER)
24674 struct alignas_test { char c; char alignas (8) alignas_8; };
24675 char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
24676 ? 1 : -1];
24677 #endif
24678
24679int
24680main ()
24681{
24682
24683 ;
24684 return 0;
24685}
24686_ACEOF
24687if ac_fn_c_try_compile "$LINENO"; then :
24688 gl_cv_header_working_stdalign_h=yes
24689else
24690 gl_cv_header_working_stdalign_h=no
24691fi
24692rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24693fi
24694{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
24695$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
24696
24697 if test $gl_cv_header_working_stdalign_h = yes; then
24698 STDALIGN_H=''
24699 else
24700 STDALIGN_H='stdalign.h'
24701 fi
24702
24703
24704 if test -n "$STDALIGN_H"; then
24705 GL_GENERATE_STDALIGN_H_TRUE=
24706 GL_GENERATE_STDALIGN_H_FALSE='#'
24707else
24708 GL_GENERATE_STDALIGN_H_TRUE='#'
24709 GL_GENERATE_STDALIGN_H_FALSE=
24710fi
24711
24712
24713
2196f55f
YQ
24714
24715
63ce7108 24716
c0c3707f
CB
24717 if test "$ac_cv_header_stdbool_h" = yes; then
24718 case "$host_os" in
24719 solaris*)
24720 if test -z "$GCC"; then
24721 STDBOOL_H='stdbool.h'
24722 else
24723 STDBOOL_H=''
24724 fi
24725 ;;
24726 *)
24727 STDBOOL_H=''
24728 ;;
24729 esac
63ce7108
TT
24730 else
24731 STDBOOL_H='stdbool.h'
24732 fi
24733
24734 if test -n "$STDBOOL_H"; then
24735 GL_GENERATE_STDBOOL_H_TRUE=
24736 GL_GENERATE_STDBOOL_H_FALSE='#'
24737else
24738 GL_GENERATE_STDBOOL_H_TRUE='#'
24739 GL_GENERATE_STDBOOL_H_FALSE=
24740fi
24741
24742
24743 if test "$ac_cv_type__Bool" = yes; then
24744 HAVE__BOOL=1
24745 else
24746 HAVE__BOOL=0
24747 fi
24748
24749
24750
24751
24752
24753 STDDEF_H=
4a626d0a 24754
c0c3707f
CB
24755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
24756$as_echo_n "checking for good max_align_t... " >&6; }
24757if ${gl_cv_type_max_align_t+:} false; then :
24758 $as_echo_n "(cached) " >&6
24759else
24760 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24761/* end confdefs.h. */
24762#include <stddef.h>
24763 unsigned int s = sizeof (max_align_t);
24764 #if defined __GNUC__ || defined __IBM__ALIGNOF__
24765 int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
24766 int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
24767 #endif
24768
24769int
24770main ()
24771{
4a626d0a 24772
c0c3707f
CB
24773 ;
24774 return 0;
24775}
24776_ACEOF
24777if ac_fn_c_try_compile "$LINENO"; then :
24778 gl_cv_type_max_align_t=yes
4a626d0a 24779else
c0c3707f 24780 gl_cv_type_max_align_t=no
4a626d0a 24781fi
c0c3707f
CB
24782rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24783
24784fi
24785{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
24786$as_echo "$gl_cv_type_max_align_t" >&6; }
24787 if test $gl_cv_type_max_align_t = no; then
24788 HAVE_MAX_ALIGN_T=0
24789 STDDEF_H=stddef.h
24790 fi
4a626d0a 24791
63ce7108
TT
24792 if test $gt_cv_c_wchar_t = no; then
24793 HAVE_WCHAR_T=0
24794 STDDEF_H=stddef.h
24795 fi
c0c3707f 24796
63ce7108
TT
24797 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
24798$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
d0ac1c44 24799if ${gl_cv_decl_null_works+:} false; then :
63ce7108
TT
24800 $as_echo_n "(cached) " >&6
24801else
24802 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24803/* end confdefs.h. */
24804#include <stddef.h>
24805 int test[2 * (sizeof NULL == sizeof (void *)) -1];
24806
24807int
24808main ()
24809{
24810
24811 ;
24812 return 0;
24813}
24814_ACEOF
24815if ac_fn_c_try_compile "$LINENO"; then :
24816 gl_cv_decl_null_works=yes
24817else
24818 gl_cv_decl_null_works=no
24819fi
24820rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24821fi
24822{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
24823$as_echo "$gl_cv_decl_null_works" >&6; }
24824 if test $gl_cv_decl_null_works = no; then
24825 REPLACE_NULL=1
24826 STDDEF_H=stddef.h
24827 fi
24828
c0c3707f 24829
63ce7108
TT
24830 if test -n "$STDDEF_H"; then
24831 GL_GENERATE_STDDEF_H_TRUE=
24832 GL_GENERATE_STDDEF_H_FALSE='#'
24833else
24834 GL_GENERATE_STDDEF_H_TRUE='#'
24835 GL_GENERATE_STDDEF_H_FALSE=
24836fi
24837
24838 if test -n "$STDDEF_H"; then
24839
24840
24841
24842
24843
24844
24845
24846
24847 if test $gl_cv_have_include_next = yes; then
24848 gl_cv_next_stddef_h='<'stddef.h'>'
24849 else
24850 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
24851$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
d0ac1c44 24852if ${gl_cv_next_stddef_h+:} false; then :
63ce7108
TT
24853 $as_echo_n "(cached) " >&6
24854else
24855
4a626d0a
PA
24856
24857
24858 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63ce7108
TT
24859/* end confdefs.h. */
24860#include <stddef.h>
63ce7108 24861_ACEOF
4a626d0a
PA
24862 case "$host_os" in
24863 aix*) gl_absname_cpp="$ac_cpp -C" ;;
24864 *) gl_absname_cpp="$ac_cpp" ;;
24865 esac
63ce7108 24866
4a626d0a
PA
24867 case "$host_os" in
24868 mingw*)
24869 gl_dirsep_regex='[/\\]'
24870 ;;
24871 *)
24872 gl_dirsep_regex='\/'
24873 ;;
24874 esac
24875 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
24876 gl_header_literal_regex=`echo 'stddef.h' \
24877 | sed -e "$gl_make_literal_regex_sed"`
24878 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
24879 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
24880 s|^/[^/]|//&|
24881 p
24882 q
24883 }'
63ce7108 24884
4a626d0a
PA
24885 gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
24886 sed -n "$gl_absolute_header_sed"`
24887
24888 gl_header=$gl_cv_absolute_stddef_h
24889 gl_cv_next_stddef_h='"'$gl_header'"'
63ce7108
TT
24890
24891
24892fi
24893{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
24894$as_echo "$gl_cv_next_stddef_h" >&6; }
24895 fi
24896 NEXT_STDDEF_H=$gl_cv_next_stddef_h
24897
24898 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
24899 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
24900 gl_next_as_first_directive='<'stddef.h'>'
24901 else
24902 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
24903 gl_next_as_first_directive=$gl_cv_next_stddef_h
24904 fi
24905 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
24906
24907
24908
24909
24910 fi
24911
24912
24913
24914
49e4877c 24915 $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
63ce7108
TT
24916
24917
24918
98399780
YQ
24919
24920
24921
24922
24923
4a626d0a
PA
24924
24925
6a29c58e
YQ
24926 if test $gl_cv_have_include_next = yes; then
24927 gl_cv_next_stdio_h='<'stdio.h'>'
24928 else
24929 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
24930$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
d0ac1c44 24931if ${gl_cv_next_stdio_h+:} false; then :
6a29c58e
YQ
24932 $as_echo_n "(cached) " >&6
24933else
24934
4a626d0a
PA
24935
24936
24937 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6a29c58e
YQ
24938/* end confdefs.h. */
24939#include <stdio.h>
6a29c58e 24940_ACEOF
4a626d0a
PA
24941 case "$host_os" in
24942 aix*) gl_absname_cpp="$ac_cpp -C" ;;
24943 *) gl_absname_cpp="$ac_cpp" ;;
24944 esac
24945
24946 case "$host_os" in
24947 mingw*)
24948 gl_dirsep_regex='[/\\]'
24949 ;;
24950 *)
24951 gl_dirsep_regex='\/'
24952 ;;
24953 esac
24954 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
24955 gl_header_literal_regex=`echo 'stdio.h' \
24956 | sed -e "$gl_make_literal_regex_sed"`
24957 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
24958 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
24959 s|^/[^/]|//&|
24960 p
24961 q
24962 }'
6a29c58e 24963
4a626d0a
PA
24964 gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
24965 sed -n "$gl_absolute_header_sed"`
6a29c58e 24966
4a626d0a
PA
24967 gl_header=$gl_cv_absolute_stdio_h
24968 gl_cv_next_stdio_h='"'$gl_header'"'
6a29c58e
YQ
24969
24970
24971fi
24972{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
24973$as_echo "$gl_cv_next_stdio_h" >&6; }
24974 fi
24975 NEXT_STDIO_H=$gl_cv_next_stdio_h
24976
24977 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
24978 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
24979 gl_next_as_first_directive='<'stdio.h'>'
24980 else
24981 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
24982 gl_next_as_first_directive=$gl_cv_next_stdio_h
24983 fi
24984 NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
24985
24986
24987
24988
24989
4a626d0a
PA
24990 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
24991$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; }
d0ac1c44 24992if ${gl_cv_func_printf_attribute_flavor+:} false; then :
4a626d0a
PA
24993 $as_echo_n "(cached) " >&6
24994else
24995 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24996/* end confdefs.h. */
24997
24998 #define __STDC_FORMAT_MACROS 1
24999 #include <stdio.h>
25000 #include <inttypes.h>
25001 /* For non-mingw systems, compilation will trivially succeed.
25002 For mingw, compilation will succeed for older mingw (system
25003 printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
c0c3707f 25004 #if (defined _WIN32 && ! defined __CYGWIN__) && \
4a626d0a
PA
25005 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
25006 extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
25007 #endif
25008
25009int
25010main ()
25011{
25012
25013 ;
25014 return 0;
25015}
25016_ACEOF
25017if ac_fn_c_try_compile "$LINENO"; then :
25018 gl_cv_func_printf_attribute_flavor=system
25019else
25020 gl_cv_func_printf_attribute_flavor=gnu
25021fi
25022rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25023fi
25024{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
25025$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; }
25026 if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
25027
25028$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
25029
25030 fi
25031
6a29c58e
YQ
25032 GNULIB_FSCANF=1
25033
25034
25035cat >>confdefs.h <<_ACEOF
25036#define GNULIB_FSCANF 1
25037_ACEOF
25038
25039
25040 GNULIB_SCANF=1
25041
25042
25043cat >>confdefs.h <<_ACEOF
25044#define GNULIB_SCANF 1
25045_ACEOF
25046
25047
25048 GNULIB_FGETC=1
25049 GNULIB_GETC=1
25050 GNULIB_GETCHAR=1
25051 GNULIB_FGETS=1
25052 GNULIB_FREAD=1
25053
25054
25055 GNULIB_FPRINTF=1
25056 GNULIB_PRINTF=1
25057 GNULIB_VFPRINTF=1
25058 GNULIB_VPRINTF=1
25059 GNULIB_FPUTC=1
25060 GNULIB_PUTC=1
25061 GNULIB_PUTCHAR=1
25062 GNULIB_FPUTS=1
25063 GNULIB_PUTS=1
25064 GNULIB_FWRITE=1
25065
25066
25067
25068
6a29c58e 25069
6a29c58e
YQ
25070
25071
25072
25073
25074
25075
25076
25077
25078
25079
25080
25081
98399780
YQ
25082 if test $gl_cv_have_include_next = yes; then
25083 gl_cv_next_stdlib_h='<'stdlib.h'>'
25084 else
25085 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
25086$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
d0ac1c44 25087if ${gl_cv_next_stdlib_h+:} false; then :
98399780
YQ
25088 $as_echo_n "(cached) " >&6
25089else
25090
4a626d0a
PA
25091
25092
25093 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98399780
YQ
25094/* end confdefs.h. */
25095#include <stdlib.h>
98399780 25096_ACEOF
4a626d0a
PA
25097 case "$host_os" in
25098 aix*) gl_absname_cpp="$ac_cpp -C" ;;
25099 *) gl_absname_cpp="$ac_cpp" ;;
25100 esac
25101
25102 case "$host_os" in
25103 mingw*)
25104 gl_dirsep_regex='[/\\]'
25105 ;;
25106 *)
25107 gl_dirsep_regex='\/'
25108 ;;
25109 esac
25110 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
25111 gl_header_literal_regex=`echo 'stdlib.h' \
25112 | sed -e "$gl_make_literal_regex_sed"`
25113 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
25114 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
25115 s|^/[^/]|//&|
25116 p
25117 q
25118 }'
98399780 25119
4a626d0a
PA
25120 gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
25121 sed -n "$gl_absolute_header_sed"`
98399780 25122
4a626d0a
PA
25123 gl_header=$gl_cv_absolute_stdlib_h
25124 gl_cv_next_stdlib_h='"'$gl_header'"'
98399780
YQ
25125
25126
25127fi
25128{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
25129$as_echo "$gl_cv_next_stdlib_h" >&6; }
25130 fi
25131 NEXT_STDLIB_H=$gl_cv_next_stdlib_h
25132
25133 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
25134 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
25135 gl_next_as_first_directive='<'stdlib.h'>'
25136 else
25137 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
25138 gl_next_as_first_directive=$gl_cv_next_stdlib_h
25139 fi
25140 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
25141
25142
25143
25144
25145
25146
98399780 25147
98399780
YQ
25148
25149
25150
25151
25152
25153
8424cc97
SM
25154 for ac_func in strchrnul
25155do :
25156 ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul"
d0ac1c44 25157if test "x$ac_cv_func_strchrnul" = xyes; then :
8424cc97
SM
25158 cat >>confdefs.h <<_ACEOF
25159#define HAVE_STRCHRNUL 1
25160_ACEOF
25161
25162fi
25163done
25164
25165 if test $ac_cv_func_strchrnul = no; then
25166 HAVE_STRCHRNUL=0
25167 else
25168 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5
25169$as_echo_n "checking whether strchrnul works... " >&6; }
d0ac1c44 25170if ${gl_cv_func_strchrnul_works+:} false; then :
8424cc97
SM
25171 $as_echo_n "(cached) " >&6
25172else
25173 if test "$cross_compiling" = yes; then :
25174 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25175/* end confdefs.h. */
25176
25177#if defined __CYGWIN__
25178 #include <cygwin/version.h>
25179 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
25180 Lucky user
25181 #endif
25182#else
25183 Lucky user
25184#endif
25185
25186_ACEOF
25187if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25188 $EGREP "Lucky user" >/dev/null 2>&1; then :
25189 gl_cv_func_strchrnul_works="guessing yes"
25190else
25191 gl_cv_func_strchrnul_works="guessing no"
25192fi
25193rm -f conftest*
25194
25195
25196else
25197 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25198/* end confdefs.h. */
25199
25200#include <string.h> /* for strchrnul */
25201
25202int
25203main ()
25204{
25205const char *buf = "a";
25206 return strchrnul (buf, 'b') != buf + 1;
25207
25208 ;
25209 return 0;
25210}
25211_ACEOF
25212if ac_fn_c_try_run "$LINENO"; then :
25213 gl_cv_func_strchrnul_works=yes
25214else
25215 gl_cv_func_strchrnul_works=no
25216fi
25217rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25218 conftest.$ac_objext conftest.beam conftest.$ac_ext
25219fi
25220
25221
25222fi
25223{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5
25224$as_echo "$gl_cv_func_strchrnul_works" >&6; }
25225 case "$gl_cv_func_strchrnul_works" in
25226 *yes) ;;
25227 *) REPLACE_STRCHRNUL=1 ;;
25228 esac
25229 fi
25230
25231 if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
25232
25233
25234
25235
25236
25237
25238
25239
25240 gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext"
25241
25242 :
25243 fi
25244
25245
25246
25247
25248
25249 GNULIB_STRCHRNUL=1
25250
25251
25252
25253
25254
25255$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
25256
25257
25258
25259
25260
25261
25262
6ec2e0f5
SDJ
25263 if test $ac_cv_func_strdup = yes; then
25264 if test $gl_cv_func_malloc_posix != yes; then
25265 REPLACE_STRDUP=1
25266 fi
25267 fi
25268
25269 if test $ac_cv_have_decl_strdup = no; then
25270 HAVE_DECL_STRDUP=0
25271 fi
25272
25273 if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
25274
25275
25276
25277
25278
25279
25280
25281
25282 gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext"
25283
25284 :
25285 fi
25286
25287
25288
25289
25290
25291 GNULIB_STRDUP=1
25292
25293
25294
25295
25296
25297$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
25298
25299
25300
25301
25302
25303
25304
25305
5abebf3c
CB
25306
25307
6ec2e0f5
SDJ
25308 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
25309 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
25310$as_echo_n "checking for working strerror function... " >&6; }
d0ac1c44 25311if ${gl_cv_func_working_strerror+:} false; then :
6ec2e0f5
SDJ
25312 $as_echo_n "(cached) " >&6
25313else
25314 if test "$cross_compiling" = yes; then :
25315 case "$host_os" in
c0c3707f
CB
25316 # Guess yes on glibc systems.
25317 *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
25318 # Guess yes on musl systems.
25319 *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
25320 # If we don't know, obey --enable-cross-guesses.
25321 *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
6ec2e0f5
SDJ
25322 esac
25323
25324else
25325 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25326/* end confdefs.h. */
25327#include <string.h>
25328
25329int
25330main ()
25331{
25332if (!*strerror (-2)) return 1;
25333 ;
25334 return 0;
25335}
25336_ACEOF
25337if ac_fn_c_try_run "$LINENO"; then :
25338 gl_cv_func_working_strerror=yes
25339else
25340 gl_cv_func_working_strerror=no
25341fi
25342rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25343 conftest.$ac_objext conftest.beam conftest.$ac_ext
25344fi
25345
25346
25347fi
25348{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
25349$as_echo "$gl_cv_func_working_strerror" >&6; }
25350 case "$gl_cv_func_working_strerror" in
25351 *yes) ;;
25352 *)
25353 REPLACE_STRERROR=1
25354 ;;
25355 esac
25356
5abebf3c
CB
25357 case "$gl_cv_func_strerror_r_works" in
25358 *no) REPLACE_STRERROR=1 ;;
25359 esac
25360
6ec2e0f5
SDJ
25361 else
25362 REPLACE_STRERROR=1
25363 fi
25364
25365 if test $REPLACE_STRERROR = 1; then
25366
25367
25368
25369
25370
25371
25372
25373
25374 gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
25375
25376 fi
25377
25378
25379cat >>confdefs.h <<_ACEOF
25380#define GNULIB_STRERROR 1
25381_ACEOF
25382
25383
25384
25385
25386
25387
25388
25389 GNULIB_STRERROR=1
25390
25391
25392
25393
25394
25395$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
25396
25397
25398
25399
25400
25401 if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
25402
25403
25404
25405
25406
25407
25408
25409
25410 gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext"
25411
25412
25413
25414
25415
25416 if test $ac_cv_header_sys_socket_h != yes; then
25417 for ac_header in winsock2.h
25418do :
25419 ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
d0ac1c44 25420if test "x$ac_cv_header_winsock2_h" = xyes; then :
6ec2e0f5
SDJ
25421 cat >>confdefs.h <<_ACEOF
25422#define HAVE_WINSOCK2_H 1
25423_ACEOF
25424
25425fi
25426
25427done
25428
25429 fi
25430 if test "$ac_cv_header_winsock2_h" = yes; then
25431 HAVE_WINSOCK2_H=1
25432 UNISTD_H_HAVE_WINSOCK2_H=1
25433 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
25434 else
25435 HAVE_WINSOCK2_H=0
25436 fi
25437
25438
25439 fi
25440
25441
25442
25443
98399780 25444
5abebf3c 25445
5abebf3c 25446
c0c3707f
CB
25447 if test $ac_cv_have_decl_strerror_r = no; then
25448 HAVE_DECL_STRERROR_R=0
25449 fi
5abebf3c
CB
25450
25451 if test $ac_cv_func_strerror_r = yes; then
25452 if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
25453 if test $gl_cv_func_strerror_r_posix_signature = yes; then
25454 case "$gl_cv_func_strerror_r_works" in
25455 *no) REPLACE_STRERROR_R=1 ;;
25456 esac
25457 else
25458 REPLACE_STRERROR_R=1
25459 fi
25460 else
25461 REPLACE_STRERROR_R=1
25462 fi
25463 fi
25464
5abebf3c
CB
25465 if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
25466
25467
25468
25469
25470
25471
25472
25473
25474 gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext"
25475
25476
25477
5abebf3c
CB
25478
25479
25480
c0c3707f 25481 fi
5abebf3c
CB
25482
25483
25484
25485
5abebf3c 25486
c0c3707f 25487 GNULIB_STRERROR_R=1
5abebf3c
CB
25488
25489
25490
25491
5abebf3c 25492
c0c3707f 25493$as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
5abebf3c
CB
25494
25495
25496
25497
5abebf3c 25498
c0c3707f
CB
25499cat >>confdefs.h <<_ACEOF
25500#define GNULIB_STRERROR_R_POSIX 1
25501_ACEOF
5abebf3c
CB
25502
25503
25504
25505
25506
25507
25508
63ce7108
TT
25509 if test $REPLACE_STRSTR = 0; then
25510 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5
25511$as_echo_n "checking whether strstr works in linear time... " >&6; }
d0ac1c44 25512if ${gl_cv_func_strstr_linear+:} false; then :
63ce7108
TT
25513 $as_echo_n "(cached) " >&6
25514else
25515 if test "$cross_compiling" = yes; then :
25516 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25517/* end confdefs.h. */
25518
25519#include <features.h>
25520#ifdef __GNU_LIBRARY__
25521 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
25522 && !(defined __i386__ || defined __x86_64__) \
25523 && !defined __UCLIBC__
25524 Lucky user
25525 #endif
25526#endif
25527#ifdef __CYGWIN__
25528 #include <cygwin/version.h>
25529 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
25530 Lucky user
25531 #endif
25532#endif
25533
25534_ACEOF
25535if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25536 $EGREP "Lucky user" >/dev/null 2>&1; then :
25537 gl_cv_func_strstr_linear="guessing yes"
c971b7fa 25538else
c0c3707f 25539 gl_cv_func_strstr_linear="$gl_cross_guess_normal"
c971b7fa
PA
25540fi
25541rm -f conftest*
25542
25543
25544else
25545 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25546/* end confdefs.h. */
25547
49e4877c
PA
25548#ifdef __MVS__
25549/* z/OS does not deliver signals while strstr() is running (thanks to
25550 restrictions on its LE runtime), which prevents us from limiting the
25551 running time of this test. */
25552# error "This test does not work properly on z/OS"
25553#endif
c971b7fa 25554#include <signal.h> /* for signal */
63ce7108 25555#include <string.h> /* for strstr */
c971b7fa
PA
25556#include <stdlib.h> /* for malloc */
25557#include <unistd.h> /* for alarm */
49e4877c 25558static void quit (int sig) { _exit (sig + 128); }
c971b7fa
PA
25559
25560int
25561main ()
25562{
25563
25564 int result = 0;
25565 size_t m = 1000000;
63ce7108
TT
25566 char *haystack = (char *) malloc (2 * m + 2);
25567 char *needle = (char *) malloc (m + 2);
c971b7fa 25568 /* Failure to compile this test due to missing alarm is okay,
63ce7108 25569 since all such platforms (mingw) also have quadratic strstr. */
c971b7fa
PA
25570 signal (SIGALRM, quit);
25571 alarm (5);
25572 /* Check for quadratic performance. */
25573 if (haystack && needle)
25574 {
25575 memset (haystack, 'A', 2 * m);
25576 haystack[2 * m] = 'B';
63ce7108 25577 haystack[2 * m + 1] = 0;
c971b7fa
PA
25578 memset (needle, 'A', m);
25579 needle[m] = 'B';
63ce7108
TT
25580 needle[m + 1] = 0;
25581 if (!strstr (haystack, needle))
c971b7fa
PA
25582 result |= 1;
25583 }
c0c3707f
CB
25584 /* Free allocated memory, in case some sanitizer is watching. */
25585 free (haystack);
25586 free (needle);
c971b7fa
PA
25587 return result;
25588
25589 ;
25590 return 0;
25591}
25592_ACEOF
25593if ac_fn_c_try_run "$LINENO"; then :
63ce7108 25594 gl_cv_func_strstr_linear=yes
c971b7fa 25595else
63ce7108 25596 gl_cv_func_strstr_linear=no
c971b7fa
PA
25597fi
25598rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25599 conftest.$ac_objext conftest.beam conftest.$ac_ext
25600fi
25601
25602
25603fi
63ce7108
TT
25604{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5
25605$as_echo "$gl_cv_func_strstr_linear" >&6; }
25606 case "$gl_cv_func_strstr_linear" in
40a73391
JK
25607 *yes) ;;
25608 *)
63ce7108 25609 REPLACE_STRSTR=1
40a73391
JK
25610 ;;
25611 esac
c971b7fa
PA
25612 fi
25613
63ce7108 25614 if test $REPLACE_STRSTR = 1; then
c971b7fa
PA
25615
25616
25617
25618
25619
25620
25621
25622
63ce7108 25623 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
c971b7fa 25624
a512b375 25625 fi
c971b7fa
PA
25626
25627
25628
c0c3707f 25629 if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
63ce7108 25630 REPLACE_STRSTR=1
c971b7fa 25631 else
c0c3707f 25632 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
63ce7108 25633$as_echo_n "checking whether strstr works... " >&6; }
d0ac1c44 25634if ${gl_cv_func_strstr_works_always+:} false; then :
c971b7fa
PA
25635 $as_echo_n "(cached) " >&6
25636else
25637 if test "$cross_compiling" = yes; then :
c0c3707f 25638 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa
PA
25639/* end confdefs.h. */
25640
25641#ifdef __GNU_LIBRARY__
25642 #include <features.h>
63ce7108 25643 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
c971b7fa
PA
25644 || defined __UCLIBC__
25645 Lucky user
25646 #endif
25647#elif defined __CYGWIN__
25648 #include <cygwin/version.h>
25649 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
25650 Lucky user
25651 #endif
25652#else
25653 Lucky user
25654#endif
25655
25656_ACEOF
25657if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25658 $EGREP "Lucky user" >/dev/null 2>&1; then :
63ce7108 25659 gl_cv_func_strstr_works_always="guessing yes"
c971b7fa 25660else
c0c3707f 25661 gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
c971b7fa
PA
25662fi
25663rm -f conftest*
25664
25665
25666else
25667 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25668/* end confdefs.h. */
25669
63ce7108 25670#include <string.h> /* for strstr */
c0c3707f
CB
25671#ifdef __GNU_LIBRARY__
25672 #include <features.h>
25673 #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
25674 Unlucky user
25675 #endif
25676#endif
c971b7fa
PA
25677#define P "_EF_BF_BD"
25678#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
25679#define NEEDLE P P P P P
25680
25681int
25682main ()
25683{
63ce7108 25684return !!strstr (HAYSTACK, NEEDLE);
c971b7fa
PA
25685
25686 ;
25687 return 0;
25688}
25689_ACEOF
25690if ac_fn_c_try_run "$LINENO"; then :
63ce7108 25691 gl_cv_func_strstr_works_always=yes
c971b7fa 25692else
63ce7108 25693 gl_cv_func_strstr_works_always=no
c971b7fa
PA
25694fi
25695rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25696 conftest.$ac_objext conftest.beam conftest.$ac_ext
25697fi
25698
25699
25700fi
63ce7108
TT
25701{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
25702$as_echo "$gl_cv_func_strstr_works_always" >&6; }
25703 case "$gl_cv_func_strstr_works_always" in
40a73391
JK
25704 *yes) ;;
25705 *)
63ce7108 25706 REPLACE_STRSTR=1
40a73391
JK
25707 ;;
25708 esac
c971b7fa 25709 fi
8839a007 25710
63ce7108 25711 if test $REPLACE_STRSTR = 1; then
8839a007 25712
8690e634
JK
25713
25714
8690e634
JK
25715
25716
25717
25718
25719
63ce7108 25720 gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
8690e634 25721
8690e634
JK
25722 fi
25723
8690e634
JK
25724
25725
8690e634 25726
8690e634 25727
63ce7108 25728 GNULIB_STRSTR=1
8690e634
JK
25729
25730
25731
8690e634
JK
25732
25733
63ce7108 25734$as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
8690e634
JK
25735
25736
25737
25738
25739
25740
25741
421693b0
PA
25742 for ac_func in strtok_r
25743do :
25744 ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r"
d0ac1c44 25745if test "x$ac_cv_func_strtok_r" = xyes; then :
421693b0
PA
25746 cat >>confdefs.h <<_ACEOF
25747#define HAVE_STRTOK_R 1
25748_ACEOF
25749
25750fi
25751done
25752
25753 if test $ac_cv_func_strtok_r = yes; then
25754 HAVE_STRTOK_R=1
25755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r works" >&5
25756$as_echo_n "checking whether strtok_r works... " >&6; }
d0ac1c44 25757if ${gl_cv_func_strtok_r_works+:} false; then :
421693b0
PA
25758 $as_echo_n "(cached) " >&6
25759else
25760 if test "$cross_compiling" = yes; then :
c0c3707f
CB
25761 case "$host_os" in
25762 # Guess no on glibc systems.
25763 *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;;
25764 # Guess yes on native Windows.
25765 mingw*) gl_cv_func_strtok_r_works="guessing yes" ;;
25766 *) gl_cv_func_strtok_r_works="guessing yes" ;;
421693b0
PA
25767 esac
25768
25769else
25770 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25771/* end confdefs.h. */
25772
25773 #ifndef __OPTIMIZE__
25774 # define __OPTIMIZE__ 1
25775 #endif
25776 #undef __OPTIMIZE_SIZE__
25777 #undef __NO_INLINE__
25778 #include <stdlib.h>
25779 #include <string.h>
25780
25781int
25782main ()
25783{
25784static const char dummy[] = "\177\01a";
25785 char delimiters[] = "xxxxxxxx";
25786 char *save_ptr = (char *) dummy;
25787 strtok_r (delimiters, "x", &save_ptr);
25788 strtok_r (NULL, "x", &save_ptr);
25789 return 0;
25790
25791 ;
25792 return 0;
25793}
25794
25795_ACEOF
25796if ac_fn_c_try_run "$LINENO"; then :
25797 gl_cv_func_strtok_r_works=yes
25798else
25799 gl_cv_func_strtok_r_works=no
25800fi
25801rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25802 conftest.$ac_objext conftest.beam conftest.$ac_ext
25803fi
25804
25805
25806fi
25807{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtok_r_works" >&5
25808$as_echo "$gl_cv_func_strtok_r_works" >&6; }
25809 case "$gl_cv_func_strtok_r_works" in
25810 *no)
25811 UNDEFINE_STRTOK_R=1
25812 ;;
25813 esac
25814 else
25815 HAVE_STRTOK_R=0
25816 fi
25817
25818 if test $ac_cv_have_decl_strtok_r = no; then
25819 HAVE_DECL_STRTOK_R=0
25820 fi
25821
25822 if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then
25823
25824
25825
25826
25827
25828
25829
25830
25831 gl_LIBOBJS="$gl_LIBOBJS strtok_r.$ac_objext"
25832
25833
25834 :
25835
25836 fi
25837
25838
25839
25840
25841
25842 GNULIB_STRTOK_R=1
25843
25844
25845
25846
25847
25848$as_echo "#define GNULIB_TEST_STRTOK_R 1" >>confdefs.h
25849
25850
25851
25852
25853
25854
25855
8690e634
JK
25856
25857
25858
25859
25860
8690e634 25861
09607c9e 25862
725e2999
JB
25863
25864
09607c9e
TT
25865
25866
25867
25868 if test $gl_cv_have_include_next = yes; then
25869 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
25870 else
25871 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
25872$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
d0ac1c44 25873if ${gl_cv_next_sys_stat_h+:} false; then :
09607c9e
TT
25874 $as_echo_n "(cached) " >&6
25875else
25876
25877 if test $ac_cv_header_sys_stat_h = yes; then
25878
25879
4a626d0a
PA
25880
25881
25882 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
09607c9e
TT
25883/* end confdefs.h. */
25884#include <sys/stat.h>
09607c9e 25885_ACEOF
4a626d0a
PA
25886 case "$host_os" in
25887 aix*) gl_absname_cpp="$ac_cpp -C" ;;
25888 *) gl_absname_cpp="$ac_cpp" ;;
25889 esac
25890
25891 case "$host_os" in
25892 mingw*)
25893 gl_dirsep_regex='[/\\]'
25894 ;;
25895 *)
25896 gl_dirsep_regex='\/'
25897 ;;
25898 esac
25899 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
25900 gl_header_literal_regex=`echo 'sys/stat.h' \
25901 | sed -e "$gl_make_literal_regex_sed"`
25902 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
25903 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
25904 s|^/[^/]|//&|
25905 p
25906 q
25907 }'
25908
25909 gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
25910 sed -n "$gl_absolute_header_sed"`
25911
25912 gl_header=$gl_cv_absolute_sys_stat_h
25913 gl_cv_next_sys_stat_h='"'$gl_header'"'
09607c9e
TT
25914 else
25915 gl_cv_next_sys_stat_h='<'sys/stat.h'>'
25916 fi
25917
25918
25919fi
25920{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
25921$as_echo "$gl_cv_next_sys_stat_h" >&6; }
25922 fi
25923 NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
25924
25925 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
25926 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
25927 gl_next_as_first_directive='<'sys/stat.h'>'
25928 else
25929 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
25930 gl_next_as_first_directive=$gl_cv_next_sys_stat_h
25931 fi
25932 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
25933
25934
25935
25936
25937
25938
25939
25940
c0c3707f
CB
25941 WINDOWS_STAT_TIMESPEC=0
25942
25943
2196f55f 25944
09607c9e
TT
25945
25946
09607c9e 25947
09607c9e 25948
09607c9e
TT
25949
25950 ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
25951 #include <sys/stat.h>
25952"
d0ac1c44 25953if test "x$ac_cv_type_nlink_t" = xyes; then :
09607c9e
TT
25954
25955else
25956
c0c3707f 25957$as_echo "#define nlink_t int" >>confdefs.h
09607c9e 25958
c0c3707f 25959fi
09607c9e
TT
25960
25961
25962
25963
25964
25965
25966
25967
25968
25969
725e2999
JB
25970
25971
25972
25973
25974
25975
725e2999
JB
25976
25977
25978
25979
25980
25981
25982
25983
25984 if test $gl_cv_have_include_next = yes; then
25985 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
25986 else
25987 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
25988$as_echo_n "checking absolute name of <sys/uio.h>... " >&6; }
25989if ${gl_cv_next_sys_uio_h+:} false; then :
25990 $as_echo_n "(cached) " >&6
25991else
25992
25993 if test $ac_cv_header_sys_uio_h = yes; then
25994
25995
25996
25997
25998 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25999/* end confdefs.h. */
26000#include <sys/uio.h>
26001_ACEOF
26002 case "$host_os" in
26003 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26004 *) gl_absname_cpp="$ac_cpp" ;;
26005 esac
26006
26007 case "$host_os" in
26008 mingw*)
26009 gl_dirsep_regex='[/\\]'
26010 ;;
26011 *)
26012 gl_dirsep_regex='\/'
26013 ;;
26014 esac
26015 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26016 gl_header_literal_regex=`echo 'sys/uio.h' \
26017 | sed -e "$gl_make_literal_regex_sed"`
26018 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26019 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26020 s|^/[^/]|//&|
26021 p
26022 q
26023 }'
26024
26025 gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26026 sed -n "$gl_absolute_header_sed"`
26027
26028 gl_header=$gl_cv_absolute_sys_uio_h
26029 gl_cv_next_sys_uio_h='"'$gl_header'"'
26030 else
26031 gl_cv_next_sys_uio_h='<'sys/uio.h'>'
26032 fi
26033
26034
26035fi
26036{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
26037$as_echo "$gl_cv_next_sys_uio_h" >&6; }
26038 fi
26039 NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h
26040
26041 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
26042 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
26043 gl_next_as_first_directive='<'sys/uio.h'>'
26044 else
26045 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
26046 gl_next_as_first_directive=$gl_cv_next_sys_uio_h
26047 fi
26048 NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
26049
26050
26051
26052
26053 if test $ac_cv_header_sys_uio_h = yes; then
26054 HAVE_SYS_UIO_H=1
26055 else
26056 HAVE_SYS_UIO_H=0
26057 fi
26058
26059
26060
26061
26062
2d8adcbd
MM
26063 :
26064
26065
26066
26067
09607c9e
TT
26068
26069
26070
8839a007
PA
26071
26072
26073
26074
09607c9e 26075
c0c3707f
CB
26076 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,
26077 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
26078 been included before. */
26079 #if defined __MINGW32__
26080 # include <unistd.h>
26081 #endif
26082 #include <time.h>
09607c9e 26083
f8e27d88
CB
26084"
26085if test "x$ac_cv_have_decl_localtime_r" = xyes; then :
26086 ac_have_decl=1
26087else
26088 ac_have_decl=0
26089fi
26090
26091cat >>confdefs.h <<_ACEOF
26092#define HAVE_DECL_LOCALTIME_R $ac_have_decl
26093_ACEOF
26094
26095 if test $ac_cv_have_decl_localtime_r = no; then
26096 HAVE_DECL_LOCALTIME_R=0
26097 fi
26098
26099
f8e27d88
CB
26100 if test $ac_cv_func_localtime_r = yes; then
26101 HAVE_LOCALTIME_R=1
26102 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
26103$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
26104if ${gl_cv_time_r_posix+:} false; then :
26105 $as_echo_n "(cached) " >&6
26106else
26107 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26108/* end confdefs.h. */
c0c3707f
CB
26109/* mingw's <time.h> provides the functions asctime_r, ctime_r,
26110 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
26111 been included before. */
26112 #if defined __MINGW32__
26113 # include <unistd.h>
26114 #endif
26115 #include <time.h>
26116
f8e27d88
CB
26117int
26118main ()
26119{
26120/* We don't need to append 'restrict's to the argument types,
26121 even though the POSIX signature has the 'restrict's,
26122 since C99 says they can't affect type compatibility. */
26123 struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
26124 if (ptr) return 0;
26125 /* Check the return type is a pointer.
26126 On HP-UX 10 it is 'int'. */
26127 *localtime_r (0, 0);
26128 ;
26129 return 0;
26130}
26131
26132_ACEOF
26133if ac_fn_c_try_compile "$LINENO"; then :
26134 gl_cv_time_r_posix=yes
26135else
26136 gl_cv_time_r_posix=no
26137fi
26138rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26139
26140fi
26141{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
26142$as_echo "$gl_cv_time_r_posix" >&6; }
26143 if test $gl_cv_time_r_posix = yes; then
26144 REPLACE_LOCALTIME_R=0
26145 else
26146 REPLACE_LOCALTIME_R=1
26147 fi
26148 else
26149 HAVE_LOCALTIME_R=0
c0c3707f
CB
26150 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5
26151$as_echo_n "checking whether localtime_r exists as an inline function... " >&6; }
26152if ${gl_cv_func_localtime_r_inline+:} false; then :
26153 $as_echo_n "(cached) " >&6
26154else
26155 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26156/* end confdefs.h. */
26157/* mingw's <time.h> provides the functions asctime_r, ctime_r,
26158 gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
26159 been included before. */
26160 #if defined __MINGW32__
26161 # include <unistd.h>
26162 #endif
26163 #include <time.h>
26164
26165int
26166main ()
26167{
26168time_t a;
26169 struct tm r;
26170 localtime_r (&a, &r);
26171
26172 ;
26173 return 0;
26174}
26175
26176_ACEOF
26177if ac_fn_c_try_link "$LINENO"; then :
26178 gl_cv_func_localtime_r_inline=yes
26179else
26180 gl_cv_func_localtime_r_inline=no
26181fi
26182rm -f core conftest.err conftest.$ac_objext \
26183 conftest$ac_exeext conftest.$ac_ext
26184
26185fi
26186{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5
26187$as_echo "$gl_cv_func_localtime_r_inline" >&6; }
26188 if test $gl_cv_func_localtime_r_inline = yes; then
26189 REPLACE_LOCALTIME_R=1
26190 fi
f8e27d88
CB
26191 fi
26192
26193 if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
26194
26195
26196
26197
26198
26199
26200
26201
26202 gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
26203
26204
26205 :
26206
26207 fi
26208
26209
26210
26211
26212
26213 GNULIB_TIME_R=1
26214
26215
26216
26217
26218
26219$as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h
26220
26221
26222
26223
26224
26225
26226
26227
26228
5abebf3c
CB
26229
26230
26231
8839a007
PA
26232
26233
26234
26235 if test $gl_cv_have_include_next = yes; then
26236 gl_cv_next_unistd_h='<'unistd.h'>'
26237 else
26238 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
26239$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
d0ac1c44 26240if ${gl_cv_next_unistd_h+:} false; then :
8839a007
PA
26241 $as_echo_n "(cached) " >&6
26242else
26243
26244 if test $ac_cv_header_unistd_h = yes; then
26245
26246
4a626d0a
PA
26247
26248
26249 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8839a007
PA
26250/* end confdefs.h. */
26251#include <unistd.h>
8839a007 26252_ACEOF
4a626d0a
PA
26253 case "$host_os" in
26254 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26255 *) gl_absname_cpp="$ac_cpp" ;;
26256 esac
26257
26258 case "$host_os" in
26259 mingw*)
26260 gl_dirsep_regex='[/\\]'
26261 ;;
26262 *)
26263 gl_dirsep_regex='\/'
26264 ;;
26265 esac
26266 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26267 gl_header_literal_regex=`echo 'unistd.h' \
26268 | sed -e "$gl_make_literal_regex_sed"`
26269 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26270 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26271 s|^/[^/]|//&|
26272 p
26273 q
26274 }'
26275
26276 gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26277 sed -n "$gl_absolute_header_sed"`
26278
26279 gl_header=$gl_cv_absolute_unistd_h
26280 gl_cv_next_unistd_h='"'$gl_header'"'
8839a007
PA
26281 else
26282 gl_cv_next_unistd_h='<'unistd.h'>'
26283 fi
26284
26285
26286fi
26287{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
26288$as_echo "$gl_cv_next_unistd_h" >&6; }
26289 fi
26290 NEXT_UNISTD_H=$gl_cv_next_unistd_h
26291
26292 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
26293 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
26294 gl_next_as_first_directive='<'unistd.h'>'
26295 else
26296 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
26297 gl_next_as_first_directive=$gl_cv_next_unistd_h
26298 fi
26299 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
26300
26301
26302
26303
26304 if test $ac_cv_header_unistd_h = yes; then
26305 HAVE_UNISTD_H=1
26306 else
26307 HAVE_UNISTD_H=0
26308 fi
26309
26310
26311
26312
26313
26314
26315
472fa5ee
SM
26316
26317
26318
26319
26320
8839a007 26321
6ec2e0f5
SDJ
26322
26323
26324
3d99e817
AK
26325 if test $ac_cv_have_decl_unsetenv = no; then
26326 HAVE_DECL_UNSETENV=0
26327 fi
26328 for ac_func in unsetenv
26329do :
26330 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
d0ac1c44 26331if test "x$ac_cv_func_unsetenv" = xyes; then :
3d99e817
AK
26332 cat >>confdefs.h <<_ACEOF
26333#define HAVE_UNSETENV 1
26334_ACEOF
26335
26336fi
26337done
26338
26339 if test $ac_cv_func_unsetenv = no; then
26340 HAVE_UNSETENV=0
26341 else
26342 HAVE_UNSETENV=1
26343 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
26344$as_echo_n "checking for unsetenv() return type... " >&6; }
d0ac1c44 26345if ${gt_cv_func_unsetenv_ret+:} false; then :
3d99e817
AK
26346 $as_echo_n "(cached) " >&6
26347else
26348 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26349/* end confdefs.h. */
26350
26351#undef _BSD
26352#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
26353#include <stdlib.h>
26354extern
26355#ifdef __cplusplus
26356"C"
26357#endif
26358int unsetenv (const char *name);
26359
26360int
26361main ()
26362{
26363
26364 ;
26365 return 0;
26366}
26367_ACEOF
26368if ac_fn_c_try_compile "$LINENO"; then :
26369 gt_cv_func_unsetenv_ret='int'
26370else
26371 gt_cv_func_unsetenv_ret='void'
26372fi
26373rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26374fi
26375{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
26376$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
26377 if test $gt_cv_func_unsetenv_ret = 'void'; then
26378
26379$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
26380
26381 REPLACE_UNSETENV=1
26382 fi
26383
26384 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
26385$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
d0ac1c44 26386if ${gl_cv_func_unsetenv_works+:} false; then :
3d99e817
AK
26387 $as_echo_n "(cached) " >&6
26388else
26389 if test "$cross_compiling" = yes; then :
26390 case "$host_os" in
26391 # Guess yes on glibc systems.
26392 *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
c0c3707f
CB
26393 # If we don't know, obey --enable-cross-guesses.
26394 *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
3d99e817
AK
26395 esac
26396
26397else
26398 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26399/* end confdefs.h. */
26400
26401 #include <stdlib.h>
26402 #include <errno.h>
26403 extern char **environ;
26404
26405int
26406main ()
26407{
26408
26409 char entry1[] = "a=1";
26410 char entry2[] = "b=2";
26411 char *env[] = { entry1, entry2, NULL };
26412 if (putenv ((char *) "a=1")) return 1;
26413 if (putenv (entry2)) return 2;
26414 entry2[0] = 'a';
26415 unsetenv ("a");
26416 if (getenv ("a")) return 3;
26417 if (!unsetenv ("") || errno != EINVAL) return 4;
26418 entry2[0] = 'b';
26419 environ = env;
26420 if (!getenv ("a")) return 5;
26421 entry2[0] = 'a';
26422 unsetenv ("a");
26423 if (getenv ("a")) return 6;
26424
26425 ;
26426 return 0;
26427}
26428_ACEOF
26429if ac_fn_c_try_run "$LINENO"; then :
26430 gl_cv_func_unsetenv_works=yes
26431else
26432 gl_cv_func_unsetenv_works=no
26433fi
26434rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26435 conftest.$ac_objext conftest.beam conftest.$ac_ext
26436fi
26437
26438fi
26439{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
26440$as_echo "$gl_cv_func_unsetenv_works" >&6; }
26441 case "$gl_cv_func_unsetenv_works" in
26442 *yes) ;;
26443 *)
26444 REPLACE_UNSETENV=1
26445 ;;
26446 esac
26447 fi
26448
26449 if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
26450
26451
26452
26453
26454
26455
26456
26457
26458 gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext"
26459
26460
26461
26462
26463
26464 fi
26465
26466
26467
26468
26469
26470 GNULIB_UNSETENV=1
26471
26472
26473
26474
26475
26476$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
26477
26478
26479
26480
26481
26482
8839a007
PA
26483
26484
26485
26486
26487
26488
26489
8690e634
JK
26490
26491
26492 if test $gl_cv_have_include_next = yes; then
26493 gl_cv_next_wchar_h='<'wchar.h'>'
26494 else
26495 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
26496$as_echo_n "checking absolute name of <wchar.h>... " >&6; }
d0ac1c44 26497if ${gl_cv_next_wchar_h+:} false; then :
8690e634
JK
26498 $as_echo_n "(cached) " >&6
26499else
26500
26501 if test $ac_cv_header_wchar_h = yes; then
26502
26503
4a626d0a
PA
26504
26505
26506 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
26507/* end confdefs.h. */
26508#include <wchar.h>
8690e634 26509_ACEOF
4a626d0a
PA
26510 case "$host_os" in
26511 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26512 *) gl_absname_cpp="$ac_cpp" ;;
26513 esac
26514
26515 case "$host_os" in
26516 mingw*)
26517 gl_dirsep_regex='[/\\]'
26518 ;;
26519 *)
26520 gl_dirsep_regex='\/'
26521 ;;
26522 esac
26523 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26524 gl_header_literal_regex=`echo 'wchar.h' \
26525 | sed -e "$gl_make_literal_regex_sed"`
26526 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26527 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26528 s|^/[^/]|//&|
26529 p
26530 q
26531 }'
26532
26533 gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26534 sed -n "$gl_absolute_header_sed"`
26535
26536 gl_header=$gl_cv_absolute_wchar_h
26537 gl_cv_next_wchar_h='"'$gl_header'"'
8690e634
JK
26538 else
26539 gl_cv_next_wchar_h='<'wchar.h'>'
26540 fi
26541
26542
26543fi
26544{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
26545$as_echo "$gl_cv_next_wchar_h" >&6; }
26546 fi
26547 NEXT_WCHAR_H=$gl_cv_next_wchar_h
26548
26549 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
26550 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
26551 gl_next_as_first_directive='<'wchar.h'>'
26552 else
26553 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
26554 gl_next_as_first_directive=$gl_cv_next_wchar_h
26555 fi
26556 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
26557
26558
26559
26560
26561 if test $ac_cv_header_wchar_h = yes; then
26562 HAVE_WCHAR_H=1
26563 else
26564 HAVE_WCHAR_H=0
26565 fi
26566
c971b7fa
PA
26567
26568
26569
26570
8690e634
JK
26571 if test $gt_cv_c_wint_t = yes; then
26572 HAVE_WINT_T=1
26573 else
26574 HAVE_WINT_T=0
26575 fi
c971b7fa
PA
26576
26577
26578
8690e634
JK
26579
26580
26581
26582
26583
472fa5ee
SM
26584
26585
26586
26587
26588
8690e634
JK
26589 if test $ac_cv_func_iswcntrl = yes; then
26590 HAVE_ISWCNTRL=1
26591 else
26592 HAVE_ISWCNTRL=0
26593 fi
26594
26595
26596
8690e634
JK
26597 if test $gt_cv_c_wint_t = yes; then
26598 HAVE_WINT_T=1
26599 else
26600 HAVE_WINT_T=0
26601 fi
26602
26603
26604
26605
26606
26607
c971b7fa 26608
8690e634 26609
472fa5ee
SM
26610
26611
c971b7fa
PA
26612
26613
26614
26615 if test $gl_cv_have_include_next = yes; then
8690e634 26616 gl_cv_next_wctype_h='<'wctype.h'>'
c971b7fa 26617 else
8690e634
JK
26618 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
26619$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
d0ac1c44 26620if ${gl_cv_next_wctype_h+:} false; then :
c971b7fa
PA
26621 $as_echo_n "(cached) " >&6
26622else
26623
8690e634
JK
26624 if test $ac_cv_header_wctype_h = yes; then
26625
26626
4a626d0a
PA
26627
26628
26629 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
c971b7fa 26630/* end confdefs.h. */
8690e634 26631#include <wctype.h>
c971b7fa 26632_ACEOF
4a626d0a
PA
26633 case "$host_os" in
26634 aix*) gl_absname_cpp="$ac_cpp -C" ;;
26635 *) gl_absname_cpp="$ac_cpp" ;;
26636 esac
26637
26638 case "$host_os" in
26639 mingw*)
26640 gl_dirsep_regex='[/\\]'
26641 ;;
26642 *)
26643 gl_dirsep_regex='\/'
26644 ;;
26645 esac
26646 gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
26647 gl_header_literal_regex=`echo 'wctype.h' \
26648 | sed -e "$gl_make_literal_regex_sed"`
26649 gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
26650 s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
26651 s|^/[^/]|//&|
26652 p
26653 q
26654 }'
26655
26656 gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
26657 sed -n "$gl_absolute_header_sed"`
26658
26659 gl_header=$gl_cv_absolute_wctype_h
26660 gl_cv_next_wctype_h='"'$gl_header'"'
8690e634
JK
26661 else
26662 gl_cv_next_wctype_h='<'wctype.h'>'
26663 fi
c971b7fa
PA
26664
26665
26666fi
8690e634
JK
26667{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
26668$as_echo "$gl_cv_next_wctype_h" >&6; }
c971b7fa 26669 fi
8690e634 26670 NEXT_WCTYPE_H=$gl_cv_next_wctype_h
c971b7fa
PA
26671
26672 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
26673 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
8690e634 26674 gl_next_as_first_directive='<'wctype.h'>'
c971b7fa
PA
26675 else
26676 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
8690e634 26677 gl_next_as_first_directive=$gl_cv_next_wctype_h
c971b7fa 26678 fi
8690e634
JK
26679 NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
26680
26681
26682
26683
26684 if test $ac_cv_header_wctype_h = yes; then
26685 if test $ac_cv_func_iswcntrl = yes; then
26686 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
26687$as_echo_n "checking whether iswcntrl works... " >&6; }
d0ac1c44 26688if ${gl_cv_func_iswcntrl_works+:} false; then :
8690e634
JK
26689 $as_echo_n "(cached) " >&6
26690else
26691
26692 if test "$cross_compiling" = yes; then :
c0c3707f 26693 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8690e634
JK
26694/* end confdefs.h. */
26695#include <stdlib.h>
26696 #if __GNU_LIBRARY__ == 1
26697 Linux libc5 i18n is broken.
26698 #endif
26699int
26700main ()
26701{
26702
26703 ;
26704 return 0;
26705}
26706_ACEOF
26707if ac_fn_c_try_compile "$LINENO"; then :
26708 gl_cv_func_iswcntrl_works="guessing yes"
26709else
26710 gl_cv_func_iswcntrl_works="guessing no"
26711fi
26712rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26713
26714else
26715 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26716/* end confdefs.h. */
26717
26718 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
26719 included before <wchar.h>.
26720 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
26721 must be included before <wchar.h>. */
26722 #include <stddef.h>
26723 #include <stdio.h>
26724 #include <time.h>
26725 #include <wchar.h>
26726 #include <wctype.h>
26727 int main () { return iswprint ('x') == 0; }
26728
26729_ACEOF
26730if ac_fn_c_try_run "$LINENO"; then :
26731 gl_cv_func_iswcntrl_works=yes
26732else
26733 gl_cv_func_iswcntrl_works=no
26734fi
26735rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26736 conftest.$ac_objext conftest.beam conftest.$ac_ext
26737fi
26738
26739
26740fi
26741{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
26742$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
26743 fi
26744 HAVE_WCTYPE_H=1
26745 else
26746 HAVE_WCTYPE_H=0
26747 fi
26748
26749
c0c3707f
CB
26750 if test $GNULIB_OVERRIDES_WINT_T = 1; then
26751 REPLACE_ISWCNTRL=1
26752 else
26753 case "$gl_cv_func_iswcntrl_works" in
26754 *yes) REPLACE_ISWCNTRL=0 ;;
26755 *) REPLACE_ISWCNTRL=1 ;;
26756 esac
26757 fi
8690e634
JK
26758
26759
26760 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
26761 :
26762 fi
26763
26764 if test $REPLACE_ISWCNTRL = 1; then
26765 REPLACE_TOWLOWER=1
26766 else
26767 for ac_func in towlower
26768do :
26769 ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
d0ac1c44 26770if test "x$ac_cv_func_towlower" = xyes; then :
8690e634
JK
26771 cat >>confdefs.h <<_ACEOF
26772#define HAVE_TOWLOWER 1
26773_ACEOF
26774
26775fi
26776done
26777
26778 if test $ac_cv_func_towlower = yes; then
26779 REPLACE_TOWLOWER=0
26780 else
26781 ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
26782 included before <wchar.h>.
26783 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
26784 must be included before <wchar.h>. */
26785 #include <stddef.h>
26786 #include <stdio.h>
26787 #include <time.h>
26788 #include <wchar.h>
26789 #if HAVE_WCTYPE_H
26790 # include <wctype.h>
26791 #endif
26792
26793"
d0ac1c44 26794if test "x$ac_cv_have_decl_towlower" = xyes; then :
8690e634
JK
26795 ac_have_decl=1
26796else
26797 ac_have_decl=0
26798fi
26799
26800cat >>confdefs.h <<_ACEOF
26801#define HAVE_DECL_TOWLOWER $ac_have_decl
26802_ACEOF
26803
26804 if test $ac_cv_have_decl_towlower = yes; then
26805 REPLACE_TOWLOWER=1
26806 else
26807 REPLACE_TOWLOWER=0
26808 fi
26809 fi
26810 fi
26811
26812
26813 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
26814 :
26815 fi
26816
26817 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
26818$as_echo_n "checking for wctype_t... " >&6; }
d0ac1c44 26819if ${gl_cv_type_wctype_t+:} false; then :
8690e634
JK
26820 $as_echo_n "(cached) " >&6
26821else
26822 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26823/* end confdefs.h. */
26824/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
26825 included before <wchar.h>.
26826 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
26827 must be included before <wchar.h>. */
26828 #include <stddef.h>
26829 #include <stdio.h>
26830 #include <time.h>
26831 #include <wchar.h>
26832 #if HAVE_WCTYPE_H
26833 # include <wctype.h>
26834 #endif
26835 wctype_t a;
26836
26837int
26838main ()
26839{
26840
26841 ;
26842 return 0;
26843}
26844_ACEOF
26845if ac_fn_c_try_compile "$LINENO"; then :
26846 gl_cv_type_wctype_t=yes
26847else
26848 gl_cv_type_wctype_t=no
26849fi
26850rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 26851
8690e634
JK
26852fi
26853{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
26854$as_echo "$gl_cv_type_wctype_t" >&6; }
26855 if test $gl_cv_type_wctype_t = no; then
26856 HAVE_WCTYPE_T=0
26857 fi
26858
26859 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
26860$as_echo_n "checking for wctrans_t... " >&6; }
d0ac1c44 26861if ${gl_cv_type_wctrans_t+:} false; then :
8690e634
JK
26862 $as_echo_n "(cached) " >&6
26863else
26864 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26865/* end confdefs.h. */
26866/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
26867 included before <wchar.h>.
26868 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
26869 must be included before <wchar.h>. */
26870 #include <stddef.h>
26871 #include <stdio.h>
26872 #include <time.h>
26873 #include <wchar.h>
26874 #include <wctype.h>
26875 wctrans_t a;
c971b7fa 26876
8690e634
JK
26877int
26878main ()
26879{
c971b7fa 26880
8690e634
JK
26881 ;
26882 return 0;
26883}
26884_ACEOF
26885if ac_fn_c_try_compile "$LINENO"; then :
26886 gl_cv_type_wctrans_t=yes
26887else
26888 gl_cv_type_wctrans_t=no
26889fi
26890rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
c971b7fa 26891
8690e634
JK
26892fi
26893{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
26894$as_echo "$gl_cv_type_wctrans_t" >&6; }
26895 if test $gl_cv_type_wctrans_t = no; then
26896 HAVE_WCTRANS_T=0
c971b7fa
PA
26897 fi
26898
26899
5e8754f9 26900
5e8754f9 26901
c971b7fa 26902
c0c3707f
CB
26903
26904 case "$host_os" in
26905 mingw*)
26906
26907
26908
26909
26910
26911
26912
26913
26914 gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext"
26915
26916 ;;
26917 esac
26918
26919 case "$host_os" in
26920 mingw*)
26921
26922
26923
26924
26925
26926
26927
26928
26929 gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext"
26930
26931 ;;
26932 esac
26933
26934 case "$host_os" in
26935 mingw*)
26936
26937
c971b7fa
PA
26938
26939
c0c3707f
CB
26940
26941
26942
26943
26944 gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext"
26945
26946 ;;
26947 esac
26948
26949 case "$host_os" in
26950 mingw*)
26951
26952
26953
26954
26955
26956
26957
26958
26959 gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext"
26960
26961 ;;
26962 esac
c971b7fa
PA
26963 # End of code from modules
26964
26965
26966
26967
26968
26969
26970
26971
26972
26973 gltests_libdeps=
26974 gltests_ltlibdeps=
26975
26976
26977
26978
26979
26980
26981
26982
26983
26984 gl_source_base='tests'
26985 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
26986
26987 gl_module_indicator_condition=$gltests_WITNESS
26988
26989
26990
26991
26992
26993
26994
26995
26996
26997 LIBGNU_LIBDEPS="$gl_libdeps"
26998
26999 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
27000
27001
27002
d0ac1c44 27003am__api_version='1.15'
c971b7fa
PA
27004
27005# Find a good install program. We prefer a C program (faster),
27006# so one script is as good as another. But avoid the broken or
27007# incompatible versions:
27008# SysV /etc/install, /usr/sbin/install
27009# SunOS /usr/etc/install
27010# IRIX /sbin/install
27011# AIX /bin/install
27012# AmigaOS /C/install, which installs bootblocks on floppy discs
27013# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
27014# AFS /usr/afsws/bin/install, which mishandles nonexistent args
27015# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
27016# OS/2's system install, which has a completely different semantic
27017# ./install, which can be erroneously created by make from ./install.sh.
27018# Reject install programs that cannot install multiple files.
27019{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
27020$as_echo_n "checking for a BSD-compatible install... " >&6; }
27021if test -z "$INSTALL"; then
d0ac1c44 27022if ${ac_cv_path_install+:} false; then :
c971b7fa
PA
27023 $as_echo_n "(cached) " >&6
27024else
27025 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27026for as_dir in $PATH
27027do
27028 IFS=$as_save_IFS
27029 test -z "$as_dir" && as_dir=.
27030 # Account for people who put trailing slashes in PATH elements.
27031case $as_dir/ in #((
27032 ./ | .// | /[cC]/* | \
27033 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
27034 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
27035 /usr/ucb/* ) ;;
27036 *)
27037 # OSF1 and SCO ODT 3.0 have their own names for install.
27038 # Don't use installbsd from OSF since it installs stuff as root
27039 # by default.
27040 for ac_prog in ginstall scoinst install; do
27041 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27042 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
c971b7fa
PA
27043 if test $ac_prog = install &&
27044 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
27045 # AIX install. It has an incompatible calling convention.
27046 :
27047 elif test $ac_prog = install &&
27048 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
27049 # program-specific install script used by HP pwplus--don't use.
27050 :
27051 else
27052 rm -rf conftest.one conftest.two conftest.dir
27053 echo one > conftest.one
27054 echo two > conftest.two
27055 mkdir conftest.dir
27056 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
27057 test -s conftest.one && test -s conftest.two &&
27058 test -s conftest.dir/conftest.one &&
27059 test -s conftest.dir/conftest.two
27060 then
27061 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
27062 break 3
27063 fi
27064 fi
27065 fi
27066 done
27067 done
27068 ;;
27069esac
27070
27071 done
27072IFS=$as_save_IFS
27073
27074rm -rf conftest.one conftest.two conftest.dir
27075
27076fi
27077 if test "${ac_cv_path_install+set}" = set; then
27078 INSTALL=$ac_cv_path_install
27079 else
27080 # As a last resort, use the slow shell script. Don't cache a
27081 # value for INSTALL within a source directory, because that will
27082 # break other packages using the cache if that directory is
27083 # removed, or if the value is a relative name.
27084 INSTALL=$ac_install_sh
27085 fi
27086fi
27087{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
27088$as_echo "$INSTALL" >&6; }
27089
27090# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
27091# It thinks the first close brace ends the variable substitution.
27092test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
27093
27094test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
27095
27096test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
27097
27098{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
27099$as_echo_n "checking whether build environment is sane... " >&6; }
c971b7fa
PA
27100# Reject unsafe characters in $srcdir or the absolute working directory
27101# name. Accept space and tab only in the latter.
27102am_lf='
27103'
27104case `pwd` in
27105 *[\\\"\#\$\&\'\`$am_lf]*)
d0ac1c44 27106 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
c971b7fa
PA
27107esac
27108case $srcdir in
27109 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
d0ac1c44 27110 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
c971b7fa
PA
27111esac
27112
d0ac1c44 27113# Do 'set' in a subshell so we don't clobber the current shell's
c971b7fa
PA
27114# arguments. Must try -L first in case configure is actually a
27115# symlink; some systems play weird games with the mod time of symlinks
27116# (eg FreeBSD returns the mod time of the symlink's containing
27117# directory).
27118if (
d0ac1c44
SM
27119 am_has_slept=no
27120 for am_try in 1 2; do
27121 echo "timestamp, slept: $am_has_slept" > conftest.file
27122 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
27123 if test "$*" = "X"; then
27124 # -L didn't work.
27125 set X `ls -t "$srcdir/configure" conftest.file`
27126 fi
27127 if test "$*" != "X $srcdir/configure conftest.file" \
27128 && test "$*" != "X conftest.file $srcdir/configure"; then
27129
27130 # If neither matched, then we have a broken ls. This can happen
27131 # if, for instance, CONFIG_SHELL is bash and it inherits a
27132 # broken ls alias from the environment. This has actually
27133 # happened. Such a system could not be considered "sane".
27134 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
27135 alias in your environment" "$LINENO" 5
27136 fi
27137 if test "$2" = conftest.file || test $am_try -eq 2; then
27138 break
27139 fi
27140 # Just in case.
27141 sleep 1
27142 am_has_slept=yes
27143 done
c971b7fa
PA
27144 test "$2" = conftest.file
27145 )
27146then
27147 # Ok.
27148 :
27149else
d0ac1c44 27150 as_fn_error $? "newly created file is older than distributed files!
c971b7fa
PA
27151Check your system clock" "$LINENO" 5
27152fi
27153{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
27154$as_echo "yes" >&6; }
d0ac1c44
SM
27155# If we didn't sleep, we still need to ensure time stamps of config.status and
27156# generated files are strictly newer.
27157am_sleep_pid=
27158if grep 'slept: no' conftest.file >/dev/null 2>&1; then
27159 ( sleep 1 ) &
27160 am_sleep_pid=$!
27161fi
27162
27163rm -f conftest.file
27164
c971b7fa
PA
27165test "$program_prefix" != NONE &&
27166 program_transform_name="s&^&$program_prefix&;$program_transform_name"
27167# Use a double $ so make ignores it.
27168test "$program_suffix" != NONE &&
27169 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
27170# Double any \ or $.
27171# By default was `s,x,x', remove it if useless.
27172ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
27173program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
27174
c0c3707f
CB
27175# Expand $ac_aux_dir to an absolute path.
27176am_aux_dir=`cd "$ac_aux_dir" && pwd`
27177
c971b7fa
PA
27178if test x"${MISSING+set}" != xset; then
27179 case $am_aux_dir in
27180 *\ * | *\ *)
27181 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
27182 *)
27183 MISSING="\${SHELL} $am_aux_dir/missing" ;;
27184 esac
27185fi
27186# Use eval to expand $SHELL
d0ac1c44
SM
27187if eval "$MISSING --is-lightweight"; then
27188 am_missing_run="$MISSING "
c971b7fa
PA
27189else
27190 am_missing_run=
d0ac1c44
SM
27191 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
27192$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
c971b7fa
PA
27193fi
27194
d0ac1c44 27195if test x"${install_sh+set}" != xset; then
c971b7fa
PA
27196 case $am_aux_dir in
27197 *\ * | *\ *)
27198 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
27199 *)
27200 install_sh="\${SHELL} $am_aux_dir/install-sh"
27201 esac
27202fi
27203
d0ac1c44
SM
27204# Installed binaries are usually stripped using 'strip' when the user
27205# run "make install-strip". However 'strip' might not be the right
c971b7fa 27206# tool to use in cross-compilation environments, therefore Automake
d0ac1c44 27207# will honor the 'STRIP' environment variable to overrule this program.
c971b7fa
PA
27208if test "$cross_compiling" != no; then
27209 if test -n "$ac_tool_prefix"; then
27210 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
27211set dummy ${ac_tool_prefix}strip; ac_word=$2
27212{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27213$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27214if ${ac_cv_prog_STRIP+:} false; then :
c971b7fa
PA
27215 $as_echo_n "(cached) " >&6
27216else
27217 if test -n "$STRIP"; then
27218 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
27219else
27220as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27221for as_dir in $PATH
27222do
27223 IFS=$as_save_IFS
27224 test -z "$as_dir" && as_dir=.
27225 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27226 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27227 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
27228 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27229 break 2
27230 fi
27231done
27232 done
27233IFS=$as_save_IFS
27234
27235fi
27236fi
27237STRIP=$ac_cv_prog_STRIP
27238if test -n "$STRIP"; then
27239 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
27240$as_echo "$STRIP" >&6; }
27241else
27242 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27243$as_echo "no" >&6; }
27244fi
27245
27246
27247fi
27248if test -z "$ac_cv_prog_STRIP"; then
27249 ac_ct_STRIP=$STRIP
27250 # Extract the first word of "strip", so it can be a program name with args.
27251set dummy strip; ac_word=$2
27252{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27253$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27254if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
c971b7fa
PA
27255 $as_echo_n "(cached) " >&6
27256else
27257 if test -n "$ac_ct_STRIP"; then
27258 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
27259else
27260as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27261for as_dir in $PATH
27262do
27263 IFS=$as_save_IFS
27264 test -z "$as_dir" && as_dir=.
27265 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27266 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27267 ac_cv_prog_ac_ct_STRIP="strip"
27268 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27269 break 2
27270 fi
27271done
27272 done
27273IFS=$as_save_IFS
27274
27275fi
27276fi
27277ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
27278if test -n "$ac_ct_STRIP"; then
27279 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
27280$as_echo "$ac_ct_STRIP" >&6; }
27281else
27282 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27283$as_echo "no" >&6; }
27284fi
27285
27286 if test "x$ac_ct_STRIP" = x; then
27287 STRIP=":"
27288 else
27289 case $cross_compiling:$ac_tool_warned in
27290yes:)
27291{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
27292$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
27293ac_tool_warned=yes ;;
27294esac
27295 STRIP=$ac_ct_STRIP
27296 fi
27297else
27298 STRIP="$ac_cv_prog_STRIP"
27299fi
27300
27301fi
27302INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
27303
c971b7fa
PA
27304for ac_prog in gawk mawk nawk awk
27305do
27306 # Extract the first word of "$ac_prog", so it can be a program name with args.
27307set dummy $ac_prog; ac_word=$2
27308{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27309$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27310if ${ac_cv_prog_AWK+:} false; then :
c971b7fa
PA
27311 $as_echo_n "(cached) " >&6
27312else
27313 if test -n "$AWK"; then
27314 ac_cv_prog_AWK="$AWK" # Let the user override the test.
27315else
27316as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27317for as_dir in $PATH
27318do
27319 IFS=$as_save_IFS
27320 test -z "$as_dir" && as_dir=.
27321 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27322 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27323 ac_cv_prog_AWK="$ac_prog"
27324 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27325 break 2
27326 fi
27327done
27328 done
27329IFS=$as_save_IFS
27330
27331fi
27332fi
27333AWK=$ac_cv_prog_AWK
27334if test -n "$AWK"; then
27335 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
27336$as_echo "$AWK" >&6; }
27337else
27338 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27339$as_echo "no" >&6; }
27340fi
27341
27342
27343 test -n "$AWK" && break
27344done
27345
27346{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
27347$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
27348set x ${MAKE-make}
27349ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
d0ac1c44 27350if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
c971b7fa
PA
27351 $as_echo_n "(cached) " >&6
27352else
27353 cat >conftest.make <<\_ACEOF
27354SHELL = /bin/sh
27355all:
27356 @echo '@@@%%%=$(MAKE)=@@@%%%'
27357_ACEOF
d0ac1c44 27358# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
c971b7fa
PA
27359case `${MAKE-make} -f conftest.make 2>/dev/null` in
27360 *@@@%%%=?*=@@@%%%*)
27361 eval ac_cv_prog_make_${ac_make}_set=yes;;
27362 *)
27363 eval ac_cv_prog_make_${ac_make}_set=no;;
27364esac
27365rm -f conftest.make
27366fi
27367if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
27368 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
27369$as_echo "yes" >&6; }
27370 SET_MAKE=
27371else
27372 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27373$as_echo "no" >&6; }
27374 SET_MAKE="MAKE=${MAKE-make}"
27375fi
27376
27377rm -rf .tst 2>/dev/null
27378mkdir .tst 2>/dev/null
27379if test -d .tst; then
27380 am__leading_dot=.
27381else
27382 am__leading_dot=_
27383fi
27384rmdir .tst 2>/dev/null
27385
27386DEPDIR="${am__leading_dot}deps"
27387
27388ac_config_commands="$ac_config_commands depfiles"
27389
27390
27391am_make=${MAKE-make}
27392cat > confinc << 'END'
27393am__doit:
27394 @echo this is the am__doit target
27395.PHONY: am__doit
27396END
27397# If we don't find an include directive, just comment out the code.
27398{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
27399$as_echo_n "checking for style of include used by $am_make... " >&6; }
27400am__include="#"
27401am__quote=
27402_am_result=none
27403# First try GNU make style include.
27404echo "include confinc" > confmf
d0ac1c44 27405# Ignore all kinds of additional output from 'make'.
c971b7fa
PA
27406case `$am_make -s -f confmf 2> /dev/null` in #(
27407*the\ am__doit\ target*)
27408 am__include=include
27409 am__quote=
27410 _am_result=GNU
27411 ;;
27412esac
27413# Now try BSD make style include.
27414if test "$am__include" = "#"; then
27415 echo '.include "confinc"' > confmf
27416 case `$am_make -s -f confmf 2> /dev/null` in #(
27417 *the\ am__doit\ target*)
27418 am__include=.include
27419 am__quote="\""
27420 _am_result=BSD
27421 ;;
27422 esac
27423fi
27424
27425
27426{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
27427$as_echo "$_am_result" >&6; }
27428rm -f confinc confmf
27429
27430# Check whether --enable-dependency-tracking was given.
27431if test "${enable_dependency_tracking+set}" = set; then :
27432 enableval=$enable_dependency_tracking;
27433fi
27434
27435if test "x$enable_dependency_tracking" != xno; then
27436 am_depcomp="$ac_aux_dir/depcomp"
27437 AMDEPBACKSLASH='\'
d0ac1c44 27438 am__nodep='_no'
c971b7fa
PA
27439fi
27440 if test "x$enable_dependency_tracking" != xno; then
27441 AMDEP_TRUE=
27442 AMDEP_FALSE='#'
27443else
27444 AMDEP_TRUE='#'
27445 AMDEP_FALSE=
27446fi
27447
27448
d0ac1c44
SM
27449# Check whether --enable-silent-rules was given.
27450if test "${enable_silent_rules+set}" = set; then :
27451 enableval=$enable_silent_rules;
27452fi
27453
27454case $enable_silent_rules in # (((
27455 yes) AM_DEFAULT_VERBOSITY=0;;
27456 no) AM_DEFAULT_VERBOSITY=1;;
27457 *) AM_DEFAULT_VERBOSITY=1;;
27458esac
27459am_make=${MAKE-make}
27460{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
27461$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
27462if ${am_cv_make_support_nested_variables+:} false; then :
27463 $as_echo_n "(cached) " >&6
27464else
27465 if $as_echo 'TRUE=$(BAR$(V))
27466BAR0=false
27467BAR1=true
27468V=1
27469am__doit:
27470 @$(TRUE)
27471.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
27472 am_cv_make_support_nested_variables=yes
27473else
27474 am_cv_make_support_nested_variables=no
27475fi
27476fi
27477{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
27478$as_echo "$am_cv_make_support_nested_variables" >&6; }
27479if test $am_cv_make_support_nested_variables = yes; then
27480 AM_V='$(V)'
27481 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
27482else
27483 AM_V=$AM_DEFAULT_VERBOSITY
27484 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
27485fi
27486AM_BACKSLASH='\'
27487
c971b7fa
PA
27488if test "`cd $srcdir && pwd`" != "`pwd`"; then
27489 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
27490 # is not polluted with repeated "-I."
27491 am__isrc=' -I$(srcdir)'
27492 # test to see if srcdir already configured
27493 if test -f $srcdir/config.status; then
d0ac1c44 27494 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
c971b7fa
PA
27495 fi
27496fi
27497
27498# test whether we have cygpath
27499if test -z "$CYGPATH_W"; then
27500 if (cygpath --version) >/dev/null 2>/dev/null; then
27501 CYGPATH_W='cygpath -w'
27502 else
27503 CYGPATH_W=echo
27504 fi
27505fi
27506
27507
27508# Define the identity of the package.
d0ac1c44
SM
27509 PACKAGE='libgnu'
27510 VERSION='UNUSED-VERSION'
c971b7fa
PA
27511
27512
27513# Some tools Automake needs.
27514
27515ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
27516
27517
27518AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
27519
27520
27521AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
27522
27523
27524AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
27525
27526
27527MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
27528
d0ac1c44
SM
27529# For better backward compatibility. To be removed once Automake 1.9.x
27530# dies out for good. For more background, see:
27531# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
27532# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
27533mkdir_p='$(MKDIR_P)'
27534
27535# We need awk for the "check" target (and possibly the TAP driver). The
27536# system "awk" is bad on some platforms.
27537# Always define AMTAR for backward compatibility. Yes, it's still used
27538# in the wild :-( We should find a proper way to deprecate it ...
27539AMTAR='$${TAR-tar}'
27540
27541
27542# We'll loop over all known methods to create a tar archive until one works.
27543_am_tools='gnutar pax cpio none'
c971b7fa 27544
d0ac1c44 27545am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
c971b7fa 27546
c971b7fa
PA
27547
27548
27549
27550
27551depcc="$CC" am_compiler_list=
27552
27553{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
27554$as_echo_n "checking dependency style of $depcc... " >&6; }
d0ac1c44 27555if ${am_cv_CC_dependencies_compiler_type+:} false; then :
c971b7fa
PA
27556 $as_echo_n "(cached) " >&6
27557else
27558 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
27559 # We make a subdir and do the tests there. Otherwise we can end up
27560 # making bogus files that we don't know about and never remove. For
27561 # instance it was reported that on HP-UX the gcc test will end up
d0ac1c44
SM
27562 # making a dummy file named 'D' -- because '-MD' means "put the output
27563 # in D".
27564 rm -rf conftest.dir
c971b7fa
PA
27565 mkdir conftest.dir
27566 # Copy depcomp to subdir because otherwise we won't find it if we're
27567 # using a relative directory.
27568 cp "$am_depcomp" conftest.dir
27569 cd conftest.dir
27570 # We will build objects and dependencies in a subdirectory because
27571 # it helps to detect inapplicable dependency modes. For instance
27572 # both Tru64's cc and ICC support -MD to output dependencies as a
27573 # side effect of compilation, but ICC will put the dependencies in
27574 # the current directory while Tru64 will put them in the object
27575 # directory.
27576 mkdir sub
27577
27578 am_cv_CC_dependencies_compiler_type=none
27579 if test "$am_compiler_list" = ""; then
27580 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
27581 fi
27582 am__universal=false
27583 case " $depcc " in #(
27584 *\ -arch\ *\ -arch\ *) am__universal=true ;;
27585 esac
27586
27587 for depmode in $am_compiler_list; do
27588 # Setup a source with many dependencies, because some compilers
27589 # like to wrap large dependency lists on column 80 (with \), and
27590 # we should not choose a depcomp mode which is confused by this.
27591 #
27592 # We need to recreate these files for each test, as the compiler may
27593 # overwrite some of them when testing with obscure command lines.
27594 # This happens at least with the AIX C compiler.
27595 : > sub/conftest.c
27596 for i in 1 2 3 4 5 6; do
27597 echo '#include "conftst'$i'.h"' >> sub/conftest.c
d0ac1c44
SM
27598 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
27599 # Solaris 10 /bin/sh.
27600 echo '/* dummy */' > sub/conftst$i.h
c971b7fa
PA
27601 done
27602 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
27603
d0ac1c44 27604 # We check with '-c' and '-o' for the sake of the "dashmstdout"
c971b7fa 27605 # mode. It turns out that the SunPro C++ compiler does not properly
d0ac1c44
SM
27606 # handle '-M -o', and we need to detect this. Also, some Intel
27607 # versions had trouble with output in subdirs.
c971b7fa
PA
27608 am__obj=sub/conftest.${OBJEXT-o}
27609 am__minus_obj="-o $am__obj"
27610 case $depmode in
27611 gcc)
27612 # This depmode causes a compiler race in universal mode.
27613 test "$am__universal" = false || continue
27614 ;;
27615 nosideeffect)
d0ac1c44
SM
27616 # After this tag, mechanisms are not by side-effect, so they'll
27617 # only be used when explicitly requested.
c971b7fa
PA
27618 if test "x$enable_dependency_tracking" = xyes; then
27619 continue
27620 else
27621 break
27622 fi
27623 ;;
d0ac1c44
SM
27624 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
27625 # This compiler won't grok '-c -o', but also, the minuso test has
c971b7fa
PA
27626 # not run yet. These depmodes are late enough in the game, and
27627 # so weak that their functioning should not be impacted.
27628 am__obj=conftest.${OBJEXT-o}
27629 am__minus_obj=
27630 ;;
27631 none) break ;;
27632 esac
27633 if depmode=$depmode \
27634 source=sub/conftest.c object=$am__obj \
27635 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27636 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
27637 >/dev/null 2>conftest.err &&
27638 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27639 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27640 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27641 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27642 # icc doesn't choke on unknown options, it will just issue warnings
27643 # or remarks (even with -Werror). So we grep stderr for any message
27644 # that says an option was ignored or not supported.
27645 # When given -MP, icc 7.0 and 7.1 complain thusly:
27646 # icc: Command line warning: ignoring option '-M'; no argument required
27647 # The diagnosis changed in icc 8.0:
27648 # icc: Command line remark: option '-MP' not supported
27649 if (grep 'ignoring option' conftest.err ||
27650 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
27651 am_cv_CC_dependencies_compiler_type=$depmode
27652 break
27653 fi
27654 fi
27655 done
27656
27657 cd ..
27658 rm -rf conftest.dir
27659else
27660 am_cv_CC_dependencies_compiler_type=none
27661fi
27662
27663fi
27664{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
27665$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
27666CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
27667
27668 if
27669 test "x$enable_dependency_tracking" != xno \
27670 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
27671 am__fastdepCC_TRUE=
27672 am__fastdepCC_FALSE='#'
27673else
27674 am__fastdepCC_TRUE='#'
27675 am__fastdepCC_FALSE=
27676fi
27677
27678
27679
d0ac1c44
SM
27680# POSIX will say in a future version that running "rm -f" with no argument
27681# is OK; and we want to be able to make that assumption in our Makefile
27682# recipes. So use an aggressive probe to check that the usage we want is
27683# actually supported "in the wild" to an acceptable degree.
27684# See automake bug#10828.
27685# To make any issue more visible, cause the running configure to be aborted
27686# by default if the 'rm' program in use doesn't match our expectations; the
27687# user can still override this though.
27688if rm -f && rm -fr && rm -rf; then : OK; else
27689 cat >&2 <<'END'
27690Oops!
27691
27692Your 'rm' program seems unable to run without file operands specified
27693on the command line, even when the '-f' option is present. This is contrary
27694to the behaviour of most rm programs out there, and not conforming with
27695the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
27696
27697Please tell bug-automake@gnu.org about your system, including the value
27698of your $PATH and any error possibly output before this message. This
27699can help us improve future automake versions.
27700
27701END
27702 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
27703 echo 'Configuration will proceed anyway, since you have set the' >&2
27704 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
27705 echo >&2
27706 else
27707 cat >&2 <<'END'
27708Aborting the configuration process, to ensure you take notice of the issue.
27709
27710You can download and install GNU coreutils to get an 'rm' implementation
27711that behaves properly: <http://www.gnu.org/software/coreutils/>.
27712
27713If you want to complete the configuration process using your problematic
27714'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
27715to "yes", and re-run configure.
27716
27717END
27718 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
27719 fi
27720fi
27721
c971b7fa 27722
39be3c7e
SM
27723# Check whether --enable-silent-rules was given.
27724if test "${enable_silent_rules+set}" = set; then :
27725 enableval=$enable_silent_rules;
27726fi
27727
d0ac1c44
SM
27728case $enable_silent_rules in # (((
27729 yes) AM_DEFAULT_VERBOSITY=0;;
27730 no) AM_DEFAULT_VERBOSITY=1;;
27731 *) AM_DEFAULT_VERBOSITY=0;;
39be3c7e 27732esac
d0ac1c44
SM
27733am_make=${MAKE-make}
27734{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
27735$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
27736if ${am_cv_make_support_nested_variables+:} false; then :
27737 $as_echo_n "(cached) " >&6
27738else
27739 if $as_echo 'TRUE=$(BAR$(V))
27740BAR0=false
27741BAR1=true
27742V=1
27743am__doit:
27744 @$(TRUE)
27745.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
27746 am_cv_make_support_nested_variables=yes
27747else
27748 am_cv_make_support_nested_variables=no
27749fi
27750fi
27751{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
27752$as_echo "$am_cv_make_support_nested_variables" >&6; }
27753if test $am_cv_make_support_nested_variables = yes; then
27754 AM_V='$(V)'
27755 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
27756else
27757 AM_V=$AM_DEFAULT_VERBOSITY
27758 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
27759fi
39be3c7e
SM
27760AM_BACKSLASH='\'
27761
27762
c971b7fa
PA
27763# --------------------- #
27764# Checks for programs. #
27765# --------------------- #
27766
27767
27768{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
27769$as_echo_n "checking whether ln -s works... " >&6; }
27770LN_S=$as_ln_s
27771if test "$LN_S" = "ln -s"; then
27772 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
27773$as_echo "yes" >&6; }
27774else
27775 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
27776$as_echo "no, using $LN_S" >&6; }
27777fi
27778
27779if test -n "$ac_tool_prefix"; then
27780 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
27781set dummy ${ac_tool_prefix}ranlib; ac_word=$2
27782{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27783$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27784if ${ac_cv_prog_RANLIB+:} false; then :
c971b7fa
PA
27785 $as_echo_n "(cached) " >&6
27786else
27787 if test -n "$RANLIB"; then
27788 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
27789else
27790as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27791for as_dir in $PATH
27792do
27793 IFS=$as_save_IFS
27794 test -z "$as_dir" && as_dir=.
27795 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27796 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27797 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
27798 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27799 break 2
27800 fi
27801done
27802 done
27803IFS=$as_save_IFS
27804
27805fi
27806fi
27807RANLIB=$ac_cv_prog_RANLIB
27808if test -n "$RANLIB"; then
27809 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
27810$as_echo "$RANLIB" >&6; }
27811else
27812 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27813$as_echo "no" >&6; }
27814fi
27815
27816
27817fi
27818if test -z "$ac_cv_prog_RANLIB"; then
27819 ac_ct_RANLIB=$RANLIB
27820 # Extract the first word of "ranlib", so it can be a program name with args.
27821set dummy ranlib; ac_word=$2
27822{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27823$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27824if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
c971b7fa
PA
27825 $as_echo_n "(cached) " >&6
27826else
27827 if test -n "$ac_ct_RANLIB"; then
27828 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
27829else
27830as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27831for as_dir in $PATH
27832do
27833 IFS=$as_save_IFS
27834 test -z "$as_dir" && as_dir=.
27835 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27836 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27837 ac_cv_prog_ac_ct_RANLIB="ranlib"
27838 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27839 break 2
27840 fi
27841done
27842 done
27843IFS=$as_save_IFS
27844
27845fi
27846fi
27847ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
27848if test -n "$ac_ct_RANLIB"; then
27849 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
27850$as_echo "$ac_ct_RANLIB" >&6; }
27851else
27852 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27853$as_echo "no" >&6; }
27854fi
27855
27856 if test "x$ac_ct_RANLIB" = x; then
27857 RANLIB=":"
27858 else
27859 case $cross_compiling:$ac_tool_warned in
27860yes:)
27861{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
27862$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
27863ac_tool_warned=yes ;;
27864esac
27865 RANLIB=$ac_ct_RANLIB
27866 fi
27867else
27868 RANLIB="$ac_cv_prog_RANLIB"
27869fi
27870
27871
27872if test -n "$ac_tool_prefix"; then
27873 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
27874set dummy ${ac_tool_prefix}ar; ac_word=$2
27875{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27876$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27877if ${ac_cv_prog_AR+:} false; then :
c971b7fa
PA
27878 $as_echo_n "(cached) " >&6
27879else
27880 if test -n "$AR"; then
27881 ac_cv_prog_AR="$AR" # Let the user override the test.
27882else
27883as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27884for as_dir in $PATH
27885do
27886 IFS=$as_save_IFS
27887 test -z "$as_dir" && as_dir=.
27888 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27889 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27890 ac_cv_prog_AR="${ac_tool_prefix}ar"
27891 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27892 break 2
27893 fi
27894done
27895 done
27896IFS=$as_save_IFS
27897
27898fi
27899fi
27900AR=$ac_cv_prog_AR
27901if test -n "$AR"; then
27902 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
27903$as_echo "$AR" >&6; }
27904else
27905 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27906$as_echo "no" >&6; }
27907fi
27908
27909
27910fi
27911if test -z "$ac_cv_prog_AR"; then
27912 ac_ct_AR=$AR
27913 # Extract the first word of "ar", so it can be a program name with args.
27914set dummy ar; ac_word=$2
27915{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27916$as_echo_n "checking for $ac_word... " >&6; }
d0ac1c44 27917if ${ac_cv_prog_ac_ct_AR+:} false; then :
c971b7fa
PA
27918 $as_echo_n "(cached) " >&6
27919else
27920 if test -n "$ac_ct_AR"; then
27921 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
27922else
27923as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27924for as_dir in $PATH
27925do
27926 IFS=$as_save_IFS
27927 test -z "$as_dir" && as_dir=.
27928 for ac_exec_ext in '' $ac_executable_extensions; do
d0ac1c44 27929 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
c971b7fa
PA
27930 ac_cv_prog_ac_ct_AR="ar"
27931 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
27932 break 2
27933 fi
27934done
27935 done
27936IFS=$as_save_IFS
27937
27938fi
27939fi
27940ac_ct_AR=$ac_cv_prog_ac_ct_AR
27941if test -n "$ac_ct_AR"; then
27942 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
27943$as_echo "$ac_ct_AR" >&6; }
27944else
27945 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27946$as_echo "no" >&6; }
27947fi
27948
27949 if test "x$ac_ct_AR" = x; then
27950 AR=""
27951 else
27952 case $cross_compiling:$ac_tool_warned in
27953yes:)
27954{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
27955$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
27956ac_tool_warned=yes ;;
27957esac
27958 AR=$ac_ct_AR
27959 fi
27960else
27961 AR="$ac_cv_prog_AR"
27962fi
27963
27964
27965# ---------------------- #
27966# Checks for libraries. #
27967# ---------------------- #
27968
27969ac_config_files="$ac_config_files Makefile import/Makefile"
27970
27971ac_config_commands="$ac_config_commands default"
27972
27973cat >confcache <<\_ACEOF
27974# This file is a shell script that caches the results of configure
27975# tests run on this system so they can be shared between configure
27976# scripts and configure runs, see configure's option --config-cache.
27977# It is not useful on other systems. If it contains results you don't
27978# want to keep, you may remove or edit it.
27979#
27980# config.status only pays attention to the cache file if you give it
27981# the --recheck option to rerun configure.
27982#
27983# `ac_cv_env_foo' variables (set or unset) will be overridden when
27984# loading this file, other *unset* `ac_cv_foo' will be assigned the
27985# following values.
27986
27987_ACEOF
27988
27989# The following way of writing the cache mishandles newlines in values,
27990# but we know of no workaround that is simple, portable, and efficient.
27991# So, we kill variables containing newlines.
27992# Ultrix sh set writes to stderr and can't be redirected directly,
27993# and sets the high bit in the cache file unless we assign to the vars.
27994(
27995 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
27996 eval ac_val=\$$ac_var
27997 case $ac_val in #(
27998 *${as_nl}*)
27999 case $ac_var in #(
28000 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
28001$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
28002 esac
28003 case $ac_var in #(
28004 _ | IFS | as_nl) ;; #(
28005 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
28006 *) { eval $ac_var=; unset $ac_var;} ;;
28007 esac ;;
28008 esac
28009 done
28010
28011 (set) 2>&1 |
28012 case $as_nl`(ac_space=' '; set) 2>&1` in #(
28013 *${as_nl}ac_space=\ *)
28014 # `set' does not quote correctly, so add quotes: double-quote
28015 # substitution turns \\\\ into \\, and sed turns \\ into \.
28016 sed -n \
28017 "s/'/'\\\\''/g;
28018 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
28019 ;; #(
28020 *)
28021 # `set' quotes correctly as required by POSIX, so do not add quotes.
28022 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
28023 ;;
28024 esac |
28025 sort
28026) |
28027 sed '
28028 /^ac_cv_env_/b end
28029 t clear
28030 :clear
28031 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
28032 t end
28033 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
28034 :end' >>confcache
28035if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
28036 if test -w "$cache_file"; then
d0ac1c44 28037 if test "x$cache_file" != "x/dev/null"; then
c971b7fa
PA
28038 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
28039$as_echo "$as_me: updating cache $cache_file" >&6;}
d0ac1c44
SM
28040 if test ! -f "$cache_file" || test -h "$cache_file"; then
28041 cat confcache >"$cache_file"
28042 else
28043 case $cache_file in #(
28044 */* | ?:*)
28045 mv -f confcache "$cache_file"$$ &&
28046 mv -f "$cache_file"$$ "$cache_file" ;; #(
28047 *)
28048 mv -f confcache "$cache_file" ;;
28049 esac
28050 fi
28051 fi
c971b7fa
PA
28052 else
28053 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
28054$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
28055 fi
28056fi
28057rm -f confcache
28058
28059test "x$prefix" = xNONE && prefix=$ac_default_prefix
28060# Let make expand exec_prefix.
28061test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
28062
28063DEFS=-DHAVE_CONFIG_H
28064
28065ac_libobjs=
28066ac_ltlibobjs=
28067for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
28068 # 1. Remove the extension, and $U if already installed.
28069 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
28070 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
28071 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
28072 # will be set to the directory where LIBOBJS objects are built.
28073 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
28074 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
28075done
28076LIBOBJS=$ac_libobjs
28077
28078LTLIBOBJS=$ac_ltlibobjs
28079
28080
28081if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
d0ac1c44 28082 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
c971b7fa
PA
28083Usually this means the macro was only invoked conditionally." "$LINENO" 5
28084fi
28085if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
d0ac1c44 28086 as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
c971b7fa
PA
28087Usually this means the macro was only invoked conditionally." "$LINENO" 5
28088fi
8690e634 28089if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
d0ac1c44 28090 as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
8690e634
JK
28091Usually this means the macro was only invoked conditionally." "$LINENO" 5
28092fi
18848e28 28093if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
d0ac1c44 28094 as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
18848e28
GF
28095Usually this means the macro was only invoked conditionally." "$LINENO" 5
28096fi
88b48903 28097if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
d0ac1c44 28098 as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
88b48903
WN
28099Usually this means the macro was only invoked conditionally." "$LINENO" 5
28100fi
8690e634 28101if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
d0ac1c44 28102 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
8690e634
JK
28103Usually this means the macro was only invoked conditionally." "$LINENO" 5
28104fi
c0c3707f
CB
28105if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
28106 as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
28107Usually this means the macro was only invoked conditionally." "$LINENO" 5
28108fi
28109if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
28110 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
28111Usually this means the macro was only invoked conditionally." "$LINENO" 5
28112fi
6ec2e0f5 28113if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then
d0ac1c44 28114 as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined.
6ec2e0f5
SDJ
28115Usually this means the macro was only invoked conditionally." "$LINENO" 5
28116fi
49e4877c 28117if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
d0ac1c44 28118 as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
49e4877c
PA
28119Usually this means the macro was only invoked conditionally." "$LINENO" 5
28120fi
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
c971b7fa 28125if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
d0ac1c44 28126 as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
c971b7fa
PA
28127Usually this means the macro was only invoked conditionally." "$LINENO" 5
28128fi
88b48903
WN
28129
28130
725e2999
JB
28131if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
28132 as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined.
28133Usually this means the macro was only invoked conditionally." "$LINENO" 5
28134fi
28135if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
28136 as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
28137Usually this means the macro was only invoked conditionally." "$LINENO" 5
28138fi
8690e634 28139if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
d0ac1c44 28140 as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
8690e634
JK
28141Usually this means the macro was only invoked conditionally." "$LINENO" 5
28142fi
c971b7fa 28143if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
d0ac1c44 28144 as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
c971b7fa
PA
28145Usually this means the macro was only invoked conditionally." "$LINENO" 5
28146fi
28147
28148 gl_libobjs=
28149 gl_ltlibobjs=
28150 if test -n "$gl_LIBOBJS"; then
28151 # Remove the extension.
28152 sed_drop_objext='s/\.o$//;s/\.obj$//'
28153 for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
28154 gl_libobjs="$gl_libobjs $i.$ac_objext"
28155 gl_ltlibobjs="$gl_ltlibobjs $i.lo"
28156 done
28157 fi
28158 gl_LIBOBJS=$gl_libobjs
28159
28160 gl_LTLIBOBJS=$gl_ltlibobjs
28161
28162
28163
28164 gltests_libobjs=
28165 gltests_ltlibobjs=
28166 if test -n "$gltests_LIBOBJS"; then
28167 # Remove the extension.
28168 sed_drop_objext='s/\.o$//;s/\.obj$//'
28169 for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
28170 gltests_libobjs="$gltests_libobjs $i.$ac_objext"
28171 gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
28172 done
28173 fi
28174 gltests_LIBOBJS=$gltests_libobjs
28175
28176 gltests_LTLIBOBJS=$gltests_ltlibobjs
28177
28178
d0ac1c44
SM
28179{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
28180$as_echo_n "checking that generated files are newer than configure... " >&6; }
28181 if test -n "$am_sleep_pid"; then
28182 # Hide warnings about reused PIDs.
28183 wait $am_sleep_pid 2>/dev/null
28184 fi
28185 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
28186$as_echo "done" >&6; }
c971b7fa 28187if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
d0ac1c44 28188 as_fn_error $? "conditional \"AMDEP\" was never defined.
c971b7fa
PA
28189Usually this means the macro was only invoked conditionally." "$LINENO" 5
28190fi
28191if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
d0ac1c44 28192 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
c971b7fa
PA
28193Usually this means the macro was only invoked conditionally." "$LINENO" 5
28194fi
28195 if test -n "$EXEEXT"; then
28196 am__EXEEXT_TRUE=
28197 am__EXEEXT_FALSE='#'
28198else
28199 am__EXEEXT_TRUE='#'
28200 am__EXEEXT_FALSE=
28201fi
28202
28203
d0ac1c44 28204: "${CONFIG_STATUS=./config.status}"
c971b7fa
PA
28205ac_write_fail=0
28206ac_clean_files_save=$ac_clean_files
28207ac_clean_files="$ac_clean_files $CONFIG_STATUS"
28208{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
28209$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
28210as_write_fail=0
28211cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
28212#! $SHELL
28213# Generated by $as_me.
28214# Run this file to recreate the current configuration.
28215# Compiler output produced by configure, useful for debugging
28216# configure, is in config.log if it exists.
28217
28218debug=false
28219ac_cs_recheck=false
28220ac_cs_silent=false
28221
28222SHELL=\${CONFIG_SHELL-$SHELL}
28223export SHELL
28224_ASEOF
28225cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
28226## -------------------- ##
28227## M4sh Initialization. ##
28228## -------------------- ##
28229
28230# Be more Bourne compatible
28231DUALCASE=1; export DUALCASE # for MKS sh
28232if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
28233 emulate sh
28234 NULLCMD=:
28235 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
28236 # is contrary to our usage. Disable this feature.
28237 alias -g '${1+"$@"}'='"$@"'
28238 setopt NO_GLOB_SUBST
28239else
28240 case `(set -o) 2>/dev/null` in #(
28241 *posix*) :
28242 set -o posix ;; #(
28243 *) :
28244 ;;
28245esac
28246fi
28247
28248
28249as_nl='
28250'
28251export as_nl
28252# Printing a long string crashes Solaris 7 /usr/bin/printf.
28253as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
28254as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
28255as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
28256# Prefer a ksh shell builtin over an external printf program on Solaris,
28257# but without wasting forks for bash or zsh.
28258if test -z "$BASH_VERSION$ZSH_VERSION" \
28259 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
28260 as_echo='print -r --'
28261 as_echo_n='print -rn --'
28262elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
28263 as_echo='printf %s\n'
28264 as_echo_n='printf %s'
28265else
28266 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
28267 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
28268 as_echo_n='/usr/ucb/echo -n'
28269 else
28270 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
28271 as_echo_n_body='eval
28272 arg=$1;
28273 case $arg in #(
28274 *"$as_nl"*)
28275 expr "X$arg" : "X\\(.*\\)$as_nl";
28276 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
28277 esac;
28278 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
28279 '
28280 export as_echo_n_body
28281 as_echo_n='sh -c $as_echo_n_body as_echo'
28282 fi
28283 export as_echo_body
28284 as_echo='sh -c $as_echo_body as_echo'
28285fi
28286
28287# The user is always right.
28288if test "${PATH_SEPARATOR+set}" != set; then
28289 PATH_SEPARATOR=:
28290 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
28291 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
28292 PATH_SEPARATOR=';'
28293 }
28294fi
28295
28296
28297# IFS
28298# We need space, tab and new line, in precisely that order. Quoting is
28299# there to prevent editors from complaining about space-tab.
28300# (If _AS_PATH_WALK were called with IFS unset, it would disable word
28301# splitting by setting IFS to empty value.)
28302IFS=" "" $as_nl"
28303
28304# Find who we are. Look in the path if we contain no directory separator.
d0ac1c44 28305as_myself=
c971b7fa
PA
28306case $0 in #((
28307 *[\\/]* ) as_myself=$0 ;;
28308 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
28309for as_dir in $PATH
28310do
28311 IFS=$as_save_IFS
28312 test -z "$as_dir" && as_dir=.
28313 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
28314 done
28315IFS=$as_save_IFS
28316
28317 ;;
28318esac
28319# We did not find ourselves, most probably we were run as `sh COMMAND'
28320# in which case we are not to be found in the path.
28321if test "x$as_myself" = x; then
28322 as_myself=$0
28323fi
28324if test ! -f "$as_myself"; then
28325 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
28326 exit 1
28327fi
28328
28329# Unset variables that we do not need and which cause bugs (e.g. in
28330# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
28331# suppresses any "Segmentation fault" message there. '((' could
28332# trigger a bug in pdksh 5.2.14.
28333for as_var in BASH_ENV ENV MAIL MAILPATH
28334do eval test x\${$as_var+set} = xset \
28335 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
28336done
28337PS1='$ '
28338PS2='> '
28339PS4='+ '
28340
28341# NLS nuisances.
28342LC_ALL=C
28343export LC_ALL
28344LANGUAGE=C
28345export LANGUAGE
28346
28347# CDPATH.
28348(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
28349
28350
d0ac1c44
SM
28351# as_fn_error STATUS ERROR [LINENO LOG_FD]
28352# ----------------------------------------
c971b7fa
PA
28353# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
28354# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
d0ac1c44 28355# script with STATUS, using 1 if that was 0.
c971b7fa
PA
28356as_fn_error ()
28357{
d0ac1c44
SM
28358 as_status=$1; test $as_status -eq 0 && as_status=1
28359 if test "$4"; then
28360 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
28361 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
c971b7fa 28362 fi
d0ac1c44 28363 $as_echo "$as_me: error: $2" >&2
c971b7fa
PA
28364 as_fn_exit $as_status
28365} # as_fn_error
28366
28367
28368# as_fn_set_status STATUS
28369# -----------------------
28370# Set $? to STATUS, without forking.
28371as_fn_set_status ()
28372{
28373 return $1
28374} # as_fn_set_status
28375
28376# as_fn_exit STATUS
28377# -----------------
28378# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
28379as_fn_exit ()
28380{
28381 set +e
28382 as_fn_set_status $1
28383 exit $1
28384} # as_fn_exit
28385
28386# as_fn_unset VAR
28387# ---------------
28388# Portably unset VAR.
28389as_fn_unset ()
28390{
28391 { eval $1=; unset $1;}
28392}
28393as_unset=as_fn_unset
28394# as_fn_append VAR VALUE
28395# ----------------------
28396# Append the text in VALUE to the end of the definition contained in VAR. Take
28397# advantage of any shell optimizations that allow amortized linear growth over
28398# repeated appends, instead of the typical quadratic growth present in naive
28399# implementations.
28400if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
28401 eval 'as_fn_append ()
28402 {
28403 eval $1+=\$2
28404 }'
28405else
28406 as_fn_append ()
28407 {
28408 eval $1=\$$1\$2
28409 }
28410fi # as_fn_append
28411
28412# as_fn_arith ARG...
28413# ------------------
28414# Perform arithmetic evaluation on the ARGs, and store the result in the
28415# global $as_val. Take advantage of shells that can avoid forks. The arguments
28416# must be portable across $(()) and expr.
28417if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
28418 eval 'as_fn_arith ()
28419 {
28420 as_val=$(( $* ))
28421 }'
28422else
28423 as_fn_arith ()
28424 {
28425 as_val=`expr "$@" || test $? -eq 1`
28426 }
28427fi # as_fn_arith
28428
28429
28430if expr a : '\(a\)' >/dev/null 2>&1 &&
28431 test "X`expr 00001 : '.*\(...\)'`" = X001; then
28432 as_expr=expr
28433else
28434 as_expr=false
28435fi
28436
28437if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
28438 as_basename=basename
28439else
28440 as_basename=false
28441fi
28442
28443if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
28444 as_dirname=dirname
28445else
28446 as_dirname=false
28447fi
28448
28449as_me=`$as_basename -- "$0" ||
28450$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
28451 X"$0" : 'X\(//\)$' \| \
28452 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
28453$as_echo X/"$0" |
28454 sed '/^.*\/\([^/][^/]*\)\/*$/{
28455 s//\1/
28456 q
28457 }
28458 /^X\/\(\/\/\)$/{
28459 s//\1/
28460 q
28461 }
28462 /^X\/\(\/\).*/{
28463 s//\1/
28464 q
28465 }
28466 s/.*/./; q'`
28467
28468# Avoid depending upon Character Ranges.
28469as_cr_letters='abcdefghijklmnopqrstuvwxyz'
28470as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
28471as_cr_Letters=$as_cr_letters$as_cr_LETTERS
28472as_cr_digits='0123456789'
28473as_cr_alnum=$as_cr_Letters$as_cr_digits
28474
28475ECHO_C= ECHO_N= ECHO_T=
28476case `echo -n x` in #(((((
28477-n*)
28478 case `echo 'xy\c'` in
28479 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
28480 xy) ECHO_C='\c';;
28481 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
28482 ECHO_T=' ';;
28483 esac;;
28484*)
28485 ECHO_N='-n';;
28486esac
28487
28488rm -f conf$$ conf$$.exe conf$$.file
28489if test -d conf$$.dir; then
28490 rm -f conf$$.dir/conf$$.file
28491else
28492 rm -f conf$$.dir
28493 mkdir conf$$.dir 2>/dev/null
28494fi
28495if (echo >conf$$.file) 2>/dev/null; then
28496 if ln -s conf$$.file conf$$ 2>/dev/null; then
28497 as_ln_s='ln -s'
28498 # ... but there are two gotchas:
28499 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
28500 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
d0ac1c44 28501 # In both cases, we have to default to `cp -pR'.
c971b7fa 28502 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
d0ac1c44 28503 as_ln_s='cp -pR'
c971b7fa
PA
28504 elif ln conf$$.file conf$$ 2>/dev/null; then
28505 as_ln_s=ln
28506 else
d0ac1c44 28507 as_ln_s='cp -pR'
c971b7fa
PA
28508 fi
28509else
d0ac1c44 28510 as_ln_s='cp -pR'
c971b7fa
PA
28511fi
28512rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
28513rmdir conf$$.dir 2>/dev/null
28514
28515
28516# as_fn_mkdir_p
28517# -------------
28518# Create "$as_dir" as a directory, including parents if necessary.
28519as_fn_mkdir_p ()
28520{
28521
28522 case $as_dir in #(
28523 -*) as_dir=./$as_dir;;
28524 esac
28525 test -d "$as_dir" || eval $as_mkdir_p || {
28526 as_dirs=
28527 while :; do
28528 case $as_dir in #(
28529 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
28530 *) as_qdir=$as_dir;;
28531 esac
28532 as_dirs="'$as_qdir' $as_dirs"
28533 as_dir=`$as_dirname -- "$as_dir" ||
28534$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
28535 X"$as_dir" : 'X\(//\)[^/]' \| \
28536 X"$as_dir" : 'X\(//\)$' \| \
28537 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
28538$as_echo X"$as_dir" |
28539 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
28540 s//\1/
28541 q
28542 }
28543 /^X\(\/\/\)[^/].*/{
28544 s//\1/
28545 q
28546 }
28547 /^X\(\/\/\)$/{
28548 s//\1/
28549 q
28550 }
28551 /^X\(\/\).*/{
28552 s//\1/
28553 q
28554 }
28555 s/.*/./; q'`
28556 test -d "$as_dir" && break
28557 done
28558 test -z "$as_dirs" || eval "mkdir $as_dirs"
d0ac1c44 28559 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
c971b7fa
PA
28560
28561
28562} # as_fn_mkdir_p
28563if mkdir -p . 2>/dev/null; then
28564 as_mkdir_p='mkdir -p "$as_dir"'
28565else
28566 test -d ./-p && rmdir ./-p
28567 as_mkdir_p=false
28568fi
28569
d0ac1c44
SM
28570
28571# as_fn_executable_p FILE
28572# -----------------------
28573# Test if FILE is an executable regular file.
28574as_fn_executable_p ()
28575{
28576 test -f "$1" && test -x "$1"
28577} # as_fn_executable_p
28578as_test_x='test -x'
28579as_executable_p=as_fn_executable_p
c971b7fa
PA
28580
28581# Sed expression to map a string onto a valid CPP name.
28582as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
28583
28584# Sed expression to map a string onto a valid variable name.
28585as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
28586
28587
28588exec 6>&1
28589## ----------------------------------- ##
28590## Main body of $CONFIG_STATUS script. ##
28591## ----------------------------------- ##
28592_ASEOF
28593test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
28594
28595cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28596# Save the log message, to keep $0 and so on meaningful, and to
28597# report actual input values of CONFIG_FILES etc. instead of their
28598# values after options handling.
28599ac_log="
d0ac1c44
SM
28600This file was extended by libgnu $as_me UNUSED-VERSION, which was
28601generated by GNU Autoconf 2.69. Invocation command line was
c971b7fa
PA
28602
28603 CONFIG_FILES = $CONFIG_FILES
28604 CONFIG_HEADERS = $CONFIG_HEADERS
28605 CONFIG_LINKS = $CONFIG_LINKS
28606 CONFIG_COMMANDS = $CONFIG_COMMANDS
28607 $ $0 $@
28608
28609on `(hostname || uname -n) 2>/dev/null | sed 1q`
28610"
28611
28612_ACEOF
28613
28614case $ac_config_files in *"
28615"*) set x $ac_config_files; shift; ac_config_files=$*;;
28616esac
28617
28618case $ac_config_headers in *"
28619"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
28620esac
28621
28622
28623cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
28624# Files that config.status was made for.
28625config_files="$ac_config_files"
28626config_headers="$ac_config_headers"
28627config_commands="$ac_config_commands"
28628
28629_ACEOF
28630
28631cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28632ac_cs_usage="\
28633\`$as_me' instantiates files and other configuration actions
28634from templates according to the current configuration. Unless the files
28635and actions are specified as TAGs, all are instantiated by default.
28636
28637Usage: $0 [OPTION]... [TAG]...
28638
28639 -h, --help print this help, then exit
28640 -V, --version print version number and configuration settings, then exit
d0ac1c44 28641 --config print configuration, then exit
c971b7fa
PA
28642 -q, --quiet, --silent
28643 do not print progress messages
28644 -d, --debug don't remove temporary files
28645 --recheck update $as_me by reconfiguring in the same conditions
28646 --file=FILE[:TEMPLATE]
28647 instantiate the configuration file FILE
28648 --header=FILE[:TEMPLATE]
28649 instantiate the configuration header FILE
28650
28651Configuration files:
28652$config_files
28653
28654Configuration headers:
28655$config_headers
28656
28657Configuration commands:
28658$config_commands
28659
28660Report bugs to the package provider."
28661
28662_ACEOF
28663cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 28664ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
c971b7fa 28665ac_cs_version="\\
d0ac1c44
SM
28666libgnu config.status UNUSED-VERSION
28667configured by $0, generated by GNU Autoconf 2.69,
28668 with options \\"\$ac_cs_config\\"
c971b7fa 28669
d0ac1c44 28670Copyright (C) 2012 Free Software Foundation, Inc.
c971b7fa
PA
28671This config.status script is free software; the Free Software Foundation
28672gives unlimited permission to copy, distribute and modify it."
28673
28674ac_pwd='$ac_pwd'
28675srcdir='$srcdir'
28676INSTALL='$INSTALL'
28677MKDIR_P='$MKDIR_P'
28678AWK='$AWK'
28679test -n "\$AWK" || AWK=awk
28680_ACEOF
28681
28682cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28683# The default lists apply if the user does not specify any file.
28684ac_need_defaults=:
28685while test $# != 0
28686do
28687 case $1 in
d0ac1c44 28688 --*=?*)
c971b7fa
PA
28689 ac_option=`expr "X$1" : 'X\([^=]*\)='`
28690 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
28691 ac_shift=:
28692 ;;
d0ac1c44
SM
28693 --*=)
28694 ac_option=`expr "X$1" : 'X\([^=]*\)='`
28695 ac_optarg=
28696 ac_shift=:
28697 ;;
c971b7fa
PA
28698 *)
28699 ac_option=$1
28700 ac_optarg=$2
28701 ac_shift=shift
28702 ;;
28703 esac
28704
28705 case $ac_option in
28706 # Handling of the options.
28707 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
28708 ac_cs_recheck=: ;;
28709 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
28710 $as_echo "$ac_cs_version"; exit ;;
d0ac1c44
SM
28711 --config | --confi | --conf | --con | --co | --c )
28712 $as_echo "$ac_cs_config"; exit ;;
c971b7fa
PA
28713 --debug | --debu | --deb | --de | --d | -d )
28714 debug=: ;;
28715 --file | --fil | --fi | --f )
28716 $ac_shift
28717 case $ac_optarg in
28718 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
d0ac1c44 28719 '') as_fn_error $? "missing file argument" ;;
c971b7fa
PA
28720 esac
28721 as_fn_append CONFIG_FILES " '$ac_optarg'"
28722 ac_need_defaults=false;;
28723 --header | --heade | --head | --hea )
28724 $ac_shift
28725 case $ac_optarg in
28726 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
28727 esac
28728 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
28729 ac_need_defaults=false;;
28730 --he | --h)
28731 # Conflict between --help and --header
d0ac1c44 28732 as_fn_error $? "ambiguous option: \`$1'
c971b7fa
PA
28733Try \`$0 --help' for more information.";;
28734 --help | --hel | -h )
28735 $as_echo "$ac_cs_usage"; exit ;;
28736 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
28737 | -silent | --silent | --silen | --sile | --sil | --si | --s)
28738 ac_cs_silent=: ;;
28739
28740 # This is an error.
d0ac1c44 28741 -*) as_fn_error $? "unrecognized option: \`$1'
c971b7fa
PA
28742Try \`$0 --help' for more information." ;;
28743
28744 *) as_fn_append ac_config_targets " $1"
28745 ac_need_defaults=false ;;
28746
28747 esac
28748 shift
28749done
28750
28751ac_configure_extra_args=
28752
28753if $ac_cs_silent; then
28754 exec 6>/dev/null
28755 ac_configure_extra_args="$ac_configure_extra_args --silent"
28756fi
28757
28758_ACEOF
28759cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
28760if \$ac_cs_recheck; then
d0ac1c44 28761 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
c971b7fa
PA
28762 shift
28763 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
28764 CONFIG_SHELL='$SHELL'
28765 export CONFIG_SHELL
28766 exec "\$@"
28767fi
28768
28769_ACEOF
28770cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28771exec 5>>config.log
28772{
28773 echo
28774 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
28775## Running $as_me. ##
28776_ASBOX
28777 $as_echo "$ac_log"
28778} >&5
28779
28780_ACEOF
28781cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
28782#
28783# INIT-COMMANDS
28784#
28785AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
28786
28787_ACEOF
28788
28789cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28790
28791# Handling of arguments.
28792for ac_config_target in $ac_config_targets
28793do
28794 case $ac_config_target in
28795 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
28796 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
28797 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
28798 "import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;;
28799 "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
28800
d0ac1c44 28801 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
c971b7fa
PA
28802 esac
28803done
28804
28805
28806# If the user did not use the arguments to specify the items to instantiate,
28807# then the envvar interface is used. Set only those that are not.
28808# We use the long form for the default assignment because of an extremely
28809# bizarre bug on SunOS 4.1.3.
28810if $ac_need_defaults; then
28811 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
28812 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
28813 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
28814fi
28815
28816# Have a temporary directory for convenience. Make it in the build tree
28817# simply because there is no reason against having it here, and in addition,
28818# creating and moving files from /tmp can sometimes cause problems.
28819# Hook for its removal unless debugging.
28820# Note that there is a small window in which the directory will not be cleaned:
28821# after its creation but before its name has been assigned to `$tmp'.
28822$debug ||
28823{
d0ac1c44 28824 tmp= ac_tmp=
c971b7fa 28825 trap 'exit_status=$?
d0ac1c44
SM
28826 : "${ac_tmp:=$tmp}"
28827 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
c971b7fa
PA
28828' 0
28829 trap 'as_fn_exit 1' 1 2 13 15
28830}
28831# Create a (secure) tmp directory for tmp files.
28832
28833{
28834 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
d0ac1c44 28835 test -d "$tmp"
c971b7fa
PA
28836} ||
28837{
28838 tmp=./conf$$-$RANDOM
28839 (umask 077 && mkdir "$tmp")
d0ac1c44
SM
28840} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
28841ac_tmp=$tmp
c971b7fa
PA
28842
28843# Set up the scripts for CONFIG_FILES section.
28844# No need to generate them if there are no CONFIG_FILES.
28845# This happens for instance with `./config.status config.h'.
28846if test -n "$CONFIG_FILES"; then
28847
28848
28849ac_cr=`echo X | tr X '\015'`
28850# On cygwin, bash can eat \r inside `` if the user requested igncr.
28851# But we know of no other shell where ac_cr would be empty at this
28852# point, so we can use a bashism as a fallback.
28853if test "x$ac_cr" = x; then
28854 eval ac_cr=\$\'\\r\'
28855fi
28856ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
28857if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
d0ac1c44 28858 ac_cs_awk_cr='\\r'
c971b7fa
PA
28859else
28860 ac_cs_awk_cr=$ac_cr
28861fi
28862
d0ac1c44 28863echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
c971b7fa
PA
28864_ACEOF
28865
28866
28867{
28868 echo "cat >conf$$subs.awk <<_ACEOF" &&
28869 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
28870 echo "_ACEOF"
28871} >conf$$subs.sh ||
d0ac1c44
SM
28872 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
28873ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
c971b7fa
PA
28874ac_delim='%!_!# '
28875for ac_last_try in false false false false false :; do
28876 . ./conf$$subs.sh ||
d0ac1c44 28877 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
28878
28879 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
28880 if test $ac_delim_n = $ac_delim_num; then
28881 break
28882 elif $ac_last_try; then
d0ac1c44 28883 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
28884 else
28885 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
28886 fi
28887done
28888rm -f conf$$subs.sh
28889
28890cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
d0ac1c44 28891cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
c971b7fa
PA
28892_ACEOF
28893sed -n '
28894h
28895s/^/S["/; s/!.*/"]=/
28896p
28897g
28898s/^[^!]*!//
28899:repl
28900t repl
28901s/'"$ac_delim"'$//
28902t delim
28903:nl
28904h
d0ac1c44 28905s/\(.\{148\}\)..*/\1/
c971b7fa
PA
28906t more1
28907s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
28908p
28909n
28910b repl
28911:more1
28912s/["\\]/\\&/g; s/^/"/; s/$/"\\/
28913p
28914g
28915s/.\{148\}//
28916t nl
28917:delim
28918h
d0ac1c44 28919s/\(.\{148\}\)..*/\1/
c971b7fa
PA
28920t more2
28921s/["\\]/\\&/g; s/^/"/; s/$/"/
28922p
28923b
28924:more2
28925s/["\\]/\\&/g; s/^/"/; s/$/"\\/
28926p
28927g
28928s/.\{148\}//
28929t delim
28930' <conf$$subs.awk | sed '
28931/^[^""]/{
28932 N
28933 s/\n//
28934}
28935' >>$CONFIG_STATUS || ac_write_fail=1
28936rm -f conf$$subs.awk
28937cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
28938_ACAWK
d0ac1c44 28939cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
c971b7fa
PA
28940 for (key in S) S_is_set[key] = 1
28941 FS = "\a"
28942
28943}
28944{
28945 line = $ 0
28946 nfields = split(line, field, "@")
28947 substed = 0
28948 len = length(field[1])
28949 for (i = 2; i < nfields; i++) {
28950 key = field[i]
28951 keylen = length(key)
28952 if (S_is_set[key]) {
28953 value = S[key]
28954 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
28955 len += length(value) + length(field[++i])
28956 substed = 1
28957 } else
28958 len += 1 + keylen
28959 }
28960
28961 print line
28962}
28963
28964_ACAWK
28965_ACEOF
28966cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28967if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
28968 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
28969else
28970 cat
d0ac1c44
SM
28971fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
28972 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
c971b7fa
PA
28973_ACEOF
28974
d0ac1c44
SM
28975# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
28976# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
c971b7fa
PA
28977# trailing colons and then remove the whole line if VPATH becomes empty
28978# (actually we leave an empty line to preserve line numbers).
28979if test "x$srcdir" = x.; then
d0ac1c44
SM
28980 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
28981h
28982s///
28983s/^/:/
28984s/[ ]*$/:/
28985s/:\$(srcdir):/:/g
28986s/:\${srcdir}:/:/g
28987s/:@srcdir@:/:/g
28988s/^:*//
c971b7fa 28989s/:*$//
d0ac1c44
SM
28990x
28991s/\(=[ ]*\).*/\1/
28992G
28993s/\n//
c971b7fa
PA
28994s/^[^=]*=[ ]*$//
28995}'
28996fi
28997
28998cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
28999fi # test -n "$CONFIG_FILES"
29000
29001# Set up the scripts for CONFIG_HEADERS section.
29002# No need to generate them if there are no CONFIG_HEADERS.
29003# This happens for instance with `./config.status Makefile'.
29004if test -n "$CONFIG_HEADERS"; then
d0ac1c44 29005cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
c971b7fa
PA
29006BEGIN {
29007_ACEOF
29008
29009# Transform confdefs.h into an awk script `defines.awk', embedded as
29010# here-document in config.status, that substitutes the proper values into
29011# config.h.in to produce config.h.
29012
29013# Create a delimiter string that does not exist in confdefs.h, to ease
29014# handling of long lines.
29015ac_delim='%!_!# '
29016for ac_last_try in false false :; do
d0ac1c44
SM
29017 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
29018 if test -z "$ac_tt"; then
c971b7fa
PA
29019 break
29020 elif $ac_last_try; then
d0ac1c44 29021 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
c971b7fa
PA
29022 else
29023 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
29024 fi
29025done
29026
29027# For the awk script, D is an array of macro values keyed by name,
29028# likewise P contains macro parameters if any. Preserve backslash
29029# newline sequences.
29030
29031ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
29032sed -n '
29033s/.\{148\}/&'"$ac_delim"'/g
29034t rset
29035:rset
29036s/^[ ]*#[ ]*define[ ][ ]*/ /
29037t def
29038d
29039:def
29040s/\\$//
29041t bsnl
29042s/["\\]/\\&/g
29043s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
29044D["\1"]=" \3"/p
29045s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
29046d
29047:bsnl
29048s/["\\]/\\&/g
29049s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
29050D["\1"]=" \3\\\\\\n"\\/p
29051t cont
29052s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
29053t cont
29054d
29055:cont
29056n
29057s/.\{148\}/&'"$ac_delim"'/g
29058t clear
29059:clear
29060s/\\$//
29061t bsnlc
29062s/["\\]/\\&/g; s/^/"/; s/$/"/p
29063d
29064:bsnlc
29065s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
29066b cont
29067' <confdefs.h | sed '
29068s/'"$ac_delim"'/"\\\
29069"/g' >>$CONFIG_STATUS || ac_write_fail=1
29070
29071cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
29072 for (key in D) D_is_set[key] = 1
29073 FS = "\a"
29074}
29075/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
29076 line = \$ 0
29077 split(line, arg, " ")
29078 if (arg[1] == "#") {
29079 defundef = arg[2]
29080 mac1 = arg[3]
29081 } else {
29082 defundef = substr(arg[1], 2)
29083 mac1 = arg[2]
29084 }
29085 split(mac1, mac2, "(") #)
29086 macro = mac2[1]
29087 prefix = substr(line, 1, index(line, defundef) - 1)
29088 if (D_is_set[macro]) {
29089 # Preserve the white space surrounding the "#".
29090 print prefix "define", macro P[macro] D[macro]
29091 next
29092 } else {
29093 # Replace #undef with comments. This is necessary, for example,
29094 # in the case of _POSIX_SOURCE, which is predefined and required
29095 # on some systems where configure will not decide to define it.
29096 if (defundef == "undef") {
29097 print "/*", prefix defundef, macro, "*/"
29098 next
29099 }
29100 }
29101}
29102{ print }
29103_ACAWK
29104_ACEOF
29105cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
d0ac1c44 29106 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
c971b7fa
PA
29107fi # test -n "$CONFIG_HEADERS"
29108
29109
29110eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
29111shift
29112for ac_tag
29113do
29114 case $ac_tag in
29115 :[FHLC]) ac_mode=$ac_tag; continue;;
29116 esac
29117 case $ac_mode$ac_tag in
29118 :[FHL]*:*);;
d0ac1c44 29119 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
c971b7fa
PA
29120 :[FH]-) ac_tag=-:-;;
29121 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
29122 esac
29123 ac_save_IFS=$IFS
29124 IFS=:
29125 set x $ac_tag
29126 IFS=$ac_save_IFS
29127 shift
29128 ac_file=$1
29129 shift
29130
29131 case $ac_mode in
29132 :L) ac_source=$1;;
29133 :[FH])
29134 ac_file_inputs=
29135 for ac_f
29136 do
29137 case $ac_f in
d0ac1c44 29138 -) ac_f="$ac_tmp/stdin";;
c971b7fa
PA
29139 *) # Look for the file first in the build tree, then in the source tree
29140 # (if the path is not absolute). The absolute path cannot be DOS-style,
29141 # because $ac_f cannot contain `:'.
29142 test -f "$ac_f" ||
29143 case $ac_f in
29144 [\\/$]*) false;;
29145 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
29146 esac ||
d0ac1c44 29147 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
c971b7fa
PA
29148 esac
29149 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
29150 as_fn_append ac_file_inputs " '$ac_f'"
29151 done
29152
29153 # Let's still pretend it is `configure' which instantiates (i.e., don't
29154 # use $as_me), people would be surprised to read:
29155 # /* config.h. Generated by config.status. */
29156 configure_input='Generated from '`
29157 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
29158 `' by configure.'
29159 if test x"$ac_file" != x-; then
29160 configure_input="$ac_file. $configure_input"
29161 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
29162$as_echo "$as_me: creating $ac_file" >&6;}
29163 fi
29164 # Neutralize special characters interpreted by sed in replacement strings.
29165 case $configure_input in #(
29166 *\&* | *\|* | *\\* )
29167 ac_sed_conf_input=`$as_echo "$configure_input" |
29168 sed 's/[\\\\&|]/\\\\&/g'`;; #(
29169 *) ac_sed_conf_input=$configure_input;;
29170 esac
29171
29172 case $ac_tag in
d0ac1c44
SM
29173 *:-:* | *:-) cat >"$ac_tmp/stdin" \
29174 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
c971b7fa
PA
29175 esac
29176 ;;
29177 esac
29178
29179 ac_dir=`$as_dirname -- "$ac_file" ||
29180$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
29181 X"$ac_file" : 'X\(//\)[^/]' \| \
29182 X"$ac_file" : 'X\(//\)$' \| \
29183 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
29184$as_echo X"$ac_file" |
29185 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
29186 s//\1/
29187 q
29188 }
29189 /^X\(\/\/\)[^/].*/{
29190 s//\1/
29191 q
29192 }
29193 /^X\(\/\/\)$/{
29194 s//\1/
29195 q
29196 }
29197 /^X\(\/\).*/{
29198 s//\1/
29199 q
29200 }
29201 s/.*/./; q'`
29202 as_dir="$ac_dir"; as_fn_mkdir_p
29203 ac_builddir=.
29204
29205case "$ac_dir" in
29206.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
29207*)
29208 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
29209 # A ".." for each directory in $ac_dir_suffix.
29210 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
29211 case $ac_top_builddir_sub in
29212 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
29213 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
29214 esac ;;
29215esac
29216ac_abs_top_builddir=$ac_pwd
29217ac_abs_builddir=$ac_pwd$ac_dir_suffix
29218# for backward compatibility:
29219ac_top_builddir=$ac_top_build_prefix
29220
29221case $srcdir in
29222 .) # We are building in place.
29223 ac_srcdir=.
29224 ac_top_srcdir=$ac_top_builddir_sub
29225 ac_abs_top_srcdir=$ac_pwd ;;
29226 [\\/]* | ?:[\\/]* ) # Absolute name.
29227 ac_srcdir=$srcdir$ac_dir_suffix;
29228 ac_top_srcdir=$srcdir
29229 ac_abs_top_srcdir=$srcdir ;;
29230 *) # Relative name.
29231 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
29232 ac_top_srcdir=$ac_top_build_prefix$srcdir
29233 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
29234esac
29235ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
29236
29237
29238 case $ac_mode in
29239 :F)
29240 #
29241 # CONFIG_FILE
29242 #
29243
29244 case $INSTALL in
29245 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
29246 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
29247 esac
29248 ac_MKDIR_P=$MKDIR_P
29249 case $MKDIR_P in
29250 [\\/$]* | ?:[\\/]* ) ;;
29251 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
29252 esac
29253_ACEOF
29254
29255cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
29256# If the template does not know about datarootdir, expand it.
29257# FIXME: This hack should be removed a few years after 2.60.
29258ac_datarootdir_hack=; ac_datarootdir_seen=
29259ac_sed_dataroot='
29260/datarootdir/ {
29261 p
29262 q
29263}
29264/@datadir@/p
29265/@docdir@/p
29266/@infodir@/p
29267/@localedir@/p
29268/@mandir@/p'
29269case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
29270*datarootdir*) ac_datarootdir_seen=yes;;
29271*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
29272 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
29273$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
29274_ACEOF
29275cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
29276 ac_datarootdir_hack='
29277 s&@datadir@&$datadir&g
29278 s&@docdir@&$docdir&g
29279 s&@infodir@&$infodir&g
29280 s&@localedir@&$localedir&g
29281 s&@mandir@&$mandir&g
29282 s&\\\${datarootdir}&$datarootdir&g' ;;
29283esac
29284_ACEOF
29285
29286# Neutralize VPATH when `$srcdir' = `.'.
29287# Shell code in configure.ac might set extrasub.
29288# FIXME: do we really want to maintain this feature?
29289cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
29290ac_sed_extra="$ac_vpsub
29291$extrasub
29292_ACEOF
29293cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
29294:t
29295/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
29296s|@configure_input@|$ac_sed_conf_input|;t t
29297s&@top_builddir@&$ac_top_builddir_sub&;t t
29298s&@top_build_prefix@&$ac_top_build_prefix&;t t
29299s&@srcdir@&$ac_srcdir&;t t
29300s&@abs_srcdir@&$ac_abs_srcdir&;t t
29301s&@top_srcdir@&$ac_top_srcdir&;t t
29302s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
29303s&@builddir@&$ac_builddir&;t t
29304s&@abs_builddir@&$ac_abs_builddir&;t t
29305s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
29306s&@INSTALL@&$ac_INSTALL&;t t
29307s&@MKDIR_P@&$ac_MKDIR_P&;t t
29308$ac_datarootdir_hack
29309"
d0ac1c44
SM
29310eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
29311 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
29312
29313test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
d0ac1c44
SM
29314 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
29315 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
29316 "$ac_tmp/out"`; test -z "$ac_out"; } &&
c971b7fa 29317 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 29318which seems to be undefined. Please make sure it is defined" >&5
c971b7fa 29319$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
d0ac1c44 29320which seems to be undefined. Please make sure it is defined" >&2;}
c971b7fa 29321
d0ac1c44 29322 rm -f "$ac_tmp/stdin"
c971b7fa 29323 case $ac_file in
d0ac1c44
SM
29324 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
29325 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
c971b7fa 29326 esac \
d0ac1c44 29327 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
29328 ;;
29329 :H)
29330 #
29331 # CONFIG_HEADER
29332 #
29333 if test x"$ac_file" != x-; then
29334 {
29335 $as_echo "/* $configure_input */" \
d0ac1c44
SM
29336 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
29337 } >"$ac_tmp/config.h" \
29338 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
29339 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
c971b7fa
PA
29340 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
29341$as_echo "$as_me: $ac_file is unchanged" >&6;}
29342 else
29343 rm -f "$ac_file"
d0ac1c44
SM
29344 mv "$ac_tmp/config.h" "$ac_file" \
29345 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
c971b7fa
PA
29346 fi
29347 else
29348 $as_echo "/* $configure_input */" \
d0ac1c44
SM
29349 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
29350 || as_fn_error $? "could not create -" "$LINENO" 5
c971b7fa
PA
29351 fi
29352# Compute "$ac_file"'s index in $config_headers.
29353_am_arg="$ac_file"
29354_am_stamp_count=1
29355for _am_header in $config_headers :; do
29356 case $_am_header in
29357 $_am_arg | $_am_arg:* )
29358 break ;;
29359 * )
29360 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
29361 esac
29362done
29363echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
29364$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
29365 X"$_am_arg" : 'X\(//\)[^/]' \| \
29366 X"$_am_arg" : 'X\(//\)$' \| \
29367 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
29368$as_echo X"$_am_arg" |
29369 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
29370 s//\1/
29371 q
29372 }
29373 /^X\(\/\/\)[^/].*/{
29374 s//\1/
29375 q
29376 }
29377 /^X\(\/\/\)$/{
29378 s//\1/
29379 q
29380 }
29381 /^X\(\/\).*/{
29382 s//\1/
29383 q
29384 }
29385 s/.*/./; q'`/stamp-h$_am_stamp_count
29386 ;;
29387
29388 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
29389$as_echo "$as_me: executing $ac_file commands" >&6;}
29390 ;;
29391 esac
29392
29393
29394 case $ac_file$ac_mode in
29395 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
d0ac1c44 29396 # Older Autoconf quotes --file arguments for eval, but not when files
c971b7fa
PA
29397 # are listed without --file. Let's play safe and only enable the eval
29398 # if we detect the quoting.
29399 case $CONFIG_FILES in
29400 *\'*) eval set x "$CONFIG_FILES" ;;
29401 *) set x $CONFIG_FILES ;;
29402 esac
29403 shift
29404 for mf
29405 do
29406 # Strip MF so we end up with the name of the file.
29407 mf=`echo "$mf" | sed -e 's/:.*$//'`
29408 # Check whether this is an Automake generated Makefile or not.
d0ac1c44 29409 # We used to match only the files named 'Makefile.in', but
c971b7fa
PA
29410 # some people rename them; so instead we look at the file content.
29411 # Grep'ing the first line is not enough: some people post-process
29412 # each Makefile.in and add a new line on top of each file to say so.
29413 # Grep'ing the whole file is not good either: AIX grep has a line
29414 # limit of 2048, but all sed's we know have understand at least 4000.
29415 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
29416 dirpart=`$as_dirname -- "$mf" ||
29417$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
29418 X"$mf" : 'X\(//\)[^/]' \| \
29419 X"$mf" : 'X\(//\)$' \| \
29420 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
29421$as_echo X"$mf" |
29422 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
29423 s//\1/
29424 q
29425 }
29426 /^X\(\/\/\)[^/].*/{
29427 s//\1/
29428 q
29429 }
29430 /^X\(\/\/\)$/{
29431 s//\1/
29432 q
29433 }
29434 /^X\(\/\).*/{
29435 s//\1/
29436 q
29437 }
29438 s/.*/./; q'`
29439 else
29440 continue
29441 fi
29442 # Extract the definition of DEPDIR, am__include, and am__quote
d0ac1c44 29443 # from the Makefile without running 'make'.
c971b7fa
PA
29444 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
29445 test -z "$DEPDIR" && continue
29446 am__include=`sed -n 's/^am__include = //p' < "$mf"`
d0ac1c44 29447 test -z "$am__include" && continue
c971b7fa 29448 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
c971b7fa
PA
29449 # Find all dependency output files, they are included files with
29450 # $(DEPDIR) in their names. We invoke sed twice because it is the
29451 # simplest approach to changing $(DEPDIR) to its actual value in the
29452 # expansion.
29453 for file in `sed -n "
29454 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
d0ac1c44 29455 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
c971b7fa
PA
29456 # Make sure the directory exists.
29457 test -f "$dirpart/$file" && continue
29458 fdir=`$as_dirname -- "$file" ||
29459$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
29460 X"$file" : 'X\(//\)[^/]' \| \
29461 X"$file" : 'X\(//\)$' \| \
29462 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
29463$as_echo X"$file" |
29464 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
29465 s//\1/
29466 q
29467 }
29468 /^X\(\/\/\)[^/].*/{
29469 s//\1/
29470 q
29471 }
29472 /^X\(\/\/\)$/{
29473 s//\1/
29474 q
29475 }
29476 /^X\(\/\).*/{
29477 s//\1/
29478 q
29479 }
29480 s/.*/./; q'`
29481 as_dir=$dirpart/$fdir; as_fn_mkdir_p
29482 # echo "creating $dirpart/$file"
29483 echo '# dummy' > "$dirpart/$file"
29484 done
29485 done
29486}
29487 ;;
29488 "default":C)
29489case x$CONFIG_HEADERS in
29490xconfig.h:config.in)
29491echo > stamp-h ;;
29492esac
29493 ;;
29494
29495 esac
29496done # for ac_tag
29497
29498
29499as_fn_exit 0
29500_ACEOF
29501ac_clean_files=$ac_clean_files_save
29502
29503test $ac_write_fail = 0 ||
d0ac1c44 29504 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
c971b7fa
PA
29505
29506
29507# configure is writing to config.log, and then calls config.status.
29508# config.status does its own redirection, appending to config.log.
29509# Unfortunately, on DOS this fails, as config.log is still kept open
29510# by configure, so config.status won't be able to write to it; its
29511# output is simply discarded. So we exec the FD to /dev/null,
29512# effectively closing config.log, so it can be properly (re)opened and
29513# appended to by config.status. When coming back to configure, we
29514# need to make the FD available again.
29515if test "$no_create" != yes; then
29516 ac_cs_success=:
29517 ac_config_status_args=
29518 test "$silent" = yes &&
29519 ac_config_status_args="$ac_config_status_args --quiet"
29520 exec 5>/dev/null
29521 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
29522 exec 5>>config.log
29523 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
29524 # would make configure fail if this is the last instruction.
d0ac1c44 29525 $ac_cs_success || as_fn_exit 1
c971b7fa
PA
29526fi
29527if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
29528 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
29529$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
29530fi
29531
29532
29533exit 0
This page took 2.316565 seconds and 4 git commands to generate.