1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.69 for GNU coreutils 8.30.
4#
5# Report bugs to <bug-coreutils@gnu.org>.
6#
7#
8# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
9#
10#
11# This configure script is free software; the Free Software Foundation
12# gives unlimited permission to copy, distribute and modify it.
13## -------------------- ##
14## M4sh Initialization. ##
15## -------------------- ##
16
17# Be more Bourne compatible
18DUALCASE=1; export DUALCASE # for MKS sh
19if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
20  emulate sh
21  NULLCMD=:
22  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
23  # is contrary to our usage.  Disable this feature.
24  alias -g '${1+"$@"}'='"$@"'
25  setopt NO_GLOB_SUBST
26else
27  case `(set -o) 2>/dev/null` in #(
28  *posix*) :
29    set -o posix ;; #(
30  *) :
31     ;;
32esac
33fi
34
35
36as_nl='
37'
38export as_nl
39# Printing a long string crashes Solaris 7 /usr/bin/printf.
40as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
41as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
42as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
43# Prefer a ksh shell builtin over an external printf program on Solaris,
44# but without wasting forks for bash or zsh.
45if test -z "$BASH_VERSION$ZSH_VERSION" \
46    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
47  as_echo='print -r --'
48  as_echo_n='print -rn --'
49elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
50  as_echo='printf %s\n'
51  as_echo_n='printf %s'
52else
53  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
54    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
55    as_echo_n='/usr/ucb/echo -n'
56  else
57    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
58    as_echo_n_body='eval
59      arg=$1;
60      case $arg in #(
61      *"$as_nl"*)
62	expr "X$arg" : "X\\(.*\\)$as_nl";
63	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
64      esac;
65      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
66    '
67    export as_echo_n_body
68    as_echo_n='sh -c $as_echo_n_body as_echo'
69  fi
70  export as_echo_body
71  as_echo='sh -c $as_echo_body as_echo'
72fi
73
74# The user is always right.
75if test "${PATH_SEPARATOR+set}" != set; then
76  PATH_SEPARATOR=:
77  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
78    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
79      PATH_SEPARATOR=';'
80  }
81fi
82
83
84# IFS
85# We need space, tab and new line, in precisely that order.  Quoting is
86# there to prevent editors from complaining about space-tab.
87# (If _AS_PATH_WALK were called with IFS unset, it would disable word
88# splitting by setting IFS to empty value.)
89IFS=" ""	$as_nl"
90
91# Find who we are.  Look in the path if we contain no directory separator.
92as_myself=
93case $0 in #((
94  *[\\/]* ) as_myself=$0 ;;
95  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
96for as_dir in $PATH
97do
98  IFS=$as_save_IFS
99  test -z "$as_dir" && as_dir=.
100    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
101  done
102IFS=$as_save_IFS
103
104     ;;
105esac
106# We did not find ourselves, most probably we were run as `sh COMMAND'
107# in which case we are not to be found in the path.
108if test "x$as_myself" = x; then
109  as_myself=$0
110fi
111if test ! -f "$as_myself"; then
112  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
113  exit 1
114fi
115
116# Unset variables that we do not need and which cause bugs (e.g. in
117# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
118# suppresses any "Segmentation fault" message there.  '((' could
119# trigger a bug in pdksh 5.2.14.
120for as_var in BASH_ENV ENV MAIL MAILPATH
121do eval test x\${$as_var+set} = xset \
122  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
123done
124PS1='$ '
125PS2='> '
126PS4='+ '
127
128# NLS nuisances.
129LC_ALL=C
130export LC_ALL
131LANGUAGE=C
132export LANGUAGE
133
134# CDPATH.
135(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
136
137# Use a proper internal environment variable to ensure we don't fall
138  # into an infinite loop, continuously re-executing ourselves.
139  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
140    _as_can_reexec=no; export _as_can_reexec;
141    # We cannot yet assume a decent shell, so we have to provide a
142# neutralization value for shells without unset; and this also
143# works around shells that cannot unset nonexistent variables.
144# Preserve -v and -x to the replacement shell.
145BASH_ENV=/dev/null
146ENV=/dev/null
147(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
148case $- in # ((((
149  *v*x* | *x*v* ) as_opts=-vx ;;
150  *v* ) as_opts=-v ;;
151  *x* ) as_opts=-x ;;
152  * ) as_opts= ;;
153esac
154exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
155# Admittedly, this is quite paranoid, since all the known shells bail
156# out after a failed `exec'.
157$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
158as_fn_exit 255
159  fi
160  # We don't want this to propagate to other subprocesses.
161          { _as_can_reexec=; unset _as_can_reexec;}
162if test "x$CONFIG_SHELL" = x; then
163  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
164  emulate sh
165  NULLCMD=:
166  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
167  # is contrary to our usage.  Disable this feature.
168  alias -g '\${1+\"\$@\"}'='\"\$@\"'
169  setopt NO_GLOB_SUBST
170else
171  case \`(set -o) 2>/dev/null\` in #(
172  *posix*) :
173    set -o posix ;; #(
174  *) :
175     ;;
176esac
177fi
178"
179  as_required="as_fn_return () { (exit \$1); }
180as_fn_success () { as_fn_return 0; }
181as_fn_failure () { as_fn_return 1; }
182as_fn_ret_success () { return 0; }
183as_fn_ret_failure () { return 1; }
184
185exitcode=0
186as_fn_success || { exitcode=1; echo as_fn_success failed.; }
187as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
188as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
189as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
190if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
191
192else
193  exitcode=1; echo positional parameters were not saved.
194fi
195test x\$exitcode = x0 || exit 1
196test -x / || exit 1"
197  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
198  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
199  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
200  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
201test \$(( 1 + 1 )) = 2 || exit 1"
202  if (eval "$as_required") 2>/dev/null; then :
203  as_have_required=yes
204else
205  as_have_required=no
206fi
207  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
208
209else
210  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
211as_found=false
212for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
213do
214  IFS=$as_save_IFS
215  test -z "$as_dir" && as_dir=.
216  as_found=:
217  case $as_dir in #(
218	 /*)
219	   for as_base in sh bash ksh sh5; do
220	     # Try only shells that exist, to save several forks.
221	     as_shell=$as_dir/$as_base
222	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
223		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
224  CONFIG_SHELL=$as_shell as_have_required=yes
225		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
226  break 2
227fi
228fi
229	   done;;
230       esac
231  as_found=false
232done
233$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
234	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
235  CONFIG_SHELL=$SHELL as_have_required=yes
236fi; }
237IFS=$as_save_IFS
238
239
240      if test "x$CONFIG_SHELL" != x; then :
241  export CONFIG_SHELL
242             # We cannot yet assume a decent shell, so we have to provide a
243# neutralization value for shells without unset; and this also
244# works around shells that cannot unset nonexistent variables.
245# Preserve -v and -x to the replacement shell.
246BASH_ENV=/dev/null
247ENV=/dev/null
248(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
249case $- in # ((((
250  *v*x* | *x*v* ) as_opts=-vx ;;
251  *v* ) as_opts=-v ;;
252  *x* ) as_opts=-x ;;
253  * ) as_opts= ;;
254esac
255exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
256# Admittedly, this is quite paranoid, since all the known shells bail
257# out after a failed `exec'.
258$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
259exit 255
260fi
261
262    if test x$as_have_required = xno; then :
263  $as_echo "$0: This script requires a shell more modern than all"
264  $as_echo "$0: the shells that I found on your system."
265  if test x${ZSH_VERSION+set} = xset ; then
266    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
267    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
268  else
269    $as_echo "$0: Please tell bug-autoconf@gnu.org and
270$0: bug-coreutils@gnu.org about your system, including any
271$0: error possibly output before this message. Then install
272$0: a modern shell, or manually run the script under such a
273$0: shell if you do have one."
274  fi
275  exit 1
276fi
277fi
278fi
279SHELL=${CONFIG_SHELL-/bin/sh}
280export SHELL
281# Unset more variables known to interfere with behavior of common tools.
282CLICOLOR_FORCE= GREP_OPTIONS=
283unset CLICOLOR_FORCE GREP_OPTIONS
284
285## --------------------- ##
286## M4sh Shell Functions. ##
287## --------------------- ##
288# as_fn_unset VAR
289# ---------------
290# Portably unset VAR.
291as_fn_unset ()
292{
293  { eval $1=; unset $1;}
294}
295as_unset=as_fn_unset
296
297# as_fn_set_status STATUS
298# -----------------------
299# Set $? to STATUS, without forking.
300as_fn_set_status ()
301{
302  return $1
303} # as_fn_set_status
304
305# as_fn_exit STATUS
306# -----------------
307# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
308as_fn_exit ()
309{
310  set +e
311  as_fn_set_status $1
312  exit $1
313} # as_fn_exit
314
315# as_fn_mkdir_p
316# -------------
317# Create "$as_dir" as a directory, including parents if necessary.
318as_fn_mkdir_p ()
319{
320
321  case $as_dir in #(
322  -*) as_dir=./$as_dir;;
323  esac
324  test -d "$as_dir" || eval $as_mkdir_p || {
325    as_dirs=
326    while :; do
327      case $as_dir in #(
328      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
329      *) as_qdir=$as_dir;;
330      esac
331      as_dirs="'$as_qdir' $as_dirs"
332      as_dir=`$as_dirname -- "$as_dir" ||
333$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
334	 X"$as_dir" : 'X\(//\)[^/]' \| \
335	 X"$as_dir" : 'X\(//\)$' \| \
336	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
337$as_echo X"$as_dir" |
338    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
339	    s//\1/
340	    q
341	  }
342	  /^X\(\/\/\)[^/].*/{
343	    s//\1/
344	    q
345	  }
346	  /^X\(\/\/\)$/{
347	    s//\1/
348	    q
349	  }
350	  /^X\(\/\).*/{
351	    s//\1/
352	    q
353	  }
354	  s/.*/./; q'`
355      test -d "$as_dir" && break
356    done
357    test -z "$as_dirs" || eval "mkdir $as_dirs"
358  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
359
360
361} # as_fn_mkdir_p
362
363# as_fn_executable_p FILE
364# -----------------------
365# Test if FILE is an executable regular file.
366as_fn_executable_p ()
367{
368  test -f "$1" && test -x "$1"
369} # as_fn_executable_p
370# as_fn_append VAR VALUE
371# ----------------------
372# Append the text in VALUE to the end of the definition contained in VAR. Take
373# advantage of any shell optimizations that allow amortized linear growth over
374# repeated appends, instead of the typical quadratic growth present in naive
375# implementations.
376if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
377  eval 'as_fn_append ()
378  {
379    eval $1+=\$2
380  }'
381else
382  as_fn_append ()
383  {
384    eval $1=\$$1\$2
385  }
386fi # as_fn_append
387
388# as_fn_arith ARG...
389# ------------------
390# Perform arithmetic evaluation on the ARGs, and store the result in the
391# global $as_val. Take advantage of shells that can avoid forks. The arguments
392# must be portable across $(()) and expr.
393if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
394  eval 'as_fn_arith ()
395  {
396    as_val=$(( $* ))
397  }'
398else
399  as_fn_arith ()
400  {
401    as_val=`expr "$@" || test $? -eq 1`
402  }
403fi # as_fn_arith
404
405
406# as_fn_error STATUS ERROR [LINENO LOG_FD]
407# ----------------------------------------
408# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
409# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
410# script with STATUS, using 1 if that was 0.
411as_fn_error ()
412{
413  as_status=$1; test $as_status -eq 0 && as_status=1
414  if test "$4"; then
415    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
416    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
417  fi
418  $as_echo "$as_me: error: $2" >&2
419  as_fn_exit $as_status
420} # as_fn_error
421
422if expr a : '\(a\)' >/dev/null 2>&1 &&
423   test "X`expr 00001 : '.*\(...\)'`" = X001; then
424  as_expr=expr
425else
426  as_expr=false
427fi
428
429if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
430  as_basename=basename
431else
432  as_basename=false
433fi
434
435if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
436  as_dirname=dirname
437else
438  as_dirname=false
439fi
440
441as_me=`$as_basename -- "$0" ||
442$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
443	 X"$0" : 'X\(//\)$' \| \
444	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
445$as_echo X/"$0" |
446    sed '/^.*\/\([^/][^/]*\)\/*$/{
447	    s//\1/
448	    q
449	  }
450	  /^X\/\(\/\/\)$/{
451	    s//\1/
452	    q
453	  }
454	  /^X\/\(\/\).*/{
455	    s//\1/
456	    q
457	  }
458	  s/.*/./; q'`
459
460# Avoid depending upon Character Ranges.
461as_cr_letters='abcdefghijklmnopqrstuvwxyz'
462as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
463as_cr_Letters=$as_cr_letters$as_cr_LETTERS
464as_cr_digits='0123456789'
465as_cr_alnum=$as_cr_Letters$as_cr_digits
466
467
468  as_lineno_1=$LINENO as_lineno_1a=$LINENO
469  as_lineno_2=$LINENO as_lineno_2a=$LINENO
470  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
471  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
472  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
473  sed -n '
474    p
475    /[$]LINENO/=
476  ' <$as_myself |
477    sed '
478      s/[$]LINENO.*/&-/
479      t lineno
480      b
481      :lineno
482      N
483      :loop
484      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
485      t loop
486      s/-\n.*//
487    ' >$as_me.lineno &&
488  chmod +x "$as_me.lineno" ||
489    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
490
491  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
492  # already done that, so ensure we don't try to do so again and fall
493  # in an infinite loop.  This has already happened in practice.
494  _as_can_reexec=no; export _as_can_reexec
495  # Don't try to exec as it changes $[0], causing all sort of problems
496  # (the dirname of $[0] is not the place where we might find the
497  # original and so on.  Autoconf is especially sensitive to this).
498  . "./$as_me.lineno"
499  # Exit status is that of the last command.
500  exit
501}
502
503ECHO_C= ECHO_N= ECHO_T=
504case `echo -n x` in #(((((
505-n*)
506  case `echo 'xy\c'` in
507  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
508  xy)  ECHO_C='\c';;
509  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
510       ECHO_T='	';;
511  esac;;
512*)
513  ECHO_N='-n';;
514esac
515
516rm -f conf$$ conf$$.exe conf$$.file
517if test -d conf$$.dir; then
518  rm -f conf$$.dir/conf$$.file
519else
520  rm -f conf$$.dir
521  mkdir conf$$.dir 2>/dev/null
522fi
523if (echo >conf$$.file) 2>/dev/null; then
524  if ln -s conf$$.file conf$$ 2>/dev/null; then
525    as_ln_s='ln -s'
526    # ... but there are two gotchas:
527    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
528    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
529    # In both cases, we have to default to `cp -pR'.
530    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
531      as_ln_s='cp -pR'
532  elif ln conf$$.file conf$$ 2>/dev/null; then
533    as_ln_s=ln
534  else
535    as_ln_s='cp -pR'
536  fi
537else
538  as_ln_s='cp -pR'
539fi
540rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
541rmdir conf$$.dir 2>/dev/null
542
543if mkdir -p . 2>/dev/null; then
544  as_mkdir_p='mkdir -p "$as_dir"'
545else
546  test -d ./-p && rmdir ./-p
547  as_mkdir_p=false
548fi
549
550as_test_x='test -x'
551as_executable_p=as_fn_executable_p
552
553# Sed expression to map a string onto a valid CPP name.
554as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
555
556# Sed expression to map a string onto a valid variable name.
557as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
558
559
560test -n "$DJDIR" || exec 7<&0 </dev/null
561exec 6>&1
562
563# Name of the host.
564# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
565# so uname gets run too.
566ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
567
568#
569# Initializations.
570#
571ac_default_prefix=/usr/local
572ac_clean_files=
573ac_config_libobj_dir=.
574LIBOBJS=
575cross_compiling=no
576subdirs=
577MFLAGS=
578MAKEFLAGS=
579
580# Identity of this package.
581PACKAGE_NAME='GNU coreutils'
582PACKAGE_TARNAME='coreutils'
583PACKAGE_VERSION='8.30'
584PACKAGE_STRING='GNU coreutils 8.30'
585PACKAGE_BUGREPORT='bug-coreutils@gnu.org'
586PACKAGE_URL='https://www.gnu.org/software/coreutils/'
587
588ac_unique_file="src/ls.c"
589# Factoring default headers for most tests.
590ac_includes_default="\
591#include <stdio.h>
592#ifdef HAVE_SYS_TYPES_H
593# include <sys/types.h>
594#endif
595#ifdef HAVE_SYS_STAT_H
596# include <sys/stat.h>
597#endif
598#ifdef STDC_HEADERS
599# include <stdlib.h>
600# include <stddef.h>
601#else
602# ifdef HAVE_STDLIB_H
603#  include <stdlib.h>
604# endif
605#endif
606#ifdef HAVE_STRING_H
607# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
608#  include <memory.h>
609# endif
610# include <string.h>
611#endif
612#ifdef HAVE_STRINGS_H
613# include <strings.h>
614#endif
615#ifdef HAVE_INTTYPES_H
616# include <inttypes.h>
617#endif
618#ifdef HAVE_STDINT_H
619# include <stdint.h>
620#endif
621#ifdef HAVE_UNISTD_H
622# include <unistd.h>
623#endif"
624
625gl_use_threads_default=
626ac_func_list=
627ac_header_list=
628with_openssl_default='no'
629LIB_CRYPTO=
630gl_fnmatch_required=POSIX
631gl_getopt_required=POSIX
632gt_needs=
633ac_config_libobj_dir=lib
634ac_subst_vars='gltests_LTLIBOBJS
635gltests_LIBOBJS
636gl_LTLIBOBJS
637gl_LIBOBJS
638CONFIG_INCLUDE
639am__EXEEXT_FALSE
640am__EXEEXT_TRUE
641LTLIBOBJS
642LIBOBJS
643POSUB
644INTLLIBS
645XGETTEXT_EXTRA_OPTIONS
646MSGMERGE
647XGETTEXT_015
648XGETTEXT
649GMSGFMT_015
650MSGFMT_015
651GMSGFMT
652MSGFMT
653GETTEXT_MACRO_VERSION
654USE_NLS
655CROSS_COMPILING_FALSE
656CROSS_COMPILING_TRUE
657built_programs
658EXTRA_MANS
659man1_MANS
660pkglibexec_PROGRAMS
661bin_PROGRAMS
662single_binary_install_type
663single_binary_deps
664single_binary_libs
665single_binary_progs
666USE_XLC_INCLUDE_FALSE
667USE_XLC_INCLUDE_TRUE
668LIB_GMP
669LIB_NVPAIR
670SINGLE_BINARY_FALSE
671SINGLE_BINARY_TRUE
672GNULIB_TEST_WARN_CFLAGS
673GNULIB_WARN_CFLAGS
674WARN_CFLAGS
675WERROR_CFLAGS
676HAVE_PERL_FALSE
677HAVE_PERL_TRUE
678SEQ_LIBM
679LIB_CAP
680LIB_XATTR
681MAN
682HELP2MAN
683LIBTESTS_LIBDEPS
684LIBCOREUTILS_LTLIBDEPS
685LIBCOREUTILS_LIBDEPS
686YIELD_LIB
687abs_aux_dir
688LIB_PTHREAD_SIGMASK
689INTL_MACOSX_LIBS
690INET_PTON_LIB
691LOCALE_TR_UTF8
692gltests_WITNESS
693NEXT_AS_FIRST_DIRECTIVE_WCHAR_H
694NEXT_WCHAR_H
695GL_GENERATE_UTIME_H_FALSE
696GL_GENERATE_UTIME_H_TRUE
697UTIME_H
698HAVE_UTIME_H
699NEXT_AS_FIRST_DIRECTIVE_UTIME_H
700NEXT_UTIME_H
701REPLACE_UTIME
702HAVE_UTIME
703GNULIB_UTIME
704LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE
705LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE
706LIBUNISTRING_UNIWIDTH_H
707LIBUNISTRING_UNITYPES_H
708LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE
709LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE
710LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE
711LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE
712LIBUNISTRING_UNISTR_H
713HAVE_UNISTD_H
714NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
715NEXT_UNISTD_H
716LIB_TIMER_TIME
717UNISTD_H_DEFINES_STRUCT_TIMESPEC
718PTHREAD_H_DEFINES_STRUCT_TIMESPEC
719SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
720TIME_H_DEFINES_STRUCT_TIMESPEC
721NEXT_AS_FIRST_DIRECTIVE_TIME_H
722NEXT_TIME_H
723NEXT_AS_FIRST_DIRECTIVE_TERMIOS_H
724NEXT_TERMIOS_H
725HAVE_TERMIOS_H
726HAVE_DECL_TCGETSID
727GNULIB_TCGETSID
728NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H
729NEXT_SYS_WAIT_H
730GNULIB_WAITPID
731HAVE_SYS_UTSNAME_H
732NEXT_AS_FIRST_DIRECTIVE_SYS_UTSNAME_H
733NEXT_SYS_UTSNAME_H
734HAVE_STRUCT_UTSNAME
735HAVE_UNAME
736GNULIB_UNAME
737HAVE_SYS_UIO_H
738NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H
739NEXT_SYS_UIO_H
740HAVE_SYS_RESOURCE_H
741NEXT_AS_FIRST_DIRECTIVE_SYS_RESOURCE_H
742NEXT_SYS_RESOURCE_H
743HAVE_GETRUSAGE
744GNULIB_GETRUSAGE
745NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H
746NEXT_SYS_IOCTL_H
747HAVE_SYS_IOCTL_H
748NEXT_AS_FIRST_DIRECTIVE_STRING_H
749NEXT_STRING_H
750NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
751NEXT_STDLIB_H
752NEXT_AS_FIRST_DIRECTIVE_STDIO_H
753NEXT_STDIO_H
754GL_GENERATE_STDARG_H_FALSE
755GL_GENERATE_STDARG_H_TRUE
756STDARG_H
757NEXT_AS_FIRST_DIRECTIVE_STDARG_H
758NEXT_STDARG_H
759GL_GENERATE_STDALIGN_H_FALSE
760GL_GENERATE_STDALIGN_H_TRUE
761STDALIGN_H
762LIB_SMACK
763NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H
764NEXT_SIGNAL_H
765GL_GENERATE_SELINUX_CONTEXT_H_FALSE
766GL_GENERATE_SELINUX_CONTEXT_H_TRUE
767SELINUX_CONTEXT_H
768NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H
769NEXT_SELINUX_SELINUX_H
770LIB_SELINUX
771GL_GENERATE_SCHED_H_FALSE
772GL_GENERATE_SCHED_H_TRUE
773SCHED_H
774HAVE_STRUCT_SCHED_PARAM
775HAVE_SCHED_H
776NEXT_AS_FIRST_DIRECTIVE_SCHED_H
777NEXT_SCHED_H
778GLIBC21
779REPLACE_RAISE
780REPLACE_PTHREAD_SIGMASK
781HAVE_SIGHANDLER_T
782HAVE_TYPE_VOLATILE_SIG_ATOMIC_T
783HAVE_STRUCT_SIGACTION_SA_SIGACTION
784HAVE_SIGACTION
785HAVE_SIGINFO_T
786HAVE_SIGSET_T
787HAVE_RAISE
788HAVE_PTHREAD_SIGMASK
789HAVE_POSIX_SIGNALBLOCKING
790GNULIB_SIGACTION
791GNULIB_SIGPROCMASK
792GNULIB_SIGNAL_H_SIGPIPE
793GNULIB_RAISE
794GNULIB_PTHREAD_SIGMASK
795LIB_PTHREAD
796GL_GENERATE_PTHREAD_H_FALSE
797GL_GENERATE_PTHREAD_H_TRUE
798PTHREAD_H
799NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H
800NEXT_PTHREAD_H
801HAVE_PTHREAD_SPINLOCK_T
802HAVE_PTHREAD_T
803HAVE_PTHREAD_H
804DEFAULT_POSIX2_VERSION
805PREFERABLY_POSIX_SHELL
806POSIX_SHELL
807PERL
808YFLAGS
809YACC
810HAVE__BOOL
811GL_GENERATE_STDBOOL_H_FALSE
812GL_GENERATE_STDBOOL_H_TRUE
813STDBOOL_H
814GL_GENERATE_NETINET_IN_H_FALSE
815GL_GENERATE_NETINET_IN_H_TRUE
816NETINET_IN_H
817HAVE_NETINET_IN_H
818NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
819NEXT_NETINET_IN_H
820LIB_NANOSLEEP
821LIB_SELECT
822LIBSOCKET
823HAVE_SYS_SELECT_H
824NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H
825NEXT_SYS_SELECT_H
826REPLACE_SELECT
827REPLACE_PSELECT
828HAVE_PSELECT
829GNULIB_SELECT
830GNULIB_PSELECT
831LOCALE_FR_UTF8
832LOCALE_ZH_CN
833LOCALE_JA
834NEXT_AS_FIRST_DIRECTIVE_MATH_H
835NEXT_MATH_H
836SED
837LTLIBMULTITHREAD
838LIBMULTITHREAD
839LTLIBTHREAD
840LIBTHREAD
841LIBPTH_PREFIX
842LTLIBPTH
843LIBPTH
844NEXT_AS_FIRST_DIRECTIVE_LOCALE_H
845NEXT_LOCALE_H
846HAVE_XLOCALE_H
847NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
848NEXT_STDDEF_H
849GL_GENERATE_STDDEF_H_FALSE
850GL_GENERATE_STDDEF_H_TRUE
851STDDEF_H
852HAVE_WCHAR_T
853HAVE_MAX_ALIGN_T
854REPLACE_NULL
855REPLACE_STRUCT_LCONV
856REPLACE_DUPLOCALE
857REPLACE_SETLOCALE
858REPLACE_LOCALECONV
859HAVE_DUPLOCALE
860GNULIB_DUPLOCALE
861GNULIB_SETLOCALE
862GNULIB_LOCALECONV
863LOCALCHARSET_TESTS_ENVIRONMENT
864IGNORE_UNUSED_LIBRARIES_CFLAGS
865HAVE_LANGINFO_YESEXPR
866HAVE_LANGINFO_ERA
867HAVE_LANGINFO_ALTMON
868HAVE_LANGINFO_T_FMT_AMPM
869HAVE_LANGINFO_CODESET
870HAVE_LANGINFO_H
871NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H
872NEXT_LANGINFO_H
873REPLACE_NL_LANGINFO
874HAVE_NL_LANGINFO
875GNULIB_NL_LANGINFO
876REPLACE_TOWLOWER
877REPLACE_ISWCNTRL
878HAVE_WCTYPE_H
879NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
880NEXT_WCTYPE_H
881HAVE_CRTDEFS_H
882HAVE_WINT_T
883HAVE_ISWCNTRL
884REPLACE_ISWBLANK
885HAVE_WCTRANS_T
886HAVE_WCTYPE_T
887HAVE_ISWBLANK
888GNULIB_TOWCTRANS
889GNULIB_WCTRANS
890GNULIB_ISWCTYPE
891GNULIB_WCTYPE
892GNULIB_ISWBLANK
893NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
894NEXT_INTTYPES_H
895UINT64_MAX_EQ_ULONG_MAX
896UINT32_MAX_LT_UINTMAX_MAX
897PRIPTR_PREFIX
898PRI_MACROS_BROKEN
899INT64_MAX_EQ_LONG_MAX
900INT32_MAX_LT_INTMAX_MAX
901REPLACE_STRTOUMAX
902REPLACE_STRTOIMAX
903HAVE_IMAXDIV_T
904HAVE_DECL_STRTOUMAX
905HAVE_DECL_STRTOIMAX
906HAVE_DECL_IMAXDIV
907HAVE_DECL_IMAXABS
908GNULIB_STRTOUMAX
909GNULIB_STRTOIMAX
910GNULIB_IMAXDIV
911GNULIB_IMAXABS
912GL_GENERATE_STDINT_H_FALSE
913GL_GENERATE_STDINT_H_TRUE
914STDINT_H
915HAVE_SYS_INTTYPES_H
916HAVE_SYS_BITYPES_H
917HAVE_C99_STDINT_H
918WINT_T_SUFFIX
919WCHAR_T_SUFFIX
920SIG_ATOMIC_T_SUFFIX
921SIZE_T_SUFFIX
922PTRDIFF_T_SUFFIX
923HAVE_SIGNED_WINT_T
924HAVE_SIGNED_WCHAR_T
925HAVE_SIGNED_SIG_ATOMIC_T
926BITSIZEOF_WINT_T
927BITSIZEOF_WCHAR_T
928BITSIZEOF_SIG_ATOMIC_T
929BITSIZEOF_SIZE_T
930BITSIZEOF_PTRDIFF_T
931APPLE_UNIVERSAL_BUILD
932HAVE_STDINT_H
933NEXT_AS_FIRST_DIRECTIVE_STDINT_H
934NEXT_STDINT_H
935HAVE_SYS_TYPES_H
936HAVE_INTTYPES_H
937HAVE_WCHAR_H
938HAVE_UNSIGNED_LONG_LONG_INT
939HAVE_LONG_LONG_INT
940GNULIB_OVERRIDES_WINT_T
941GL_GENERATE_LIMITS_H_FALSE
942GL_GENERATE_LIMITS_H_TRUE
943LIMITS_H
944NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
945NEXT_LIMITS_H
946NEXT_AS_FIRST_DIRECTIVE_ICONV_H
947NEXT_ICONV_H
948GL_GENERATE_ICONV_H_FALSE
949GL_GENERATE_ICONV_H_TRUE
950ICONV_H
951REPLACE_ICONV_UTF
952REPLACE_ICONV_OPEN
953REPLACE_ICONV
954ICONV_CONST
955GNULIB_ICONV
956LTLIBICONV
957LIBICONV
958HOST_CPU_C_ABI
959HOST_CPU
960GNU_MAKE_FALSE
961GNU_MAKE_TRUE
962REPLACE_LOCALTIME
963REPLACE_GMTIME
964REPLACE_TZSET
965REPLACE_TIMEGM
966REPLACE_STRFTIME
967REPLACE_NANOSLEEP
968REPLACE_MKTIME
969REPLACE_LOCALTIME_R
970REPLACE_CTIME
971HAVE_TIMEZONE_T
972HAVE_TZSET
973HAVE_TIMEGM
974HAVE_STRPTIME
975HAVE_NANOSLEEP
976HAVE_DECL_LOCALTIME_R
977GNULIB_TZSET
978GNULIB_TIME_RZ
979GNULIB_TIME_R
980GNULIB_TIMEGM
981GNULIB_STRPTIME
982GNULIB_STRFTIME
983GNULIB_NANOSLEEP
984GNULIB_LOCALTIME
985GNULIB_MKTIME
986GNULIB_CTIME
987NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
988NEXT_SYS_TIME_H
989REPLACE_STRUCT_TIMEVAL
990REPLACE_GETTIMEOFDAY
991HAVE_SYS_TIME_H
992HAVE_STRUCT_TIMEVAL
993HAVE_GETTIMEOFDAY
994GNULIB_GETTIMEOFDAY
995LTLIBINTL
996LIBINTL
997GNULIB_GL_UNISTD_H_GETOPT
998GETOPT_CDEFS_H
999GETOPT_H
1000HAVE_SYS_CDEFS_H
1001HAVE_GETOPT_H
1002NEXT_AS_FIRST_DIRECTIVE_GETOPT_H
1003NEXT_GETOPT_H
1004LIB_GETLOGIN
1005GETLOADAVG_LIBS
1006LIB_GETHRXTIME
1007GETHOSTNAME_LIB
1008GETADDRINFO_LIB
1009INET_NTOP_LIB
1010SERVENT_LIB
1011HOSTENT_LIB
1012HAVE_NETDB_H
1013NEXT_AS_FIRST_DIRECTIVE_NETDB_H
1014NEXT_NETDB_H
1015REPLACE_GAI_STRERROR
1016HAVE_DECL_GETNAMEINFO
1017HAVE_DECL_GETADDRINFO
1018HAVE_DECL_GAI_STRERROR
1019HAVE_DECL_FREEADDRINFO
1020HAVE_STRUCT_ADDRINFO
1021GNULIB_GETADDRINFO
1022WINDOWS_64_BIT_ST_SIZE
1023WINDOWS_STAT_TIMESPEC
1024NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
1025NEXT_SYS_STAT_H
1026WINDOWS_STAT_INODES
1027WINDOWS_64_BIT_OFF_T
1028NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H
1029NEXT_SYS_TYPES_H
1030HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
1031REPLACE_TRUNCL
1032REPLACE_TRUNCF
1033REPLACE_TRUNC
1034REPLACE_TANHF
1035REPLACE_TANF
1036REPLACE_SQRTL
1037REPLACE_SQRTF
1038REPLACE_SINHF
1039REPLACE_SINF
1040REPLACE_SIGNBIT_USING_GCC
1041REPLACE_SIGNBIT
1042REPLACE_ROUNDL
1043REPLACE_ROUNDF
1044REPLACE_ROUND
1045REPLACE_REMAINDERL
1046REPLACE_REMAINDERF
1047REPLACE_REMAINDER
1048REPLACE_NAN
1049REPLACE_MODFL
1050REPLACE_MODFF
1051REPLACE_MODF
1052REPLACE_LOGBL
1053REPLACE_LOGBF
1054REPLACE_LOGB
1055REPLACE_LOG2L
1056REPLACE_LOG2F
1057REPLACE_LOG2
1058REPLACE_LOG1PL
1059REPLACE_LOG1PF
1060REPLACE_LOG1P
1061REPLACE_LOG10L
1062REPLACE_LOG10F
1063REPLACE_LOG10
1064REPLACE_LOGL
1065REPLACE_LOGF
1066REPLACE_LOG
1067REPLACE_LDEXPL
1068REPLACE_ISNAN
1069REPLACE_ISINF
1070REPLACE_ISFINITE
1071REPLACE_ILOGBL
1072REPLACE_ILOGBF
1073REPLACE_ILOGB
1074REPLACE_HYPOTL
1075REPLACE_HYPOTF
1076REPLACE_HYPOT
1077REPLACE_HUGE_VAL
1078REPLACE_FREXPL
1079REPLACE_FREXP
1080REPLACE_FREXPF
1081REPLACE_FMODL
1082REPLACE_FMODF
1083REPLACE_FMOD
1084REPLACE_FMAL
1085REPLACE_FMAF
1086REPLACE_FMA
1087REPLACE_FLOORL
1088REPLACE_FLOORF
1089REPLACE_FLOOR
1090REPLACE_FABSL
1091REPLACE_EXP2L
1092REPLACE_EXP2
1093REPLACE_EXPM1F
1094REPLACE_EXPM1
1095REPLACE_EXPF
1096REPLACE_COSHF
1097REPLACE_COSF
1098REPLACE_CEILL
1099REPLACE_CEILF
1100REPLACE_CEIL
1101REPLACE_CBRTL
1102REPLACE_CBRTF
1103REPLACE_ATAN2F
1104REPLACE_ATANF
1105REPLACE_ASINF
1106REPLACE_ACOSF
1107HAVE_DECL_TRUNCL
1108HAVE_DECL_TRUNCF
1109HAVE_DECL_TRUNC
1110HAVE_DECL_TANL
1111HAVE_DECL_SQRTL
1112HAVE_DECL_SINL
1113HAVE_DECL_ROUNDL
1114HAVE_DECL_ROUNDF
1115HAVE_DECL_ROUND
1116HAVE_DECL_RINTF
1117HAVE_DECL_REMAINDERL
1118HAVE_DECL_REMAINDER
1119HAVE_DECL_LOGB
1120HAVE_DECL_LOG2L
1121HAVE_DECL_LOG2F
1122HAVE_DECL_LOG2
1123HAVE_DECL_LOG10L
1124HAVE_DECL_LOGL
1125HAVE_DECL_LDEXPL
1126HAVE_DECL_FREXPL
1127HAVE_DECL_FLOORL
1128HAVE_DECL_FLOORF
1129HAVE_DECL_EXPM1L
1130HAVE_DECL_EXP2L
1131HAVE_DECL_EXP2F
1132HAVE_DECL_EXP2
1133HAVE_DECL_EXPL
1134HAVE_DECL_COSL
1135HAVE_DECL_COPYSIGNF
1136HAVE_DECL_CEILL
1137HAVE_DECL_CEILF
1138HAVE_DECL_CBRTL
1139HAVE_DECL_CBRTF
1140HAVE_DECL_ATANL
1141HAVE_DECL_ASINL
1142HAVE_DECL_ACOSL
1143HAVE_TANHF
1144HAVE_TANL
1145HAVE_TANF
1146HAVE_SQRTL
1147HAVE_SQRTF
1148HAVE_SINHF
1149HAVE_SINL
1150HAVE_SINF
1151HAVE_RINTL
1152HAVE_RINT
1153HAVE_REMAINDERF
1154HAVE_REMAINDER
1155HAVE_POWF
1156HAVE_MODFL
1157HAVE_MODFF
1158HAVE_LOGBL
1159HAVE_LOGBF
1160HAVE_LOG1PL
1161HAVE_LOG1PF
1162HAVE_LOG1P
1163HAVE_LOG10L
1164HAVE_LOG10F
1165HAVE_LOGL
1166HAVE_LOGF
1167HAVE_LDEXPF
1168HAVE_ISNANL
1169HAVE_ISNAND
1170HAVE_ISNANF
1171HAVE_ILOGBL
1172HAVE_ILOGBF
1173HAVE_ILOGB
1174HAVE_HYPOTL
1175HAVE_HYPOTF
1176HAVE_FREXPF
1177HAVE_FMODL
1178HAVE_FMODF
1179HAVE_FMAL
1180HAVE_FMAF
1181HAVE_FMA
1182HAVE_FABSL
1183HAVE_FABSF
1184HAVE_EXPM1F
1185HAVE_EXPM1
1186HAVE_EXPL
1187HAVE_EXPF
1188HAVE_COSHF
1189HAVE_COSL
1190HAVE_COSF
1191HAVE_COPYSIGNL
1192HAVE_COPYSIGN
1193HAVE_CBRTL
1194HAVE_CBRTF
1195HAVE_CBRT
1196HAVE_ATAN2F
1197HAVE_ATANL
1198HAVE_ATANF
1199HAVE_ASINL
1200HAVE_ASINF
1201HAVE_ACOSL
1202HAVE_ACOSF
1203GNULIB_TRUNCL
1204GNULIB_TRUNCF
1205GNULIB_TRUNC
1206GNULIB_TANHF
1207GNULIB_TANL
1208GNULIB_TANF
1209GNULIB_SQRTL
1210GNULIB_SQRTF
1211GNULIB_SINHF
1212GNULIB_SINL
1213GNULIB_SINF
1214GNULIB_SIGNBIT
1215GNULIB_ROUNDL
1216GNULIB_ROUNDF
1217GNULIB_ROUND
1218GNULIB_RINTL
1219GNULIB_RINTF
1220GNULIB_RINT
1221GNULIB_REMAINDERL
1222GNULIB_REMAINDERF
1223GNULIB_REMAINDER
1224GNULIB_POWF
1225GNULIB_MODFL
1226GNULIB_MODFF
1227GNULIB_MODF
1228GNULIB_LOGBL
1229GNULIB_LOGBF
1230GNULIB_LOGB
1231GNULIB_LOG2L
1232GNULIB_LOG2F
1233GNULIB_LOG2
1234GNULIB_LOG1PL
1235GNULIB_LOG1PF
1236GNULIB_LOG1P
1237GNULIB_LOG10L
1238GNULIB_LOG10F
1239GNULIB_LOG10
1240GNULIB_LOGL
1241GNULIB_LOGF
1242GNULIB_LOG
1243GNULIB_LDEXPL
1244GNULIB_LDEXPF
1245GNULIB_ISNANL
1246GNULIB_ISNAND
1247GNULIB_ISNANF
1248GNULIB_ISNAN
1249GNULIB_ISINF
1250GNULIB_ISFINITE
1251GNULIB_ILOGBL
1252GNULIB_ILOGBF
1253GNULIB_ILOGB
1254GNULIB_HYPOTL
1255GNULIB_HYPOTF
1256GNULIB_HYPOT
1257GNULIB_FREXPL
1258GNULIB_FREXP
1259GNULIB_FREXPF
1260GNULIB_FMODL
1261GNULIB_FMODF
1262GNULIB_FMOD
1263GNULIB_FMAL
1264GNULIB_FMAF
1265GNULIB_FMA
1266GNULIB_FLOORL
1267GNULIB_FLOORF
1268GNULIB_FLOOR
1269GNULIB_FABSL
1270GNULIB_FABSF
1271GNULIB_EXPM1L
1272GNULIB_EXPM1F
1273GNULIB_EXPM1
1274GNULIB_EXP2L
1275GNULIB_EXP2F
1276GNULIB_EXP2
1277GNULIB_EXPL
1278GNULIB_EXPF
1279GNULIB_COSHF
1280GNULIB_COSL
1281GNULIB_COSF
1282GNULIB_COPYSIGNL
1283GNULIB_COPYSIGNF
1284GNULIB_COPYSIGN
1285GNULIB_CEILL
1286GNULIB_CEILF
1287GNULIB_CEIL
1288GNULIB_CBRTL
1289GNULIB_CBRTF
1290GNULIB_CBRT
1291GNULIB_ATAN2F
1292GNULIB_ATANL
1293GNULIB_ATANF
1294GNULIB_ASINL
1295GNULIB_ASINF
1296GNULIB_ACOSL
1297GNULIB_ACOSF
1298GL_GENERATE_FNMATCH_H_FALSE
1299GL_GENERATE_FNMATCH_H_TRUE
1300FNMATCH_H
1301REPLACE_ITOLD
1302GL_GENERATE_FLOAT_H_FALSE
1303GL_GENERATE_FLOAT_H_TRUE
1304FLOAT_H
1305NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
1306NEXT_FLOAT_H
1307LIB_HAS_ACL
1308LIB_FDATASYNC
1309NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
1310NEXT_FCNTL_H
1311REPLACE_OPENAT
1312REPLACE_OPEN
1313REPLACE_FCNTL
1314HAVE_OPENAT
1315HAVE_FCNTL
1316GNULIB_OPENAT
1317GNULIB_OPEN
1318GNULIB_NONBLOCKING
1319GNULIB_FCNTL
1320REPLACE_VSPRINTF
1321REPLACE_VSNPRINTF
1322REPLACE_VPRINTF
1323REPLACE_VFPRINTF
1324REPLACE_VDPRINTF
1325REPLACE_VASPRINTF
1326REPLACE_TMPFILE
1327REPLACE_STDIO_WRITE_FUNCS
1328REPLACE_STDIO_READ_FUNCS
1329REPLACE_SPRINTF
1330REPLACE_SNPRINTF
1331REPLACE_RENAMEAT
1332REPLACE_RENAME
1333REPLACE_REMOVE
1334REPLACE_PRINTF
1335REPLACE_POPEN
1336REPLACE_PERROR
1337REPLACE_OBSTACK_PRINTF
1338REPLACE_GETLINE
1339REPLACE_GETDELIM
1340REPLACE_FTELLO
1341REPLACE_FTELL
1342REPLACE_FSEEKO
1343REPLACE_FSEEK
1344REPLACE_FREOPEN
1345REPLACE_FPURGE
1346REPLACE_FPRINTF
1347REPLACE_FOPEN
1348REPLACE_FFLUSH
1349REPLACE_FDOPEN
1350REPLACE_FCLOSE
1351REPLACE_DPRINTF
1352HAVE_VDPRINTF
1353HAVE_VASPRINTF
1354HAVE_RENAMEAT
1355HAVE_POPEN
1356HAVE_PCLOSE
1357HAVE_FTELLO
1358HAVE_FSEEKO
1359HAVE_DPRINTF
1360HAVE_DECL_VSNPRINTF
1361HAVE_DECL_SNPRINTF
1362HAVE_DECL_OBSTACK_PRINTF
1363HAVE_DECL_GETLINE
1364HAVE_DECL_GETDELIM
1365HAVE_DECL_FTELLO
1366HAVE_DECL_FSEEKO
1367HAVE_DECL_FPURGE
1368GNULIB_VSPRINTF_POSIX
1369GNULIB_VSNPRINTF
1370GNULIB_VPRINTF_POSIX
1371GNULIB_VPRINTF
1372GNULIB_VFPRINTF_POSIX
1373GNULIB_VFPRINTF
1374GNULIB_VDPRINTF
1375GNULIB_VSCANF
1376GNULIB_VFSCANF
1377GNULIB_VASPRINTF
1378GNULIB_TMPFILE
1379GNULIB_STDIO_H_SIGPIPE
1380GNULIB_STDIO_H_NONBLOCKING
1381GNULIB_SPRINTF_POSIX
1382GNULIB_SNPRINTF
1383GNULIB_SCANF
1384GNULIB_RENAMEAT
1385GNULIB_RENAME
1386GNULIB_REMOVE
1387GNULIB_PUTS
1388GNULIB_PUTCHAR
1389GNULIB_PUTC
1390GNULIB_PRINTF_POSIX
1391GNULIB_PRINTF
1392GNULIB_POPEN
1393GNULIB_PERROR
1394GNULIB_PCLOSE
1395GNULIB_OBSTACK_PRINTF_POSIX
1396GNULIB_OBSTACK_PRINTF
1397GNULIB_GETLINE
1398GNULIB_GETDELIM
1399GNULIB_GETCHAR
1400GNULIB_GETC
1401GNULIB_FWRITE
1402GNULIB_FTELLO
1403GNULIB_FTELL
1404GNULIB_FSEEKO
1405GNULIB_FSEEK
1406GNULIB_FSCANF
1407GNULIB_FREOPEN
1408GNULIB_FREAD
1409GNULIB_FPUTS
1410GNULIB_FPUTC
1411GNULIB_FPURGE
1412GNULIB_FPRINTF_POSIX
1413GNULIB_FPRINTF
1414GNULIB_FOPEN
1415GNULIB_FGETS
1416GNULIB_FGETC
1417GNULIB_FFLUSH
1418GNULIB_FDOPEN
1419GNULIB_FCLOSE
1420GNULIB_DPRINTF
1421REPLACE_UTIMENSAT
1422REPLACE_STAT
1423REPLACE_MKNOD
1424REPLACE_MKFIFO
1425REPLACE_MKDIR
1426REPLACE_LSTAT
1427REPLACE_FUTIMENS
1428REPLACE_FSTATAT
1429REPLACE_FSTAT
1430HAVE_UTIMENSAT
1431HAVE_MKNODAT
1432HAVE_MKNOD
1433HAVE_MKFIFOAT
1434HAVE_MKFIFO
1435HAVE_MKDIRAT
1436HAVE_LSTAT
1437HAVE_LCHMOD
1438HAVE_FUTIMENS
1439HAVE_FSTATAT
1440HAVE_FCHMODAT
1441GNULIB_OVERRIDES_STRUCT_STAT
1442GNULIB_UTIMENSAT
1443GNULIB_STAT
1444GNULIB_MKNODAT
1445GNULIB_MKNOD
1446GNULIB_MKFIFOAT
1447GNULIB_MKFIFO
1448GNULIB_MKDIRAT
1449GNULIB_LSTAT
1450GNULIB_LCHMOD
1451GNULIB_FUTIMENS
1452GNULIB_FSTATAT
1453GNULIB_FSTAT
1454GNULIB_FCHMODAT
1455UNDEFINE_STRTOK_R
1456REPLACE_STRSIGNAL
1457REPLACE_STRERROR_R
1458REPLACE_STRERROR
1459REPLACE_STRTOK_R
1460REPLACE_STRCASESTR
1461REPLACE_STRSTR
1462REPLACE_STRNLEN
1463REPLACE_STRNDUP
1464REPLACE_STRNCAT
1465REPLACE_STRDUP
1466REPLACE_STRCHRNUL
1467REPLACE_STPNCPY
1468REPLACE_MEMMEM
1469REPLACE_MEMCHR
1470HAVE_STRVERSCMP
1471HAVE_DECL_STRSIGNAL
1472HAVE_DECL_STRERROR_R
1473HAVE_DECL_STRTOK_R
1474HAVE_STRCASESTR
1475HAVE_STRSEP
1476HAVE_STRPBRK
1477HAVE_DECL_STRNLEN
1478HAVE_DECL_STRNDUP
1479HAVE_DECL_STRDUP
1480HAVE_STRCHRNUL
1481HAVE_STPNCPY
1482HAVE_STPCPY
1483HAVE_RAWMEMCHR
1484HAVE_DECL_MEMRCHR
1485HAVE_MEMPCPY
1486HAVE_DECL_MEMMEM
1487HAVE_MEMCHR
1488HAVE_FFSLL
1489HAVE_FFSL
1490HAVE_EXPLICIT_BZERO
1491HAVE_MBSLEN
1492GNULIB_STRVERSCMP
1493GNULIB_STRSIGNAL
1494GNULIB_STRERROR_R
1495GNULIB_STRERROR
1496GNULIB_MBSTOK_R
1497GNULIB_MBSSEP
1498GNULIB_MBSSPN
1499GNULIB_MBSPBRK
1500GNULIB_MBSCSPN
1501GNULIB_MBSCASESTR
1502GNULIB_MBSPCASECMP
1503GNULIB_MBSNCASECMP
1504GNULIB_MBSCASECMP
1505GNULIB_MBSSTR
1506GNULIB_MBSRCHR
1507GNULIB_MBSCHR
1508GNULIB_MBSNLEN
1509GNULIB_MBSLEN
1510GNULIB_STRTOK_R
1511GNULIB_STRCASESTR
1512GNULIB_STRSTR
1513GNULIB_STRSEP
1514GNULIB_STRPBRK
1515GNULIB_STRNLEN
1516GNULIB_STRNDUP
1517GNULIB_STRNCAT
1518GNULIB_STRDUP
1519GNULIB_STRCHRNUL
1520GNULIB_STPNCPY
1521GNULIB_STPCPY
1522GNULIB_RAWMEMCHR
1523GNULIB_MEMRCHR
1524GNULIB_MEMPCPY
1525GNULIB_MEMMEM
1526GNULIB_MEMCHR
1527GNULIB_FFSLL
1528GNULIB_FFSL
1529GNULIB_EXPLICIT_BZERO
1530LIB_EACCESS
1531EOVERFLOW_VALUE
1532EOVERFLOW_HIDDEN
1533ENOLINK_VALUE
1534ENOLINK_HIDDEN
1535EMULTIHOP_VALUE
1536EMULTIHOP_HIDDEN
1537GL_GENERATE_ERRNO_H_FALSE
1538GL_GENERATE_ERRNO_H_TRUE
1539ERRNO_H
1540NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
1541NEXT_ERRNO_H
1542HAVE_DIRENT_H
1543NEXT_AS_FIRST_DIRECTIVE_DIRENT_H
1544NEXT_DIRENT_H
1545NEXT_AS_FIRST_DIRECTIVE_CTYPE_H
1546NEXT_CTYPE_H
1547HAVE_ISBLANK
1548GNULIB_ISBLANK
1549LIB_CRYPTO
1550HAVE_WS2TCPIP_H
1551HAVE_SYS_SOCKET_H
1552NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
1553NEXT_SYS_SOCKET_H
1554HAVE_ACCEPT4
1555HAVE_SA_FAMILY_T
1556HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
1557HAVE_STRUCT_SOCKADDR_STORAGE
1558GNULIB_ACCEPT4
1559GNULIB_SHUTDOWN
1560GNULIB_SETSOCKOPT
1561GNULIB_SENDTO
1562GNULIB_RECVFROM
1563GNULIB_SEND
1564GNULIB_RECV
1565GNULIB_LISTEN
1566GNULIB_GETSOCKOPT
1567GNULIB_GETSOCKNAME
1568GNULIB_GETPEERNAME
1569GNULIB_BIND
1570GNULIB_ACCEPT
1571GNULIB_CONNECT
1572GNULIB_SOCKET
1573pkglibexecdir
1574runstatedir
1575lispdir
1576REPLACE_FDOPENDIR
1577REPLACE_DIRFD
1578REPLACE_CLOSEDIR
1579REPLACE_OPENDIR
1580HAVE_ALPHASORT
1581HAVE_SCANDIR
1582HAVE_FDOPENDIR
1583HAVE_DECL_FDOPENDIR
1584HAVE_DECL_DIRFD
1585HAVE_CLOSEDIR
1586HAVE_REWINDDIR
1587HAVE_READDIR
1588HAVE_OPENDIR
1589GNULIB_ALPHASORT
1590GNULIB_SCANDIR
1591GNULIB_FDOPENDIR
1592GNULIB_DIRFD
1593GNULIB_CLOSEDIR
1594GNULIB_REWINDDIR
1595GNULIB_READDIR
1596GNULIB_OPENDIR
1597HAVE_WINSOCK2_H
1598REPLACE_IOCTL
1599SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
1600SYS_IOCTL_H_HAVE_WINSOCK2_H
1601GNULIB_IOCTL
1602HAVE_MSVC_INVALID_PARAMETER_HANDLER
1603LIB_CLOCK_GETTIME
1604UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
1605UNISTD_H_HAVE_WINSOCK2_H
1606REPLACE_WRITE
1607REPLACE_USLEEP
1608REPLACE_UNLINKAT
1609REPLACE_UNLINK
1610REPLACE_TTYNAME_R
1611REPLACE_TRUNCATE
1612REPLACE_SYMLINKAT
1613REPLACE_SYMLINK
1614REPLACE_SLEEP
1615REPLACE_RMDIR
1616REPLACE_READLINKAT
1617REPLACE_READLINK
1618REPLACE_READ
1619REPLACE_PWRITE
1620REPLACE_PREAD
1621REPLACE_LSEEK
1622REPLACE_LINKAT
1623REPLACE_LINK
1624REPLACE_LCHOWN
1625REPLACE_ISATTY
1626REPLACE_GETPAGESIZE
1627REPLACE_GETGROUPS
1628REPLACE_GETLOGIN_R
1629REPLACE_GETDTABLESIZE
1630REPLACE_GETDOMAINNAME
1631REPLACE_GETCWD
1632REPLACE_FTRUNCATE
1633REPLACE_FCHOWNAT
1634REPLACE_FACCESSAT
1635REPLACE_DUP2
1636REPLACE_DUP
1637REPLACE_CLOSE
1638REPLACE_CHOWN
1639HAVE_SYS_PARAM_H
1640HAVE_OS_H
1641HAVE_DECL_TTYNAME_R
1642HAVE_DECL_TRUNCATE
1643HAVE_DECL_SETHOSTNAME
1644HAVE_DECL_GETUSERSHELL
1645HAVE_DECL_GETPAGESIZE
1646HAVE_DECL_GETLOGIN_R
1647HAVE_DECL_GETLOGIN
1648HAVE_DECL_GETDOMAINNAME
1649HAVE_DECL_FDATASYNC
1650HAVE_DECL_FCHDIR
1651HAVE_DECL_ENVIRON
1652HAVE_USLEEP
1653HAVE_UNLINKAT
1654HAVE_SYMLINKAT
1655HAVE_SYMLINK
1656HAVE_SLEEP
1657HAVE_SETHOSTNAME
1658HAVE_READLINKAT
1659HAVE_READLINK
1660HAVE_PWRITE
1661HAVE_PREAD
1662HAVE_PIPE2
1663HAVE_PIPE
1664HAVE_LINKAT
1665HAVE_LINK
1666HAVE_LCHOWN
1667HAVE_GROUP_MEMBER
1668HAVE_GETPAGESIZE
1669HAVE_GETLOGIN
1670HAVE_GETHOSTNAME
1671HAVE_GETGROUPS
1672HAVE_GETDTABLESIZE
1673HAVE_FTRUNCATE
1674HAVE_FSYNC
1675HAVE_FDATASYNC
1676HAVE_FCHOWNAT
1677HAVE_FCHDIR
1678HAVE_FACCESSAT
1679HAVE_EUIDACCESS
1680HAVE_DUP3
1681HAVE_DUP2
1682HAVE_CHOWN
1683GNULIB_WRITE
1684GNULIB_USLEEP
1685GNULIB_UNLINKAT
1686GNULIB_UNLINK
1687GNULIB_UNISTD_H_SIGPIPE
1688GNULIB_UNISTD_H_NONBLOCKING
1689GNULIB_TTYNAME_R
1690GNULIB_TRUNCATE
1691GNULIB_SYMLINKAT
1692GNULIB_SYMLINK
1693GNULIB_SLEEP
1694GNULIB_SETHOSTNAME
1695GNULIB_RMDIR
1696GNULIB_READLINKAT
1697GNULIB_READLINK
1698GNULIB_READ
1699GNULIB_PWRITE
1700GNULIB_PREAD
1701GNULIB_PIPE2
1702GNULIB_PIPE
1703GNULIB_LSEEK
1704GNULIB_LINKAT
1705GNULIB_LINK
1706GNULIB_LCHOWN
1707GNULIB_ISATTY
1708GNULIB_GROUP_MEMBER
1709GNULIB_GETUSERSHELL
1710GNULIB_GETPAGESIZE
1711GNULIB_GETLOGIN_R
1712GNULIB_GETLOGIN
1713GNULIB_GETHOSTNAME
1714GNULIB_GETGROUPS
1715GNULIB_GETDTABLESIZE
1716GNULIB_GETDOMAINNAME
1717GNULIB_GETCWD
1718GNULIB_FTRUNCATE
1719GNULIB_FSYNC
1720GNULIB_FDATASYNC
1721GNULIB_FCHOWNAT
1722GNULIB_FCHDIR
1723GNULIB_FACCESSAT
1724GNULIB_EUIDACCESS
1725GNULIB_ENVIRON
1726GNULIB_DUP3
1727GNULIB_DUP2
1728GNULIB_DUP
1729GNULIB_CLOSE
1730GNULIB_CHOWN
1731GNULIB_CHDIR
1732REPLACE_WCTOMB
1733REPLACE_UNSETENV
1734REPLACE_STRTOD
1735REPLACE_SETENV
1736REPLACE_REALPATH
1737REPLACE_REALLOC
1738REPLACE_RANDOM_R
1739REPLACE_QSORT_R
1740REPLACE_PUTENV
1741REPLACE_PTSNAME_R
1742REPLACE_PTSNAME
1743REPLACE_MKSTEMP
1744REPLACE_MBTOWC
1745REPLACE_MALLOC
1746REPLACE_CANONICALIZE_FILE_NAME
1747REPLACE_CALLOC
1748HAVE_DECL_UNSETENV
1749HAVE_UNLOCKPT
1750HAVE_SYS_LOADAVG_H
1751HAVE_STRUCT_RANDOM_DATA
1752HAVE_STRTOULL
1753HAVE_STRTOLL
1754HAVE_STRTOD
1755HAVE_DECL_SETSTATE
1756HAVE_DECL_SETENV
1757HAVE_SETENV
1758HAVE_SECURE_GETENV
1759HAVE_RPMATCH
1760HAVE_REALPATH
1761HAVE_REALLOCARRAY
1762HAVE_RANDOM_R
1763HAVE_RANDOM_H
1764HAVE_RANDOM
1765HAVE_QSORT_R
1766HAVE_PTSNAME_R
1767HAVE_PTSNAME
1768HAVE_POSIX_OPENPT
1769HAVE_MKSTEMPS
1770HAVE_MKSTEMP
1771HAVE_MKOSTEMPS
1772HAVE_MKOSTEMP
1773HAVE_MKDTEMP
1774HAVE_DECL_INITSTATE
1775HAVE_GRANTPT
1776HAVE_GETSUBOPT
1777HAVE_DECL_GETLOADAVG
1778HAVE_CANONICALIZE_FILE_NAME
1779HAVE_ATOLL
1780HAVE__EXIT
1781GNULIB_WCTOMB
1782GNULIB_UNSETENV
1783GNULIB_UNLOCKPT
1784GNULIB_SYSTEM_POSIX
1785GNULIB_STRTOULL
1786GNULIB_STRTOLL
1787GNULIB_STRTOD
1788GNULIB_SETENV
1789GNULIB_SECURE_GETENV
1790GNULIB_RPMATCH
1791GNULIB_REALPATH
1792GNULIB_REALLOC_POSIX
1793GNULIB_REALLOCARRAY
1794GNULIB_RANDOM_R
1795GNULIB_RANDOM
1796GNULIB_QSORT_R
1797GNULIB_PUTENV
1798GNULIB_PTSNAME_R
1799GNULIB_PTSNAME
1800GNULIB_POSIX_OPENPT
1801GNULIB_MKSTEMPS
1802GNULIB_MKSTEMP
1803GNULIB_MKOSTEMPS
1804GNULIB_MKOSTEMP
1805GNULIB_MKDTEMP
1806GNULIB_MBTOWC
1807GNULIB_MALLOC_POSIX
1808GNULIB_GRANTPT
1809GNULIB_GETSUBOPT
1810GNULIB_GETLOADAVG
1811GNULIB_CANONICALIZE_FILE_NAME
1812GNULIB_CALLOC_POSIX
1813GNULIB_ATOLL
1814GNULIB__EXIT
1815GL_GENERATE_BYTESWAP_H_FALSE
1816GL_GENERATE_BYTESWAP_H_TRUE
1817BYTESWAP_H
1818LOCALE_FR
1819REPLACE_WCSFTIME
1820REPLACE_WCSWIDTH
1821REPLACE_WCWIDTH
1822REPLACE_WCSNRTOMBS
1823REPLACE_WCSRTOMBS
1824REPLACE_WCRTOMB
1825REPLACE_MBSNRTOWCS
1826REPLACE_MBSRTOWCS
1827REPLACE_MBRLEN
1828REPLACE_MBRTOWC
1829REPLACE_MBSINIT
1830REPLACE_WCTOB
1831REPLACE_BTOWC
1832REPLACE_MBSTATE_T
1833HAVE_DECL_WCWIDTH
1834HAVE_DECL_WCTOB
1835HAVE_WCSFTIME
1836HAVE_WCSWIDTH
1837HAVE_WCSTOK
1838HAVE_WCSSTR
1839HAVE_WCSPBRK
1840HAVE_WCSSPN
1841HAVE_WCSCSPN
1842HAVE_WCSRCHR
1843HAVE_WCSCHR
1844HAVE_WCSDUP
1845HAVE_WCSXFRM
1846HAVE_WCSCOLL
1847HAVE_WCSNCASECMP
1848HAVE_WCSCASECMP
1849HAVE_WCSNCMP
1850HAVE_WCSCMP
1851HAVE_WCSNCAT
1852HAVE_WCSCAT
1853HAVE_WCPNCPY
1854HAVE_WCSNCPY
1855HAVE_WCPCPY
1856HAVE_WCSCPY
1857HAVE_WCSNLEN
1858HAVE_WCSLEN
1859HAVE_WMEMSET
1860HAVE_WMEMMOVE
1861HAVE_WMEMCPY
1862HAVE_WMEMCMP
1863HAVE_WMEMCHR
1864HAVE_WCSNRTOMBS
1865HAVE_WCSRTOMBS
1866HAVE_WCRTOMB
1867HAVE_MBSNRTOWCS
1868HAVE_MBSRTOWCS
1869HAVE_MBRLEN
1870HAVE_MBRTOWC
1871HAVE_MBSINIT
1872HAVE_BTOWC
1873GNULIB_WCSFTIME
1874GNULIB_WCSWIDTH
1875GNULIB_WCSTOK
1876GNULIB_WCSSTR
1877GNULIB_WCSPBRK
1878GNULIB_WCSSPN
1879GNULIB_WCSCSPN
1880GNULIB_WCSRCHR
1881GNULIB_WCSCHR
1882GNULIB_WCSDUP
1883GNULIB_WCSXFRM
1884GNULIB_WCSCOLL
1885GNULIB_WCSNCASECMP
1886GNULIB_WCSCASECMP
1887GNULIB_WCSNCMP
1888GNULIB_WCSCMP
1889GNULIB_WCSNCAT
1890GNULIB_WCSCAT
1891GNULIB_WCPNCPY
1892GNULIB_WCSNCPY
1893GNULIB_WCPCPY
1894GNULIB_WCSCPY
1895GNULIB_WCSNLEN
1896GNULIB_WCSLEN
1897GNULIB_WMEMSET
1898GNULIB_WMEMMOVE
1899GNULIB_WMEMCPY
1900GNULIB_WMEMCMP
1901GNULIB_WMEMCHR
1902GNULIB_WCWIDTH
1903GNULIB_WCSNRTOMBS
1904GNULIB_WCSRTOMBS
1905GNULIB_WCRTOMB
1906GNULIB_MBSNRTOWCS
1907GNULIB_MBSRTOWCS
1908GNULIB_MBRLEN
1909GNULIB_MBRTOWC
1910GNULIB_MBSINIT
1911GNULIB_WCTOB
1912GNULIB_BTOWC
1913HAVE_FEATURES_H
1914NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H
1915NEXT_ARPA_INET_H
1916PRAGMA_COLUMNS
1917PRAGMA_SYSTEM_HEADER
1918INCLUDE_NEXT_AS_FIRST_DIRECTIVE
1919INCLUDE_NEXT
1920HAVE_ARPA_INET_H
1921REPLACE_INET_PTON
1922REPLACE_INET_NTOP
1923HAVE_DECL_INET_PTON
1924HAVE_DECL_INET_NTOP
1925GNULIB_INET_PTON
1926GNULIB_INET_NTOP
1927GL_GENERATE_ALLOCA_H_FALSE
1928GL_GENERATE_ALLOCA_H_TRUE
1929ALLOCA_H
1930ALLOCA
1931USE_ACL
1932LIB_ACL
1933GL_COND_LIBTOOL_FALSE
1934GL_COND_LIBTOOL_TRUE
1935host_os
1936host_vendor
1937host_cpu
1938host
1939build_os
1940build_vendor
1941build_cpu
1942build
1943ARFLAGS
1944AR
1945LN_S
1946RANLIB
1947EGREP
1948GREP
1949CPP
1950am__fastdepCC_FALSE
1951am__fastdepCC_TRUE
1952CCDEPMODE
1953am__nodep
1954AMDEPBACKSLASH
1955AMDEP_FALSE
1956AMDEP_TRUE
1957am__quote
1958am__include
1959DEPDIR
1960OBJEXT
1961EXEEXT
1962ac_ct_CC
1963CPPFLAGS
1964LDFLAGS
1965CFLAGS
1966CC
1967AM_BACKSLASH
1968AM_DEFAULT_VERBOSITY
1969AM_DEFAULT_V
1970AM_V
1971am__untar
1972am__tar
1973AMTAR
1974am__leading_dot
1975SET_MAKE
1976AWK
1977mkdir_p
1978MKDIR_P
1979INSTALL_STRIP_PROGRAM
1980STRIP
1981install_sh
1982MAKEINFO
1983AUTOHEADER
1984AUTOMAKE
1985AUTOCONF
1986ACLOCAL
1987VERSION
1988PACKAGE
1989CYGPATH_W
1990am__isrc
1991INSTALL_DATA
1992INSTALL_SCRIPT
1993INSTALL_PROGRAM
1994target_alias
1995host_alias
1996build_alias
1997LIBS
1998ECHO_T
1999ECHO_N
2000ECHO_C
2001DEFS
2002mandir
2003localedir
2004libdir
2005psdir
2006pdfdir
2007dvidir
2008htmldir
2009infodir
2010docdir
2011oldincludedir
2012includedir
2013localstatedir
2014sharedstatedir
2015sysconfdir
2016datadir
2017datarootdir
2018libexecdir
2019sbindir
2020bindir
2021program_transform_name
2022prefix
2023exec_prefix
2024PACKAGE_URL
2025PACKAGE_BUGREPORT
2026PACKAGE_STRING
2027PACKAGE_VERSION
2028PACKAGE_TARNAME
2029PACKAGE_NAME
2030PATH_SEPARATOR
2031SHELL'
2032ac_subst_files=''
2033ac_user_opts='
2034enable_option_checking
2035enable_silent_rules
2036enable_dependency_tracking
2037enable_largefile
2038enable_threads
2039enable_acl
2040enable_assert
2041with_linux_crypto
2042with_openssl
2043with_gnu_ld
2044enable_rpath
2045with_libiconv_prefix
2046with_libpth_prefix
2047with_included_regex
2048with_selinux
2049enable_libsmack
2050with_packager
2051with_packager_version
2052with_packager_bug_reports
2053enable_xattr
2054enable_libcap
2055with_tty_group
2056enable_gcc_warnings
2057enable_single_binary
2058enable_single_binary_exceptions
2059with_gmp
2060enable_install_program
2061enable_no_install_program
2062enable_nls
2063with_libintl_prefix
2064'
2065      ac_precious_vars='build_alias
2066host_alias
2067target_alias
2068CC
2069CFLAGS
2070LDFLAGS
2071LIBS
2072CPPFLAGS
2073CPP
2074YACC
2075YFLAGS
2076DEFAULT_POSIX2_VERSION'
2077
2078
2079# Initialize some variables set by options.
2080ac_init_help=
2081ac_init_version=false
2082ac_unrecognized_opts=
2083ac_unrecognized_sep=
2084# The variables have the same names as the options, with
2085# dashes changed to underlines.
2086cache_file=/dev/null
2087exec_prefix=NONE
2088no_create=
2089no_recursion=
2090prefix=NONE
2091program_prefix=NONE
2092program_suffix=NONE
2093program_transform_name=s,x,x,
2094silent=
2095site=
2096srcdir=
2097verbose=
2098x_includes=NONE
2099x_libraries=NONE
2100
2101# Installation directory options.
2102# These are left unexpanded so users can "make install exec_prefix=/foo"
2103# and all the variables that are supposed to be based on exec_prefix
2104# by default will actually change.
2105# Use braces instead of parens because sh, perl, etc. also accept them.
2106# (The list follows the same order as the GNU Coding Standards.)
2107bindir='${exec_prefix}/bin'
2108sbindir='${exec_prefix}/sbin'
2109libexecdir='${exec_prefix}/libexec'
2110datarootdir='${prefix}/share'
2111datadir='${datarootdir}'
2112sysconfdir='${prefix}/etc'
2113sharedstatedir='${prefix}/com'
2114localstatedir='${prefix}/var'
2115includedir='${prefix}/include'
2116oldincludedir='/usr/include'
2117docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
2118infodir='${datarootdir}/info'
2119htmldir='${docdir}'
2120dvidir='${docdir}'
2121pdfdir='${docdir}'
2122psdir='${docdir}'
2123libdir='${exec_prefix}/lib'
2124localedir='${datarootdir}/locale'
2125mandir='${datarootdir}/man'
2126
2127ac_prev=
2128ac_dashdash=
2129for ac_option
2130do
2131  # If the previous option needs an argument, assign it.
2132  if test -n "$ac_prev"; then
2133    eval $ac_prev=\$ac_option
2134    ac_prev=
2135    continue
2136  fi
2137
2138  case $ac_option in
2139  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
2140  *=)   ac_optarg= ;;
2141  *)    ac_optarg=yes ;;
2142  esac
2143
2144  # Accept the important Cygnus configure options, so we can diagnose typos.
2145
2146  case $ac_dashdash$ac_option in
2147  --)
2148    ac_dashdash=yes ;;
2149
2150  -bindir | --bindir | --bindi | --bind | --bin | --bi)
2151    ac_prev=bindir ;;
2152  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
2153    bindir=$ac_optarg ;;
2154
2155  -build | --build | --buil | --bui | --bu)
2156    ac_prev=build_alias ;;
2157  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
2158    build_alias=$ac_optarg ;;
2159
2160  -cache-file | --cache-file | --cache-fil | --cache-fi \
2161  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
2162    ac_prev=cache_file ;;
2163  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
2164  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
2165    cache_file=$ac_optarg ;;
2166
2167  --config-cache | -C)
2168    cache_file=config.cache ;;
2169
2170  -datadir | --datadir | --datadi | --datad)
2171    ac_prev=datadir ;;
2172  -datadir=* | --datadir=* | --datadi=* | --datad=*)
2173    datadir=$ac_optarg ;;
2174
2175  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
2176  | --dataroo | --dataro | --datar)
2177    ac_prev=datarootdir ;;
2178  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
2179  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
2180    datarootdir=$ac_optarg ;;
2181
2182  -disable-* | --disable-*)
2183    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
2184    # Reject names that are not valid shell variable names.
2185    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
2186      as_fn_error $? "invalid feature name: $ac_useropt"
2187    ac_useropt_orig=$ac_useropt
2188    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2189    case $ac_user_opts in
2190      *"
2191"enable_$ac_useropt"
2192"*) ;;
2193      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
2194	 ac_unrecognized_sep=', ';;
2195    esac
2196    eval enable_$ac_useropt=no ;;
2197
2198  -docdir | --docdir | --docdi | --doc | --do)
2199    ac_prev=docdir ;;
2200  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
2201    docdir=$ac_optarg ;;
2202
2203  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
2204    ac_prev=dvidir ;;
2205  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
2206    dvidir=$ac_optarg ;;
2207
2208  -enable-* | --enable-*)
2209    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
2210    # Reject names that are not valid shell variable names.
2211    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
2212      as_fn_error $? "invalid feature name: $ac_useropt"
2213    ac_useropt_orig=$ac_useropt
2214    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2215    case $ac_user_opts in
2216      *"
2217"enable_$ac_useropt"
2218"*) ;;
2219      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
2220	 ac_unrecognized_sep=', ';;
2221    esac
2222    eval enable_$ac_useropt=\$ac_optarg ;;
2223
2224  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
2225  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
2226  | --exec | --exe | --ex)
2227    ac_prev=exec_prefix ;;
2228  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
2229  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
2230  | --exec=* | --exe=* | --ex=*)
2231    exec_prefix=$ac_optarg ;;
2232
2233  -gas | --gas | --ga | --g)
2234    # Obsolete; use --with-gas.
2235    with_gas=yes ;;
2236
2237  -help | --help | --hel | --he | -h)
2238    ac_init_help=long ;;
2239  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
2240    ac_init_help=recursive ;;
2241  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
2242    ac_init_help=short ;;
2243
2244  -host | --host | --hos | --ho)
2245    ac_prev=host_alias ;;
2246  -host=* | --host=* | --hos=* | --ho=*)
2247    host_alias=$ac_optarg ;;
2248
2249  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
2250    ac_prev=htmldir ;;
2251  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
2252  | --ht=*)
2253    htmldir=$ac_optarg ;;
2254
2255  -includedir | --includedir | --includedi | --included | --include \
2256  | --includ | --inclu | --incl | --inc)
2257    ac_prev=includedir ;;
2258  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
2259  | --includ=* | --inclu=* | --incl=* | --inc=*)
2260    includedir=$ac_optarg ;;
2261
2262  -infodir | --infodir | --infodi | --infod | --info | --inf)
2263    ac_prev=infodir ;;
2264  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
2265    infodir=$ac_optarg ;;
2266
2267  -libdir | --libdir | --libdi | --libd)
2268    ac_prev=libdir ;;
2269  -libdir=* | --libdir=* | --libdi=* | --libd=*)
2270    libdir=$ac_optarg ;;
2271
2272  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
2273  | --libexe | --libex | --libe)
2274    ac_prev=libexecdir ;;
2275  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
2276  | --libexe=* | --libex=* | --libe=*)
2277    libexecdir=$ac_optarg ;;
2278
2279  -localedir | --localedir | --localedi | --localed | --locale)
2280    ac_prev=localedir ;;
2281  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
2282    localedir=$ac_optarg ;;
2283
2284  -localstatedir | --localstatedir | --localstatedi | --localstated \
2285  | --localstate | --localstat | --localsta | --localst | --locals)
2286    ac_prev=localstatedir ;;
2287  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
2288  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
2289    localstatedir=$ac_optarg ;;
2290
2291  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
2292    ac_prev=mandir ;;
2293  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
2294    mandir=$ac_optarg ;;
2295
2296  -nfp | --nfp | --nf)
2297    # Obsolete; use --without-fp.
2298    with_fp=no ;;
2299
2300  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
2301  | --no-cr | --no-c | -n)
2302    no_create=yes ;;
2303
2304  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
2305  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
2306    no_recursion=yes ;;
2307
2308  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
2309  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
2310  | --oldin | --oldi | --old | --ol | --o)
2311    ac_prev=oldincludedir ;;
2312  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
2313  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
2314  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
2315    oldincludedir=$ac_optarg ;;
2316
2317  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
2318    ac_prev=prefix ;;
2319  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
2320    prefix=$ac_optarg ;;
2321
2322  -program-prefix | --program-prefix | --program-prefi | --program-pref \
2323  | --program-pre | --program-pr | --program-p)
2324    ac_prev=program_prefix ;;
2325  -program-prefix=* | --program-prefix=* | --program-prefi=* \
2326  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
2327    program_prefix=$ac_optarg ;;
2328
2329  -program-suffix | --program-suffix | --program-suffi | --program-suff \
2330  | --program-suf | --program-su | --program-s)
2331    ac_prev=program_suffix ;;
2332  -program-suffix=* | --program-suffix=* | --program-suffi=* \
2333  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
2334    program_suffix=$ac_optarg ;;
2335
2336  -program-transform-name | --program-transform-name \
2337  | --program-transform-nam | --program-transform-na \
2338  | --program-transform-n | --program-transform- \
2339  | --program-transform | --program-transfor \
2340  | --program-transfo | --program-transf \
2341  | --program-trans | --program-tran \
2342  | --progr-tra | --program-tr | --program-t)
2343    ac_prev=program_transform_name ;;
2344  -program-transform-name=* | --program-transform-name=* \
2345  | --program-transform-nam=* | --program-transform-na=* \
2346  | --program-transform-n=* | --program-transform-=* \
2347  | --program-transform=* | --program-transfor=* \
2348  | --program-transfo=* | --program-transf=* \
2349  | --program-trans=* | --program-tran=* \
2350  | --progr-tra=* | --program-tr=* | --program-t=*)
2351    program_transform_name=$ac_optarg ;;
2352
2353  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
2354    ac_prev=pdfdir ;;
2355  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
2356    pdfdir=$ac_optarg ;;
2357
2358  -psdir | --psdir | --psdi | --psd | --ps)
2359    ac_prev=psdir ;;
2360  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
2361    psdir=$ac_optarg ;;
2362
2363  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2364  | -silent | --silent | --silen | --sile | --sil)
2365    silent=yes ;;
2366
2367  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
2368    ac_prev=sbindir ;;
2369  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
2370  | --sbi=* | --sb=*)
2371    sbindir=$ac_optarg ;;
2372
2373  -sharedstatedir | --sharedstatedir | --sharedstatedi \
2374  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
2375  | --sharedst | --shareds | --shared | --share | --shar \
2376  | --sha | --sh)
2377    ac_prev=sharedstatedir ;;
2378  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
2379  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
2380  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
2381  | --sha=* | --sh=*)
2382    sharedstatedir=$ac_optarg ;;
2383
2384  -site | --site | --sit)
2385    ac_prev=site ;;
2386  -site=* | --site=* | --sit=*)
2387    site=$ac_optarg ;;
2388
2389  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
2390    ac_prev=srcdir ;;
2391  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
2392    srcdir=$ac_optarg ;;
2393
2394  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
2395  | --syscon | --sysco | --sysc | --sys | --sy)
2396    ac_prev=sysconfdir ;;
2397  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
2398  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
2399    sysconfdir=$ac_optarg ;;
2400
2401  -target | --target | --targe | --targ | --tar | --ta | --t)
2402    ac_prev=target_alias ;;
2403  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
2404    target_alias=$ac_optarg ;;
2405
2406  -v | -verbose | --verbose | --verbos | --verbo | --verb)
2407    verbose=yes ;;
2408
2409  -version | --version | --versio | --versi | --vers | -V)
2410    ac_init_version=: ;;
2411
2412  -with-* | --with-*)
2413    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
2414    # Reject names that are not valid shell variable names.
2415    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
2416      as_fn_error $? "invalid package name: $ac_useropt"
2417    ac_useropt_orig=$ac_useropt
2418    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2419    case $ac_user_opts in
2420      *"
2421"with_$ac_useropt"
2422"*) ;;
2423      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
2424	 ac_unrecognized_sep=', ';;
2425    esac
2426    eval with_$ac_useropt=\$ac_optarg ;;
2427
2428  -without-* | --without-*)
2429    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
2430    # Reject names that are not valid shell variable names.
2431    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
2432      as_fn_error $? "invalid package name: $ac_useropt"
2433    ac_useropt_orig=$ac_useropt
2434    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
2435    case $ac_user_opts in
2436      *"
2437"with_$ac_useropt"
2438"*) ;;
2439      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
2440	 ac_unrecognized_sep=', ';;
2441    esac
2442    eval with_$ac_useropt=no ;;
2443
2444  --x)
2445    # Obsolete; use --with-x.
2446    with_x=yes ;;
2447
2448  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
2449  | --x-incl | --x-inc | --x-in | --x-i)
2450    ac_prev=x_includes ;;
2451  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
2452  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
2453    x_includes=$ac_optarg ;;
2454
2455  -x-libraries | --x-libraries | --x-librarie | --x-librari \
2456  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
2457    ac_prev=x_libraries ;;
2458  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
2459  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
2460    x_libraries=$ac_optarg ;;
2461
2462  -*) as_fn_error $? "unrecognized option: \`$ac_option'
2463Try \`$0 --help' for more information"
2464    ;;
2465
2466  *=*)
2467    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
2468    # Reject names that are not valid shell variable names.
2469    case $ac_envvar in #(
2470      '' | [0-9]* | *[!_$as_cr_alnum]* )
2471      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
2472    esac
2473    eval $ac_envvar=\$ac_optarg
2474    export $ac_envvar ;;
2475
2476  *)
2477    # FIXME: should be removed in autoconf 3.0.
2478    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
2479    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
2480      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
2481    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
2482    ;;
2483
2484  esac
2485done
2486
2487if test -n "$ac_prev"; then
2488  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
2489  as_fn_error $? "missing argument to $ac_option"
2490fi
2491
2492if test -n "$ac_unrecognized_opts"; then
2493  case $enable_option_checking in
2494    no) ;;
2495    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
2496    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
2497  esac
2498fi
2499
2500# Check all directory arguments for consistency.
2501for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
2502		datadir sysconfdir sharedstatedir localstatedir includedir \
2503		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
2504		libdir localedir mandir
2505do
2506  eval ac_val=\$$ac_var
2507  # Remove trailing slashes.
2508  case $ac_val in
2509    */ )
2510      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
2511      eval $ac_var=\$ac_val;;
2512  esac
2513  # Be sure to have absolute directory names.
2514  case $ac_val in
2515    [\\/$]* | ?:[\\/]* )  continue;;
2516    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
2517  esac
2518  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
2519done
2520
2521# There might be people who depend on the old broken behavior: `$host'
2522# used to hold the argument of --host etc.
2523# FIXME: To remove some day.
2524build=$build_alias
2525host=$host_alias
2526target=$target_alias
2527
2528# FIXME: To remove some day.
2529if test "x$host_alias" != x; then
2530  if test "x$build_alias" = x; then
2531    cross_compiling=maybe
2532  elif test "x$build_alias" != "x$host_alias"; then
2533    cross_compiling=yes
2534  fi
2535fi
2536
2537ac_tool_prefix=
2538test -n "$host_alias" && ac_tool_prefix=$host_alias-
2539
2540test "$silent" = yes && exec 6>/dev/null
2541
2542
2543ac_pwd=`pwd` && test -n "$ac_pwd" &&
2544ac_ls_di=`ls -di .` &&
2545ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
2546  as_fn_error $? "working directory cannot be determined"
2547test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
2548  as_fn_error $? "pwd does not report name of working directory"
2549
2550
2551# Find the source files, if location was not specified.
2552if test -z "$srcdir"; then
2553  ac_srcdir_defaulted=yes
2554  # Try the directory containing this script, then the parent directory.
2555  ac_confdir=`$as_dirname -- "$as_myself" ||
2556$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
2557	 X"$as_myself" : 'X\(//\)[^/]' \| \
2558	 X"$as_myself" : 'X\(//\)$' \| \
2559	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
2560$as_echo X"$as_myself" |
2561    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
2562	    s//\1/
2563	    q
2564	  }
2565	  /^X\(\/\/\)[^/].*/{
2566	    s//\1/
2567	    q
2568	  }
2569	  /^X\(\/\/\)$/{
2570	    s//\1/
2571	    q
2572	  }
2573	  /^X\(\/\).*/{
2574	    s//\1/
2575	    q
2576	  }
2577	  s/.*/./; q'`
2578  srcdir=$ac_confdir
2579  if test ! -r "$srcdir/$ac_unique_file"; then
2580    srcdir=..
2581  fi
2582else
2583  ac_srcdir_defaulted=no
2584fi
2585if test ! -r "$srcdir/$ac_unique_file"; then
2586  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
2587  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
2588fi
2589ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
2590ac_abs_confdir=`(
2591	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
2592	pwd)`
2593# When building in place, set srcdir=.
2594if test "$ac_abs_confdir" = "$ac_pwd"; then
2595  srcdir=.
2596fi
2597# Remove unnecessary trailing slashes from srcdir.
2598# Double slashes in file names in object file debugging info
2599# mess up M-x gdb in Emacs.
2600case $srcdir in
2601*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
2602esac
2603for ac_var in $ac_precious_vars; do
2604  eval ac_env_${ac_var}_set=\${${ac_var}+set}
2605  eval ac_env_${ac_var}_value=\$${ac_var}
2606  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
2607  eval ac_cv_env_${ac_var}_value=\$${ac_var}
2608done
2609
2610#
2611# Report the --help message.
2612#
2613if test "$ac_init_help" = "long"; then
2614  # Omit some internal or obsolete options to make the list less imposing.
2615  # This message is too long to be a string in the A/UX 3.1 sh.
2616  cat <<_ACEOF
2617\`configure' configures GNU coreutils 8.30 to adapt to many kinds of systems.
2618
2619Usage: $0 [OPTION]... [VAR=VALUE]...
2620
2621To assign environment variables (e.g., CC, CFLAGS...), specify them as
2622VAR=VALUE.  See below for descriptions of some of the useful variables.
2623
2624Defaults for the options are specified in brackets.
2625
2626Configuration:
2627  -h, --help              display this help and exit
2628      --help=short        display options specific to this package
2629      --help=recursive    display the short help of all the included packages
2630  -V, --version           display version information and exit
2631  -q, --quiet, --silent   do not print \`checking ...' messages
2632      --cache-file=FILE   cache test results in FILE [disabled]
2633  -C, --config-cache      alias for \`--cache-file=config.cache'
2634  -n, --no-create         do not create output files
2635      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
2636
2637Installation directories:
2638  --prefix=PREFIX         install architecture-independent files in PREFIX
2639                          [$ac_default_prefix]
2640  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
2641                          [PREFIX]
2642
2643By default, \`make install' will install all the files in
2644\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
2645an installation prefix other than \`$ac_default_prefix' using \`--prefix',
2646for instance \`--prefix=\$HOME'.
2647
2648For better control, use the options below.
2649
2650Fine tuning of the installation directories:
2651  --bindir=DIR            user executables [EPREFIX/bin]
2652  --sbindir=DIR           system admin executables [EPREFIX/sbin]
2653  --libexecdir=DIR        program executables [EPREFIX/libexec]
2654  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
2655  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
2656  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
2657  --libdir=DIR            object code libraries [EPREFIX/lib]
2658  --includedir=DIR        C header files [PREFIX/include]
2659  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
2660  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
2661  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
2662  --infodir=DIR           info documentation [DATAROOTDIR/info]
2663  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
2664  --mandir=DIR            man documentation [DATAROOTDIR/man]
2665  --docdir=DIR            documentation root [DATAROOTDIR/doc/coreutils]
2666  --htmldir=DIR           html documentation [DOCDIR]
2667  --dvidir=DIR            dvi documentation [DOCDIR]
2668  --pdfdir=DIR            pdf documentation [DOCDIR]
2669  --psdir=DIR             ps documentation [DOCDIR]
2670_ACEOF
2671
2672  cat <<\_ACEOF
2673
2674Program names:
2675  --program-prefix=PREFIX            prepend PREFIX to installed program names
2676  --program-suffix=SUFFIX            append SUFFIX to installed program names
2677  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
2678
2679System types:
2680  --build=BUILD     configure for building on BUILD [guessed]
2681  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
2682_ACEOF
2683fi
2684
2685if test -n "$ac_init_help"; then
2686  case $ac_init_help in
2687     short | recursive ) echo "Configuration of GNU coreutils 8.30:";;
2688   esac
2689  cat <<\_ACEOF
2690
2691Optional Features:
2692  --disable-option-checking  ignore unrecognized --enable/--with options
2693  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
2694  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
2695  --enable-silent-rules   less verbose build output (undo: "make V=1")
2696  --disable-silent-rules  verbose build output (undo: "make V=0")
2697  --enable-dependency-tracking
2698                          do not reject slow dependency extractors
2699  --disable-dependency-tracking
2700                          speeds up one-time build
2701  --disable-largefile     omit support for large files
2702  --enable-threads={posix|solaris|pth|windows}
2703                          specify multithreading API
2704  --disable-threads       build without multithread safety
2705  --disable-acl           do not support ACLs
2706  --disable-assert        turn off assertions
2707  --disable-rpath         do not hardcode runtime library paths
2708  --disable-libsmack      disable libsmack support
2709  --disable-xattr         do not support extended attributes
2710  --disable-libcap        disable libcap support
2711  --enable-gcc-warnings   turn on many GCC warnings (for developers; best with
2712                          GNU make)
2713  --enable-single-binary=shebangs|symlinks
2714                          Compile all the tools in a single binary, reducing
2715                          the overall size. When compiled this way, shebangs
2716                          (default when enabled) or symlinks are installed for
2717                          each tool that points to the single binary.
2718  --enable-single-binary-exceptions=PROG_LIST
2719                          When used with --enable-single-binary, exclude the
2720                          PROG_LIST from it, so these programs are compiled as
2721                          separated files (comma-separated, default none))
2722  --enable-install-program=PROG_LIST
2723                          install the programs in PROG_LIST (comma-separated,
2724                          default: none)
2725  --enable-no-install-program=PROG_LIST
2726                          do NOT install the programs in PROG_LIST
2727                          (comma-separated, default: arch,coreutils,hostname)
2728  --disable-nls           do not use Native Language Support
2729
2730Optional Packages:
2731  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
2732  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
2733  --with-linux-crypto     use Linux kernel cryptographic API (if available)
2734  --with-openssl          use libcrypto hash routines. Valid ARGs are: 'yes',
2735                          'no', 'auto' => use if available, 'optional' => use
2736                          if available and warn if not available; default is
2737                          'no'. Note also --with-linux-crypto, which will
2738                          enable use of kernel crypto routines, which have
2739                          precedence
2740  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
2741  --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
2742  --without-libiconv-prefix     don't search for libiconv in includedir and libdir
2743  --with-libpth-prefix[=DIR]  search for libpth in DIR/include and DIR/lib
2744  --without-libpth-prefix     don't search for libpth in includedir and libdir
2745  --without-included-regex
2746                          don't compile regex; this is the default on systems
2747                          with recent-enough versions of the GNU C Library
2748                          (use with caution on other systems).
2749  --without-selinux       do not use SELinux, even on systems with SELinux
2750  --with-packager         String identifying the packager of this software
2751  --with-packager-version Packager-specific version information
2752  --with-packager-bug-reports
2753                          Packager info for bug reports (URL/e-mail/...)
2754  --with-tty-group[=NAME]
2755                          group used by system for TTYs, "tty" when not
2756                          specified (default: do not rely on any group used
2757                          for TTYs)
2758  --without-gmp           do not use the GNU MP library for arbitrary
2759                          precision calculation (default: use it if available)
2760  --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
2761  --without-libintl-prefix     don't search for libintl in includedir and libdir
2762
2763Some influential environment variables:
2764  CC          C compiler command
2765  CFLAGS      C compiler flags
2766  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
2767              nonstandard directory <lib dir>
2768  LIBS        libraries to pass to the linker, e.g. -l<library>
2769  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
2770              you have headers in a nonstandard directory <include dir>
2771  CPP         C preprocessor
2772  YACC        The "Yet Another C Compiler" implementation to use. Defaults to
2773              'bison -y'. Values other than 'bison -y' will most likely break
2774              on most systems.
2775  YFLAGS      YFLAGS contains the list arguments that will be passed by
2776              default to Bison. This script will default YFLAGS to the empty
2777              string to avoid a default value of '-d' given by some make
2778              applications.
2779  DEFAULT_POSIX2_VERSION
2780              POSIX version to default to; see 'config.hin'.
2781
2782Use these variables to override the choices made by `configure' or to help
2783it to find libraries and programs with nonstandard names/locations.
2784
2785Report bugs to <bug-coreutils@gnu.org>.
2786GNU coreutils home page: <https://www.gnu.org/software/coreutils/>.
2787General help using GNU software: <http://www.gnu.org/gethelp/>.
2788_ACEOF
2789ac_status=$?
2790fi
2791
2792if test "$ac_init_help" = "recursive"; then
2793  # If there are subdirs, report their specific --help.
2794  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
2795    test -d "$ac_dir" ||
2796      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
2797      continue
2798    ac_builddir=.
2799
2800case "$ac_dir" in
2801.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
2802*)
2803  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
2804  # A ".." for each directory in $ac_dir_suffix.
2805  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
2806  case $ac_top_builddir_sub in
2807  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
2808  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
2809  esac ;;
2810esac
2811ac_abs_top_builddir=$ac_pwd
2812ac_abs_builddir=$ac_pwd$ac_dir_suffix
2813# for backward compatibility:
2814ac_top_builddir=$ac_top_build_prefix
2815
2816case $srcdir in
2817  .)  # We are building in place.
2818    ac_srcdir=.
2819    ac_top_srcdir=$ac_top_builddir_sub
2820    ac_abs_top_srcdir=$ac_pwd ;;
2821  [\\/]* | ?:[\\/]* )  # Absolute name.
2822    ac_srcdir=$srcdir$ac_dir_suffix;
2823    ac_top_srcdir=$srcdir
2824    ac_abs_top_srcdir=$srcdir ;;
2825  *) # Relative name.
2826    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
2827    ac_top_srcdir=$ac_top_build_prefix$srcdir
2828    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
2829esac
2830ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
2831
2832    cd "$ac_dir" || { ac_status=$?; continue; }
2833    # Check for guested configure.
2834    if test -f "$ac_srcdir/configure.gnu"; then
2835      echo &&
2836      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
2837    elif test -f "$ac_srcdir/configure"; then
2838      echo &&
2839      $SHELL "$ac_srcdir/configure" --help=recursive
2840    else
2841      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
2842    fi || ac_status=$?
2843    cd "$ac_pwd" || { ac_status=$?; break; }
2844  done
2845fi
2846
2847test -n "$ac_init_help" && exit $ac_status
2848if $ac_init_version; then
2849  cat <<\_ACEOF
2850GNU coreutils configure 8.30
2851generated by GNU Autoconf 2.69
2852
2853Copyright (C) 2012 Free Software Foundation, Inc.
2854This configure script is free software; the Free Software Foundation
2855gives unlimited permission to copy, distribute and modify it.
2856_ACEOF
2857  exit
2858fi
2859
2860## ------------------------ ##
2861## Autoconf initialization. ##
2862## ------------------------ ##
2863
2864# ac_fn_c_try_compile LINENO
2865# --------------------------
2866# Try to compile conftest.$ac_ext, and return whether this succeeded.
2867ac_fn_c_try_compile ()
2868{
2869  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2870  rm -f conftest.$ac_objext
2871  if { { ac_try="$ac_compile"
2872case "(($ac_try" in
2873  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2874  *) ac_try_echo=$ac_try;;
2875esac
2876eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2877$as_echo "$ac_try_echo"; } >&5
2878  (eval "$ac_compile") 2>conftest.err
2879  ac_status=$?
2880  if test -s conftest.err; then
2881    grep -v '^ *+' conftest.err >conftest.er1
2882    cat conftest.er1 >&5
2883    mv -f conftest.er1 conftest.err
2884  fi
2885  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2886  test $ac_status = 0; } && {
2887	 test -z "$ac_c_werror_flag" ||
2888	 test ! -s conftest.err
2889       } && test -s conftest.$ac_objext; then :
2890  ac_retval=0
2891else
2892  $as_echo "$as_me: failed program was:" >&5
2893sed 's/^/| /' conftest.$ac_ext >&5
2894
2895	ac_retval=1
2896fi
2897  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2898  as_fn_set_status $ac_retval
2899
2900} # ac_fn_c_try_compile
2901
2902# ac_fn_c_try_cpp LINENO
2903# ----------------------
2904# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
2905ac_fn_c_try_cpp ()
2906{
2907  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2908  if { { ac_try="$ac_cpp conftest.$ac_ext"
2909case "(($ac_try" in
2910  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2911  *) ac_try_echo=$ac_try;;
2912esac
2913eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2914$as_echo "$ac_try_echo"; } >&5
2915  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
2916  ac_status=$?
2917  if test -s conftest.err; then
2918    grep -v '^ *+' conftest.err >conftest.er1
2919    cat conftest.er1 >&5
2920    mv -f conftest.er1 conftest.err
2921  fi
2922  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2923  test $ac_status = 0; } > conftest.i && {
2924	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
2925	 test ! -s conftest.err
2926       }; then :
2927  ac_retval=0
2928else
2929  $as_echo "$as_me: failed program was:" >&5
2930sed 's/^/| /' conftest.$ac_ext >&5
2931
2932    ac_retval=1
2933fi
2934  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2935  as_fn_set_status $ac_retval
2936
2937} # ac_fn_c_try_cpp
2938
2939# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
2940# -------------------------------------------------------
2941# Tests whether HEADER exists, giving a warning if it cannot be compiled using
2942# the include files in INCLUDES and setting the cache variable VAR
2943# accordingly.
2944ac_fn_c_check_header_mongrel ()
2945{
2946  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2947  if eval \${$3+:} false; then :
2948  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2949$as_echo_n "checking for $2... " >&6; }
2950if eval \${$3+:} false; then :
2951  $as_echo_n "(cached) " >&6
2952fi
2953eval ac_res=\$$3
2954	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2955$as_echo "$ac_res" >&6; }
2956else
2957  # Is the header compilable?
2958{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
2959$as_echo_n "checking $2 usability... " >&6; }
2960cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2961/* end confdefs.h.  */
2962$4
2963#include <$2>
2964_ACEOF
2965if ac_fn_c_try_compile "$LINENO"; then :
2966  ac_header_compiler=yes
2967else
2968  ac_header_compiler=no
2969fi
2970rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2971{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
2972$as_echo "$ac_header_compiler" >&6; }
2973
2974# Is the header present?
2975{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
2976$as_echo_n "checking $2 presence... " >&6; }
2977cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2978/* end confdefs.h.  */
2979#include <$2>
2980_ACEOF
2981if ac_fn_c_try_cpp "$LINENO"; then :
2982  ac_header_preproc=yes
2983else
2984  ac_header_preproc=no
2985fi
2986rm -f conftest.err conftest.i conftest.$ac_ext
2987{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
2988$as_echo "$ac_header_preproc" >&6; }
2989
2990# So?  What about this header?
2991case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
2992  yes:no: )
2993    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
2994$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
2995    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2996$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2997    ;;
2998  no:yes:* )
2999    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
3000$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
3001    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
3002$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
3003    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
3004$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
3005    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
3006$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
3007    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
3008$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
3009( $as_echo "## ------------------------------------ ##
3010## Report this to bug-coreutils@gnu.org ##
3011## ------------------------------------ ##"
3012     ) | sed "s/^/$as_me: WARNING:     /" >&2
3013    ;;
3014esac
3015  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
3016$as_echo_n "checking for $2... " >&6; }
3017if eval \${$3+:} false; then :
3018  $as_echo_n "(cached) " >&6
3019else
3020  eval "$3=\$ac_header_compiler"
3021fi
3022eval ac_res=\$$3
3023	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3024$as_echo "$ac_res" >&6; }
3025fi
3026  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3027
3028} # ac_fn_c_check_header_mongrel
3029
3030# ac_fn_c_try_run LINENO
3031# ----------------------
3032# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
3033# that executables *can* be run.
3034ac_fn_c_try_run ()
3035{
3036  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3037  if { { ac_try="$ac_link"
3038case "(($ac_try" in
3039  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3040  *) ac_try_echo=$ac_try;;
3041esac
3042eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3043$as_echo "$ac_try_echo"; } >&5
3044  (eval "$ac_link") 2>&5
3045  ac_status=$?
3046  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3047  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
3048  { { case "(($ac_try" in
3049  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3050  *) ac_try_echo=$ac_try;;
3051esac
3052eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3053$as_echo "$ac_try_echo"; } >&5
3054  (eval "$ac_try") 2>&5
3055  ac_status=$?
3056  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3057  test $ac_status = 0; }; }; then :
3058  ac_retval=0
3059else
3060  $as_echo "$as_me: program exited with status $ac_status" >&5
3061       $as_echo "$as_me: failed program was:" >&5
3062sed 's/^/| /' conftest.$ac_ext >&5
3063
3064       ac_retval=$ac_status
3065fi
3066  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
3067  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3068  as_fn_set_status $ac_retval
3069
3070} # ac_fn_c_try_run
3071
3072# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
3073# -------------------------------------------------------
3074# Tests whether HEADER exists and can be compiled using the include files in
3075# INCLUDES, setting the cache variable VAR accordingly.
3076ac_fn_c_check_header_compile ()
3077{
3078  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3079  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
3080$as_echo_n "checking for $2... " >&6; }
3081if eval \${$3+:} false; then :
3082  $as_echo_n "(cached) " >&6
3083else
3084  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3085/* end confdefs.h.  */
3086$4
3087#include <$2>
3088_ACEOF
3089if ac_fn_c_try_compile "$LINENO"; then :
3090  eval "$3=yes"
3091else
3092  eval "$3=no"
3093fi
3094rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3095fi
3096eval ac_res=\$$3
3097	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3098$as_echo "$ac_res" >&6; }
3099  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3100
3101} # ac_fn_c_check_header_compile
3102
3103# ac_fn_c_try_link LINENO
3104# -----------------------
3105# Try to link conftest.$ac_ext, and return whether this succeeded.
3106ac_fn_c_try_link ()
3107{
3108  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3109  rm -f conftest.$ac_objext conftest$ac_exeext
3110  if { { ac_try="$ac_link"
3111case "(($ac_try" in
3112  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3113  *) ac_try_echo=$ac_try;;
3114esac
3115eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3116$as_echo "$ac_try_echo"; } >&5
3117  (eval "$ac_link") 2>conftest.err
3118  ac_status=$?
3119  if test -s conftest.err; then
3120    grep -v '^ *+' conftest.err >conftest.er1
3121    cat conftest.er1 >&5
3122    mv -f conftest.er1 conftest.err
3123  fi
3124  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3125  test $ac_status = 0; } && {
3126	 test -z "$ac_c_werror_flag" ||
3127	 test ! -s conftest.err
3128       } && test -s conftest$ac_exeext && {
3129	 test "$cross_compiling" = yes ||
3130	 test -x conftest$ac_exeext
3131       }; then :
3132  ac_retval=0
3133else
3134  $as_echo "$as_me: failed program was:" >&5
3135sed 's/^/| /' conftest.$ac_ext >&5
3136
3137	ac_retval=1
3138fi
3139  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
3140  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
3141  # interfere with the next link command; also delete a directory that is
3142  # left behind by Apple's compiler.  We do this before executing the actions.
3143  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
3144  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3145  as_fn_set_status $ac_retval
3146
3147} # ac_fn_c_try_link
3148
3149# ac_fn_c_check_func LINENO FUNC VAR
3150# ----------------------------------
3151# Tests whether FUNC exists, setting the cache variable VAR accordingly
3152ac_fn_c_check_func ()
3153{
3154  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3155  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
3156$as_echo_n "checking for $2... " >&6; }
3157if eval \${$3+:} false; then :
3158  $as_echo_n "(cached) " >&6
3159else
3160  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3161/* end confdefs.h.  */
3162/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
3163   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
3164#define $2 innocuous_$2
3165
3166/* System header to define __stub macros and hopefully few prototypes,
3167    which can conflict with char $2 (); below.
3168    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3169    <limits.h> exists even on freestanding compilers.  */
3170
3171#ifdef __STDC__
3172# include <limits.h>
3173#else
3174# include <assert.h>
3175#endif
3176
3177#undef $2
3178
3179/* Override any GCC internal prototype to avoid an error.
3180   Use char because int might match the return type of a GCC
3181   builtin and then its argument prototype would still apply.  */
3182#ifdef __cplusplus
3183extern "C"
3184#endif
3185char $2 ();
3186/* The GNU C library defines this for functions which it implements
3187    to always fail with ENOSYS.  Some functions are actually named
3188    something starting with __ and the normal name is an alias.  */
3189#if defined __stub_$2 || defined __stub___$2
3190choke me
3191#endif
3192
3193int
3194main ()
3195{
3196return $2 ();
3197  ;
3198  return 0;
3199}
3200_ACEOF
3201if ac_fn_c_try_link "$LINENO"; then :
3202  eval "$3=yes"
3203else
3204  eval "$3=no"
3205fi
3206rm -f core conftest.err conftest.$ac_objext \
3207    conftest$ac_exeext conftest.$ac_ext
3208fi
3209eval ac_res=\$$3
3210	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3211$as_echo "$ac_res" >&6; }
3212  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3213
3214} # ac_fn_c_check_func
3215
3216# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
3217# -------------------------------------------
3218# Tests whether TYPE exists after having included INCLUDES, setting cache
3219# variable VAR accordingly.
3220ac_fn_c_check_type ()
3221{
3222  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3223  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
3224$as_echo_n "checking for $2... " >&6; }
3225if eval \${$3+:} false; then :
3226  $as_echo_n "(cached) " >&6
3227else
3228  eval "$3=no"
3229  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3230/* end confdefs.h.  */
3231$4
3232int
3233main ()
3234{
3235if (sizeof ($2))
3236	 return 0;
3237  ;
3238  return 0;
3239}
3240_ACEOF
3241if ac_fn_c_try_compile "$LINENO"; then :
3242  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3243/* end confdefs.h.  */
3244$4
3245int
3246main ()
3247{
3248if (sizeof (($2)))
3249	    return 0;
3250  ;
3251  return 0;
3252}
3253_ACEOF
3254if ac_fn_c_try_compile "$LINENO"; then :
3255
3256else
3257  eval "$3=yes"
3258fi
3259rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3260fi
3261rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3262fi
3263eval ac_res=\$$3
3264	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3265$as_echo "$ac_res" >&6; }
3266  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3267
3268} # ac_fn_c_check_type
3269
3270# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
3271# ----------------------------------------------------
3272# Tries to find if the field MEMBER exists in type AGGR, after including
3273# INCLUDES, setting cache variable VAR accordingly.
3274ac_fn_c_check_member ()
3275{
3276  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3277  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
3278$as_echo_n "checking for $2.$3... " >&6; }
3279if eval \${$4+:} false; then :
3280  $as_echo_n "(cached) " >&6
3281else
3282  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3283/* end confdefs.h.  */
3284$5
3285int
3286main ()
3287{
3288static $2 ac_aggr;
3289if (ac_aggr.$3)
3290return 0;
3291  ;
3292  return 0;
3293}
3294_ACEOF
3295if ac_fn_c_try_compile "$LINENO"; then :
3296  eval "$4=yes"
3297else
3298  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3299/* end confdefs.h.  */
3300$5
3301int
3302main ()
3303{
3304static $2 ac_aggr;
3305if (sizeof ac_aggr.$3)
3306return 0;
3307  ;
3308  return 0;
3309}
3310_ACEOF
3311if ac_fn_c_try_compile "$LINENO"; then :
3312  eval "$4=yes"
3313else
3314  eval "$4=no"
3315fi
3316rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3317fi
3318rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3319fi
3320eval ac_res=\$$4
3321	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3322$as_echo "$ac_res" >&6; }
3323  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3324
3325} # ac_fn_c_check_member
3326
3327# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
3328# ---------------------------------------------
3329# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
3330# accordingly.
3331ac_fn_c_check_decl ()
3332{
3333  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3334  as_decl_name=`echo $2|sed 's/ *(.*//'`
3335  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
3336  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
3337$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
3338if eval \${$3+:} false; then :
3339  $as_echo_n "(cached) " >&6
3340else
3341  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3342/* end confdefs.h.  */
3343$4
3344int
3345main ()
3346{
3347#ifndef $as_decl_name
3348#ifdef __cplusplus
3349  (void) $as_decl_use;
3350#else
3351  (void) $as_decl_name;
3352#endif
3353#endif
3354
3355  ;
3356  return 0;
3357}
3358_ACEOF
3359if ac_fn_c_try_compile "$LINENO"; then :
3360  eval "$3=yes"
3361else
3362  eval "$3=no"
3363fi
3364rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3365fi
3366eval ac_res=\$$3
3367	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
3368$as_echo "$ac_res" >&6; }
3369  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3370
3371} # ac_fn_c_check_decl
3372
3373# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
3374# --------------------------------------------
3375# Tries to find the compile-time value of EXPR in a program that includes
3376# INCLUDES, setting VAR accordingly. Returns whether the value could be
3377# computed
3378ac_fn_c_compute_int ()
3379{
3380  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
3381  if test "$cross_compiling" = yes; then
3382    # Depending upon the size, compute the lo and hi bounds.
3383cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3384/* end confdefs.h.  */
3385$4
3386int
3387main ()
3388{
3389static int test_array [1 - 2 * !(($2) >= 0)];
3390test_array [0] = 0;
3391return test_array [0];
3392
3393  ;
3394  return 0;
3395}
3396_ACEOF
3397if ac_fn_c_try_compile "$LINENO"; then :
3398  ac_lo=0 ac_mid=0
3399  while :; do
3400    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3401/* end confdefs.h.  */
3402$4
3403int
3404main ()
3405{
3406static int test_array [1 - 2 * !(($2) <= $ac_mid)];
3407test_array [0] = 0;
3408return test_array [0];
3409
3410  ;
3411  return 0;
3412}
3413_ACEOF
3414if ac_fn_c_try_compile "$LINENO"; then :
3415  ac_hi=$ac_mid; break
3416else
3417  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
3418			if test $ac_lo -le $ac_mid; then
3419			  ac_lo= ac_hi=
3420			  break
3421			fi
3422			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
3423fi
3424rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3425  done
3426else
3427  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3428/* end confdefs.h.  */
3429$4
3430int
3431main ()
3432{
3433static int test_array [1 - 2 * !(($2) < 0)];
3434test_array [0] = 0;
3435return test_array [0];
3436
3437  ;
3438  return 0;
3439}
3440_ACEOF
3441if ac_fn_c_try_compile "$LINENO"; then :
3442  ac_hi=-1 ac_mid=-1
3443  while :; do
3444    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3445/* end confdefs.h.  */
3446$4
3447int
3448main ()
3449{
3450static int test_array [1 - 2 * !(($2) >= $ac_mid)];
3451test_array [0] = 0;
3452return test_array [0];
3453
3454  ;
3455  return 0;
3456}
3457_ACEOF
3458if ac_fn_c_try_compile "$LINENO"; then :
3459  ac_lo=$ac_mid; break
3460else
3461  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
3462			if test $ac_mid -le $ac_hi; then
3463			  ac_lo= ac_hi=
3464			  break
3465			fi
3466			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
3467fi
3468rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3469  done
3470else
3471  ac_lo= ac_hi=
3472fi
3473rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3474fi
3475rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3476# Binary search between lo and hi bounds.
3477while test "x$ac_lo" != "x$ac_hi"; do
3478  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
3479  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3480/* end confdefs.h.  */
3481$4
3482int
3483main ()
3484{
3485static int test_array [1 - 2 * !(($2) <= $ac_mid)];
3486test_array [0] = 0;
3487return test_array [0];
3488
3489  ;
3490  return 0;
3491}
3492_ACEOF
3493if ac_fn_c_try_compile "$LINENO"; then :
3494  ac_hi=$ac_mid
3495else
3496  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
3497fi
3498rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3499done
3500case $ac_lo in #((
3501?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
3502'') ac_retval=1 ;;
3503esac
3504  else
3505    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3506/* end confdefs.h.  */
3507$4
3508static long int longval () { return $2; }
3509static unsigned long int ulongval () { return $2; }
3510#include <stdio.h>
3511#include <stdlib.h>
3512int
3513main ()
3514{
3515
3516  FILE *f = fopen ("conftest.val", "w");
3517  if (! f)
3518    return 1;
3519  if (($2) < 0)
3520    {
3521      long int i = longval ();
3522      if (i != ($2))
3523	return 1;
3524      fprintf (f, "%ld", i);
3525    }
3526  else
3527    {
3528      unsigned long int i = ulongval ();
3529      if (i != ($2))
3530	return 1;
3531      fprintf (f, "%lu", i);
3532    }
3533  /* Do not output a trailing newline, as this causes \r\n confusion
3534     on some platforms.  */
3535  return ferror (f) || fclose (f) != 0;
3536
3537  ;
3538  return 0;
3539}
3540_ACEOF
3541if ac_fn_c_try_run "$LINENO"; then :
3542  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
3543else
3544  ac_retval=1
3545fi
3546rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
3547  conftest.$ac_objext conftest.beam conftest.$ac_ext
3548rm -f conftest.val
3549
3550  fi
3551  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
3552  as_fn_set_status $ac_retval
3553
3554} # ac_fn_c_compute_int
3555cat >config.log <<_ACEOF
3556This file contains any messages produced by compilers while
3557running configure, to aid debugging if configure makes a mistake.
3558
3559It was created by GNU coreutils $as_me 8.30, which was
3560generated by GNU Autoconf 2.69.  Invocation command line was
3561
3562  $ $0 $@
3563
3564_ACEOF
3565exec 5>>config.log
3566{
3567cat <<_ASUNAME
3568## --------- ##
3569## Platform. ##
3570## --------- ##
3571
3572hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
3573uname -m = `(uname -m) 2>/dev/null || echo unknown`
3574uname -r = `(uname -r) 2>/dev/null || echo unknown`
3575uname -s = `(uname -s) 2>/dev/null || echo unknown`
3576uname -v = `(uname -v) 2>/dev/null || echo unknown`
3577
3578/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
3579/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
3580
3581/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
3582/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
3583/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
3584/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
3585/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
3586/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
3587/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
3588
3589_ASUNAME
3590
3591as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3592for as_dir in $PATH
3593do
3594  IFS=$as_save_IFS
3595  test -z "$as_dir" && as_dir=.
3596    $as_echo "PATH: $as_dir"
3597  done
3598IFS=$as_save_IFS
3599
3600} >&5
3601
3602cat >&5 <<_ACEOF
3603
3604
3605## ----------- ##
3606## Core tests. ##
3607## ----------- ##
3608
3609_ACEOF
3610
3611
3612# Keep a trace of the command line.
3613# Strip out --no-create and --no-recursion so they do not pile up.
3614# Strip out --silent because we don't want to record it for future runs.
3615# Also quote any args containing shell meta-characters.
3616# Make two passes to allow for proper duplicate-argument suppression.
3617ac_configure_args=
3618ac_configure_args0=
3619ac_configure_args1=
3620ac_must_keep_next=false
3621for ac_pass in 1 2
3622do
3623  for ac_arg
3624  do
3625    case $ac_arg in
3626    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
3627    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
3628    | -silent | --silent | --silen | --sile | --sil)
3629      continue ;;
3630    *\'*)
3631      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
3632    esac
3633    case $ac_pass in
3634    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
3635    2)
3636      as_fn_append ac_configure_args1 " '$ac_arg'"
3637      if test $ac_must_keep_next = true; then
3638	ac_must_keep_next=false # Got value, back to normal.
3639      else
3640	case $ac_arg in
3641	  *=* | --config-cache | -C | -disable-* | --disable-* \
3642	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
3643	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
3644	  | -with-* | --with-* | -without-* | --without-* | --x)
3645	    case "$ac_configure_args0 " in
3646	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
3647	    esac
3648	    ;;
3649	  -* ) ac_must_keep_next=true ;;
3650	esac
3651      fi
3652      as_fn_append ac_configure_args " '$ac_arg'"
3653      ;;
3654    esac
3655  done
3656done
3657{ ac_configure_args0=; unset ac_configure_args0;}
3658{ ac_configure_args1=; unset ac_configure_args1;}
3659
3660# When interrupted or exit'd, cleanup temporary files, and complete
3661# config.log.  We remove comments because anyway the quotes in there
3662# would cause problems or look ugly.
3663# WARNING: Use '\'' to represent an apostrophe within the trap.
3664# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
3665trap 'exit_status=$?
3666  # Save into config.log some information that might help in debugging.
3667  {
3668    echo
3669
3670    $as_echo "## ---------------- ##
3671## Cache variables. ##
3672## ---------------- ##"
3673    echo
3674    # The following way of writing the cache mishandles newlines in values,
3675(
3676  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
3677    eval ac_val=\$$ac_var
3678    case $ac_val in #(
3679    *${as_nl}*)
3680      case $ac_var in #(
3681      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
3682$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
3683      esac
3684      case $ac_var in #(
3685      _ | IFS | as_nl) ;; #(
3686      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
3687      *) { eval $ac_var=; unset $ac_var;} ;;
3688      esac ;;
3689    esac
3690  done
3691  (set) 2>&1 |
3692    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
3693    *${as_nl}ac_space=\ *)
3694      sed -n \
3695	"s/'\''/'\''\\\\'\'''\''/g;
3696	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
3697      ;; #(
3698    *)
3699      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
3700      ;;
3701    esac |
3702    sort
3703)
3704    echo
3705
3706    $as_echo "## ----------------- ##
3707## Output variables. ##
3708## ----------------- ##"
3709    echo
3710    for ac_var in $ac_subst_vars
3711    do
3712      eval ac_val=\$$ac_var
3713      case $ac_val in
3714      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3715      esac
3716      $as_echo "$ac_var='\''$ac_val'\''"
3717    done | sort
3718    echo
3719
3720    if test -n "$ac_subst_files"; then
3721      $as_echo "## ------------------- ##
3722## File substitutions. ##
3723## ------------------- ##"
3724      echo
3725      for ac_var in $ac_subst_files
3726      do
3727	eval ac_val=\$$ac_var
3728	case $ac_val in
3729	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
3730	esac
3731	$as_echo "$ac_var='\''$ac_val'\''"
3732      done | sort
3733      echo
3734    fi
3735
3736    if test -s confdefs.h; then
3737      $as_echo "## ----------- ##
3738## confdefs.h. ##
3739## ----------- ##"
3740      echo
3741      cat confdefs.h
3742      echo
3743    fi
3744    test "$ac_signal" != 0 &&
3745      $as_echo "$as_me: caught signal $ac_signal"
3746    $as_echo "$as_me: exit $exit_status"
3747  } >&5
3748  rm -f core *.core core.conftest.* &&
3749    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
3750    exit $exit_status
3751' 0
3752for ac_signal in 1 2 13 15; do
3753  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
3754done
3755ac_signal=0
3756
3757# confdefs.h avoids OS command line length limits that DEFS can exceed.
3758rm -f -r conftest* confdefs.h
3759
3760$as_echo "/* confdefs.h */" > confdefs.h
3761
3762# Predefined preprocessor variables.
3763
3764cat >>confdefs.h <<_ACEOF
3765#define PACKAGE_NAME "$PACKAGE_NAME"
3766_ACEOF
3767
3768cat >>confdefs.h <<_ACEOF
3769#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
3770_ACEOF
3771
3772cat >>confdefs.h <<_ACEOF
3773#define PACKAGE_VERSION "$PACKAGE_VERSION"
3774_ACEOF
3775
3776cat >>confdefs.h <<_ACEOF
3777#define PACKAGE_STRING "$PACKAGE_STRING"
3778_ACEOF
3779
3780cat >>confdefs.h <<_ACEOF
3781#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
3782_ACEOF
3783
3784cat >>confdefs.h <<_ACEOF
3785#define PACKAGE_URL "$PACKAGE_URL"
3786_ACEOF
3787
3788
3789# Let the site file select an alternate cache file if it wants to.
3790# Prefer an explicitly selected file to automatically selected ones.
3791ac_site_file1=NONE
3792ac_site_file2=NONE
3793if test -n "$CONFIG_SITE"; then
3794  # We do not want a PATH search for config.site.
3795  case $CONFIG_SITE in #((
3796    -*)  ac_site_file1=./$CONFIG_SITE;;
3797    */*) ac_site_file1=$CONFIG_SITE;;
3798    *)   ac_site_file1=./$CONFIG_SITE;;
3799  esac
3800elif test "x$prefix" != xNONE; then
3801  ac_site_file1=$prefix/share/config.site
3802  ac_site_file2=$prefix/etc/config.site
3803else
3804  ac_site_file1=$ac_default_prefix/share/config.site
3805  ac_site_file2=$ac_default_prefix/etc/config.site
3806fi
3807for ac_site_file in "$ac_site_file1" "$ac_site_file2"
3808do
3809  test "x$ac_site_file" = xNONE && continue
3810  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
3811    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
3812$as_echo "$as_me: loading site script $ac_site_file" >&6;}
3813    sed 's/^/| /' "$ac_site_file" >&5
3814    . "$ac_site_file" \
3815      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3816$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3817as_fn_error $? "failed to load site script $ac_site_file
3818See \`config.log' for more details" "$LINENO" 5; }
3819  fi
3820done
3821
3822if test -r "$cache_file"; then
3823  # Some versions of bash will fail to source /dev/null (special files
3824  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
3825  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
3826    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
3827$as_echo "$as_me: loading cache $cache_file" >&6;}
3828    case $cache_file in
3829      [\\/]* | ?:[\\/]* ) . "$cache_file";;
3830      *)                      . "./$cache_file";;
3831    esac
3832  fi
3833else
3834  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
3835$as_echo "$as_me: creating cache $cache_file" >&6;}
3836  >$cache_file
3837fi
3838
3839as_fn_append ac_func_list " fchmod"
3840as_fn_append ac_header_list " arpa/inet.h"
3841as_fn_append ac_header_list " features.h"
3842as_fn_append ac_func_list " pathconf"
3843as_fn_append ac_func_list " btowc"
3844as_fn_append ac_header_list " xlocale.h"
3845as_fn_append ac_func_list " canonicalize_file_name"
3846as_fn_append ac_func_list " realpath"
3847as_fn_append ac_func_list " readlinkat"
3848as_fn_append ac_header_list " unistd.h"
3849as_fn_append ac_header_list " sys/param.h"
3850as_fn_append ac_func_list " chown"
3851as_fn_append ac_func_list " fchown"
3852as_fn_append ac_func_list " _set_invalid_parameter_handler"
3853as_fn_append ac_header_list " sys/socket.h"
3854as_fn_append ac_func_list " fchdir"
3855as_fn_append ac_header_list " dirent.h"
3856as_fn_append ac_func_list " fdopendir"
3857as_fn_append ac_func_list " faccessat"
3858as_fn_append ac_func_list " explicit_bzero"
3859as_fn_append ac_func_list " posix_fadvise"
3860as_fn_append ac_func_list " fchmodat"
3861as_fn_append ac_func_list " lchmod"
3862as_fn_append ac_func_list " fcntl"
3863as_fn_append ac_func_list " symlink"
3864as_fn_append ac_func_list " mempcpy"
3865as_fn_append ac_func_list " isblank"
3866as_fn_append ac_func_list " iswctype"
3867as_fn_append ac_func_list " mbsrtowcs"
3868as_fn_append ac_func_list " wmemchr"
3869as_fn_append ac_func_list " wmemcpy"
3870as_fn_append ac_func_list " wmempcpy"
3871as_fn_append ac_header_list " wctype.h"
3872gl_fnmatch_required=GNU
3873as_fn_append ac_header_list " stdio_ext.h"
3874as_fn_append ac_func_list " fpurge"
3875as_fn_append ac_func_list " __fpurge"
3876as_fn_append ac_func_list " __freadahead"
3877as_fn_append ac_func_list " __freading"
3878as_fn_append ac_func_list " __freadptr"
3879as_fn_append ac_func_list " __freadptrinc"
3880as_fn_append ac_func_list " __fseterr"
3881as_fn_append ac_header_list " sys/stat.h"
3882as_fn_append ac_func_list " fstatat"
3883as_fn_append ac_header_list " sys/vfs.h"
3884as_fn_append ac_header_list " sys/fs_types.h"
3885as_fn_append ac_func_list " fsync"
3886as_fn_append ac_func_list " strtof"
3887as_fn_append ac_func_list " ftruncate"
3888as_fn_append ac_func_list " openat"
3889as_fn_append ac_func_list " fstatfs"
3890as_fn_append ac_func_list " futimens"
3891as_fn_append ac_header_list " netdb.h"
3892as_fn_append ac_header_list " netinet/in.h"
3893as_fn_append ac_func_list " getdelim"
3894as_fn_append ac_func_list " getdtablesize"
3895as_fn_append ac_func_list " microuptime"
3896as_fn_append ac_func_list " nanouptime"
3897as_fn_append ac_func_list " getlogin"
3898as_fn_append ac_func_list " flockfile"
3899as_fn_append ac_func_list " funlockfile"
3900gl_getopt_required=GNU
3901as_fn_append ac_header_list " getopt.h"
3902as_fn_append ac_header_list " sys/cdefs.h"
3903as_fn_append ac_header_list " termios.h"
3904as_fn_append ac_func_list " __fsetlocking"
3905as_fn_append ac_func_list " getprogname"
3906as_fn_append ac_func_list " getexecname"
3907as_fn_append ac_func_list " gettimeofday"
3908as_fn_append ac_func_list " nanotime"
3909as_fn_append ac_header_list " sys/time.h"
3910as_fn_append ac_header_list " grp.h"
3911as_fn_append ac_func_list " getusershell"
3912as_fn_append ac_header_list " iconv.h"
3913as_fn_append ac_header_list " limits.h"
3914as_fn_append ac_header_list " wchar.h"
3915as_fn_append ac_header_list " stdint.h"
3916as_fn_append ac_header_list " inttypes.h"
3917as_fn_append ac_func_list " iswcntrl"
3918as_fn_append ac_header_list " crtdefs.h"
3919as_fn_append ac_func_list " iswblank"
3920as_fn_append ac_header_list " langinfo.h"
3921as_fn_append ac_func_list " link"
3922as_fn_append ac_func_list " readlink"
3923as_fn_append ac_func_list " linkat"
3924as_fn_append ac_func_list " lstat"
3925as_fn_append ac_header_list " math.h"
3926as_fn_append ac_func_list " mbsinit"
3927as_fn_append ac_func_list " mbrtowc"
3928as_fn_append ac_func_list " mbrlen"
3929as_fn_append ac_func_list " mbslen"
3930as_fn_append ac_func_list " isascii"
3931as_fn_append ac_header_list " sys/mman.h"
3932as_fn_append ac_func_list " mprotect"
3933as_fn_append ac_func_list " getgrouplist"
3934as_fn_append ac_func_list " mknod"
3935as_fn_append ac_func_list " mkostemp"
3936as_fn_append ac_func_list " mkstemp"
3937as_fn_append ac_func_list " tzset"
3938as_fn_append ac_header_list " sys/statvfs.h"
3939as_fn_append ac_header_list " sys/types.h"
3940as_fn_append ac_header_list " sys/select.h"
3941as_fn_append ac_func_list " nl_langinfo"
3942as_fn_append ac_func_list " pipe"
3943as_fn_append ac_func_list " pipe2"
3944gl_printf_safe=yes
3945as_fn_append ac_header_list " priv.h"
3946as_fn_append ac_header_list " pthread.h"
3947as_fn_append ac_header_list " utmp.h"
3948as_fn_append ac_header_list " utmpx.h"
3949as_fn_append ac_func_list " utmpname"
3950as_fn_append ac_func_list " utmpxname"
3951as_fn_append ac_header_list " malloc.h"
3952as_fn_append ac_func_list " renameat"
3953as_fn_append ac_func_list " fpathconf"
3954as_fn_append ac_header_list " selinux/selinux.h"
3955as_fn_append ac_func_list " setenv"
3956as_fn_append ac_func_list " settimeofday"
3957as_fn_append ac_func_list " stime"
3958as_fn_append ac_func_list " sigaction"
3959as_fn_append ac_func_list " sigaltstack"
3960as_fn_append ac_func_list " siginterrupt"
3961as_fn_append ac_func_list " snprintf"
3962as_fn_append ac_func_list " stpncpy"
3963as_fn_append ac_func_list " strdup"
3964as_fn_append ac_func_list " strerror_r"
3965as_fn_append ac_func_list " __xpg_strerror_r"
3966as_fn_append ac_func_list " strndup"
3967as_fn_append ac_func_list " strtoimax"
3968as_fn_append ac_func_list " strtoumax"
3969as_fn_append ac_func_list " symlinkat"
3970as_fn_append ac_header_list " sys/ioctl.h"
3971as_fn_append ac_header_list " sys/resource.h"
3972as_fn_append ac_header_list " sys/uio.h"
3973as_fn_append ac_header_list " sys/utsname.h"
3974as_fn_append ac_header_list " sys/wait.h"
3975as_fn_append ac_func_list " localtime_r"
3976as_fn_append ac_func_list " timegm"
3977as_fn_append ac_func_list " unlinkat"
3978as_fn_append ac_func_list " utime"
3979as_fn_append ac_header_list " utime.h"
3980as_fn_append ac_func_list " futimes"
3981as_fn_append ac_func_list " futimesat"
3982as_fn_append ac_func_list " utimensat"
3983as_fn_append ac_func_list " lutimes"
3984as_fn_append ac_func_list " vasnprintf"
3985as_fn_append ac_func_list " wcrtomb"
3986as_fn_append ac_func_list " wcwidth"
3987as_fn_append ac_func_list " wcswidth"
3988as_fn_append ac_func_list " getegid"
3989as_fn_append ac_func_list " getrusage"
3990as_fn_append ac_func_list " newlocale"
3991as_fn_append ac_header_list " semaphore.h"
3992as_fn_append ac_func_list " pthread_sigmask"
3993as_fn_append ac_func_list " sleep"
3994as_fn_append ac_func_list " catgets"
3995as_fn_append ac_func_list " shutdown"
3996as_fn_append ac_func_list " usleep"
3997as_fn_append ac_func_list " wctob"
3998as_fn_append ac_header_list " hurd.h"
3999as_fn_append ac_header_list " linux/falloc.h"
4000as_fn_append ac_header_list " linux/fs.h"
4001as_fn_append ac_header_list " paths.h"
4002as_fn_append ac_header_list " stropts.h"
4003as_fn_append ac_header_list " sys/mtio.h"
4004as_fn_append ac_header_list " sys/systeminfo.h"
4005as_fn_append ac_header_list " syslog.h"
4006as_fn_append ac_header_list " pwd.h"
4007as_fn_append ac_func_list " directio"
4008as_fn_append ac_func_list " setrlimit"
4009as_fn_append ac_func_list " prctl"
4010as_fn_append ac_func_list " endgrent"
4011as_fn_append ac_func_list " endpwent"
4012as_fn_append ac_func_list " fallocate"
4013as_fn_append ac_func_list " iswspace"
4014as_fn_append ac_func_list " mkfifo"
4015as_fn_append ac_func_list " setgroups"
4016as_fn_append ac_func_list " sethostname"
4017as_fn_append ac_func_list " sync"
4018as_fn_append ac_func_list " syncfs"
4019as_fn_append ac_func_list " sysctl"
4020as_fn_append ac_func_list " sysinfo"
4021as_fn_append ac_func_list " tcgetpgrp"
4022as_fn_append ac_func_list " getgrgid_nomembers"
4023as_fn_append ac_func_list " getgrnam_nomembers"
4024as_fn_append ac_func_list " getgrent_nomembers"
4025as_fn_append ac_header_list " OS.h"
4026as_fn_append ac_header_list " gmp.h"
4027gt_needs="$gt_needs need-formatstring-macros"
4028# Check that the precious variables saved in the cache have kept the same
4029# value.
4030ac_cache_corrupted=false
4031for ac_var in $ac_precious_vars; do
4032  eval ac_old_set=\$ac_cv_env_${ac_var}_set
4033  eval ac_new_set=\$ac_env_${ac_var}_set
4034  eval ac_old_val=\$ac_cv_env_${ac_var}_value
4035  eval ac_new_val=\$ac_env_${ac_var}_value
4036  case $ac_old_set,$ac_new_set in
4037    set,)
4038      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
4039$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
4040      ac_cache_corrupted=: ;;
4041    ,set)
4042      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
4043$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
4044      ac_cache_corrupted=: ;;
4045    ,);;
4046    *)
4047      if test "x$ac_old_val" != "x$ac_new_val"; then
4048	# differences in whitespace do not lead to failure.
4049	ac_old_val_w=`echo x $ac_old_val`
4050	ac_new_val_w=`echo x $ac_new_val`
4051	if test "$ac_old_val_w" != "$ac_new_val_w"; then
4052	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
4053$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
4054	  ac_cache_corrupted=:
4055	else
4056	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
4057$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
4058	  eval $ac_var=\$ac_old_val
4059	fi
4060	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
4061$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
4062	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
4063$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
4064      fi;;
4065  esac
4066  # Pass precious variables to config.status.
4067  if test "$ac_new_set" = set; then
4068    case $ac_new_val in
4069    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
4070    *) ac_arg=$ac_var=$ac_new_val ;;
4071    esac
4072    case " $ac_configure_args " in
4073      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
4074      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
4075    esac
4076  fi
4077done
4078if $ac_cache_corrupted; then
4079  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4080$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4081  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
4082$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
4083  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
4084fi
4085## -------------------- ##
4086## Main body of script. ##
4087## -------------------- ##
4088
4089ac_ext=c
4090ac_cpp='$CPP $CPPFLAGS'
4091ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4092ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4093ac_compiler_gnu=$ac_cv_c_compiler_gnu
4094
4095
4096
4097
4098
4099ac_aux_dir=
4100for ac_dir in build-aux "$srcdir"/build-aux; do
4101  if test -f "$ac_dir/install-sh"; then
4102    ac_aux_dir=$ac_dir
4103    ac_install_sh="$ac_aux_dir/install-sh -c"
4104    break
4105  elif test -f "$ac_dir/install.sh"; then
4106    ac_aux_dir=$ac_dir
4107    ac_install_sh="$ac_aux_dir/install.sh -c"
4108    break
4109  elif test -f "$ac_dir/shtool"; then
4110    ac_aux_dir=$ac_dir
4111    ac_install_sh="$ac_aux_dir/shtool install -c"
4112    break
4113  fi
4114done
4115if test -z "$ac_aux_dir"; then
4116  as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
4117fi
4118
4119# These three variables are undocumented and unsupported,
4120# and are intended to be withdrawn in a future Autoconf release.
4121# They can cause serious problems if a builder's source tree is in a directory
4122# whose full name contains unusual characters.
4123ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
4124ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
4125ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
4126
4127
4128ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin"
4129
4130
4131am__api_version='1.15'
4132
4133# Find a good install program.  We prefer a C program (faster),
4134# so one script is as good as another.  But avoid the broken or
4135# incompatible versions:
4136# SysV /etc/install, /usr/sbin/install
4137# SunOS /usr/etc/install
4138# IRIX /sbin/install
4139# AIX /bin/install
4140# AmigaOS /C/install, which installs bootblocks on floppy discs
4141# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
4142# AFS /usr/afsws/bin/install, which mishandles nonexistent args
4143# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
4144# OS/2's system install, which has a completely different semantic
4145# ./install, which can be erroneously created by make from ./install.sh.
4146# Reject install programs that cannot install multiple files.
4147{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
4148$as_echo_n "checking for a BSD-compatible install... " >&6; }
4149if test -z "$INSTALL"; then
4150if ${ac_cv_path_install+:} false; then :
4151  $as_echo_n "(cached) " >&6
4152else
4153  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4154for as_dir in $PATH
4155do
4156  IFS=$as_save_IFS
4157  test -z "$as_dir" && as_dir=.
4158    # Account for people who put trailing slashes in PATH elements.
4159case $as_dir/ in #((
4160  ./ | .// | /[cC]/* | \
4161  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
4162  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
4163  /usr/ucb/* ) ;;
4164  *)
4165    # OSF1 and SCO ODT 3.0 have their own names for install.
4166    # Don't use installbsd from OSF since it installs stuff as root
4167    # by default.
4168    for ac_prog in ginstall scoinst install; do
4169      for ac_exec_ext in '' $ac_executable_extensions; do
4170	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
4171	  if test $ac_prog = install &&
4172	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
4173	    # AIX install.  It has an incompatible calling convention.
4174	    :
4175	  elif test $ac_prog = install &&
4176	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
4177	    # program-specific install script used by HP pwplus--don't use.
4178	    :
4179	  else
4180	    rm -rf conftest.one conftest.two conftest.dir
4181	    echo one > conftest.one
4182	    echo two > conftest.two
4183	    mkdir conftest.dir
4184	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
4185	      test -s conftest.one && test -s conftest.two &&
4186	      test -s conftest.dir/conftest.one &&
4187	      test -s conftest.dir/conftest.two
4188	    then
4189	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
4190	      break 3
4191	    fi
4192	  fi
4193	fi
4194      done
4195    done
4196    ;;
4197esac
4198
4199  done
4200IFS=$as_save_IFS
4201
4202rm -rf conftest.one conftest.two conftest.dir
4203
4204fi
4205  if test "${ac_cv_path_install+set}" = set; then
4206    INSTALL=$ac_cv_path_install
4207  else
4208    # As a last resort, use the slow shell script.  Don't cache a
4209    # value for INSTALL within a source directory, because that will
4210    # break other packages using the cache if that directory is
4211    # removed, or if the value is a relative name.
4212    INSTALL=$ac_install_sh
4213  fi
4214fi
4215{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
4216$as_echo "$INSTALL" >&6; }
4217
4218# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
4219# It thinks the first close brace ends the variable substitution.
4220test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
4221
4222test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
4223
4224test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
4225
4226{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
4227$as_echo_n "checking whether build environment is sane... " >&6; }
4228# Reject unsafe characters in $srcdir or the absolute working directory
4229# name.  Accept space and tab only in the latter.
4230am_lf='
4231'
4232case `pwd` in
4233  *[\\\"\#\$\&\'\`$am_lf]*)
4234    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
4235esac
4236case $srcdir in
4237  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
4238    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
4239esac
4240
4241# Do 'set' in a subshell so we don't clobber the current shell's
4242# arguments.  Must try -L first in case configure is actually a
4243# symlink; some systems play weird games with the mod time of symlinks
4244# (eg FreeBSD returns the mod time of the symlink's containing
4245# directory).
4246if (
4247   am_has_slept=no
4248   for am_try in 1 2; do
4249     echo "timestamp, slept: $am_has_slept" > conftest.file
4250     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
4251     if test "$*" = "X"; then
4252	# -L didn't work.
4253	set X `ls -t "$srcdir/configure" conftest.file`
4254     fi
4255     if test "$*" != "X $srcdir/configure conftest.file" \
4256	&& test "$*" != "X conftest.file $srcdir/configure"; then
4257
4258	# If neither matched, then we have a broken ls.  This can happen
4259	# if, for instance, CONFIG_SHELL is bash and it inherits a
4260	# broken ls alias from the environment.  This has actually
4261	# happened.  Such a system could not be considered "sane".
4262	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
4263  alias in your environment" "$LINENO" 5
4264     fi
4265     if test "$2" = conftest.file || test $am_try -eq 2; then
4266       break
4267     fi
4268     # Just in case.
4269     sleep 1
4270     am_has_slept=yes
4271   done
4272   test "$2" = conftest.file
4273   )
4274then
4275   # Ok.
4276   :
4277else
4278   as_fn_error $? "newly created file is older than distributed files!
4279Check your system clock" "$LINENO" 5
4280fi
4281{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4282$as_echo "yes" >&6; }
4283# If we didn't sleep, we still need to ensure time stamps of config.status and
4284# generated files are strictly newer.
4285am_sleep_pid=
4286if grep 'slept: no' conftest.file >/dev/null 2>&1; then
4287  ( sleep 1 ) &
4288  am_sleep_pid=$!
4289fi
4290
4291rm -f conftest.file
4292
4293test "$program_prefix" != NONE &&
4294  program_transform_name="s&^&$program_prefix&;$program_transform_name"
4295# Use a double $ so make ignores it.
4296test "$program_suffix" != NONE &&
4297  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
4298# Double any \ or $.
4299# By default was `s,x,x', remove it if useless.
4300ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
4301program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
4302
4303# Expand $ac_aux_dir to an absolute path.
4304am_aux_dir=`cd "$ac_aux_dir" && pwd`
4305
4306if test x"${MISSING+set}" != xset; then
4307  case $am_aux_dir in
4308  *\ * | *\	*)
4309    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
4310  *)
4311    MISSING="\${SHELL} $am_aux_dir/missing" ;;
4312  esac
4313fi
4314# Use eval to expand $SHELL
4315if eval "$MISSING --is-lightweight"; then
4316  am_missing_run="$MISSING "
4317else
4318  am_missing_run=
4319  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
4320$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
4321fi
4322
4323if test x"${install_sh+set}" != xset; then
4324  case $am_aux_dir in
4325  *\ * | *\	*)
4326    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
4327  *)
4328    install_sh="\${SHELL} $am_aux_dir/install-sh"
4329  esac
4330fi
4331
4332# Installed binaries are usually stripped using 'strip' when the user
4333# run "make install-strip".  However 'strip' might not be the right
4334# tool to use in cross-compilation environments, therefore Automake
4335# will honor the 'STRIP' environment variable to overrule this program.
4336if test "$cross_compiling" != no; then
4337  if test -n "$ac_tool_prefix"; then
4338  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4339set dummy ${ac_tool_prefix}strip; ac_word=$2
4340{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4341$as_echo_n "checking for $ac_word... " >&6; }
4342if ${ac_cv_prog_STRIP+:} false; then :
4343  $as_echo_n "(cached) " >&6
4344else
4345  if test -n "$STRIP"; then
4346  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4347else
4348as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4349for as_dir in $PATH
4350do
4351  IFS=$as_save_IFS
4352  test -z "$as_dir" && as_dir=.
4353    for ac_exec_ext in '' $ac_executable_extensions; do
4354  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4355    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4356    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4357    break 2
4358  fi
4359done
4360  done
4361IFS=$as_save_IFS
4362
4363fi
4364fi
4365STRIP=$ac_cv_prog_STRIP
4366if test -n "$STRIP"; then
4367  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
4368$as_echo "$STRIP" >&6; }
4369else
4370  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4371$as_echo "no" >&6; }
4372fi
4373
4374
4375fi
4376if test -z "$ac_cv_prog_STRIP"; then
4377  ac_ct_STRIP=$STRIP
4378  # Extract the first word of "strip", so it can be a program name with args.
4379set dummy strip; ac_word=$2
4380{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4381$as_echo_n "checking for $ac_word... " >&6; }
4382if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
4383  $as_echo_n "(cached) " >&6
4384else
4385  if test -n "$ac_ct_STRIP"; then
4386  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
4387else
4388as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4389for as_dir in $PATH
4390do
4391  IFS=$as_save_IFS
4392  test -z "$as_dir" && as_dir=.
4393    for ac_exec_ext in '' $ac_executable_extensions; do
4394  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4395    ac_cv_prog_ac_ct_STRIP="strip"
4396    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4397    break 2
4398  fi
4399done
4400  done
4401IFS=$as_save_IFS
4402
4403fi
4404fi
4405ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
4406if test -n "$ac_ct_STRIP"; then
4407  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
4408$as_echo "$ac_ct_STRIP" >&6; }
4409else
4410  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4411$as_echo "no" >&6; }
4412fi
4413
4414  if test "x$ac_ct_STRIP" = x; then
4415    STRIP=":"
4416  else
4417    case $cross_compiling:$ac_tool_warned in
4418yes:)
4419{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4420$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4421ac_tool_warned=yes ;;
4422esac
4423    STRIP=$ac_ct_STRIP
4424  fi
4425else
4426  STRIP="$ac_cv_prog_STRIP"
4427fi
4428
4429fi
4430INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
4431
4432{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
4433$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
4434if test -z "$MKDIR_P"; then
4435  if ${ac_cv_path_mkdir+:} false; then :
4436  $as_echo_n "(cached) " >&6
4437else
4438  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4439for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
4440do
4441  IFS=$as_save_IFS
4442  test -z "$as_dir" && as_dir=.
4443    for ac_prog in mkdir gmkdir; do
4444	 for ac_exec_ext in '' $ac_executable_extensions; do
4445	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
4446	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
4447	     'mkdir (GNU coreutils) '* | \
4448	     'mkdir (coreutils) '* | \
4449	     'mkdir (fileutils) '4.1*)
4450	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
4451	       break 3;;
4452	   esac
4453	 done
4454       done
4455  done
4456IFS=$as_save_IFS
4457
4458fi
4459
4460  test -d ./--version && rmdir ./--version
4461  if test "${ac_cv_path_mkdir+set}" = set; then
4462    MKDIR_P="$ac_cv_path_mkdir -p"
4463  else
4464    # As a last resort, use the slow shell script.  Don't cache a
4465    # value for MKDIR_P within a source directory, because that will
4466    # break other packages using the cache if that directory is
4467    # removed, or if the value is a relative name.
4468    MKDIR_P="$ac_install_sh -d"
4469  fi
4470fi
4471{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
4472$as_echo "$MKDIR_P" >&6; }
4473
4474for ac_prog in gawk mawk nawk awk
4475do
4476  # Extract the first word of "$ac_prog", so it can be a program name with args.
4477set dummy $ac_prog; ac_word=$2
4478{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4479$as_echo_n "checking for $ac_word... " >&6; }
4480if ${ac_cv_prog_AWK+:} false; then :
4481  $as_echo_n "(cached) " >&6
4482else
4483  if test -n "$AWK"; then
4484  ac_cv_prog_AWK="$AWK" # Let the user override the test.
4485else
4486as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4487for as_dir in $PATH
4488do
4489  IFS=$as_save_IFS
4490  test -z "$as_dir" && as_dir=.
4491    for ac_exec_ext in '' $ac_executable_extensions; do
4492  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4493    ac_cv_prog_AWK="$ac_prog"
4494    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4495    break 2
4496  fi
4497done
4498  done
4499IFS=$as_save_IFS
4500
4501fi
4502fi
4503AWK=$ac_cv_prog_AWK
4504if test -n "$AWK"; then
4505  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
4506$as_echo "$AWK" >&6; }
4507else
4508  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4509$as_echo "no" >&6; }
4510fi
4511
4512
4513  test -n "$AWK" && break
4514done
4515
4516{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
4517$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
4518set x ${MAKE-make}
4519ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
4520if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
4521  $as_echo_n "(cached) " >&6
4522else
4523  cat >conftest.make <<\_ACEOF
4524SHELL = /bin/sh
4525all:
4526	@echo '@@@%%%=$(MAKE)=@@@%%%'
4527_ACEOF
4528# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
4529case `${MAKE-make} -f conftest.make 2>/dev/null` in
4530  *@@@%%%=?*=@@@%%%*)
4531    eval ac_cv_prog_make_${ac_make}_set=yes;;
4532  *)
4533    eval ac_cv_prog_make_${ac_make}_set=no;;
4534esac
4535rm -f conftest.make
4536fi
4537if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
4538  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4539$as_echo "yes" >&6; }
4540  SET_MAKE=
4541else
4542  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4543$as_echo "no" >&6; }
4544  SET_MAKE="MAKE=${MAKE-make}"
4545fi
4546
4547rm -rf .tst 2>/dev/null
4548mkdir .tst 2>/dev/null
4549if test -d .tst; then
4550  am__leading_dot=.
4551else
4552  am__leading_dot=_
4553fi
4554rmdir .tst 2>/dev/null
4555
4556# Check whether --enable-silent-rules was given.
4557if test "${enable_silent_rules+set}" = set; then :
4558  enableval=$enable_silent_rules;
4559fi
4560
4561case $enable_silent_rules in # (((
4562  yes) AM_DEFAULT_VERBOSITY=0;;
4563   no) AM_DEFAULT_VERBOSITY=1;;
4564    *) AM_DEFAULT_VERBOSITY=1;;
4565esac
4566am_make=${MAKE-make}
4567{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
4568$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
4569if ${am_cv_make_support_nested_variables+:} false; then :
4570  $as_echo_n "(cached) " >&6
4571else
4572  if $as_echo 'TRUE=$(BAR$(V))
4573BAR0=false
4574BAR1=true
4575V=1
4576am__doit:
4577	@$(TRUE)
4578.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
4579  am_cv_make_support_nested_variables=yes
4580else
4581  am_cv_make_support_nested_variables=no
4582fi
4583fi
4584{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
4585$as_echo "$am_cv_make_support_nested_variables" >&6; }
4586if test $am_cv_make_support_nested_variables = yes; then
4587    AM_V='$(V)'
4588  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
4589else
4590  AM_V=$AM_DEFAULT_VERBOSITY
4591  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
4592fi
4593AM_BACKSLASH='\'
4594
4595if test "`cd $srcdir && pwd`" != "`pwd`"; then
4596  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4597  # is not polluted with repeated "-I."
4598  am__isrc=' -I$(srcdir)'
4599  # test to see if srcdir already configured
4600  if test -f $srcdir/config.status; then
4601    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
4602  fi
4603fi
4604
4605# test whether we have cygpath
4606if test -z "$CYGPATH_W"; then
4607  if (cygpath --version) >/dev/null 2>/dev/null; then
4608    CYGPATH_W='cygpath -w'
4609  else
4610    CYGPATH_W=echo
4611  fi
4612fi
4613
4614
4615# Define the identity of the package.
4616 PACKAGE='coreutils'
4617 VERSION='8.30'
4618
4619
4620cat >>confdefs.h <<_ACEOF
4621#define PACKAGE "$PACKAGE"
4622_ACEOF
4623
4624
4625cat >>confdefs.h <<_ACEOF
4626#define VERSION "$VERSION"
4627_ACEOF
4628
4629# Some tools Automake needs.
4630
4631ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
4632
4633
4634AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
4635
4636
4637AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
4638
4639
4640AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
4641
4642
4643MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
4644
4645# For better backward compatibility.  To be removed once Automake 1.9.x
4646# dies out for good.  For more background, see:
4647# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
4648# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
4649mkdir_p='$(MKDIR_P)'
4650
4651# We need awk for the "check" target (and possibly the TAP driver).  The
4652# system "awk" is bad on some platforms.
4653# Always define AMTAR for backward compatibility.  Yes, it's still used
4654# in the wild :-(  We should find a proper way to deprecate it ...
4655AMTAR='$${TAR-tar}'
4656
4657
4658# We'll loop over all known methods to create a tar archive until one works.
4659_am_tools='gnutar  pax cpio none'
4660
4661am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
4662
4663
4664
4665
4666
4667
4668# POSIX will say in a future version that running "rm -f" with no argument
4669# is OK; and we want to be able to make that assumption in our Makefile
4670# recipes.  So use an aggressive probe to check that the usage we want is
4671# actually supported "in the wild" to an acceptable degree.
4672# See automake bug#10828.
4673# To make any issue more visible, cause the running configure to be aborted
4674# by default if the 'rm' program in use doesn't match our expectations; the
4675# user can still override this though.
4676if rm -f && rm -fr && rm -rf; then : OK; else
4677  cat >&2 <<'END'
4678Oops!
4679
4680Your 'rm' program seems unable to run without file operands specified
4681on the command line, even when the '-f' option is present.  This is contrary
4682to the behaviour of most rm programs out there, and not conforming with
4683the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
4684
4685Please tell bug-automake@gnu.org about your system, including the value
4686of your $PATH and any error possibly output before this message.  This
4687can help us improve future automake versions.
4688
4689END
4690  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
4691    echo 'Configuration will proceed anyway, since you have set the' >&2
4692    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
4693    echo >&2
4694  else
4695    cat >&2 <<'END'
4696Aborting the configuration process, to ensure you take notice of the issue.
4697
4698You can download and install GNU coreutils to get an 'rm' implementation
4699that behaves properly: <http://www.gnu.org/software/coreutils/>.
4700
4701If you want to complete the configuration process using your problematic
4702'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
4703to "yes", and re-run configure.
4704
4705END
4706    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
4707  fi
4708fi
4709
4710# Check whether --enable-silent-rules was given.
4711if test "${enable_silent_rules+set}" = set; then :
4712  enableval=$enable_silent_rules;
4713fi
4714
4715case $enable_silent_rules in # (((
4716  yes) AM_DEFAULT_VERBOSITY=0;;
4717   no) AM_DEFAULT_VERBOSITY=1;;
4718    *) AM_DEFAULT_VERBOSITY=0;;
4719esac
4720am_make=${MAKE-make}
4721{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
4722$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
4723if ${am_cv_make_support_nested_variables+:} false; then :
4724  $as_echo_n "(cached) " >&6
4725else
4726  if $as_echo 'TRUE=$(BAR$(V))
4727BAR0=false
4728BAR1=true
4729V=1
4730am__doit:
4731	@$(TRUE)
4732.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
4733  am_cv_make_support_nested_variables=yes
4734else
4735  am_cv_make_support_nested_variables=no
4736fi
4737fi
4738{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
4739$as_echo "$am_cv_make_support_nested_variables" >&6; }
4740if test $am_cv_make_support_nested_variables = yes; then
4741    AM_V='$(V)'
4742  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
4743else
4744  AM_V=$AM_DEFAULT_VERBOSITY
4745  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
4746fi
4747AM_BACKSLASH='\'
4748 # make --enable-silent-rules the default.
4749
4750
4751
4752
4753
4754
4755DEPDIR="${am__leading_dot}deps"
4756
4757ac_config_commands="$ac_config_commands depfiles"
4758
4759
4760am_make=${MAKE-make}
4761cat > confinc << 'END'
4762am__doit:
4763	@echo this is the am__doit target
4764.PHONY: am__doit
4765END
4766# If we don't find an include directive, just comment out the code.
4767{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
4768$as_echo_n "checking for style of include used by $am_make... " >&6; }
4769am__include="#"
4770am__quote=
4771_am_result=none
4772# First try GNU make style include.
4773echo "include confinc" > confmf
4774# Ignore all kinds of additional output from 'make'.
4775case `$am_make -s -f confmf 2> /dev/null` in #(
4776*the\ am__doit\ target*)
4777  am__include=include
4778  am__quote=
4779  _am_result=GNU
4780  ;;
4781esac
4782# Now try BSD make style include.
4783if test "$am__include" = "#"; then
4784   echo '.include "confinc"' > confmf
4785   case `$am_make -s -f confmf 2> /dev/null` in #(
4786   *the\ am__doit\ target*)
4787     am__include=.include
4788     am__quote="\""
4789     _am_result=BSD
4790     ;;
4791   esac
4792fi
4793
4794
4795{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
4796$as_echo "$_am_result" >&6; }
4797rm -f confinc confmf
4798
4799# Check whether --enable-dependency-tracking was given.
4800if test "${enable_dependency_tracking+set}" = set; then :
4801  enableval=$enable_dependency_tracking;
4802fi
4803
4804if test "x$enable_dependency_tracking" != xno; then
4805  am_depcomp="$ac_aux_dir/depcomp"
4806  AMDEPBACKSLASH='\'
4807  am__nodep='_no'
4808fi
4809 if test "x$enable_dependency_tracking" != xno; then
4810  AMDEP_TRUE=
4811  AMDEP_FALSE='#'
4812else
4813  AMDEP_TRUE='#'
4814  AMDEP_FALSE=
4815fi
4816
4817
4818ac_ext=c
4819ac_cpp='$CPP $CPPFLAGS'
4820ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4821ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4822ac_compiler_gnu=$ac_cv_c_compiler_gnu
4823if test -n "$ac_tool_prefix"; then
4824  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
4825set dummy ${ac_tool_prefix}gcc; ac_word=$2
4826{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4827$as_echo_n "checking for $ac_word... " >&6; }
4828if ${ac_cv_prog_CC+:} false; then :
4829  $as_echo_n "(cached) " >&6
4830else
4831  if test -n "$CC"; then
4832  ac_cv_prog_CC="$CC" # Let the user override the test.
4833else
4834as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4835for as_dir in $PATH
4836do
4837  IFS=$as_save_IFS
4838  test -z "$as_dir" && as_dir=.
4839    for ac_exec_ext in '' $ac_executable_extensions; do
4840  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4841    ac_cv_prog_CC="${ac_tool_prefix}gcc"
4842    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4843    break 2
4844  fi
4845done
4846  done
4847IFS=$as_save_IFS
4848
4849fi
4850fi
4851CC=$ac_cv_prog_CC
4852if test -n "$CC"; then
4853  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4854$as_echo "$CC" >&6; }
4855else
4856  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4857$as_echo "no" >&6; }
4858fi
4859
4860
4861fi
4862if test -z "$ac_cv_prog_CC"; then
4863  ac_ct_CC=$CC
4864  # Extract the first word of "gcc", so it can be a program name with args.
4865set dummy gcc; ac_word=$2
4866{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4867$as_echo_n "checking for $ac_word... " >&6; }
4868if ${ac_cv_prog_ac_ct_CC+:} false; then :
4869  $as_echo_n "(cached) " >&6
4870else
4871  if test -n "$ac_ct_CC"; then
4872  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4873else
4874as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4875for as_dir in $PATH
4876do
4877  IFS=$as_save_IFS
4878  test -z "$as_dir" && as_dir=.
4879    for ac_exec_ext in '' $ac_executable_extensions; do
4880  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4881    ac_cv_prog_ac_ct_CC="gcc"
4882    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4883    break 2
4884  fi
4885done
4886  done
4887IFS=$as_save_IFS
4888
4889fi
4890fi
4891ac_ct_CC=$ac_cv_prog_ac_ct_CC
4892if test -n "$ac_ct_CC"; then
4893  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4894$as_echo "$ac_ct_CC" >&6; }
4895else
4896  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4897$as_echo "no" >&6; }
4898fi
4899
4900  if test "x$ac_ct_CC" = x; then
4901    CC=""
4902  else
4903    case $cross_compiling:$ac_tool_warned in
4904yes:)
4905{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4906$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4907ac_tool_warned=yes ;;
4908esac
4909    CC=$ac_ct_CC
4910  fi
4911else
4912  CC="$ac_cv_prog_CC"
4913fi
4914
4915if test -z "$CC"; then
4916          if test -n "$ac_tool_prefix"; then
4917    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
4918set dummy ${ac_tool_prefix}cc; ac_word=$2
4919{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4920$as_echo_n "checking for $ac_word... " >&6; }
4921if ${ac_cv_prog_CC+:} false; then :
4922  $as_echo_n "(cached) " >&6
4923else
4924  if test -n "$CC"; then
4925  ac_cv_prog_CC="$CC" # Let the user override the test.
4926else
4927as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4928for as_dir in $PATH
4929do
4930  IFS=$as_save_IFS
4931  test -z "$as_dir" && as_dir=.
4932    for ac_exec_ext in '' $ac_executable_extensions; do
4933  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4934    ac_cv_prog_CC="${ac_tool_prefix}cc"
4935    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4936    break 2
4937  fi
4938done
4939  done
4940IFS=$as_save_IFS
4941
4942fi
4943fi
4944CC=$ac_cv_prog_CC
4945if test -n "$CC"; then
4946  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4947$as_echo "$CC" >&6; }
4948else
4949  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4950$as_echo "no" >&6; }
4951fi
4952
4953
4954  fi
4955fi
4956if test -z "$CC"; then
4957  # Extract the first word of "cc", so it can be a program name with args.
4958set dummy cc; ac_word=$2
4959{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4960$as_echo_n "checking for $ac_word... " >&6; }
4961if ${ac_cv_prog_CC+:} false; then :
4962  $as_echo_n "(cached) " >&6
4963else
4964  if test -n "$CC"; then
4965  ac_cv_prog_CC="$CC" # Let the user override the test.
4966else
4967  ac_prog_rejected=no
4968as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4969for as_dir in $PATH
4970do
4971  IFS=$as_save_IFS
4972  test -z "$as_dir" && as_dir=.
4973    for ac_exec_ext in '' $ac_executable_extensions; do
4974  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4975    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
4976       ac_prog_rejected=yes
4977       continue
4978     fi
4979    ac_cv_prog_CC="cc"
4980    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4981    break 2
4982  fi
4983done
4984  done
4985IFS=$as_save_IFS
4986
4987if test $ac_prog_rejected = yes; then
4988  # We found a bogon in the path, so make sure we never use it.
4989  set dummy $ac_cv_prog_CC
4990  shift
4991  if test $# != 0; then
4992    # We chose a different compiler from the bogus one.
4993    # However, it has the same basename, so the bogon will be chosen
4994    # first if we set CC to just the basename; use the full file name.
4995    shift
4996    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
4997  fi
4998fi
4999fi
5000fi
5001CC=$ac_cv_prog_CC
5002if test -n "$CC"; then
5003  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
5004$as_echo "$CC" >&6; }
5005else
5006  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5007$as_echo "no" >&6; }
5008fi
5009
5010
5011fi
5012if test -z "$CC"; then
5013  if test -n "$ac_tool_prefix"; then
5014  for ac_prog in cl.exe
5015  do
5016    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5017set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5018{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5019$as_echo_n "checking for $ac_word... " >&6; }
5020if ${ac_cv_prog_CC+:} false; then :
5021  $as_echo_n "(cached) " >&6
5022else
5023  if test -n "$CC"; then
5024  ac_cv_prog_CC="$CC" # Let the user override the test.
5025else
5026as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5027for as_dir in $PATH
5028do
5029  IFS=$as_save_IFS
5030  test -z "$as_dir" && as_dir=.
5031    for ac_exec_ext in '' $ac_executable_extensions; do
5032  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5033    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
5034    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5035    break 2
5036  fi
5037done
5038  done
5039IFS=$as_save_IFS
5040
5041fi
5042fi
5043CC=$ac_cv_prog_CC
5044if test -n "$CC"; then
5045  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
5046$as_echo "$CC" >&6; }
5047else
5048  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5049$as_echo "no" >&6; }
5050fi
5051
5052
5053    test -n "$CC" && break
5054  done
5055fi
5056if test -z "$CC"; then
5057  ac_ct_CC=$CC
5058  for ac_prog in cl.exe
5059do
5060  # Extract the first word of "$ac_prog", so it can be a program name with args.
5061set dummy $ac_prog; ac_word=$2
5062{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5063$as_echo_n "checking for $ac_word... " >&6; }
5064if ${ac_cv_prog_ac_ct_CC+:} false; then :
5065  $as_echo_n "(cached) " >&6
5066else
5067  if test -n "$ac_ct_CC"; then
5068  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
5069else
5070as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5071for as_dir in $PATH
5072do
5073  IFS=$as_save_IFS
5074  test -z "$as_dir" && as_dir=.
5075    for ac_exec_ext in '' $ac_executable_extensions; do
5076  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5077    ac_cv_prog_ac_ct_CC="$ac_prog"
5078    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5079    break 2
5080  fi
5081done
5082  done
5083IFS=$as_save_IFS
5084
5085fi
5086fi
5087ac_ct_CC=$ac_cv_prog_ac_ct_CC
5088if test -n "$ac_ct_CC"; then
5089  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
5090$as_echo "$ac_ct_CC" >&6; }
5091else
5092  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5093$as_echo "no" >&6; }
5094fi
5095
5096
5097  test -n "$ac_ct_CC" && break
5098done
5099
5100  if test "x$ac_ct_CC" = x; then
5101    CC=""
5102  else
5103    case $cross_compiling:$ac_tool_warned in
5104yes:)
5105{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5106$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5107ac_tool_warned=yes ;;
5108esac
5109    CC=$ac_ct_CC
5110  fi
5111fi
5112
5113fi
5114if test -z "$CC"; then
5115  if test -n "$ac_tool_prefix"; then
5116  # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
5117set dummy ${ac_tool_prefix}clang; ac_word=$2
5118{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5119$as_echo_n "checking for $ac_word... " >&6; }
5120if ${ac_cv_prog_CC+:} false; then :
5121  $as_echo_n "(cached) " >&6
5122else
5123  if test -n "$CC"; then
5124  ac_cv_prog_CC="$CC" # Let the user override the test.
5125else
5126as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5127for as_dir in $PATH
5128do
5129  IFS=$as_save_IFS
5130  test -z "$as_dir" && as_dir=.
5131    for ac_exec_ext in '' $ac_executable_extensions; do
5132  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5133    ac_cv_prog_CC="${ac_tool_prefix}clang"
5134    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5135    break 2
5136  fi
5137done
5138  done
5139IFS=$as_save_IFS
5140
5141fi
5142fi
5143CC=$ac_cv_prog_CC
5144if test -n "$CC"; then
5145  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
5146$as_echo "$CC" >&6; }
5147else
5148  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5149$as_echo "no" >&6; }
5150fi
5151
5152
5153fi
5154if test -z "$ac_cv_prog_CC"; then
5155  ac_ct_CC=$CC
5156  # Extract the first word of "clang", so it can be a program name with args.
5157set dummy clang; ac_word=$2
5158{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5159$as_echo_n "checking for $ac_word... " >&6; }
5160if ${ac_cv_prog_ac_ct_CC+:} false; then :
5161  $as_echo_n "(cached) " >&6
5162else
5163  if test -n "$ac_ct_CC"; then
5164  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
5165else
5166as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5167for as_dir in $PATH
5168do
5169  IFS=$as_save_IFS
5170  test -z "$as_dir" && as_dir=.
5171    for ac_exec_ext in '' $ac_executable_extensions; do
5172  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5173    ac_cv_prog_ac_ct_CC="clang"
5174    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5175    break 2
5176  fi
5177done
5178  done
5179IFS=$as_save_IFS
5180
5181fi
5182fi
5183ac_ct_CC=$ac_cv_prog_ac_ct_CC
5184if test -n "$ac_ct_CC"; then
5185  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
5186$as_echo "$ac_ct_CC" >&6; }
5187else
5188  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5189$as_echo "no" >&6; }
5190fi
5191
5192  if test "x$ac_ct_CC" = x; then
5193    CC=""
5194  else
5195    case $cross_compiling:$ac_tool_warned in
5196yes:)
5197{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5198$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5199ac_tool_warned=yes ;;
5200esac
5201    CC=$ac_ct_CC
5202  fi
5203else
5204  CC="$ac_cv_prog_CC"
5205fi
5206
5207fi
5208
5209
5210test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5211$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5212as_fn_error $? "no acceptable C compiler found in \$PATH
5213See \`config.log' for more details" "$LINENO" 5; }
5214
5215# Provide some information about the compiler.
5216$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
5217set X $ac_compile
5218ac_compiler=$2
5219for ac_option in --version -v -V -qversion -version; do
5220  { { ac_try="$ac_compiler $ac_option >&5"
5221case "(($ac_try" in
5222  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5223  *) ac_try_echo=$ac_try;;
5224esac
5225eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
5226$as_echo "$ac_try_echo"; } >&5
5227  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
5228  ac_status=$?
5229  if test -s conftest.err; then
5230    sed '10a\
5231... rest of stderr output deleted ...
5232         10q' conftest.err >conftest.er1
5233    cat conftest.er1 >&5
5234  fi
5235  rm -f conftest.er1 conftest.err
5236  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5237  test $ac_status = 0; }
5238done
5239
5240cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5241/* end confdefs.h.  */
5242
5243int
5244main ()
5245{
5246
5247  ;
5248  return 0;
5249}
5250_ACEOF
5251ac_clean_files_save=$ac_clean_files
5252ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
5253# Try to create an executable without -o first, disregard a.out.
5254# It will help us diagnose broken compilers, and finding out an intuition
5255# of exeext.
5256{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
5257$as_echo_n "checking whether the C compiler works... " >&6; }
5258ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
5259
5260# The possible output files:
5261ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
5262
5263ac_rmfiles=
5264for ac_file in $ac_files
5265do
5266  case $ac_file in
5267    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
5268    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
5269  esac
5270done
5271rm -f $ac_rmfiles
5272
5273if { { ac_try="$ac_link_default"
5274case "(($ac_try" in
5275  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5276  *) ac_try_echo=$ac_try;;
5277esac
5278eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
5279$as_echo "$ac_try_echo"; } >&5
5280  (eval "$ac_link_default") 2>&5
5281  ac_status=$?
5282  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5283  test $ac_status = 0; }; then :
5284  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
5285# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
5286# in a Makefile.  We should not override ac_cv_exeext if it was cached,
5287# so that the user can short-circuit this test for compilers unknown to
5288# Autoconf.
5289for ac_file in $ac_files ''
5290do
5291  test -f "$ac_file" || continue
5292  case $ac_file in
5293    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
5294	;;
5295    [ab].out )
5296	# We found the default executable, but exeext='' is most
5297	# certainly right.
5298	break;;
5299    *.* )
5300	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
5301	then :; else
5302	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
5303	fi
5304	# We set ac_cv_exeext here because the later test for it is not
5305	# safe: cross compilers may not add the suffix if given an `-o'
5306	# argument, so we may need to know it at that point already.
5307	# Even if this section looks crufty: it has the advantage of
5308	# actually working.
5309	break;;
5310    * )
5311	break;;
5312  esac
5313done
5314test "$ac_cv_exeext" = no && ac_cv_exeext=
5315
5316else
5317  ac_file=''
5318fi
5319if test -z "$ac_file"; then :
5320  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5321$as_echo "no" >&6; }
5322$as_echo "$as_me: failed program was:" >&5
5323sed 's/^/| /' conftest.$ac_ext >&5
5324
5325{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5326$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5327as_fn_error 77 "C compiler cannot create executables
5328See \`config.log' for more details" "$LINENO" 5; }
5329else
5330  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5331$as_echo "yes" >&6; }
5332fi
5333{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
5334$as_echo_n "checking for C compiler default output file name... " >&6; }
5335{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
5336$as_echo "$ac_file" >&6; }
5337ac_exeext=$ac_cv_exeext
5338
5339rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
5340ac_clean_files=$ac_clean_files_save
5341{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
5342$as_echo_n "checking for suffix of executables... " >&6; }
5343if { { ac_try="$ac_link"
5344case "(($ac_try" in
5345  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5346  *) ac_try_echo=$ac_try;;
5347esac
5348eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
5349$as_echo "$ac_try_echo"; } >&5
5350  (eval "$ac_link") 2>&5
5351  ac_status=$?
5352  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5353  test $ac_status = 0; }; then :
5354  # If both `conftest.exe' and `conftest' are `present' (well, observable)
5355# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
5356# work properly (i.e., refer to `conftest.exe'), while it won't with
5357# `rm'.
5358for ac_file in conftest.exe conftest conftest.*; do
5359  test -f "$ac_file" || continue
5360  case $ac_file in
5361    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
5362    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
5363	  break;;
5364    * ) break;;
5365  esac
5366done
5367else
5368  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5369$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5370as_fn_error $? "cannot compute suffix of executables: cannot compile and link
5371See \`config.log' for more details" "$LINENO" 5; }
5372fi
5373rm -f conftest conftest$ac_cv_exeext
5374{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
5375$as_echo "$ac_cv_exeext" >&6; }
5376
5377rm -f conftest.$ac_ext
5378EXEEXT=$ac_cv_exeext
5379ac_exeext=$EXEEXT
5380cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5381/* end confdefs.h.  */
5382#include <stdio.h>
5383int
5384main ()
5385{
5386FILE *f = fopen ("conftest.out", "w");
5387 return ferror (f) || fclose (f) != 0;
5388
5389  ;
5390  return 0;
5391}
5392_ACEOF
5393ac_clean_files="$ac_clean_files conftest.out"
5394# Check that the compiler produces executables we can run.  If not, either
5395# the compiler is broken, or we cross compile.
5396{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
5397$as_echo_n "checking whether we are cross compiling... " >&6; }
5398if test "$cross_compiling" != yes; then
5399  { { ac_try="$ac_link"
5400case "(($ac_try" in
5401  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5402  *) ac_try_echo=$ac_try;;
5403esac
5404eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
5405$as_echo "$ac_try_echo"; } >&5
5406  (eval "$ac_link") 2>&5
5407  ac_status=$?
5408  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5409  test $ac_status = 0; }
5410  if { ac_try='./conftest$ac_cv_exeext'
5411  { { case "(($ac_try" in
5412  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5413  *) ac_try_echo=$ac_try;;
5414esac
5415eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
5416$as_echo "$ac_try_echo"; } >&5
5417  (eval "$ac_try") 2>&5
5418  ac_status=$?
5419  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5420  test $ac_status = 0; }; }; then
5421    cross_compiling=no
5422  else
5423    if test "$cross_compiling" = maybe; then
5424	cross_compiling=yes
5425    else
5426	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5427$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5428as_fn_error $? "cannot run C compiled programs.
5429If you meant to cross compile, use \`--host'.
5430See \`config.log' for more details" "$LINENO" 5; }
5431    fi
5432  fi
5433fi
5434{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
5435$as_echo "$cross_compiling" >&6; }
5436
5437rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
5438ac_clean_files=$ac_clean_files_save
5439{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
5440$as_echo_n "checking for suffix of object files... " >&6; }
5441if ${ac_cv_objext+:} false; then :
5442  $as_echo_n "(cached) " >&6
5443else
5444  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5445/* end confdefs.h.  */
5446
5447int
5448main ()
5449{
5450
5451  ;
5452  return 0;
5453}
5454_ACEOF
5455rm -f conftest.o conftest.obj
5456if { { ac_try="$ac_compile"
5457case "(($ac_try" in
5458  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5459  *) ac_try_echo=$ac_try;;
5460esac
5461eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
5462$as_echo "$ac_try_echo"; } >&5
5463  (eval "$ac_compile") 2>&5
5464  ac_status=$?
5465  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5466  test $ac_status = 0; }; then :
5467  for ac_file in conftest.o conftest.obj conftest.*; do
5468  test -f "$ac_file" || continue;
5469  case $ac_file in
5470    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
5471    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
5472       break;;
5473  esac
5474done
5475else
5476  $as_echo "$as_me: failed program was:" >&5
5477sed 's/^/| /' conftest.$ac_ext >&5
5478
5479{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5480$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5481as_fn_error $? "cannot compute suffix of object files: cannot compile
5482See \`config.log' for more details" "$LINENO" 5; }
5483fi
5484rm -f conftest.$ac_cv_objext conftest.$ac_ext
5485fi
5486{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
5487$as_echo "$ac_cv_objext" >&6; }
5488OBJEXT=$ac_cv_objext
5489ac_objext=$OBJEXT
5490{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
5491$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
5492if ${ac_cv_c_compiler_gnu+:} false; then :
5493  $as_echo_n "(cached) " >&6
5494else
5495  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5496/* end confdefs.h.  */
5497
5498int
5499main ()
5500{
5501#ifndef __GNUC__
5502       choke me
5503#endif
5504
5505  ;
5506  return 0;
5507}
5508_ACEOF
5509if ac_fn_c_try_compile "$LINENO"; then :
5510  ac_compiler_gnu=yes
5511else
5512  ac_compiler_gnu=no
5513fi
5514rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5515ac_cv_c_compiler_gnu=$ac_compiler_gnu
5516
5517fi
5518{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
5519$as_echo "$ac_cv_c_compiler_gnu" >&6; }
5520if test $ac_compiler_gnu = yes; then
5521  GCC=yes
5522else
5523  GCC=
5524fi
5525ac_test_CFLAGS=${CFLAGS+set}
5526ac_save_CFLAGS=$CFLAGS
5527{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
5528$as_echo_n "checking whether $CC accepts -g... " >&6; }
5529if ${ac_cv_prog_cc_g+:} false; then :
5530  $as_echo_n "(cached) " >&6
5531else
5532  ac_save_c_werror_flag=$ac_c_werror_flag
5533   ac_c_werror_flag=yes
5534   ac_cv_prog_cc_g=no
5535   CFLAGS="-g"
5536   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5537/* end confdefs.h.  */
5538
5539int
5540main ()
5541{
5542
5543  ;
5544  return 0;
5545}
5546_ACEOF
5547if ac_fn_c_try_compile "$LINENO"; then :
5548  ac_cv_prog_cc_g=yes
5549else
5550  CFLAGS=""
5551      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5552/* end confdefs.h.  */
5553
5554int
5555main ()
5556{
5557
5558  ;
5559  return 0;
5560}
5561_ACEOF
5562if ac_fn_c_try_compile "$LINENO"; then :
5563
5564else
5565  ac_c_werror_flag=$ac_save_c_werror_flag
5566	 CFLAGS="-g"
5567	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5568/* end confdefs.h.  */
5569
5570int
5571main ()
5572{
5573
5574  ;
5575  return 0;
5576}
5577_ACEOF
5578if ac_fn_c_try_compile "$LINENO"; then :
5579  ac_cv_prog_cc_g=yes
5580fi
5581rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5582fi
5583rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5584fi
5585rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5586   ac_c_werror_flag=$ac_save_c_werror_flag
5587fi
5588{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
5589$as_echo "$ac_cv_prog_cc_g" >&6; }
5590if test "$ac_test_CFLAGS" = set; then
5591  CFLAGS=$ac_save_CFLAGS
5592elif test $ac_cv_prog_cc_g = yes; then
5593  if test "$GCC" = yes; then
5594    CFLAGS="-g -O2"
5595  else
5596    CFLAGS="-g"
5597  fi
5598else
5599  if test "$GCC" = yes; then
5600    CFLAGS="-O2"
5601  else
5602    CFLAGS=
5603  fi
5604fi
5605{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
5606$as_echo_n "checking for $CC option to enable C11 features... " >&6; }
5607if ${ac_cv_prog_cc_c11+:} false; then :
5608  $as_echo_n "(cached) " >&6
5609else
5610  ac_cv_prog_cc_c11=no
5611ac_save_CC=$CC
5612cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5613/* end confdefs.h.  */
5614#include <stdarg.h>
5615#include <stdbool.h>
5616#include <stddef.h>
5617#include <stdlib.h>
5618#include <wchar.h>
5619#include <stdio.h>
5620
5621// Check varargs macros.  These examples are taken from C99 6.10.3.5.
5622#define debug(...) fprintf (stderr, __VA_ARGS__)
5623#define showlist(...) puts (#__VA_ARGS__)
5624#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
5625static void
5626test_varargs_macros (void)
5627{
5628  int x = 1234;
5629  int y = 5678;
5630  debug ("Flag");
5631  debug ("X = %d\n", x);
5632  showlist (The first, second, and third items.);
5633  report (x>y, "x is %d but y is %d", x, y);
5634}
5635
5636// Check long long types.
5637#define BIG64 18446744073709551615ull
5638#define BIG32 4294967295ul
5639#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
5640#if !BIG_OK
5641  your preprocessor is broken;
5642#endif
5643#if BIG_OK
5644#else
5645  your preprocessor is broken;
5646#endif
5647static long long int bignum = -9223372036854775807LL;
5648static unsigned long long int ubignum = BIG64;
5649
5650struct incomplete_array
5651{
5652  int datasize;
5653  double data[];
5654};
5655
5656struct named_init {
5657  int number;
5658  const wchar_t *name;
5659  double average;
5660};
5661
5662typedef const char *ccp;
5663
5664static inline int
5665test_restrict (ccp restrict text)
5666{
5667  // See if C++-style comments work.
5668  // Iterate through items via the restricted pointer.
5669  // Also check for declarations in for loops.
5670  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
5671    continue;
5672  return 0;
5673}
5674
5675// Check varargs and va_copy.
5676static bool
5677test_varargs (const char *format, ...)
5678{
5679  va_list args;
5680  va_start (args, format);
5681  va_list args_copy;
5682  va_copy (args_copy, args);
5683
5684  const char *str = "";
5685  int number = 0;
5686  float fnumber = 0;
5687
5688  while (*format)
5689    {
5690      switch (*format++)
5691	{
5692	case 's': // string
5693	  str = va_arg (args_copy, const char *);
5694	  break;
5695	case 'd': // int
5696	  number = va_arg (args_copy, int);
5697	  break;
5698	case 'f': // float
5699	  fnumber = va_arg (args_copy, double);
5700	  break;
5701	default:
5702	  break;
5703	}
5704    }
5705  va_end (args_copy);
5706  va_end (args);
5707
5708  return *str && number && fnumber;
5709}
5710// Check _Alignas.
5711char _Alignas (double) aligned_as_double;
5712char _Alignas (0) no_special_alignment;
5713extern char aligned_as_int;
5714char _Alignas (0) _Alignas (int) aligned_as_int;
5715
5716// Check _Alignof.
5717enum
5718{
5719  int_alignment = _Alignof (int),
5720  int_array_alignment = _Alignof (int[100]),
5721  char_alignment = _Alignof (char)
5722};
5723_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
5724
5725// Check _Noreturn.
5726int _Noreturn does_not_return (void) { for (;;) continue; }
5727
5728// Check _Static_assert.
5729struct test_static_assert
5730{
5731  int x;
5732  _Static_assert (sizeof (int) <= sizeof (long int),
5733                  "_Static_assert does not work in struct");
5734  long int y;
5735};
5736
5737// Check UTF-8 literals.
5738#define u8 syntax error!
5739char const utf8_literal[] = u8"happens to be ASCII" "another string";
5740
5741// Check duplicate typedefs.
5742typedef long *long_ptr;
5743typedef long int *long_ptr;
5744typedef long_ptr long_ptr;
5745
5746// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
5747struct anonymous
5748{
5749  union {
5750    struct { int i; int j; };
5751    struct { int k; long int l; } w;
5752  };
5753  int m;
5754} v1;
5755
5756int
5757main ()
5758{
5759
5760  // Check bool.
5761  _Bool success = false;
5762
5763  // Check restrict.
5764  if (test_restrict ("String literal") == 0)
5765    success = true;
5766  char *restrict newvar = "Another string";
5767
5768  // Check varargs.
5769  success &= test_varargs ("s, d' f .", "string", 65, 34.234);
5770  test_varargs_macros ();
5771
5772  // Check flexible array members.
5773  struct incomplete_array *ia =
5774    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
5775  ia->datasize = 10;
5776  for (int i = 0; i < ia->datasize; ++i)
5777    ia->data[i] = i * 1.234;
5778
5779  // Check named initializers.
5780  struct named_init ni = {
5781    .number = 34,
5782    .name = L"Test wide string",
5783    .average = 543.34343,
5784  };
5785
5786  ni.number = 58;
5787
5788  int dynamic_array[ni.number];
5789  dynamic_array[ni.number - 1] = 543;
5790
5791  // work around unused variable warnings
5792  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
5793	  || dynamic_array[ni.number - 1] != 543);
5794
5795  v1.i = 2;
5796  v1.w.k = 5;
5797  _Static_assert ((offsetof (struct anonymous, i)
5798		   == offsetof (struct anonymous, w.k)),
5799		  "Anonymous union alignment botch");
5800
5801  ;
5802  return 0;
5803}
5804_ACEOF
5805for ac_arg in '' -std=gnu11
5806do
5807  CC="$ac_save_CC $ac_arg"
5808  if ac_fn_c_try_compile "$LINENO"; then :
5809  ac_cv_prog_cc_c11=$ac_arg
5810fi
5811rm -f core conftest.err conftest.$ac_objext
5812  test "x$ac_cv_prog_cc_c11" != "xno" && break
5813done
5814rm -f conftest.$ac_ext
5815CC=$ac_save_CC
5816
5817fi
5818# AC_CACHE_VAL
5819ac_prog_cc_stdc_options=
5820case "x$ac_cv_prog_cc_c11" in
5821  x)
5822    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
5823$as_echo "none needed" >&6; } ;;
5824  xno)
5825    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
5826$as_echo "unsupported" >&6; } ;;
5827  *)
5828    ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11"
5829    CC=$CC$ac_prog_cc_stdc_options
5830    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
5831$as_echo "$ac_cv_prog_cc_c11" >&6; } ;;
5832esac
5833if test "x$ac_cv_prog_cc_c11" != xno; then :
5834  ac_prog_cc_stdc=c11
5835		 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
5836else
5837  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
5838$as_echo_n "checking for $CC option to enable C99 features... " >&6; }
5839if ${ac_cv_prog_cc_c99+:} false; then :
5840  $as_echo_n "(cached) " >&6
5841else
5842  ac_cv_prog_cc_c99=no
5843ac_save_CC=$CC
5844cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5845/* end confdefs.h.  */
5846#include <stdarg.h>
5847#include <stdbool.h>
5848#include <stddef.h>
5849#include <stdlib.h>
5850#include <wchar.h>
5851#include <stdio.h>
5852
5853// Check varargs macros.  These examples are taken from C99 6.10.3.5.
5854#define debug(...) fprintf (stderr, __VA_ARGS__)
5855#define showlist(...) puts (#__VA_ARGS__)
5856#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
5857static void
5858test_varargs_macros (void)
5859{
5860  int x = 1234;
5861  int y = 5678;
5862  debug ("Flag");
5863  debug ("X = %d\n", x);
5864  showlist (The first, second, and third items.);
5865  report (x>y, "x is %d but y is %d", x, y);
5866}
5867
5868// Check long long types.
5869#define BIG64 18446744073709551615ull
5870#define BIG32 4294967295ul
5871#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
5872#if !BIG_OK
5873  your preprocessor is broken;
5874#endif
5875#if BIG_OK
5876#else
5877  your preprocessor is broken;
5878#endif
5879static long long int bignum = -9223372036854775807LL;
5880static unsigned long long int ubignum = BIG64;
5881
5882struct incomplete_array
5883{
5884  int datasize;
5885  double data[];
5886};
5887
5888struct named_init {
5889  int number;
5890  const wchar_t *name;
5891  double average;
5892};
5893
5894typedef const char *ccp;
5895
5896static inline int
5897test_restrict (ccp restrict text)
5898{
5899  // See if C++-style comments work.
5900  // Iterate through items via the restricted pointer.
5901  // Also check for declarations in for loops.
5902  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
5903    continue;
5904  return 0;
5905}
5906
5907// Check varargs and va_copy.
5908static bool
5909test_varargs (const char *format, ...)
5910{
5911  va_list args;
5912  va_start (args, format);
5913  va_list args_copy;
5914  va_copy (args_copy, args);
5915
5916  const char *str = "";
5917  int number = 0;
5918  float fnumber = 0;
5919
5920  while (*format)
5921    {
5922      switch (*format++)
5923	{
5924	case 's': // string
5925	  str = va_arg (args_copy, const char *);
5926	  break;
5927	case 'd': // int
5928	  number = va_arg (args_copy, int);
5929	  break;
5930	case 'f': // float
5931	  fnumber = va_arg (args_copy, double);
5932	  break;
5933	default:
5934	  break;
5935	}
5936    }
5937  va_end (args_copy);
5938  va_end (args);
5939
5940  return *str && number && fnumber;
5941}
5942int
5943main ()
5944{
5945
5946  // Check bool.
5947  _Bool success = false;
5948
5949  // Check restrict.
5950  if (test_restrict ("String literal") == 0)
5951    success = true;
5952  char *restrict newvar = "Another string";
5953
5954  // Check varargs.
5955  success &= test_varargs ("s, d' f .", "string", 65, 34.234);
5956  test_varargs_macros ();
5957
5958  // Check flexible array members.
5959  struct incomplete_array *ia =
5960    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
5961  ia->datasize = 10;
5962  for (int i = 0; i < ia->datasize; ++i)
5963    ia->data[i] = i * 1.234;
5964
5965  // Check named initializers.
5966  struct named_init ni = {
5967    .number = 34,
5968    .name = L"Test wide string",
5969    .average = 543.34343,
5970  };
5971
5972  ni.number = 58;
5973
5974  int dynamic_array[ni.number];
5975  dynamic_array[ni.number - 1] = 543;
5976
5977  // work around unused variable warnings
5978  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
5979	  || dynamic_array[ni.number - 1] != 543);
5980
5981  ;
5982  return 0;
5983}
5984_ACEOF
5985for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99
5986do
5987  CC="$ac_save_CC $ac_arg"
5988  if ac_fn_c_try_compile "$LINENO"; then :
5989  ac_cv_prog_cc_c99=$ac_arg
5990fi
5991rm -f core conftest.err conftest.$ac_objext
5992  test "x$ac_cv_prog_cc_c99" != "xno" && break
5993done
5994rm -f conftest.$ac_ext
5995CC=$ac_save_CC
5996
5997fi
5998# AC_CACHE_VAL
5999ac_prog_cc_stdc_options=
6000case "x$ac_cv_prog_cc_c99" in
6001  x)
6002    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
6003$as_echo "none needed" >&6; } ;;
6004  xno)
6005    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
6006$as_echo "unsupported" >&6; } ;;
6007  *)
6008    ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99"
6009    CC=$CC$ac_prog_cc_stdc_options
6010    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
6011$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
6012esac
6013if test "x$ac_cv_prog_cc_c99" != xno; then :
6014  ac_prog_cc_stdc=c99
6015		    ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
6016else
6017  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
6018$as_echo_n "checking for $CC option to enable C89 features... " >&6; }
6019if ${ac_cv_prog_cc_c89+:} false; then :
6020  $as_echo_n "(cached) " >&6
6021else
6022  ac_cv_prog_cc_c89=no
6023ac_save_CC=$CC
6024cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6025/* end confdefs.h.  */
6026#include <stdarg.h>
6027#include <stdio.h>
6028struct stat;
6029/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
6030struct buf { int x; };
6031FILE * (*rcsopen) (struct buf *, struct stat *, int);
6032static char *e (p, i)
6033     char **p;
6034     int i;
6035{
6036  return p[i];
6037}
6038static char *f (char * (*g) (char **, int), char **p, ...)
6039{
6040  char *s;
6041  va_list v;
6042  va_start (v,p);
6043  s = g (p, va_arg (v,int));
6044  va_end (v);
6045  return s;
6046}
6047
6048/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
6049   function prototypes and stuff, but not '\xHH' hex character constants.
6050   These don't provoke an error unfortunately, instead are silently treated
6051   as 'x'.  The following induces an error, until -std is added to get
6052   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
6053   array size at least.  It's necessary to write '\x00'==0 to get something
6054   that's true only with -std.  */
6055int osf4_cc_array ['\x00' == 0 ? 1 : -1];
6056
6057/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
6058   inside strings and character constants.  */
6059#define FOO(x) 'x'
6060int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
6061
6062int test (int i, double x);
6063struct s1 {int (*f) (int a);};
6064struct s2 {int (*f) (double a);};
6065int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
6066int argc;
6067char **argv;
6068int
6069main ()
6070{
6071return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
6072  ;
6073  return 0;
6074}
6075_ACEOF
6076for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
6077	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
6078do
6079  CC="$ac_save_CC $ac_arg"
6080  if ac_fn_c_try_compile "$LINENO"; then :
6081  ac_cv_prog_cc_c89=$ac_arg
6082fi
6083rm -f core conftest.err conftest.$ac_objext
6084  test "x$ac_cv_prog_cc_c89" != "xno" && break
6085done
6086rm -f conftest.$ac_ext
6087CC=$ac_save_CC
6088
6089fi
6090# AC_CACHE_VAL
6091ac_prog_cc_stdc_options=
6092case "x$ac_cv_prog_cc_c89" in
6093  x)
6094    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
6095$as_echo "none needed" >&6; } ;;
6096  xno)
6097    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
6098$as_echo "unsupported" >&6; } ;;
6099  *)
6100    ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89"
6101    CC=$CC$ac_prog_cc_stdc_options
6102    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
6103$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
6104esac
6105if test "x$ac_cv_prog_cc_c89" != xno; then :
6106  ac_prog_cc_stdc=c89
6107		       ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
6108else
6109  ac_prog_cc_stdc=no
6110		       ac_cv_prog_cc_stdc=no
6111fi
6112
6113fi
6114
6115fi
6116
6117ac_ext=c
6118ac_cpp='$CPP $CPPFLAGS'
6119ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6120ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6121ac_compiler_gnu=$ac_cv_c_compiler_gnu
6122
6123depcc="$CC"   am_compiler_list=
6124
6125{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
6126$as_echo_n "checking dependency style of $depcc... " >&6; }
6127if ${am_cv_CC_dependencies_compiler_type+:} false; then :
6128  $as_echo_n "(cached) " >&6
6129else
6130  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
6131  # We make a subdir and do the tests there.  Otherwise we can end up
6132  # making bogus files that we don't know about and never remove.  For
6133  # instance it was reported that on HP-UX the gcc test will end up
6134  # making a dummy file named 'D' -- because '-MD' means "put the output
6135  # in D".
6136  rm -rf conftest.dir
6137  mkdir conftest.dir
6138  # Copy depcomp to subdir because otherwise we won't find it if we're
6139  # using a relative directory.
6140  cp "$am_depcomp" conftest.dir
6141  cd conftest.dir
6142  # We will build objects and dependencies in a subdirectory because
6143  # it helps to detect inapplicable dependency modes.  For instance
6144  # both Tru64's cc and ICC support -MD to output dependencies as a
6145  # side effect of compilation, but ICC will put the dependencies in
6146  # the current directory while Tru64 will put them in the object
6147  # directory.
6148  mkdir sub
6149
6150  am_cv_CC_dependencies_compiler_type=none
6151  if test "$am_compiler_list" = ""; then
6152     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
6153  fi
6154  am__universal=false
6155  case " $depcc " in #(
6156     *\ -arch\ *\ -arch\ *) am__universal=true ;;
6157     esac
6158
6159  for depmode in $am_compiler_list; do
6160    # Setup a source with many dependencies, because some compilers
6161    # like to wrap large dependency lists on column 80 (with \), and
6162    # we should not choose a depcomp mode which is confused by this.
6163    #
6164    # We need to recreate these files for each test, as the compiler may
6165    # overwrite some of them when testing with obscure command lines.
6166    # This happens at least with the AIX C compiler.
6167    : > sub/conftest.c
6168    for i in 1 2 3 4 5 6; do
6169      echo '#include "conftst'$i'.h"' >> sub/conftest.c
6170      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
6171      # Solaris 10 /bin/sh.
6172      echo '/* dummy */' > sub/conftst$i.h
6173    done
6174    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
6175
6176    # We check with '-c' and '-o' for the sake of the "dashmstdout"
6177    # mode.  It turns out that the SunPro C++ compiler does not properly
6178    # handle '-M -o', and we need to detect this.  Also, some Intel
6179    # versions had trouble with output in subdirs.
6180    am__obj=sub/conftest.${OBJEXT-o}
6181    am__minus_obj="-o $am__obj"
6182    case $depmode in
6183    gcc)
6184      # This depmode causes a compiler race in universal mode.
6185      test "$am__universal" = false || continue
6186      ;;
6187    nosideeffect)
6188      # After this tag, mechanisms are not by side-effect, so they'll
6189      # only be used when explicitly requested.
6190      if test "x$enable_dependency_tracking" = xyes; then
6191	continue
6192      else
6193	break
6194      fi
6195      ;;
6196    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
6197      # This compiler won't grok '-c -o', but also, the minuso test has
6198      # not run yet.  These depmodes are late enough in the game, and
6199      # so weak that their functioning should not be impacted.
6200      am__obj=conftest.${OBJEXT-o}
6201      am__minus_obj=
6202      ;;
6203    none) break ;;
6204    esac
6205    if depmode=$depmode \
6206       source=sub/conftest.c object=$am__obj \
6207       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
6208       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
6209         >/dev/null 2>conftest.err &&
6210       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
6211       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
6212       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
6213       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
6214      # icc doesn't choke on unknown options, it will just issue warnings
6215      # or remarks (even with -Werror).  So we grep stderr for any message
6216      # that says an option was ignored or not supported.
6217      # When given -MP, icc 7.0 and 7.1 complain thusly:
6218      #   icc: Command line warning: ignoring option '-M'; no argument required
6219      # The diagnosis changed in icc 8.0:
6220      #   icc: Command line remark: option '-MP' not supported
6221      if (grep 'ignoring option' conftest.err ||
6222          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
6223        am_cv_CC_dependencies_compiler_type=$depmode
6224        break
6225      fi
6226    fi
6227  done
6228
6229  cd ..
6230  rm -rf conftest.dir
6231else
6232  am_cv_CC_dependencies_compiler_type=none
6233fi
6234
6235fi
6236{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
6237$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
6238CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
6239
6240 if
6241  test "x$enable_dependency_tracking" != xno \
6242  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
6243  am__fastdepCC_TRUE=
6244  am__fastdepCC_FALSE='#'
6245else
6246  am__fastdepCC_TRUE='#'
6247  am__fastdepCC_FALSE=
6248fi
6249
6250
6251
6252
6253ac_ext=c
6254ac_cpp='$CPP $CPPFLAGS'
6255ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6256ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6257ac_compiler_gnu=$ac_cv_c_compiler_gnu
6258{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
6259$as_echo_n "checking how to run the C preprocessor... " >&6; }
6260# On Suns, sometimes $CPP names a directory.
6261if test -n "$CPP" && test -d "$CPP"; then
6262  CPP=
6263fi
6264if test -z "$CPP"; then
6265  if ${ac_cv_prog_CPP+:} false; then :
6266  $as_echo_n "(cached) " >&6
6267else
6268      # Double quotes because CPP needs to be expanded
6269    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
6270    do
6271      ac_preproc_ok=false
6272for ac_c_preproc_warn_flag in '' yes
6273do
6274  # Use a header file that comes with gcc, so configuring glibc
6275  # with a fresh cross-compiler works.
6276  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6277  # <limits.h> exists even on freestanding compilers.
6278  # On the NeXT, cc -E runs the code through the compiler's parser,
6279  # not just through cpp. "Syntax error" is here to catch this case.
6280  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6281/* end confdefs.h.  */
6282#ifdef __STDC__
6283# include <limits.h>
6284#else
6285# include <assert.h>
6286#endif
6287		     Syntax error
6288_ACEOF
6289if ac_fn_c_try_cpp "$LINENO"; then :
6290
6291else
6292  # Broken: fails on valid input.
6293continue
6294fi
6295rm -f conftest.err conftest.i conftest.$ac_ext
6296
6297  # OK, works on sane cases.  Now check whether nonexistent headers
6298  # can be detected and how.
6299  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6300/* end confdefs.h.  */
6301#include <ac_nonexistent.h>
6302_ACEOF
6303if ac_fn_c_try_cpp "$LINENO"; then :
6304  # Broken: success on invalid input.
6305continue
6306else
6307  # Passes both tests.
6308ac_preproc_ok=:
6309break
6310fi
6311rm -f conftest.err conftest.i conftest.$ac_ext
6312
6313done
6314# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6315rm -f conftest.i conftest.err conftest.$ac_ext
6316if $ac_preproc_ok; then :
6317  break
6318fi
6319
6320    done
6321    ac_cv_prog_CPP=$CPP
6322
6323fi
6324  CPP=$ac_cv_prog_CPP
6325else
6326  ac_cv_prog_CPP=$CPP
6327fi
6328{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
6329$as_echo "$CPP" >&6; }
6330ac_preproc_ok=false
6331for ac_c_preproc_warn_flag in '' yes
6332do
6333  # Use a header file that comes with gcc, so configuring glibc
6334  # with a fresh cross-compiler works.
6335  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6336  # <limits.h> exists even on freestanding compilers.
6337  # On the NeXT, cc -E runs the code through the compiler's parser,
6338  # not just through cpp. "Syntax error" is here to catch this case.
6339  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6340/* end confdefs.h.  */
6341#ifdef __STDC__
6342# include <limits.h>
6343#else
6344# include <assert.h>
6345#endif
6346		     Syntax error
6347_ACEOF
6348if ac_fn_c_try_cpp "$LINENO"; then :
6349
6350else
6351  # Broken: fails on valid input.
6352continue
6353fi
6354rm -f conftest.err conftest.i conftest.$ac_ext
6355
6356  # OK, works on sane cases.  Now check whether nonexistent headers
6357  # can be detected and how.
6358  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6359/* end confdefs.h.  */
6360#include <ac_nonexistent.h>
6361_ACEOF
6362if ac_fn_c_try_cpp "$LINENO"; then :
6363  # Broken: success on invalid input.
6364continue
6365else
6366  # Passes both tests.
6367ac_preproc_ok=:
6368break
6369fi
6370rm -f conftest.err conftest.i conftest.$ac_ext
6371
6372done
6373# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6374rm -f conftest.i conftest.err conftest.$ac_ext
6375if $ac_preproc_ok; then :
6376
6377else
6378  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6379$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6380as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
6381See \`config.log' for more details" "$LINENO" 5; }
6382fi
6383
6384ac_ext=c
6385ac_cpp='$CPP $CPPFLAGS'
6386ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6387ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6388ac_compiler_gnu=$ac_cv_c_compiler_gnu
6389
6390
6391
6392{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
6393$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
6394if ${ac_cv_path_GREP+:} false; then :
6395  $as_echo_n "(cached) " >&6
6396else
6397  if test -z "$GREP"; then
6398  ac_path_GREP_found=false
6399  # Loop through the user's path and test for each of PROGNAME-LIST
6400  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6401for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6402do
6403  IFS=$as_save_IFS
6404  test -z "$as_dir" && as_dir=.
6405    for ac_prog in grep ggrep; do
6406    for ac_exec_ext in '' $ac_executable_extensions; do
6407      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
6408      as_fn_executable_p "$ac_path_GREP" || continue
6409# Check for GNU ac_path_GREP and select it if it is found.
6410  # Check for GNU $ac_path_GREP
6411case `"$ac_path_GREP" --version 2>&1` in
6412*GNU*)
6413  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
6414*)
6415  ac_count=0
6416  $as_echo_n 0123456789 >"conftest.in"
6417  while :
6418  do
6419    cat "conftest.in" "conftest.in" >"conftest.tmp"
6420    mv "conftest.tmp" "conftest.in"
6421    cp "conftest.in" "conftest.nl"
6422    $as_echo 'GREP' >> "conftest.nl"
6423    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
6424    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6425    as_fn_arith $ac_count + 1 && ac_count=$as_val
6426    if test $ac_count -gt ${ac_path_GREP_max-0}; then
6427      # Best one so far, save it but keep looking for a better one
6428      ac_cv_path_GREP="$ac_path_GREP"
6429      ac_path_GREP_max=$ac_count
6430    fi
6431    # 10*(2^10) chars as input seems more than enough
6432    test $ac_count -gt 10 && break
6433  done
6434  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6435esac
6436
6437      $ac_path_GREP_found && break 3
6438    done
6439  done
6440  done
6441IFS=$as_save_IFS
6442  if test -z "$ac_cv_path_GREP"; then
6443    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6444  fi
6445else
6446  ac_cv_path_GREP=$GREP
6447fi
6448
6449fi
6450{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
6451$as_echo "$ac_cv_path_GREP" >&6; }
6452 GREP="$ac_cv_path_GREP"
6453
6454
6455{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
6456$as_echo_n "checking for egrep... " >&6; }
6457if ${ac_cv_path_EGREP+:} false; then :
6458  $as_echo_n "(cached) " >&6
6459else
6460  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
6461   then ac_cv_path_EGREP="$GREP -E"
6462   else
6463     if test -z "$EGREP"; then
6464  ac_path_EGREP_found=false
6465  # Loop through the user's path and test for each of PROGNAME-LIST
6466  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6467for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6468do
6469  IFS=$as_save_IFS
6470  test -z "$as_dir" && as_dir=.
6471    for ac_prog in egrep; do
6472    for ac_exec_ext in '' $ac_executable_extensions; do
6473      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
6474      as_fn_executable_p "$ac_path_EGREP" || continue
6475# Check for GNU ac_path_EGREP and select it if it is found.
6476  # Check for GNU $ac_path_EGREP
6477case `"$ac_path_EGREP" --version 2>&1` in
6478*GNU*)
6479  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
6480*)
6481  ac_count=0
6482  $as_echo_n 0123456789 >"conftest.in"
6483  while :
6484  do
6485    cat "conftest.in" "conftest.in" >"conftest.tmp"
6486    mv "conftest.tmp" "conftest.in"
6487    cp "conftest.in" "conftest.nl"
6488    $as_echo 'EGREP' >> "conftest.nl"
6489    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
6490    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6491    as_fn_arith $ac_count + 1 && ac_count=$as_val
6492    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
6493      # Best one so far, save it but keep looking for a better one
6494      ac_cv_path_EGREP="$ac_path_EGREP"
6495      ac_path_EGREP_max=$ac_count
6496    fi
6497    # 10*(2^10) chars as input seems more than enough
6498    test $ac_count -gt 10 && break
6499  done
6500  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6501esac
6502
6503      $ac_path_EGREP_found && break 3
6504    done
6505  done
6506  done
6507IFS=$as_save_IFS
6508  if test -z "$ac_cv_path_EGREP"; then
6509    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6510  fi
6511else
6512  ac_cv_path_EGREP=$EGREP
6513fi
6514
6515   fi
6516fi
6517{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
6518$as_echo "$ac_cv_path_EGREP" >&6; }
6519 EGREP="$ac_cv_path_EGREP"
6520
6521
6522if test $ac_cv_c_compiler_gnu = yes; then
6523    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
6524$as_echo_n "checking whether $CC needs -traditional... " >&6; }
6525if ${ac_cv_prog_gcc_traditional+:} false; then :
6526  $as_echo_n "(cached) " >&6
6527else
6528    ac_pattern="Autoconf.*'x'"
6529  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6530/* end confdefs.h.  */
6531#include <sgtty.h>
6532Autoconf TIOCGETP
6533_ACEOF
6534if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6535  $EGREP "$ac_pattern" >/dev/null 2>&1; then :
6536  ac_cv_prog_gcc_traditional=yes
6537else
6538  ac_cv_prog_gcc_traditional=no
6539fi
6540rm -f conftest*
6541
6542
6543  if test $ac_cv_prog_gcc_traditional = no; then
6544    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6545/* end confdefs.h.  */
6546#include <termio.h>
6547Autoconf TCGETA
6548_ACEOF
6549if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6550  $EGREP "$ac_pattern" >/dev/null 2>&1; then :
6551  ac_cv_prog_gcc_traditional=yes
6552fi
6553rm -f conftest*
6554
6555  fi
6556fi
6557{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
6558$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
6559  if test $ac_cv_prog_gcc_traditional = yes; then
6560    CC="$CC -traditional"
6561  fi
6562fi
6563
6564if test -n "$ac_tool_prefix"; then
6565  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6566set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6567{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6568$as_echo_n "checking for $ac_word... " >&6; }
6569if ${ac_cv_prog_RANLIB+:} false; then :
6570  $as_echo_n "(cached) " >&6
6571else
6572  if test -n "$RANLIB"; then
6573  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6574else
6575as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6576for as_dir in $PATH
6577do
6578  IFS=$as_save_IFS
6579  test -z "$as_dir" && as_dir=.
6580    for ac_exec_ext in '' $ac_executable_extensions; do
6581  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6582    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6583    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6584    break 2
6585  fi
6586done
6587  done
6588IFS=$as_save_IFS
6589
6590fi
6591fi
6592RANLIB=$ac_cv_prog_RANLIB
6593if test -n "$RANLIB"; then
6594  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
6595$as_echo "$RANLIB" >&6; }
6596else
6597  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6598$as_echo "no" >&6; }
6599fi
6600
6601
6602fi
6603if test -z "$ac_cv_prog_RANLIB"; then
6604  ac_ct_RANLIB=$RANLIB
6605  # Extract the first word of "ranlib", so it can be a program name with args.
6606set dummy ranlib; ac_word=$2
6607{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6608$as_echo_n "checking for $ac_word... " >&6; }
6609if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
6610  $as_echo_n "(cached) " >&6
6611else
6612  if test -n "$ac_ct_RANLIB"; then
6613  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6614else
6615as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6616for as_dir in $PATH
6617do
6618  IFS=$as_save_IFS
6619  test -z "$as_dir" && as_dir=.
6620    for ac_exec_ext in '' $ac_executable_extensions; do
6621  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6622    ac_cv_prog_ac_ct_RANLIB="ranlib"
6623    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6624    break 2
6625  fi
6626done
6627  done
6628IFS=$as_save_IFS
6629
6630fi
6631fi
6632ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6633if test -n "$ac_ct_RANLIB"; then
6634  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
6635$as_echo "$ac_ct_RANLIB" >&6; }
6636else
6637  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6638$as_echo "no" >&6; }
6639fi
6640
6641  if test "x$ac_ct_RANLIB" = x; then
6642    RANLIB=":"
6643  else
6644    case $cross_compiling:$ac_tool_warned in
6645yes:)
6646{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6647$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6648ac_tool_warned=yes ;;
6649esac
6650    RANLIB=$ac_ct_RANLIB
6651  fi
6652else
6653  RANLIB="$ac_cv_prog_RANLIB"
6654fi
6655
6656{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
6657$as_echo_n "checking whether ln -s works... " >&6; }
6658LN_S=$as_ln_s
6659if test "$LN_S" = "ln -s"; then
6660  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6661$as_echo "yes" >&6; }
6662else
6663  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
6664$as_echo "no, using $LN_S" >&6; }
6665fi
6666
6667{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
6668$as_echo_n "checking for ANSI C header files... " >&6; }
6669if ${ac_cv_header_stdc+:} false; then :
6670  $as_echo_n "(cached) " >&6
6671else
6672  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6673/* end confdefs.h.  */
6674#include <stdlib.h>
6675#include <stdarg.h>
6676#include <string.h>
6677#include <float.h>
6678
6679int
6680main ()
6681{
6682
6683  ;
6684  return 0;
6685}
6686_ACEOF
6687if ac_fn_c_try_compile "$LINENO"; then :
6688  ac_cv_header_stdc=yes
6689else
6690  ac_cv_header_stdc=no
6691fi
6692rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6693
6694if test $ac_cv_header_stdc = yes; then
6695  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6696  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6697/* end confdefs.h.  */
6698#include <string.h>
6699
6700_ACEOF
6701if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6702  $EGREP "memchr" >/dev/null 2>&1; then :
6703
6704else
6705  ac_cv_header_stdc=no
6706fi
6707rm -f conftest*
6708
6709fi
6710
6711if test $ac_cv_header_stdc = yes; then
6712  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6713  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6714/* end confdefs.h.  */
6715#include <stdlib.h>
6716
6717_ACEOF
6718if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6719  $EGREP "free" >/dev/null 2>&1; then :
6720
6721else
6722  ac_cv_header_stdc=no
6723fi
6724rm -f conftest*
6725
6726fi
6727
6728if test $ac_cv_header_stdc = yes; then
6729  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
6730  if test "$cross_compiling" = yes; then :
6731  :
6732else
6733  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6734/* end confdefs.h.  */
6735#include <ctype.h>
6736#include <stdlib.h>
6737#if ((' ' & 0x0FF) == 0x020)
6738# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
6739# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
6740#else
6741# define ISLOWER(c) \
6742		   (('a' <= (c) && (c) <= 'i') \
6743		     || ('j' <= (c) && (c) <= 'r') \
6744		     || ('s' <= (c) && (c) <= 'z'))
6745# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
6746#endif
6747
6748#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
6749int
6750main ()
6751{
6752  int i;
6753  for (i = 0; i < 256; i++)
6754    if (XOR (islower (i), ISLOWER (i))
6755	|| toupper (i) != TOUPPER (i))
6756      return 2;
6757  return 0;
6758}
6759_ACEOF
6760if ac_fn_c_try_run "$LINENO"; then :
6761
6762else
6763  ac_cv_header_stdc=no
6764fi
6765rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
6766  conftest.$ac_objext conftest.beam conftest.$ac_ext
6767fi
6768
6769fi
6770fi
6771{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
6772$as_echo "$ac_cv_header_stdc" >&6; }
6773if test $ac_cv_header_stdc = yes; then
6774
6775$as_echo "#define STDC_HEADERS 1" >>confdefs.h
6776
6777fi
6778
6779# On IRIX 5.3, sys/types and inttypes.h are conflicting.
6780for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
6781		  inttypes.h stdint.h unistd.h
6782do :
6783  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
6784ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
6785"
6786if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
6787  cat >>confdefs.h <<_ACEOF
6788#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
6789_ACEOF
6790
6791fi
6792
6793done
6794
6795
6796
6797  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
6798if test "x$ac_cv_header_minix_config_h" = xyes; then :
6799  MINIX=yes
6800else
6801  MINIX=
6802fi
6803
6804
6805  if test "$MINIX" = yes; then
6806
6807$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
6808
6809
6810$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
6811
6812
6813$as_echo "#define _MINIX 1" >>confdefs.h
6814
6815
6816$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
6817
6818  fi
6819
6820
6821  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
6822$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
6823if ${ac_cv_safe_to_define___extensions__+:} false; then :
6824  $as_echo_n "(cached) " >&6
6825else
6826  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6827/* end confdefs.h.  */
6828
6829#         define __EXTENSIONS__ 1
6830          $ac_includes_default
6831int
6832main ()
6833{
6834
6835  ;
6836  return 0;
6837}
6838_ACEOF
6839if ac_fn_c_try_compile "$LINENO"; then :
6840  ac_cv_safe_to_define___extensions__=yes
6841else
6842  ac_cv_safe_to_define___extensions__=no
6843fi
6844rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6845fi
6846{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
6847$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
6848  test $ac_cv_safe_to_define___extensions__ = yes &&
6849    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
6850
6851  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
6852
6853  $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
6854
6855  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
6856
6857  $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
6858
6859  $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h
6860
6861  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
6862
6863  $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h
6864
6865  $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h
6866
6867  $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h
6868
6869  $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h
6870
6871  $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h
6872
6873  $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h
6874
6875  $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h
6876
6877  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
6878
6879  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
6880$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; }
6881if ${ac_cv_should_define__xopen_source+:} false; then :
6882  $as_echo_n "(cached) " >&6
6883else
6884  ac_cv_should_define__xopen_source=no
6885     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6886/* end confdefs.h.  */
6887
6888          #include <wchar.h>
6889          mbstate_t x;
6890int
6891main ()
6892{
6893
6894  ;
6895  return 0;
6896}
6897_ACEOF
6898if ac_fn_c_try_compile "$LINENO"; then :
6899
6900else
6901  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6902/* end confdefs.h.  */
6903
6904             #define _XOPEN_SOURCE 500
6905             #include <wchar.h>
6906             mbstate_t x;
6907int
6908main ()
6909{
6910
6911  ;
6912  return 0;
6913}
6914_ACEOF
6915if ac_fn_c_try_compile "$LINENO"; then :
6916  ac_cv_should_define__xopen_source=yes
6917fi
6918rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6919fi
6920rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6921fi
6922{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
6923$as_echo "$ac_cv_should_define__xopen_source" >&6; }
6924  test $ac_cv_should_define__xopen_source = yes &&
6925    $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
6926
6927  $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
6940$as_echo_n "checking for Minix Amsterdam compiler... " >&6; }
6941if ${gl_cv_c_amsterdam_compiler+:} false; then :
6942  $as_echo_n "(cached) " >&6
6943else
6944
6945      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6946/* end confdefs.h.  */
6947
6948#ifdef __ACK__
6949Amsterdam
6950#endif
6951
6952_ACEOF
6953if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6954  $EGREP "Amsterdam" >/dev/null 2>&1; then :
6955  gl_cv_c_amsterdam_compiler=yes
6956else
6957  gl_cv_c_amsterdam_compiler=no
6958fi
6959rm -f conftest*
6960
6961
6962fi
6963{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
6964$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
6965
6966      if test $gl_cv_c_amsterdam_compiler = yes; then
6967    if test -z "$AR"; then
6968      AR='cc -c.a'
6969    fi
6970    if test -z "$ARFLAGS"; then
6971      ARFLAGS='-o'
6972    fi
6973  else
6974                                                :
6975  fi
6976
6977        if test -n "$ac_tool_prefix"; then
6978  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
6979set dummy ${ac_tool_prefix}ar; ac_word=$2
6980{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6981$as_echo_n "checking for $ac_word... " >&6; }
6982if ${ac_cv_prog_AR+:} false; then :
6983  $as_echo_n "(cached) " >&6
6984else
6985  if test -n "$AR"; then
6986  ac_cv_prog_AR="$AR" # Let the user override the test.
6987else
6988as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6989for as_dir in $PATH
6990do
6991  IFS=$as_save_IFS
6992  test -z "$as_dir" && as_dir=.
6993    for ac_exec_ext in '' $ac_executable_extensions; do
6994  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6995    ac_cv_prog_AR="${ac_tool_prefix}ar"
6996    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6997    break 2
6998  fi
6999done
7000  done
7001IFS=$as_save_IFS
7002
7003fi
7004fi
7005AR=$ac_cv_prog_AR
7006if test -n "$AR"; then
7007  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
7008$as_echo "$AR" >&6; }
7009else
7010  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7011$as_echo "no" >&6; }
7012fi
7013
7014
7015fi
7016if test -z "$ac_cv_prog_AR"; then
7017  ac_ct_AR=$AR
7018  # Extract the first word of "ar", so it can be a program name with args.
7019set dummy ar; ac_word=$2
7020{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7021$as_echo_n "checking for $ac_word... " >&6; }
7022if ${ac_cv_prog_ac_ct_AR+:} false; then :
7023  $as_echo_n "(cached) " >&6
7024else
7025  if test -n "$ac_ct_AR"; then
7026  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
7027else
7028as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7029for as_dir in $PATH
7030do
7031  IFS=$as_save_IFS
7032  test -z "$as_dir" && as_dir=.
7033    for ac_exec_ext in '' $ac_executable_extensions; do
7034  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7035    ac_cv_prog_ac_ct_AR="ar"
7036    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7037    break 2
7038  fi
7039done
7040  done
7041IFS=$as_save_IFS
7042
7043fi
7044fi
7045ac_ct_AR=$ac_cv_prog_ac_ct_AR
7046if test -n "$ac_ct_AR"; then
7047  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
7048$as_echo "$ac_ct_AR" >&6; }
7049else
7050  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7051$as_echo "no" >&6; }
7052fi
7053
7054  if test "x$ac_ct_AR" = x; then
7055    AR="ar"
7056  else
7057    case $cross_compiling:$ac_tool_warned in
7058yes:)
7059{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7060$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7061ac_tool_warned=yes ;;
7062esac
7063    AR=$ac_ct_AR
7064  fi
7065else
7066  AR="$ac_cv_prog_AR"
7067fi
7068
7069  if test -z "$ARFLAGS"; then
7070    ARFLAGS='cr'
7071  fi
7072
7073
7074
7075  if test -z "$RANLIB"; then
7076    if test $gl_cv_c_amsterdam_compiler = yes; then
7077      RANLIB=':'
7078    else
7079            if test -n "$ac_tool_prefix"; then
7080  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
7081set dummy ${ac_tool_prefix}ranlib; ac_word=$2
7082{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7083$as_echo_n "checking for $ac_word... " >&6; }
7084if ${ac_cv_prog_RANLIB+:} false; then :
7085  $as_echo_n "(cached) " >&6
7086else
7087  if test -n "$RANLIB"; then
7088  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
7089else
7090as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7091for as_dir in $PATH
7092do
7093  IFS=$as_save_IFS
7094  test -z "$as_dir" && as_dir=.
7095    for ac_exec_ext in '' $ac_executable_extensions; do
7096  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7097    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
7098    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7099    break 2
7100  fi
7101done
7102  done
7103IFS=$as_save_IFS
7104
7105fi
7106fi
7107RANLIB=$ac_cv_prog_RANLIB
7108if test -n "$RANLIB"; then
7109  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
7110$as_echo "$RANLIB" >&6; }
7111else
7112  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7113$as_echo "no" >&6; }
7114fi
7115
7116
7117fi
7118if test -z "$ac_cv_prog_RANLIB"; then
7119  ac_ct_RANLIB=$RANLIB
7120  # Extract the first word of "ranlib", so it can be a program name with args.
7121set dummy ranlib; ac_word=$2
7122{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7123$as_echo_n "checking for $ac_word... " >&6; }
7124if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
7125  $as_echo_n "(cached) " >&6
7126else
7127  if test -n "$ac_ct_RANLIB"; then
7128  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
7129else
7130as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7131for as_dir in $PATH
7132do
7133  IFS=$as_save_IFS
7134  test -z "$as_dir" && as_dir=.
7135    for ac_exec_ext in '' $ac_executable_extensions; do
7136  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7137    ac_cv_prog_ac_ct_RANLIB="ranlib"
7138    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7139    break 2
7140  fi
7141done
7142  done
7143IFS=$as_save_IFS
7144
7145fi
7146fi
7147ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
7148if test -n "$ac_ct_RANLIB"; then
7149  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
7150$as_echo "$ac_ct_RANLIB" >&6; }
7151else
7152  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7153$as_echo "no" >&6; }
7154fi
7155
7156  if test "x$ac_ct_RANLIB" = x; then
7157    RANLIB=":"
7158  else
7159    case $cross_compiling:$ac_tool_warned in
7160yes:)
7161{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7162$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7163ac_tool_warned=yes ;;
7164esac
7165    RANLIB=$ac_ct_RANLIB
7166  fi
7167else
7168  RANLIB="$ac_cv_prog_RANLIB"
7169fi
7170
7171    fi
7172  fi
7173
7174
7175# Make sure we can run config.sub.
7176$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
7177  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
7178
7179{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
7180$as_echo_n "checking build system type... " >&6; }
7181if ${ac_cv_build+:} false; then :
7182  $as_echo_n "(cached) " >&6
7183else
7184  ac_build_alias=$build_alias
7185test "x$ac_build_alias" = x &&
7186  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
7187test "x$ac_build_alias" = x &&
7188  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
7189ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
7190  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
7191
7192fi
7193{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
7194$as_echo "$ac_cv_build" >&6; }
7195case $ac_cv_build in
7196*-*-*) ;;
7197*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
7198esac
7199build=$ac_cv_build
7200ac_save_IFS=$IFS; IFS='-'
7201set x $ac_cv_build
7202shift
7203build_cpu=$1
7204build_vendor=$2
7205shift; shift
7206# Remember, the first character of IFS is used to create $*,
7207# except with old shells:
7208build_os=$*
7209IFS=$ac_save_IFS
7210case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
7211
7212
7213{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
7214$as_echo_n "checking host system type... " >&6; }
7215if ${ac_cv_host+:} false; then :
7216  $as_echo_n "(cached) " >&6
7217else
7218  if test "x$host_alias" = x; then
7219  ac_cv_host=$ac_cv_build
7220else
7221  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
7222    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
7223fi
7224
7225fi
7226{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
7227$as_echo "$ac_cv_host" >&6; }
7228case $ac_cv_host in
7229*-*-*) ;;
7230*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
7231esac
7232host=$ac_cv_host
7233ac_save_IFS=$IFS; IFS='-'
7234set x $ac_cv_host
7235shift
7236host_cpu=$1
7237host_vendor=$2
7238shift; shift
7239# Remember, the first character of IFS is used to create $*,
7240# except with old shells:
7241host_os=$*
7242IFS=$ac_save_IFS
7243case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
7244
7245
7246{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
7247$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
7248if ${ac_cv_sys_largefile_source+:} false; then :
7249  $as_echo_n "(cached) " >&6
7250else
7251  while :; do
7252  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7253/* end confdefs.h.  */
7254#include <sys/types.h> /* for off_t */
7255     #include <stdio.h>
7256int
7257main ()
7258{
7259int (*fp) (FILE *, off_t, int) = fseeko;
7260     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
7261  ;
7262  return 0;
7263}
7264_ACEOF
7265if ac_fn_c_try_link "$LINENO"; then :
7266  ac_cv_sys_largefile_source=no; break
7267fi
7268rm -f core conftest.err conftest.$ac_objext \
7269    conftest$ac_exeext conftest.$ac_ext
7270  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7271/* end confdefs.h.  */
7272#define _LARGEFILE_SOURCE 1
7273#include <sys/types.h> /* for off_t */
7274     #include <stdio.h>
7275int
7276main ()
7277{
7278int (*fp) (FILE *, off_t, int) = fseeko;
7279     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
7280  ;
7281  return 0;
7282}
7283_ACEOF
7284if ac_fn_c_try_link "$LINENO"; then :
7285  ac_cv_sys_largefile_source=1; break
7286fi
7287rm -f core conftest.err conftest.$ac_objext \
7288    conftest$ac_exeext conftest.$ac_ext
7289  ac_cv_sys_largefile_source=unknown
7290  break
7291done
7292fi
7293{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
7294$as_echo "$ac_cv_sys_largefile_source" >&6; }
7295case $ac_cv_sys_largefile_source in #(
7296  no | unknown) ;;
7297  *)
7298cat >>confdefs.h <<_ACEOF
7299#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
7300_ACEOF
7301;;
7302esac
7303rm -rf conftest*
7304
7305# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
7306# in glibc 2.1.3, but that breaks too many other things.
7307# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
7308if test $ac_cv_sys_largefile_source != unknown; then
7309
7310$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
7311
7312fi
7313
7314
7315
7316
7317  # IEEE behaviour is the default on all CPUs except Alpha and SH
7318  # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
7319  # and the GCC 4.1.2 manual).
7320  case "$host_cpu" in
7321    alpha*)
7322      # On Alpha systems, a compiler option provides the behaviour.
7323      # See the ieee(3) manual page, also available at
7324      # <https://backdrift.org/man/tru64/man3/ieee.3.html>
7325      if test -n "$GCC"; then
7326        # GCC has the option -mieee.
7327        # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
7328        CPPFLAGS="$CPPFLAGS -mieee"
7329      else
7330        # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
7331        # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
7332        CPPFLAGS="$CPPFLAGS -ieee"
7333      fi
7334      ;;
7335    sh*)
7336      if test -n "$GCC"; then
7337        # GCC has the option -mieee.
7338        CPPFLAGS="$CPPFLAGS -mieee"
7339      fi
7340      ;;
7341  esac
7342
7343# Check whether --enable-largefile was given.
7344if test "${enable_largefile+set}" = set; then :
7345  enableval=$enable_largefile;
7346fi
7347
7348if test "$enable_largefile" != no; then
7349
7350  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
7351$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
7352if ${ac_cv_sys_largefile_CC+:} false; then :
7353  $as_echo_n "(cached) " >&6
7354else
7355  ac_cv_sys_largefile_CC=no
7356     if test "$GCC" != yes; then
7357       ac_save_CC=$CC
7358       while :; do
7359         # IRIX 6.2 and later do not support large files by default,
7360         # so use the C compiler's -n32 option if that helps.
7361         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7362/* end confdefs.h.  */
7363#include <sys/types.h>
7364 /* Check that off_t can represent 2**63 - 1 correctly.
7365    We can't simply define LARGE_OFF_T to be 9223372036854775807,
7366    since some C++ compilers masquerading as C compilers
7367    incorrectly reject 9223372036854775807.  */
7368#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
7369  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
7370                       && LARGE_OFF_T % 2147483647 == 1)
7371                      ? 1 : -1];
7372int
7373main ()
7374{
7375
7376  ;
7377  return 0;
7378}
7379_ACEOF
7380         if ac_fn_c_try_compile "$LINENO"; then :
7381  break
7382fi
7383rm -f core conftest.err conftest.$ac_objext
7384         CC="$CC -n32"
7385         if ac_fn_c_try_compile "$LINENO"; then :
7386  ac_cv_sys_largefile_CC=' -n32'; break
7387fi
7388rm -f core conftest.err conftest.$ac_objext
7389         break
7390       done
7391       CC=$ac_save_CC
7392       rm -f conftest.$ac_ext
7393    fi
7394fi
7395{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
7396$as_echo "$ac_cv_sys_largefile_CC" >&6; }
7397  if test "$ac_cv_sys_largefile_CC" != no; then
7398    CC=$CC$ac_cv_sys_largefile_CC
7399  fi
7400
7401  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
7402$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
7403if ${ac_cv_sys_file_offset_bits+:} false; then :
7404  $as_echo_n "(cached) " >&6
7405else
7406  while :; do
7407  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7408/* end confdefs.h.  */
7409#include <sys/types.h>
7410 /* Check that off_t can represent 2**63 - 1 correctly.
7411    We can't simply define LARGE_OFF_T to be 9223372036854775807,
7412    since some C++ compilers masquerading as C compilers
7413    incorrectly reject 9223372036854775807.  */
7414#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
7415  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
7416                       && LARGE_OFF_T % 2147483647 == 1)
7417                      ? 1 : -1];
7418int
7419main ()
7420{
7421
7422  ;
7423  return 0;
7424}
7425_ACEOF
7426if ac_fn_c_try_compile "$LINENO"; then :
7427  ac_cv_sys_file_offset_bits=no; break
7428fi
7429rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7430  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7431/* end confdefs.h.  */
7432#define _FILE_OFFSET_BITS 64
7433#include <sys/types.h>
7434 /* Check that off_t can represent 2**63 - 1 correctly.
7435    We can't simply define LARGE_OFF_T to be 9223372036854775807,
7436    since some C++ compilers masquerading as C compilers
7437    incorrectly reject 9223372036854775807.  */
7438#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
7439  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
7440                       && LARGE_OFF_T % 2147483647 == 1)
7441                      ? 1 : -1];
7442int
7443main ()
7444{
7445
7446  ;
7447  return 0;
7448}
7449_ACEOF
7450if ac_fn_c_try_compile "$LINENO"; then :
7451  ac_cv_sys_file_offset_bits=64; break
7452fi
7453rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7454  ac_cv_sys_file_offset_bits=unknown
7455  break
7456done
7457fi
7458{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
7459$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
7460case $ac_cv_sys_file_offset_bits in #(
7461  no | unknown) ;;
7462  *)
7463cat >>confdefs.h <<_ACEOF
7464#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
7465_ACEOF
7466;;
7467esac
7468rm -rf conftest*
7469  if test $ac_cv_sys_file_offset_bits = unknown; then
7470    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
7471$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
7472if ${ac_cv_sys_large_files+:} false; then :
7473  $as_echo_n "(cached) " >&6
7474else
7475  while :; do
7476  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7477/* end confdefs.h.  */
7478#include <sys/types.h>
7479 /* Check that off_t can represent 2**63 - 1 correctly.
7480    We can't simply define LARGE_OFF_T to be 9223372036854775807,
7481    since some C++ compilers masquerading as C compilers
7482    incorrectly reject 9223372036854775807.  */
7483#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
7484  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
7485                       && LARGE_OFF_T % 2147483647 == 1)
7486                      ? 1 : -1];
7487int
7488main ()
7489{
7490
7491  ;
7492  return 0;
7493}
7494_ACEOF
7495if ac_fn_c_try_compile "$LINENO"; then :
7496  ac_cv_sys_large_files=no; break
7497fi
7498rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7499  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7500/* end confdefs.h.  */
7501#define _LARGE_FILES 1
7502#include <sys/types.h>
7503 /* Check that off_t can represent 2**63 - 1 correctly.
7504    We can't simply define LARGE_OFF_T to be 9223372036854775807,
7505    since some C++ compilers masquerading as C compilers
7506    incorrectly reject 9223372036854775807.  */
7507#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
7508  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
7509                       && LARGE_OFF_T % 2147483647 == 1)
7510                      ? 1 : -1];
7511int
7512main ()
7513{
7514
7515  ;
7516  return 0;
7517}
7518_ACEOF
7519if ac_fn_c_try_compile "$LINENO"; then :
7520  ac_cv_sys_large_files=1; break
7521fi
7522rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7523  ac_cv_sys_large_files=unknown
7524  break
7525done
7526fi
7527{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
7528$as_echo "$ac_cv_sys_large_files" >&6; }
7529case $ac_cv_sys_large_files in #(
7530  no | unknown) ;;
7531  *)
7532cat >>confdefs.h <<_ACEOF
7533#define _LARGE_FILES $ac_cv_sys_large_files
7534_ACEOF
7535;;
7536esac
7537rm -rf conftest*
7538  fi
7539
7540
7541$as_echo "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h
7542
7543fi
7544
7545
7546
7547
7548
7549
7550  # Check whether --enable-threads was given.
7551if test "${enable_threads+set}" = set; then :
7552  enableval=$enable_threads; gl_use_threads=$enableval
7553else
7554  if test -n "$gl_use_threads_default"; then
7555       gl_use_threads="$gl_use_threads_default"
7556     else
7557       case "$host_os" in
7558                                                               osf*) gl_use_threads=no ;;
7559         cygwin*)
7560               case `uname -r` in
7561                 1.[0-5].*) gl_use_threads=no ;;
7562                 *)         gl_use_threads=yes ;;
7563               esac
7564               ;;
7565         *)    gl_use_threads=yes ;;
7566       esac
7567     fi
7568
7569fi
7570
7571  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
7572    # For using <pthread.h>:
7573    case "$host_os" in
7574      osf*)
7575        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
7576        # groks <pthread.h>. cc also understands the flag -pthread, but
7577        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
7578        # 2. putting a flag into CPPFLAGS that has an effect on the linker
7579        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
7580        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
7581        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
7582        ;;
7583    esac
7584    # Some systems optimize for single-threaded programs by default, and
7585    # need special flags to disable these optimizations. For example, the
7586    # definition of 'errno' in <errno.h>.
7587    case "$host_os" in
7588      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
7589      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
7590    esac
7591  fi
7592
7593
7594
7595  case "$host_os" in
7596    mingw*)
7597
7598$as_echo "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h
7599
7600      ;;
7601  esac
7602
7603
7604
7605  # Pre-early section.
7606
7607
7608
7609
7610  # Code from module absolute-header:
7611  # Code from module accept:
7612  # Code from module accept-tests:
7613  # Code from module acl:
7614  # Code from module acl-permissions:
7615  # Code from module acl-tests:
7616  # Code from module alignof:
7617  # Code from module alignof-tests:
7618  # Code from module alloca:
7619  # Code from module alloca-opt:
7620  # Code from module alloca-opt-tests:
7621  # Code from module allocator:
7622  # Code from module announce-gen:
7623  # Code from module areadlink:
7624  # Code from module areadlink-tests:
7625  # Code from module areadlink-with-size:
7626  # Code from module areadlink-with-size-tests:
7627  # Code from module areadlinkat:
7628  # Code from module areadlinkat-tests:
7629  # Code from module argmatch:
7630  # Code from module argmatch-tests:
7631  # Code from module argv-iter:
7632  # Code from module argv-iter-tests:
7633  # Code from module arpa_inet:
7634  # Code from module arpa_inet-tests:
7635  # Code from module assert:
7636  # Code from module assure:
7637  # Code from module at-internal:
7638  # Code from module autobuild:
7639
7640
7641
7642
7643  if test -z "$AB_PACKAGE"; then
7644    AB_PACKAGE=${PACKAGE_NAME:-$PACKAGE}
7645  fi
7646  { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild project... $AB_PACKAGE" >&5
7647$as_echo "$as_me: autobuild project... $AB_PACKAGE" >&6;}
7648
7649  if test -z "$AB_VERSION"; then
7650    AB_VERSION=${PACKAGE_VERSION:-$VERSION}
7651  fi
7652  { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild revision... $AB_VERSION" >&5
7653$as_echo "$as_me: autobuild revision... $AB_VERSION" >&6;}
7654
7655  hostname=`hostname`
7656  if test "$hostname"; then
7657    { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild hostname... $hostname" >&5
7658$as_echo "$as_me: autobuild hostname... $hostname" >&6;}
7659  fi
7660
7661
7662
7663  date=`TZ=UTC0 date +%Y%m%dT%H%M%SZ`
7664  if test "$?" != 0; then
7665    date=`date`
7666  fi
7667  if test "$date"; then
7668    { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild timestamp... $date" >&5
7669$as_echo "$as_me: autobuild timestamp... $date" >&6;}
7670  fi
7671
7672  # Code from module backup-rename:
7673  # Code from module backupfile:
7674  # Code from module base32:
7675  # Code from module base32-tests:
7676  # Code from module base64:
7677  # Code from module base64-tests:
7678  # Code from module binary-io:
7679  # Code from module binary-io-tests:
7680  # Code from module bind:
7681  # Code from module bind-tests:
7682  # Code from module bitrotate:
7683  # Code from module bitrotate-tests:
7684  # Code from module btowc:
7685  # Code from module btowc-tests:
7686  # Code from module buffer-lcm:
7687  # Code from module builtin-expect:
7688  # Code from module byteswap:
7689  # Code from module byteswap-tests:
7690  # Code from module c-ctype:
7691  # Code from module c-ctype-tests:
7692  # Code from module c-strcase:
7693  # Code from module c-strcase-tests:
7694  # Code from module c-strcaseeq:
7695  # Code from module c-strtod:
7696  # Code from module c-strtold:
7697  # Code from module c99:
7698  # Code from module calloc-gnu:
7699  # Code from module calloc-gnu-tests:
7700  # Code from module calloc-posix:
7701  # Code from module canon-host:
7702  # Code from module canonicalize:
7703  # Code from module canonicalize-tests:
7704  # Code from module careadlinkat:
7705  # Code from module chdir:
7706  # Code from module chdir-long:
7707  # Code from module chdir-tests:
7708  # Code from module chown:
7709  # Code from module chown-tests:
7710  # Code from module clock-time:
7711  # Code from module cloexec:
7712  # Code from module cloexec-tests:
7713  # Code from module close:
7714  # Code from module close-stream:
7715  # Code from module close-tests:
7716  # Code from module closedir:
7717  # Code from module closein:
7718  # Code from module closein-tests:
7719  # Code from module closeout:
7720  # Code from module config-h:
7721  # Code from module configmake:
7722  # Code from module connect:
7723  # Code from module connect-tests:
7724  # Code from module crypto/af_alg:
7725  # Code from module crypto/md5:
7726  # Code from module crypto/md5-buffer:
7727  # Code from module crypto/md5-tests:
7728  # Code from module crypto/sha1:
7729  # Code from module crypto/sha1-buffer:
7730  # Code from module crypto/sha1-tests:
7731  # Code from module crypto/sha256:
7732  # Code from module crypto/sha256-buffer:
7733  # Code from module crypto/sha256-tests:
7734  # Code from module crypto/sha512:
7735  # Code from module crypto/sha512-buffer:
7736  # Code from module crypto/sha512-tests:
7737  # Code from module ctype:
7738  # Code from module ctype-tests:
7739  # Code from module cycle-check:
7740  # Code from module d-ino:
7741  # Code from module d-type:
7742  # Code from module dev-ino:
7743  # Code from module di-set:
7744  # Code from module di-set-tests:
7745  # Code from module diacrit:
7746  # Code from module dirent:
7747  # Code from module dirent-safer:
7748  # Code from module dirent-safer-tests:
7749  # Code from module dirent-tests:
7750  # Code from module dirfd:
7751  # Code from module dirname:
7752  # Code from module dirname-lgpl:
7753  # Code from module dirname-tests:
7754  # Code from module do-release-commit-and-tag:
7755  # Code from module dosname:
7756  # Code from module double-slash-root:
7757  # Code from module dtoastr:
7758  # Code from module dtotimespec:
7759  # Code from module dup:
7760  # Code from module dup-tests:
7761  # Code from module dup2:
7762  # Code from module dup2-tests:
7763  # Code from module environ:
7764  # Code from module environ-tests:
7765  # Code from module errno:
7766  # Code from module errno-tests:
7767  # Code from module error:
7768  # Code from module euidaccess:
7769  # Code from module exclude:
7770  # Code from module exclude-tests:
7771  # Code from module exitfail:
7772  # Code from module explicit_bzero:
7773  # Code from module extensions:
7774  # Code from module extern-inline:
7775  # Code from module faccessat:
7776  # Code from module faccessat-tests:
7777  # Code from module fadvise:
7778  # Code from module fadvise-tests:
7779  # Code from module fchdir:
7780  # Code from module fchdir-tests:
7781  # Code from module fchmodat:
7782  # Code from module fchmodat-tests:
7783  # Code from module fchownat:
7784  # Code from module fchownat-tests:
7785  # Code from module fclose:
7786  # Code from module fclose-tests:
7787  # Code from module fcntl:
7788  # Code from module fcntl-h:
7789  # Code from module fcntl-h-tests:
7790  # Code from module fcntl-safer:
7791  # Code from module fcntl-safer-tests:
7792  # Code from module fcntl-tests:
7793  # Code from module fd-hook:
7794  # Code from module fd-reopen:
7795  # Code from module fd-safer-flag:
7796  # Code from module fdatasync:
7797  # Code from module fdatasync-tests:
7798  # Code from module fdl:
7799  # Code from module fdopen:
7800  # Code from module fdopen-tests:
7801  # Code from module fdopendir:
7802  # Code from module fdopendir-tests:
7803  # Code from module fdutimensat:
7804  # Code from module fdutimensat-tests:
7805  # Code from module fflush:
7806
7807  # Code from module fflush-tests:
7808  # Code from module fgetc-tests:
7809  # Code from module file-has-acl:
7810  # Code from module file-has-acl-tests:
7811  # Code from module file-set:
7812  # Code from module file-type:
7813  # Code from module fileblocks:
7814  # Code from module filemode:
7815  # Code from module filename:
7816  # Code from module filenamecat:
7817  # Code from module filenamecat-lgpl:
7818  # Code from module filenamecat-tests:
7819  # Code from module filevercmp:
7820  # Code from module filevercmp-tests:
7821  # Code from module flexmember:
7822  # Code from module float:
7823  # Code from module float-tests:
7824  # Code from module fnmatch:
7825  # Code from module fnmatch-gnu:
7826  # Code from module fnmatch-tests:
7827  # Code from module fopen:
7828  # Code from module fopen-safer:
7829  # Code from module fopen-safer-tests:
7830  # Code from module fopen-tests:
7831  # Code from module fpending:
7832  # Code from module fpending-tests:
7833  # Code from module fpieee:
7834
7835  # Code from module fprintftime:
7836  # Code from module fpucw:
7837  # Code from module fpurge:
7838  # Code from module fpurge-tests:
7839  # Code from module fputc-tests:
7840  # Code from module fread-tests:
7841  # Code from module freadahead:
7842  # Code from module freadahead-tests:
7843  # Code from module freading:
7844  # Code from module freading-tests:
7845  # Code from module freadptr:
7846  # Code from module freadptr-tests:
7847  # Code from module freadseek:
7848  # Code from module freadseek-tests:
7849  # Code from module freopen:
7850  # Code from module freopen-safer:
7851  # Code from module freopen-safer-tests:
7852  # Code from module freopen-tests:
7853  # Code from module frexp-nolibm:
7854  # Code from module frexp-nolibm-tests:
7855  # Code from module frexpl-nolibm:
7856  # Code from module frexpl-nolibm-tests:
7857  # Code from module fseek:
7858  # Code from module fseek-tests:
7859  # Code from module fseeko:
7860
7861  # Code from module fseeko-tests:
7862  # Code from module fseterr:
7863  # Code from module fseterr-tests:
7864  # Code from module fstat:
7865  # Code from module fstat-tests:
7866  # Code from module fstatat:
7867  # Code from module fstatat-tests:
7868  # Code from module fsusage:
7869  # Code from module fsync:
7870  # Code from module fsync-tests:
7871  # Code from module ftell:
7872  # Code from module ftell-tests:
7873  # Code from module ftello:
7874
7875  # Code from module ftello-tests:
7876  # Code from module ftoastr:
7877  # Code from module ftruncate:
7878  # Code from module ftruncate-tests:
7879  # Code from module fts:
7880  # Code from module full-read:
7881  # Code from module full-write:
7882  # Code from module futimens:
7883  # Code from module futimens-tests:
7884  # Code from module fwrite-tests:
7885  # Code from module gendocs:
7886  # Code from module getaddrinfo:
7887  # Code from module getaddrinfo-tests:
7888  # Code from module getcwd:
7889  # Code from module getcwd-lgpl:
7890  # Code from module getcwd-lgpl-tests:
7891  # Code from module getcwd-tests:
7892  # Code from module getdelim:
7893  # Code from module getdelim-tests:
7894  # Code from module getdtablesize:
7895  # Code from module getdtablesize-tests:
7896  # Code from module getgroups:
7897  # Code from module getgroups-tests:
7898  # Code from module gethostname:
7899  # Code from module gethostname-tests:
7900  # Code from module gethrxtime:
7901  # Code from module getline:
7902  # Code from module getline-tests:
7903  # Code from module getloadavg:
7904  # Code from module getloadavg-tests:
7905  # Code from module getlogin:
7906  # Code from module getlogin-tests:
7907  # Code from module getndelim2:
7908  # Code from module getndelim2-tests:
7909  # Code from module getopt-gnu:
7910  # Code from module getopt-gnu-tests:
7911  # Code from module getopt-posix:
7912  # Code from module getopt-posix-tests:
7913  # Code from module getpagesize:
7914  # Code from module getpass-gnu:
7915  # Code from module getprogname:
7916  # Code from module getprogname-tests:
7917  # Code from module getrusage:
7918  # Code from module getrusage-tests:
7919  # Code from module gettext-h:
7920  # Code from module gettime:
7921  # Code from module gettimeofday:
7922  # Code from module gettimeofday-tests:
7923  # Code from module getugroups:
7924  # Code from module getusershell:
7925  # Code from module git-version-gen:
7926  # Code from module gitlog-to-changelog:
7927  # Code from module gnu-make:
7928  # Code from module gnu-web-doc-update:
7929  # Code from module gnumakefile:
7930  # Code from module gnupload:
7931  # Code from module gperf:
7932  # Code from module group-member:
7933  # Code from module hard-locale:
7934  # Code from module hash:
7935  # Code from module hash-pjw:
7936  # Code from module hash-tests:
7937  # Code from module hash-triple:
7938  # Code from module havelib:
7939  # Code from module heap:
7940  # Code from module host-cpu-c-abi:
7941  # Code from module host-os:
7942  # Code from module hostent:
7943  # Code from module human:
7944  # Code from module i-ring:
7945  # Code from module i-ring-tests:
7946  # Code from module iconv:
7947  # Code from module iconv-h:
7948  # Code from module iconv-h-tests:
7949  # Code from module iconv-tests:
7950  # Code from module iconv_open:
7951  # Code from module idcache:
7952  # Code from module ignore-value:
7953  # Code from module ignore-value-tests:
7954  # Code from module include_next:
7955  # Code from module inet_ntop:
7956  # Code from module inet_ntop-tests:
7957  # Code from module inet_pton:
7958  # Code from module inet_pton-tests:
7959  # Code from module inline:
7960  # Code from module ino-map:
7961  # Code from module ino-map-tests:
7962  # Code from module intprops:
7963  # Code from module intprops-tests:
7964  # Code from module inttostr:
7965  # Code from module inttostr-tests:
7966  # Code from module inttypes:
7967  # Code from module inttypes-incomplete:
7968  # Code from module inttypes-tests:
7969  # Code from module ioctl:
7970  # Code from module ioctl-tests:
7971  # Code from module isapipe:
7972  # Code from module isatty:
7973  # Code from module isatty-tests:
7974  # Code from module isblank:
7975  # Code from module isblank-tests:
7976  # Code from module isnand-nolibm:
7977  # Code from module isnand-nolibm-tests:
7978  # Code from module isnanf-nolibm:
7979  # Code from module isnanf-nolibm-tests:
7980  # Code from module isnanl-nolibm:
7981  # Code from module isnanl-nolibm-tests:
7982  # Code from module iswblank:
7983  # Code from module iswblank-tests:
7984  # Code from module langinfo:
7985  # Code from module langinfo-tests:
7986  # Code from module largefile:
7987
7988  # Code from module lchmod:
7989  # Code from module lchown:
7990  # Code from module lchown-tests:
7991  # Code from module ldtoastr:
7992  # Code from module lib-ignore:
7993  # Code from module limits-h:
7994  # Code from module limits-h-tests:
7995  # Code from module linebuffer:
7996  # Code from module link:
7997  # Code from module link-follow:
7998  # Code from module link-tests:
7999  # Code from module linkat:
8000  # Code from module linkat-tests:
8001  # Code from module listen:
8002  # Code from module listen-tests:
8003  # Code from module localcharset:
8004  # Code from module localcharset-tests:
8005  # Code from module locale:
8006  # Code from module locale-tests:
8007  # Code from module localeconv:
8008  # Code from module localeconv-tests:
8009  # Code from module localename:
8010  # Code from module localename-tests:
8011  # Code from module localtime-buffer:
8012  # Code from module lock:
8013  # Code from module lock-tests:
8014  # Code from module long-options:
8015  # Code from module lseek:
8016  # Code from module lseek-tests:
8017  # Code from module lstat:
8018  # Code from module lstat-tests:
8019  # Code from module maintainer-makefile:
8020  # Code from module malloc-gnu:
8021  # Code from module malloc-gnu-tests:
8022  # Code from module malloc-posix:
8023  # Code from module malloca:
8024  # Code from module malloca-tests:
8025  # Code from module manywarnings:
8026  # Code from module math:
8027  # Code from module math-tests:
8028  # Code from module mbchar:
8029  # Code from module mbiter:
8030  # Code from module mbrlen:
8031  # Code from module mbrtowc:
8032  # Code from module mbrtowc-tests:
8033  # Code from module mbsalign:
8034  # Code from module mbsalign-tests:
8035  # Code from module mbscasecmp:
8036  # Code from module mbscasecmp-tests:
8037  # Code from module mbschr:
8038  # Code from module mbschr-tests:
8039  # Code from module mbsinit:
8040  # Code from module mbsinit-tests:
8041  # Code from module mbslen:
8042  # Code from module mbsrtowcs:
8043  # Code from module mbsrtowcs-tests:
8044  # Code from module mbsstr:
8045  # Code from module mbsstr-tests:
8046  # Code from module mbswidth:
8047  # Code from module mbtowc:
8048  # Code from module mbuiter:
8049  # Code from module memcasecmp:
8050  # Code from module memcasecmp-tests:
8051  # Code from module memchr:
8052  # Code from module memchr-tests:
8053  # Code from module memchr2:
8054  # Code from module memchr2-tests:
8055  # Code from module memcmp2:
8056  # Code from module memcoll:
8057  # Code from module memcoll-tests:
8058  # Code from module mempcpy:
8059  # Code from module memrchr:
8060  # Code from module memrchr-tests:
8061  # Code from module mgetgroups:
8062  # Code from module minmax:
8063  # Code from module mkancesdirs:
8064  # Code from module mkdir:
8065  # Code from module mkdir-p:
8066  # Code from module mkdir-tests:
8067  # Code from module mkfifo:
8068  # Code from module mkfifo-tests:
8069  # Code from module mknod:
8070  # Code from module mknod-tests:
8071  # Code from module mkostemp:
8072  # Code from module mkstemp:
8073  # Code from module mktime:
8074  # Code from module mktime-internal:
8075  # Code from module modechange:
8076  # Code from module mountlist:
8077  # Code from module mpsort:
8078  # Code from module msvc-inval:
8079  # Code from module msvc-nothrow:
8080  # Code from module multiarch:
8081  # Code from module nanosleep:
8082  # Code from module nanosleep-tests:
8083  # Code from module netdb:
8084  # Code from module netdb-tests:
8085  # Code from module netinet_in:
8086  # Code from module netinet_in-tests:
8087  # Code from module nl_langinfo:
8088  # Code from module nl_langinfo-tests:
8089  # Code from module nocrash:
8090  # Code from module non-recursive-gnulib-prefix-hack:
8091  # Code from module nproc:
8092  # Code from module nstrftime:
8093  # Code from module nstrftime-tests:
8094  # Code from module obstack:
8095  # Code from module open:
8096  # Code from module open-tests:
8097  # Code from module openat:
8098  # Code from module openat-die:
8099  # Code from module openat-h:
8100  # Code from module openat-safer:
8101  # Code from module openat-safer-tests:
8102  # Code from module openat-tests:
8103  # Code from module opendir:
8104  # Code from module parse-datetime:
8105  # Code from module parse-datetime-tests:
8106  # Code from module pathmax:
8107  # Code from module pathmax-tests:
8108  # Code from module perl:
8109  # Code from module perror:
8110  # Code from module perror-tests:
8111  # Code from module physmem:
8112  # Code from module pipe-posix:
8113  # Code from module pipe-posix-tests:
8114  # Code from module pipe2:
8115  # Code from module pipe2-tests:
8116  # Code from module posix-shell:
8117  # Code from module posixtm:
8118  # Code from module posixtm-tests:
8119  # Code from module posixver:
8120  # Code from module printf-frexp:
8121  # Code from module printf-frexp-tests:
8122  # Code from module printf-frexpl:
8123  # Code from module printf-frexpl-tests:
8124  # Code from module printf-safe:
8125  # Code from module priv-set:
8126  # Code from module priv-set-tests:
8127  # Code from module progname:
8128  # Code from module propername:
8129  # Code from module pthread:
8130
8131$as_echo "#define _REENTRANT 1" >>confdefs.h
8132
8133
8134$as_echo "#define _THREAD_SAFE 1" >>confdefs.h
8135
8136  # Code from module pthread_sigmask:
8137  # Code from module pthread_sigmask-tests:
8138  # Code from module putenv:
8139  # Code from module qcopy-acl:
8140  # Code from module qset-acl:
8141  # Code from module quote:
8142  # Code from module quotearg:
8143  # Code from module quotearg-simple:
8144  # Code from module quotearg-simple-tests:
8145  # Code from module raise:
8146  # Code from module raise-tests:
8147  # Code from module randint:
8148  # Code from module randperm:
8149  # Code from module randread:
8150  # Code from module randread-tests:
8151  # Code from module read:
8152  # Code from module read-file:
8153  # Code from module read-file-tests:
8154  # Code from module read-tests:
8155  # Code from module readdir:
8156  # Code from module readlink:
8157  # Code from module readlink-tests:
8158  # Code from module readlinkat:
8159  # Code from module readlinkat-tests:
8160  # Code from module readtokens:
8161  # Code from module readtokens-tests:
8162  # Code from module readtokens0:
8163  # Code from module readutmp:
8164  # Code from module realloc-gnu:
8165  # Code from module realloc-gnu-tests:
8166  # Code from module realloc-posix:
8167  # Code from module regex:
8168  # Code from module regex-tests:
8169  # Code from module remove:
8170  # Code from module remove-tests:
8171  # Code from module rename:
8172  # Code from module rename-tests:
8173  # Code from module renameat:
8174  # Code from module renameat-tests:
8175  # Code from module renameat2:
8176  # Code from module renameat2-tests:
8177  # Code from module rewinddir:
8178  # Code from module rmdir:
8179  # Code from module rmdir-tests:
8180  # Code from module root-dev-ino:
8181  # Code from module root-uid:
8182  # Code from module rpmatch:
8183  # Code from module safe-read:
8184  # Code from module safe-write:
8185  # Code from module same:
8186  # Code from module same-inode:
8187  # Code from module save-cwd:
8188  # Code from module savedir:
8189  # Code from module savewd:
8190  # Code from module sched:
8191  # Code from module sched-tests:
8192  # Code from module select:
8193  # Code from module select-tests:
8194  # Code from module selinux-at:
8195  # Code from module selinux-h:
8196  # Code from module servent:
8197  # Code from module setenv:
8198  # Code from module setenv-tests:
8199  # Code from module setlocale:
8200  # Code from module setlocale-tests:
8201  # Code from module setsockopt:
8202  # Code from module setsockopt-tests:
8203  # Code from module settime:
8204  # Code from module sig2str:
8205  # Code from module sigaction:
8206  # Code from module sigaction-tests:
8207  # Code from module signal-h:
8208  # Code from module signal-h-tests:
8209  # Code from module signbit:
8210  # Code from module signbit-tests:
8211  # Code from module sigprocmask:
8212  # Code from module sigprocmask-tests:
8213  # Code from module size_max:
8214  # Code from module sleep:
8215  # Code from module sleep-tests:
8216  # Code from module smack:
8217  # Code from module snippet/_Noreturn:
8218  # Code from module snippet/arg-nonnull:
8219  # Code from module snippet/c++defs:
8220  # Code from module snippet/unused-parameter:
8221  # Code from module snippet/warn-on-use:
8222  # Code from module snprintf:
8223  # Code from module snprintf-tests:
8224  # Code from module socket:
8225  # Code from module socketlib:
8226  # Code from module sockets:
8227  # Code from module sockets-tests:
8228  # Code from module socklen:
8229  # Code from module ssize_t:
8230  # Code from module stat:
8231  # Code from module stat-macros:
8232  # Code from module stat-size:
8233  # Code from module stat-tests:
8234  # Code from module stat-time:
8235  # Code from module stat-time-tests:
8236  # Code from module statat:
8237  # Code from module statat-tests:
8238  # Code from module std-gnu11:
8239  # Code from module stdalign:
8240  # Code from module stdalign-tests:
8241  # Code from module stdarg:
8242
8243
8244
8245  # Code from module stdbool:
8246  # Code from module stdbool-tests:
8247  # Code from module stddef:
8248  # Code from module stddef-tests:
8249  # Code from module stdint:
8250  # Code from module stdint-tests:
8251  # Code from module stdio:
8252  # Code from module stdio-tests:
8253  # Code from module stdlib:
8254  # Code from module stdlib-safer:
8255  # Code from module stdlib-tests:
8256  # Code from module stpcpy:
8257  # Code from module stpncpy:
8258  # Code from module strdup-posix:
8259  # Code from module streq:
8260  # Code from module strerror:
8261  # Code from module strerror-override:
8262  # Code from module strerror-tests:
8263  # Code from module strerror_r-posix:
8264  # Code from module strerror_r-posix-tests:
8265  # Code from module striconv:
8266  # Code from module striconv-tests:
8267  # Code from module string:
8268  # Code from module string-tests:
8269  # Code from module strncat:
8270  # Code from module strncat-tests:
8271  # Code from module strndup:
8272  # Code from module strnlen:
8273  # Code from module strnlen-tests:
8274  # Code from module strnlen1:
8275  # Code from module strnumcmp:
8276  # Code from module strsignal:
8277  # Code from module strsignal-tests:
8278  # Code from module strstr-simple:
8279  # Code from module strtod:
8280  # Code from module strtod-tests:
8281  # Code from module strtoimax:
8282  # Code from module strtoimax-tests:
8283  # Code from module strtoll:
8284  # Code from module strtoll-tests:
8285  # Code from module strtoull:
8286  # Code from module strtoull-tests:
8287  # Code from module strtoumax:
8288  # Code from module strtoumax-tests:
8289  # Code from module symlink:
8290  # Code from module symlink-tests:
8291  # Code from module symlinkat:
8292  # Code from module symlinkat-tests:
8293  # Code from module sys_ioctl:
8294  # Code from module sys_ioctl-tests:
8295  # Code from module sys_resource:
8296  # Code from module sys_resource-tests:
8297  # Code from module sys_select:
8298  # Code from module sys_select-tests:
8299  # Code from module sys_socket:
8300  # Code from module sys_socket-tests:
8301  # Code from module sys_stat:
8302  # Code from module sys_stat-tests:
8303  # Code from module sys_time:
8304  # Code from module sys_time-tests:
8305  # Code from module sys_types:
8306  # Code from module sys_types-tests:
8307  # Code from module sys_uio:
8308  # Code from module sys_uio-tests:
8309  # Code from module sys_utsname:
8310  # Code from module sys_utsname-tests:
8311  # Code from module sys_wait:
8312  # Code from module sys_wait-tests:
8313  # Code from module tempname:
8314  # Code from module termios:
8315  # Code from module termios-tests:
8316  # Code from module test-framework-sh:
8317  # Code from module test-framework-sh-tests:
8318  # Code from module thread:
8319  # Code from module thread-tests:
8320  # Code from module threadlib:
8321
8322
8323
8324  # Code from module time:
8325  # Code from module time-tests:
8326  # Code from module time_r:
8327  # Code from module time_rz:
8328  # Code from module timegm:
8329  # Code from module timer-time:
8330  # Code from module timespec:
8331  # Code from module timespec-add:
8332  # Code from module timespec-sub:
8333  # Code from module timespec-tests:
8334  # Code from module tls:
8335  # Code from module tls-tests:
8336  # Code from module trim:
8337  # Code from module tzset:
8338  # Code from module u64:
8339  # Code from module u64-tests:
8340  # Code from module uname:
8341  # Code from module uname-tests:
8342  # Code from module unicodeio:
8343  # Code from module unistd:
8344  # Code from module unistd-safer:
8345  # Code from module unistd-safer-tests:
8346  # Code from module unistd-tests:
8347  # Code from module unistr/base:
8348  # Code from module unistr/u8-mbtoucr:
8349  # Code from module unistr/u8-mbtoucr-tests:
8350  # Code from module unistr/u8-uctomb:
8351  # Code from module unistr/u8-uctomb-tests:
8352  # Code from module unitypes:
8353  # Code from module uniwidth/base:
8354  # Code from module uniwidth/width:
8355  # Code from module uniwidth/width-tests:
8356  # Code from module unlink:
8357  # Code from module unlink-busy:
8358  # Code from module unlink-tests:
8359  # Code from module unlinkat:
8360  # Code from module unlinkat-tests:
8361  # Code from module unlinkdir:
8362  # Code from module unlocked-io:
8363  # Code from module unsetenv:
8364  # Code from module unsetenv-tests:
8365  # Code from module update-copyright:
8366  # Code from module update-copyright-tests:
8367  # Code from module uptime:
8368  # Code from module useless-if-before-free:
8369  # Code from module userspec:
8370  # Code from module userspec-tests:
8371  # Code from module usleep:
8372  # Code from module usleep-tests:
8373  # Code from module utime:
8374  # Code from module utime-h:
8375  # Code from module utime-h-tests:
8376  # Code from module utime-tests:
8377  # Code from module utimecmp:
8378  # Code from module utimens:
8379  # Code from module utimens-tests:
8380  # Code from module utimensat:
8381  # Code from module utimensat-tests:
8382  # Code from module vasnprintf:
8383  # Code from module vasnprintf-tests:
8384  # Code from module vasprintf:
8385  # Code from module vasprintf-posix:
8386  # Code from module vasprintf-posix-tests:
8387  # Code from module vasprintf-tests:
8388  # Code from module vc-list-files:
8389  # Code from module vc-list-files-tests:
8390  # Code from module verify:
8391  # Code from module verify-tests:
8392  # Code from module verror:
8393  # Code from module version-etc:
8394  # Code from module version-etc-fsf:
8395  # Code from module version-etc-tests:
8396  # Code from module vfprintf-posix:
8397  # Code from module vfprintf-posix-tests:
8398  # Code from module vprintf-posix:
8399  # Code from module vprintf-posix-tests:
8400  # Code from module warnings:
8401  # Code from module wchar:
8402  # Code from module wchar-single:
8403  # Code from module wchar-tests:
8404  # Code from module wcrtomb:
8405  # Code from module wcrtomb-tests:
8406  # Code from module wcswidth:
8407  # Code from module wctob:
8408  # Code from module wctomb:
8409  # Code from module wctype-h:
8410  # Code from module wctype-h-tests:
8411  # Code from module wcwidth:
8412  # Code from module wcwidth-tests:
8413  # Code from module winsz-ioctl:
8414  # Code from module winsz-termios:
8415  # Code from module write:
8416  # Code from module write-any-file:
8417  # Code from module write-tests:
8418  # Code from module xalloc:
8419  # Code from module xalloc-die:
8420  # Code from module xalloc-die-tests:
8421  # Code from module xalloc-oversized:
8422  # Code from module xbinary-io:
8423  # Code from module xdectoint:
8424  # Code from module xfts:
8425  # Code from module xgetcwd:
8426  # Code from module xgetgroups:
8427  # Code from module xgethostname:
8428  # Code from module xmemcoll:
8429  # Code from module xnanosleep:
8430  # Code from module xprintf:
8431  # Code from module xprintf-posix:
8432  # Code from module xprintf-posix-tests:
8433  # Code from module xreadlink:
8434  # Code from module xsize:
8435  # Code from module xstriconv:
8436  # Code from module xstrndup:
8437  # Code from module xstrtod:
8438  # Code from module xstrtoimax:
8439  # Code from module xstrtoimax-tests:
8440  # Code from module xstrtol:
8441  # Code from module xstrtol-tests:
8442  # Code from module xstrtold:
8443  # Code from module xstrtoumax:
8444  # Code from module xstrtoumax-tests:
8445  # Code from module xvasprintf:
8446  # Code from module xvasprintf-tests:
8447  # Code from module year2038:
8448
8449  # Code from module yesno:
8450  # Code from module yesno-tests:
8451  # Code from module yield:
8452
8453
8454
8455
8456
8457
8458          LIBC_FATAL_STDERR_=1
8459  export LIBC_FATAL_STDERR_
8460
8461
8462  gl_need_lib_has_acl=
8463  # Check whether --enable-acl was given.
8464if test "${enable_acl+set}" = set; then :
8465  enableval=$enable_acl;
8466else
8467  enable_acl=auto
8468fi
8469
8470
8471
8472
8473
8474  for ac_func in $ac_func_list
8475do :
8476  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
8477ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
8478if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
8479  cat >>confdefs.h <<_ACEOF
8480#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
8481_ACEOF
8482
8483fi
8484done
8485
8486
8487
8488ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
8489if test "x$ac_cv_type_size_t" = xyes; then :
8490
8491else
8492
8493cat >>confdefs.h <<_ACEOF
8494#define size_t unsigned int
8495_ACEOF
8496
8497fi
8498
8499# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
8500# for constant arguments.  Useless!
8501{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
8502$as_echo_n "checking for working alloca.h... " >&6; }
8503if ${ac_cv_working_alloca_h+:} false; then :
8504  $as_echo_n "(cached) " >&6
8505else
8506  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8507/* end confdefs.h.  */
8508#include <alloca.h>
8509int
8510main ()
8511{
8512char *p = (char *) alloca (2 * sizeof (int));
8513			  if (p) return 0;
8514  ;
8515  return 0;
8516}
8517_ACEOF
8518if ac_fn_c_try_link "$LINENO"; then :
8519  ac_cv_working_alloca_h=yes
8520else
8521  ac_cv_working_alloca_h=no
8522fi
8523rm -f core conftest.err conftest.$ac_objext \
8524    conftest$ac_exeext conftest.$ac_ext
8525fi
8526{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
8527$as_echo "$ac_cv_working_alloca_h" >&6; }
8528if test $ac_cv_working_alloca_h = yes; then
8529
8530$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
8531
8532fi
8533
8534{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
8535$as_echo_n "checking for alloca... " >&6; }
8536if ${ac_cv_func_alloca_works+:} false; then :
8537  $as_echo_n "(cached) " >&6
8538else
8539  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8540/* end confdefs.h.  */
8541#ifdef __GNUC__
8542# define alloca __builtin_alloca
8543#else
8544# ifdef _MSC_VER
8545#  include <malloc.h>
8546#  define alloca _alloca
8547# else
8548#  ifdef HAVE_ALLOCA_H
8549#   include <alloca.h>
8550#  else
8551#   ifdef _AIX
8552 #pragma alloca
8553#   else
8554#    ifndef alloca /* predefined by HP cc +Olibcalls */
8555void *alloca (size_t);
8556#    endif
8557#   endif
8558#  endif
8559# endif
8560#endif
8561
8562int
8563main ()
8564{
8565char *p = (char *) alloca (1);
8566				    if (p) return 0;
8567  ;
8568  return 0;
8569}
8570_ACEOF
8571if ac_fn_c_try_link "$LINENO"; then :
8572  ac_cv_func_alloca_works=yes
8573else
8574  ac_cv_func_alloca_works=no
8575fi
8576rm -f core conftest.err conftest.$ac_objext \
8577    conftest$ac_exeext conftest.$ac_ext
8578fi
8579{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
8580$as_echo "$ac_cv_func_alloca_works" >&6; }
8581
8582if test $ac_cv_func_alloca_works = yes; then
8583
8584$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
8585
8586else
8587  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
8588# that cause trouble.  Some versions do not even contain alloca or
8589# contain a buggy version.  If you still want to use their alloca,
8590# use ar to extract alloca.o from them instead of compiling alloca.c.
8591
8592
8593
8594
8595
8596ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
8597
8598$as_echo "#define C_ALLOCA 1" >>confdefs.h
8599
8600
8601{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
8602$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
8603if ${ac_cv_os_cray+:} false; then :
8604  $as_echo_n "(cached) " >&6
8605else
8606  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8607/* end confdefs.h.  */
8608#if defined CRAY && ! defined CRAY2
8609webecray
8610#else
8611wenotbecray
8612#endif
8613
8614_ACEOF
8615if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8616  $EGREP "webecray" >/dev/null 2>&1; then :
8617  ac_cv_os_cray=yes
8618else
8619  ac_cv_os_cray=no
8620fi
8621rm -f conftest*
8622
8623fi
8624{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
8625$as_echo "$ac_cv_os_cray" >&6; }
8626if test $ac_cv_os_cray = yes; then
8627  for ac_func in _getb67 GETB67 getb67; do
8628    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
8629ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
8630if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
8631
8632cat >>confdefs.h <<_ACEOF
8633#define CRAY_STACKSEG_END $ac_func
8634_ACEOF
8635
8636    break
8637fi
8638
8639  done
8640fi
8641
8642{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
8643$as_echo_n "checking stack direction for C alloca... " >&6; }
8644if ${ac_cv_c_stack_direction+:} false; then :
8645  $as_echo_n "(cached) " >&6
8646else
8647  if test "$cross_compiling" = yes; then :
8648  ac_cv_c_stack_direction=0
8649else
8650  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8651/* end confdefs.h.  */
8652$ac_includes_default
8653int
8654find_stack_direction (int *addr, int depth)
8655{
8656  int dir, dummy = 0;
8657  if (! addr)
8658    addr = &dummy;
8659  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
8660  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
8661  return dir + dummy;
8662}
8663
8664int
8665main (int argc, char **argv)
8666{
8667  return find_stack_direction (0, argc + !argv + 20) < 0;
8668}
8669_ACEOF
8670if ac_fn_c_try_run "$LINENO"; then :
8671  ac_cv_c_stack_direction=1
8672else
8673  ac_cv_c_stack_direction=-1
8674fi
8675rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8676  conftest.$ac_objext conftest.beam conftest.$ac_ext
8677fi
8678
8679fi
8680{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
8681$as_echo "$ac_cv_c_stack_direction" >&6; }
8682cat >>confdefs.h <<_ACEOF
8683#define STACK_DIRECTION $ac_cv_c_stack_direction
8684_ACEOF
8685
8686
8687fi
8688
8689
8690  GNULIB_INET_NTOP=0;
8691  GNULIB_INET_PTON=0;
8692    HAVE_DECL_INET_NTOP=1;
8693  HAVE_DECL_INET_PTON=1;
8694  REPLACE_INET_NTOP=0;
8695  REPLACE_INET_PTON=0;
8696
8697
8698
8699
8700  for ac_header in $ac_header_list
8701do :
8702  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
8703ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
8704"
8705if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
8706  cat >>confdefs.h <<_ACEOF
8707#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
8708_ACEOF
8709
8710fi
8711
8712done
8713
8714
8715
8716
8717
8718  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
8719$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
8720if ${gl_cv_have_include_next+:} false; then :
8721  $as_echo_n "(cached) " >&6
8722else
8723  rm -rf conftestd1a conftestd1b conftestd2
8724     mkdir conftestd1a conftestd1b conftestd2
8725                                                  cat <<EOF > conftestd1a/conftest.h
8726#define DEFINED_IN_CONFTESTD1
8727#include_next <conftest.h>
8728#ifdef DEFINED_IN_CONFTESTD2
8729int foo;
8730#else
8731#error "include_next doesn't work"
8732#endif
8733EOF
8734     cat <<EOF > conftestd1b/conftest.h
8735#define DEFINED_IN_CONFTESTD1
8736#include <stdio.h>
8737#include_next <conftest.h>
8738#ifdef DEFINED_IN_CONFTESTD2
8739int foo;
8740#else
8741#error "include_next doesn't work"
8742#endif
8743EOF
8744     cat <<EOF > conftestd2/conftest.h
8745#ifndef DEFINED_IN_CONFTESTD1
8746#error "include_next test doesn't work"
8747#endif
8748#define DEFINED_IN_CONFTESTD2
8749EOF
8750     gl_save_CPPFLAGS="$CPPFLAGS"
8751     CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
8752     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8753/* end confdefs.h.  */
8754#include <conftest.h>
8755_ACEOF
8756if ac_fn_c_try_compile "$LINENO"; then :
8757  gl_cv_have_include_next=yes
8758else
8759  CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
8760        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8761/* end confdefs.h.  */
8762#include <conftest.h>
8763_ACEOF
8764if ac_fn_c_try_compile "$LINENO"; then :
8765  gl_cv_have_include_next=buggy
8766else
8767  gl_cv_have_include_next=no
8768fi
8769rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8770
8771fi
8772rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8773     CPPFLAGS="$gl_save_CPPFLAGS"
8774     rm -rf conftestd1a conftestd1b conftestd2
8775
8776fi
8777{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
8778$as_echo "$gl_cv_have_include_next" >&6; }
8779  PRAGMA_SYSTEM_HEADER=
8780  if test $gl_cv_have_include_next = yes; then
8781    INCLUDE_NEXT=include_next
8782    INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
8783    if test -n "$GCC"; then
8784      PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
8785    fi
8786  else
8787    if test $gl_cv_have_include_next = buggy; then
8788      INCLUDE_NEXT=include
8789      INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
8790    else
8791      INCLUDE_NEXT=include
8792      INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
8793    fi
8794  fi
8795
8796
8797
8798  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5
8799$as_echo_n "checking whether system header files limit the line length... " >&6; }
8800if ${gl_cv_pragma_columns+:} false; then :
8801  $as_echo_n "(cached) " >&6
8802else
8803       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8804/* end confdefs.h.  */
8805
8806#ifdef __TANDEM
8807choke me
8808#endif
8809
8810_ACEOF
8811if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8812  $EGREP "choke me" >/dev/null 2>&1; then :
8813  gl_cv_pragma_columns=yes
8814else
8815  gl_cv_pragma_columns=no
8816fi
8817rm -f conftest*
8818
8819
8820fi
8821{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5
8822$as_echo "$gl_cv_pragma_columns" >&6; }
8823  if test $gl_cv_pragma_columns = yes; then
8824    PRAGMA_COLUMNS="#pragma COLUMNS 10000"
8825  else
8826    PRAGMA_COLUMNS=
8827  fi
8828
8829
8830
8831
8832
8833
8834  if test $ac_cv_header_features_h = yes; then
8835    HAVE_FEATURES_H=1
8836  else
8837    HAVE_FEATURES_H=0
8838  fi
8839
8840
8841    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
8842$as_echo_n "checking for d_ino member in directory struct... " >&6; }
8843if ${gl_cv_struct_dirent_d_ino+:} false; then :
8844  $as_echo_n "(cached) " >&6
8845else
8846  if test "$cross_compiling" = yes; then :
8847  case "$host_os" in
8848                           # Guess yes on glibc systems with Linux kernel.
8849              linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
8850                           # Guess no on native Windows.
8851              mingw*)      gl_cv_struct_dirent_d_ino="guessing no" ;;
8852                           # If we don't know, assume the worst.
8853              *)           gl_cv_struct_dirent_d_ino="guessing no" ;;
8854            esac
8855
8856else
8857  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8858/* end confdefs.h.  */
8859#include <sys/types.h>
8860             #include <sys/stat.h>
8861             #include <dirent.h>
8862
8863int
8864main ()
8865{
8866DIR *dp = opendir (".");
8867             struct dirent *e;
8868             struct stat st;
8869             if (! dp)
8870               return 1;
8871             e = readdir (dp);
8872             if (! e)
8873               { closedir (dp); return 2; }
8874             if (lstat (e->d_name, &st) != 0)
8875               { closedir (dp); return 3; }
8876             if (e->d_ino != st.st_ino)
8877               { closedir (dp); return 4; }
8878             closedir (dp);
8879             return 0;
8880
8881  ;
8882  return 0;
8883}
8884_ACEOF
8885if ac_fn_c_try_run "$LINENO"; then :
8886  gl_cv_struct_dirent_d_ino=yes
8887else
8888  gl_cv_struct_dirent_d_ino=no
8889fi
8890rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8891  conftest.$ac_objext conftest.beam conftest.$ac_ext
8892fi
8893
8894fi
8895{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
8896$as_echo "$gl_cv_struct_dirent_d_ino" >&6; }
8897   case "$gl_cv_struct_dirent_d_ino" in
8898     *yes)
8899
8900$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
8901
8902       ;;
8903   esac
8904
8905
8906{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long file names" >&5
8907$as_echo_n "checking for long file names... " >&6; }
8908if ${ac_cv_sys_long_file_names+:} false; then :
8909  $as_echo_n "(cached) " >&6
8910else
8911  ac_cv_sys_long_file_names=yes
8912# Test for long file names in all the places we know might matter:
8913#      .		the current directory, where building will happen
8914#      $prefix/lib	where we will be installing things
8915#      $exec_prefix/lib	likewise
8916#      $TMPDIR		if set, where it might want to write temporary files
8917#      /tmp		where it might want to write temporary files
8918#      /var/tmp		likewise
8919#      /usr/tmp		likewise
8920for ac_dir in . "$TMPDIR" /tmp /var/tmp /usr/tmp "$prefix/lib" "$exec_prefix/lib"; do
8921  # Skip $TMPDIR if it is empty or bogus, and skip $exec_prefix/lib
8922  # in the usual case where exec_prefix is '${prefix}'.
8923  case $ac_dir in #(
8924    . | /* | ?:[\\/]*) ;; #(
8925    *) continue;;
8926  esac
8927  test -w "$ac_dir/." || continue # It is less confusing to not echo anything here.
8928  ac_xdir=$ac_dir/cf$$
8929  (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
8930  ac_tf1=$ac_xdir/conftest9012345
8931  ac_tf2=$ac_xdir/conftest9012346
8932  touch "$ac_tf1" 2>/dev/null && test -f "$ac_tf1" && test ! -f "$ac_tf2" ||
8933    ac_cv_sys_long_file_names=no
8934  rm -f -r "$ac_xdir" 2>/dev/null
8935  test $ac_cv_sys_long_file_names = no && break
8936done
8937fi
8938{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_long_file_names" >&5
8939$as_echo "$ac_cv_sys_long_file_names" >&6; }
8940if test $ac_cv_sys_long_file_names = yes; then
8941
8942$as_echo "#define HAVE_LONG_FILE_NAMES 1" >>confdefs.h
8943
8944fi
8945
8946
8947
8948{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
8949$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
8950if ${ac_cv_c_restrict+:} false; then :
8951  $as_echo_n "(cached) " >&6
8952else
8953  ac_cv_c_restrict=no
8954   # The order here caters to the fact that C++ does not require restrict.
8955   for ac_kw in __restrict __restrict__ _Restrict restrict; do
8956     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8957/* end confdefs.h.  */
8958typedef int *int_ptr;
8959           int foo (int_ptr $ac_kw ip) { return ip[0]; }
8960           int bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
8961           int bar (int ip[$ac_kw]) { return ip[0]; }
8962
8963int
8964main ()
8965{
8966int s[1];
8967           int *$ac_kw t = s;
8968           t[0] = 0;
8969           return foo (t) + bar (t);
8970
8971  ;
8972  return 0;
8973}
8974_ACEOF
8975if ac_fn_c_try_compile "$LINENO"; then :
8976  ac_cv_c_restrict=$ac_kw
8977fi
8978rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8979     test "$ac_cv_c_restrict" != no && break
8980   done
8981
8982fi
8983{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
8984$as_echo "$ac_cv_c_restrict" >&6; }
8985
8986 case $ac_cv_c_restrict in
8987   restrict) ;;
8988   no) $as_echo "#define restrict /**/" >>confdefs.h
8989 ;;
8990   *)  cat >>confdefs.h <<_ACEOF
8991#define restrict $ac_cv_c_restrict
8992_ACEOF
8993 ;;
8994 esac
8995
8996
8997  GNULIB_BTOWC=0;
8998  GNULIB_WCTOB=0;
8999  GNULIB_MBSINIT=0;
9000  GNULIB_MBRTOWC=0;
9001  GNULIB_MBRLEN=0;
9002  GNULIB_MBSRTOWCS=0;
9003  GNULIB_MBSNRTOWCS=0;
9004  GNULIB_WCRTOMB=0;
9005  GNULIB_WCSRTOMBS=0;
9006  GNULIB_WCSNRTOMBS=0;
9007  GNULIB_WCWIDTH=0;
9008  GNULIB_WMEMCHR=0;
9009  GNULIB_WMEMCMP=0;
9010  GNULIB_WMEMCPY=0;
9011  GNULIB_WMEMMOVE=0;
9012  GNULIB_WMEMSET=0;
9013  GNULIB_WCSLEN=0;
9014  GNULIB_WCSNLEN=0;
9015  GNULIB_WCSCPY=0;
9016  GNULIB_WCPCPY=0;
9017  GNULIB_WCSNCPY=0;
9018  GNULIB_WCPNCPY=0;
9019  GNULIB_WCSCAT=0;
9020  GNULIB_WCSNCAT=0;
9021  GNULIB_WCSCMP=0;
9022  GNULIB_WCSNCMP=0;
9023  GNULIB_WCSCASECMP=0;
9024  GNULIB_WCSNCASECMP=0;
9025  GNULIB_WCSCOLL=0;
9026  GNULIB_WCSXFRM=0;
9027  GNULIB_WCSDUP=0;
9028  GNULIB_WCSCHR=0;
9029  GNULIB_WCSRCHR=0;
9030  GNULIB_WCSCSPN=0;
9031  GNULIB_WCSSPN=0;
9032  GNULIB_WCSPBRK=0;
9033  GNULIB_WCSSTR=0;
9034  GNULIB_WCSTOK=0;
9035  GNULIB_WCSWIDTH=0;
9036  GNULIB_WCSFTIME=0;
9037    HAVE_BTOWC=1;
9038  HAVE_MBSINIT=1;
9039  HAVE_MBRTOWC=1;
9040  HAVE_MBRLEN=1;
9041  HAVE_MBSRTOWCS=1;
9042  HAVE_MBSNRTOWCS=1;
9043  HAVE_WCRTOMB=1;
9044  HAVE_WCSRTOMBS=1;
9045  HAVE_WCSNRTOMBS=1;
9046  HAVE_WMEMCHR=1;
9047  HAVE_WMEMCMP=1;
9048  HAVE_WMEMCPY=1;
9049  HAVE_WMEMMOVE=1;
9050  HAVE_WMEMSET=1;
9051  HAVE_WCSLEN=1;
9052  HAVE_WCSNLEN=1;
9053  HAVE_WCSCPY=1;
9054  HAVE_WCPCPY=1;
9055  HAVE_WCSNCPY=1;
9056  HAVE_WCPNCPY=1;
9057  HAVE_WCSCAT=1;
9058  HAVE_WCSNCAT=1;
9059  HAVE_WCSCMP=1;
9060  HAVE_WCSNCMP=1;
9061  HAVE_WCSCASECMP=1;
9062  HAVE_WCSNCASECMP=1;
9063  HAVE_WCSCOLL=1;
9064  HAVE_WCSXFRM=1;
9065  HAVE_WCSDUP=1;
9066  HAVE_WCSCHR=1;
9067  HAVE_WCSRCHR=1;
9068  HAVE_WCSCSPN=1;
9069  HAVE_WCSSPN=1;
9070  HAVE_WCSPBRK=1;
9071  HAVE_WCSSTR=1;
9072  HAVE_WCSTOK=1;
9073  HAVE_WCSWIDTH=1;
9074  HAVE_WCSFTIME=1;
9075  HAVE_DECL_WCTOB=1;
9076  HAVE_DECL_WCWIDTH=1;
9077  REPLACE_MBSTATE_T=0;
9078  REPLACE_BTOWC=0;
9079  REPLACE_WCTOB=0;
9080  REPLACE_MBSINIT=0;
9081  REPLACE_MBRTOWC=0;
9082  REPLACE_MBRLEN=0;
9083  REPLACE_MBSRTOWCS=0;
9084  REPLACE_MBSNRTOWCS=0;
9085  REPLACE_WCRTOMB=0;
9086  REPLACE_WCSRTOMBS=0;
9087  REPLACE_WCSNRTOMBS=0;
9088  REPLACE_WCWIDTH=0;
9089  REPLACE_WCSWIDTH=0;
9090  REPLACE_WCSFTIME=0;
9091
9092
9093            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
9094$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
9095if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
9096  $as_echo_n "(cached) " >&6
9097else
9098  gl_cv_header_wchar_h_correct_inline=yes
9099     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9100/* end confdefs.h.  */
9101
9102       #define wcstod renamed_wcstod
9103/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
9104   <wchar.h>.
9105   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
9106   included before <wchar.h>.  */
9107#include <stddef.h>
9108#include <stdio.h>
9109#include <time.h>
9110#include <wchar.h>
9111extern int zero (void);
9112int main () { return zero(); }
9113
9114_ACEOF
9115                              save_ac_compile="$ac_compile"
9116     ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
9117     if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
9118  (eval $ac_compile) 2>&5
9119  ac_status=$?
9120  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9121  test $ac_status = 0; }; then
9122       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9123/* end confdefs.h.  */
9124
9125         #define wcstod renamed_wcstod
9126/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
9127   <wchar.h>.
9128   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
9129   included before <wchar.h>.  */
9130#include <stddef.h>
9131#include <stdio.h>
9132#include <time.h>
9133#include <wchar.h>
9134int zero (void) { return 0; }
9135
9136_ACEOF
9137              ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
9138       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
9139  (eval $ac_compile) 2>&5
9140  ac_status=$?
9141  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9142  test $ac_status = 0; }; then
9143         if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
9144           :
9145         else
9146           gl_cv_header_wchar_h_correct_inline=no
9147         fi
9148       fi
9149     fi
9150     ac_compile="$save_ac_compile"
9151     rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
9152
9153fi
9154{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
9155$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
9156  if test $gl_cv_header_wchar_h_correct_inline = no; then
9157    as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
9158This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
9159C99 mode. You have four options:
9160  - Add the flag -fgnu89-inline to CC and reconfigure, or
9161  - Fix your include files, using parts of
9162    <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
9163  - Use a gcc version older than 4.3, or
9164  - Don't use the flags -std=c99 or -std=gnu99.
9165Configuration aborted." "$LINENO" 5
9166  fi
9167
9168
9169
9170
9171  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
9172$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
9173if ${am_cv_langinfo_codeset+:} false; then :
9174  $as_echo_n "(cached) " >&6
9175else
9176  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9177/* end confdefs.h.  */
9178#include <langinfo.h>
9179int
9180main ()
9181{
9182char* cs = nl_langinfo(CODESET); return !cs;
9183  ;
9184  return 0;
9185}
9186_ACEOF
9187if ac_fn_c_try_link "$LINENO"; then :
9188  am_cv_langinfo_codeset=yes
9189else
9190  am_cv_langinfo_codeset=no
9191fi
9192rm -f core conftest.err conftest.$ac_objext \
9193    conftest$ac_exeext conftest.$ac_ext
9194
9195fi
9196{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
9197$as_echo "$am_cv_langinfo_codeset" >&6; }
9198  if test $am_cv_langinfo_codeset = yes; then
9199
9200$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
9201
9202  fi
9203
9204
9205
9206
9207  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
9208$as_echo_n "checking for a traditional french locale... " >&6; }
9209if ${gt_cv_locale_fr+:} false; then :
9210  $as_echo_n "(cached) " >&6
9211else
9212
9213    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9214/* end confdefs.h.  */
9215
9216#include <locale.h>
9217#include <time.h>
9218#if HAVE_LANGINFO_CODESET
9219# include <langinfo.h>
9220#endif
9221#include <stdlib.h>
9222#include <string.h>
9223struct tm t;
9224char buf[16];
9225int main () {
9226  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
9227     imitates locale dependent behaviour by looking at the environment
9228     variables, and all locales use the UTF-8 encoding.  */
9229#if defined __BEOS__ || defined __HAIKU__
9230  return 1;
9231#else
9232  /* Check whether the given locale name is recognized by the system.  */
9233# if defined _WIN32 && !defined __CYGWIN__
9234  /* On native Windows, setlocale(category, "") looks at the system settings,
9235     not at the environment variables.  Also, when an encoding suffix such
9236     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
9237     category of the locale to "C".  */
9238  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
9239      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
9240    return 1;
9241# else
9242  if (setlocale (LC_ALL, "") == NULL) return 1;
9243# endif
9244  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
9245     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
9246     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
9247     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
9248     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
9249     some unit tests fail.
9250     On MirBSD 10, when an unsupported locale is specified, setlocale()
9251     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
9252# if HAVE_LANGINFO_CODESET
9253  {
9254    const char *cs = nl_langinfo (CODESET);
9255    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
9256        || strcmp (cs, "UTF-8") == 0)
9257      return 1;
9258  }
9259# endif
9260# ifdef __CYGWIN__
9261  /* On Cygwin, avoid locale names without encoding suffix, because the
9262     locale_charset() function relies on the encoding suffix.  Note that
9263     LC_ALL is set on the command line.  */
9264  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
9265# endif
9266  /* Check whether in the abbreviation of the second month, the second
9267     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
9268     one byte long. This excludes the UTF-8 encoding.  */
9269  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
9270  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
9271# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
9272  /* Check whether the decimal separator is a comma.
9273     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
9274     are nl_langinfo(RADIXCHAR) are both ".".  */
9275  if (localeconv () ->decimal_point[0] != ',') return 1;
9276# endif
9277  return 0;
9278#endif
9279}
9280
9281_ACEOF
9282    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
9283  (eval $ac_link) 2>&5
9284  ac_status=$?
9285  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9286  test $ac_status = 0; } && test -s conftest$ac_exeext; then
9287      case "$host_os" in
9288        # Handle native Windows specially, because there setlocale() interprets
9289        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
9290        # "fr" or "fra" as "French" or "French_France.1252",
9291        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
9292        # "ja" as "Japanese" or "Japanese_Japan.932",
9293        # and similar.
9294        mingw*)
9295          # Test for the native Windows locale name.
9296          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
9297            gt_cv_locale_fr=French_France.1252
9298          else
9299            # None found.
9300            gt_cv_locale_fr=none
9301          fi
9302          ;;
9303        *)
9304          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
9305          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
9306          # configure script would override the LC_ALL setting. Likewise for
9307          # LC_CTYPE, which is also set at the beginning of the configure script.
9308          # Test for the usual locale name.
9309          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
9310            gt_cv_locale_fr=fr_FR
9311          else
9312            # Test for the locale name with explicit encoding suffix.
9313            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
9314              gt_cv_locale_fr=fr_FR.ISO-8859-1
9315            else
9316              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
9317              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
9318                gt_cv_locale_fr=fr_FR.ISO8859-1
9319              else
9320                # Test for the HP-UX locale name.
9321                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
9322                  gt_cv_locale_fr=fr_FR.iso88591
9323                else
9324                  # Test for the Solaris 7 locale name.
9325                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
9326                    gt_cv_locale_fr=fr
9327                  else
9328                    # None found.
9329                    gt_cv_locale_fr=none
9330                  fi
9331                fi
9332              fi
9333            fi
9334          fi
9335          ;;
9336      esac
9337    fi
9338    rm -fr conftest*
9339
9340fi
9341{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
9342$as_echo "$gt_cv_locale_fr" >&6; }
9343  LOCALE_FR=$gt_cv_locale_fr
9344
9345
9346
9347
9348
9349  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtold conforms to C99" >&5
9350$as_echo_n "checking whether strtold conforms to C99... " >&6; }
9351if ${gl_cv_func_c99_strtold+:} false; then :
9352  $as_echo_n "(cached) " >&6
9353else
9354  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9355/* end confdefs.h.  */
9356/* On HP-UX before 11.23, strtold returns a struct instead of
9357                long double.  Reject implementations like that, by requiring
9358                compatibility with the C99 prototype.  */
9359             #include <stdlib.h>
9360             static long double (*p) (char const *, char **) = strtold;
9361             static long double
9362             test (char const *nptr, char **endptr)
9363             {
9364               long double r;
9365               r = strtold (nptr, endptr);
9366               return r;
9367             }
9368int
9369main ()
9370{
9371return test ("1.0", NULL) != 1 || p ("1.0", NULL) != 1;
9372  ;
9373  return 0;
9374}
9375_ACEOF
9376if ac_fn_c_try_link "$LINENO"; then :
9377  gl_cv_func_c99_strtold=yes
9378else
9379  gl_cv_func_c99_strtold=no
9380fi
9381rm -f core conftest.err conftest.$ac_objext \
9382    conftest$ac_exeext conftest.$ac_ext
9383fi
9384{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_c99_strtold" >&5
9385$as_echo "$gl_cv_func_c99_strtold" >&6; }
9386  if test $gl_cv_func_c99_strtold = yes; then
9387
9388$as_echo "#define HAVE_C99_STRTOLD 1" >>confdefs.h
9389
9390  fi
9391
9392
9393  GNULIB__EXIT=0;
9394  GNULIB_ATOLL=0;
9395  GNULIB_CALLOC_POSIX=0;
9396  GNULIB_CANONICALIZE_FILE_NAME=0;
9397  GNULIB_GETLOADAVG=0;
9398  GNULIB_GETSUBOPT=0;
9399  GNULIB_GRANTPT=0;
9400  GNULIB_MALLOC_POSIX=0;
9401  GNULIB_MBTOWC=0;
9402  GNULIB_MKDTEMP=0;
9403  GNULIB_MKOSTEMP=0;
9404  GNULIB_MKOSTEMPS=0;
9405  GNULIB_MKSTEMP=0;
9406  GNULIB_MKSTEMPS=0;
9407  GNULIB_POSIX_OPENPT=0;
9408  GNULIB_PTSNAME=0;
9409  GNULIB_PTSNAME_R=0;
9410  GNULIB_PUTENV=0;
9411  GNULIB_QSORT_R=0;
9412  GNULIB_RANDOM=0;
9413  GNULIB_RANDOM_R=0;
9414  GNULIB_REALLOCARRAY=0;
9415  GNULIB_REALLOC_POSIX=0;
9416  GNULIB_REALPATH=0;
9417  GNULIB_RPMATCH=0;
9418  GNULIB_SECURE_GETENV=0;
9419  GNULIB_SETENV=0;
9420  GNULIB_STRTOD=0;
9421  GNULIB_STRTOLL=0;
9422  GNULIB_STRTOULL=0;
9423  GNULIB_SYSTEM_POSIX=0;
9424  GNULIB_UNLOCKPT=0;
9425  GNULIB_UNSETENV=0;
9426  GNULIB_WCTOMB=0;
9427    HAVE__EXIT=1;
9428  HAVE_ATOLL=1;
9429  HAVE_CANONICALIZE_FILE_NAME=1;
9430  HAVE_DECL_GETLOADAVG=1;
9431  HAVE_GETSUBOPT=1;
9432  HAVE_GRANTPT=1;
9433  HAVE_DECL_INITSTATE=1;
9434  HAVE_MKDTEMP=1;
9435  HAVE_MKOSTEMP=1;
9436  HAVE_MKOSTEMPS=1;
9437  HAVE_MKSTEMP=1;
9438  HAVE_MKSTEMPS=1;
9439  HAVE_POSIX_OPENPT=1;
9440  HAVE_PTSNAME=1;
9441  HAVE_PTSNAME_R=1;
9442  HAVE_QSORT_R=1;
9443  HAVE_RANDOM=1;
9444  HAVE_RANDOM_H=1;
9445  HAVE_RANDOM_R=1;
9446  HAVE_REALLOCARRAY=1;
9447  HAVE_REALPATH=1;
9448  HAVE_RPMATCH=1;
9449  HAVE_SECURE_GETENV=1;
9450  HAVE_SETENV=1;
9451  HAVE_DECL_SETENV=1;
9452  HAVE_DECL_SETSTATE=1;
9453  HAVE_STRTOD=1;
9454  HAVE_STRTOLL=1;
9455  HAVE_STRTOULL=1;
9456  HAVE_STRUCT_RANDOM_DATA=1;
9457  HAVE_SYS_LOADAVG_H=0;
9458  HAVE_UNLOCKPT=1;
9459  HAVE_DECL_UNSETENV=1;
9460  REPLACE_CALLOC=0;
9461  REPLACE_CANONICALIZE_FILE_NAME=0;
9462  REPLACE_MALLOC=0;
9463  REPLACE_MBTOWC=0;
9464  REPLACE_MKSTEMP=0;
9465  REPLACE_PTSNAME=0;
9466  REPLACE_PTSNAME_R=0;
9467  REPLACE_PUTENV=0;
9468  REPLACE_QSORT_R=0;
9469  REPLACE_RANDOM_R=0;
9470  REPLACE_REALLOC=0;
9471  REPLACE_REALPATH=0;
9472  REPLACE_SETENV=0;
9473  REPLACE_STRTOD=0;
9474  REPLACE_UNSETENV=0;
9475  REPLACE_WCTOMB=0;
9476
9477
9478  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
9479$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
9480if ${gl_cv_func_malloc_posix+:} false; then :
9481  $as_echo_n "(cached) " >&6
9482else
9483
9484                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9485/* end confdefs.h.  */
9486
9487int
9488main ()
9489{
9490#if defined _WIN32 && ! defined __CYGWIN__
9491             choke me
9492             #endif
9493
9494  ;
9495  return 0;
9496}
9497_ACEOF
9498if ac_fn_c_try_compile "$LINENO"; then :
9499  gl_cv_func_malloc_posix=yes
9500else
9501  gl_cv_func_malloc_posix=no
9502fi
9503rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9504
9505fi
9506{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
9507$as_echo "$gl_cv_func_malloc_posix" >&6; }
9508
9509
9510
9511
9512
9513  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
9514$as_echo_n "checking whether // is distinct from /... " >&6; }
9515if ${gl_cv_double_slash_root+:} false; then :
9516  $as_echo_n "(cached) " >&6
9517else
9518   if test x"$cross_compiling" = xyes ; then
9519        # When cross-compiling, there is no way to tell whether // is special
9520        # short of a list of hosts.  However, the only known hosts to date
9521        # that have a distinct // are Apollo DomainOS (too old to port to),
9522        # Cygwin, and z/OS.  If anyone knows of another system for which // has
9523        # special semantics and is distinct from /, please report it to
9524        # <bug-gnulib@gnu.org>.
9525        case $host in
9526          *-cygwin | i370-ibm-openedition)
9527            gl_cv_double_slash_root=yes ;;
9528          *)
9529            # Be optimistic and assume that / and // are the same when we
9530            # don't know.
9531            gl_cv_double_slash_root='unknown, assuming no' ;;
9532        esac
9533      else
9534        set x `ls -di / // 2>/dev/null`
9535        if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
9536          gl_cv_double_slash_root=no
9537        else
9538          gl_cv_double_slash_root=yes
9539        fi
9540      fi
9541fi
9542{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
9543$as_echo "$gl_cv_double_slash_root" >&6; }
9544  if test "$gl_cv_double_slash_root" = yes; then
9545
9546$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
9547
9548  fi
9549
9550
9551
9552
9553
9554     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5
9555$as_echo_n "checking whether realpath works... " >&6; }
9556if ${gl_cv_func_realpath_works+:} false; then :
9557  $as_echo_n "(cached) " >&6
9558else
9559
9560    touch conftest.a
9561    mkdir conftest.d
9562    if test "$cross_compiling" = yes; then :
9563  case "$host_os" in
9564                       # Guess yes on glibc systems.
9565        *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
9566                       # Guess no on native Windows.
9567        mingw*)        gl_cv_func_realpath_works="guessing no" ;;
9568                       # If we don't know, assume the worst.
9569        *)             gl_cv_func_realpath_works="guessing no" ;;
9570      esac
9571
9572else
9573  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9574/* end confdefs.h.  */
9575
9576
9577
9578#include <stdlib.h>
9579#if defined __MACH__ && defined __APPLE__
9580/* Avoid a crash on Mac OS X.  */
9581#include <mach/mach.h>
9582#include <mach/mach_error.h>
9583#include <mach/thread_status.h>
9584#include <mach/exception.h>
9585#include <mach/task.h>
9586#include <pthread.h>
9587/* The exception port on which our thread listens.  */
9588static mach_port_t our_exception_port;
9589/* The main function of the thread listening for exceptions of type
9590   EXC_BAD_ACCESS.  */
9591static void *
9592mach_exception_thread (void *arg)
9593{
9594  /* Buffer for a message to be received.  */
9595  struct {
9596    mach_msg_header_t head;
9597    mach_msg_body_t msgh_body;
9598    char data[1024];
9599  } msg;
9600  mach_msg_return_t retval;
9601  /* Wait for a message on the exception port.  */
9602  retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
9603                     our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
9604  if (retval != MACH_MSG_SUCCESS)
9605    abort ();
9606  exit (1);
9607}
9608static void
9609nocrash_init (void)
9610{
9611  mach_port_t self = mach_task_self ();
9612  /* Allocate a port on which the thread shall listen for exceptions.  */
9613  if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
9614      == KERN_SUCCESS) {
9615    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
9616    if (mach_port_insert_right (self, our_exception_port, our_exception_port,
9617                                MACH_MSG_TYPE_MAKE_SEND)
9618        == KERN_SUCCESS) {
9619      /* The exceptions we want to catch.  Only EXC_BAD_ACCESS is interesting
9620         for us.  */
9621      exception_mask_t mask = EXC_MASK_BAD_ACCESS;
9622      /* Create the thread listening on the exception port.  */
9623      pthread_attr_t attr;
9624      pthread_t thread;
9625      if (pthread_attr_init (&attr) == 0
9626          && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
9627          && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
9628        pthread_attr_destroy (&attr);
9629        /* Replace the exception port info for these exceptions with our own.
9630           Note that we replace the exception port for the entire task, not only
9631           for a particular thread.  This has the effect that when our exception
9632           port gets the message, the thread specific exception port has already
9633           been asked, and we don't need to bother about it.
9634           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
9635        task_set_exception_ports (self, mask, our_exception_port,
9636                                  EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
9637      }
9638    }
9639  }
9640}
9641#elif defined _WIN32 && ! defined __CYGWIN__
9642/* Avoid a crash on native Windows.  */
9643#define WIN32_LEAN_AND_MEAN
9644#include <windows.h>
9645#include <winerror.h>
9646static LONG WINAPI
9647exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
9648{
9649  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
9650    {
9651    case EXCEPTION_ACCESS_VIOLATION:
9652    case EXCEPTION_IN_PAGE_ERROR:
9653    case EXCEPTION_STACK_OVERFLOW:
9654    case EXCEPTION_GUARD_PAGE:
9655    case EXCEPTION_PRIV_INSTRUCTION:
9656    case EXCEPTION_ILLEGAL_INSTRUCTION:
9657    case EXCEPTION_DATATYPE_MISALIGNMENT:
9658    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
9659    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
9660      exit (1);
9661    }
9662  return EXCEPTION_CONTINUE_SEARCH;
9663}
9664static void
9665nocrash_init (void)
9666{
9667  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
9668}
9669#else
9670/* Avoid a crash on POSIX systems.  */
9671#include <signal.h>
9672#include <unistd.h>
9673/* A POSIX signal handler.  */
9674static void
9675exception_handler (int sig)
9676{
9677  _exit (1);
9678}
9679static void
9680nocrash_init (void)
9681{
9682#ifdef SIGSEGV
9683  signal (SIGSEGV, exception_handler);
9684#endif
9685#ifdef SIGBUS
9686  signal (SIGBUS, exception_handler);
9687#endif
9688}
9689#endif
9690
9691        #include <stdlib.h>
9692        #include <string.h>
9693
9694int
9695main ()
9696{
9697
9698        int result = 0;
9699        {
9700          char *name = realpath ("conftest.a", NULL);
9701          if (!(name && *name == '/'))
9702            result |= 1;
9703          free (name);
9704        }
9705        {
9706          char *name = realpath ("conftest.b/../conftest.a", NULL);
9707          if (name != NULL)
9708            result |= 2;
9709          free (name);
9710        }
9711        {
9712          char *name = realpath ("conftest.a/", NULL);
9713          if (name != NULL)
9714            result |= 4;
9715          free (name);
9716        }
9717        {
9718          char *name1 = realpath (".", NULL);
9719          char *name2 = realpath ("conftest.d//./..", NULL);
9720          if (! name1 || ! name2 || strcmp (name1, name2))
9721            result |= 8;
9722          free (name1);
9723          free (name2);
9724        }
9725        return result;
9726
9727  ;
9728  return 0;
9729}
9730
9731_ACEOF
9732if ac_fn_c_try_run "$LINENO"; then :
9733  gl_cv_func_realpath_works=yes
9734else
9735  gl_cv_func_realpath_works=no
9736fi
9737rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9738  conftest.$ac_objext conftest.beam conftest.$ac_ext
9739fi
9740
9741    rm -rf conftest.a conftest.d
9742
9743fi
9744{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
9745$as_echo "$gl_cv_func_realpath_works" >&6; }
9746  case "$gl_cv_func_realpath_works" in
9747    *yes)
9748
9749$as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
9750
9751      ;;
9752  esac
9753
9754
9755
9756
9757  GNULIB_CHDIR=0;
9758  GNULIB_CHOWN=0;
9759  GNULIB_CLOSE=0;
9760  GNULIB_DUP=0;
9761  GNULIB_DUP2=0;
9762  GNULIB_DUP3=0;
9763  GNULIB_ENVIRON=0;
9764  GNULIB_EUIDACCESS=0;
9765  GNULIB_FACCESSAT=0;
9766  GNULIB_FCHDIR=0;
9767  GNULIB_FCHOWNAT=0;
9768  GNULIB_FDATASYNC=0;
9769  GNULIB_FSYNC=0;
9770  GNULIB_FTRUNCATE=0;
9771  GNULIB_GETCWD=0;
9772  GNULIB_GETDOMAINNAME=0;
9773  GNULIB_GETDTABLESIZE=0;
9774  GNULIB_GETGROUPS=0;
9775  GNULIB_GETHOSTNAME=0;
9776  GNULIB_GETLOGIN=0;
9777  GNULIB_GETLOGIN_R=0;
9778  GNULIB_GETPAGESIZE=0;
9779  GNULIB_GETUSERSHELL=0;
9780  GNULIB_GROUP_MEMBER=0;
9781  GNULIB_ISATTY=0;
9782  GNULIB_LCHOWN=0;
9783  GNULIB_LINK=0;
9784  GNULIB_LINKAT=0;
9785  GNULIB_LSEEK=0;
9786  GNULIB_PIPE=0;
9787  GNULIB_PIPE2=0;
9788  GNULIB_PREAD=0;
9789  GNULIB_PWRITE=0;
9790  GNULIB_READ=0;
9791  GNULIB_READLINK=0;
9792  GNULIB_READLINKAT=0;
9793  GNULIB_RMDIR=0;
9794  GNULIB_SETHOSTNAME=0;
9795  GNULIB_SLEEP=0;
9796  GNULIB_SYMLINK=0;
9797  GNULIB_SYMLINKAT=0;
9798  GNULIB_TRUNCATE=0;
9799  GNULIB_TTYNAME_R=0;
9800  GNULIB_UNISTD_H_NONBLOCKING=0;
9801  GNULIB_UNISTD_H_SIGPIPE=0;
9802  GNULIB_UNLINK=0;
9803  GNULIB_UNLINKAT=0;
9804  GNULIB_USLEEP=0;
9805  GNULIB_WRITE=0;
9806    HAVE_CHOWN=1;
9807  HAVE_DUP2=1;
9808  HAVE_DUP3=1;
9809  HAVE_EUIDACCESS=1;
9810  HAVE_FACCESSAT=1;
9811  HAVE_FCHDIR=1;
9812  HAVE_FCHOWNAT=1;
9813  HAVE_FDATASYNC=1;
9814  HAVE_FSYNC=1;
9815  HAVE_FTRUNCATE=1;
9816  HAVE_GETDTABLESIZE=1;
9817  HAVE_GETGROUPS=1;
9818  HAVE_GETHOSTNAME=1;
9819  HAVE_GETLOGIN=1;
9820  HAVE_GETPAGESIZE=1;
9821  HAVE_GROUP_MEMBER=1;
9822  HAVE_LCHOWN=1;
9823  HAVE_LINK=1;
9824  HAVE_LINKAT=1;
9825  HAVE_PIPE=1;
9826  HAVE_PIPE2=1;
9827  HAVE_PREAD=1;
9828  HAVE_PWRITE=1;
9829  HAVE_READLINK=1;
9830  HAVE_READLINKAT=1;
9831  HAVE_SETHOSTNAME=1;
9832  HAVE_SLEEP=1;
9833  HAVE_SYMLINK=1;
9834  HAVE_SYMLINKAT=1;
9835  HAVE_UNLINKAT=1;
9836  HAVE_USLEEP=1;
9837  HAVE_DECL_ENVIRON=1;
9838  HAVE_DECL_FCHDIR=1;
9839  HAVE_DECL_FDATASYNC=1;
9840  HAVE_DECL_GETDOMAINNAME=1;
9841  HAVE_DECL_GETLOGIN=1;
9842  HAVE_DECL_GETLOGIN_R=1;
9843  HAVE_DECL_GETPAGESIZE=1;
9844  HAVE_DECL_GETUSERSHELL=1;
9845  HAVE_DECL_SETHOSTNAME=1;
9846  HAVE_DECL_TRUNCATE=1;
9847  HAVE_DECL_TTYNAME_R=1;
9848  HAVE_OS_H=0;
9849  HAVE_SYS_PARAM_H=0;
9850  REPLACE_CHOWN=0;
9851  REPLACE_CLOSE=0;
9852  REPLACE_DUP=0;
9853  REPLACE_DUP2=0;
9854  REPLACE_FACCESSAT=0;
9855  REPLACE_FCHOWNAT=0;
9856  REPLACE_FTRUNCATE=0;
9857  REPLACE_GETCWD=0;
9858  REPLACE_GETDOMAINNAME=0;
9859  REPLACE_GETDTABLESIZE=0;
9860  REPLACE_GETLOGIN_R=0;
9861  REPLACE_GETGROUPS=0;
9862  REPLACE_GETPAGESIZE=0;
9863  REPLACE_ISATTY=0;
9864  REPLACE_LCHOWN=0;
9865  REPLACE_LINK=0;
9866  REPLACE_LINKAT=0;
9867  REPLACE_LSEEK=0;
9868  REPLACE_PREAD=0;
9869  REPLACE_PWRITE=0;
9870  REPLACE_READ=0;
9871  REPLACE_READLINK=0;
9872  REPLACE_READLINKAT=0;
9873  REPLACE_RMDIR=0;
9874  REPLACE_SLEEP=0;
9875  REPLACE_SYMLINK=0;
9876  REPLACE_SYMLINKAT=0;
9877  REPLACE_TRUNCATE=0;
9878  REPLACE_TTYNAME_R=0;
9879  REPLACE_UNLINK=0;
9880  REPLACE_UNLINKAT=0;
9881  REPLACE_USLEEP=0;
9882  REPLACE_WRITE=0;
9883  UNISTD_H_HAVE_WINSOCK2_H=0;
9884  UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
9895$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
9896if ${ac_cv_type_uid_t+:} false; then :
9897  $as_echo_n "(cached) " >&6
9898else
9899  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9900/* end confdefs.h.  */
9901#include <sys/types.h>
9902
9903_ACEOF
9904if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9905  $EGREP "uid_t" >/dev/null 2>&1; then :
9906  ac_cv_type_uid_t=yes
9907else
9908  ac_cv_type_uid_t=no
9909fi
9910rm -f conftest*
9911
9912fi
9913{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
9914$as_echo "$ac_cv_type_uid_t" >&6; }
9915if test $ac_cv_type_uid_t = no; then
9916
9917$as_echo "#define uid_t int" >>confdefs.h
9918
9919
9920$as_echo "#define gid_t int" >>confdefs.h
9921
9922fi
9923
9924
9925      for ac_header in unistd.h
9926do :
9927  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
9928if test "x$ac_cv_header_unistd_h" = xyes; then :
9929  cat >>confdefs.h <<_ACEOF
9930#define HAVE_UNISTD_H 1
9931_ACEOF
9932
9933fi
9934
9935done
9936
9937  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5
9938$as_echo_n "checking for working chown... " >&6; }
9939if ${ac_cv_func_chown_works+:} false; then :
9940  $as_echo_n "(cached) " >&6
9941else
9942  if test "$cross_compiling" = yes; then :
9943  case "$host_os" in # ((
9944                           # Guess yes on Linux systems.
9945          linux-* | linux) ac_cv_func_chown_works="guessing yes" ;;
9946                           # Guess yes on glibc systems.
9947          *-gnu* | gnu*)   ac_cv_func_chown_works="guessing yes" ;;
9948                           # Guess no on native Windows.
9949          mingw*)          ac_cv_func_chown_works="guessing no" ;;
9950                           # If we don't know, assume the worst.
9951          *)               ac_cv_func_chown_works="guessing no" ;;
9952        esac
9953
9954else
9955  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9956/* end confdefs.h.  */
9957$ac_includes_default
9958           #include <fcntl.h>
9959
9960int
9961main ()
9962{
9963
9964            char *f = "conftest.chown";
9965            struct stat before, after;
9966
9967            if (creat (f, 0600) < 0)
9968              return 1;
9969            if (stat (f, &before) < 0)
9970              return 1;
9971            if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
9972              return 1;
9973            if (stat (f, &after) < 0)
9974              return 1;
9975            return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid);
9976
9977  ;
9978  return 0;
9979}
9980
9981_ACEOF
9982if ac_fn_c_try_run "$LINENO"; then :
9983  ac_cv_func_chown_works=yes
9984else
9985  ac_cv_func_chown_works=no
9986fi
9987rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9988  conftest.$ac_objext conftest.beam conftest.$ac_ext
9989fi
9990
9991     rm -f conftest.chown
9992
9993fi
9994{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5
9995$as_echo "$ac_cv_func_chown_works" >&6; }
9996  case "$ac_cv_func_chown_works" in
9997    *yes)
9998
9999$as_echo "#define HAVE_CHOWN 1" >>confdefs.h
10000
10001      ;;
10002  esac
10003
10004
10005  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown dereferences symlinks" >&5
10006$as_echo_n "checking whether chown dereferences symlinks... " >&6; }
10007if ${gl_cv_func_chown_follows_symlink+:} false; then :
10008  $as_echo_n "(cached) " >&6
10009else
10010
10011      if test "$cross_compiling" = yes; then :
10012  gl_cv_func_chown_follows_symlink=yes
10013
10014else
10015  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10016/* end confdefs.h.  */
10017
10018#include <unistd.h>
10019#include <stdlib.h>
10020#include <errno.h>
10021
10022        int
10023        main ()
10024        {
10025          int result = 0;
10026          char const *dangling_symlink = "conftest.dangle";
10027
10028          unlink (dangling_symlink);
10029          if (symlink ("conftest.no-such", dangling_symlink))
10030            abort ();
10031
10032          /* Exit successfully on a conforming system,
10033             i.e., where chown must fail with ENOENT.  */
10034          if (chown (dangling_symlink, getuid (), getgid ()) == 0)
10035            result |= 1;
10036          if (errno != ENOENT)
10037            result |= 2;
10038          return result;
10039        }
10040
10041_ACEOF
10042if ac_fn_c_try_run "$LINENO"; then :
10043  gl_cv_func_chown_follows_symlink=yes
10044else
10045  gl_cv_func_chown_follows_symlink=no
10046fi
10047rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10048  conftest.$ac_objext conftest.beam conftest.$ac_ext
10049fi
10050
10051
10052
10053fi
10054{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_chown_follows_symlink" >&5
10055$as_echo "$gl_cv_func_chown_follows_symlink" >&6; }
10056
10057  if test $gl_cv_func_chown_follows_symlink = no; then
10058
10059$as_echo "#define CHOWN_MODIFIES_SYMLINK 1" >>confdefs.h
10060
10061  fi
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074    if test $ac_cv_func_chown = no; then
10075    HAVE_CHOWN=0
10076  else
10077        if test $gl_cv_func_chown_follows_symlink = no; then
10078      REPLACE_CHOWN=1
10079    fi
10080
10081        case "$ac_cv_func_chown_works" in
10082      *no)
10083
10084$as_echo "#define CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE 1" >>confdefs.h
10085
10086        REPLACE_CHOWN=1
10087        ;;
10088    esac
10089
10090                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown honors trailing slash" >&5
10091$as_echo_n "checking whether chown honors trailing slash... " >&6; }
10092if ${gl_cv_func_chown_slash_works+:} false; then :
10093  $as_echo_n "(cached) " >&6
10094else
10095  touch conftest.file && rm -f conftest.link
10096       if test "$cross_compiling" = yes; then :
10097  case "$host_os" in
10098                   # Guess yes on glibc systems.
10099           *-gnu*) gl_cv_func_chown_slash_works="guessing yes" ;;
10100                   # If we don't know, assume the worst.
10101           *)      gl_cv_func_chown_slash_works="guessing no" ;;
10102         esac
10103
10104else
10105  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10106/* end confdefs.h.  */
10107
10108#include <unistd.h>
10109#include <stdlib.h>
10110#include <errno.h>
10111
10112int
10113main ()
10114{
10115    if (symlink ("conftest.file", "conftest.link")) return 1;
10116          if (chown ("conftest.link/", getuid (), getgid ()) == 0) return 2;
10117
10118  ;
10119  return 0;
10120}
10121_ACEOF
10122if ac_fn_c_try_run "$LINENO"; then :
10123  gl_cv_func_chown_slash_works=yes
10124else
10125  gl_cv_func_chown_slash_works=no
10126fi
10127rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10128  conftest.$ac_objext conftest.beam conftest.$ac_ext
10129fi
10130
10131      rm -f conftest.link conftest.file
10132fi
10133{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_chown_slash_works" >&5
10134$as_echo "$gl_cv_func_chown_slash_works" >&6; }
10135    case "$gl_cv_func_chown_slash_works" in
10136      *yes) ;;
10137      *)
10138
10139$as_echo "#define CHOWN_TRAILING_SLASH_BUG 1" >>confdefs.h
10140
10141        REPLACE_CHOWN=1
10142        ;;
10143    esac
10144
10145        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown always updates ctime" >&5
10146$as_echo_n "checking whether chown always updates ctime... " >&6; }
10147if ${gl_cv_func_chown_ctime_works+:} false; then :
10148  $as_echo_n "(cached) " >&6
10149else
10150  if test "$cross_compiling" = yes; then :
10151  case "$host_os" in
10152                   # Guess yes on glibc systems.
10153           *-gnu*) gl_cv_func_chown_ctime_works="guessing yes" ;;
10154                   # If we don't know, assume the worst.
10155           *)      gl_cv_func_chown_ctime_works="guessing no" ;;
10156         esac
10157
10158else
10159  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10160/* end confdefs.h.  */
10161
10162#include <unistd.h>
10163#include <stdlib.h>
10164#include <errno.h>
10165#include <fcntl.h>
10166#include <sys/stat.h>
10167
10168int
10169main ()
10170{
10171    struct stat st1, st2;
10172          if (close (creat ("conftest.file", 0600))) return 1;
10173          if (stat ("conftest.file", &st1)) return 2;
10174          sleep (1);
10175          if (chown ("conftest.file", st1.st_uid, st1.st_gid)) return 3;
10176          if (stat ("conftest.file", &st2)) return 4;
10177          if (st2.st_ctime <= st1.st_ctime) return 5;
10178
10179  ;
10180  return 0;
10181}
10182_ACEOF
10183if ac_fn_c_try_run "$LINENO"; then :
10184  gl_cv_func_chown_ctime_works=yes
10185else
10186  gl_cv_func_chown_ctime_works=no
10187fi
10188rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10189  conftest.$ac_objext conftest.beam conftest.$ac_ext
10190fi
10191
10192      rm -f conftest.file
10193fi
10194{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_chown_ctime_works" >&5
10195$as_echo "$gl_cv_func_chown_ctime_works" >&6; }
10196    case "$gl_cv_func_chown_ctime_works" in
10197      *yes) ;;
10198      *)
10199
10200$as_echo "#define CHOWN_CHANGE_TIME_BUG 1" >>confdefs.h
10201
10202        REPLACE_CHOWN=1
10203        ;;
10204    esac
10205  fi
10206
10207
10208
10209
10210
10211  if test $ac_cv_func__set_invalid_parameter_handler = yes; then
10212    HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
10213
10214$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
10215
10216  else
10217    HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
10218  fi
10219
10220
10221
10222  GNULIB_IOCTL=0;
10223    SYS_IOCTL_H_HAVE_WINSOCK2_H=0;
10224  SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
10225
10226  REPLACE_IOCTL=0;
10227
10228
10229
10230
10231
10232
10233     GNULIB_OPENDIR=0;
10234  GNULIB_READDIR=0;
10235  GNULIB_REWINDDIR=0;
10236  GNULIB_CLOSEDIR=0;
10237  GNULIB_DIRFD=0;
10238  GNULIB_FDOPENDIR=0;
10239  GNULIB_SCANDIR=0;
10240  GNULIB_ALPHASORT=0;
10241    HAVE_OPENDIR=1;
10242  HAVE_READDIR=1;
10243  HAVE_REWINDDIR=1;
10244  HAVE_CLOSEDIR=1;
10245  HAVE_DECL_DIRFD=1;
10246  HAVE_DECL_FDOPENDIR=1;
10247  HAVE_FDOPENDIR=1;
10248  HAVE_SCANDIR=1;
10249  HAVE_ALPHASORT=1;
10250  REPLACE_OPENDIR=0;
10251  REPLACE_CLOSEDIR=0;
10252  REPLACE_DIRFD=0;
10253  REPLACE_FDOPENDIR=0;
10254
10255
10256  GNULIB_SOCKET=0;
10257  GNULIB_CONNECT=0;
10258  GNULIB_ACCEPT=0;
10259  GNULIB_BIND=0;
10260  GNULIB_GETPEERNAME=0;
10261  GNULIB_GETSOCKNAME=0;
10262  GNULIB_GETSOCKOPT=0;
10263  GNULIB_LISTEN=0;
10264  GNULIB_RECV=0;
10265  GNULIB_SEND=0;
10266  GNULIB_RECVFROM=0;
10267  GNULIB_SENDTO=0;
10268  GNULIB_SETSOCKOPT=0;
10269  GNULIB_SHUTDOWN=0;
10270  GNULIB_ACCEPT4=0;
10271  HAVE_STRUCT_SOCKADDR_STORAGE=1;
10272  HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
10273
10274  HAVE_SA_FAMILY_T=1;
10275  HAVE_ACCEPT4=1;
10276
10277
10278   if test $ac_cv_header_sys_socket_h = no; then
10279                         for ac_header in ws2tcpip.h
10280do :
10281  ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
10282if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
10283  cat >>confdefs.h <<_ACEOF
10284#define HAVE_WS2TCPIP_H 1
10285_ACEOF
10286
10287fi
10288
10289done
10290
10291   fi
10292
10293
10294
10295
10296
10297        case "$host_os" in
10298    osf*)
10299
10300$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h
10301
10302      ;;
10303  esac
10304
10305  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
10306$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
10307if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then :
10308  $as_echo_n "(cached) " >&6
10309else
10310
10311      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10312/* end confdefs.h.  */
10313#include <sys/socket.h>
10314int
10315main ()
10316{
10317
10318  ;
10319  return 0;
10320}
10321_ACEOF
10322if ac_fn_c_try_compile "$LINENO"; then :
10323  gl_cv_header_sys_socket_h_selfcontained=yes
10324else
10325  gl_cv_header_sys_socket_h_selfcontained=no
10326fi
10327rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10328
10329fi
10330{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
10331$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
10332  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
10333            for ac_func in shutdown
10334do :
10335  ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
10336if test "x$ac_cv_func_shutdown" = xyes; then :
10337  cat >>confdefs.h <<_ACEOF
10338#define HAVE_SHUTDOWN 1
10339_ACEOF
10340
10341fi
10342done
10343
10344    if test $ac_cv_func_shutdown = yes; then
10345      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
10346$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
10347if ${gl_cv_header_sys_socket_h_shut+:} false; then :
10348  $as_echo_n "(cached) " >&6
10349else
10350
10351          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10352/* end confdefs.h.  */
10353#include <sys/socket.h>
10354int
10355main ()
10356{
10357int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
10358  ;
10359  return 0;
10360}
10361_ACEOF
10362if ac_fn_c_try_compile "$LINENO"; then :
10363  gl_cv_header_sys_socket_h_shut=yes
10364else
10365  gl_cv_header_sys_socket_h_shut=no
10366fi
10367rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10368
10369fi
10370{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
10371$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
10372      if test $gl_cv_header_sys_socket_h_shut = no; then
10373        SYS_SOCKET_H='sys/socket.h'
10374      fi
10375    fi
10376  fi
10377  # We need to check for ws2tcpip.h now.
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389     if test $gl_cv_have_include_next = yes; then
10390       gl_cv_next_sys_socket_h='<'sys/socket.h'>'
10391     else
10392       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
10393$as_echo_n "checking absolute name of <sys/socket.h>... " >&6; }
10394if ${gl_cv_next_sys_socket_h+:} false; then :
10395  $as_echo_n "(cached) " >&6
10396else
10397
10398             if test $ac_cv_header_sys_socket_h = yes; then
10399
10400
10401
10402
10403  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10404/* end confdefs.h.  */
10405#include <sys/socket.h>
10406_ACEOF
10407                case "$host_os" in
10408    aix*) gl_absname_cpp="$ac_cpp -C" ;;
10409    *)    gl_absname_cpp="$ac_cpp" ;;
10410  esac
10411
10412  case "$host_os" in
10413    mingw*)
10414                                          gl_dirsep_regex='[/\\]'
10415      ;;
10416    *)
10417      gl_dirsep_regex='\/'
10418      ;;
10419  esac
10420      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
10421  gl_header_literal_regex=`echo 'sys/socket.h' \
10422                           | sed -e "$gl_make_literal_regex_sed"`
10423  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
10424      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
10425      s|^/[^/]|//&|
10426      p
10427      q
10428    }'
10429
10430        gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
10431  sed -n "$gl_absolute_header_sed"`
10432
10433           gl_header=$gl_cv_absolute_sys_socket_h
10434           gl_cv_next_sys_socket_h='"'$gl_header'"'
10435          else
10436               gl_cv_next_sys_socket_h='<'sys/socket.h'>'
10437             fi
10438
10439
10440fi
10441{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
10442$as_echo "$gl_cv_next_sys_socket_h" >&6; }
10443     fi
10444     NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
10445
10446     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
10447       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
10448       gl_next_as_first_directive='<'sys/socket.h'>'
10449     else
10450       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
10451       gl_next_as_first_directive=$gl_cv_next_sys_socket_h
10452     fi
10453     NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
10454
10455
10456
10457
10458  if test $ac_cv_header_sys_socket_h = yes; then
10459    HAVE_SYS_SOCKET_H=1
10460    HAVE_WS2TCPIP_H=0
10461  else
10462    HAVE_SYS_SOCKET_H=0
10463    if test $ac_cv_header_ws2tcpip_h = yes; then
10464      HAVE_WS2TCPIP_H=1
10465    else
10466      HAVE_WS2TCPIP_H=0
10467    fi
10468  fi
10469
10470
10471
10472  ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
10473  /* sys/types.h is not needed according to POSIX, but the
10474     sys/socket.h in i386-unknown-freebsd4.10 and
10475     powerpc-apple-darwin5.5 required it. */
10476#include <sys/types.h>
10477#ifdef HAVE_SYS_SOCKET_H
10478#include <sys/socket.h>
10479#endif
10480#ifdef HAVE_WS2TCPIP_H
10481#include <ws2tcpip.h>
10482#endif
10483
10484"
10485if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
10486
10487cat >>confdefs.h <<_ACEOF
10488#define HAVE_STRUCT_SOCKADDR_STORAGE 1
10489_ACEOF
10490
10491
10492fi
10493ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "
10494  /* sys/types.h is not needed according to POSIX, but the
10495     sys/socket.h in i386-unknown-freebsd4.10 and
10496     powerpc-apple-darwin5.5 required it. */
10497#include <sys/types.h>
10498#ifdef HAVE_SYS_SOCKET_H
10499#include <sys/socket.h>
10500#endif
10501#ifdef HAVE_WS2TCPIP_H
10502#include <ws2tcpip.h>
10503#endif
10504
10505"
10506if test "x$ac_cv_type_sa_family_t" = xyes; then :
10507
10508cat >>confdefs.h <<_ACEOF
10509#define HAVE_SA_FAMILY_T 1
10510_ACEOF
10511
10512
10513fi
10514
10515  if test $ac_cv_type_struct_sockaddr_storage = no; then
10516    HAVE_STRUCT_SOCKADDR_STORAGE=0
10517  fi
10518  if test $ac_cv_type_sa_family_t = no; then
10519    HAVE_SA_FAMILY_T=0
10520  fi
10521  if test $ac_cv_type_struct_sockaddr_storage != no; then
10522    ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
10523       #ifdef HAVE_SYS_SOCKET_H
10524       #include <sys/socket.h>
10525       #endif
10526       #ifdef HAVE_WS2TCPIP_H
10527       #include <ws2tcpip.h>
10528       #endif
10529
10530"
10531if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
10532
10533cat >>confdefs.h <<_ACEOF
10534#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
10535_ACEOF
10536
10537
10538else
10539  HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
10540fi
10541
10542  fi
10543  if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
10544     || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
10545    SYS_SOCKET_H='sys/socket.h'
10546  fi
10547
10548
10549
10550
10551  if test $ac_cv_header_sys_socket_h != yes; then
10552                    for ac_header in winsock2.h
10553do :
10554  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
10555if test "x$ac_cv_header_winsock2_h" = xyes; then :
10556  cat >>confdefs.h <<_ACEOF
10557#define HAVE_WINSOCK2_H 1
10558_ACEOF
10559
10560fi
10561
10562done
10563
10564  fi
10565  if test "$ac_cv_header_winsock2_h" = yes; then
10566    HAVE_WINSOCK2_H=1
10567    UNISTD_H_HAVE_WINSOCK2_H=1
10568    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
10569  else
10570    HAVE_WINSOCK2_H=0
10571  fi
10572
10573
10574
10575
10576
10577{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
10578$as_echo_n "checking for inline... " >&6; }
10579if ${ac_cv_c_inline+:} false; then :
10580  $as_echo_n "(cached) " >&6
10581else
10582  ac_cv_c_inline=no
10583for ac_kw in inline __inline__ __inline; do
10584  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10585/* end confdefs.h.  */
10586#ifndef __cplusplus
10587typedef int foo_t;
10588static $ac_kw foo_t static_foo () {return 0; }
10589$ac_kw foo_t foo () {return 0; }
10590#endif
10591
10592_ACEOF
10593if ac_fn_c_try_compile "$LINENO"; then :
10594  ac_cv_c_inline=$ac_kw
10595fi
10596rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10597  test "$ac_cv_c_inline" != no && break
10598done
10599
10600fi
10601{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
10602$as_echo "$ac_cv_c_inline" >&6; }
10603
10604case $ac_cv_c_inline in
10605  inline | yes) ;;
10606  *)
10607    case $ac_cv_c_inline in
10608      no) ac_val=;;
10609      *) ac_val=$ac_cv_c_inline;;
10610    esac
10611    cat >>confdefs.h <<_ACEOF
10612#ifndef __cplusplus
10613#define inline $ac_val
10614#endif
10615_ACEOF
10616    ;;
10617esac
10618
10619
10620
10621
10622
10623    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linux/if_alg.h has struct sockaddr_alg." >&5
10624$as_echo_n "checking whether linux/if_alg.h has struct sockaddr_alg.... " >&6; }
10625if ${gl_cv_header_linux_if_alg_salg+:} false; then :
10626  $as_echo_n "(cached) " >&6
10627else
10628  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10629/* end confdefs.h.  */
10630#include <sys/socket.h>
10631                          #include <linux/if_alg.h>
10632                          struct sockaddr_alg salg = {
10633                            .salg_family = AF_ALG,
10634                            .salg_type = "hash",
10635                            .salg_name = "sha1",
10636                          };
10637int
10638main ()
10639{
10640
10641  ;
10642  return 0;
10643}
10644_ACEOF
10645if ac_fn_c_try_compile "$LINENO"; then :
10646  gl_cv_header_linux_if_alg_salg=yes
10647else
10648  gl_cv_header_linux_if_alg_salg=no
10649fi
10650rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10651fi
10652{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_linux_if_alg_salg" >&5
10653$as_echo "$gl_cv_header_linux_if_alg_salg" >&6; }
10654  if test "$gl_cv_header_linux_if_alg_salg" = yes; then
10655
10656$as_echo "#define HAVE_LINUX_IF_ALG_H 1" >>confdefs.h
10657
10658  fi
10659
10660        use_af_alg=no
10661
10662# Check whether --with-linux-crypto was given.
10663if test "${with_linux_crypto+set}" = set; then :
10664  withval=$with_linux_crypto; use_af_alg=$withval
10665else
10666  use_af_alg=no
10667fi
10668
10669    if test "$gl_cv_header_linux_if_alg_salg" != yes; then
10670    if test "$use_af_alg" != no; then
10671      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Linux kernel cryptographic API not found" >&5
10672$as_echo "$as_me: WARNING: Linux kernel cryptographic API not found" >&2;}
10673    fi
10674    use_af_alg=no
10675  fi
10676
10677  if test "$use_af_alg" != no; then
10678    USE_AF_ALG=1
10679  else
10680    USE_AF_ALG=0
10681  fi
10682
10683cat >>confdefs.h <<_ACEOF
10684#define USE_LINUX_CRYPTO_API $USE_AF_ALG
10685_ACEOF
10686
10687
10688
10689   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
10690$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
10691if ${ac_cv_c_bigendian+:} false; then :
10692  $as_echo_n "(cached) " >&6
10693else
10694  ac_cv_c_bigendian=unknown
10695    # See if we're dealing with a universal compiler.
10696    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10697/* end confdefs.h.  */
10698#ifndef __APPLE_CC__
10699	       not a universal capable compiler
10700	     #endif
10701	     typedef int dummy;
10702
10703_ACEOF
10704if ac_fn_c_try_compile "$LINENO"; then :
10705
10706	# Check for potential -arch flags.  It is not universal unless
10707	# there are at least two -arch flags with different values.
10708	ac_arch=
10709	ac_prev=
10710	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
10711	 if test -n "$ac_prev"; then
10712	   case $ac_word in
10713	     i?86 | x86_64 | ppc | ppc64)
10714	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
10715		 ac_arch=$ac_word
10716	       else
10717		 ac_cv_c_bigendian=universal
10718		 break
10719	       fi
10720	       ;;
10721	   esac
10722	   ac_prev=
10723	 elif test "x$ac_word" = "x-arch"; then
10724	   ac_prev=arch
10725	 fi
10726       done
10727fi
10728rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10729    if test $ac_cv_c_bigendian = unknown; then
10730      # See if sys/param.h defines the BYTE_ORDER macro.
10731      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10732/* end confdefs.h.  */
10733#include <sys/types.h>
10734	     #include <sys/param.h>
10735
10736int
10737main ()
10738{
10739#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
10740		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
10741		     && LITTLE_ENDIAN)
10742	      bogus endian macros
10743	     #endif
10744
10745  ;
10746  return 0;
10747}
10748_ACEOF
10749if ac_fn_c_try_compile "$LINENO"; then :
10750  # It does; now see whether it defined to BIG_ENDIAN or not.
10751	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10752/* end confdefs.h.  */
10753#include <sys/types.h>
10754		#include <sys/param.h>
10755
10756int
10757main ()
10758{
10759#if BYTE_ORDER != BIG_ENDIAN
10760		 not big endian
10761		#endif
10762
10763  ;
10764  return 0;
10765}
10766_ACEOF
10767if ac_fn_c_try_compile "$LINENO"; then :
10768  ac_cv_c_bigendian=yes
10769else
10770  ac_cv_c_bigendian=no
10771fi
10772rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10773fi
10774rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10775    fi
10776    if test $ac_cv_c_bigendian = unknown; then
10777      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
10778      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10779/* end confdefs.h.  */
10780#include <limits.h>
10781
10782int
10783main ()
10784{
10785#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
10786	      bogus endian macros
10787	     #endif
10788
10789  ;
10790  return 0;
10791}
10792_ACEOF
10793if ac_fn_c_try_compile "$LINENO"; then :
10794  # It does; now see whether it defined to _BIG_ENDIAN or not.
10795	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10796/* end confdefs.h.  */
10797#include <limits.h>
10798
10799int
10800main ()
10801{
10802#ifndef _BIG_ENDIAN
10803		 not big endian
10804		#endif
10805
10806  ;
10807  return 0;
10808}
10809_ACEOF
10810if ac_fn_c_try_compile "$LINENO"; then :
10811  ac_cv_c_bigendian=yes
10812else
10813  ac_cv_c_bigendian=no
10814fi
10815rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10816fi
10817rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10818    fi
10819    if test $ac_cv_c_bigendian = unknown; then
10820      # Compile a test program.
10821      if test "$cross_compiling" = yes; then :
10822  # Try to guess by grepping values from an object file.
10823	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10824/* end confdefs.h.  */
10825short int ascii_mm[] =
10826		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
10827		short int ascii_ii[] =
10828		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
10829		int use_ascii (int i) {
10830		  return ascii_mm[i] + ascii_ii[i];
10831		}
10832		short int ebcdic_ii[] =
10833		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
10834		short int ebcdic_mm[] =
10835		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
10836		int use_ebcdic (int i) {
10837		  return ebcdic_mm[i] + ebcdic_ii[i];
10838		}
10839		extern int foo;
10840
10841int
10842main ()
10843{
10844return use_ascii (foo) == use_ebcdic (foo);
10845  ;
10846  return 0;
10847}
10848_ACEOF
10849if ac_fn_c_try_compile "$LINENO"; then :
10850  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
10851	      ac_cv_c_bigendian=yes
10852	    fi
10853	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
10854	      if test "$ac_cv_c_bigendian" = unknown; then
10855		ac_cv_c_bigendian=no
10856	      else
10857		# finding both strings is unlikely to happen, but who knows?
10858		ac_cv_c_bigendian=unknown
10859	      fi
10860	    fi
10861fi
10862rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10863else
10864  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10865/* end confdefs.h.  */
10866$ac_includes_default
10867int
10868main ()
10869{
10870
10871	     /* Are we little or big endian?  From Harbison&Steele.  */
10872	     union
10873	     {
10874	       long int l;
10875	       char c[sizeof (long int)];
10876	     } u;
10877	     u.l = 1;
10878	     return u.c[sizeof (long int) - 1] == 1;
10879
10880  ;
10881  return 0;
10882}
10883_ACEOF
10884if ac_fn_c_try_run "$LINENO"; then :
10885  ac_cv_c_bigendian=no
10886else
10887  ac_cv_c_bigendian=yes
10888fi
10889rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10890  conftest.$ac_objext conftest.beam conftest.$ac_ext
10891fi
10892
10893    fi
10894fi
10895{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
10896$as_echo "$ac_cv_c_bigendian" >&6; }
10897 case $ac_cv_c_bigendian in #(
10898   yes)
10899     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
10900;; #(
10901   no)
10902      ;; #(
10903   universal)
10904
10905$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
10906
10907     ;; #(
10908   *)
10909     as_fn_error $? "unknown endianness
10910 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
10911 esac
10912
10913
10914
10915  GNULIB_ISBLANK=0;
10916    HAVE_ISBLANK=1;
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
10934$as_echo_n "checking if environ is properly declared... " >&6; }
10935  if ${gt_cv_var_environ_declaration+:} false; then :
10936  $as_echo_n "(cached) " >&6
10937else
10938
10939    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10940/* end confdefs.h.  */
10941#if HAVE_UNISTD_H
10942     #include <unistd.h>
10943     #endif
10944     /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
10945     #include <stdlib.h>
10946
10947           extern struct { int foo; } environ;
10948int
10949main ()
10950{
10951environ.foo = 1;
10952  ;
10953  return 0;
10954}
10955_ACEOF
10956if ac_fn_c_try_compile "$LINENO"; then :
10957  gt_cv_var_environ_declaration=no
10958else
10959  gt_cv_var_environ_declaration=yes
10960fi
10961rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10962fi
10963
10964  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
10965$as_echo "$gt_cv_var_environ_declaration" >&6; }
10966  if test $gt_cv_var_environ_declaration = yes; then
10967
10968$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
10969
10970  fi
10971
10972
10973  if test $gt_cv_var_environ_declaration != yes; then
10974    HAVE_DECL_ENVIRON=0
10975  fi
10976
10977
10978
10979  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
10980$as_echo_n "checking for complete errno.h... " >&6; }
10981if ${gl_cv_header_errno_h_complete+:} false; then :
10982  $as_echo_n "(cached) " >&6
10983else
10984
10985    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10986/* end confdefs.h.  */
10987
10988#include <errno.h>
10989#if !defined ETXTBSY
10990booboo
10991#endif
10992#if !defined ENOMSG
10993booboo
10994#endif
10995#if !defined EIDRM
10996booboo
10997#endif
10998#if !defined ENOLINK
10999booboo
11000#endif
11001#if !defined EPROTO
11002booboo
11003#endif
11004#if !defined EMULTIHOP
11005booboo
11006#endif
11007#if !defined EBADMSG
11008booboo
11009#endif
11010#if !defined EOVERFLOW
11011booboo
11012#endif
11013#if !defined ENOTSUP
11014booboo
11015#endif
11016#if !defined ENETRESET
11017booboo
11018#endif
11019#if !defined ECONNABORTED
11020booboo
11021#endif
11022#if !defined ESTALE
11023booboo
11024#endif
11025#if !defined EDQUOT
11026booboo
11027#endif
11028#if !defined ECANCELED
11029booboo
11030#endif
11031#if !defined EOWNERDEAD
11032booboo
11033#endif
11034#if !defined ENOTRECOVERABLE
11035booboo
11036#endif
11037#if !defined EILSEQ
11038booboo
11039#endif
11040
11041_ACEOF
11042if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11043  $EGREP "booboo" >/dev/null 2>&1; then :
11044  gl_cv_header_errno_h_complete=no
11045else
11046  gl_cv_header_errno_h_complete=yes
11047fi
11048rm -f conftest*
11049
11050
11051fi
11052{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
11053$as_echo "$gl_cv_header_errno_h_complete" >&6; }
11054  if test $gl_cv_header_errno_h_complete = yes; then
11055    ERRNO_H=''
11056  else
11057
11058
11059
11060
11061
11062
11063
11064
11065     if test $gl_cv_have_include_next = yes; then
11066       gl_cv_next_errno_h='<'errno.h'>'
11067     else
11068       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
11069$as_echo_n "checking absolute name of <errno.h>... " >&6; }
11070if ${gl_cv_next_errno_h+:} false; then :
11071  $as_echo_n "(cached) " >&6
11072else
11073
11074
11075
11076  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11077/* end confdefs.h.  */
11078#include <errno.h>
11079_ACEOF
11080                case "$host_os" in
11081    aix*) gl_absname_cpp="$ac_cpp -C" ;;
11082    *)    gl_absname_cpp="$ac_cpp" ;;
11083  esac
11084
11085  case "$host_os" in
11086    mingw*)
11087                                          gl_dirsep_regex='[/\\]'
11088      ;;
11089    *)
11090      gl_dirsep_regex='\/'
11091      ;;
11092  esac
11093      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
11094  gl_header_literal_regex=`echo 'errno.h' \
11095                           | sed -e "$gl_make_literal_regex_sed"`
11096  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
11097      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
11098      s|^/[^/]|//&|
11099      p
11100      q
11101    }'
11102
11103        gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
11104  sed -n "$gl_absolute_header_sed"`
11105
11106           gl_header=$gl_cv_absolute_errno_h
11107           gl_cv_next_errno_h='"'$gl_header'"'
11108
11109
11110fi
11111{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
11112$as_echo "$gl_cv_next_errno_h" >&6; }
11113     fi
11114     NEXT_ERRNO_H=$gl_cv_next_errno_h
11115
11116     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
11117       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
11118       gl_next_as_first_directive='<'errno.h'>'
11119     else
11120       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
11121       gl_next_as_first_directive=$gl_cv_next_errno_h
11122     fi
11123     NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
11124
11125
11126
11127
11128    ERRNO_H='errno.h'
11129  fi
11130
11131   if test -n "$ERRNO_H"; then
11132  GL_GENERATE_ERRNO_H_TRUE=
11133  GL_GENERATE_ERRNO_H_FALSE='#'
11134else
11135  GL_GENERATE_ERRNO_H_TRUE='#'
11136  GL_GENERATE_ERRNO_H_FALSE=
11137fi
11138
11139
11140  if test -n "$ERRNO_H"; then
11141    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
11142$as_echo_n "checking for EMULTIHOP value... " >&6; }
11143if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
11144  $as_echo_n "(cached) " >&6
11145else
11146
11147      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11148/* end confdefs.h.  */
11149
11150#include <errno.h>
11151#ifdef EMULTIHOP
11152yes
11153#endif
11154
11155_ACEOF
11156if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11157  $EGREP "yes" >/dev/null 2>&1; then :
11158  gl_cv_header_errno_h_EMULTIHOP=yes
11159else
11160  gl_cv_header_errno_h_EMULTIHOP=no
11161fi
11162rm -f conftest*
11163
11164      if test $gl_cv_header_errno_h_EMULTIHOP = no; then
11165        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11166/* end confdefs.h.  */
11167
11168#define _XOPEN_SOURCE_EXTENDED 1
11169#include <errno.h>
11170#ifdef EMULTIHOP
11171yes
11172#endif
11173
11174_ACEOF
11175if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11176  $EGREP "yes" >/dev/null 2>&1; then :
11177  gl_cv_header_errno_h_EMULTIHOP=hidden
11178fi
11179rm -f conftest*
11180
11181        if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
11182                              if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP"        "
11183#define _XOPEN_SOURCE_EXTENDED 1
11184#include <errno.h>
11185/* The following two lines are a workaround against an autoconf-2.52 bug.  */
11186#include <stdio.h>
11187#include <stdlib.h>
11188"; then :
11189
11190fi
11191
11192        fi
11193      fi
11194
11195fi
11196{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
11197$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
11198    case $gl_cv_header_errno_h_EMULTIHOP in
11199      yes | no)
11200        EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
11201        ;;
11202      *)
11203        EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
11204        ;;
11205    esac
11206
11207
11208  fi
11209
11210
11211  if test -n "$ERRNO_H"; then
11212    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
11213$as_echo_n "checking for ENOLINK value... " >&6; }
11214if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
11215  $as_echo_n "(cached) " >&6
11216else
11217
11218      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11219/* end confdefs.h.  */
11220
11221#include <errno.h>
11222#ifdef ENOLINK
11223yes
11224#endif
11225
11226_ACEOF
11227if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11228  $EGREP "yes" >/dev/null 2>&1; then :
11229  gl_cv_header_errno_h_ENOLINK=yes
11230else
11231  gl_cv_header_errno_h_ENOLINK=no
11232fi
11233rm -f conftest*
11234
11235      if test $gl_cv_header_errno_h_ENOLINK = no; then
11236        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11237/* end confdefs.h.  */
11238
11239#define _XOPEN_SOURCE_EXTENDED 1
11240#include <errno.h>
11241#ifdef ENOLINK
11242yes
11243#endif
11244
11245_ACEOF
11246if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11247  $EGREP "yes" >/dev/null 2>&1; then :
11248  gl_cv_header_errno_h_ENOLINK=hidden
11249fi
11250rm -f conftest*
11251
11252        if test $gl_cv_header_errno_h_ENOLINK = hidden; then
11253                              if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK"        "
11254#define _XOPEN_SOURCE_EXTENDED 1
11255#include <errno.h>
11256/* The following two lines are a workaround against an autoconf-2.52 bug.  */
11257#include <stdio.h>
11258#include <stdlib.h>
11259"; then :
11260
11261fi
11262
11263        fi
11264      fi
11265
11266fi
11267{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
11268$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
11269    case $gl_cv_header_errno_h_ENOLINK in
11270      yes | no)
11271        ENOLINK_HIDDEN=0; ENOLINK_VALUE=
11272        ;;
11273      *)
11274        ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
11275        ;;
11276    esac
11277
11278
11279  fi
11280
11281
11282  if test -n "$ERRNO_H"; then
11283    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
11284$as_echo_n "checking for EOVERFLOW value... " >&6; }
11285if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
11286  $as_echo_n "(cached) " >&6
11287else
11288
11289      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11290/* end confdefs.h.  */
11291
11292#include <errno.h>
11293#ifdef EOVERFLOW
11294yes
11295#endif
11296
11297_ACEOF
11298if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11299  $EGREP "yes" >/dev/null 2>&1; then :
11300  gl_cv_header_errno_h_EOVERFLOW=yes
11301else
11302  gl_cv_header_errno_h_EOVERFLOW=no
11303fi
11304rm -f conftest*
11305
11306      if test $gl_cv_header_errno_h_EOVERFLOW = no; then
11307        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11308/* end confdefs.h.  */
11309
11310#define _XOPEN_SOURCE_EXTENDED 1
11311#include <errno.h>
11312#ifdef EOVERFLOW
11313yes
11314#endif
11315
11316_ACEOF
11317if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11318  $EGREP "yes" >/dev/null 2>&1; then :
11319  gl_cv_header_errno_h_EOVERFLOW=hidden
11320fi
11321rm -f conftest*
11322
11323        if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
11324                              if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW"        "
11325#define _XOPEN_SOURCE_EXTENDED 1
11326#include <errno.h>
11327/* The following two lines are a workaround against an autoconf-2.52 bug.  */
11328#include <stdio.h>
11329#include <stdlib.h>
11330"; then :
11331
11332fi
11333
11334        fi
11335      fi
11336
11337fi
11338{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
11339$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
11340    case $gl_cv_header_errno_h_EOVERFLOW in
11341      yes | no)
11342        EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
11343        ;;
11344      *)
11345        EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
11346        ;;
11347    esac
11348
11349
11350  fi
11351
11352
11353ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
11354if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
11355  ac_have_decl=1
11356else
11357  ac_have_decl=0
11358fi
11359
11360cat >>confdefs.h <<_ACEOF
11361#define HAVE_DECL_STRERROR_R $ac_have_decl
11362_ACEOF
11363
11364for ac_func in strerror_r
11365do :
11366  ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
11367if test "x$ac_cv_func_strerror_r" = xyes; then :
11368  cat >>confdefs.h <<_ACEOF
11369#define HAVE_STRERROR_R 1
11370_ACEOF
11371
11372fi
11373done
11374
11375{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
11376$as_echo_n "checking whether strerror_r returns char *... " >&6; }
11377if ${ac_cv_func_strerror_r_char_p+:} false; then :
11378  $as_echo_n "(cached) " >&6
11379else
11380
11381    ac_cv_func_strerror_r_char_p=no
11382    if test $ac_cv_have_decl_strerror_r = yes; then
11383      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11384/* end confdefs.h.  */
11385$ac_includes_default
11386int
11387main ()
11388{
11389
11390	  char buf[100];
11391	  char x = *strerror_r (0, buf, sizeof buf);
11392	  char *p = strerror_r (0, buf, sizeof buf);
11393	  return !p || x;
11394
11395  ;
11396  return 0;
11397}
11398_ACEOF
11399if ac_fn_c_try_compile "$LINENO"; then :
11400  ac_cv_func_strerror_r_char_p=yes
11401fi
11402rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11403    else
11404      # strerror_r is not declared.  Choose between
11405      # systems that have relatively inaccessible declarations for the
11406      # function.  BeOS and DEC UNIX 4.0 fall in this category, but the
11407      # former has a strerror_r that returns char*, while the latter
11408      # has a strerror_r that returns `int'.
11409      # This test should segfault on the DEC system.
11410      if test "$cross_compiling" = yes; then :
11411  :
11412else
11413  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11414/* end confdefs.h.  */
11415$ac_includes_default
11416	extern char *strerror_r ();
11417int
11418main ()
11419{
11420char buf[100];
11421	  char x = *strerror_r (0, buf, sizeof buf);
11422	  return ! isalpha (x);
11423  ;
11424  return 0;
11425}
11426_ACEOF
11427if ac_fn_c_try_run "$LINENO"; then :
11428  ac_cv_func_strerror_r_char_p=yes
11429fi
11430rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11431  conftest.$ac_objext conftest.beam conftest.$ac_ext
11432fi
11433
11434    fi
11435
11436fi
11437{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
11438$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
11439if test $ac_cv_func_strerror_r_char_p = yes; then
11440
11441$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
11442
11443fi
11444
11445
11446  XGETTEXT_EXTRA_OPTIONS=
11447
11448
11449
11450{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5
11451$as_echo_n "checking type of array argument to getgroups... " >&6; }
11452if ${ac_cv_type_getgroups+:} false; then :
11453  $as_echo_n "(cached) " >&6
11454else
11455  if test "$cross_compiling" = yes; then :
11456  ac_cv_type_getgroups=cross
11457else
11458  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11459/* end confdefs.h.  */
11460/* Thanks to Mike Rendell for this test.  */
11461$ac_includes_default
11462#define NGID 256
11463#undef MAX
11464#define MAX(x, y) ((x) > (y) ? (x) : (y))
11465
11466int
11467main ()
11468{
11469  gid_t gidset[NGID];
11470  int i, n;
11471  union { gid_t gval; long int lval; }  val;
11472
11473  val.lval = -1;
11474  for (i = 0; i < NGID; i++)
11475    gidset[i] = val.gval;
11476  n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
11477		 gidset);
11478  /* Exit non-zero if getgroups seems to require an array of ints.  This
11479     happens when gid_t is short int but getgroups modifies an array
11480     of ints.  */
11481  return n > 0 && gidset[n] != val.gval;
11482}
11483_ACEOF
11484if ac_fn_c_try_run "$LINENO"; then :
11485  ac_cv_type_getgroups=gid_t
11486else
11487  ac_cv_type_getgroups=int
11488fi
11489rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11490  conftest.$ac_objext conftest.beam conftest.$ac_ext
11491fi
11492
11493if test $ac_cv_type_getgroups = cross; then
11494        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11495/* end confdefs.h.  */
11496#include <unistd.h>
11497
11498_ACEOF
11499if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11500  $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then :
11501  ac_cv_type_getgroups=gid_t
11502else
11503  ac_cv_type_getgroups=int
11504fi
11505rm -f conftest*
11506
11507fi
11508fi
11509{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_getgroups" >&5
11510$as_echo "$ac_cv_type_getgroups" >&6; }
11511
11512cat >>confdefs.h <<_ACEOF
11513#define GETGROUPS_T $ac_cv_type_getgroups
11514_ACEOF
11515
11516
11517
11518  GNULIB_EXPLICIT_BZERO=0;
11519  GNULIB_FFSL=0;
11520  GNULIB_FFSLL=0;
11521  GNULIB_MEMCHR=0;
11522  GNULIB_MEMMEM=0;
11523  GNULIB_MEMPCPY=0;
11524  GNULIB_MEMRCHR=0;
11525  GNULIB_RAWMEMCHR=0;
11526  GNULIB_STPCPY=0;
11527  GNULIB_STPNCPY=0;
11528  GNULIB_STRCHRNUL=0;
11529  GNULIB_STRDUP=0;
11530  GNULIB_STRNCAT=0;
11531  GNULIB_STRNDUP=0;
11532  GNULIB_STRNLEN=0;
11533  GNULIB_STRPBRK=0;
11534  GNULIB_STRSEP=0;
11535  GNULIB_STRSTR=0;
11536  GNULIB_STRCASESTR=0;
11537  GNULIB_STRTOK_R=0;
11538  GNULIB_MBSLEN=0;
11539  GNULIB_MBSNLEN=0;
11540  GNULIB_MBSCHR=0;
11541  GNULIB_MBSRCHR=0;
11542  GNULIB_MBSSTR=0;
11543  GNULIB_MBSCASECMP=0;
11544  GNULIB_MBSNCASECMP=0;
11545  GNULIB_MBSPCASECMP=0;
11546  GNULIB_MBSCASESTR=0;
11547  GNULIB_MBSCSPN=0;
11548  GNULIB_MBSPBRK=0;
11549  GNULIB_MBSSPN=0;
11550  GNULIB_MBSSEP=0;
11551  GNULIB_MBSTOK_R=0;
11552  GNULIB_STRERROR=0;
11553  GNULIB_STRERROR_R=0;
11554  GNULIB_STRSIGNAL=0;
11555  GNULIB_STRVERSCMP=0;
11556  HAVE_MBSLEN=0;
11557    HAVE_EXPLICIT_BZERO=1;
11558  HAVE_FFSL=1;
11559  HAVE_FFSLL=1;
11560  HAVE_MEMCHR=1;
11561  HAVE_DECL_MEMMEM=1;
11562  HAVE_MEMPCPY=1;
11563  HAVE_DECL_MEMRCHR=1;
11564  HAVE_RAWMEMCHR=1;
11565  HAVE_STPCPY=1;
11566  HAVE_STPNCPY=1;
11567  HAVE_STRCHRNUL=1;
11568  HAVE_DECL_STRDUP=1;
11569  HAVE_DECL_STRNDUP=1;
11570  HAVE_DECL_STRNLEN=1;
11571  HAVE_STRPBRK=1;
11572  HAVE_STRSEP=1;
11573  HAVE_STRCASESTR=1;
11574  HAVE_DECL_STRTOK_R=1;
11575  HAVE_DECL_STRERROR_R=1;
11576  HAVE_DECL_STRSIGNAL=1;
11577  HAVE_STRVERSCMP=1;
11578  REPLACE_MEMCHR=0;
11579  REPLACE_MEMMEM=0;
11580  REPLACE_STPNCPY=0;
11581  REPLACE_STRCHRNUL=0;
11582  REPLACE_STRDUP=0;
11583  REPLACE_STRNCAT=0;
11584  REPLACE_STRNDUP=0;
11585  REPLACE_STRNLEN=0;
11586  REPLACE_STRSTR=0;
11587  REPLACE_STRCASESTR=0;
11588  REPLACE_STRTOK_R=0;
11589  REPLACE_STRERROR=0;
11590  REPLACE_STRERROR_R=0;
11591  REPLACE_STRSIGNAL=0;
11592  UNDEFINE_STRTOK_R=0;
11593
11594
11595
11596
11597
11598
11599
11600         { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
11601$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
11602if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
11603  $as_echo_n "(cached) " >&6
11604else
11605  rm -f conftest.sym conftest.file
11606     echo >conftest.file
11607     if test "$cross_compiling" = yes; then :
11608  case "$host_os" in
11609          linux-* | linux)
11610            # Guess yes on Linux systems.
11611            gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
11612          *-gnu* | gnu*)
11613            # Guess yes on glibc systems.
11614            gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
11615          mingw*)
11616            # Guess no on native Windows.
11617            gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
11618          *)
11619            # If we don't know, assume the worst.
11620            gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
11621        esac
11622
11623else
11624  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11625/* end confdefs.h.  */
11626$ac_includes_default
11627int
11628main ()
11629{
11630struct stat sbuf;
11631            if (symlink ("conftest.file", "conftest.sym") != 0)
11632              return 1;
11633            /* Linux will dereference the symlink and fail, as required by
11634               POSIX.  That is better in the sense that it means we will not
11635               have to compile and use the lstat wrapper.  */
11636            return lstat ("conftest.sym/", &sbuf) == 0;
11637
11638  ;
11639  return 0;
11640}
11641_ACEOF
11642if ac_fn_c_try_run "$LINENO"; then :
11643  gl_cv_func_lstat_dereferences_slashed_symlink=yes
11644else
11645  gl_cv_func_lstat_dereferences_slashed_symlink=no
11646fi
11647rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11648  conftest.$ac_objext conftest.beam conftest.$ac_ext
11649fi
11650
11651     rm -f conftest.sym conftest.file
11652
11653fi
11654{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
11655$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
11656  case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
11657    *yes)
11658
11659cat >>confdefs.h <<_ACEOF
11660#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
11661_ACEOF
11662
11663      ;;
11664  esac
11665
11666
11667
11668ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default"
11669if test "x$ac_cv_have_decl_fchdir" = xyes; then :
11670  ac_have_decl=1
11671else
11672  ac_have_decl=0
11673fi
11674
11675cat >>confdefs.h <<_ACEOF
11676#define HAVE_DECL_FCHDIR $ac_have_decl
11677_ACEOF
11678
11679
11680     GNULIB_FCHMODAT=0;
11681  GNULIB_FSTAT=0;
11682  GNULIB_FSTATAT=0;
11683  GNULIB_FUTIMENS=0;
11684  GNULIB_LCHMOD=0;
11685  GNULIB_LSTAT=0;
11686  GNULIB_MKDIRAT=0;
11687  GNULIB_MKFIFO=0;
11688  GNULIB_MKFIFOAT=0;
11689  GNULIB_MKNOD=0;
11690  GNULIB_MKNODAT=0;
11691  GNULIB_STAT=0;
11692  GNULIB_UTIMENSAT=0;
11693  GNULIB_OVERRIDES_STRUCT_STAT=0;
11694    HAVE_FCHMODAT=1;
11695  HAVE_FSTATAT=1;
11696  HAVE_FUTIMENS=1;
11697  HAVE_LCHMOD=1;
11698  HAVE_LSTAT=1;
11699  HAVE_MKDIRAT=1;
11700  HAVE_MKFIFO=1;
11701  HAVE_MKFIFOAT=1;
11702  HAVE_MKNOD=1;
11703  HAVE_MKNODAT=1;
11704  HAVE_UTIMENSAT=1;
11705  REPLACE_FSTAT=0;
11706  REPLACE_FSTATAT=0;
11707  REPLACE_FUTIMENS=0;
11708  REPLACE_LSTAT=0;
11709  REPLACE_MKDIR=0;
11710  REPLACE_MKFIFO=0;
11711  REPLACE_MKNOD=0;
11712  REPLACE_STAT=0;
11713  REPLACE_UTIMENSAT=0;
11714
11715
11716
11717
11718
11719
11720  GNULIB_DPRINTF=0;
11721  GNULIB_FCLOSE=0;
11722  GNULIB_FDOPEN=0;
11723  GNULIB_FFLUSH=0;
11724  GNULIB_FGETC=0;
11725  GNULIB_FGETS=0;
11726  GNULIB_FOPEN=0;
11727  GNULIB_FPRINTF=0;
11728  GNULIB_FPRINTF_POSIX=0;
11729  GNULIB_FPURGE=0;
11730  GNULIB_FPUTC=0;
11731  GNULIB_FPUTS=0;
11732  GNULIB_FREAD=0;
11733  GNULIB_FREOPEN=0;
11734  GNULIB_FSCANF=0;
11735  GNULIB_FSEEK=0;
11736  GNULIB_FSEEKO=0;
11737  GNULIB_FTELL=0;
11738  GNULIB_FTELLO=0;
11739  GNULIB_FWRITE=0;
11740  GNULIB_GETC=0;
11741  GNULIB_GETCHAR=0;
11742  GNULIB_GETDELIM=0;
11743  GNULIB_GETLINE=0;
11744  GNULIB_OBSTACK_PRINTF=0;
11745  GNULIB_OBSTACK_PRINTF_POSIX=0;
11746  GNULIB_PCLOSE=0;
11747  GNULIB_PERROR=0;
11748  GNULIB_POPEN=0;
11749  GNULIB_PRINTF=0;
11750  GNULIB_PRINTF_POSIX=0;
11751  GNULIB_PUTC=0;
11752  GNULIB_PUTCHAR=0;
11753  GNULIB_PUTS=0;
11754  GNULIB_REMOVE=0;
11755  GNULIB_RENAME=0;
11756  GNULIB_RENAMEAT=0;
11757  GNULIB_SCANF=0;
11758  GNULIB_SNPRINTF=0;
11759  GNULIB_SPRINTF_POSIX=0;
11760  GNULIB_STDIO_H_NONBLOCKING=0;
11761  GNULIB_STDIO_H_SIGPIPE=0;
11762  GNULIB_TMPFILE=0;
11763  GNULIB_VASPRINTF=0;
11764  GNULIB_VFSCANF=0;
11765  GNULIB_VSCANF=0;
11766  GNULIB_VDPRINTF=0;
11767  GNULIB_VFPRINTF=0;
11768  GNULIB_VFPRINTF_POSIX=0;
11769  GNULIB_VPRINTF=0;
11770  GNULIB_VPRINTF_POSIX=0;
11771  GNULIB_VSNPRINTF=0;
11772  GNULIB_VSPRINTF_POSIX=0;
11773    HAVE_DECL_FPURGE=1;
11774  HAVE_DECL_FSEEKO=1;
11775  HAVE_DECL_FTELLO=1;
11776  HAVE_DECL_GETDELIM=1;
11777  HAVE_DECL_GETLINE=1;
11778  HAVE_DECL_OBSTACK_PRINTF=1;
11779  HAVE_DECL_SNPRINTF=1;
11780  HAVE_DECL_VSNPRINTF=1;
11781  HAVE_DPRINTF=1;
11782  HAVE_FSEEKO=1;
11783  HAVE_FTELLO=1;
11784  HAVE_PCLOSE=1;
11785  HAVE_POPEN=1;
11786  HAVE_RENAMEAT=1;
11787  HAVE_VASPRINTF=1;
11788  HAVE_VDPRINTF=1;
11789  REPLACE_DPRINTF=0;
11790  REPLACE_FCLOSE=0;
11791  REPLACE_FDOPEN=0;
11792  REPLACE_FFLUSH=0;
11793  REPLACE_FOPEN=0;
11794  REPLACE_FPRINTF=0;
11795  REPLACE_FPURGE=0;
11796  REPLACE_FREOPEN=0;
11797  REPLACE_FSEEK=0;
11798  REPLACE_FSEEKO=0;
11799  REPLACE_FTELL=0;
11800  REPLACE_FTELLO=0;
11801  REPLACE_GETDELIM=0;
11802  REPLACE_GETLINE=0;
11803  REPLACE_OBSTACK_PRINTF=0;
11804  REPLACE_PERROR=0;
11805  REPLACE_POPEN=0;
11806  REPLACE_PRINTF=0;
11807  REPLACE_REMOVE=0;
11808  REPLACE_RENAME=0;
11809  REPLACE_RENAMEAT=0;
11810  REPLACE_SNPRINTF=0;
11811  REPLACE_SPRINTF=0;
11812  REPLACE_STDIO_READ_FUNCS=0;
11813  REPLACE_STDIO_WRITE_FUNCS=0;
11814  REPLACE_TMPFILE=0;
11815  REPLACE_VASPRINTF=0;
11816  REPLACE_VDPRINTF=0;
11817  REPLACE_VFPRINTF=0;
11818  REPLACE_VPRINTF=0;
11819  REPLACE_VSNPRINTF=0;
11820  REPLACE_VSPRINTF=0;
11821
11822
11823  GNULIB_FCNTL=0;
11824  GNULIB_NONBLOCKING=0;
11825  GNULIB_OPEN=0;
11826  GNULIB_OPENAT=0;
11827    HAVE_FCNTL=1;
11828  HAVE_OPENAT=1;
11829  REPLACE_FCNTL=0;
11830  REPLACE_OPEN=0;
11831  REPLACE_OPENAT=0;
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
11843$as_echo_n "checking for working fcntl.h... " >&6; }
11844if ${gl_cv_header_working_fcntl_h+:} false; then :
11845  $as_echo_n "(cached) " >&6
11846else
11847  if test "$cross_compiling" = yes; then :
11848  case "$host_os" in
11849                  # Guess 'no' on native Windows.
11850          mingw*) gl_cv_header_working_fcntl_h='no' ;;
11851          *)      gl_cv_header_working_fcntl_h=cross-compiling ;;
11852        esac
11853
11854else
11855  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11856/* end confdefs.h.  */
11857#include <sys/types.h>
11858           #include <sys/stat.h>
11859           #if HAVE_UNISTD_H
11860           # include <unistd.h>
11861           #else /* on Windows with MSVC */
11862           # include <io.h>
11863           # include <stdlib.h>
11864           # defined sleep(n) _sleep ((n) * 1000)
11865           #endif
11866           #include <fcntl.h>
11867           #ifndef O_NOATIME
11868            #define O_NOATIME 0
11869           #endif
11870           #ifndef O_NOFOLLOW
11871            #define O_NOFOLLOW 0
11872           #endif
11873           static int const constants[] =
11874            {
11875              O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
11876              O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
11877            };
11878
11879int
11880main ()
11881{
11882
11883            int result = !constants;
11884            #if HAVE_SYMLINK
11885            {
11886              static char const sym[] = "conftest.sym";
11887              if (symlink ("/dev/null", sym) != 0)
11888                result |= 2;
11889              else
11890                {
11891                  int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
11892                  if (fd >= 0)
11893                    {
11894                      close (fd);
11895                      result |= 4;
11896                    }
11897                }
11898              if (unlink (sym) != 0 || symlink (".", sym) != 0)
11899                result |= 2;
11900              else
11901                {
11902                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
11903                  if (fd >= 0)
11904                    {
11905                      close (fd);
11906                      result |= 4;
11907                    }
11908                }
11909              unlink (sym);
11910            }
11911            #endif
11912            {
11913              static char const file[] = "confdefs.h";
11914              int fd = open (file, O_RDONLY | O_NOATIME);
11915              if (fd < 0)
11916                result |= 8;
11917              else
11918                {
11919                  struct stat st0;
11920                  if (fstat (fd, &st0) != 0)
11921                    result |= 16;
11922                  else
11923                    {
11924                      char c;
11925                      sleep (1);
11926                      if (read (fd, &c, 1) != 1)
11927                        result |= 24;
11928                      else
11929                        {
11930                          if (close (fd) != 0)
11931                            result |= 32;
11932                          else
11933                            {
11934                              struct stat st1;
11935                              if (stat (file, &st1) != 0)
11936                                result |= 40;
11937                              else
11938                                if (st0.st_atime != st1.st_atime)
11939                                  result |= 64;
11940                            }
11941                        }
11942                    }
11943                }
11944            }
11945            return result;
11946  ;
11947  return 0;
11948}
11949_ACEOF
11950if ac_fn_c_try_run "$LINENO"; then :
11951  gl_cv_header_working_fcntl_h=yes
11952else
11953  case $? in #(
11954        4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
11955        64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
11956        68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
11957         *) gl_cv_header_working_fcntl_h='no';;
11958        esac
11959fi
11960rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11961  conftest.$ac_objext conftest.beam conftest.$ac_ext
11962fi
11963
11964
11965fi
11966{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
11967$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
11968
11969  case $gl_cv_header_working_fcntl_h in #(
11970  *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
11971  *) ac_val=1;;
11972  esac
11973
11974cat >>confdefs.h <<_ACEOF
11975#define HAVE_WORKING_O_NOATIME $ac_val
11976_ACEOF
11977
11978
11979  case $gl_cv_header_working_fcntl_h in #(
11980  *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
11981  *) ac_val=1;;
11982  esac
11983
11984cat >>confdefs.h <<_ACEOF
11985#define HAVE_WORKING_O_NOFOLLOW $ac_val
11986_ACEOF
11987
11988
11989ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
11990if test "x$ac_cv_type_pid_t" = xyes; then :
11991
11992else
11993
11994cat >>confdefs.h <<_ACEOF
11995#define pid_t int
11996_ACEOF
11997
11998fi
11999
12000ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
12001if test "x$ac_cv_type_mode_t" = xyes; then :
12002
12003else
12004
12005cat >>confdefs.h <<_ACEOF
12006#define mode_t int
12007_ACEOF
12008
12009fi
12010
12011
12012
12013  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
12014$as_echo_n "checking for promoted mode_t type... " >&6; }
12015if ${gl_cv_promoted_mode_t+:} false; then :
12016  $as_echo_n "(cached) " >&6
12017else
12018
12019                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12020/* end confdefs.h.  */
12021#include <sys/types.h>
12022int
12023main ()
12024{
12025typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
12026  ;
12027  return 0;
12028}
12029_ACEOF
12030if ac_fn_c_try_compile "$LINENO"; then :
12031  gl_cv_promoted_mode_t='int'
12032else
12033  gl_cv_promoted_mode_t='mode_t'
12034fi
12035rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12036
12037fi
12038{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
12039$as_echo "$gl_cv_promoted_mode_t" >&6; }
12040
12041cat >>confdefs.h <<_ACEOF
12042#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
12043_ACEOF
12044
12045
12046ac_fn_c_check_decl "$LINENO" "fdatasync" "ac_cv_have_decl_fdatasync" "$ac_includes_default"
12047if test "x$ac_cv_have_decl_fdatasync" = xyes; then :
12048  ac_have_decl=1
12049else
12050  ac_have_decl=0
12051fi
12052
12053cat >>confdefs.h <<_ACEOF
12054#define HAVE_DECL_FDATASYNC $ac_have_decl
12055_ACEOF
12056
12057{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_dm_mode in struct stat" >&5
12058$as_echo_n "checking for st_dm_mode in struct stat... " >&6; }
12059if ${ac_cv_struct_st_dm_mode+:} false; then :
12060  $as_echo_n "(cached) " >&6
12061else
12062  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12063/* end confdefs.h.  */
12064
12065#include <sys/types.h>
12066#include <sys/stat.h>
12067int
12068main ()
12069{
12070struct stat s; s.st_dm_mode;
12071  ;
12072  return 0;
12073}
12074_ACEOF
12075if ac_fn_c_try_compile "$LINENO"; then :
12076  ac_cv_struct_st_dm_mode=yes
12077else
12078  ac_cv_struct_st_dm_mode=no
12079fi
12080rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12081fi
12082{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_st_dm_mode" >&5
12083$as_echo "$ac_cv_struct_st_dm_mode" >&6; }
12084
12085  if test $ac_cv_struct_st_dm_mode = yes; then
12086
12087$as_echo "#define HAVE_ST_DM_MODE 1" >>confdefs.h
12088
12089  fi
12090
12091
12092ac_fn_c_check_decl "$LINENO" "strmode" "ac_cv_have_decl_strmode" "$ac_includes_default"
12093if test "x$ac_cv_have_decl_strmode" = xyes; then :
12094  ac_have_decl=1
12095else
12096  ac_have_decl=0
12097fi
12098
12099cat >>confdefs.h <<_ACEOF
12100#define HAVE_DECL_STRMODE $ac_have_decl
12101_ACEOF
12102
12103
12104
12105
12106
12107
12108
12109
12110   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
12111$as_echo_n "checking for mbstate_t... " >&6; }
12112if ${ac_cv_type_mbstate_t+:} false; then :
12113  $as_echo_n "(cached) " >&6
12114else
12115  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12116/* end confdefs.h.  */
12117$ac_includes_default
12118/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
12119   <wchar.h>.
12120   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12121   included before <wchar.h>.  */
12122#include <stddef.h>
12123#include <stdio.h>
12124#include <time.h>
12125#include <wchar.h>
12126int
12127main ()
12128{
12129mbstate_t x; return sizeof x;
12130  ;
12131  return 0;
12132}
12133_ACEOF
12134if ac_fn_c_try_compile "$LINENO"; then :
12135  ac_cv_type_mbstate_t=yes
12136else
12137  ac_cv_type_mbstate_t=no
12138fi
12139rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12140fi
12141{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
12142$as_echo "$ac_cv_type_mbstate_t" >&6; }
12143   if test $ac_cv_type_mbstate_t = yes; then
12144
12145$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
12146
12147   else
12148
12149$as_echo "#define mbstate_t int" >>confdefs.h
12150
12151   fi
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182  GNULIB_ACOSF=0;
12183  GNULIB_ACOSL=0;
12184  GNULIB_ASINF=0;
12185  GNULIB_ASINL=0;
12186  GNULIB_ATANF=0;
12187  GNULIB_ATANL=0;
12188  GNULIB_ATAN2F=0;
12189  GNULIB_CBRT=0;
12190  GNULIB_CBRTF=0;
12191  GNULIB_CBRTL=0;
12192  GNULIB_CEIL=0;
12193  GNULIB_CEILF=0;
12194  GNULIB_CEILL=0;
12195  GNULIB_COPYSIGN=0;
12196  GNULIB_COPYSIGNF=0;
12197  GNULIB_COPYSIGNL=0;
12198  GNULIB_COSF=0;
12199  GNULIB_COSL=0;
12200  GNULIB_COSHF=0;
12201  GNULIB_EXPF=0;
12202  GNULIB_EXPL=0;
12203  GNULIB_EXP2=0;
12204  GNULIB_EXP2F=0;
12205  GNULIB_EXP2L=0;
12206  GNULIB_EXPM1=0;
12207  GNULIB_EXPM1F=0;
12208  GNULIB_EXPM1L=0;
12209  GNULIB_FABSF=0;
12210  GNULIB_FABSL=0;
12211  GNULIB_FLOOR=0;
12212  GNULIB_FLOORF=0;
12213  GNULIB_FLOORL=0;
12214  GNULIB_FMA=0;
12215  GNULIB_FMAF=0;
12216  GNULIB_FMAL=0;
12217  GNULIB_FMOD=0;
12218  GNULIB_FMODF=0;
12219  GNULIB_FMODL=0;
12220  GNULIB_FREXPF=0;
12221  GNULIB_FREXP=0;
12222  GNULIB_FREXPL=0;
12223  GNULIB_HYPOT=0;
12224  GNULIB_HYPOTF=0;
12225  GNULIB_HYPOTL=0;
12226  GNULIB_ILOGB=0;
12227  GNULIB_ILOGBF=0;
12228  GNULIB_ILOGBL=0;
12229  GNULIB_ISFINITE=0;
12230  GNULIB_ISINF=0;
12231  GNULIB_ISNAN=0;
12232  GNULIB_ISNANF=0;
12233  GNULIB_ISNAND=0;
12234  GNULIB_ISNANL=0;
12235  GNULIB_LDEXPF=0;
12236  GNULIB_LDEXPL=0;
12237  GNULIB_LOG=0;
12238  GNULIB_LOGF=0;
12239  GNULIB_LOGL=0;
12240  GNULIB_LOG10=0;
12241  GNULIB_LOG10F=0;
12242  GNULIB_LOG10L=0;
12243  GNULIB_LOG1P=0;
12244  GNULIB_LOG1PF=0;
12245  GNULIB_LOG1PL=0;
12246  GNULIB_LOG2=0;
12247  GNULIB_LOG2F=0;
12248  GNULIB_LOG2L=0;
12249  GNULIB_LOGB=0;
12250  GNULIB_LOGBF=0;
12251  GNULIB_LOGBL=0;
12252  GNULIB_MODF=0;
12253  GNULIB_MODFF=0;
12254  GNULIB_MODFL=0;
12255  GNULIB_POWF=0;
12256  GNULIB_REMAINDER=0;
12257  GNULIB_REMAINDERF=0;
12258  GNULIB_REMAINDERL=0;
12259  GNULIB_RINT=0;
12260  GNULIB_RINTF=0;
12261  GNULIB_RINTL=0;
12262  GNULIB_ROUND=0;
12263  GNULIB_ROUNDF=0;
12264  GNULIB_ROUNDL=0;
12265  GNULIB_SIGNBIT=0;
12266  GNULIB_SINF=0;
12267  GNULIB_SINL=0;
12268  GNULIB_SINHF=0;
12269  GNULIB_SQRTF=0;
12270  GNULIB_SQRTL=0;
12271  GNULIB_TANF=0;
12272  GNULIB_TANL=0;
12273  GNULIB_TANHF=0;
12274  GNULIB_TRUNC=0;
12275  GNULIB_TRUNCF=0;
12276  GNULIB_TRUNCL=0;
12277    HAVE_ACOSF=1;
12278  HAVE_ACOSL=1;
12279  HAVE_ASINF=1;
12280  HAVE_ASINL=1;
12281  HAVE_ATANF=1;
12282  HAVE_ATANL=1;
12283  HAVE_ATAN2F=1;
12284  HAVE_CBRT=1;
12285  HAVE_CBRTF=1;
12286  HAVE_CBRTL=1;
12287  HAVE_COPYSIGN=1;
12288  HAVE_COPYSIGNL=1;
12289  HAVE_COSF=1;
12290  HAVE_COSL=1;
12291  HAVE_COSHF=1;
12292  HAVE_EXPF=1;
12293  HAVE_EXPL=1;
12294  HAVE_EXPM1=1;
12295  HAVE_EXPM1F=1;
12296  HAVE_FABSF=1;
12297  HAVE_FABSL=1;
12298  HAVE_FMA=1;
12299  HAVE_FMAF=1;
12300  HAVE_FMAL=1;
12301  HAVE_FMODF=1;
12302  HAVE_FMODL=1;
12303  HAVE_FREXPF=1;
12304  HAVE_HYPOTF=1;
12305  HAVE_HYPOTL=1;
12306  HAVE_ILOGB=1;
12307  HAVE_ILOGBF=1;
12308  HAVE_ILOGBL=1;
12309  HAVE_ISNANF=1;
12310  HAVE_ISNAND=1;
12311  HAVE_ISNANL=1;
12312  HAVE_LDEXPF=1;
12313  HAVE_LOGF=1;
12314  HAVE_LOGL=1;
12315  HAVE_LOG10F=1;
12316  HAVE_LOG10L=1;
12317  HAVE_LOG1P=1;
12318  HAVE_LOG1PF=1;
12319  HAVE_LOG1PL=1;
12320  HAVE_LOGBF=1;
12321  HAVE_LOGBL=1;
12322  HAVE_MODFF=1;
12323  HAVE_MODFL=1;
12324  HAVE_POWF=1;
12325  HAVE_REMAINDER=1;
12326  HAVE_REMAINDERF=1;
12327  HAVE_RINT=1;
12328  HAVE_RINTL=1;
12329  HAVE_SINF=1;
12330  HAVE_SINL=1;
12331  HAVE_SINHF=1;
12332  HAVE_SQRTF=1;
12333  HAVE_SQRTL=1;
12334  HAVE_TANF=1;
12335  HAVE_TANL=1;
12336  HAVE_TANHF=1;
12337  HAVE_DECL_ACOSL=1;
12338  HAVE_DECL_ASINL=1;
12339  HAVE_DECL_ATANL=1;
12340  HAVE_DECL_CBRTF=1;
12341  HAVE_DECL_CBRTL=1;
12342  HAVE_DECL_CEILF=1;
12343  HAVE_DECL_CEILL=1;
12344  HAVE_DECL_COPYSIGNF=1;
12345  HAVE_DECL_COSL=1;
12346  HAVE_DECL_EXPL=1;
12347  HAVE_DECL_EXP2=1;
12348  HAVE_DECL_EXP2F=1;
12349  HAVE_DECL_EXP2L=1;
12350  HAVE_DECL_EXPM1L=1;
12351  HAVE_DECL_FLOORF=1;
12352  HAVE_DECL_FLOORL=1;
12353  HAVE_DECL_FREXPL=1;
12354  HAVE_DECL_LDEXPL=1;
12355  HAVE_DECL_LOGL=1;
12356  HAVE_DECL_LOG10L=1;
12357  HAVE_DECL_LOG2=1;
12358  HAVE_DECL_LOG2F=1;
12359  HAVE_DECL_LOG2L=1;
12360  HAVE_DECL_LOGB=1;
12361  HAVE_DECL_REMAINDER=1;
12362  HAVE_DECL_REMAINDERL=1;
12363  HAVE_DECL_RINTF=1;
12364  HAVE_DECL_ROUND=1;
12365  HAVE_DECL_ROUNDF=1;
12366  HAVE_DECL_ROUNDL=1;
12367  HAVE_DECL_SINL=1;
12368  HAVE_DECL_SQRTL=1;
12369  HAVE_DECL_TANL=1;
12370  HAVE_DECL_TRUNC=1;
12371  HAVE_DECL_TRUNCF=1;
12372  HAVE_DECL_TRUNCL=1;
12373  REPLACE_ACOSF=0;
12374  REPLACE_ASINF=0;
12375  REPLACE_ATANF=0;
12376  REPLACE_ATAN2F=0;
12377  REPLACE_CBRTF=0;
12378  REPLACE_CBRTL=0;
12379  REPLACE_CEIL=0;
12380  REPLACE_CEILF=0;
12381  REPLACE_CEILL=0;
12382  REPLACE_COSF=0;
12383  REPLACE_COSHF=0;
12384  REPLACE_EXPF=0;
12385  REPLACE_EXPM1=0;
12386  REPLACE_EXPM1F=0;
12387  REPLACE_EXP2=0;
12388  REPLACE_EXP2L=0;
12389  REPLACE_FABSL=0;
12390  REPLACE_FLOOR=0;
12391  REPLACE_FLOORF=0;
12392  REPLACE_FLOORL=0;
12393  REPLACE_FMA=0;
12394  REPLACE_FMAF=0;
12395  REPLACE_FMAL=0;
12396  REPLACE_FMOD=0;
12397  REPLACE_FMODF=0;
12398  REPLACE_FMODL=0;
12399  REPLACE_FREXPF=0;
12400  REPLACE_FREXP=0;
12401  REPLACE_FREXPL=0;
12402  REPLACE_HUGE_VAL=0;
12403  REPLACE_HYPOT=0;
12404  REPLACE_HYPOTF=0;
12405  REPLACE_HYPOTL=0;
12406  REPLACE_ILOGB=0;
12407  REPLACE_ILOGBF=0;
12408  REPLACE_ILOGBL=0;
12409  REPLACE_ISFINITE=0;
12410  REPLACE_ISINF=0;
12411  REPLACE_ISNAN=0;
12412  REPLACE_LDEXPL=0;
12413  REPLACE_LOG=0;
12414  REPLACE_LOGF=0;
12415  REPLACE_LOGL=0;
12416  REPLACE_LOG10=0;
12417  REPLACE_LOG10F=0;
12418  REPLACE_LOG10L=0;
12419  REPLACE_LOG1P=0;
12420  REPLACE_LOG1PF=0;
12421  REPLACE_LOG1PL=0;
12422  REPLACE_LOG2=0;
12423  REPLACE_LOG2F=0;
12424  REPLACE_LOG2L=0;
12425  REPLACE_LOGB=0;
12426  REPLACE_LOGBF=0;
12427  REPLACE_LOGBL=0;
12428  REPLACE_MODF=0;
12429  REPLACE_MODFF=0;
12430  REPLACE_MODFL=0;
12431  REPLACE_NAN=0;
12432  REPLACE_REMAINDER=0;
12433  REPLACE_REMAINDERF=0;
12434  REPLACE_REMAINDERL=0;
12435  REPLACE_ROUND=0;
12436  REPLACE_ROUNDF=0;
12437  REPLACE_ROUNDL=0;
12438  REPLACE_SIGNBIT=0;
12439  REPLACE_SIGNBIT_USING_GCC=0;
12440  REPLACE_SINF=0;
12441  REPLACE_SINHF=0;
12442  REPLACE_SQRTF=0;
12443  REPLACE_SQRTL=0;
12444  REPLACE_TANF=0;
12445  REPLACE_TANHF=0;
12446  REPLACE_TRUNC=0;
12447  REPLACE_TRUNCF=0;
12448  REPLACE_TRUNCL=0;
12449
12450
12451  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
12452$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
12453if ${gl_cv_func_frexp_no_libm+:} false; then :
12454  $as_echo_n "(cached) " >&6
12455else
12456
12457      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12458/* end confdefs.h.  */
12459#include <math.h>
12460             double x;
12461int
12462main ()
12463{
12464int e; return frexp (x, &e) > 0;
12465  ;
12466  return 0;
12467}
12468_ACEOF
12469if ac_fn_c_try_link "$LINENO"; then :
12470  gl_cv_func_frexp_no_libm=yes
12471else
12472  gl_cv_func_frexp_no_libm=no
12473fi
12474rm -f core conftest.err conftest.$ac_objext \
12475    conftest$ac_exeext conftest.$ac_ext
12476
12477fi
12478{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
12479$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
12480
12481ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
12482if test "x$ac_cv_have_decl_alarm" = xyes; then :
12483  ac_have_decl=1
12484else
12485  ac_have_decl=0
12486fi
12487
12488cat >>confdefs.h <<_ACEOF
12489#define HAVE_DECL_ALARM $ac_have_decl
12490_ACEOF
12491
12492
12493  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
12494$as_echo_n "checking whether long double and double are the same... " >&6; }
12495if ${gl_cv_long_double_equals_double+:} false; then :
12496  $as_echo_n "(cached) " >&6
12497else
12498  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12499/* end confdefs.h.  */
12500#include <float.h>
12501int
12502main ()
12503{
12504typedef int check[sizeof (long double) == sizeof (double)
12505                              && LDBL_MANT_DIG == DBL_MANT_DIG
12506                              && LDBL_MAX_EXP == DBL_MAX_EXP
12507                              && LDBL_MIN_EXP == DBL_MIN_EXP
12508                              ? 1 : -1];
12509
12510  ;
12511  return 0;
12512}
12513_ACEOF
12514if ac_fn_c_try_compile "$LINENO"; then :
12515  gl_cv_long_double_equals_double=yes
12516else
12517  gl_cv_long_double_equals_double=no
12518fi
12519rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12520
12521fi
12522{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
12523$as_echo "$gl_cv_long_double_equals_double" >&6; }
12524  if test $gl_cv_long_double_equals_double = yes; then
12525
12526$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
12527
12528    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
12529  else
12530    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
12531  fi
12532
12533
12534
12535    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdin defaults to large file offsets" >&5
12536$as_echo_n "checking whether stdin defaults to large file offsets... " >&6; }
12537if ${gl_cv_var_stdin_large_offset+:} false; then :
12538  $as_echo_n "(cached) " >&6
12539else
12540  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12541/* end confdefs.h.  */
12542#include <stdio.h>
12543int
12544main ()
12545{
12546#if defined __SL64 && defined __SCLE /* cygwin */
12547  /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
12548     fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, and
12549     it is easier to do a version check than building a runtime test.  */
12550# include <cygwin/version.h>
12551# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
12552  choke me
12553# endif
12554#endif
12555  ;
12556  return 0;
12557}
12558_ACEOF
12559if ac_fn_c_try_link "$LINENO"; then :
12560  gl_cv_var_stdin_large_offset=yes
12561else
12562  gl_cv_var_stdin_large_offset=no
12563fi
12564rm -f core conftest.err conftest.$ac_objext \
12565    conftest$ac_exeext conftest.$ac_ext
12566fi
12567{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var_stdin_large_offset" >&5
12568$as_echo "$gl_cv_var_stdin_large_offset" >&6; }
12569
12570
12571
12572
12573
12574  case "$host_os" in
12575    mingw*)
12576                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
12577$as_echo_n "checking for 64-bit off_t... " >&6; }
12578if ${gl_cv_type_off_t_64+:} false; then :
12579  $as_echo_n "(cached) " >&6
12580else
12581  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12582/* end confdefs.h.  */
12583#include <sys/types.h>
12584                int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
12585
12586int
12587main ()
12588{
12589
12590  ;
12591  return 0;
12592}
12593_ACEOF
12594if ac_fn_c_try_compile "$LINENO"; then :
12595  gl_cv_type_off_t_64=yes
12596else
12597  gl_cv_type_off_t_64=no
12598fi
12599rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12600
12601fi
12602{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
12603$as_echo "$gl_cv_type_off_t_64" >&6; }
12604      if test $gl_cv_type_off_t_64 = no; then
12605        WINDOWS_64_BIT_OFF_T=1
12606      else
12607        WINDOWS_64_BIT_OFF_T=0
12608      fi
12609                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5
12610$as_echo_n "checking for 64-bit st_size... " >&6; }
12611if ${gl_cv_member_st_size_64+:} false; then :
12612  $as_echo_n "(cached) " >&6
12613else
12614  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12615/* end confdefs.h.  */
12616#include <sys/types.h>
12617                struct stat buf;
12618                int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
12619
12620int
12621main ()
12622{
12623
12624  ;
12625  return 0;
12626}
12627_ACEOF
12628if ac_fn_c_try_compile "$LINENO"; then :
12629  gl_cv_member_st_size_64=yes
12630else
12631  gl_cv_member_st_size_64=no
12632fi
12633rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12634
12635fi
12636{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5
12637$as_echo "$gl_cv_member_st_size_64" >&6; }
12638      if test $gl_cv_member_st_size_64 = no; then
12639        WINDOWS_64_BIT_ST_SIZE=1
12640      else
12641        WINDOWS_64_BIT_ST_SIZE=0
12642      fi
12643      ;;
12644    *)
12645                                                      WINDOWS_64_BIT_OFF_T=0
12646      WINDOWS_64_BIT_ST_SIZE=0
12647      ;;
12648  esac
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658$as_echo "#define _USE_STD_STAT 1" >>confdefs.h
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670     if test $gl_cv_have_include_next = yes; then
12671       gl_cv_next_sys_types_h='<'sys/types.h'>'
12672     else
12673       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
12674$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
12675if ${gl_cv_next_sys_types_h+:} false; then :
12676  $as_echo_n "(cached) " >&6
12677else
12678
12679
12680
12681  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12682/* end confdefs.h.  */
12683#include <sys/types.h>
12684_ACEOF
12685                case "$host_os" in
12686    aix*) gl_absname_cpp="$ac_cpp -C" ;;
12687    *)    gl_absname_cpp="$ac_cpp" ;;
12688  esac
12689
12690  case "$host_os" in
12691    mingw*)
12692                                          gl_dirsep_regex='[/\\]'
12693      ;;
12694    *)
12695      gl_dirsep_regex='\/'
12696      ;;
12697  esac
12698      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
12699  gl_header_literal_regex=`echo 'sys/types.h' \
12700                           | sed -e "$gl_make_literal_regex_sed"`
12701  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
12702      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
12703      s|^/[^/]|//&|
12704      p
12705      q
12706    }'
12707
12708        gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
12709  sed -n "$gl_absolute_header_sed"`
12710
12711           gl_header=$gl_cv_absolute_sys_types_h
12712           gl_cv_next_sys_types_h='"'$gl_header'"'
12713
12714
12715fi
12716{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
12717$as_echo "$gl_cv_next_sys_types_h" >&6; }
12718     fi
12719     NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
12720
12721     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
12722       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
12723       gl_next_as_first_directive='<'sys/types.h'>'
12724     else
12725       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
12726       gl_next_as_first_directive=$gl_cv_next_sys_types_h
12727     fi
12728     NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741    WINDOWS_STAT_INODES=0
12742
12743
12744
12745ac_fn_c_check_decl "$LINENO" "fseeko" "ac_cv_have_decl_fseeko" "$ac_includes_default"
12746if test "x$ac_cv_have_decl_fseeko" = xyes; then :
12747  ac_have_decl=1
12748else
12749  ac_have_decl=0
12750fi
12751
12752cat >>confdefs.h <<_ACEOF
12753#define HAVE_DECL_FSEEKO $ac_have_decl
12754_ACEOF
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5
12765$as_echo_n "checking for fseeko... " >&6; }
12766if ${gl_cv_func_fseeko+:} false; then :
12767  $as_echo_n "(cached) " >&6
12768else
12769
12770      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12771/* end confdefs.h.  */
12772#include <stdio.h>
12773
12774int
12775main ()
12776{
12777fseeko (stdin, 0, 0);
12778  ;
12779  return 0;
12780}
12781_ACEOF
12782if ac_fn_c_try_link "$LINENO"; then :
12783  gl_cv_func_fseeko=yes
12784else
12785  gl_cv_func_fseeko=no
12786fi
12787rm -f core conftest.err conftest.$ac_objext \
12788    conftest$ac_exeext conftest.$ac_ext
12789
12790fi
12791{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5
12792$as_echo "$gl_cv_func_fseeko" >&6; }
12793
12794
12795  if test $ac_cv_have_decl_fseeko = no; then
12796    HAVE_DECL_FSEEKO=0
12797  fi
12798
12799  if test $gl_cv_func_fseeko = no; then
12800    HAVE_FSEEKO=0
12801  else
12802    if test $WINDOWS_64_BIT_OFF_T = 1; then
12803      REPLACE_FSEEKO=1
12804    fi
12805    if test $gl_cv_var_stdin_large_offset = no; then
12806      REPLACE_FSEEKO=1
12807    fi
12808
12809
12810
12811  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
12812$as_echo_n "checking whether fflush works on input streams... " >&6; }
12813if ${gl_cv_func_fflush_stdin+:} false; then :
12814  $as_echo_n "(cached) " >&6
12815else
12816  echo hello world > conftest.txt
12817     if test "$cross_compiling" = yes; then :
12818  case "$host_os" in
12819                  # Guess no on native Windows.
12820          mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
12821          *)      gl_cv_func_fflush_stdin=cross ;;
12822        esac
12823
12824else
12825  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12826/* end confdefs.h.  */
12827
12828#include <stdio.h>
12829#if HAVE_UNISTD_H
12830# include <unistd.h>
12831#else /* on Windows with MSVC */
12832# include <io.h>
12833#endif
12834
12835int
12836main ()
12837{
12838FILE *f = fopen ("conftest.txt", "r");
12839         char buffer[10];
12840         int fd;
12841         int c;
12842         if (f == NULL)
12843           return 1;
12844         fd = fileno (f);
12845         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
12846           { fclose (f); return 2; }
12847         /* For deterministic results, ensure f read a bigger buffer.  */
12848         if (lseek (fd, 0, SEEK_CUR) == 5)
12849           { fclose (f); return 3; }
12850         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
12851            on BSD systems and on mingw.  */
12852         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
12853           { fclose (f); return 4; }
12854         if (lseek (fd, 0, SEEK_CUR) != 5)
12855           { fclose (f); return 5; }
12856         /* Verify behaviour of fflush after ungetc. See
12857            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
12858         /* Verify behaviour of fflush after a backup ungetc.  This fails on
12859            mingw.  */
12860         c = fgetc (f);
12861         ungetc (c, f);
12862         fflush (f);
12863         if (fgetc (f) != c)
12864           { fclose (f); return 6; }
12865         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
12866            on glibc 2.8 and on BSD systems.  */
12867         c = fgetc (f);
12868         ungetc ('@', f);
12869         fflush (f);
12870         if (fgetc (f) != c)
12871           { fclose (f); return 7; }
12872         fclose (f);
12873         return 0;
12874
12875  ;
12876  return 0;
12877}
12878_ACEOF
12879if ac_fn_c_try_run "$LINENO"; then :
12880  gl_cv_func_fflush_stdin=yes
12881else
12882  gl_cv_func_fflush_stdin=no
12883fi
12884rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12885  conftest.$ac_objext conftest.beam conftest.$ac_ext
12886fi
12887
12888     rm conftest.txt
12889
12890fi
12891{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
12892$as_echo "$gl_cv_func_fflush_stdin" >&6; }
12893  case "$gl_cv_func_fflush_stdin" in
12894    *yes) gl_func_fflush_stdin=1 ;;
12895    *no)  gl_func_fflush_stdin=0 ;;
12896    *)    gl_func_fflush_stdin='(-1)' ;;
12897  esac
12898
12899cat >>confdefs.h <<_ACEOF
12900#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
12901_ACEOF
12902
12903
12904      case "$gl_cv_func_fflush_stdin" in
12905        *yes) ;;
12906        *) REPLACE_FSEEKO=1 ;;
12907      esac
12908
12909  fi
12910
12911
12912
12913{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
12914$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
12915if ${ac_cv_header_stat_broken+:} false; then :
12916  $as_echo_n "(cached) " >&6
12917else
12918  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12919/* end confdefs.h.  */
12920#include <sys/types.h>
12921#include <sys/stat.h>
12922
12923#if defined S_ISBLK && defined S_IFDIR
12924extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
12925#endif
12926
12927#if defined S_ISBLK && defined S_IFCHR
12928extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
12929#endif
12930
12931#if defined S_ISLNK && defined S_IFREG
12932extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
12933#endif
12934
12935#if defined S_ISSOCK && defined S_IFREG
12936extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
12937#endif
12938
12939_ACEOF
12940if ac_fn_c_try_compile "$LINENO"; then :
12941  ac_cv_header_stat_broken=no
12942else
12943  ac_cv_header_stat_broken=yes
12944fi
12945rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12946fi
12947{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
12948$as_echo "$ac_cv_header_stat_broken" >&6; }
12949if test $ac_cv_header_stat_broken = yes; then
12950
12951$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
12952
12953fi
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971     if test $gl_cv_have_include_next = yes; then
12972       gl_cv_next_sys_stat_h='<'sys/stat.h'>'
12973     else
12974       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
12975$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
12976if ${gl_cv_next_sys_stat_h+:} false; then :
12977  $as_echo_n "(cached) " >&6
12978else
12979
12980             if test $ac_cv_header_sys_stat_h = yes; then
12981
12982
12983
12984
12985  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12986/* end confdefs.h.  */
12987#include <sys/stat.h>
12988_ACEOF
12989                case "$host_os" in
12990    aix*) gl_absname_cpp="$ac_cpp -C" ;;
12991    *)    gl_absname_cpp="$ac_cpp" ;;
12992  esac
12993
12994  case "$host_os" in
12995    mingw*)
12996                                          gl_dirsep_regex='[/\\]'
12997      ;;
12998    *)
12999      gl_dirsep_regex='\/'
13000      ;;
13001  esac
13002      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
13003  gl_header_literal_regex=`echo 'sys/stat.h' \
13004                           | sed -e "$gl_make_literal_regex_sed"`
13005  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
13006      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
13007      s|^/[^/]|//&|
13008      p
13009      q
13010    }'
13011
13012        gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
13013  sed -n "$gl_absolute_header_sed"`
13014
13015           gl_header=$gl_cv_absolute_sys_stat_h
13016           gl_cv_next_sys_stat_h='"'$gl_header'"'
13017          else
13018               gl_cv_next_sys_stat_h='<'sys/stat.h'>'
13019             fi
13020
13021
13022fi
13023{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
13024$as_echo "$gl_cv_next_sys_stat_h" >&6; }
13025     fi
13026     NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
13027
13028     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
13029       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
13030       gl_next_as_first_directive='<'sys/stat.h'>'
13031     else
13032       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
13033       gl_next_as_first_directive=$gl_cv_next_sys_stat_h
13034     fi
13035     NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
13036
13037
13038
13039
13040
13041
13042
13043
13044    WINDOWS_STAT_TIMESPEC=0
13045
13046
13047
13048
13049
13050
13051
13052
13053      ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
13054     #include <sys/stat.h>
13055"
13056if test "x$ac_cv_type_nlink_t" = xyes; then :
13057
13058else
13059
13060$as_echo "#define nlink_t int" >>confdefs.h
13061
13062fi
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075ac_fn_c_check_decl "$LINENO" "ftello" "ac_cv_have_decl_ftello" "$ac_includes_default"
13076if test "x$ac_cv_have_decl_ftello" = xyes; then :
13077  ac_have_decl=1
13078else
13079  ac_have_decl=0
13080fi
13081
13082cat >>confdefs.h <<_ACEOF
13083#define HAVE_DECL_FTELLO $ac_have_decl
13084_ACEOF
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095  if test $ac_cv_have_decl_ftello = no; then
13096    HAVE_DECL_FTELLO=0
13097  fi
13098
13099  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
13100$as_echo_n "checking for ftello... " >&6; }
13101if ${gl_cv_func_ftello+:} false; then :
13102  $as_echo_n "(cached) " >&6
13103else
13104
13105      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13106/* end confdefs.h.  */
13107#include <stdio.h>
13108int
13109main ()
13110{
13111ftello (stdin);
13112  ;
13113  return 0;
13114}
13115_ACEOF
13116if ac_fn_c_try_link "$LINENO"; then :
13117  gl_cv_func_ftello=yes
13118else
13119  gl_cv_func_ftello=no
13120fi
13121rm -f core conftest.err conftest.$ac_objext \
13122    conftest$ac_exeext conftest.$ac_ext
13123
13124fi
13125{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
13126$as_echo "$gl_cv_func_ftello" >&6; }
13127  if test $gl_cv_func_ftello = no; then
13128    HAVE_FTELLO=0
13129  else
13130    if test $WINDOWS_64_BIT_OFF_T = 1; then
13131      REPLACE_FTELLO=1
13132    fi
13133    if test $gl_cv_var_stdin_large_offset = no; then
13134      REPLACE_FTELLO=1
13135    fi
13136    if test $REPLACE_FTELLO = 0; then
13137
13138      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ftello works" >&5
13139$as_echo_n "checking whether ftello works... " >&6; }
13140if ${gl_cv_func_ftello_works+:} false; then :
13141  $as_echo_n "(cached) " >&6
13142else
13143
13144                              case "$host_os" in
13145                      # Guess no on Solaris.
13146            solaris*) gl_cv_func_ftello_works="guessing no" ;;
13147                      # Guess yes on native Windows.
13148            mingw*)   gl_cv_func_ftello_works="guessing yes" ;;
13149                      # Guess yes otherwise.
13150            *)        gl_cv_func_ftello_works="guessing yes" ;;
13151          esac
13152          if test "$cross_compiling" = yes; then :
13153  :
13154else
13155  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13156/* end confdefs.h.  */
13157
13158#include <stdio.h>
13159#include <stdlib.h>
13160#include <string.h>
13161#define TESTFILE "conftest.tmp"
13162int
13163main (void)
13164{
13165  FILE *fp;
13166
13167  /* Create a file with some contents.  */
13168  fp = fopen (TESTFILE, "w");
13169  if (fp == NULL)
13170    return 70;
13171  if (fwrite ("foogarsh", 1, 8, fp) < 8)
13172    { fclose (fp); return 71; }
13173  if (fclose (fp))
13174    return 72;
13175
13176  /* The file's contents is now "foogarsh".  */
13177
13178  /* Try writing after reading to EOF.  */
13179  fp = fopen (TESTFILE, "r+");
13180  if (fp == NULL)
13181    return 73;
13182  if (fseek (fp, -1, SEEK_END))
13183    { fclose (fp); return 74; }
13184  if (!(getc (fp) == 'h'))
13185    { fclose (fp); return 1; }
13186  if (!(getc (fp) == EOF))
13187    { fclose (fp); return 2; }
13188  if (!(ftell (fp) == 8))
13189    { fclose (fp); return 3; }
13190  if (!(ftell (fp) == 8))
13191    { fclose (fp); return 4; }
13192  if (!(putc ('!', fp) == '!'))
13193    { fclose (fp); return 5; }
13194  if (!(ftell (fp) == 9))
13195    { fclose (fp); return 6; }
13196  if (!(fclose (fp) == 0))
13197    return 7;
13198  fp = fopen (TESTFILE, "r");
13199  if (fp == NULL)
13200    return 75;
13201  {
13202    char buf[10];
13203    if (!(fread (buf, 1, 10, fp) == 9))
13204      { fclose (fp); return 10; }
13205    if (!(memcmp (buf, "foogarsh!", 9) == 0))
13206      { fclose (fp); return 11; }
13207  }
13208  if (!(fclose (fp) == 0))
13209    return 12;
13210
13211  /* The file's contents is now "foogarsh!".  */
13212
13213  return 0;
13214}
13215_ACEOF
13216if ac_fn_c_try_run "$LINENO"; then :
13217  gl_cv_func_ftello_works=yes
13218else
13219  gl_cv_func_ftello_works=no
13220fi
13221rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13222  conftest.$ac_objext conftest.beam conftest.$ac_ext
13223fi
13224
13225
13226fi
13227{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello_works" >&5
13228$as_echo "$gl_cv_func_ftello_works" >&6; }
13229      case "$gl_cv_func_ftello_works" in
13230        *yes) ;;
13231        *)
13232          REPLACE_FTELLO=1
13233
13234$as_echo "#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1" >>confdefs.h
13235
13236          ;;
13237      esac
13238    fi
13239  fi
13240
13241
13242
13243
13244
13245
13246
13247
13248  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
13249$as_echo_n "checking for O_CLOEXEC... " >&6; }
13250if ${gl_cv_macro_O_CLOEXEC+:} false; then :
13251  $as_echo_n "(cached) " >&6
13252else
13253  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13254/* end confdefs.h.  */
13255#include <fcntl.h>
13256                          #ifndef O_CLOEXEC
13257                            choke me;
13258                          #endif
13259
13260int
13261main ()
13262{
13263return O_CLOEXEC;
13264  ;
13265  return 0;
13266}
13267_ACEOF
13268if ac_fn_c_try_compile "$LINENO"; then :
13269  gl_cv_macro_O_CLOEXEC=yes
13270else
13271  gl_cv_macro_O_CLOEXEC=no
13272fi
13273rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13274fi
13275{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5
13276$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; }
13277
13278
13279
13280
13281
13282
13283  GNULIB_GETADDRINFO=0;
13284    HAVE_STRUCT_ADDRINFO=1;
13285  HAVE_DECL_FREEADDRINFO=1;
13286  HAVE_DECL_GAI_STRERROR=1;
13287  HAVE_DECL_GETADDRINFO=1;
13288  HAVE_DECL_GETNAMEINFO=1;
13289  REPLACE_GAI_STRERROR=0;
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304     if test $gl_cv_have_include_next = yes; then
13305       gl_cv_next_netdb_h='<'netdb.h'>'
13306     else
13307       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netdb.h>" >&5
13308$as_echo_n "checking absolute name of <netdb.h>... " >&6; }
13309if ${gl_cv_next_netdb_h+:} false; then :
13310  $as_echo_n "(cached) " >&6
13311else
13312
13313             if test $ac_cv_header_netdb_h = yes; then
13314
13315
13316
13317
13318  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13319/* end confdefs.h.  */
13320#include <netdb.h>
13321_ACEOF
13322                case "$host_os" in
13323    aix*) gl_absname_cpp="$ac_cpp -C" ;;
13324    *)    gl_absname_cpp="$ac_cpp" ;;
13325  esac
13326
13327  case "$host_os" in
13328    mingw*)
13329                                          gl_dirsep_regex='[/\\]'
13330      ;;
13331    *)
13332      gl_dirsep_regex='\/'
13333      ;;
13334  esac
13335      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
13336  gl_header_literal_regex=`echo 'netdb.h' \
13337                           | sed -e "$gl_make_literal_regex_sed"`
13338  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
13339      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
13340      s|^/[^/]|//&|
13341      p
13342      q
13343    }'
13344
13345        gl_cv_absolute_netdb_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
13346  sed -n "$gl_absolute_header_sed"`
13347
13348           gl_header=$gl_cv_absolute_netdb_h
13349           gl_cv_next_netdb_h='"'$gl_header'"'
13350          else
13351               gl_cv_next_netdb_h='<'netdb.h'>'
13352             fi
13353
13354
13355fi
13356{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netdb_h" >&5
13357$as_echo "$gl_cv_next_netdb_h" >&6; }
13358     fi
13359     NEXT_NETDB_H=$gl_cv_next_netdb_h
13360
13361     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
13362       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
13363       gl_next_as_first_directive='<'netdb.h'>'
13364     else
13365       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
13366       gl_next_as_first_directive=$gl_cv_next_netdb_h
13367     fi
13368     NEXT_AS_FIRST_DIRECTIVE_NETDB_H=$gl_next_as_first_directive
13369
13370
13371
13372
13373  if test $ac_cv_header_netdb_h = yes; then
13374    HAVE_NETDB_H=1
13375  else
13376    HAVE_NETDB_H=0
13377  fi
13378
13379
13380
13381
13382
13383                  HOSTENT_LIB=
13384  gl_saved_libs="$LIBS"
13385  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
13386$as_echo_n "checking for library containing gethostbyname... " >&6; }
13387if ${ac_cv_search_gethostbyname+:} false; then :
13388  $as_echo_n "(cached) " >&6
13389else
13390  ac_func_search_save_LIBS=$LIBS
13391cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13392/* end confdefs.h.  */
13393
13394/* Override any GCC internal prototype to avoid an error.
13395   Use char because int might match the return type of a GCC
13396   builtin and then its argument prototype would still apply.  */
13397#ifdef __cplusplus
13398extern "C"
13399#endif
13400char gethostbyname ();
13401int
13402main ()
13403{
13404return gethostbyname ();
13405  ;
13406  return 0;
13407}
13408_ACEOF
13409for ac_lib in '' nsl network net; do
13410  if test -z "$ac_lib"; then
13411    ac_res="none required"
13412  else
13413    ac_res=-l$ac_lib
13414    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
13415  fi
13416  if ac_fn_c_try_link "$LINENO"; then :
13417  ac_cv_search_gethostbyname=$ac_res
13418fi
13419rm -f core conftest.err conftest.$ac_objext \
13420    conftest$ac_exeext
13421  if ${ac_cv_search_gethostbyname+:} false; then :
13422  break
13423fi
13424done
13425if ${ac_cv_search_gethostbyname+:} false; then :
13426
13427else
13428  ac_cv_search_gethostbyname=no
13429fi
13430rm conftest.$ac_ext
13431LIBS=$ac_func_search_save_LIBS
13432fi
13433{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
13434$as_echo "$ac_cv_search_gethostbyname" >&6; }
13435ac_res=$ac_cv_search_gethostbyname
13436if test "$ac_res" != no; then :
13437  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
13438  if test "$ac_cv_search_gethostbyname" != "none required"; then
13439       HOSTENT_LIB="$ac_cv_search_gethostbyname"
13440     fi
13441fi
13442
13443  LIBS="$gl_saved_libs"
13444  if test -z "$HOSTENT_LIB"; then
13445    for ac_func in gethostbyname
13446do :
13447  ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
13448if test "x$ac_cv_func_gethostbyname" = xyes; then :
13449  cat >>confdefs.h <<_ACEOF
13450#define HAVE_GETHOSTBYNAME 1
13451_ACEOF
13452
13453else
13454
13455      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in winsock2.h and -lws2_32" >&5
13456$as_echo_n "checking for gethostbyname in winsock2.h and -lws2_32... " >&6; }
13457if ${gl_cv_w32_gethostbyname+:} false; then :
13458  $as_echo_n "(cached) " >&6
13459else
13460  gl_cv_w32_gethostbyname=no
13461         gl_save_LIBS="$LIBS"
13462         LIBS="$LIBS -lws2_32"
13463         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13464/* end confdefs.h.  */
13465
13466#ifdef HAVE_WINSOCK2_H
13467#include <winsock2.h>
13468#endif
13469#include <stddef.h>
13470
13471int
13472main ()
13473{
13474gethostbyname(NULL);
13475  ;
13476  return 0;
13477}
13478_ACEOF
13479if ac_fn_c_try_link "$LINENO"; then :
13480  gl_cv_w32_gethostbyname=yes
13481fi
13482rm -f core conftest.err conftest.$ac_objext \
13483    conftest$ac_exeext conftest.$ac_ext
13484         LIBS="$gl_save_LIBS"
13485
13486fi
13487{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_gethostbyname" >&5
13488$as_echo "$gl_cv_w32_gethostbyname" >&6; }
13489      if test "$gl_cv_w32_gethostbyname" = "yes"; then
13490        HOSTENT_LIB="-lws2_32"
13491      fi
13492
13493fi
13494done
13495
13496  fi
13497
13498
13499
13500                      SERVENT_LIB=
13501  gl_saved_libs="$LIBS"
13502  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getservbyname" >&5
13503$as_echo_n "checking for library containing getservbyname... " >&6; }
13504if ${ac_cv_search_getservbyname+:} false; then :
13505  $as_echo_n "(cached) " >&6
13506else
13507  ac_func_search_save_LIBS=$LIBS
13508cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13509/* end confdefs.h.  */
13510
13511/* Override any GCC internal prototype to avoid an error.
13512   Use char because int might match the return type of a GCC
13513   builtin and then its argument prototype would still apply.  */
13514#ifdef __cplusplus
13515extern "C"
13516#endif
13517char getservbyname ();
13518int
13519main ()
13520{
13521return getservbyname ();
13522  ;
13523  return 0;
13524}
13525_ACEOF
13526for ac_lib in '' socket network net; do
13527  if test -z "$ac_lib"; then
13528    ac_res="none required"
13529  else
13530    ac_res=-l$ac_lib
13531    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
13532  fi
13533  if ac_fn_c_try_link "$LINENO"; then :
13534  ac_cv_search_getservbyname=$ac_res
13535fi
13536rm -f core conftest.err conftest.$ac_objext \
13537    conftest$ac_exeext
13538  if ${ac_cv_search_getservbyname+:} false; then :
13539  break
13540fi
13541done
13542if ${ac_cv_search_getservbyname+:} false; then :
13543
13544else
13545  ac_cv_search_getservbyname=no
13546fi
13547rm conftest.$ac_ext
13548LIBS=$ac_func_search_save_LIBS
13549fi
13550{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getservbyname" >&5
13551$as_echo "$ac_cv_search_getservbyname" >&6; }
13552ac_res=$ac_cv_search_getservbyname
13553if test "$ac_res" != no; then :
13554  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
13555  if test "$ac_cv_search_getservbyname" != "none required"; then
13556       SERVENT_LIB="$ac_cv_search_getservbyname"
13557     fi
13558fi
13559
13560  LIBS="$gl_saved_libs"
13561  if test -z "$SERVENT_LIB"; then
13562    for ac_func in getservbyname
13563do :
13564  ac_fn_c_check_func "$LINENO" "getservbyname" "ac_cv_func_getservbyname"
13565if test "x$ac_cv_func_getservbyname" = xyes; then :
13566  cat >>confdefs.h <<_ACEOF
13567#define HAVE_GETSERVBYNAME 1
13568_ACEOF
13569
13570else
13571
13572      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getservbyname in winsock2.h and -lws2_32" >&5
13573$as_echo_n "checking for getservbyname in winsock2.h and -lws2_32... " >&6; }
13574if ${gl_cv_w32_getservbyname+:} false; then :
13575  $as_echo_n "(cached) " >&6
13576else
13577  gl_cv_w32_getservbyname=no
13578         gl_save_LIBS="$LIBS"
13579         LIBS="$LIBS -lws2_32"
13580         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13581/* end confdefs.h.  */
13582
13583#ifdef HAVE_WINSOCK2_H
13584#include <winsock2.h>
13585#endif
13586#include <stddef.h>
13587
13588int
13589main ()
13590{
13591getservbyname(NULL,NULL);
13592  ;
13593  return 0;
13594}
13595_ACEOF
13596if ac_fn_c_try_link "$LINENO"; then :
13597  gl_cv_w32_getservbyname=yes
13598fi
13599rm -f core conftest.err conftest.$ac_objext \
13600    conftest$ac_exeext conftest.$ac_ext
13601         LIBS="$gl_save_LIBS"
13602
13603fi
13604{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_getservbyname" >&5
13605$as_echo "$gl_cv_w32_getservbyname" >&6; }
13606      if test "$gl_cv_w32_getservbyname" = "yes"; then
13607        SERVENT_LIB="-lws2_32"
13608      fi
13609
13610fi
13611done
13612
13613  fi
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623                HAVE_INET_NTOP=1
13624  INET_NTOP_LIB=
13625
13626
13627
13628
13629  if test $ac_cv_header_sys_socket_h != yes; then
13630                    for ac_header in winsock2.h
13631do :
13632  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
13633if test "x$ac_cv_header_winsock2_h" = xyes; then :
13634  cat >>confdefs.h <<_ACEOF
13635#define HAVE_WINSOCK2_H 1
13636_ACEOF
13637
13638fi
13639
13640done
13641
13642  fi
13643  if test "$ac_cv_header_winsock2_h" = yes; then
13644    HAVE_WINSOCK2_H=1
13645    UNISTD_H_HAVE_WINSOCK2_H=1
13646    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
13647  else
13648    HAVE_WINSOCK2_H=0
13649  fi
13650
13651
13652  if test $HAVE_WINSOCK2_H = 1; then
13653    ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
13654"
13655if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
13656  ac_have_decl=1
13657else
13658  ac_have_decl=0
13659fi
13660
13661cat >>confdefs.h <<_ACEOF
13662#define HAVE_DECL_INET_NTOP $ac_have_decl
13663_ACEOF
13664
13665    if test $ac_cv_have_decl_inet_ntop = yes; then
13666                  REPLACE_INET_NTOP=1
13667      INET_NTOP_LIB="-lws2_32"
13668    else
13669      HAVE_DECL_INET_NTOP=0
13670      HAVE_INET_NTOP=0
13671    fi
13672  else
13673    gl_save_LIBS=$LIBS
13674    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
13675$as_echo_n "checking for library containing inet_ntop... " >&6; }
13676if ${ac_cv_search_inet_ntop+:} false; then :
13677  $as_echo_n "(cached) " >&6
13678else
13679  ac_func_search_save_LIBS=$LIBS
13680cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13681/* end confdefs.h.  */
13682
13683/* Override any GCC internal prototype to avoid an error.
13684   Use char because int might match the return type of a GCC
13685   builtin and then its argument prototype would still apply.  */
13686#ifdef __cplusplus
13687extern "C"
13688#endif
13689char inet_ntop ();
13690int
13691main ()
13692{
13693return inet_ntop ();
13694  ;
13695  return 0;
13696}
13697_ACEOF
13698for ac_lib in '' nsl resolv network; do
13699  if test -z "$ac_lib"; then
13700    ac_res="none required"
13701  else
13702    ac_res=-l$ac_lib
13703    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
13704  fi
13705  if ac_fn_c_try_link "$LINENO"; then :
13706  ac_cv_search_inet_ntop=$ac_res
13707fi
13708rm -f core conftest.err conftest.$ac_objext \
13709    conftest$ac_exeext
13710  if ${ac_cv_search_inet_ntop+:} false; then :
13711  break
13712fi
13713done
13714if ${ac_cv_search_inet_ntop+:} false; then :
13715
13716else
13717  ac_cv_search_inet_ntop=no
13718fi
13719rm conftest.$ac_ext
13720LIBS=$ac_func_search_save_LIBS
13721fi
13722{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
13723$as_echo "$ac_cv_search_inet_ntop" >&6; }
13724ac_res=$ac_cv_search_inet_ntop
13725if test "$ac_res" != no; then :
13726  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
13727
13728else
13729  for ac_func in inet_ntop
13730do :
13731  ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
13732if test "x$ac_cv_func_inet_ntop" = xyes; then :
13733  cat >>confdefs.h <<_ACEOF
13734#define HAVE_INET_NTOP 1
13735_ACEOF
13736
13737fi
13738done
13739
13740       if test $ac_cv_func_inet_ntop = no; then
13741         HAVE_INET_NTOP=0
13742       fi
13743
13744fi
13745
13746    LIBS=$gl_save_LIBS
13747
13748    if test "$ac_cv_search_inet_ntop" != "no" \
13749       && test "$ac_cv_search_inet_ntop" != "none required"; then
13750      INET_NTOP_LIB="$ac_cv_search_inet_ntop"
13751    fi
13752
13753
13754    ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
13755        #if HAVE_NETDB_H
13756        # include <netdb.h>
13757        #endif
13758
13759"
13760if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
13761  ac_have_decl=1
13762else
13763  ac_have_decl=0
13764fi
13765
13766cat >>confdefs.h <<_ACEOF
13767#define HAVE_DECL_INET_NTOP $ac_have_decl
13768_ACEOF
13769
13770    if test $ac_cv_have_decl_inet_ntop = no; then
13771      HAVE_DECL_INET_NTOP=0
13772    fi
13773  fi
13774
13775
13776
13777
13778
13779
13780
13781
13782  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
13783$as_echo_n "checking for IPv4 sockets... " >&6; }
13784  if ${gl_cv_socket_ipv4+:} false; then :
13785  $as_echo_n "(cached) " >&6
13786else
13787  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13788/* end confdefs.h.  */
13789#include <sys/types.h>
13790#ifdef HAVE_SYS_SOCKET_H
13791#include <sys/socket.h>
13792#endif
13793#ifdef HAVE_NETINET_IN_H
13794#include <netinet/in.h>
13795#endif
13796#ifdef HAVE_WINSOCK2_H
13797#include <winsock2.h>
13798#endif
13799int
13800main ()
13801{
13802int x = AF_INET; struct in_addr y; struct sockaddr_in z;
13803 if (&x && &y && &z) return 0;
13804  ;
13805  return 0;
13806}
13807_ACEOF
13808if ac_fn_c_try_compile "$LINENO"; then :
13809  gl_cv_socket_ipv4=yes
13810else
13811  gl_cv_socket_ipv4=no
13812fi
13813rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13814fi
13815
13816  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
13817$as_echo "$gl_cv_socket_ipv4" >&6; }
13818  if test $gl_cv_socket_ipv4 = yes; then
13819
13820$as_echo "#define HAVE_IPV4 1" >>confdefs.h
13821
13822  fi
13823
13824  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
13825$as_echo_n "checking for IPv6 sockets... " >&6; }
13826  if ${gl_cv_socket_ipv6+:} false; then :
13827  $as_echo_n "(cached) " >&6
13828else
13829  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13830/* end confdefs.h.  */
13831#include <sys/types.h>
13832#ifdef HAVE_SYS_SOCKET_H
13833#include <sys/socket.h>
13834#endif
13835#ifdef HAVE_NETINET_IN_H
13836#include <netinet/in.h>
13837#endif
13838#ifdef HAVE_WINSOCK2_H
13839#include <winsock2.h>
13840#endif
13841#ifdef HAVE_WS2TCPIP_H
13842#include <ws2tcpip.h>
13843#endif
13844int
13845main ()
13846{
13847int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
13848 if (&x && &y && &z) return 0;
13849  ;
13850  return 0;
13851}
13852_ACEOF
13853if ac_fn_c_try_compile "$LINENO"; then :
13854  gl_cv_socket_ipv6=yes
13855else
13856  gl_cv_socket_ipv6=no
13857fi
13858rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13859fi
13860
13861  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
13862$as_echo "$gl_cv_socket_ipv6" >&6; }
13863  if test $gl_cv_socket_ipv6 = yes; then
13864
13865$as_echo "#define HAVE_IPV6 1" >>confdefs.h
13866
13867  fi
13868
13869
13870
13871   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
13872$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
13873if ${gl_cv_func_getcwd_null+:} false; then :
13874  $as_echo_n "(cached) " >&6
13875else
13876  if test "$cross_compiling" = yes; then :
13877  case "$host_os" in
13878                           # Guess yes on glibc systems.
13879            *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
13880                           # Guess yes on Cygwin.
13881            cygwin*)       gl_cv_func_getcwd_null="guessing yes";;
13882                           # If we don't know, assume the worst.
13883            *)             gl_cv_func_getcwd_null="guessing no";;
13884          esac
13885
13886else
13887  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13888/* end confdefs.h.  */
13889
13890#	 include <stdlib.h>
13891#        if HAVE_UNISTD_H
13892#         include <unistd.h>
13893#        else /* on Windows with MSVC */
13894#         include <direct.h>
13895#        endif
13896#        ifndef getcwd
13897         char *getcwd ();
13898#        endif
13899
13900int
13901main ()
13902{
13903
13904#if defined _WIN32 && ! defined __CYGWIN__
13905/* mingw cwd does not start with '/', but getcwd does allocate.
13906   However, mingw fails to honor non-zero size.  */
13907#else
13908           if (chdir ("/") != 0)
13909             return 1;
13910           else
13911             {
13912               char *f = getcwd (NULL, 0);
13913               if (! f)
13914                 return 2;
13915               if (f[0] != '/')
13916                 { free (f); return 3; }
13917               if (f[1] != '\0')
13918                 { free (f); return 4; }
13919               free (f);
13920               return 0;
13921             }
13922#endif
13923
13924  ;
13925  return 0;
13926}
13927_ACEOF
13928if ac_fn_c_try_run "$LINENO"; then :
13929  gl_cv_func_getcwd_null=yes
13930else
13931  gl_cv_func_getcwd_null=no
13932fi
13933rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13934  conftest.$ac_objext conftest.beam conftest.$ac_ext
13935fi
13936
13937fi
13938{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
13939$as_echo "$gl_cv_func_getcwd_null" >&6; }
13940
13941
13942  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
13943$as_echo_n "checking for getcwd with POSIX signature... " >&6; }
13944if ${gl_cv_func_getcwd_posix_signature+:} false; then :
13945  $as_echo_n "(cached) " >&6
13946else
13947  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13948/* end confdefs.h.  */
13949#include <unistd.h>
13950int
13951main ()
13952{
13953extern
13954           #ifdef __cplusplus
13955           "C"
13956           #endif
13957           char *getcwd (char *, size_t);
13958
13959  ;
13960  return 0;
13961}
13962
13963_ACEOF
13964if ac_fn_c_try_compile "$LINENO"; then :
13965  gl_cv_func_getcwd_posix_signature=yes
13966else
13967  gl_cv_func_getcwd_posix_signature=no
13968fi
13969rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13970
13971fi
13972{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
13973$as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
13974
13975ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default"
13976if test "x$ac_cv_have_decl_getcwd" = xyes; then :
13977  ac_have_decl=1
13978else
13979  ac_have_decl=0
13980fi
13981
13982cat >>confdefs.h <<_ACEOF
13983#define HAVE_DECL_GETCWD $ac_have_decl
13984_ACEOF
13985
13986ac_fn_c_check_decl "$LINENO" "getdelim" "ac_cv_have_decl_getdelim" "$ac_includes_default"
13987if test "x$ac_cv_have_decl_getdelim" = xyes; then :
13988  ac_have_decl=1
13989else
13990  ac_have_decl=0
13991fi
13992
13993cat >>confdefs.h <<_ACEOF
13994#define HAVE_DECL_GETDELIM $ac_have_decl
13995_ACEOF
13996
13997
13998
13999
14000
14001ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
14002if test "x$ac_cv_have_decl_getdtablesize" = xyes; then :
14003  ac_have_decl=1
14004else
14005  ac_have_decl=0
14006fi
14007
14008cat >>confdefs.h <<_ACEOF
14009#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
14010_ACEOF
14011
14012
14013
14014  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arithmetic hrtime_t" >&5
14015$as_echo_n "checking for arithmetic hrtime_t... " >&6; }
14016if ${gl_cv_arithmetic_hrtime_t+:} false; then :
14017  $as_echo_n "(cached) " >&6
14018else
14019  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14020/* end confdefs.h.  */
14021#include <time.h>
14022int
14023main ()
14024{
14025hrtime_t x = 0; return x/x;
14026  ;
14027  return 0;
14028}
14029_ACEOF
14030if ac_fn_c_try_compile "$LINENO"; then :
14031  gl_cv_arithmetic_hrtime_t=yes
14032else
14033  gl_cv_arithmetic_hrtime_t=no
14034fi
14035rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14036fi
14037{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_arithmetic_hrtime_t" >&5
14038$as_echo "$gl_cv_arithmetic_hrtime_t" >&6; }
14039  if test $gl_cv_arithmetic_hrtime_t = yes; then
14040
14041$as_echo "#define HAVE_ARITHMETIC_HRTIME_T 1" >>confdefs.h
14042
14043  fi
14044
14045
14046  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
14047$as_echo_n "checking for unsigned long long int... " >&6; }
14048if ${ac_cv_type_unsigned_long_long_int+:} false; then :
14049  $as_echo_n "(cached) " >&6
14050else
14051  ac_cv_type_unsigned_long_long_int=yes
14052     if test "x${ac_cv_prog_cc_c99-no}" = xno; then
14053       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14054/* end confdefs.h.  */
14055
14056  /* For now, do not test the preprocessor; as of 2007 there are too many
14057         implementations with broken preprocessors.  Perhaps this can
14058         be revisited in 2012.  In the meantime, code should not expect
14059         #if to work with literals wider than 32 bits.  */
14060      /* Test literals.  */
14061      long long int ll = 9223372036854775807ll;
14062      long long int nll = -9223372036854775807LL;
14063      unsigned long long int ull = 18446744073709551615ULL;
14064      /* Test constant expressions.   */
14065      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
14066                     ? 1 : -1)];
14067      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
14068                     ? 1 : -1)];
14069      int i = 63;
14070int
14071main ()
14072{
14073/* Test availability of runtime routines for shift and division.  */
14074      long long int llmax = 9223372036854775807ll;
14075      unsigned long long int ullmax = 18446744073709551615ull;
14076      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
14077              | (llmax / ll) | (llmax % ll)
14078              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
14079              | (ullmax / ull) | (ullmax % ull));
14080  ;
14081  return 0;
14082}
14083
14084_ACEOF
14085if ac_fn_c_try_link "$LINENO"; then :
14086
14087else
14088  ac_cv_type_unsigned_long_long_int=no
14089fi
14090rm -f core conftest.err conftest.$ac_objext \
14091    conftest$ac_exeext conftest.$ac_ext
14092     fi
14093fi
14094{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
14095$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
14096  if test $ac_cv_type_unsigned_long_long_int = yes; then
14097
14098$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
14099
14100  fi
14101
14102
14103
14104  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
14105$as_echo_n "checking for long long int... " >&6; }
14106if ${ac_cv_type_long_long_int+:} false; then :
14107  $as_echo_n "(cached) " >&6
14108else
14109  ac_cv_type_long_long_int=yes
14110      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
14111        ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
14112        if test $ac_cv_type_long_long_int = yes; then
14113                                        if test "$cross_compiling" = yes; then :
14114  :
14115else
14116  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14117/* end confdefs.h.  */
14118#include <limits.h>
14119                 #ifndef LLONG_MAX
14120                 # define HALF \
14121                          (1LL << (sizeof (long long int) * CHAR_BIT - 2))
14122                 # define LLONG_MAX (HALF - 1 + HALF)
14123                 #endif
14124int
14125main ()
14126{
14127long long int n = 1;
14128                 int i;
14129                 for (i = 0; ; i++)
14130                   {
14131                     long long int m = n << i;
14132                     if (m >> i != n)
14133                       return 1;
14134                     if (LLONG_MAX / 2 < m)
14135                       break;
14136                   }
14137                 return 0;
14138  ;
14139  return 0;
14140}
14141_ACEOF
14142if ac_fn_c_try_run "$LINENO"; then :
14143
14144else
14145  ac_cv_type_long_long_int=no
14146fi
14147rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14148  conftest.$ac_objext conftest.beam conftest.$ac_ext
14149fi
14150
14151        fi
14152      fi
14153fi
14154{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
14155$as_echo "$ac_cv_type_long_long_int" >&6; }
14156  if test $ac_cv_type_long_long_int = yes; then
14157
14158$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
14159
14160  fi
14161
14162
14163
14164  :
14165
14166
14167
14168
14169
14170ac_fn_c_check_decl "$LINENO" "getline" "ac_cv_have_decl_getline" "$ac_includes_default"
14171if test "x$ac_cv_have_decl_getline" = xyes; then :
14172  ac_have_decl=1
14173else
14174  ac_have_decl=0
14175fi
14176
14177cat >>confdefs.h <<_ACEOF
14178#define HAVE_DECL_GETLINE $ac_have_decl
14179_ACEOF
14180
14181ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default"
14182if test "x$ac_cv_have_decl_getlogin" = xyes; then :
14183  ac_have_decl=1
14184else
14185  ac_have_decl=0
14186fi
14187
14188cat >>confdefs.h <<_ACEOF
14189#define HAVE_DECL_GETLOGIN $ac_have_decl
14190_ACEOF
14191
14192
14193
14194
14195
14196  case $host_os in
14197    mingw*)
14198      LIB_GETLOGIN='-ladvapi32' ;;
14199    *)
14200      LIB_GETLOGIN= ;;
14201  esac
14202
14203
14204
14205  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
14206$as_echo_n "checking for ssize_t... " >&6; }
14207if ${gt_cv_ssize_t+:} false; then :
14208  $as_echo_n "(cached) " >&6
14209else
14210  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14211/* end confdefs.h.  */
14212#include <sys/types.h>
14213int
14214main ()
14215{
14216int x = sizeof (ssize_t *) + sizeof (ssize_t);
14217            return !x;
14218  ;
14219  return 0;
14220}
14221_ACEOF
14222if ac_fn_c_try_compile "$LINENO"; then :
14223  gt_cv_ssize_t=yes
14224else
14225  gt_cv_ssize_t=no
14226fi
14227rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14228fi
14229{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
14230$as_echo "$gt_cv_ssize_t" >&6; }
14231  if test $gt_cv_ssize_t = no; then
14232
14233$as_echo "#define ssize_t int" >>confdefs.h
14234
14235  fi
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256     if test $gl_cv_have_include_next = yes; then
14257       gl_cv_next_getopt_h='<'getopt.h'>'
14258     else
14259       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5
14260$as_echo_n "checking absolute name of <getopt.h>... " >&6; }
14261if ${gl_cv_next_getopt_h+:} false; then :
14262  $as_echo_n "(cached) " >&6
14263else
14264
14265             if test $ac_cv_header_getopt_h = yes; then
14266
14267
14268
14269
14270  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14271/* end confdefs.h.  */
14272#include <getopt.h>
14273_ACEOF
14274                case "$host_os" in
14275    aix*) gl_absname_cpp="$ac_cpp -C" ;;
14276    *)    gl_absname_cpp="$ac_cpp" ;;
14277  esac
14278
14279  case "$host_os" in
14280    mingw*)
14281                                          gl_dirsep_regex='[/\\]'
14282      ;;
14283    *)
14284      gl_dirsep_regex='\/'
14285      ;;
14286  esac
14287      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
14288  gl_header_literal_regex=`echo 'getopt.h' \
14289                           | sed -e "$gl_make_literal_regex_sed"`
14290  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
14291      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
14292      s|^/[^/]|//&|
14293      p
14294      q
14295    }'
14296
14297        gl_cv_absolute_getopt_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
14298  sed -n "$gl_absolute_header_sed"`
14299
14300           gl_header=$gl_cv_absolute_getopt_h
14301           gl_cv_next_getopt_h='"'$gl_header'"'
14302          else
14303               gl_cv_next_getopt_h='<'getopt.h'>'
14304             fi
14305
14306
14307fi
14308{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5
14309$as_echo "$gl_cv_next_getopt_h" >&6; }
14310     fi
14311     NEXT_GETOPT_H=$gl_cv_next_getopt_h
14312
14313     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
14314       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
14315       gl_next_as_first_directive='<'getopt.h'>'
14316     else
14317       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
14318       gl_next_as_first_directive=$gl_cv_next_getopt_h
14319     fi
14320     NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive
14321
14322
14323
14324
14325  if test $ac_cv_header_getopt_h = yes; then
14326    HAVE_GETOPT_H=1
14327  else
14328    HAVE_GETOPT_H=0
14329  fi
14330
14331
14332  gl_replace_getopt=
14333
14334    if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
14335    for ac_header in getopt.h
14336do :
14337  ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
14338if test "x$ac_cv_header_getopt_h" = xyes; then :
14339  cat >>confdefs.h <<_ACEOF
14340#define HAVE_GETOPT_H 1
14341_ACEOF
14342
14343else
14344  gl_replace_getopt=yes
14345fi
14346
14347done
14348
14349  fi
14350
14351    if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
14352    for ac_func in getopt_long_only
14353do :
14354  ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
14355if test "x$ac_cv_func_getopt_long_only" = xyes; then :
14356  cat >>confdefs.h <<_ACEOF
14357#define HAVE_GETOPT_LONG_ONLY 1
14358_ACEOF
14359
14360else
14361  gl_replace_getopt=yes
14362fi
14363done
14364
14365  fi
14366
14367          if test -z "$gl_replace_getopt"; then
14368    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5
14369$as_echo_n "checking whether getopt is POSIX compatible... " >&6; }
14370if ${gl_cv_func_getopt_posix+:} false; then :
14371  $as_echo_n "(cached) " >&6
14372else
14373
14374                                                if test $cross_compiling = no; then
14375                              if test "$cross_compiling" = yes; then :
14376  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14377$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14378as_fn_error $? "cannot run test program while cross compiling
14379See \`config.log' for more details" "$LINENO" 5; }
14380else
14381  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14382/* end confdefs.h.  */
14383
14384#include <unistd.h>
14385#include <stdlib.h>
14386#include <string.h>
14387
14388int
14389main ()
14390{
14391  static char program[] = "program";
14392  static char a[] = "-a";
14393  static char foo[] = "foo";
14394  static char bar[] = "bar";
14395  char *argv[] = { program, a, foo, bar, NULL };
14396  int c;
14397
14398  c = getopt (4, argv, "ab");
14399  if (!(c == 'a'))
14400    return 1;
14401  c = getopt (4, argv, "ab");
14402  if (!(c == -1))
14403    return 2;
14404  if (!(optind == 2))
14405    return 3;
14406  return 0;
14407}
14408
14409_ACEOF
14410if ac_fn_c_try_run "$LINENO"; then :
14411  gl_cv_func_getopt_posix=maybe
14412else
14413  gl_cv_func_getopt_posix=no
14414fi
14415rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14416  conftest.$ac_objext conftest.beam conftest.$ac_ext
14417fi
14418
14419          if test $gl_cv_func_getopt_posix = maybe; then
14420                                    if test "$cross_compiling" = yes; then :
14421  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14422$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14423as_fn_error $? "cannot run test program while cross compiling
14424See \`config.log' for more details" "$LINENO" 5; }
14425else
14426  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14427/* end confdefs.h.  */
14428
14429#include <unistd.h>
14430#include <stdlib.h>
14431#include <string.h>
14432
14433int
14434main ()
14435{
14436  static char program[] = "program";
14437  static char donald[] = "donald";
14438  static char p[] = "-p";
14439  static char billy[] = "billy";
14440  static char duck[] = "duck";
14441  static char a[] = "-a";
14442  static char bar[] = "bar";
14443  char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
14444  int c;
14445
14446  c = getopt (7, argv, "+abp:q:");
14447  if (!(c == -1))
14448    return 4;
14449  if (!(strcmp (argv[0], "program") == 0))
14450    return 5;
14451  if (!(strcmp (argv[1], "donald") == 0))
14452    return 6;
14453  if (!(strcmp (argv[2], "-p") == 0))
14454    return 7;
14455  if (!(strcmp (argv[3], "billy") == 0))
14456    return 8;
14457  if (!(strcmp (argv[4], "duck") == 0))
14458    return 9;
14459  if (!(strcmp (argv[5], "-a") == 0))
14460    return 10;
14461  if (!(strcmp (argv[6], "bar") == 0))
14462    return 11;
14463  if (!(optind == 1))
14464    return 12;
14465  return 0;
14466}
14467
14468_ACEOF
14469if ac_fn_c_try_run "$LINENO"; then :
14470  gl_cv_func_getopt_posix=maybe
14471else
14472  gl_cv_func_getopt_posix=no
14473fi
14474rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14475  conftest.$ac_objext conftest.beam conftest.$ac_ext
14476fi
14477
14478          fi
14479          if test $gl_cv_func_getopt_posix = maybe; then
14480                        if test "$cross_compiling" = yes; then :
14481  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14482$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14483as_fn_error $? "cannot run test program while cross compiling
14484See \`config.log' for more details" "$LINENO" 5; }
14485else
14486  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14487/* end confdefs.h.  */
14488
14489#include <unistd.h>
14490#include <stdlib.h>
14491#include <string.h>
14492
14493int
14494main ()
14495{
14496  static char program[] = "program";
14497  static char ab[] = "-ab";
14498  char *argv[3] = { program, ab, NULL };
14499  if (getopt (2, argv, "ab:") != 'a')
14500    return 13;
14501  if (getopt (2, argv, "ab:") != '?')
14502    return 14;
14503  if (optopt != 'b')
14504    return 15;
14505  if (optind != 2)
14506    return 16;
14507  return 0;
14508}
14509
14510_ACEOF
14511if ac_fn_c_try_run "$LINENO"; then :
14512  gl_cv_func_getopt_posix=yes
14513else
14514  gl_cv_func_getopt_posix=no
14515fi
14516rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14517  conftest.$ac_objext conftest.beam conftest.$ac_ext
14518fi
14519
14520          fi
14521        else
14522          case "$host_os" in
14523            darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
14524            *)                       gl_cv_func_getopt_posix="guessing yes";;
14525          esac
14526        fi
14527
14528fi
14529{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5
14530$as_echo "$gl_cv_func_getopt_posix" >&6; }
14531    case "$gl_cv_func_getopt_posix" in
14532      *no) gl_replace_getopt=yes ;;
14533    esac
14534  fi
14535
14536  if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
14537    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5
14538$as_echo_n "checking for working GNU getopt function... " >&6; }
14539if ${gl_cv_func_getopt_gnu+:} false; then :
14540  $as_echo_n "(cached) " >&6
14541else
14542  # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
14543       # optstring is necessary for programs like m4 that have POSIX-mandated
14544       # semantics for supporting options interspersed with files.
14545       # Also, since getopt_long is a GNU extension, we require optind=0.
14546       # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
14547       # so take care to revert to the correct (non-)export state.
14548       gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
14549       case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
14550         xx) gl_had_POSIXLY_CORRECT=exported ;;
14551         x)  gl_had_POSIXLY_CORRECT=yes      ;;
14552         *)  gl_had_POSIXLY_CORRECT=         ;;
14553       esac
14554       POSIXLY_CORRECT=1
14555       export POSIXLY_CORRECT
14556       if test "$cross_compiling" = yes; then :
14557           gl_cv_func_getopt_gnu="guessing no"
14558
14559else
14560  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14561/* end confdefs.h.  */
14562#include <getopt.h>
14563                           #include <stddef.h>
14564                           #include <string.h>
14565
14566#include <stdlib.h>
14567#if defined __MACH__ && defined __APPLE__
14568/* Avoid a crash on Mac OS X.  */
14569#include <mach/mach.h>
14570#include <mach/mach_error.h>
14571#include <mach/thread_status.h>
14572#include <mach/exception.h>
14573#include <mach/task.h>
14574#include <pthread.h>
14575/* The exception port on which our thread listens.  */
14576static mach_port_t our_exception_port;
14577/* The main function of the thread listening for exceptions of type
14578   EXC_BAD_ACCESS.  */
14579static void *
14580mach_exception_thread (void *arg)
14581{
14582  /* Buffer for a message to be received.  */
14583  struct {
14584    mach_msg_header_t head;
14585    mach_msg_body_t msgh_body;
14586    char data[1024];
14587  } msg;
14588  mach_msg_return_t retval;
14589  /* Wait for a message on the exception port.  */
14590  retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
14591                     our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
14592  if (retval != MACH_MSG_SUCCESS)
14593    abort ();
14594  exit (1);
14595}
14596static void
14597nocrash_init (void)
14598{
14599  mach_port_t self = mach_task_self ();
14600  /* Allocate a port on which the thread shall listen for exceptions.  */
14601  if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
14602      == KERN_SUCCESS) {
14603    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
14604    if (mach_port_insert_right (self, our_exception_port, our_exception_port,
14605                                MACH_MSG_TYPE_MAKE_SEND)
14606        == KERN_SUCCESS) {
14607      /* The exceptions we want to catch.  Only EXC_BAD_ACCESS is interesting
14608         for us.  */
14609      exception_mask_t mask = EXC_MASK_BAD_ACCESS;
14610      /* Create the thread listening on the exception port.  */
14611      pthread_attr_t attr;
14612      pthread_t thread;
14613      if (pthread_attr_init (&attr) == 0
14614          && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
14615          && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
14616        pthread_attr_destroy (&attr);
14617        /* Replace the exception port info for these exceptions with our own.
14618           Note that we replace the exception port for the entire task, not only
14619           for a particular thread.  This has the effect that when our exception
14620           port gets the message, the thread specific exception port has already
14621           been asked, and we don't need to bother about it.
14622           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
14623        task_set_exception_ports (self, mask, our_exception_port,
14624                                  EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
14625      }
14626    }
14627  }
14628}
14629#elif defined _WIN32 && ! defined __CYGWIN__
14630/* Avoid a crash on native Windows.  */
14631#define WIN32_LEAN_AND_MEAN
14632#include <windows.h>
14633#include <winerror.h>
14634static LONG WINAPI
14635exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
14636{
14637  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
14638    {
14639    case EXCEPTION_ACCESS_VIOLATION:
14640    case EXCEPTION_IN_PAGE_ERROR:
14641    case EXCEPTION_STACK_OVERFLOW:
14642    case EXCEPTION_GUARD_PAGE:
14643    case EXCEPTION_PRIV_INSTRUCTION:
14644    case EXCEPTION_ILLEGAL_INSTRUCTION:
14645    case EXCEPTION_DATATYPE_MISALIGNMENT:
14646    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
14647    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
14648      exit (1);
14649    }
14650  return EXCEPTION_CONTINUE_SEARCH;
14651}
14652static void
14653nocrash_init (void)
14654{
14655  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
14656}
14657#else
14658/* Avoid a crash on POSIX systems.  */
14659#include <signal.h>
14660#include <unistd.h>
14661/* A POSIX signal handler.  */
14662static void
14663exception_handler (int sig)
14664{
14665  _exit (1);
14666}
14667static void
14668nocrash_init (void)
14669{
14670#ifdef SIGSEGV
14671  signal (SIGSEGV, exception_handler);
14672#endif
14673#ifdef SIGBUS
14674  signal (SIGBUS, exception_handler);
14675#endif
14676}
14677#endif
14678
14679
14680int
14681main ()
14682{
14683
14684             int result = 0;
14685
14686             nocrash_init();
14687
14688             /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
14689                and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
14690                OSF/1 5.1, Solaris 10.  */
14691             {
14692               static char conftest[] = "conftest";
14693               static char plus[] = "-+";
14694               char *argv[3] = { conftest, plus, NULL };
14695               opterr = 0;
14696               if (getopt (2, argv, "+a") != '?')
14697                 result |= 1;
14698             }
14699             /* This code succeeds on glibc 2.8, mingw,
14700                and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
14701                IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
14702             {
14703               static char program[] = "program";
14704               static char p[] = "-p";
14705               static char foo[] = "foo";
14706               static char bar[] = "bar";
14707               char *argv[] = { program, p, foo, bar, NULL };
14708
14709               optind = 1;
14710               if (getopt (4, argv, "p::") != 'p')
14711                 result |= 2;
14712               else if (optarg != NULL)
14713                 result |= 4;
14714               else if (getopt (4, argv, "p::") != -1)
14715                 result |= 6;
14716               else if (optind != 2)
14717                 result |= 8;
14718             }
14719             /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
14720             {
14721               static char program[] = "program";
14722               static char foo[] = "foo";
14723               static char p[] = "-p";
14724               char *argv[] = { program, foo, p, NULL };
14725               optind = 0;
14726               if (getopt (3, argv, "-p") != 1)
14727                 result |= 16;
14728               else if (getopt (3, argv, "-p") != 'p')
14729                 result |= 16;
14730             }
14731             /* This code fails on glibc 2.11.  */
14732             {
14733               static char program[] = "program";
14734               static char b[] = "-b";
14735               static char a[] = "-a";
14736               char *argv[] = { program, b, a, NULL };
14737               optind = opterr = 0;
14738               if (getopt (3, argv, "+:a:b") != 'b')
14739                 result |= 32;
14740               else if (getopt (3, argv, "+:a:b") != ':')
14741                 result |= 32;
14742             }
14743             /* This code dumps core on glibc 2.14.  */
14744             {
14745               static char program[] = "program";
14746               static char w[] = "-W";
14747               static char dummy[] = "dummy";
14748               char *argv[] = { program, w, dummy, NULL };
14749               optind = opterr = 1;
14750               if (getopt (3, argv, "W;") != 'W')
14751                 result |= 64;
14752             }
14753             return result;
14754
14755  ;
14756  return 0;
14757}
14758_ACEOF
14759if ac_fn_c_try_run "$LINENO"; then :
14760  gl_cv_func_getopt_gnu=yes
14761else
14762  gl_cv_func_getopt_gnu=no
14763fi
14764rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14765  conftest.$ac_objext conftest.beam conftest.$ac_ext
14766fi
14767
14768       case $gl_had_POSIXLY_CORRECT in
14769         exported) ;;
14770         yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;;
14771         *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;;
14772       esac
14773
14774fi
14775{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5
14776$as_echo "$gl_cv_func_getopt_gnu" >&6; }
14777    if test "$gl_cv_func_getopt_gnu" != yes; then
14778      gl_replace_getopt=yes
14779    else
14780      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5
14781$as_echo_n "checking for working GNU getopt_long function... " >&6; }
14782if ${gl_cv_func_getopt_long_gnu+:} false; then :
14783  $as_echo_n "(cached) " >&6
14784else
14785  if test "$cross_compiling" = yes; then :
14786              case "$host_os" in
14787              openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
14788              *)        gl_cv_func_getopt_long_gnu="guessing yes";;
14789            esac
14790
14791else
14792  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14793/* end confdefs.h.  */
14794#include <getopt.h>
14795                #include <stddef.h>
14796                #include <string.h>
14797
14798int
14799main ()
14800{
14801static const struct option long_options[] =
14802                  {
14803                    { "xtremely-",no_argument,       NULL, 1003 },
14804                    { "xtra",     no_argument,       NULL, 1001 },
14805                    { "xtreme",   no_argument,       NULL, 1002 },
14806                    { "xtremely", no_argument,       NULL, 1003 },
14807                    { NULL,       0,                 NULL, 0 }
14808                  };
14809                /* This code fails on OpenBSD 5.0.  */
14810                {
14811                  static char program[] = "program";
14812                  static char xtremel[] = "--xtremel";
14813                  char *argv[] = { program, xtremel, NULL };
14814                  int option_index;
14815                  optind = 1; opterr = 0;
14816                  if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
14817                    return 1;
14818                }
14819                return 0;
14820
14821  ;
14822  return 0;
14823}
14824_ACEOF
14825if ac_fn_c_try_run "$LINENO"; then :
14826  gl_cv_func_getopt_long_gnu=yes
14827else
14828  gl_cv_func_getopt_long_gnu=no
14829fi
14830rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14831  conftest.$ac_objext conftest.beam conftest.$ac_ext
14832fi
14833
14834
14835fi
14836{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5
14837$as_echo "$gl_cv_func_getopt_long_gnu" >&6; }
14838      case "$gl_cv_func_getopt_long_gnu" in
14839        *yes) ;;
14840        *) gl_replace_getopt=yes ;;
14841      esac
14842    fi
14843  fi
14844
14845
14846
14847ac_fn_c_check_decl "$LINENO" "getpass" "ac_cv_have_decl_getpass" "$ac_includes_default"
14848if test "x$ac_cv_have_decl_getpass" = xyes; then :
14849  ac_have_decl=1
14850else
14851  ac_have_decl=0
14852fi
14853
14854cat >>confdefs.h <<_ACEOF
14855#define HAVE_DECL_GETPASS $ac_have_decl
14856_ACEOF
14857
14858
14859
14860
14861
14862ac_fn_c_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default"
14863if test "x$ac_cv_have_decl_fflush_unlocked" = xyes; then :
14864  ac_have_decl=1
14865else
14866  ac_have_decl=0
14867fi
14868
14869cat >>confdefs.h <<_ACEOF
14870#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl
14871_ACEOF
14872
14873ac_fn_c_check_decl "$LINENO" "flockfile" "ac_cv_have_decl_flockfile" "$ac_includes_default"
14874if test "x$ac_cv_have_decl_flockfile" = xyes; then :
14875  ac_have_decl=1
14876else
14877  ac_have_decl=0
14878fi
14879
14880cat >>confdefs.h <<_ACEOF
14881#define HAVE_DECL_FLOCKFILE $ac_have_decl
14882_ACEOF
14883
14884ac_fn_c_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default"
14885if test "x$ac_cv_have_decl_fputs_unlocked" = xyes; then :
14886  ac_have_decl=1
14887else
14888  ac_have_decl=0
14889fi
14890
14891cat >>confdefs.h <<_ACEOF
14892#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl
14893_ACEOF
14894
14895ac_fn_c_check_decl "$LINENO" "funlockfile" "ac_cv_have_decl_funlockfile" "$ac_includes_default"
14896if test "x$ac_cv_have_decl_funlockfile" = xyes; then :
14897  ac_have_decl=1
14898else
14899  ac_have_decl=0
14900fi
14901
14902cat >>confdefs.h <<_ACEOF
14903#define HAVE_DECL_FUNLOCKFILE $ac_have_decl
14904_ACEOF
14905
14906ac_fn_c_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default"
14907if test "x$ac_cv_have_decl_putc_unlocked" = xyes; then :
14908  ac_have_decl=1
14909else
14910  ac_have_decl=0
14911fi
14912
14913cat >>confdefs.h <<_ACEOF
14914#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl
14915_ACEOF
14916
14917
14918
14919
14920
14921:
14922
14923
14924
14925
14926
14927  GNULIB_GETTIMEOFDAY=0;
14928    HAVE_GETTIMEOFDAY=1;
14929  HAVE_STRUCT_TIMEVAL=1;
14930  HAVE_SYS_TIME_H=1;
14931  REPLACE_GETTIMEOFDAY=0;
14932  REPLACE_STRUCT_TIMEVAL=0;
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949     if test $gl_cv_have_include_next = yes; then
14950       gl_cv_next_sys_time_h='<'sys/time.h'>'
14951     else
14952       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
14953$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
14954if ${gl_cv_next_sys_time_h+:} false; then :
14955  $as_echo_n "(cached) " >&6
14956else
14957
14958             if test $ac_cv_header_sys_time_h = yes; then
14959
14960
14961
14962
14963  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14964/* end confdefs.h.  */
14965#include <sys/time.h>
14966_ACEOF
14967                case "$host_os" in
14968    aix*) gl_absname_cpp="$ac_cpp -C" ;;
14969    *)    gl_absname_cpp="$ac_cpp" ;;
14970  esac
14971
14972  case "$host_os" in
14973    mingw*)
14974                                          gl_dirsep_regex='[/\\]'
14975      ;;
14976    *)
14977      gl_dirsep_regex='\/'
14978      ;;
14979  esac
14980      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
14981  gl_header_literal_regex=`echo 'sys/time.h' \
14982                           | sed -e "$gl_make_literal_regex_sed"`
14983  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
14984      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
14985      s|^/[^/]|//&|
14986      p
14987      q
14988    }'
14989
14990        gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
14991  sed -n "$gl_absolute_header_sed"`
14992
14993           gl_header=$gl_cv_absolute_sys_time_h
14994           gl_cv_next_sys_time_h='"'$gl_header'"'
14995          else
14996               gl_cv_next_sys_time_h='<'sys/time.h'>'
14997             fi
14998
14999
15000fi
15001{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
15002$as_echo "$gl_cv_next_sys_time_h" >&6; }
15003     fi
15004     NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
15005
15006     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
15007       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
15008       gl_next_as_first_directive='<'sys/time.h'>'
15009     else
15010       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
15011       gl_next_as_first_directive=$gl_cv_next_sys_time_h
15012     fi
15013     NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
15014
15015
15016
15017
15018
15019  if test $ac_cv_header_sys_time_h != yes; then
15020    HAVE_SYS_TIME_H=0
15021  fi
15022
15023
15024
15025
15026
15027  if test $ac_cv_header_sys_socket_h != yes; then
15028                    for ac_header in winsock2.h
15029do :
15030  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
15031if test "x$ac_cv_header_winsock2_h" = xyes; then :
15032  cat >>confdefs.h <<_ACEOF
15033#define HAVE_WINSOCK2_H 1
15034_ACEOF
15035
15036fi
15037
15038done
15039
15040  fi
15041  if test "$ac_cv_header_winsock2_h" = yes; then
15042    HAVE_WINSOCK2_H=1
15043    UNISTD_H_HAVE_WINSOCK2_H=1
15044    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
15045  else
15046    HAVE_WINSOCK2_H=0
15047  fi
15048
15049
15050  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
15051$as_echo_n "checking for struct timeval... " >&6; }
15052if ${gl_cv_sys_struct_timeval+:} false; then :
15053  $as_echo_n "(cached) " >&6
15054else
15055  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15056/* end confdefs.h.  */
15057#if HAVE_SYS_TIME_H
15058             #include <sys/time.h>
15059            #endif
15060            #include <time.h>
15061            #if HAVE_WINSOCK2_H
15062            # include <winsock2.h>
15063            #endif
15064
15065int
15066main ()
15067{
15068static struct timeval x; x.tv_sec = x.tv_usec;
15069  ;
15070  return 0;
15071}
15072_ACEOF
15073if ac_fn_c_try_compile "$LINENO"; then :
15074  gl_cv_sys_struct_timeval=yes
15075else
15076  gl_cv_sys_struct_timeval=no
15077fi
15078rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15079
15080fi
15081{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
15082$as_echo "$gl_cv_sys_struct_timeval" >&6; }
15083  if test $gl_cv_sys_struct_timeval != yes; then
15084    HAVE_STRUCT_TIMEVAL=0
15085  else
15086                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
15087$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
15088if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then :
15089  $as_echo_n "(cached) " >&6
15090else
15091  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15092/* end confdefs.h.  */
15093#if HAVE_SYS_TIME_H
15094               #include <sys/time.h>
15095              #endif
15096              #include <time.h>
15097              #if HAVE_WINSOCK2_H
15098              # include <winsock2.h>
15099              #endif
15100
15101int
15102main ()
15103{
15104static struct timeval x;
15105              typedef int verify_tv_sec_type[
15106                sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
15107              ];
15108
15109  ;
15110  return 0;
15111}
15112_ACEOF
15113if ac_fn_c_try_compile "$LINENO"; then :
15114  gl_cv_sys_struct_timeval_tv_sec=yes
15115else
15116  gl_cv_sys_struct_timeval_tv_sec=no
15117fi
15118rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15119
15120fi
15121{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
15122$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
15123    if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
15124      REPLACE_STRUCT_TIMEVAL=1
15125    fi
15126  fi
15127
15128
15129
15130
15131
15132
15133
15134  NEED_LOCALTIME_BUFFER=0
15135
15136
15137  GNULIB_CTIME=0;
15138  GNULIB_MKTIME=0;
15139  GNULIB_LOCALTIME=0;
15140  GNULIB_NANOSLEEP=0;
15141  GNULIB_STRFTIME=0;
15142  GNULIB_STRPTIME=0;
15143  GNULIB_TIMEGM=0;
15144  GNULIB_TIME_R=0;
15145  GNULIB_TIME_RZ=0;
15146  GNULIB_TZSET=0;
15147    HAVE_DECL_LOCALTIME_R=1;
15148  HAVE_NANOSLEEP=1;
15149  HAVE_STRPTIME=1;
15150  HAVE_TIMEGM=1;
15151  HAVE_TZSET=1;
15152    HAVE_TIMEZONE_T=0;
15153        REPLACE_CTIME=GNULIB_PORTCHECK;
15154  REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
15155  REPLACE_MKTIME=GNULIB_PORTCHECK;
15156  REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
15157  REPLACE_STRFTIME=GNULIB_PORTCHECK;
15158  REPLACE_TIMEGM=GNULIB_PORTCHECK;
15159  REPLACE_TZSET=GNULIB_PORTCHECK;
15160
15161      : ${GNULIB_GETTIMEOFDAY=0};
15162        REPLACE_GMTIME=0;
15163  REPLACE_LOCALTIME=0;
15164
15165
15166
15167
15168
15169
15170  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15171/* end confdefs.h.  */
15172
15173#ifdef _MSC_VER
15174MicrosoftCompiler
15175#endif
15176
15177_ACEOF
15178if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15179  $EGREP "MicrosoftCompiler" >/dev/null 2>&1; then :
15180  gl_asmext='asm'
15181     gl_c_asm_opt='-c -Fa'
15182
15183else
15184  gl_asmext='s'
15185     gl_c_asm_opt='-S'
15186
15187fi
15188rm -f conftest*
15189
15190
15191
15192
15193
15194  { $as_echo "$as_me:${as_lineno-$LINENO}: checking host CPU and C ABI" >&5
15195$as_echo_n "checking host CPU and C ABI... " >&6; }
15196if ${gl_cv_host_cpu_c_abi+:} false; then :
15197  $as_echo_n "(cached) " >&6
15198else
15199  case "$host_cpu" in
15200
15201       i[4567]86 )
15202         gl_cv_host_cpu_c_abi=i386
15203         ;;
15204
15205       x86_64 )
15206         # On x86_64 systems, the C compiler may be generating code in one of
15207         # these ABIs:
15208         # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
15209         # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
15210         #   with native Windows (mingw, MSVC).
15211         # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
15212         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
15213         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15214/* end confdefs.h.  */
15215#if (defined __x86_64__ || defined __amd64__ \
15216                     || defined _M_X64 || defined _M_AMD64)
15217                 int ok;
15218                #else
15219                 error fail
15220                #endif
15221
15222_ACEOF
15223if ac_fn_c_try_compile "$LINENO"; then :
15224  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15225/* end confdefs.h.  */
15226#if defined __ILP32__ || defined _ILP32
15227                    int ok;
15228                   #else
15229                    error fail
15230                   #endif
15231
15232_ACEOF
15233if ac_fn_c_try_compile "$LINENO"; then :
15234  gl_cv_host_cpu_c_abi=x86_64-x32
15235else
15236  gl_cv_host_cpu_c_abi=x86_64
15237fi
15238rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15239else
15240  gl_cv_host_cpu_c_abi=i386
15241fi
15242rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15243         ;;
15244
15245       alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
15246         gl_cv_host_cpu_c_abi=alpha
15247         ;;
15248
15249       arm* | aarch64 )
15250         # Assume arm with EABI.
15251         # On arm64 systems, the C compiler may be generating code in one of
15252         # these ABIs:
15253         # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
15254         # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
15255         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
15256         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15257/* end confdefs.h.  */
15258#ifdef __aarch64__
15259                 int ok;
15260                #else
15261                 error fail
15262                #endif
15263
15264_ACEOF
15265if ac_fn_c_try_compile "$LINENO"; then :
15266  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15267/* end confdefs.h.  */
15268#if defined __ILP32__ || defined _ILP32
15269                   int ok;
15270                  #else
15271                   error fail
15272                  #endif
15273
15274_ACEOF
15275if ac_fn_c_try_compile "$LINENO"; then :
15276  gl_cv_host_cpu_c_abi=arm64-ilp32
15277else
15278  gl_cv_host_cpu_c_abi=arm64
15279fi
15280rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15281else
15282  # Don't distinguish little-endian and big-endian arm, since they
15283            # don't require different machine code for simple operations and
15284            # since the user can distinguish them through the preprocessor
15285            # defines __ARMEL__ vs. __ARMEB__.
15286            # But distinguish arm which passes floating-point arguments and
15287            # return values in integer registers (r0, r1, ...) - this is
15288            # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
15289            # passes them in float registers (s0, s1, ...) and double registers
15290            # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
15291            # sets the preprocessor defines __ARM_PCS (for the first case) and
15292            # __ARM_PCS_VFP (for the second case), but older GCC does not.
15293            echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
15294            # Look for a reference to the register d0 in the .s file.
15295            { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c'
15296  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
15297  (eval $ac_try) 2>&5
15298  ac_status=$?
15299  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15300  test $ac_status = 0; }; } >/dev/null 2>&1
15301            if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
15302              gl_cv_host_cpu_c_abi=armhf
15303            else
15304              gl_cv_host_cpu_c_abi=arm
15305            fi
15306            rm -f conftest*
15307
15308fi
15309rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15310         ;;
15311
15312       hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
15313         # On hppa, the C compiler may be generating 32-bit code or 64-bit
15314         # code. In the latter case, it defines _LP64 and __LP64__.
15315         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15316/* end confdefs.h.  */
15317#ifdef __LP64__
15318                 int ok;
15319                #else
15320                 error fail
15321                #endif
15322
15323_ACEOF
15324if ac_fn_c_try_compile "$LINENO"; then :
15325  gl_cv_host_cpu_c_abi=hppa64
15326else
15327  gl_cv_host_cpu_c_abi=hppa
15328fi
15329rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15330         ;;
15331
15332       ia64* )
15333         # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
15334         # 32-bit code. In the latter case, it defines _ILP32.
15335         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15336/* end confdefs.h.  */
15337#ifdef _ILP32
15338                 int ok;
15339                #else
15340                 error fail
15341                #endif
15342
15343_ACEOF
15344if ac_fn_c_try_compile "$LINENO"; then :
15345  gl_cv_host_cpu_c_abi=ia64-ilp32
15346else
15347  gl_cv_host_cpu_c_abi=ia64
15348fi
15349rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15350         ;;
15351
15352       mips* )
15353         # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
15354         # at 32.
15355         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15356/* end confdefs.h.  */
15357#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
15358                 int ok;
15359                #else
15360                 error fail
15361                #endif
15362
15363_ACEOF
15364if ac_fn_c_try_compile "$LINENO"; then :
15365  gl_cv_host_cpu_c_abi=mips64
15366else
15367  # In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
15368            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
15369            # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
15370            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
15371            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15372/* end confdefs.h.  */
15373#if (_MIPS_SIM == _ABIN32)
15374                    int ok;
15375                   #else
15376                    error fail
15377                   #endif
15378
15379_ACEOF
15380if ac_fn_c_try_compile "$LINENO"; then :
15381  gl_cv_host_cpu_c_abi=mipsn32
15382else
15383  gl_cv_host_cpu_c_abi=mips
15384fi
15385rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15386fi
15387rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15388         ;;
15389
15390       powerpc* )
15391         # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
15392         # No need to distinguish them here; the caller may distinguish
15393         # them based on the OS.
15394         # On powerpc64 systems, the C compiler may still be generating
15395         # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
15396         # be generating 64-bit code.
15397         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15398/* end confdefs.h.  */
15399#if defined __powerpc64__ || defined _ARCH_PPC64
15400                 int ok;
15401                #else
15402                 error fail
15403                #endif
15404
15405_ACEOF
15406if ac_fn_c_try_compile "$LINENO"; then :
15407  # On powerpc64, there are two ABIs on Linux: The AIX compatible
15408            # one and the ELFv2 one. The latter defines _CALL_ELF=2.
15409            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15410/* end confdefs.h.  */
15411#if defined _CALL_ELF && _CALL_ELF == 2
15412                    int ok;
15413                   #else
15414                    error fail
15415                   #endif
15416
15417_ACEOF
15418if ac_fn_c_try_compile "$LINENO"; then :
15419  gl_cv_host_cpu_c_abi=powerpc64-elfv2
15420else
15421  gl_cv_host_cpu_c_abi=powerpc64
15422fi
15423rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15424
15425else
15426  gl_cv_host_cpu_c_abi=powerpc
15427fi
15428rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15429         ;;
15430
15431       rs6000 )
15432         gl_cv_host_cpu_c_abi=powerpc
15433         ;;
15434
15435       riscv32 | riscv64 )
15436         # There are 2 architectures (with variants): rv32* and rv64*.
15437         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15438/* end confdefs.h.  */
15439#if __riscv_xlen == 64
15440                  int ok;
15441                #else
15442                  error fail
15443                #endif
15444
15445_ACEOF
15446if ac_fn_c_try_compile "$LINENO"; then :
15447  cpu=riscv64
15448else
15449  cpu=riscv32
15450fi
15451rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15452         # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
15453         # Size of 'long' and 'void *':
15454         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15455/* end confdefs.h.  */
15456#if defined __LP64__
15457                  int ok;
15458                #else
15459                  error fail
15460                #endif
15461
15462_ACEOF
15463if ac_fn_c_try_compile "$LINENO"; then :
15464  main_abi=lp64
15465else
15466  main_abi=ilp32
15467fi
15468rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15469         # Float ABIs:
15470         # __riscv_float_abi_double:
15471         #   'float' and 'double' are passed in floating-point registers.
15472         # __riscv_float_abi_single:
15473         #   'float' are passed in floating-point registers.
15474         # __riscv_float_abi_soft:
15475         #   No values are passed in floating-point registers.
15476         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15477/* end confdefs.h.  */
15478#if defined __riscv_float_abi_double
15479                  int ok;
15480                #else
15481                  error fail
15482                #endif
15483
15484_ACEOF
15485if ac_fn_c_try_compile "$LINENO"; then :
15486  float_abi=d
15487else
15488  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15489/* end confdefs.h.  */
15490#if defined __riscv_float_abi_single
15491                     int ok;
15492                   #else
15493                     error fail
15494                   #endif
15495
15496_ACEOF
15497if ac_fn_c_try_compile "$LINENO"; then :
15498  float_abi=f
15499else
15500  float_abi=''
15501fi
15502rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15503
15504fi
15505rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15506         gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
15507         ;;
15508
15509       s390* )
15510         # On s390x, the C compiler may be generating 64-bit (= s390x) code
15511         # or 31-bit (= s390) code.
15512         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15513/* end confdefs.h.  */
15514#if defined __LP64__ || defined __s390x__
15515                  int ok;
15516                #else
15517                  error fail
15518                #endif
15519
15520_ACEOF
15521if ac_fn_c_try_compile "$LINENO"; then :
15522  gl_cv_host_cpu_c_abi=s390x
15523else
15524  gl_cv_host_cpu_c_abi=s390
15525fi
15526rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15527         ;;
15528
15529       sparc | sparc64 )
15530         # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
15531         # C compiler still generates 32-bit code.
15532         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15533/* end confdefs.h.  */
15534#if defined __sparcv9 || defined __arch64__
15535                 int ok;
15536                #else
15537                 error fail
15538                #endif
15539
15540_ACEOF
15541if ac_fn_c_try_compile "$LINENO"; then :
15542  gl_cv_host_cpu_c_abi=sparc64
15543else
15544  gl_cv_host_cpu_c_abi=sparc
15545fi
15546rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15547         ;;
15548
15549       *)
15550         gl_cv_host_cpu_c_abi="$host_cpu"
15551         ;;
15552     esac
15553
15554fi
15555{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi" >&5
15556$as_echo "$gl_cv_host_cpu_c_abi" >&6; }
15557
15558    HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
15559  HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
15560
15561
15562
15563  # This was
15564  #   AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
15565  #   AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
15566  # earlier, but KAI C++ 3.2d doesn't like this.
15567  sed -e 's/-/_/g' >> confdefs.h <<EOF
15568#ifndef __${HOST_CPU}__
15569#define __${HOST_CPU}__ 1
15570#endif
15571#ifndef __${HOST_CPU_C_ABI}__
15572#define __${HOST_CPU_C_ABI}__ 1
15573#endif
15574EOF
15575
15576
15577
15578
15579      if test "X$prefix" = "XNONE"; then
15580    acl_final_prefix="$ac_default_prefix"
15581  else
15582    acl_final_prefix="$prefix"
15583  fi
15584  if test "X$exec_prefix" = "XNONE"; then
15585    acl_final_exec_prefix='${prefix}'
15586  else
15587    acl_final_exec_prefix="$exec_prefix"
15588  fi
15589  acl_save_prefix="$prefix"
15590  prefix="$acl_final_prefix"
15591  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
15592  prefix="$acl_save_prefix"
15593
15594
15595
15596# Check whether --with-gnu-ld was given.
15597if test "${with_gnu_ld+set}" = set; then :
15598  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
15599else
15600  with_gnu_ld=no
15601fi
15602
15603# Prepare PATH_SEPARATOR.
15604# The user is always right.
15605if test "${PATH_SEPARATOR+set}" != set; then
15606  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
15607  # contains only /bin. Note that ksh looks also at the FPATH variable,
15608  # so we have to set that as well for the test.
15609  PATH_SEPARATOR=:
15610  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
15611    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
15612           || PATH_SEPARATOR=';'
15613       }
15614fi
15615
15616if test -n "$LD"; then
15617  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld" >&5
15618$as_echo_n "checking for ld... " >&6; }
15619elif test "$GCC" = yes; then
15620  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
15621$as_echo_n "checking for ld used by $CC... " >&6; }
15622elif test "$with_gnu_ld" = yes; then
15623  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
15624$as_echo_n "checking for GNU ld... " >&6; }
15625else
15626  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
15627$as_echo_n "checking for non-GNU ld... " >&6; }
15628fi
15629if test -n "$LD"; then
15630  # Let the user override the test with a path.
15631  :
15632else
15633  if ${acl_cv_path_LD+:} false; then :
15634  $as_echo_n "(cached) " >&6
15635else
15636
15637    acl_cv_path_LD= # Final result of this test
15638    ac_prog=ld # Program to search in $PATH
15639    if test "$GCC" = yes; then
15640      # Check if gcc -print-prog-name=ld gives a path.
15641      case $host in
15642        *-*-mingw*)
15643          # gcc leaves a trailing carriage return which upsets mingw
15644          acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
15645        *)
15646          acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
15647      esac
15648      case $acl_output in
15649        # Accept absolute paths.
15650        [\\/]* | ?:[\\/]*)
15651          re_direlt='/[^/][^/]*/\.\./'
15652          # Canonicalize the pathname of ld
15653          acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
15654          while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
15655            acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
15656          done
15657          # Got the pathname. No search in PATH is needed.
15658          acl_cv_path_LD="$acl_output"
15659          ac_prog=
15660          ;;
15661        "")
15662          # If it fails, then pretend we aren't using GCC.
15663          ;;
15664        *)
15665          # If it is relative, then search for the first ld in PATH.
15666          with_gnu_ld=unknown
15667          ;;
15668      esac
15669    fi
15670    if test -n "$ac_prog"; then
15671      # Search for $ac_prog in $PATH.
15672      acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
15673      for ac_dir in $PATH; do
15674        IFS="$acl_save_ifs"
15675        test -z "$ac_dir" && ac_dir=.
15676        if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
15677          acl_cv_path_LD="$ac_dir/$ac_prog"
15678          # Check to see if the program is GNU ld.  I'd rather use --version,
15679          # but apparently some variants of GNU ld only accept -v.
15680          # Break only if it was the GNU/non-GNU ld that we prefer.
15681          case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
15682            *GNU* | *'with BFD'*)
15683              test "$with_gnu_ld" != no && break
15684              ;;
15685            *)
15686              test "$with_gnu_ld" != yes && break
15687              ;;
15688          esac
15689        fi
15690      done
15691      IFS="$acl_save_ifs"
15692    fi
15693    case $host in
15694      *-*-aix*)
15695        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15696/* end confdefs.h.  */
15697#if defined __powerpc64__ || defined _ARCH_PPC64
15698                int ok;
15699               #else
15700                error fail
15701               #endif
15702
15703_ACEOF
15704if ac_fn_c_try_compile "$LINENO"; then :
15705  # The compiler produces 64-bit code. Add option '-b64' so that the
15706           # linker groks 64-bit object files.
15707           case "$acl_cv_path_LD " in
15708             *" -b64 "*) ;;
15709             *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
15710           esac
15711
15712fi
15713rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15714        ;;
15715      sparc64-*-netbsd*)
15716        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15717/* end confdefs.h.  */
15718#if defined __sparcv9 || defined __arch64__
15719                int ok;
15720               #else
15721                error fail
15722               #endif
15723
15724_ACEOF
15725if ac_fn_c_try_compile "$LINENO"; then :
15726
15727else
15728  # The compiler produces 32-bit code. Add option '-m elf32_sparc'
15729           # so that the linker groks 32-bit object files.
15730           case "$acl_cv_path_LD " in
15731             *" -m elf32_sparc "*) ;;
15732             *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
15733           esac
15734
15735fi
15736rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15737        ;;
15738    esac
15739
15740fi
15741
15742  LD="$acl_cv_path_LD"
15743fi
15744if test -n "$LD"; then
15745  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
15746$as_echo "$LD" >&6; }
15747else
15748  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15749$as_echo "no" >&6; }
15750  as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
15751fi
15752{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
15753$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
15754if ${acl_cv_prog_gnu_ld+:} false; then :
15755  $as_echo_n "(cached) " >&6
15756else
15757  # I'd rather use --version here, but apparently some GNU lds only accept -v.
15758case `$LD -v 2>&1 </dev/null` in
15759*GNU* | *'with BFD'*)
15760  acl_cv_prog_gnu_ld=yes
15761  ;;
15762*)
15763  acl_cv_prog_gnu_ld=no
15764  ;;
15765esac
15766fi
15767{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
15768$as_echo "$acl_cv_prog_gnu_ld" >&6; }
15769with_gnu_ld=$acl_cv_prog_gnu_ld
15770
15771
15772
15773
15774                                                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
15775$as_echo_n "checking for shared library run path origin... " >&6; }
15776if ${acl_cv_rpath+:} false; then :
15777  $as_echo_n "(cached) " >&6
15778else
15779
15780    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
15781    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
15782    . ./conftest.sh
15783    rm -f ./conftest.sh
15784    acl_cv_rpath=done
15785
15786fi
15787{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
15788$as_echo "$acl_cv_rpath" >&6; }
15789  wl="$acl_cv_wl"
15790  acl_libext="$acl_cv_libext"
15791  acl_shlibext="$acl_cv_shlibext"
15792  acl_libname_spec="$acl_cv_libname_spec"
15793  acl_library_names_spec="$acl_cv_library_names_spec"
15794  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
15795  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
15796  acl_hardcode_direct="$acl_cv_hardcode_direct"
15797  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
15798    # Check whether --enable-rpath was given.
15799if test "${enable_rpath+set}" = set; then :
15800  enableval=$enable_rpath; :
15801else
15802  enable_rpath=yes
15803fi
15804
15805
15806
15807
15808
15809    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5
15810$as_echo_n "checking for the common suffixes of directories in the library search path... " >&6; }
15811if ${acl_cv_libdirstems+:} false; then :
15812  $as_echo_n "(cached) " >&6
15813else
15814  acl_libdirstem=lib
15815     acl_libdirstem2=
15816     case "$host_os" in
15817       solaris*)
15818                                                      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
15819$as_echo_n "checking for 64-bit host... " >&6; }
15820if ${gl_cv_solaris_64bit+:} false; then :
15821  $as_echo_n "(cached) " >&6
15822else
15823  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15824/* end confdefs.h.  */
15825#ifdef _LP64
15826                    int ok;
15827                   #else
15828                    error fail
15829                   #endif
15830
15831_ACEOF
15832if ac_fn_c_try_compile "$LINENO"; then :
15833  gl_cv_solaris_64bit=yes
15834else
15835  gl_cv_solaris_64bit=no
15836fi
15837rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15838
15839fi
15840{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
15841$as_echo "$gl_cv_solaris_64bit" >&6; }
15842         if test $gl_cv_solaris_64bit = yes; then
15843           acl_libdirstem=lib/64
15844           case "$host_cpu" in
15845             sparc*)        acl_libdirstem2=lib/sparcv9 ;;
15846             i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
15847           esac
15848         fi
15849         ;;
15850       *)
15851                           case "$gl_cv_host_cpu_c_abi" in
15852           i386 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | s390 | sparc)
15853             ;;
15854           *) # x86_64 | arm64 | hppa64 | ia64 | mips64 | powerpc64* | s390x | sparc64 | ...
15855                                                    searchpath=`(if test -f /usr/bin/gcc \
15856                             && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \
15857                            LC_ALL=C /usr/bin/gcc -print-search-dirs; \
15858                          else \
15859                            LC_ALL=C $CC -print-search-dirs; \
15860                          fi) 2>/dev/null \
15861                         | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
15862             if test -n "$searchpath"; then
15863               acl_save_IFS="${IFS= 	}"; IFS=":"
15864               for searchdir in $searchpath; do
15865                 if test -d "$searchdir"; then
15866                   case "$searchdir" in
15867                     */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
15868                     */../ | */.. )
15869                       # Better ignore directories of this form. They are misleading.
15870                       ;;
15871                     *) searchdir=`cd "$searchdir" && pwd`
15872                        case "$searchdir" in
15873                          */lib64 ) acl_libdirstem=lib64 ;;
15874                        esac ;;
15875                   esac
15876                 fi
15877               done
15878               IFS="$acl_save_IFS"
15879             fi
15880             ;;
15881         esac
15882         ;;
15883     esac
15884     test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
15885     acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2"
15886
15887fi
15888{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5
15889$as_echo "$acl_cv_libdirstems" >&6; }
15890  # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2.
15891  acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
15892  acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'`
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905    use_additional=yes
15906
15907  acl_save_prefix="$prefix"
15908  prefix="$acl_final_prefix"
15909  acl_save_exec_prefix="$exec_prefix"
15910  exec_prefix="$acl_final_exec_prefix"
15911
15912    eval additional_includedir=\"$includedir\"
15913    eval additional_libdir=\"$libdir\"
15914
15915  exec_prefix="$acl_save_exec_prefix"
15916  prefix="$acl_save_prefix"
15917
15918
15919# Check whether --with-libiconv-prefix was given.
15920if test "${with_libiconv_prefix+set}" = set; then :
15921  withval=$with_libiconv_prefix;
15922    if test "X$withval" = "Xno"; then
15923      use_additional=no
15924    else
15925      if test "X$withval" = "X"; then
15926
15927  acl_save_prefix="$prefix"
15928  prefix="$acl_final_prefix"
15929  acl_save_exec_prefix="$exec_prefix"
15930  exec_prefix="$acl_final_exec_prefix"
15931
15932          eval additional_includedir=\"$includedir\"
15933          eval additional_libdir=\"$libdir\"
15934
15935  exec_prefix="$acl_save_exec_prefix"
15936  prefix="$acl_save_prefix"
15937
15938      else
15939        additional_includedir="$withval/include"
15940        additional_libdir="$withval/$acl_libdirstem"
15941        if test "$acl_libdirstem2" != "$acl_libdirstem" \
15942           && test ! -d "$withval/$acl_libdirstem"; then
15943          additional_libdir="$withval/$acl_libdirstem2"
15944        fi
15945      fi
15946    fi
15947
15948fi
15949
15950      LIBICONV=
15951  LTLIBICONV=
15952  INCICONV=
15953  LIBICONV_PREFIX=
15954      HAVE_LIBICONV=
15955  rpathdirs=
15956  ltrpathdirs=
15957  names_already_handled=
15958  names_next_round='iconv '
15959  while test -n "$names_next_round"; do
15960    names_this_round="$names_next_round"
15961    names_next_round=
15962    for name in $names_this_round; do
15963      already_handled=
15964      for n in $names_already_handled; do
15965        if test "$n" = "$name"; then
15966          already_handled=yes
15967          break
15968        fi
15969      done
15970      if test -z "$already_handled"; then
15971        names_already_handled="$names_already_handled $name"
15972                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
15973        eval value=\"\$HAVE_LIB$uppername\"
15974        if test -n "$value"; then
15975          if test "$value" = yes; then
15976            eval value=\"\$LIB$uppername\"
15977            test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
15978            eval value=\"\$LTLIB$uppername\"
15979            test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
15980          else
15981                                    :
15982          fi
15983        else
15984                              found_dir=
15985          found_la=
15986          found_so=
15987          found_a=
15988          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
15989          if test -n "$acl_shlibext"; then
15990            shrext=".$acl_shlibext"             # typically: shrext=.so
15991          else
15992            shrext=
15993          fi
15994          if test $use_additional = yes; then
15995            dir="$additional_libdir"
15996                                    if test -n "$acl_shlibext"; then
15997              if test -f "$dir/$libname$shrext"; then
15998                found_dir="$dir"
15999                found_so="$dir/$libname$shrext"
16000              else
16001                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
16002                  ver=`(cd "$dir" && \
16003                        for f in "$libname$shrext".*; do echo "$f"; done \
16004                        | sed -e "s,^$libname$shrext\\\\.,," \
16005                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
16006                        | sed 1q ) 2>/dev/null`
16007                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
16008                    found_dir="$dir"
16009                    found_so="$dir/$libname$shrext.$ver"
16010                  fi
16011                else
16012                  eval library_names=\"$acl_library_names_spec\"
16013                  for f in $library_names; do
16014                    if test -f "$dir/$f"; then
16015                      found_dir="$dir"
16016                      found_so="$dir/$f"
16017                      break
16018                    fi
16019                  done
16020                fi
16021              fi
16022            fi
16023                        if test "X$found_dir" = "X"; then
16024              if test -f "$dir/$libname.$acl_libext"; then
16025                found_dir="$dir"
16026                found_a="$dir/$libname.$acl_libext"
16027              fi
16028            fi
16029            if test "X$found_dir" != "X"; then
16030              if test -f "$dir/$libname.la"; then
16031                found_la="$dir/$libname.la"
16032              fi
16033            fi
16034          fi
16035          if test "X$found_dir" = "X"; then
16036            for x in $LDFLAGS $LTLIBICONV; do
16037
16038  acl_save_prefix="$prefix"
16039  prefix="$acl_final_prefix"
16040  acl_save_exec_prefix="$exec_prefix"
16041  exec_prefix="$acl_final_exec_prefix"
16042  eval x=\"$x\"
16043  exec_prefix="$acl_save_exec_prefix"
16044  prefix="$acl_save_prefix"
16045
16046              case "$x" in
16047                -L*)
16048                  dir=`echo "X$x" | sed -e 's/^X-L//'`
16049                                    if test -n "$acl_shlibext"; then
16050                    if test -f "$dir/$libname$shrext"; then
16051                      found_dir="$dir"
16052                      found_so="$dir/$libname$shrext"
16053                    else
16054                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
16055                        ver=`(cd "$dir" && \
16056                              for f in "$libname$shrext".*; do echo "$f"; done \
16057                              | sed -e "s,^$libname$shrext\\\\.,," \
16058                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
16059                              | sed 1q ) 2>/dev/null`
16060                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
16061                          found_dir="$dir"
16062                          found_so="$dir/$libname$shrext.$ver"
16063                        fi
16064                      else
16065                        eval library_names=\"$acl_library_names_spec\"
16066                        for f in $library_names; do
16067                          if test -f "$dir/$f"; then
16068                            found_dir="$dir"
16069                            found_so="$dir/$f"
16070                            break
16071                          fi
16072                        done
16073                      fi
16074                    fi
16075                  fi
16076                                    if test "X$found_dir" = "X"; then
16077                    if test -f "$dir/$libname.$acl_libext"; then
16078                      found_dir="$dir"
16079                      found_a="$dir/$libname.$acl_libext"
16080                    fi
16081                  fi
16082                  if test "X$found_dir" != "X"; then
16083                    if test -f "$dir/$libname.la"; then
16084                      found_la="$dir/$libname.la"
16085                    fi
16086                  fi
16087                  ;;
16088              esac
16089              if test "X$found_dir" != "X"; then
16090                break
16091              fi
16092            done
16093          fi
16094          if test "X$found_dir" != "X"; then
16095                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
16096            if test "X$found_so" != "X"; then
16097                                                        if test "$enable_rpath" = no \
16098                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
16099                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
16100                                LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
16101              else
16102                                                                                haveit=
16103                for x in $ltrpathdirs; do
16104                  if test "X$x" = "X$found_dir"; then
16105                    haveit=yes
16106                    break
16107                  fi
16108                done
16109                if test -z "$haveit"; then
16110                  ltrpathdirs="$ltrpathdirs $found_dir"
16111                fi
16112                                if test "$acl_hardcode_direct" = yes; then
16113                                                      LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
16114                else
16115                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
16116                                                            LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
16117                                                            haveit=
16118                    for x in $rpathdirs; do
16119                      if test "X$x" = "X$found_dir"; then
16120                        haveit=yes
16121                        break
16122                      fi
16123                    done
16124                    if test -z "$haveit"; then
16125                      rpathdirs="$rpathdirs $found_dir"
16126                    fi
16127                  else
16128                                                                                haveit=
16129                    for x in $LDFLAGS $LIBICONV; do
16130
16131  acl_save_prefix="$prefix"
16132  prefix="$acl_final_prefix"
16133  acl_save_exec_prefix="$exec_prefix"
16134  exec_prefix="$acl_final_exec_prefix"
16135  eval x=\"$x\"
16136  exec_prefix="$acl_save_exec_prefix"
16137  prefix="$acl_save_prefix"
16138
16139                      if test "X$x" = "X-L$found_dir"; then
16140                        haveit=yes
16141                        break
16142                      fi
16143                    done
16144                    if test -z "$haveit"; then
16145                      LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
16146                    fi
16147                    if test "$acl_hardcode_minus_L" != no; then
16148                                                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
16149                    else
16150                                                                                                                                                                                LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
16151                    fi
16152                  fi
16153                fi
16154              fi
16155            else
16156              if test "X$found_a" != "X"; then
16157                                LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a"
16158              else
16159                                                LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name"
16160              fi
16161            fi
16162                        additional_includedir=
16163            case "$found_dir" in
16164              */$acl_libdirstem | */$acl_libdirstem/)
16165                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
16166                if test "$name" = 'iconv'; then
16167                  LIBICONV_PREFIX="$basedir"
16168                fi
16169                additional_includedir="$basedir/include"
16170                ;;
16171              */$acl_libdirstem2 | */$acl_libdirstem2/)
16172                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
16173                if test "$name" = 'iconv'; then
16174                  LIBICONV_PREFIX="$basedir"
16175                fi
16176                additional_includedir="$basedir/include"
16177                ;;
16178            esac
16179            if test "X$additional_includedir" != "X"; then
16180                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
16181                haveit=
16182                if test "X$additional_includedir" = "X/usr/local/include"; then
16183                  if test -n "$GCC"; then
16184                    case $host_os in
16185                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
16186                    esac
16187                  fi
16188                fi
16189                if test -z "$haveit"; then
16190                  for x in $CPPFLAGS $INCICONV; do
16191
16192  acl_save_prefix="$prefix"
16193  prefix="$acl_final_prefix"
16194  acl_save_exec_prefix="$exec_prefix"
16195  exec_prefix="$acl_final_exec_prefix"
16196  eval x=\"$x\"
16197  exec_prefix="$acl_save_exec_prefix"
16198  prefix="$acl_save_prefix"
16199
16200                    if test "X$x" = "X-I$additional_includedir"; then
16201                      haveit=yes
16202                      break
16203                    fi
16204                  done
16205                  if test -z "$haveit"; then
16206                    if test -d "$additional_includedir"; then
16207                                            INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir"
16208                    fi
16209                  fi
16210                fi
16211              fi
16212            fi
16213                        if test -n "$found_la"; then
16214                                                        save_libdir="$libdir"
16215              case "$found_la" in
16216                */* | *\\*) . "$found_la" ;;
16217                *) . "./$found_la" ;;
16218              esac
16219              libdir="$save_libdir"
16220                            for dep in $dependency_libs; do
16221                case "$dep" in
16222                  -L*)
16223                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
16224                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
16225                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
16226                      haveit=
16227                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
16228                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
16229                        if test -n "$GCC"; then
16230                          case $host_os in
16231                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
16232                          esac
16233                        fi
16234                      fi
16235                      if test -z "$haveit"; then
16236                        haveit=
16237                        for x in $LDFLAGS $LIBICONV; do
16238
16239  acl_save_prefix="$prefix"
16240  prefix="$acl_final_prefix"
16241  acl_save_exec_prefix="$exec_prefix"
16242  exec_prefix="$acl_final_exec_prefix"
16243  eval x=\"$x\"
16244  exec_prefix="$acl_save_exec_prefix"
16245  prefix="$acl_save_prefix"
16246
16247                          if test "X$x" = "X-L$additional_libdir"; then
16248                            haveit=yes
16249                            break
16250                          fi
16251                        done
16252                        if test -z "$haveit"; then
16253                          if test -d "$additional_libdir"; then
16254                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir"
16255                          fi
16256                        fi
16257                        haveit=
16258                        for x in $LDFLAGS $LTLIBICONV; do
16259
16260  acl_save_prefix="$prefix"
16261  prefix="$acl_final_prefix"
16262  acl_save_exec_prefix="$exec_prefix"
16263  exec_prefix="$acl_final_exec_prefix"
16264  eval x=\"$x\"
16265  exec_prefix="$acl_save_exec_prefix"
16266  prefix="$acl_save_prefix"
16267
16268                          if test "X$x" = "X-L$additional_libdir"; then
16269                            haveit=yes
16270                            break
16271                          fi
16272                        done
16273                        if test -z "$haveit"; then
16274                          if test -d "$additional_libdir"; then
16275                                                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir"
16276                          fi
16277                        fi
16278                      fi
16279                    fi
16280                    ;;
16281                  -R*)
16282                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
16283                    if test "$enable_rpath" != no; then
16284                                                                  haveit=
16285                      for x in $rpathdirs; do
16286                        if test "X$x" = "X$dir"; then
16287                          haveit=yes
16288                          break
16289                        fi
16290                      done
16291                      if test -z "$haveit"; then
16292                        rpathdirs="$rpathdirs $dir"
16293                      fi
16294                                                                  haveit=
16295                      for x in $ltrpathdirs; do
16296                        if test "X$x" = "X$dir"; then
16297                          haveit=yes
16298                          break
16299                        fi
16300                      done
16301                      if test -z "$haveit"; then
16302                        ltrpathdirs="$ltrpathdirs $dir"
16303                      fi
16304                    fi
16305                    ;;
16306                  -l*)
16307                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
16308                    ;;
16309                  *.la)
16310                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
16311                    ;;
16312                  *)
16313                                        LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
16314                    LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
16315                    ;;
16316                esac
16317              done
16318            fi
16319          else
16320                                                            LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
16321            LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
16322          fi
16323        fi
16324      fi
16325    done
16326  done
16327  if test "X$rpathdirs" != "X"; then
16328    if test -n "$acl_hardcode_libdir_separator"; then
16329                        alldirs=
16330      for found_dir in $rpathdirs; do
16331        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
16332      done
16333            acl_save_libdir="$libdir"
16334      libdir="$alldirs"
16335      eval flag=\"$acl_hardcode_libdir_flag_spec\"
16336      libdir="$acl_save_libdir"
16337      LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
16338    else
16339            for found_dir in $rpathdirs; do
16340        acl_save_libdir="$libdir"
16341        libdir="$found_dir"
16342        eval flag=\"$acl_hardcode_libdir_flag_spec\"
16343        libdir="$acl_save_libdir"
16344        LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
16345      done
16346    fi
16347  fi
16348  if test "X$ltrpathdirs" != "X"; then
16349            for found_dir in $ltrpathdirs; do
16350      LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
16351    done
16352  fi
16353
16354
16355
16356
16357
16358
16359
16360
16361  GNULIB_ICONV=0;
16362    ICONV_CONST=;
16363  REPLACE_ICONV=0;
16364  REPLACE_ICONV_OPEN=0;
16365  REPLACE_ICONV_UTF=0;
16366  ICONV_H='';
16367   if test -n "$ICONV_H"; then
16368  GL_GENERATE_ICONV_H_TRUE=
16369  GL_GENERATE_ICONV_H_FALSE='#'
16370else
16371  GL_GENERATE_ICONV_H_TRUE='#'
16372  GL_GENERATE_ICONV_H_FALSE=
16373fi
16374
16375
16376
16377
16378
16379
16380
16381          am_save_CPPFLAGS="$CPPFLAGS"
16382
16383  for element in $INCICONV; do
16384    haveit=
16385    for x in $CPPFLAGS; do
16386
16387  acl_save_prefix="$prefix"
16388  prefix="$acl_final_prefix"
16389  acl_save_exec_prefix="$exec_prefix"
16390  exec_prefix="$acl_final_exec_prefix"
16391  eval x=\"$x\"
16392  exec_prefix="$acl_save_exec_prefix"
16393  prefix="$acl_save_prefix"
16394
16395      if test "X$x" = "X$element"; then
16396        haveit=yes
16397        break
16398      fi
16399    done
16400    if test -z "$haveit"; then
16401      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
16402    fi
16403  done
16404
16405
16406  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
16407$as_echo_n "checking for iconv... " >&6; }
16408if ${am_cv_func_iconv+:} false; then :
16409  $as_echo_n "(cached) " >&6
16410else
16411
16412    am_cv_func_iconv="no, consider installing GNU libiconv"
16413    am_cv_lib_iconv=no
16414    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16415/* end confdefs.h.  */
16416
16417#include <stdlib.h>
16418#include <iconv.h>
16419
16420int
16421main ()
16422{
16423iconv_t cd = iconv_open("","");
16424           iconv(cd,NULL,NULL,NULL,NULL);
16425           iconv_close(cd);
16426  ;
16427  return 0;
16428}
16429_ACEOF
16430if ac_fn_c_try_link "$LINENO"; then :
16431  am_cv_func_iconv=yes
16432fi
16433rm -f core conftest.err conftest.$ac_objext \
16434    conftest$ac_exeext conftest.$ac_ext
16435    if test "$am_cv_func_iconv" != yes; then
16436      am_save_LIBS="$LIBS"
16437      LIBS="$LIBS $LIBICONV"
16438      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16439/* end confdefs.h.  */
16440
16441#include <stdlib.h>
16442#include <iconv.h>
16443
16444int
16445main ()
16446{
16447iconv_t cd = iconv_open("","");
16448             iconv(cd,NULL,NULL,NULL,NULL);
16449             iconv_close(cd);
16450  ;
16451  return 0;
16452}
16453_ACEOF
16454if ac_fn_c_try_link "$LINENO"; then :
16455  am_cv_lib_iconv=yes
16456        am_cv_func_iconv=yes
16457fi
16458rm -f core conftest.err conftest.$ac_objext \
16459    conftest$ac_exeext conftest.$ac_ext
16460      LIBS="$am_save_LIBS"
16461    fi
16462
16463fi
16464{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
16465$as_echo "$am_cv_func_iconv" >&6; }
16466  if test "$am_cv_func_iconv" = yes; then
16467    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
16468$as_echo_n "checking for working iconv... " >&6; }
16469if ${am_cv_func_iconv_works+:} false; then :
16470  $as_echo_n "(cached) " >&6
16471else
16472
16473                  am_save_LIBS="$LIBS"
16474      if test $am_cv_lib_iconv = yes; then
16475        LIBS="$LIBS $LIBICONV"
16476      fi
16477      am_cv_func_iconv_works=no
16478      for ac_iconv_const in '' 'const'; do
16479        if test "$cross_compiling" = yes; then :
16480  case "$host_os" in
16481             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
16482             *)            am_cv_func_iconv_works="guessing yes" ;;
16483           esac
16484else
16485  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16486/* end confdefs.h.  */
16487
16488#include <iconv.h>
16489#include <string.h>
16490
16491#ifndef ICONV_CONST
16492# define ICONV_CONST $ac_iconv_const
16493#endif
16494
16495int
16496main ()
16497{
16498int result = 0;
16499  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
16500     returns.  */
16501  {
16502    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
16503    if (cd_utf8_to_88591 != (iconv_t)(-1))
16504      {
16505        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
16506        char buf[10];
16507        ICONV_CONST char *inptr = input;
16508        size_t inbytesleft = strlen (input);
16509        char *outptr = buf;
16510        size_t outbytesleft = sizeof (buf);
16511        size_t res = iconv (cd_utf8_to_88591,
16512                            &inptr, &inbytesleft,
16513                            &outptr, &outbytesleft);
16514        if (res == 0)
16515          result |= 1;
16516        iconv_close (cd_utf8_to_88591);
16517      }
16518  }
16519  /* Test against Solaris 10 bug: Failures are not distinguishable from
16520     successful returns.  */
16521  {
16522    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
16523    if (cd_ascii_to_88591 != (iconv_t)(-1))
16524      {
16525        static ICONV_CONST char input[] = "\263";
16526        char buf[10];
16527        ICONV_CONST char *inptr = input;
16528        size_t inbytesleft = strlen (input);
16529        char *outptr = buf;
16530        size_t outbytesleft = sizeof (buf);
16531        size_t res = iconv (cd_ascii_to_88591,
16532                            &inptr, &inbytesleft,
16533                            &outptr, &outbytesleft);
16534        if (res == 0)
16535          result |= 2;
16536        iconv_close (cd_ascii_to_88591);
16537      }
16538  }
16539  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
16540  {
16541    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
16542    if (cd_88591_to_utf8 != (iconv_t)(-1))
16543      {
16544        static ICONV_CONST char input[] = "\304";
16545        static char buf[2] = { (char)0xDE, (char)0xAD };
16546        ICONV_CONST char *inptr = input;
16547        size_t inbytesleft = 1;
16548        char *outptr = buf;
16549        size_t outbytesleft = 1;
16550        size_t res = iconv (cd_88591_to_utf8,
16551                            &inptr, &inbytesleft,
16552                            &outptr, &outbytesleft);
16553        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
16554          result |= 4;
16555        iconv_close (cd_88591_to_utf8);
16556      }
16557  }
16558#if 0 /* This bug could be worked around by the caller.  */
16559  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
16560  {
16561    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
16562    if (cd_88591_to_utf8 != (iconv_t)(-1))
16563      {
16564        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
16565        char buf[50];
16566        ICONV_CONST char *inptr = input;
16567        size_t inbytesleft = strlen (input);
16568        char *outptr = buf;
16569        size_t outbytesleft = sizeof (buf);
16570        size_t res = iconv (cd_88591_to_utf8,
16571                            &inptr, &inbytesleft,
16572                            &outptr, &outbytesleft);
16573        if ((int)res > 0)
16574          result |= 8;
16575        iconv_close (cd_88591_to_utf8);
16576      }
16577  }
16578#endif
16579  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
16580     provided.  */
16581  {
16582    /* Try standardized names.  */
16583    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
16584    /* Try IRIX, OSF/1 names.  */
16585    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
16586    /* Try AIX names.  */
16587    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
16588    /* Try HP-UX names.  */
16589    iconv_t cd4 = iconv_open ("utf8", "eucJP");
16590    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
16591        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
16592      result |= 16;
16593    if (cd1 != (iconv_t)(-1))
16594      iconv_close (cd1);
16595    if (cd2 != (iconv_t)(-1))
16596      iconv_close (cd2);
16597    if (cd3 != (iconv_t)(-1))
16598      iconv_close (cd3);
16599    if (cd4 != (iconv_t)(-1))
16600      iconv_close (cd4);
16601  }
16602  return result;
16603
16604  ;
16605  return 0;
16606}
16607_ACEOF
16608if ac_fn_c_try_run "$LINENO"; then :
16609  am_cv_func_iconv_works=yes
16610fi
16611rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16612  conftest.$ac_objext conftest.beam conftest.$ac_ext
16613fi
16614
16615        test "$am_cv_func_iconv_works" = no || break
16616      done
16617      LIBS="$am_save_LIBS"
16618
16619fi
16620{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
16621$as_echo "$am_cv_func_iconv_works" >&6; }
16622    case "$am_cv_func_iconv_works" in
16623      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
16624      *)   am_func_iconv=yes ;;
16625    esac
16626  else
16627    am_func_iconv=no am_cv_lib_iconv=no
16628  fi
16629  if test "$am_func_iconv" = yes; then
16630
16631$as_echo "#define HAVE_ICONV 1" >>confdefs.h
16632
16633  fi
16634  if test "$am_cv_lib_iconv" = yes; then
16635    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
16636$as_echo_n "checking how to link with libiconv... " >&6; }
16637    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
16638$as_echo "$LIBICONV" >&6; }
16639  else
16640            CPPFLAGS="$am_save_CPPFLAGS"
16641    LIBICONV=
16642    LTLIBICONV=
16643  fi
16644
16645
16646
16647  if test "$am_cv_func_iconv" = yes; then
16648    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5
16649$as_echo_n "checking for iconv declaration... " >&6; }
16650    if ${am_cv_proto_iconv+:} false; then :
16651  $as_echo_n "(cached) " >&6
16652else
16653
16654      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16655/* end confdefs.h.  */
16656
16657#include <stdlib.h>
16658#include <iconv.h>
16659extern
16660#ifdef __cplusplus
16661"C"
16662#endif
16663#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
16664size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
16665#else
16666size_t iconv();
16667#endif
16668
16669int
16670main ()
16671{
16672
16673  ;
16674  return 0;
16675}
16676_ACEOF
16677if ac_fn_c_try_compile "$LINENO"; then :
16678  am_cv_proto_iconv_arg1=""
16679else
16680  am_cv_proto_iconv_arg1="const"
16681fi
16682rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16683      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
16684fi
16685
16686    am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
16687    { $as_echo "$as_me:${as_lineno-$LINENO}: result:
16688         $am_cv_proto_iconv" >&5
16689$as_echo "
16690         $am_cv_proto_iconv" >&6; }
16691  else
16692            am_cv_proto_iconv_arg1=""
16693  fi
16694
16695cat >>confdefs.h <<_ACEOF
16696#define ICONV_CONST $am_cv_proto_iconv_arg1
16697_ACEOF
16698
16699
16700     if test -n "$am_cv_proto_iconv_arg1"; then
16701       ICONV_CONST="const"
16702     fi
16703
16704
16705
16706
16707ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
16708if test "x$ac_cv_type_off_t" = xyes; then :
16709
16710else
16711
16712cat >>confdefs.h <<_ACEOF
16713#define off_t long int
16714_ACEOF
16715
16716fi
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730     if test $gl_cv_have_include_next = yes; then
16731       gl_cv_next_limits_h='<'limits.h'>'
16732     else
16733       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
16734$as_echo_n "checking absolute name of <limits.h>... " >&6; }
16735if ${gl_cv_next_limits_h+:} false; then :
16736  $as_echo_n "(cached) " >&6
16737else
16738
16739             if test $ac_cv_header_limits_h = yes; then
16740
16741
16742
16743
16744  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16745/* end confdefs.h.  */
16746#include <limits.h>
16747_ACEOF
16748                case "$host_os" in
16749    aix*) gl_absname_cpp="$ac_cpp -C" ;;
16750    *)    gl_absname_cpp="$ac_cpp" ;;
16751  esac
16752
16753  case "$host_os" in
16754    mingw*)
16755                                          gl_dirsep_regex='[/\\]'
16756      ;;
16757    *)
16758      gl_dirsep_regex='\/'
16759      ;;
16760  esac
16761      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
16762  gl_header_literal_regex=`echo 'limits.h' \
16763                           | sed -e "$gl_make_literal_regex_sed"`
16764  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
16765      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
16766      s|^/[^/]|//&|
16767      p
16768      q
16769    }'
16770
16771        gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
16772  sed -n "$gl_absolute_header_sed"`
16773
16774           gl_header=$gl_cv_absolute_limits_h
16775           gl_cv_next_limits_h='"'$gl_header'"'
16776          else
16777               gl_cv_next_limits_h='<'limits.h'>'
16778             fi
16779
16780
16781fi
16782{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
16783$as_echo "$gl_cv_next_limits_h" >&6; }
16784     fi
16785     NEXT_LIMITS_H=$gl_cv_next_limits_h
16786
16787     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
16788       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
16789       gl_next_as_first_directive='<'limits.h'>'
16790     else
16791       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
16792       gl_next_as_first_directive=$gl_cv_next_limits_h
16793     fi
16794     NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
16795
16796
16797
16798
16799
16800  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5
16801$as_echo_n "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; }
16802if ${gl_cv_header_limits_width+:} false; then :
16803  $as_echo_n "(cached) " >&6
16804else
16805  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16806/* end confdefs.h.  */
16807#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
16808                           #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
16809                          #endif
16810                          #include <limits.h>
16811                          int ullw = ULLONG_WIDTH;
16812int
16813main ()
16814{
16815
16816  ;
16817  return 0;
16818}
16819_ACEOF
16820if ac_fn_c_try_compile "$LINENO"; then :
16821  gl_cv_header_limits_width=yes
16822else
16823  gl_cv_header_limits_width=no
16824fi
16825rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16826fi
16827{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
16828$as_echo "$gl_cv_header_limits_width" >&6; }
16829  if test "$gl_cv_header_limits_width" = yes; then
16830    LIMITS_H=
16831  else
16832    LIMITS_H=limits.h
16833  fi
16834
16835   if test -n "$LIMITS_H"; then
16836  GL_GENERATE_LIMITS_H_TRUE=
16837  GL_GENERATE_LIMITS_H_FALSE='#'
16838else
16839  GL_GENERATE_LIMITS_H_TRUE='#'
16840  GL_GENERATE_LIMITS_H_FALSE=
16841fi
16842
16843
16844
16845  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
16846$as_echo_n "checking for wint_t... " >&6; }
16847if ${gt_cv_c_wint_t+:} false; then :
16848  $as_echo_n "(cached) " >&6
16849else
16850  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16851/* end confdefs.h.  */
16852
16853/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
16854   <wchar.h>.
16855   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
16856   before <wchar.h>.  */
16857#include <stddef.h>
16858#include <stdio.h>
16859#include <time.h>
16860#include <wchar.h>
16861            wint_t foo = (wchar_t)'\0';
16862int
16863main ()
16864{
16865
16866  ;
16867  return 0;
16868}
16869_ACEOF
16870if ac_fn_c_try_compile "$LINENO"; then :
16871  gt_cv_c_wint_t=yes
16872else
16873  gt_cv_c_wint_t=no
16874fi
16875rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16876fi
16877{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
16878$as_echo "$gt_cv_c_wint_t" >&6; }
16879  if test $gt_cv_c_wint_t = yes; then
16880
16881$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
16882
16883
16884            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5
16885$as_echo_n "checking whether wint_t is too small... " >&6; }
16886if ${gl_cv_type_wint_t_too_small+:} false; then :
16887  $as_echo_n "(cached) " >&6
16888else
16889  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16890/* end confdefs.h.  */
16891
16892/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
16893   <wchar.h>.
16894   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
16895   included before <wchar.h>.  */
16896#if !(defined __GLIBC__ && !defined __UCLIBC__)
16897# include <stddef.h>
16898# include <stdio.h>
16899# include <time.h>
16900#endif
16901#include <wchar.h>
16902              int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
16903
16904int
16905main ()
16906{
16907
16908  ;
16909  return 0;
16910}
16911_ACEOF
16912if ac_fn_c_try_compile "$LINENO"; then :
16913  gl_cv_type_wint_t_too_small=no
16914else
16915  gl_cv_type_wint_t_too_small=yes
16916fi
16917rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16918fi
16919{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5
16920$as_echo "$gl_cv_type_wint_t_too_small" >&6; }
16921    if test $gl_cv_type_wint_t_too_small = yes; then
16922      GNULIB_OVERRIDES_WINT_T=1
16923    else
16924      GNULIB_OVERRIDES_WINT_T=0
16925    fi
16926  else
16927    GNULIB_OVERRIDES_WINT_T=0
16928  fi
16929
16930
16931
16932
16933
16934
16935
16936    gl_cv_c_multiarch=no
16937  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16938/* end confdefs.h.  */
16939#ifndef __APPLE_CC__
16940         not a universal capable compiler
16941        #endif
16942        typedef int dummy;
16943
16944_ACEOF
16945if ac_fn_c_try_compile "$LINENO"; then :
16946
16947               arch=
16948     prev=
16949     for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
16950       if test -n "$prev"; then
16951         case $word in
16952           i?86 | x86_64 | ppc | ppc64)
16953             if test -z "$arch" || test "$arch" = "$word"; then
16954               arch="$word"
16955             else
16956               gl_cv_c_multiarch=yes
16957             fi
16958             ;;
16959         esac
16960         prev=
16961       else
16962         if test "x$word" = "x-arch"; then
16963           prev=arch
16964         fi
16965       fi
16966     done
16967
16968fi
16969rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16970  if test $gl_cv_c_multiarch = yes; then
16971    APPLE_UNIVERSAL_BUILD=1
16972  else
16973    APPLE_UNIVERSAL_BUILD=0
16974  fi
16975
16976
16977
16978
16979
16980
16981
16982
16983  if test $ac_cv_type_long_long_int = yes; then
16984    HAVE_LONG_LONG_INT=1
16985  else
16986    HAVE_LONG_LONG_INT=0
16987  fi
16988
16989
16990  if test $ac_cv_type_unsigned_long_long_int = yes; then
16991    HAVE_UNSIGNED_LONG_LONG_INT=1
16992  else
16993    HAVE_UNSIGNED_LONG_LONG_INT=0
16994  fi
16995
16996
16997
16998  if test $ac_cv_header_wchar_h = yes; then
16999    HAVE_WCHAR_H=1
17000  else
17001    HAVE_WCHAR_H=0
17002  fi
17003
17004
17005      if test $ac_cv_header_inttypes_h = yes; then
17006    HAVE_INTTYPES_H=1
17007  else
17008    HAVE_INTTYPES_H=0
17009  fi
17010
17011
17012      if test $ac_cv_header_sys_types_h = yes; then
17013    HAVE_SYS_TYPES_H=1
17014  else
17015    HAVE_SYS_TYPES_H=0
17016  fi
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028     if test $gl_cv_have_include_next = yes; then
17029       gl_cv_next_stdint_h='<'stdint.h'>'
17030     else
17031       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
17032$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
17033if ${gl_cv_next_stdint_h+:} false; then :
17034  $as_echo_n "(cached) " >&6
17035else
17036
17037             if test $ac_cv_header_stdint_h = yes; then
17038
17039
17040
17041
17042  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17043/* end confdefs.h.  */
17044#include <stdint.h>
17045_ACEOF
17046                case "$host_os" in
17047    aix*) gl_absname_cpp="$ac_cpp -C" ;;
17048    *)    gl_absname_cpp="$ac_cpp" ;;
17049  esac
17050
17051  case "$host_os" in
17052    mingw*)
17053                                          gl_dirsep_regex='[/\\]'
17054      ;;
17055    *)
17056      gl_dirsep_regex='\/'
17057      ;;
17058  esac
17059      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17060  gl_header_literal_regex=`echo 'stdint.h' \
17061                           | sed -e "$gl_make_literal_regex_sed"`
17062  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17063      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17064      s|^/[^/]|//&|
17065      p
17066      q
17067    }'
17068
17069        gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17070  sed -n "$gl_absolute_header_sed"`
17071
17072           gl_header=$gl_cv_absolute_stdint_h
17073           gl_cv_next_stdint_h='"'$gl_header'"'
17074          else
17075               gl_cv_next_stdint_h='<'stdint.h'>'
17076             fi
17077
17078
17079fi
17080{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
17081$as_echo "$gl_cv_next_stdint_h" >&6; }
17082     fi
17083     NEXT_STDINT_H=$gl_cv_next_stdint_h
17084
17085     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17086       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17087       gl_next_as_first_directive='<'stdint.h'>'
17088     else
17089       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17090       gl_next_as_first_directive=$gl_cv_next_stdint_h
17091     fi
17092     NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
17093
17094
17095
17096
17097  if test $ac_cv_header_stdint_h = yes; then
17098    HAVE_STDINT_H=1
17099  else
17100    HAVE_STDINT_H=0
17101  fi
17102
17103
17104    if test $ac_cv_header_stdint_h = yes; then
17105    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
17106$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
17107if ${gl_cv_header_working_stdint_h+:} false; then :
17108  $as_echo_n "(cached) " >&6
17109else
17110  gl_cv_header_working_stdint_h=no
17111       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17112/* end confdefs.h.  */
17113
17114
17115#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
17116#define __STDC_CONSTANT_MACROS 1
17117#define __STDC_LIMIT_MACROS 1
17118#include <stdint.h>
17119/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
17120#if !(defined WCHAR_MIN && defined WCHAR_MAX)
17121#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
17122#endif
17123
17124
17125  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17126     included before <wchar.h>.  */
17127  #include <stddef.h>
17128  #include <signal.h>
17129  #if HAVE_WCHAR_H
17130  # include <stdio.h>
17131  # include <time.h>
17132  # include <wchar.h>
17133  #endif
17134
17135
17136#ifdef INT8_MAX
17137int8_t a1 = INT8_MAX;
17138int8_t a1min = INT8_MIN;
17139#endif
17140#ifdef INT16_MAX
17141int16_t a2 = INT16_MAX;
17142int16_t a2min = INT16_MIN;
17143#endif
17144#ifdef INT32_MAX
17145int32_t a3 = INT32_MAX;
17146int32_t a3min = INT32_MIN;
17147#endif
17148#ifdef INT64_MAX
17149int64_t a4 = INT64_MAX;
17150int64_t a4min = INT64_MIN;
17151#endif
17152#ifdef UINT8_MAX
17153uint8_t b1 = UINT8_MAX;
17154#else
17155typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
17156#endif
17157#ifdef UINT16_MAX
17158uint16_t b2 = UINT16_MAX;
17159#endif
17160#ifdef UINT32_MAX
17161uint32_t b3 = UINT32_MAX;
17162#endif
17163#ifdef UINT64_MAX
17164uint64_t b4 = UINT64_MAX;
17165#endif
17166int_least8_t c1 = INT8_C (0x7f);
17167int_least8_t c1max = INT_LEAST8_MAX;
17168int_least8_t c1min = INT_LEAST8_MIN;
17169int_least16_t c2 = INT16_C (0x7fff);
17170int_least16_t c2max = INT_LEAST16_MAX;
17171int_least16_t c2min = INT_LEAST16_MIN;
17172int_least32_t c3 = INT32_C (0x7fffffff);
17173int_least32_t c3max = INT_LEAST32_MAX;
17174int_least32_t c3min = INT_LEAST32_MIN;
17175int_least64_t c4 = INT64_C (0x7fffffffffffffff);
17176int_least64_t c4max = INT_LEAST64_MAX;
17177int_least64_t c4min = INT_LEAST64_MIN;
17178uint_least8_t d1 = UINT8_C (0xff);
17179uint_least8_t d1max = UINT_LEAST8_MAX;
17180uint_least16_t d2 = UINT16_C (0xffff);
17181uint_least16_t d2max = UINT_LEAST16_MAX;
17182uint_least32_t d3 = UINT32_C (0xffffffff);
17183uint_least32_t d3max = UINT_LEAST32_MAX;
17184uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
17185uint_least64_t d4max = UINT_LEAST64_MAX;
17186int_fast8_t e1 = INT_FAST8_MAX;
17187int_fast8_t e1min = INT_FAST8_MIN;
17188int_fast16_t e2 = INT_FAST16_MAX;
17189int_fast16_t e2min = INT_FAST16_MIN;
17190int_fast32_t e3 = INT_FAST32_MAX;
17191int_fast32_t e3min = INT_FAST32_MIN;
17192int_fast64_t e4 = INT_FAST64_MAX;
17193int_fast64_t e4min = INT_FAST64_MIN;
17194uint_fast8_t f1 = UINT_FAST8_MAX;
17195uint_fast16_t f2 = UINT_FAST16_MAX;
17196uint_fast32_t f3 = UINT_FAST32_MAX;
17197uint_fast64_t f4 = UINT_FAST64_MAX;
17198#ifdef INTPTR_MAX
17199intptr_t g = INTPTR_MAX;
17200intptr_t gmin = INTPTR_MIN;
17201#endif
17202#ifdef UINTPTR_MAX
17203uintptr_t h = UINTPTR_MAX;
17204#endif
17205intmax_t i = INTMAX_MAX;
17206uintmax_t j = UINTMAX_MAX;
17207
17208/* Check that SIZE_MAX has the correct type, if possible.  */
17209#if 201112 <= __STDC_VERSION__
17210int k = _Generic (SIZE_MAX, size_t: 0);
17211#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
17212       || (0x5110 <= __SUNPRO_C && !__STDC__))
17213extern size_t k;
17214extern __typeof__ (SIZE_MAX) k;
17215#endif
17216
17217#include <limits.h> /* for CHAR_BIT */
17218#define TYPE_MINIMUM(t) \
17219  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
17220#define TYPE_MAXIMUM(t) \
17221  ((t) ((t) 0 < (t) -1 \
17222        ? (t) -1 \
17223        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
17224struct s {
17225  int check_PTRDIFF:
17226      PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
17227      && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
17228      ? 1 : -1;
17229  /* Detect bug in FreeBSD 6.0 / ia64.  */
17230  int check_SIG_ATOMIC:
17231      SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
17232      && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
17233      ? 1 : -1;
17234  int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
17235  int check_WCHAR:
17236      WCHAR_MIN == TYPE_MINIMUM (wchar_t)
17237      && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
17238      ? 1 : -1;
17239  /* Detect bug in mingw.  */
17240  int check_WINT:
17241      WINT_MIN == TYPE_MINIMUM (wint_t)
17242      && WINT_MAX == TYPE_MAXIMUM (wint_t)
17243      ? 1 : -1;
17244
17245  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
17246  int check_UINT8_C:
17247        (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
17248  int check_UINT16_C:
17249        (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
17250
17251  /* Detect bugs in OpenBSD 3.9 stdint.h.  */
17252#ifdef UINT8_MAX
17253  int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
17254#endif
17255#ifdef UINT16_MAX
17256  int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
17257#endif
17258#ifdef UINT32_MAX
17259  int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
17260#endif
17261#ifdef UINT64_MAX
17262  int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
17263#endif
17264  int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
17265  int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
17266  int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
17267  int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
17268  int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
17269  int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
17270  int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
17271  int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
17272  int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
17273  int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
17274  int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
17275};
17276
17277int
17278main ()
17279{
17280
17281  ;
17282  return 0;
17283}
17284_ACEOF
17285if ac_fn_c_try_compile "$LINENO"; then :
17286                                                    if test "$cross_compiling" = yes; then :
17287  case "$host_os" in
17288                         # Guess yes on native Windows.
17289                 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
17290                         # In general, assume it works.
17291                 *)      gl_cv_header_working_stdint_h="guessing yes" ;;
17292               esac
17293
17294else
17295  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17296/* end confdefs.h.  */
17297
17298
17299#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
17300#define __STDC_CONSTANT_MACROS 1
17301#define __STDC_LIMIT_MACROS 1
17302#include <stdint.h>
17303
17304
17305  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17306     included before <wchar.h>.  */
17307  #include <stddef.h>
17308  #include <signal.h>
17309  #if HAVE_WCHAR_H
17310  # include <stdio.h>
17311  # include <time.h>
17312  # include <wchar.h>
17313  #endif
17314
17315
17316#include <stdio.h>
17317#include <string.h>
17318#define MVAL(macro) MVAL1(macro)
17319#define MVAL1(expression) #expression
17320static const char *macro_values[] =
17321  {
17322#ifdef INT8_MAX
17323    MVAL (INT8_MAX),
17324#endif
17325#ifdef INT16_MAX
17326    MVAL (INT16_MAX),
17327#endif
17328#ifdef INT32_MAX
17329    MVAL (INT32_MAX),
17330#endif
17331#ifdef INT64_MAX
17332    MVAL (INT64_MAX),
17333#endif
17334#ifdef UINT8_MAX
17335    MVAL (UINT8_MAX),
17336#endif
17337#ifdef UINT16_MAX
17338    MVAL (UINT16_MAX),
17339#endif
17340#ifdef UINT32_MAX
17341    MVAL (UINT32_MAX),
17342#endif
17343#ifdef UINT64_MAX
17344    MVAL (UINT64_MAX),
17345#endif
17346    NULL
17347  };
17348
17349int
17350main ()
17351{
17352
17353  const char **mv;
17354  for (mv = macro_values; *mv != NULL; mv++)
17355    {
17356      const char *value = *mv;
17357      /* Test whether it looks like a cast expression.  */
17358      if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
17359          || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
17360          || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
17361          || strncmp (value, "((int)"/*)*/, 6) == 0
17362          || strncmp (value, "((signed short)"/*)*/, 15) == 0
17363          || strncmp (value, "((signed char)"/*)*/, 14) == 0)
17364        return mv - macro_values + 1;
17365    }
17366  return 0;
17367
17368  ;
17369  return 0;
17370}
17371_ACEOF
17372if ac_fn_c_try_run "$LINENO"; then :
17373  gl_cv_header_working_stdint_h=yes
17374fi
17375rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17376  conftest.$ac_objext conftest.beam conftest.$ac_ext
17377fi
17378
17379
17380fi
17381rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17382
17383fi
17384{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
17385$as_echo "$gl_cv_header_working_stdint_h" >&6; }
17386  fi
17387
17388  HAVE_C99_STDINT_H=0
17389  HAVE_SYS_BITYPES_H=0
17390  HAVE_SYS_INTTYPES_H=0
17391  STDINT_H=stdint.h
17392  case "$gl_cv_header_working_stdint_h" in
17393    *yes)
17394      HAVE_C99_STDINT_H=1
17395                  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5
17396$as_echo_n "checking whether stdint.h predates C++11... " >&6; }
17397if ${gl_cv_header_stdint_predates_cxx11_h+:} false; then :
17398  $as_echo_n "(cached) " >&6
17399else
17400  gl_cv_header_stdint_predates_cxx11_h=yes
17401         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17402/* end confdefs.h.  */
17403
17404
17405#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
17406#include <stdint.h>
17407
17408
17409  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17410     included before <wchar.h>.  */
17411  #include <stddef.h>
17412  #include <signal.h>
17413  #if HAVE_WCHAR_H
17414  # include <stdio.h>
17415  # include <time.h>
17416  # include <wchar.h>
17417  #endif
17418
17419
17420intmax_t im = INTMAX_MAX;
17421int32_t i32 = INT32_C (0x7fffffff);
17422
17423int
17424main ()
17425{
17426
17427  ;
17428  return 0;
17429}
17430_ACEOF
17431if ac_fn_c_try_compile "$LINENO"; then :
17432  gl_cv_header_stdint_predates_cxx11_h=no
17433fi
17434rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17435fi
17436{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5
17437$as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; }
17438
17439      if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
17440
17441$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
17442
17443
17444$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
17445
17446      fi
17447      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
17448$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
17449if ${gl_cv_header_stdint_width+:} false; then :
17450  $as_echo_n "(cached) " >&6
17451else
17452  gl_cv_header_stdint_width=no
17453         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17454/* end confdefs.h.  */
17455
17456              /* Work if build is not clean.  */
17457              #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
17458              #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
17459               #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
17460              #endif
17461              #include <stdint.h>
17462
17463  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17464     included before <wchar.h>.  */
17465  #include <stddef.h>
17466  #include <signal.h>
17467  #if HAVE_WCHAR_H
17468  # include <stdio.h>
17469  # include <time.h>
17470  # include <wchar.h>
17471  #endif
17472
17473              int iw = UINTMAX_WIDTH;
17474
17475int
17476main ()
17477{
17478
17479  ;
17480  return 0;
17481}
17482_ACEOF
17483if ac_fn_c_try_compile "$LINENO"; then :
17484  gl_cv_header_stdint_width=yes
17485fi
17486rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17487fi
17488{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
17489$as_echo "$gl_cv_header_stdint_width" >&6; }
17490      if test "$gl_cv_header_stdint_width" = yes; then
17491        STDINT_H=
17492      fi
17493      ;;
17494    *)
17495                  for ac_header in sys/inttypes.h sys/bitypes.h
17496do :
17497  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
17498ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
17499if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
17500  cat >>confdefs.h <<_ACEOF
17501#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
17502_ACEOF
17503
17504fi
17505
17506done
17507
17508      if test $ac_cv_header_sys_inttypes_h = yes; then
17509        HAVE_SYS_INTTYPES_H=1
17510      fi
17511      if test $ac_cv_header_sys_bitypes_h = yes; then
17512        HAVE_SYS_BITYPES_H=1
17513      fi
17514
17515
17516  if test $APPLE_UNIVERSAL_BUILD = 0; then
17517
17518
17519  for gltype in ptrdiff_t size_t ; do
17520    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
17521$as_echo_n "checking for bit size of $gltype... " >&6; }
17522if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
17523  $as_echo_n "(cached) " >&6
17524else
17525  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
17526  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17527     included before <wchar.h>.  */
17528  #include <stddef.h>
17529  #include <signal.h>
17530  #if HAVE_WCHAR_H
17531  # include <stdio.h>
17532  # include <time.h>
17533  # include <wchar.h>
17534  #endif
17535
17536#include <limits.h>"; then :
17537
17538else
17539  result=unknown
17540fi
17541
17542       eval gl_cv_bitsizeof_${gltype}=\$result
17543
17544fi
17545eval ac_res=\$gl_cv_bitsizeof_${gltype}
17546	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17547$as_echo "$ac_res" >&6; }
17548    eval result=\$gl_cv_bitsizeof_${gltype}
17549    if test $result = unknown; then
17550                                                result=0
17551    fi
17552    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
17553    cat >>confdefs.h <<_ACEOF
17554#define BITSIZEOF_${GLTYPE} $result
17555_ACEOF
17556
17557    eval BITSIZEOF_${GLTYPE}=\$result
17558  done
17559
17560
17561  fi
17562
17563
17564  for gltype in sig_atomic_t wchar_t wint_t ; do
17565    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
17566$as_echo_n "checking for bit size of $gltype... " >&6; }
17567if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
17568  $as_echo_n "(cached) " >&6
17569else
17570  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
17571  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17572     included before <wchar.h>.  */
17573  #include <stddef.h>
17574  #include <signal.h>
17575  #if HAVE_WCHAR_H
17576  # include <stdio.h>
17577  # include <time.h>
17578  # include <wchar.h>
17579  #endif
17580
17581#include <limits.h>"; then :
17582
17583else
17584  result=unknown
17585fi
17586
17587       eval gl_cv_bitsizeof_${gltype}=\$result
17588
17589fi
17590eval ac_res=\$gl_cv_bitsizeof_${gltype}
17591	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17592$as_echo "$ac_res" >&6; }
17593    eval result=\$gl_cv_bitsizeof_${gltype}
17594    if test $result = unknown; then
17595                                                result=0
17596    fi
17597    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
17598    cat >>confdefs.h <<_ACEOF
17599#define BITSIZEOF_${GLTYPE} $result
17600_ACEOF
17601
17602    eval BITSIZEOF_${GLTYPE}=\$result
17603  done
17604
17605
17606
17607
17608  for gltype in sig_atomic_t wchar_t wint_t ; do
17609    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
17610$as_echo_n "checking whether $gltype is signed... " >&6; }
17611if eval \${gl_cv_type_${gltype}_signed+:} false; then :
17612  $as_echo_n "(cached) " >&6
17613else
17614  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17615/* end confdefs.h.  */
17616
17617  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17618     included before <wchar.h>.  */
17619  #include <stddef.h>
17620  #include <signal.h>
17621  #if HAVE_WCHAR_H
17622  # include <stdio.h>
17623  # include <time.h>
17624  # include <wchar.h>
17625  #endif
17626
17627            int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
17628int
17629main ()
17630{
17631
17632  ;
17633  return 0;
17634}
17635_ACEOF
17636if ac_fn_c_try_compile "$LINENO"; then :
17637  result=yes
17638else
17639  result=no
17640fi
17641rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17642       eval gl_cv_type_${gltype}_signed=\$result
17643
17644fi
17645eval ac_res=\$gl_cv_type_${gltype}_signed
17646	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17647$as_echo "$ac_res" >&6; }
17648    eval result=\$gl_cv_type_${gltype}_signed
17649    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
17650    if test "$result" = yes; then
17651      cat >>confdefs.h <<_ACEOF
17652#define HAVE_SIGNED_${GLTYPE} 1
17653_ACEOF
17654
17655      eval HAVE_SIGNED_${GLTYPE}=1
17656    else
17657      eval HAVE_SIGNED_${GLTYPE}=0
17658    fi
17659  done
17660
17661
17662  gl_cv_type_ptrdiff_t_signed=yes
17663  gl_cv_type_size_t_signed=no
17664  if test $APPLE_UNIVERSAL_BUILD = 0; then
17665
17666
17667  for gltype in ptrdiff_t size_t ; do
17668    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
17669$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
17670if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
17671  $as_echo_n "(cached) " >&6
17672else
17673  eval gl_cv_type_${gltype}_suffix=no
17674       eval result=\$gl_cv_type_${gltype}_signed
17675       if test "$result" = yes; then
17676         glsufu=
17677       else
17678         glsufu=u
17679       fi
17680       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
17681         case $glsuf in
17682           '')  gltype1='int';;
17683           l)   gltype1='long int';;
17684           ll)  gltype1='long long int';;
17685           i64) gltype1='__int64';;
17686           u)   gltype1='unsigned int';;
17687           ul)  gltype1='unsigned long int';;
17688           ull) gltype1='unsigned long long int';;
17689           ui64)gltype1='unsigned __int64';;
17690         esac
17691         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17692/* end confdefs.h.  */
17693
17694  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17695     included before <wchar.h>.  */
17696  #include <stddef.h>
17697  #include <signal.h>
17698  #if HAVE_WCHAR_H
17699  # include <stdio.h>
17700  # include <time.h>
17701  # include <wchar.h>
17702  #endif
17703
17704              extern $gltype foo;
17705              extern $gltype1 foo;
17706int
17707main ()
17708{
17709
17710  ;
17711  return 0;
17712}
17713_ACEOF
17714if ac_fn_c_try_compile "$LINENO"; then :
17715  eval gl_cv_type_${gltype}_suffix=\$glsuf
17716fi
17717rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17718         eval result=\$gl_cv_type_${gltype}_suffix
17719         test "$result" != no && break
17720       done
17721fi
17722eval ac_res=\$gl_cv_type_${gltype}_suffix
17723	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17724$as_echo "$ac_res" >&6; }
17725    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
17726    eval result=\$gl_cv_type_${gltype}_suffix
17727    test "$result" = no && result=
17728    eval ${GLTYPE}_SUFFIX=\$result
17729    cat >>confdefs.h <<_ACEOF
17730#define ${GLTYPE}_SUFFIX $result
17731_ACEOF
17732
17733  done
17734
17735
17736  fi
17737
17738
17739  for gltype in sig_atomic_t wchar_t wint_t ; do
17740    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
17741$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
17742if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
17743  $as_echo_n "(cached) " >&6
17744else
17745  eval gl_cv_type_${gltype}_suffix=no
17746       eval result=\$gl_cv_type_${gltype}_signed
17747       if test "$result" = yes; then
17748         glsufu=
17749       else
17750         glsufu=u
17751       fi
17752       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
17753         case $glsuf in
17754           '')  gltype1='int';;
17755           l)   gltype1='long int';;
17756           ll)  gltype1='long long int';;
17757           i64) gltype1='__int64';;
17758           u)   gltype1='unsigned int';;
17759           ul)  gltype1='unsigned long int';;
17760           ull) gltype1='unsigned long long int';;
17761           ui64)gltype1='unsigned __int64';;
17762         esac
17763         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17764/* end confdefs.h.  */
17765
17766  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
17767     included before <wchar.h>.  */
17768  #include <stddef.h>
17769  #include <signal.h>
17770  #if HAVE_WCHAR_H
17771  # include <stdio.h>
17772  # include <time.h>
17773  # include <wchar.h>
17774  #endif
17775
17776              extern $gltype foo;
17777              extern $gltype1 foo;
17778int
17779main ()
17780{
17781
17782  ;
17783  return 0;
17784}
17785_ACEOF
17786if ac_fn_c_try_compile "$LINENO"; then :
17787  eval gl_cv_type_${gltype}_suffix=\$glsuf
17788fi
17789rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17790         eval result=\$gl_cv_type_${gltype}_suffix
17791         test "$result" != no && break
17792       done
17793fi
17794eval ac_res=\$gl_cv_type_${gltype}_suffix
17795	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17796$as_echo "$ac_res" >&6; }
17797    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
17798    eval result=\$gl_cv_type_${gltype}_suffix
17799    test "$result" = no && result=
17800    eval ${GLTYPE}_SUFFIX=\$result
17801    cat >>confdefs.h <<_ACEOF
17802#define ${GLTYPE}_SUFFIX $result
17803_ACEOF
17804
17805  done
17806
17807
17808
17809          if test $GNULIB_OVERRIDES_WINT_T = 1; then
17810    BITSIZEOF_WINT_T=32
17811  fi
17812
17813      ;;
17814  esac
17815
17816    LIMITS_H=limits.h
17817   if test -n "$LIMITS_H"; then
17818  GL_GENERATE_LIMITS_H_TRUE=
17819  GL_GENERATE_LIMITS_H_FALSE='#'
17820else
17821  GL_GENERATE_LIMITS_H_TRUE='#'
17822  GL_GENERATE_LIMITS_H_FALSE=
17823fi
17824
17825
17826
17827
17828
17829
17830   if test -n "$STDINT_H"; then
17831  GL_GENERATE_STDINT_H_TRUE=
17832  GL_GENERATE_STDINT_H_FALSE='#'
17833else
17834  GL_GENERATE_STDINT_H_TRUE='#'
17835  GL_GENERATE_STDINT_H_FALSE=
17836fi
17837
17838
17839
17840
17841
17842  GNULIB_IMAXABS=0;
17843  GNULIB_IMAXDIV=0;
17844  GNULIB_STRTOIMAX=0;
17845  GNULIB_STRTOUMAX=0;
17846    HAVE_DECL_IMAXABS=1;
17847  HAVE_DECL_IMAXDIV=1;
17848  HAVE_DECL_STRTOIMAX=1;
17849  HAVE_DECL_STRTOUMAX=1;
17850  HAVE_IMAXDIV_T=1;
17851  REPLACE_STRTOIMAX=0;
17852  REPLACE_STRTOUMAX=0;
17853  INT32_MAX_LT_INTMAX_MAX=1;
17854  INT64_MAX_EQ_LONG_MAX='defined _LP64';
17855  PRI_MACROS_BROKEN=0;
17856  PRIPTR_PREFIX=__PRIPTR_PREFIX;
17857  UINT32_MAX_LT_UINTMAX_MAX=1;
17858  UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874     if test $gl_cv_have_include_next = yes; then
17875       gl_cv_next_inttypes_h='<'inttypes.h'>'
17876     else
17877       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
17878$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
17879if ${gl_cv_next_inttypes_h+:} false; then :
17880  $as_echo_n "(cached) " >&6
17881else
17882
17883             if test $ac_cv_header_inttypes_h = yes; then
17884
17885
17886
17887
17888  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17889/* end confdefs.h.  */
17890#include <inttypes.h>
17891_ACEOF
17892                case "$host_os" in
17893    aix*) gl_absname_cpp="$ac_cpp -C" ;;
17894    *)    gl_absname_cpp="$ac_cpp" ;;
17895  esac
17896
17897  case "$host_os" in
17898    mingw*)
17899                                          gl_dirsep_regex='[/\\]'
17900      ;;
17901    *)
17902      gl_dirsep_regex='\/'
17903      ;;
17904  esac
17905      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
17906  gl_header_literal_regex=`echo 'inttypes.h' \
17907                           | sed -e "$gl_make_literal_regex_sed"`
17908  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
17909      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
17910      s|^/[^/]|//&|
17911      p
17912      q
17913    }'
17914
17915        gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
17916  sed -n "$gl_absolute_header_sed"`
17917
17918           gl_header=$gl_cv_absolute_inttypes_h
17919           gl_cv_next_inttypes_h='"'$gl_header'"'
17920          else
17921               gl_cv_next_inttypes_h='<'inttypes.h'>'
17922             fi
17923
17924
17925fi
17926{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
17927$as_echo "$gl_cv_next_inttypes_h" >&6; }
17928     fi
17929     NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
17930
17931     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
17932       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
17933       gl_next_as_first_directive='<'inttypes.h'>'
17934     else
17935       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
17936       gl_next_as_first_directive=$gl_cv_next_inttypes_h
17937     fi
17938     NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949  for ac_header in inttypes.h
17950do :
17951  ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
17952if test "x$ac_cv_header_inttypes_h" = xyes; then :
17953  cat >>confdefs.h <<_ACEOF
17954#define HAVE_INTTYPES_H 1
17955_ACEOF
17956
17957fi
17958
17959done
17960
17961  if test $ac_cv_header_inttypes_h = yes; then
17962    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5
17963$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; }
17964if ${gt_cv_inttypes_pri_broken+:} false; then :
17965  $as_echo_n "(cached) " >&6
17966else
17967
17968        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17969/* end confdefs.h.  */
17970
17971#include <inttypes.h>
17972#ifdef PRId32
17973char *p = PRId32;
17974#endif
17975
17976int
17977main ()
17978{
17979
17980  ;
17981  return 0;
17982}
17983_ACEOF
17984if ac_fn_c_try_compile "$LINENO"; then :
17985  gt_cv_inttypes_pri_broken=no
17986else
17987  gt_cv_inttypes_pri_broken=yes
17988fi
17989rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17990
17991fi
17992{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5
17993$as_echo "$gt_cv_inttypes_pri_broken" >&6; }
17994  fi
17995  if test "$gt_cv_inttypes_pri_broken" = yes; then
17996
17997cat >>confdefs.h <<_ACEOF
17998#define PRI_MACROS_BROKEN 1
17999_ACEOF
18000
18001    PRI_MACROS_BROKEN=1
18002  else
18003    PRI_MACROS_BROKEN=0
18004  fi
18005
18006
18007
18008  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
18009$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
18010if ${gl_cv_cc_double_expbit0+:} false; then :
18011  $as_echo_n "(cached) " >&6
18012else
18013
18014      if test "$cross_compiling" = yes; then :
18015
18016                                                                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18017/* end confdefs.h.  */
18018
18019#if defined arm || defined __arm || defined __arm__
18020  mixed_endianness
18021#endif
18022
18023_ACEOF
18024if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18025  $EGREP "mixed_endianness" >/dev/null 2>&1; then :
18026  gl_cv_cc_double_expbit0="unknown"
18027else
18028
18029                                                         :
18030if ${ac_cv_c_bigendian+:} false; then :
18031  $as_echo_n "(cached) " >&6
18032else
18033  ac_cv_c_bigendian=unknown
18034    # See if we're dealing with a universal compiler.
18035    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18036/* end confdefs.h.  */
18037#ifndef __APPLE_CC__
18038	       not a universal capable compiler
18039	     #endif
18040	     typedef int dummy;
18041
18042_ACEOF
18043if ac_fn_c_try_compile "$LINENO"; then :
18044
18045	# Check for potential -arch flags.  It is not universal unless
18046	# there are at least two -arch flags with different values.
18047	ac_arch=
18048	ac_prev=
18049	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
18050	 if test -n "$ac_prev"; then
18051	   case $ac_word in
18052	     i?86 | x86_64 | ppc | ppc64)
18053	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
18054		 ac_arch=$ac_word
18055	       else
18056		 ac_cv_c_bigendian=universal
18057		 break
18058	       fi
18059	       ;;
18060	   esac
18061	   ac_prev=
18062	 elif test "x$ac_word" = "x-arch"; then
18063	   ac_prev=arch
18064	 fi
18065       done
18066fi
18067rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18068    if test $ac_cv_c_bigendian = unknown; then
18069      # See if sys/param.h defines the BYTE_ORDER macro.
18070      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18071/* end confdefs.h.  */
18072#include <sys/types.h>
18073	     #include <sys/param.h>
18074
18075int
18076main ()
18077{
18078#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
18079		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
18080		     && LITTLE_ENDIAN)
18081	      bogus endian macros
18082	     #endif
18083
18084  ;
18085  return 0;
18086}
18087_ACEOF
18088if ac_fn_c_try_compile "$LINENO"; then :
18089  # It does; now see whether it defined to BIG_ENDIAN or not.
18090	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18091/* end confdefs.h.  */
18092#include <sys/types.h>
18093		#include <sys/param.h>
18094
18095int
18096main ()
18097{
18098#if BYTE_ORDER != BIG_ENDIAN
18099		 not big endian
18100		#endif
18101
18102  ;
18103  return 0;
18104}
18105_ACEOF
18106if ac_fn_c_try_compile "$LINENO"; then :
18107  ac_cv_c_bigendian=yes
18108else
18109  ac_cv_c_bigendian=no
18110fi
18111rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18112fi
18113rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18114    fi
18115    if test $ac_cv_c_bigendian = unknown; then
18116      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
18117      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18118/* end confdefs.h.  */
18119#include <limits.h>
18120
18121int
18122main ()
18123{
18124#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
18125	      bogus endian macros
18126	     #endif
18127
18128  ;
18129  return 0;
18130}
18131_ACEOF
18132if ac_fn_c_try_compile "$LINENO"; then :
18133  # It does; now see whether it defined to _BIG_ENDIAN or not.
18134	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18135/* end confdefs.h.  */
18136#include <limits.h>
18137
18138int
18139main ()
18140{
18141#ifndef _BIG_ENDIAN
18142		 not big endian
18143		#endif
18144
18145  ;
18146  return 0;
18147}
18148_ACEOF
18149if ac_fn_c_try_compile "$LINENO"; then :
18150  ac_cv_c_bigendian=yes
18151else
18152  ac_cv_c_bigendian=no
18153fi
18154rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18155fi
18156rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18157    fi
18158    if test $ac_cv_c_bigendian = unknown; then
18159      # Compile a test program.
18160      if test "$cross_compiling" = yes; then :
18161  # Try to guess by grepping values from an object file.
18162	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18163/* end confdefs.h.  */
18164short int ascii_mm[] =
18165		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
18166		short int ascii_ii[] =
18167		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
18168		int use_ascii (int i) {
18169		  return ascii_mm[i] + ascii_ii[i];
18170		}
18171		short int ebcdic_ii[] =
18172		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
18173		short int ebcdic_mm[] =
18174		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
18175		int use_ebcdic (int i) {
18176		  return ebcdic_mm[i] + ebcdic_ii[i];
18177		}
18178		extern int foo;
18179
18180int
18181main ()
18182{
18183return use_ascii (foo) == use_ebcdic (foo);
18184  ;
18185  return 0;
18186}
18187_ACEOF
18188if ac_fn_c_try_compile "$LINENO"; then :
18189  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
18190	      ac_cv_c_bigendian=yes
18191	    fi
18192	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
18193	      if test "$ac_cv_c_bigendian" = unknown; then
18194		ac_cv_c_bigendian=no
18195	      else
18196		# finding both strings is unlikely to happen, but who knows?
18197		ac_cv_c_bigendian=unknown
18198	      fi
18199	    fi
18200fi
18201rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18202else
18203  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18204/* end confdefs.h.  */
18205$ac_includes_default
18206int
18207main ()
18208{
18209
18210	     /* Are we little or big endian?  From Harbison&Steele.  */
18211	     union
18212	     {
18213	       long int l;
18214	       char c[sizeof (long int)];
18215	     } u;
18216	     u.l = 1;
18217	     return u.c[sizeof (long int) - 1] == 1;
18218
18219  ;
18220  return 0;
18221}
18222_ACEOF
18223if ac_fn_c_try_run "$LINENO"; then :
18224  ac_cv_c_bigendian=no
18225else
18226  ac_cv_c_bigendian=yes
18227fi
18228rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18229  conftest.$ac_objext conftest.beam conftest.$ac_ext
18230fi
18231
18232    fi
18233fi
18234:
18235 case $ac_cv_c_bigendian in #(
18236   yes)
18237     gl_cv_cc_double_expbit0="word 0 bit 20";; #(
18238   no)
18239     gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
18240   universal)
18241
18242$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
18243
18244     ;; #(
18245   *)
18246     gl_cv_cc_double_expbit0="unknown" ;;
18247 esac
18248
18249
18250fi
18251rm -f conftest*
18252
18253
18254else
18255  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18256/* end confdefs.h.  */
18257
18258#include <float.h>
18259#include <stddef.h>
18260#include <stdio.h>
18261#include <string.h>
18262#define NWORDS \
18263  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
18264typedef union { double value; unsigned int word[NWORDS]; } memory_double;
18265static unsigned int ored_words[NWORDS];
18266static unsigned int anded_words[NWORDS];
18267static void add_to_ored_words (double x)
18268{
18269  memory_double m;
18270  size_t i;
18271  /* Clear it first, in case sizeof (double) < sizeof (memory_double).  */
18272  memset (&m, 0, sizeof (memory_double));
18273  m.value = x;
18274  for (i = 0; i < NWORDS; i++)
18275    {
18276      ored_words[i] |= m.word[i];
18277      anded_words[i] &= m.word[i];
18278    }
18279}
18280int main ()
18281{
18282  size_t j;
18283  FILE *fp = fopen ("conftest.out", "w");
18284  if (fp == NULL)
18285    return 1;
18286  for (j = 0; j < NWORDS; j++)
18287    anded_words[j] = ~ (unsigned int) 0;
18288  add_to_ored_words (0.25);
18289  add_to_ored_words (0.5);
18290  add_to_ored_words (1.0);
18291  add_to_ored_words (2.0);
18292  add_to_ored_words (4.0);
18293  /* Remove bits that are common (e.g. if representation of the first mantissa
18294     bit is explicit).  */
18295  for (j = 0; j < NWORDS; j++)
18296    ored_words[j] &= ~anded_words[j];
18297  /* Now find the nonzero word.  */
18298  for (j = 0; j < NWORDS; j++)
18299    if (ored_words[j] != 0)
18300      break;
18301  if (j < NWORDS)
18302    {
18303      size_t i;
18304      for (i = j + 1; i < NWORDS; i++)
18305        if (ored_words[i] != 0)
18306          {
18307            fprintf (fp, "unknown");
18308            return (fclose (fp) != 0);
18309          }
18310      for (i = 0; ; i++)
18311        if ((ored_words[j] >> i) & 1)
18312          {
18313            fprintf (fp, "word %d bit %d", (int) j, (int) i);
18314            return (fclose (fp) != 0);
18315          }
18316    }
18317  fprintf (fp, "unknown");
18318  return (fclose (fp) != 0);
18319}
18320
18321_ACEOF
18322if ac_fn_c_try_run "$LINENO"; then :
18323  gl_cv_cc_double_expbit0=`cat conftest.out`
18324else
18325  gl_cv_cc_double_expbit0="unknown"
18326fi
18327rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18328  conftest.$ac_objext conftest.beam conftest.$ac_ext
18329fi
18330
18331      rm -f conftest.out
18332
18333fi
18334{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
18335$as_echo "$gl_cv_cc_double_expbit0" >&6; }
18336  case "$gl_cv_cc_double_expbit0" in
18337    word*bit*)
18338      word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
18339      bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
18340
18341cat >>confdefs.h <<_ACEOF
18342#define DBL_EXPBIT0_WORD $word
18343_ACEOF
18344
18345
18346cat >>confdefs.h <<_ACEOF
18347#define DBL_EXPBIT0_BIT $bit
18348_ACEOF
18349
18350      ;;
18351  esac
18352
18353
18354  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
18355$as_echo_n "checking where to find the exponent in a 'float'... " >&6; }
18356if ${gl_cv_cc_float_expbit0+:} false; then :
18357  $as_echo_n "(cached) " >&6
18358else
18359
18360      if test "$cross_compiling" = yes; then :
18361  gl_cv_cc_float_expbit0="word 0 bit 23"
18362else
18363  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18364/* end confdefs.h.  */
18365
18366#include <float.h>
18367#include <stddef.h>
18368#include <stdio.h>
18369#include <string.h>
18370#define NWORDS \
18371  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
18372typedef union { float value; unsigned int word[NWORDS]; } memory_float;
18373static unsigned int ored_words[NWORDS];
18374static unsigned int anded_words[NWORDS];
18375static void add_to_ored_words (float x)
18376{
18377  memory_float m;
18378  size_t i;
18379  /* Clear it first, in case
18380     sizeof (float) < sizeof (memory_float).  */
18381  memset (&m, 0, sizeof (memory_float));
18382  m.value = x;
18383  for (i = 0; i < NWORDS; i++)
18384    {
18385      ored_words[i] |= m.word[i];
18386      anded_words[i] &= m.word[i];
18387    }
18388}
18389int main ()
18390{
18391  size_t j;
18392  FILE *fp = fopen ("conftest.out", "w");
18393  if (fp == NULL)
18394    return 1;
18395  for (j = 0; j < NWORDS; j++)
18396    anded_words[j] = ~ (unsigned int) 0;
18397  add_to_ored_words (0.25f);
18398  add_to_ored_words (0.5f);
18399  add_to_ored_words (1.0f);
18400  add_to_ored_words (2.0f);
18401  add_to_ored_words (4.0f);
18402  /* Remove bits that are common (e.g. if representation of the first mantissa
18403     bit is explicit).  */
18404  for (j = 0; j < NWORDS; j++)
18405    ored_words[j] &= ~anded_words[j];
18406  /* Now find the nonzero word.  */
18407  for (j = 0; j < NWORDS; j++)
18408    if (ored_words[j] != 0)
18409      break;
18410  if (j < NWORDS)
18411    {
18412      size_t i;
18413      for (i = j + 1; i < NWORDS; i++)
18414        if (ored_words[i] != 0)
18415          {
18416            fprintf (fp, "unknown");
18417            return (fclose (fp) != 0);
18418          }
18419      for (i = 0; ; i++)
18420        if ((ored_words[j] >> i) & 1)
18421          {
18422            fprintf (fp, "word %d bit %d", (int) j, (int) i);
18423            return (fclose (fp) != 0);
18424          }
18425    }
18426  fprintf (fp, "unknown");
18427  return (fclose (fp) != 0);
18428}
18429
18430_ACEOF
18431if ac_fn_c_try_run "$LINENO"; then :
18432  gl_cv_cc_float_expbit0=`cat conftest.out`
18433else
18434  gl_cv_cc_float_expbit0="unknown"
18435fi
18436rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18437  conftest.$ac_objext conftest.beam conftest.$ac_ext
18438fi
18439
18440      rm -f conftest.out
18441
18442fi
18443{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
18444$as_echo "$gl_cv_cc_float_expbit0" >&6; }
18445  case "$gl_cv_cc_float_expbit0" in
18446    word*bit*)
18447      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
18448      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
18449
18450cat >>confdefs.h <<_ACEOF
18451#define FLT_EXPBIT0_WORD $word
18452_ACEOF
18453
18454
18455cat >>confdefs.h <<_ACEOF
18456#define FLT_EXPBIT0_BIT $bit
18457_ACEOF
18458
18459      ;;
18460  esac
18461
18462
18463  GNULIB_ISWBLANK=0;
18464  GNULIB_WCTYPE=0;
18465  GNULIB_ISWCTYPE=0;
18466  GNULIB_WCTRANS=0;
18467  GNULIB_TOWCTRANS=0;
18468    HAVE_ISWBLANK=1;
18469  HAVE_WCTYPE_T=1;
18470  HAVE_WCTRANS_T=1;
18471  REPLACE_ISWBLANK=0;
18472
18473
18474
18475
18476
18477
18478
18479  if test $ac_cv_header_crtdefs_h = yes; then
18480    HAVE_CRTDEFS_H=1
18481  else
18482    HAVE_CRTDEFS_H=0
18483  fi
18484
18485
18486
18487
18488
18489
18490
18491  if test $ac_cv_func_iswcntrl = yes; then
18492    HAVE_ISWCNTRL=1
18493  else
18494    HAVE_ISWCNTRL=0
18495  fi
18496
18497
18498
18499  if test $gt_cv_c_wint_t = yes; then
18500    HAVE_WINT_T=1
18501  else
18502    HAVE_WINT_T=0
18503  fi
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517     if test $gl_cv_have_include_next = yes; then
18518       gl_cv_next_wctype_h='<'wctype.h'>'
18519     else
18520       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
18521$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
18522if ${gl_cv_next_wctype_h+:} false; then :
18523  $as_echo_n "(cached) " >&6
18524else
18525
18526             if test $ac_cv_header_wctype_h = yes; then
18527
18528
18529
18530
18531  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18532/* end confdefs.h.  */
18533#include <wctype.h>
18534_ACEOF
18535                case "$host_os" in
18536    aix*) gl_absname_cpp="$ac_cpp -C" ;;
18537    *)    gl_absname_cpp="$ac_cpp" ;;
18538  esac
18539
18540  case "$host_os" in
18541    mingw*)
18542                                          gl_dirsep_regex='[/\\]'
18543      ;;
18544    *)
18545      gl_dirsep_regex='\/'
18546      ;;
18547  esac
18548      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18549  gl_header_literal_regex=`echo 'wctype.h' \
18550                           | sed -e "$gl_make_literal_regex_sed"`
18551  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18552      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18553      s|^/[^/]|//&|
18554      p
18555      q
18556    }'
18557
18558        gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18559  sed -n "$gl_absolute_header_sed"`
18560
18561           gl_header=$gl_cv_absolute_wctype_h
18562           gl_cv_next_wctype_h='"'$gl_header'"'
18563          else
18564               gl_cv_next_wctype_h='<'wctype.h'>'
18565             fi
18566
18567
18568fi
18569{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
18570$as_echo "$gl_cv_next_wctype_h" >&6; }
18571     fi
18572     NEXT_WCTYPE_H=$gl_cv_next_wctype_h
18573
18574     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18575       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18576       gl_next_as_first_directive='<'wctype.h'>'
18577     else
18578       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
18579       gl_next_as_first_directive=$gl_cv_next_wctype_h
18580     fi
18581     NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
18582
18583
18584
18585
18586  if test $ac_cv_header_wctype_h = yes; then
18587    if test $ac_cv_func_iswcntrl = yes; then
18588                  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
18589$as_echo_n "checking whether iswcntrl works... " >&6; }
18590if ${gl_cv_func_iswcntrl_works+:} false; then :
18591  $as_echo_n "(cached) " >&6
18592else
18593
18594          if test "$cross_compiling" = yes; then :
18595               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18596/* end confdefs.h.  */
18597#include <stdlib.h>
18598                          #if __GNU_LIBRARY__ == 1
18599                          Linux libc5 i18n is broken.
18600                          #endif
18601int
18602main ()
18603{
18604
18605  ;
18606  return 0;
18607}
18608_ACEOF
18609if ac_fn_c_try_compile "$LINENO"; then :
18610  gl_cv_func_iswcntrl_works="guessing yes"
18611else
18612  gl_cv_func_iswcntrl_works="guessing no"
18613fi
18614rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18615
18616else
18617  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18618/* end confdefs.h.  */
18619
18620               /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
18621                  included before <wchar.h>.
18622                  BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
18623                  must be included before <wchar.h>.  */
18624               #include <stddef.h>
18625               #include <stdio.h>
18626               #include <time.h>
18627               #include <wchar.h>
18628               #include <wctype.h>
18629               int main () { return iswprint ('x') == 0; }
18630
18631_ACEOF
18632if ac_fn_c_try_run "$LINENO"; then :
18633  gl_cv_func_iswcntrl_works=yes
18634else
18635  gl_cv_func_iswcntrl_works=no
18636fi
18637rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18638  conftest.$ac_objext conftest.beam conftest.$ac_ext
18639fi
18640
18641
18642fi
18643{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
18644$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
18645    fi
18646    HAVE_WCTYPE_H=1
18647  else
18648    HAVE_WCTYPE_H=0
18649  fi
18650
18651
18652  case "$gl_cv_func_iswcntrl_works" in
18653    *yes) REPLACE_ISWCNTRL=0 ;;
18654    *)    REPLACE_ISWCNTRL=1 ;;
18655  esac
18656
18657
18658  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
18659        :
18660  fi
18661
18662  if test $REPLACE_ISWCNTRL = 1; then
18663    REPLACE_TOWLOWER=1
18664  else
18665    for ac_func in towlower
18666do :
18667  ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
18668if test "x$ac_cv_func_towlower" = xyes; then :
18669  cat >>confdefs.h <<_ACEOF
18670#define HAVE_TOWLOWER 1
18671_ACEOF
18672
18673fi
18674done
18675
18676    if test $ac_cv_func_towlower = yes; then
18677      REPLACE_TOWLOWER=0
18678    else
18679      ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
18680             included before <wchar.h>.
18681             BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
18682             must be included before <wchar.h>.  */
18683          #include <stddef.h>
18684          #include <stdio.h>
18685          #include <time.h>
18686          #include <wchar.h>
18687          #if HAVE_WCTYPE_H
18688          # include <wctype.h>
18689          #endif
18690
18691"
18692if test "x$ac_cv_have_decl_towlower" = xyes; then :
18693  ac_have_decl=1
18694else
18695  ac_have_decl=0
18696fi
18697
18698cat >>confdefs.h <<_ACEOF
18699#define HAVE_DECL_TOWLOWER $ac_have_decl
18700_ACEOF
18701
18702      if test $ac_cv_have_decl_towlower = yes; then
18703                                REPLACE_TOWLOWER=1
18704      else
18705        REPLACE_TOWLOWER=0
18706      fi
18707    fi
18708  fi
18709
18710
18711  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
18712        :
18713  fi
18714
18715          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
18716$as_echo_n "checking for wctype_t... " >&6; }
18717if ${gl_cv_type_wctype_t+:} false; then :
18718  $as_echo_n "(cached) " >&6
18719else
18720  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18721/* end confdefs.h.  */
18722/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
18723               included before <wchar.h>.
18724               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
18725               must be included before <wchar.h>.  */
18726            #include <stddef.h>
18727            #include <stdio.h>
18728            #include <time.h>
18729            #include <wchar.h>
18730            #if HAVE_WCTYPE_H
18731            # include <wctype.h>
18732            #endif
18733            wctype_t a;
18734
18735int
18736main ()
18737{
18738
18739  ;
18740  return 0;
18741}
18742_ACEOF
18743if ac_fn_c_try_compile "$LINENO"; then :
18744  gl_cv_type_wctype_t=yes
18745else
18746  gl_cv_type_wctype_t=no
18747fi
18748rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18749
18750fi
18751{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
18752$as_echo "$gl_cv_type_wctype_t" >&6; }
18753  if test $gl_cv_type_wctype_t = no; then
18754    HAVE_WCTYPE_T=0
18755  fi
18756
18757      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
18758$as_echo_n "checking for wctrans_t... " >&6; }
18759if ${gl_cv_type_wctrans_t+:} false; then :
18760  $as_echo_n "(cached) " >&6
18761else
18762  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18763/* end confdefs.h.  */
18764/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
18765               included before <wchar.h>.
18766               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
18767               must be included before <wchar.h>.  */
18768            #include <stddef.h>
18769            #include <stdio.h>
18770            #include <time.h>
18771            #include <wchar.h>
18772            #include <wctype.h>
18773            wctrans_t a;
18774
18775int
18776main ()
18777{
18778
18779  ;
18780  return 0;
18781}
18782_ACEOF
18783if ac_fn_c_try_compile "$LINENO"; then :
18784  gl_cv_type_wctrans_t=yes
18785else
18786  gl_cv_type_wctrans_t=no
18787fi
18788rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18789
18790fi
18791{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
18792$as_echo "$gl_cv_type_wctrans_t" >&6; }
18793  if test $gl_cv_type_wctrans_t = no; then
18794    HAVE_WCTRANS_T=0
18795  fi
18796
18797
18798
18799
18800
18801
18802  GNULIB_NL_LANGINFO=0;
18803    HAVE_NL_LANGINFO=1;
18804  REPLACE_NL_LANGINFO=0;
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815  GNULIB_LOCALECONV=0;
18816  GNULIB_SETLOCALE=0;
18817  GNULIB_DUPLOCALE=0;
18818    HAVE_DUPLOCALE=1;
18819  REPLACE_LOCALECONV=0;
18820  REPLACE_SETLOCALE=0;
18821  REPLACE_DUPLOCALE=0;
18822  REPLACE_STRUCT_LCONV=0;
18823
18824
18825    REPLACE_NULL=0;
18826  HAVE_MAX_ALIGN_T=1;
18827  HAVE_WCHAR_T=1;
18828
18829
18830  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
18831$as_echo_n "checking for wchar_t... " >&6; }
18832if ${gt_cv_c_wchar_t+:} false; then :
18833  $as_echo_n "(cached) " >&6
18834else
18835  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18836/* end confdefs.h.  */
18837#include <stddef.h>
18838            wchar_t foo = (wchar_t)'\0';
18839int
18840main ()
18841{
18842
18843  ;
18844  return 0;
18845}
18846_ACEOF
18847if ac_fn_c_try_compile "$LINENO"; then :
18848  gt_cv_c_wchar_t=yes
18849else
18850  gt_cv_c_wchar_t=no
18851fi
18852rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18853fi
18854{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
18855$as_echo "$gt_cv_c_wchar_t" >&6; }
18856  if test $gt_cv_c_wchar_t = yes; then
18857
18858$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
18859
18860  fi
18861
18862
18863
18864
18865  STDDEF_H=
18866  ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h>
18867
18868"
18869if test "x$ac_cv_type_max_align_t" = xyes; then :
18870
18871else
18872  HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h
18873fi
18874
18875  if test $gt_cv_c_wchar_t = no; then
18876    HAVE_WCHAR_T=0
18877    STDDEF_H=stddef.h
18878  fi
18879  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
18880$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
18881if ${gl_cv_decl_null_works+:} false; then :
18882  $as_echo_n "(cached) " >&6
18883else
18884  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18885/* end confdefs.h.  */
18886#include <stddef.h>
18887      int test[2 * (sizeof NULL == sizeof (void *)) -1];
18888
18889int
18890main ()
18891{
18892
18893  ;
18894  return 0;
18895}
18896_ACEOF
18897if ac_fn_c_try_compile "$LINENO"; then :
18898  gl_cv_decl_null_works=yes
18899else
18900  gl_cv_decl_null_works=no
18901fi
18902rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18903fi
18904{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
18905$as_echo "$gl_cv_decl_null_works" >&6; }
18906  if test $gl_cv_decl_null_works = no; then
18907    REPLACE_NULL=1
18908    STDDEF_H=stddef.h
18909  fi
18910
18911   if test -n "$STDDEF_H"; then
18912  GL_GENERATE_STDDEF_H_TRUE=
18913  GL_GENERATE_STDDEF_H_FALSE='#'
18914else
18915  GL_GENERATE_STDDEF_H_TRUE='#'
18916  GL_GENERATE_STDDEF_H_FALSE=
18917fi
18918
18919  if test -n "$STDDEF_H"; then
18920
18921
18922
18923
18924
18925
18926
18927
18928     if test $gl_cv_have_include_next = yes; then
18929       gl_cv_next_stddef_h='<'stddef.h'>'
18930     else
18931       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
18932$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
18933if ${gl_cv_next_stddef_h+:} false; then :
18934  $as_echo_n "(cached) " >&6
18935else
18936
18937
18938
18939  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18940/* end confdefs.h.  */
18941#include <stddef.h>
18942_ACEOF
18943                case "$host_os" in
18944    aix*) gl_absname_cpp="$ac_cpp -C" ;;
18945    *)    gl_absname_cpp="$ac_cpp" ;;
18946  esac
18947
18948  case "$host_os" in
18949    mingw*)
18950                                          gl_dirsep_regex='[/\\]'
18951      ;;
18952    *)
18953      gl_dirsep_regex='\/'
18954      ;;
18955  esac
18956      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
18957  gl_header_literal_regex=`echo 'stddef.h' \
18958                           | sed -e "$gl_make_literal_regex_sed"`
18959  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
18960      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
18961      s|^/[^/]|//&|
18962      p
18963      q
18964    }'
18965
18966        gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
18967  sed -n "$gl_absolute_header_sed"`
18968
18969           gl_header=$gl_cv_absolute_stddef_h
18970           gl_cv_next_stddef_h='"'$gl_header'"'
18971
18972
18973fi
18974{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
18975$as_echo "$gl_cv_next_stddef_h" >&6; }
18976     fi
18977     NEXT_STDDEF_H=$gl_cv_next_stddef_h
18978
18979     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
18980       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
18981       gl_next_as_first_directive='<'stddef.h'>'
18982     else
18983       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
18984       gl_next_as_first_directive=$gl_cv_next_stddef_h
18985     fi
18986     NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
18987
18988
18989
18990
18991  fi
18992
18993
18994
18995  gl_threads_api=none
18996  LIBTHREAD=
18997  LTLIBTHREAD=
18998  LIBMULTITHREAD=
18999  LTLIBMULTITHREAD=
19000  if test "$gl_use_threads" != no; then
19001        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
19002$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
19003if ${gl_cv_have_weak+:} false; then :
19004  $as_echo_n "(cached) " >&6
19005else
19006  gl_cv_have_weak=no
19007              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19008/* end confdefs.h.  */
19009extern void xyzzy ();
19010#pragma weak xyzzy
19011int
19012main ()
19013{
19014xyzzy();
19015  ;
19016  return 0;
19017}
19018_ACEOF
19019if ac_fn_c_try_link "$LINENO"; then :
19020  gl_cv_have_weak=maybe
19021fi
19022rm -f core conftest.err conftest.$ac_objext \
19023    conftest$ac_exeext conftest.$ac_ext
19024       if test $gl_cv_have_weak = maybe; then
19025                           if test "$cross_compiling" = yes; then :
19026                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19027/* end confdefs.h.  */
19028#ifdef __ELF__
19029               Extensible Linking Format
19030               #endif
19031
19032_ACEOF
19033if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19034  $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
19035  gl_cv_have_weak="guessing yes"
19036else
19037  gl_cv_have_weak="guessing no"
19038fi
19039rm -f conftest*
19040
19041
19042else
19043  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19044/* end confdefs.h.  */
19045
19046#include <stdio.h>
19047#pragma weak fputs
19048int main ()
19049{
19050  return (fputs == NULL);
19051}
19052_ACEOF
19053if ac_fn_c_try_run "$LINENO"; then :
19054  gl_cv_have_weak=yes
19055else
19056  gl_cv_have_weak=no
19057fi
19058rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19059  conftest.$ac_objext conftest.beam conftest.$ac_ext
19060fi
19061
19062       fi
19063              case " $LDFLAGS " in
19064         *" -static "*) gl_cv_have_weak=no ;;
19065       esac
19066
19067fi
19068{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
19069$as_echo "$gl_cv_have_weak" >&6; }
19070            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker supports --as-needed" >&5
19071$as_echo_n "checking whether the linker supports --as-needed... " >&6; }
19072if ${gl_cv_linker_have_as_needed+:} false; then :
19073  $as_echo_n "(cached) " >&6
19074else
19075  if test -n "$GCC"; then
19076         gl_saved_ldflags="$LDFLAGS"
19077         LDFLAGS="$gl_saved_ldflags -Wl,--as-needed -Wl,--no-as-needed"
19078         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19079/* end confdefs.h.  */
19080
19081int
19082main ()
19083{
19084
19085  ;
19086  return 0;
19087}
19088_ACEOF
19089if ac_fn_c_try_link "$LINENO"; then :
19090  gl_cv_linker_have_as_needed=yes
19091else
19092  gl_cv_linker_have_as_needed=no
19093fi
19094rm -f core conftest.err conftest.$ac_objext \
19095    conftest$ac_exeext conftest.$ac_ext
19096         LDFLAGS="$gl_saved_ldflags"
19097       else
19098         gl_cv_linker_have_as_needed=no
19099       fi
19100
19101fi
19102{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_linker_have_as_needed" >&5
19103$as_echo "$gl_cv_linker_have_as_needed" >&6; }
19104            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker supports --push-state" >&5
19105$as_echo_n "checking whether the linker supports --push-state... " >&6; }
19106if ${gl_cv_linker_have_push_state+:} false; then :
19107  $as_echo_n "(cached) " >&6
19108else
19109  if test -n "$GCC"; then
19110         gl_saved_ldflags="$LDFLAGS"
19111         LDFLAGS="$gl_saved_ldflags -Wl,--push-state -Wl,--pop-state"
19112         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19113/* end confdefs.h.  */
19114
19115int
19116main ()
19117{
19118
19119  ;
19120  return 0;
19121}
19122_ACEOF
19123if ac_fn_c_try_link "$LINENO"; then :
19124  gl_cv_linker_have_push_state=yes
19125else
19126  gl_cv_linker_have_push_state=no
19127fi
19128rm -f core conftest.err conftest.$ac_objext \
19129    conftest$ac_exeext conftest.$ac_ext
19130         LDFLAGS="$gl_saved_ldflags"
19131       else
19132         gl_cv_linker_have_push_state=no
19133       fi
19134
19135fi
19136{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_linker_have_push_state" >&5
19137$as_echo "$gl_cv_linker_have_push_state" >&6; }
19138    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
19139      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
19140      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
19141      ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
19142if test "x$ac_cv_header_pthread_h" = xyes; then :
19143  gl_have_pthread_h=yes
19144else
19145  gl_have_pthread_h=no
19146fi
19147
19148
19149      if test "$gl_have_pthread_h" = yes; then
19150        # Other possible tests:
19151        #   -lpthreads (FSU threads, PCthreads)
19152        #   -lgthreads
19153        gl_have_pthread=
19154        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
19155        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
19156        # the second one only in libpthread, and lock.c needs it.
19157        #
19158        # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
19159        # needs -pthread for some reason.  See:
19160        # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
19161        save_LIBS=$LIBS
19162        for gl_pthread in '' '-pthread'; do
19163          LIBS="$LIBS $gl_pthread"
19164          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19165/* end confdefs.h.  */
19166#include <pthread.h>
19167                 pthread_mutex_t m;
19168                 pthread_mutexattr_t ma;
19169
19170int
19171main ()
19172{
19173pthread_mutex_lock (&m);
19174                 pthread_mutexattr_init (&ma);
19175  ;
19176  return 0;
19177}
19178_ACEOF
19179if ac_fn_c_try_link "$LINENO"; then :
19180  gl_have_pthread=yes
19181             LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread
19182             LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread
19183fi
19184rm -f core conftest.err conftest.$ac_objext \
19185    conftest$ac_exeext conftest.$ac_ext
19186          LIBS=$save_LIBS
19187          test -n "$gl_have_pthread" && break
19188        done
19189
19190        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
19191        # since it is defined as a macro on OSF/1.)
19192        if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then
19193          # The program links fine without libpthread. But it may actually
19194          # need to link with libpthread in order to create multiple threads.
19195          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
19196$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
19197if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
19198  $as_echo_n "(cached) " >&6
19199else
19200  ac_check_lib_save_LIBS=$LIBS
19201LIBS="-lpthread  $LIBS"
19202cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19203/* end confdefs.h.  */
19204
19205/* Override any GCC internal prototype to avoid an error.
19206   Use char because int might match the return type of a GCC
19207   builtin and then its argument prototype would still apply.  */
19208#ifdef __cplusplus
19209extern "C"
19210#endif
19211char pthread_kill ();
19212int
19213main ()
19214{
19215return pthread_kill ();
19216  ;
19217  return 0;
19218}
19219_ACEOF
19220if ac_fn_c_try_link "$LINENO"; then :
19221  ac_cv_lib_pthread_pthread_kill=yes
19222else
19223  ac_cv_lib_pthread_pthread_kill=no
19224fi
19225rm -f core conftest.err conftest.$ac_objext \
19226    conftest$ac_exeext conftest.$ac_ext
19227LIBS=$ac_check_lib_save_LIBS
19228fi
19229{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
19230$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
19231if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
19232  LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
19233             # On Solaris and HP-UX, most pthread functions exist also in libc.
19234             # Therefore pthread_in_use() needs to actually try to create a
19235             # thread: pthread_create from libc will fail, whereas
19236             # pthread_create will actually create a thread.
19237             # On Solaris 10 or newer, this test is no longer needed, because
19238             # libc contains the fully functional pthread functions.
19239             case "$host_os" in
19240               solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
19241
19242$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
19243
19244             esac
19245
19246fi
19247
19248        elif test -z "$gl_have_pthread"; then
19249          # Some library is needed. Try libpthread and libc_r.
19250          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
19251$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
19252if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
19253  $as_echo_n "(cached) " >&6
19254else
19255  ac_check_lib_save_LIBS=$LIBS
19256LIBS="-lpthread  $LIBS"
19257cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19258/* end confdefs.h.  */
19259
19260/* Override any GCC internal prototype to avoid an error.
19261   Use char because int might match the return type of a GCC
19262   builtin and then its argument prototype would still apply.  */
19263#ifdef __cplusplus
19264extern "C"
19265#endif
19266char pthread_kill ();
19267int
19268main ()
19269{
19270return pthread_kill ();
19271  ;
19272  return 0;
19273}
19274_ACEOF
19275if ac_fn_c_try_link "$LINENO"; then :
19276  ac_cv_lib_pthread_pthread_kill=yes
19277else
19278  ac_cv_lib_pthread_pthread_kill=no
19279fi
19280rm -f core conftest.err conftest.$ac_objext \
19281    conftest$ac_exeext conftest.$ac_ext
19282LIBS=$ac_check_lib_save_LIBS
19283fi
19284{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
19285$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
19286if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
19287  gl_have_pthread=yes
19288             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
19289             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
19290fi
19291
19292          if test -z "$gl_have_pthread"; then
19293            # For FreeBSD 4.
19294            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
19295$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
19296if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
19297  $as_echo_n "(cached) " >&6
19298else
19299  ac_check_lib_save_LIBS=$LIBS
19300LIBS="-lc_r  $LIBS"
19301cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19302/* end confdefs.h.  */
19303
19304/* Override any GCC internal prototype to avoid an error.
19305   Use char because int might match the return type of a GCC
19306   builtin and then its argument prototype would still apply.  */
19307#ifdef __cplusplus
19308extern "C"
19309#endif
19310char pthread_kill ();
19311int
19312main ()
19313{
19314return pthread_kill ();
19315  ;
19316  return 0;
19317}
19318_ACEOF
19319if ac_fn_c_try_link "$LINENO"; then :
19320  ac_cv_lib_c_r_pthread_kill=yes
19321else
19322  ac_cv_lib_c_r_pthread_kill=no
19323fi
19324rm -f core conftest.err conftest.$ac_objext \
19325    conftest$ac_exeext conftest.$ac_ext
19326LIBS=$ac_check_lib_save_LIBS
19327fi
19328{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
19329$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
19330if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
19331  gl_have_pthread=yes
19332               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
19333               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r
19334fi
19335
19336          fi
19337        fi
19338        if test -n "$gl_have_pthread"; then
19339          gl_threads_api=posix
19340
19341$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
19342
19343          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
19344            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
19345
19346$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
19347
19348              LIBTHREAD=
19349              LTLIBTHREAD=
19350                                                                      case "$LIBMULTITHREAD" in
19351                "") ;;
19352                -pthread)
19353                  if test $gl_cv_linker_have_as_needed = yes; then
19354                    if test $gl_cv_linker_have_push_state = yes; then
19355                      LIBMULTITHREAD="$LIBMULTITHREAD -Wl,--push-state -Wl,--no-as-needed -lpthread -Wl,--pop-state"
19356                    else
19357                      LIBMULTITHREAD="$LIBMULTITHREAD -Wl,--no-as-needed -lpthread"
19358                    fi
19359                  fi
19360                  ;;
19361                *)
19362                  if test $gl_cv_linker_have_as_needed = yes; then
19363                    if test $gl_cv_linker_have_push_state = yes; then
19364                      LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
19365                    else
19366                      LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
19367                    fi
19368                  fi
19369                  ;;
19370              esac
19371              # TODO: May need to modify LTLIBMULTITHREAD similarly.
19372            fi
19373          fi
19374        fi
19375      fi
19376    fi
19377    if test -z "$gl_have_pthread"; then
19378      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
19379        gl_have_solaristhread=
19380        gl_save_LIBS="$LIBS"
19381        LIBS="$LIBS -lthread"
19382        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19383/* end confdefs.h.  */
19384
19385#include <thread.h>
19386#include <synch.h>
19387
19388int
19389main ()
19390{
19391thr_self();
19392  ;
19393  return 0;
19394}
19395_ACEOF
19396if ac_fn_c_try_link "$LINENO"; then :
19397  gl_have_solaristhread=yes
19398fi
19399rm -f core conftest.err conftest.$ac_objext \
19400    conftest$ac_exeext conftest.$ac_ext
19401        LIBS="$gl_save_LIBS"
19402        if test -n "$gl_have_solaristhread"; then
19403          gl_threads_api=solaris
19404          LIBTHREAD=-lthread
19405          LTLIBTHREAD=-lthread
19406          LIBMULTITHREAD="$LIBTHREAD"
19407          LTLIBMULTITHREAD="$LTLIBTHREAD"
19408
19409$as_echo "#define USE_SOLARIS_THREADS 1" >>confdefs.h
19410
19411          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
19412
19413$as_echo "#define USE_SOLARIS_THREADS_WEAK 1" >>confdefs.h
19414
19415            LIBTHREAD=
19416            LTLIBTHREAD=
19417                                                            if test $gl_cv_linker_have_as_needed = yes; then
19418              if test $gl_cv_linker_have_push_state = yes; then
19419                LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
19420              else
19421                LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
19422              fi
19423            fi
19424            # TODO: May need to modify LTLIBMULTITHREAD similarly.
19425          fi
19426        fi
19427      fi
19428    fi
19429    if test "$gl_use_threads" = pth; then
19430      gl_save_CPPFLAGS="$CPPFLAGS"
19431
19432
19433
19434
19435
19436  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libpth" >&5
19437$as_echo_n "checking how to link with libpth... " >&6; }
19438if ${ac_cv_libpth_libs+:} false; then :
19439  $as_echo_n "(cached) " >&6
19440else
19441
19442
19443
19444
19445
19446
19447
19448
19449    use_additional=yes
19450
19451  acl_save_prefix="$prefix"
19452  prefix="$acl_final_prefix"
19453  acl_save_exec_prefix="$exec_prefix"
19454  exec_prefix="$acl_final_exec_prefix"
19455
19456    eval additional_includedir=\"$includedir\"
19457    eval additional_libdir=\"$libdir\"
19458
19459  exec_prefix="$acl_save_exec_prefix"
19460  prefix="$acl_save_prefix"
19461
19462
19463# Check whether --with-libpth-prefix was given.
19464if test "${with_libpth_prefix+set}" = set; then :
19465  withval=$with_libpth_prefix;
19466    if test "X$withval" = "Xno"; then
19467      use_additional=no
19468    else
19469      if test "X$withval" = "X"; then
19470
19471  acl_save_prefix="$prefix"
19472  prefix="$acl_final_prefix"
19473  acl_save_exec_prefix="$exec_prefix"
19474  exec_prefix="$acl_final_exec_prefix"
19475
19476          eval additional_includedir=\"$includedir\"
19477          eval additional_libdir=\"$libdir\"
19478
19479  exec_prefix="$acl_save_exec_prefix"
19480  prefix="$acl_save_prefix"
19481
19482      else
19483        additional_includedir="$withval/include"
19484        additional_libdir="$withval/$acl_libdirstem"
19485        if test "$acl_libdirstem2" != "$acl_libdirstem" \
19486           && test ! -d "$withval/$acl_libdirstem"; then
19487          additional_libdir="$withval/$acl_libdirstem2"
19488        fi
19489      fi
19490    fi
19491
19492fi
19493
19494      LIBPTH=
19495  LTLIBPTH=
19496  INCPTH=
19497  LIBPTH_PREFIX=
19498      HAVE_LIBPTH=
19499  rpathdirs=
19500  ltrpathdirs=
19501  names_already_handled=
19502  names_next_round='pth '
19503  while test -n "$names_next_round"; do
19504    names_this_round="$names_next_round"
19505    names_next_round=
19506    for name in $names_this_round; do
19507      already_handled=
19508      for n in $names_already_handled; do
19509        if test "$n" = "$name"; then
19510          already_handled=yes
19511          break
19512        fi
19513      done
19514      if test -z "$already_handled"; then
19515        names_already_handled="$names_already_handled $name"
19516                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
19517        eval value=\"\$HAVE_LIB$uppername\"
19518        if test -n "$value"; then
19519          if test "$value" = yes; then
19520            eval value=\"\$LIB$uppername\"
19521            test -z "$value" || LIBPTH="${LIBPTH}${LIBPTH:+ }$value"
19522            eval value=\"\$LTLIB$uppername\"
19523            test -z "$value" || LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$value"
19524          else
19525                                    :
19526          fi
19527        else
19528                              found_dir=
19529          found_la=
19530          found_so=
19531          found_a=
19532          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
19533          if test -n "$acl_shlibext"; then
19534            shrext=".$acl_shlibext"             # typically: shrext=.so
19535          else
19536            shrext=
19537          fi
19538          if test $use_additional = yes; then
19539            dir="$additional_libdir"
19540                                    if test -n "$acl_shlibext"; then
19541              if test -f "$dir/$libname$shrext"; then
19542                found_dir="$dir"
19543                found_so="$dir/$libname$shrext"
19544              else
19545                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
19546                  ver=`(cd "$dir" && \
19547                        for f in "$libname$shrext".*; do echo "$f"; done \
19548                        | sed -e "s,^$libname$shrext\\\\.,," \
19549                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
19550                        | sed 1q ) 2>/dev/null`
19551                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
19552                    found_dir="$dir"
19553                    found_so="$dir/$libname$shrext.$ver"
19554                  fi
19555                else
19556                  eval library_names=\"$acl_library_names_spec\"
19557                  for f in $library_names; do
19558                    if test -f "$dir/$f"; then
19559                      found_dir="$dir"
19560                      found_so="$dir/$f"
19561                      break
19562                    fi
19563                  done
19564                fi
19565              fi
19566            fi
19567                        if test "X$found_dir" = "X"; then
19568              if test -f "$dir/$libname.$acl_libext"; then
19569                found_dir="$dir"
19570                found_a="$dir/$libname.$acl_libext"
19571              fi
19572            fi
19573            if test "X$found_dir" != "X"; then
19574              if test -f "$dir/$libname.la"; then
19575                found_la="$dir/$libname.la"
19576              fi
19577            fi
19578          fi
19579          if test "X$found_dir" = "X"; then
19580            for x in $LDFLAGS $LTLIBPTH; do
19581
19582  acl_save_prefix="$prefix"
19583  prefix="$acl_final_prefix"
19584  acl_save_exec_prefix="$exec_prefix"
19585  exec_prefix="$acl_final_exec_prefix"
19586  eval x=\"$x\"
19587  exec_prefix="$acl_save_exec_prefix"
19588  prefix="$acl_save_prefix"
19589
19590              case "$x" in
19591                -L*)
19592                  dir=`echo "X$x" | sed -e 's/^X-L//'`
19593                                    if test -n "$acl_shlibext"; then
19594                    if test -f "$dir/$libname$shrext"; then
19595                      found_dir="$dir"
19596                      found_so="$dir/$libname$shrext"
19597                    else
19598                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
19599                        ver=`(cd "$dir" && \
19600                              for f in "$libname$shrext".*; do echo "$f"; done \
19601                              | sed -e "s,^$libname$shrext\\\\.,," \
19602                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
19603                              | sed 1q ) 2>/dev/null`
19604                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
19605                          found_dir="$dir"
19606                          found_so="$dir/$libname$shrext.$ver"
19607                        fi
19608                      else
19609                        eval library_names=\"$acl_library_names_spec\"
19610                        for f in $library_names; do
19611                          if test -f "$dir/$f"; then
19612                            found_dir="$dir"
19613                            found_so="$dir/$f"
19614                            break
19615                          fi
19616                        done
19617                      fi
19618                    fi
19619                  fi
19620                                    if test "X$found_dir" = "X"; then
19621                    if test -f "$dir/$libname.$acl_libext"; then
19622                      found_dir="$dir"
19623                      found_a="$dir/$libname.$acl_libext"
19624                    fi
19625                  fi
19626                  if test "X$found_dir" != "X"; then
19627                    if test -f "$dir/$libname.la"; then
19628                      found_la="$dir/$libname.la"
19629                    fi
19630                  fi
19631                  ;;
19632              esac
19633              if test "X$found_dir" != "X"; then
19634                break
19635              fi
19636            done
19637          fi
19638          if test "X$found_dir" != "X"; then
19639                        LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$found_dir -l$name"
19640            if test "X$found_so" != "X"; then
19641                                                        if test "$enable_rpath" = no \
19642                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
19643                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
19644                                LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
19645              else
19646                                                                                haveit=
19647                for x in $ltrpathdirs; do
19648                  if test "X$x" = "X$found_dir"; then
19649                    haveit=yes
19650                    break
19651                  fi
19652                done
19653                if test -z "$haveit"; then
19654                  ltrpathdirs="$ltrpathdirs $found_dir"
19655                fi
19656                                if test "$acl_hardcode_direct" = yes; then
19657                                                      LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
19658                else
19659                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
19660                                                            LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
19661                                                            haveit=
19662                    for x in $rpathdirs; do
19663                      if test "X$x" = "X$found_dir"; then
19664                        haveit=yes
19665                        break
19666                      fi
19667                    done
19668                    if test -z "$haveit"; then
19669                      rpathdirs="$rpathdirs $found_dir"
19670                    fi
19671                  else
19672                                                                                haveit=
19673                    for x in $LDFLAGS $LIBPTH; do
19674
19675  acl_save_prefix="$prefix"
19676  prefix="$acl_final_prefix"
19677  acl_save_exec_prefix="$exec_prefix"
19678  exec_prefix="$acl_final_exec_prefix"
19679  eval x=\"$x\"
19680  exec_prefix="$acl_save_exec_prefix"
19681  prefix="$acl_save_prefix"
19682
19683                      if test "X$x" = "X-L$found_dir"; then
19684                        haveit=yes
19685                        break
19686                      fi
19687                    done
19688                    if test -z "$haveit"; then
19689                      LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir"
19690                    fi
19691                    if test "$acl_hardcode_minus_L" != no; then
19692                                                                                        LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
19693                    else
19694                                                                                                                                                                                LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name"
19695                    fi
19696                  fi
19697                fi
19698              fi
19699            else
19700              if test "X$found_a" != "X"; then
19701                                LIBPTH="${LIBPTH}${LIBPTH:+ }$found_a"
19702              else
19703                                                LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir -l$name"
19704              fi
19705            fi
19706                        additional_includedir=
19707            case "$found_dir" in
19708              */$acl_libdirstem | */$acl_libdirstem/)
19709                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
19710                if test "$name" = 'pth'; then
19711                  LIBPTH_PREFIX="$basedir"
19712                fi
19713                additional_includedir="$basedir/include"
19714                ;;
19715              */$acl_libdirstem2 | */$acl_libdirstem2/)
19716                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
19717                if test "$name" = 'pth'; then
19718                  LIBPTH_PREFIX="$basedir"
19719                fi
19720                additional_includedir="$basedir/include"
19721                ;;
19722            esac
19723            if test "X$additional_includedir" != "X"; then
19724                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
19725                haveit=
19726                if test "X$additional_includedir" = "X/usr/local/include"; then
19727                  if test -n "$GCC"; then
19728                    case $host_os in
19729                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
19730                    esac
19731                  fi
19732                fi
19733                if test -z "$haveit"; then
19734                  for x in $CPPFLAGS $INCPTH; do
19735
19736  acl_save_prefix="$prefix"
19737  prefix="$acl_final_prefix"
19738  acl_save_exec_prefix="$exec_prefix"
19739  exec_prefix="$acl_final_exec_prefix"
19740  eval x=\"$x\"
19741  exec_prefix="$acl_save_exec_prefix"
19742  prefix="$acl_save_prefix"
19743
19744                    if test "X$x" = "X-I$additional_includedir"; then
19745                      haveit=yes
19746                      break
19747                    fi
19748                  done
19749                  if test -z "$haveit"; then
19750                    if test -d "$additional_includedir"; then
19751                                            INCPTH="${INCPTH}${INCPTH:+ }-I$additional_includedir"
19752                    fi
19753                  fi
19754                fi
19755              fi
19756            fi
19757                        if test -n "$found_la"; then
19758                                                        save_libdir="$libdir"
19759              case "$found_la" in
19760                */* | *\\*) . "$found_la" ;;
19761                *) . "./$found_la" ;;
19762              esac
19763              libdir="$save_libdir"
19764                            for dep in $dependency_libs; do
19765                case "$dep" in
19766                  -L*)
19767                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
19768                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
19769                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
19770                      haveit=
19771                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
19772                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
19773                        if test -n "$GCC"; then
19774                          case $host_os in
19775                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
19776                          esac
19777                        fi
19778                      fi
19779                      if test -z "$haveit"; then
19780                        haveit=
19781                        for x in $LDFLAGS $LIBPTH; do
19782
19783  acl_save_prefix="$prefix"
19784  prefix="$acl_final_prefix"
19785  acl_save_exec_prefix="$exec_prefix"
19786  exec_prefix="$acl_final_exec_prefix"
19787  eval x=\"$x\"
19788  exec_prefix="$acl_save_exec_prefix"
19789  prefix="$acl_save_prefix"
19790
19791                          if test "X$x" = "X-L$additional_libdir"; then
19792                            haveit=yes
19793                            break
19794                          fi
19795                        done
19796                        if test -z "$haveit"; then
19797                          if test -d "$additional_libdir"; then
19798                                                        LIBPTH="${LIBPTH}${LIBPTH:+ }-L$additional_libdir"
19799                          fi
19800                        fi
19801                        haveit=
19802                        for x in $LDFLAGS $LTLIBPTH; do
19803
19804  acl_save_prefix="$prefix"
19805  prefix="$acl_final_prefix"
19806  acl_save_exec_prefix="$exec_prefix"
19807  exec_prefix="$acl_final_exec_prefix"
19808  eval x=\"$x\"
19809  exec_prefix="$acl_save_exec_prefix"
19810  prefix="$acl_save_prefix"
19811
19812                          if test "X$x" = "X-L$additional_libdir"; then
19813                            haveit=yes
19814                            break
19815                          fi
19816                        done
19817                        if test -z "$haveit"; then
19818                          if test -d "$additional_libdir"; then
19819                                                        LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$additional_libdir"
19820                          fi
19821                        fi
19822                      fi
19823                    fi
19824                    ;;
19825                  -R*)
19826                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
19827                    if test "$enable_rpath" != no; then
19828                                                                  haveit=
19829                      for x in $rpathdirs; do
19830                        if test "X$x" = "X$dir"; then
19831                          haveit=yes
19832                          break
19833                        fi
19834                      done
19835                      if test -z "$haveit"; then
19836                        rpathdirs="$rpathdirs $dir"
19837                      fi
19838                                                                  haveit=
19839                      for x in $ltrpathdirs; do
19840                        if test "X$x" = "X$dir"; then
19841                          haveit=yes
19842                          break
19843                        fi
19844                      done
19845                      if test -z "$haveit"; then
19846                        ltrpathdirs="$ltrpathdirs $dir"
19847                      fi
19848                    fi
19849                    ;;
19850                  -l*)
19851                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
19852                    ;;
19853                  *.la)
19854                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
19855                    ;;
19856                  *)
19857                                        LIBPTH="${LIBPTH}${LIBPTH:+ }$dep"
19858                    LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$dep"
19859                    ;;
19860                esac
19861              done
19862            fi
19863          else
19864                                                            LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name"
19865            LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-l$name"
19866          fi
19867        fi
19868      fi
19869    done
19870  done
19871  if test "X$rpathdirs" != "X"; then
19872    if test -n "$acl_hardcode_libdir_separator"; then
19873                        alldirs=
19874      for found_dir in $rpathdirs; do
19875        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
19876      done
19877            acl_save_libdir="$libdir"
19878      libdir="$alldirs"
19879      eval flag=\"$acl_hardcode_libdir_flag_spec\"
19880      libdir="$acl_save_libdir"
19881      LIBPTH="${LIBPTH}${LIBPTH:+ }$flag"
19882    else
19883            for found_dir in $rpathdirs; do
19884        acl_save_libdir="$libdir"
19885        libdir="$found_dir"
19886        eval flag=\"$acl_hardcode_libdir_flag_spec\"
19887        libdir="$acl_save_libdir"
19888        LIBPTH="${LIBPTH}${LIBPTH:+ }$flag"
19889      done
19890    fi
19891  fi
19892  if test "X$ltrpathdirs" != "X"; then
19893            for found_dir in $ltrpathdirs; do
19894      LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-R$found_dir"
19895    done
19896  fi
19897
19898
19899
19900
19901
19902
19903    ac_cv_libpth_libs="$LIBPTH"
19904    ac_cv_libpth_ltlibs="$LTLIBPTH"
19905    ac_cv_libpth_cppflags="$INCPTH"
19906    ac_cv_libpth_prefix="$LIBPTH_PREFIX"
19907
19908fi
19909{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libpth_libs" >&5
19910$as_echo "$ac_cv_libpth_libs" >&6; }
19911  LIBPTH="$ac_cv_libpth_libs"
19912  LTLIBPTH="$ac_cv_libpth_ltlibs"
19913  INCPTH="$ac_cv_libpth_cppflags"
19914  LIBPTH_PREFIX="$ac_cv_libpth_prefix"
19915
19916  for element in $INCPTH; do
19917    haveit=
19918    for x in $CPPFLAGS; do
19919
19920  acl_save_prefix="$prefix"
19921  prefix="$acl_final_prefix"
19922  acl_save_exec_prefix="$exec_prefix"
19923  exec_prefix="$acl_final_exec_prefix"
19924  eval x=\"$x\"
19925  exec_prefix="$acl_save_exec_prefix"
19926  prefix="$acl_save_prefix"
19927
19928      if test "X$x" = "X$element"; then
19929        haveit=yes
19930        break
19931      fi
19932    done
19933    if test -z "$haveit"; then
19934      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
19935    fi
19936  done
19937
19938
19939
19940
19941      HAVE_LIBPTH=yes
19942
19943
19944
19945      gl_have_pth=
19946      gl_save_LIBS="$LIBS"
19947      LIBS="$LIBS $LIBPTH"
19948      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19949/* end confdefs.h.  */
19950#include <pth.h>
19951int
19952main ()
19953{
19954pth_self();
19955  ;
19956  return 0;
19957}
19958_ACEOF
19959if ac_fn_c_try_link "$LINENO"; then :
19960  gl_have_pth=yes
19961fi
19962rm -f core conftest.err conftest.$ac_objext \
19963    conftest$ac_exeext conftest.$ac_ext
19964      LIBS="$gl_save_LIBS"
19965      if test -n "$gl_have_pth"; then
19966        gl_threads_api=pth
19967        LIBTHREAD="$LIBPTH"
19968        LTLIBTHREAD="$LTLIBPTH"
19969        LIBMULTITHREAD="$LIBTHREAD"
19970        LTLIBMULTITHREAD="$LTLIBTHREAD"
19971
19972$as_echo "#define USE_PTH_THREADS 1" >>confdefs.h
19973
19974        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
19975          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
19976
19977$as_echo "#define USE_PTH_THREADS_WEAK 1" >>confdefs.h
19978
19979            LIBTHREAD=
19980            LTLIBTHREAD=
19981                                                            if test $gl_cv_linker_have_as_needed = yes; then
19982              if test $gl_cv_linker_have_push_state = yes; then
19983                LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
19984              else
19985                LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
19986              fi
19987            fi
19988            # TODO: May need to modify LTLIBMULTITHREAD similarly.
19989          fi
19990        fi
19991      else
19992        CPPFLAGS="$gl_save_CPPFLAGS"
19993      fi
19994    fi
19995    if test -z "$gl_have_pthread"; then
19996      case "$gl_use_threads" in
19997        yes | windows | win32) # The 'win32' is for backward compatibility.
19998          if { case "$host_os" in
19999                 mingw*) true;;
20000                 *) false;;
20001               esac
20002             }; then
20003            gl_threads_api=windows
20004
20005$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
20006
20007          fi
20008          ;;
20009      esac
20010    fi
20011  fi
20012  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
20013$as_echo_n "checking for multithread API to use... " >&6; }
20014  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
20015$as_echo "$gl_threads_api" >&6; }
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
20028$as_echo_n "checking for a sed that does not truncate output... " >&6; }
20029if ${ac_cv_path_SED+:} false; then :
20030  $as_echo_n "(cached) " >&6
20031else
20032            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
20033     for ac_i in 1 2 3 4 5 6 7; do
20034       ac_script="$ac_script$as_nl$ac_script"
20035     done
20036     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
20037     { ac_script=; unset ac_script;}
20038     if test -z "$SED"; then
20039  ac_path_SED_found=false
20040  # Loop through the user's path and test for each of PROGNAME-LIST
20041  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
20042for as_dir in $PATH
20043do
20044  IFS=$as_save_IFS
20045  test -z "$as_dir" && as_dir=.
20046    for ac_prog in sed gsed; do
20047    for ac_exec_ext in '' $ac_executable_extensions; do
20048      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
20049      as_fn_executable_p "$ac_path_SED" || continue
20050# Check for GNU ac_path_SED and select it if it is found.
20051  # Check for GNU $ac_path_SED
20052case `"$ac_path_SED" --version 2>&1` in
20053*GNU*)
20054  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
20055*)
20056  ac_count=0
20057  $as_echo_n 0123456789 >"conftest.in"
20058  while :
20059  do
20060    cat "conftest.in" "conftest.in" >"conftest.tmp"
20061    mv "conftest.tmp" "conftest.in"
20062    cp "conftest.in" "conftest.nl"
20063    $as_echo '' >> "conftest.nl"
20064    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
20065    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
20066    as_fn_arith $ac_count + 1 && ac_count=$as_val
20067    if test $ac_count -gt ${ac_path_SED_max-0}; then
20068      # Best one so far, save it but keep looking for a better one
20069      ac_cv_path_SED="$ac_path_SED"
20070      ac_path_SED_max=$ac_count
20071    fi
20072    # 10*(2^10) chars as input seems more than enough
20073    test $ac_count -gt 10 && break
20074  done
20075  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
20076esac
20077
20078      $ac_path_SED_found && break 3
20079    done
20080  done
20081  done
20082IFS=$as_save_IFS
20083  if test -z "$ac_cv_path_SED"; then
20084    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
20085  fi
20086else
20087  ac_cv_path_SED=$SED
20088fi
20089
20090fi
20091{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
20092$as_echo "$ac_cv_path_SED" >&6; }
20093 SED="$ac_cv_path_SED"
20094  rm -f conftest.sed
20095
20096
20097
20098      for ac_header in stdlib.h
20099do :
20100  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
20101if test "x$ac_cv_header_stdlib_h" = xyes; then :
20102  cat >>confdefs.h <<_ACEOF
20103#define HAVE_STDLIB_H 1
20104_ACEOF
20105
20106fi
20107
20108done
20109
20110  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
20111$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
20112if ${ac_cv_func_malloc_0_nonnull+:} false; then :
20113  $as_echo_n "(cached) " >&6
20114else
20115  if test "$cross_compiling" = yes; then :
20116  case "$host_os" in
20117          # Guess yes on platforms where we know the result.
20118          *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \
20119          | hpux* | solaris* | cygwin* | mingw*)
20120            ac_cv_func_malloc_0_nonnull=yes ;;
20121          # If we don't know, assume the worst.
20122          *) ac_cv_func_malloc_0_nonnull=no ;;
20123        esac
20124
20125else
20126  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20127/* end confdefs.h.  */
20128#if defined STDC_HEADERS || defined HAVE_STDLIB_H
20129            # include <stdlib.h>
20130            #else
20131            char *malloc ();
20132            #endif
20133
20134int
20135main ()
20136{
20137char *p = malloc (0);
20138            int result = !p;
20139            free (p);
20140            return result;
20141  ;
20142  return 0;
20143}
20144
20145_ACEOF
20146if ac_fn_c_try_run "$LINENO"; then :
20147  ac_cv_func_malloc_0_nonnull=yes
20148else
20149  ac_cv_func_malloc_0_nonnull=no
20150fi
20151rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20152  conftest.$ac_objext conftest.beam conftest.$ac_ext
20153fi
20154
20155
20156fi
20157{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
20158$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
20159  if test $ac_cv_func_malloc_0_nonnull = yes; then :
20160  gl_cv_func_malloc_0_nonnull=1
20161else
20162  gl_cv_func_malloc_0_nonnull=0
20163fi
20164
20165
20166cat >>confdefs.h <<_ACEOF
20167#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
20168_ACEOF
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
20181$as_echo_n "checking for a traditional japanese locale... " >&6; }
20182if ${gt_cv_locale_ja+:} false; then :
20183  $as_echo_n "(cached) " >&6
20184else
20185
20186    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20187/* end confdefs.h.  */
20188
20189#include <locale.h>
20190#include <time.h>
20191#if HAVE_LANGINFO_CODESET
20192# include <langinfo.h>
20193#endif
20194#include <stdlib.h>
20195#include <string.h>
20196struct tm t;
20197char buf[16];
20198int main ()
20199{
20200  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
20201     imitates locale dependent behaviour by looking at the environment
20202     variables, and all locales use the UTF-8 encoding.  */
20203#if defined __BEOS__ || defined __HAIKU__
20204  return 1;
20205#else
20206  /* Check whether the given locale name is recognized by the system.  */
20207# if defined _WIN32 && !defined __CYGWIN__
20208  /* On native Windows, setlocale(category, "") looks at the system settings,
20209     not at the environment variables.  Also, when an encoding suffix such
20210     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
20211     category of the locale to "C".  */
20212  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
20213      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
20214    return 1;
20215# else
20216  if (setlocale (LC_ALL, "") == NULL) return 1;
20217# endif
20218  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
20219     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
20220     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
20221     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
20222     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
20223     some unit tests fail.
20224     On MirBSD 10, when an unsupported locale is specified, setlocale()
20225     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
20226# if HAVE_LANGINFO_CODESET
20227  {
20228    const char *cs = nl_langinfo (CODESET);
20229    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
20230        || strcmp (cs, "UTF-8") == 0)
20231      return 1;
20232  }
20233# endif
20234# ifdef __CYGWIN__
20235  /* On Cygwin, avoid locale names without encoding suffix, because the
20236     locale_charset() function relies on the encoding suffix.  Note that
20237     LC_ALL is set on the command line.  */
20238  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
20239# endif
20240  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
20241     on Cygwin 1.5.x.  */
20242  if (MB_CUR_MAX == 1)
20243    return 1;
20244  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
20245     This excludes the UTF-8 encoding (except on MirBSD).  */
20246  {
20247    const char *p;
20248    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
20249    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
20250    for (p = buf; *p != '\0'; p++)
20251      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
20252        return 1;
20253  }
20254  return 0;
20255#endif
20256}
20257
20258_ACEOF
20259    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
20260  (eval $ac_link) 2>&5
20261  ac_status=$?
20262  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
20263  test $ac_status = 0; } && test -s conftest$ac_exeext; then
20264      case "$host_os" in
20265        # Handle native Windows specially, because there setlocale() interprets
20266        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
20267        # "fr" or "fra" as "French" or "French_France.1252",
20268        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
20269        # "ja" as "Japanese" or "Japanese_Japan.932",
20270        # and similar.
20271        mingw*)
20272          # Note that on native Windows, the Japanese locale is
20273          # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
20274          # cannot use it here.
20275          gt_cv_locale_ja=none
20276          ;;
20277        *)
20278          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
20279          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
20280          # configure script would override the LC_ALL setting. Likewise for
20281          # LC_CTYPE, which is also set at the beginning of the configure script.
20282          # Test for the AIX locale name.
20283          if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20284            gt_cv_locale_ja=ja_JP
20285          else
20286            # Test for the locale name with explicit encoding suffix.
20287            if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20288              gt_cv_locale_ja=ja_JP.EUC-JP
20289            else
20290              # Test for the HP-UX, OSF/1, NetBSD locale name.
20291              if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20292                gt_cv_locale_ja=ja_JP.eucJP
20293              else
20294                # Test for the IRIX, FreeBSD locale name.
20295                if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20296                  gt_cv_locale_ja=ja_JP.EUC
20297                else
20298                  # Test for the Solaris 7 locale name.
20299                  if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20300                    gt_cv_locale_ja=ja
20301                  else
20302                    # Special test for NetBSD 1.6.
20303                    if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
20304                      gt_cv_locale_ja=ja_JP.eucJP
20305                    else
20306                      # None found.
20307                      gt_cv_locale_ja=none
20308                    fi
20309                  fi
20310                fi
20311              fi
20312            fi
20313          fi
20314          ;;
20315      esac
20316    fi
20317    rm -fr conftest*
20318
20319fi
20320{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
20321$as_echo "$gt_cv_locale_ja" >&6; }
20322  LOCALE_JA=$gt_cv_locale_ja
20323
20324
20325
20326
20327
20328  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
20329$as_echo_n "checking for a transitional chinese locale... " >&6; }
20330if ${gt_cv_locale_zh_CN+:} false; then :
20331  $as_echo_n "(cached) " >&6
20332else
20333
20334    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20335/* end confdefs.h.  */
20336
20337#include <locale.h>
20338#include <stdlib.h>
20339#include <time.h>
20340#if HAVE_LANGINFO_CODESET
20341# include <langinfo.h>
20342#endif
20343#include <stdlib.h>
20344#include <string.h>
20345struct tm t;
20346char buf[16];
20347int main ()
20348{
20349  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
20350     imitates locale dependent behaviour by looking at the environment
20351     variables, and all locales use the UTF-8 encoding.  */
20352#if defined __BEOS__ || defined __HAIKU__
20353  return 1;
20354#else
20355  /* Check whether the given locale name is recognized by the system.  */
20356# if defined _WIN32 && !defined __CYGWIN__
20357  /* On native Windows, setlocale(category, "") looks at the system settings,
20358     not at the environment variables.  Also, when an encoding suffix such
20359     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
20360     category of the locale to "C".  */
20361  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
20362      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
20363    return 1;
20364# else
20365  if (setlocale (LC_ALL, "") == NULL) return 1;
20366# endif
20367  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
20368     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
20369     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
20370     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
20371     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
20372     some unit tests fail.
20373     On MirBSD 10, when an unsupported locale is specified, setlocale()
20374     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
20375# if HAVE_LANGINFO_CODESET
20376  {
20377    const char *cs = nl_langinfo (CODESET);
20378    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
20379        || strcmp (cs, "UTF-8") == 0)
20380      return 1;
20381  }
20382# endif
20383# ifdef __CYGWIN__
20384  /* On Cygwin, avoid locale names without encoding suffix, because the
20385     locale_charset() function relies on the encoding suffix.  Note that
20386     LC_ALL is set on the command line.  */
20387  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
20388# endif
20389  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
20390     This excludes the UTF-8 encoding (except on MirBSD).  */
20391  {
20392    const char *p;
20393    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
20394    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
20395    for (p = buf; *p != '\0'; p++)
20396      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
20397        return 1;
20398  }
20399  /* Check whether a typical GB18030 multibyte sequence is recognized as a
20400     single wide character.  This excludes the GB2312 and GBK encodings.  */
20401  if (mblen ("\203\062\332\066", 5) != 4)
20402    return 1;
20403  return 0;
20404#endif
20405}
20406
20407_ACEOF
20408    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
20409  (eval $ac_link) 2>&5
20410  ac_status=$?
20411  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
20412  test $ac_status = 0; } && test -s conftest$ac_exeext; then
20413      case "$host_os" in
20414        # Handle native Windows specially, because there setlocale() interprets
20415        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
20416        # "fr" or "fra" as "French" or "French_France.1252",
20417        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
20418        # "ja" as "Japanese" or "Japanese_Japan.932",
20419        # and similar.
20420        mingw*)
20421          # Test for the hypothetical native Windows locale name.
20422          if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20423            gt_cv_locale_zh_CN=Chinese_China.54936
20424          else
20425            # None found.
20426            gt_cv_locale_zh_CN=none
20427          fi
20428          ;;
20429        solaris2.8)
20430          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
20431          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
20432          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
20433          gt_cv_locale_zh_CN=none
20434          ;;
20435        *)
20436          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
20437          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
20438          # configure script would override the LC_ALL setting. Likewise for
20439          # LC_CTYPE, which is also set at the beginning of the configure script.
20440          # Test for the locale name without encoding suffix.
20441          if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20442            gt_cv_locale_zh_CN=zh_CN
20443          else
20444            # Test for the locale name with explicit encoding suffix.
20445            if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20446              gt_cv_locale_zh_CN=zh_CN.GB18030
20447            else
20448              # None found.
20449              gt_cv_locale_zh_CN=none
20450            fi
20451          fi
20452          ;;
20453      esac
20454    else
20455      # If there was a link error, due to mblen(), the system is so old that
20456      # it certainly doesn't have a chinese locale.
20457      gt_cv_locale_zh_CN=none
20458    fi
20459    rm -fr conftest*
20460
20461fi
20462{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
20463$as_echo "$gt_cv_locale_zh_CN" >&6; }
20464  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
20465
20466
20467
20468
20469  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
20470$as_echo_n "checking for a french Unicode locale... " >&6; }
20471if ${gt_cv_locale_fr_utf8+:} false; then :
20472  $as_echo_n "(cached) " >&6
20473else
20474
20475    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20476/* end confdefs.h.  */
20477
20478#include <locale.h>
20479#include <time.h>
20480#if HAVE_LANGINFO_CODESET
20481# include <langinfo.h>
20482#endif
20483#include <stdlib.h>
20484#include <string.h>
20485struct tm t;
20486char buf[16];
20487int main () {
20488  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
20489     imitates locale dependent behaviour by looking at the environment
20490     variables, and all locales use the UTF-8 encoding.  */
20491#if !(defined __BEOS__ || defined __HAIKU__)
20492  /* Check whether the given locale name is recognized by the system.  */
20493# if defined _WIN32 && !defined __CYGWIN__
20494  /* On native Windows, setlocale(category, "") looks at the system settings,
20495     not at the environment variables.  Also, when an encoding suffix such
20496     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
20497     category of the locale to "C".  */
20498  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
20499      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
20500    return 1;
20501# else
20502  if (setlocale (LC_ALL, "") == NULL) return 1;
20503# endif
20504  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
20505     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
20506     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
20507     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
20508     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
20509     some unit tests fail.  */
20510# if HAVE_LANGINFO_CODESET
20511  {
20512    const char *cs = nl_langinfo (CODESET);
20513    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
20514      return 1;
20515  }
20516# endif
20517# ifdef __CYGWIN__
20518  /* On Cygwin, avoid locale names without encoding suffix, because the
20519     locale_charset() function relies on the encoding suffix.  Note that
20520     LC_ALL is set on the command line.  */
20521  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
20522# endif
20523  /* Check whether in the abbreviation of the second month, the second
20524     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
20525     two bytes long, with UTF-8 encoding.  */
20526  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
20527  if (strftime (buf, sizeof (buf), "%b", &t) < 4
20528      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
20529    return 1;
20530#endif
20531#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
20532  /* Check whether the decimal separator is a comma.
20533     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
20534     are nl_langinfo(RADIXCHAR) are both ".".  */
20535  if (localeconv () ->decimal_point[0] != ',') return 1;
20536#endif
20537  return 0;
20538}
20539
20540_ACEOF
20541    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
20542  (eval $ac_link) 2>&5
20543  ac_status=$?
20544  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
20545  test $ac_status = 0; } && test -s conftest$ac_exeext; then
20546      case "$host_os" in
20547        # Handle native Windows specially, because there setlocale() interprets
20548        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
20549        # "fr" or "fra" as "French" or "French_France.1252",
20550        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
20551        # "ja" as "Japanese" or "Japanese_Japan.932",
20552        # and similar.
20553        mingw*)
20554          # Test for the hypothetical native Windows locale name.
20555          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20556            gt_cv_locale_fr_utf8=French_France.65001
20557          else
20558            # None found.
20559            gt_cv_locale_fr_utf8=none
20560          fi
20561          ;;
20562        *)
20563          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
20564          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
20565          # configure script would override the LC_ALL setting. Likewise for
20566          # LC_CTYPE, which is also set at the beginning of the configure script.
20567          # Test for the usual locale name.
20568          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20569            gt_cv_locale_fr_utf8=fr_FR
20570          else
20571            # Test for the locale name with explicit encoding suffix.
20572            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20573              gt_cv_locale_fr_utf8=fr_FR.UTF-8
20574            else
20575              # Test for the Solaris 7 locale name.
20576              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
20577                gt_cv_locale_fr_utf8=fr.UTF-8
20578              else
20579                # None found.
20580                gt_cv_locale_fr_utf8=none
20581              fi
20582            fi
20583          fi
20584          ;;
20585      esac
20586    fi
20587    rm -fr conftest*
20588
20589fi
20590{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
20591$as_echo "$gt_cv_locale_fr_utf8" >&6; }
20592  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
20606
20607
20608
20609     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
20610$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
20611if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
20612  $as_echo_n "(cached) " >&6
20613else
20614
20615                  case "$host_os" in
20616                     # Guess no on AIX and OSF/1.
20617        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
20618                     # Guess yes otherwise.
20619        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
20620      esac
20621      if test $LOCALE_JA != none; then
20622        if test "$cross_compiling" = yes; then :
20623  :
20624else
20625  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20626/* end confdefs.h.  */
20627
20628#include <locale.h>
20629#include <string.h>
20630/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20631   <wchar.h>.
20632   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
20633   included before <wchar.h>.  */
20634#include <stddef.h>
20635#include <stdio.h>
20636#include <time.h>
20637#include <wchar.h>
20638int main ()
20639{
20640  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
20641    {
20642      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
20643      mbstate_t state;
20644      wchar_t wc;
20645
20646      memset (&state, '\0', sizeof (mbstate_t));
20647      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
20648        if (mbsinit (&state))
20649          return 2;
20650    }
20651  return 0;
20652}
20653_ACEOF
20654if ac_fn_c_try_run "$LINENO"; then :
20655  gl_cv_func_mbrtowc_incomplete_state=yes
20656else
20657  gl_cv_func_mbrtowc_incomplete_state=no
20658fi
20659rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20660  conftest.$ac_objext conftest.beam conftest.$ac_ext
20661fi
20662
20663      fi
20664
20665fi
20666{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
20667$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
20668
20669
20670
20671
20672     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
20673$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
20674if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
20675  $as_echo_n "(cached) " >&6
20676else
20677
20678                  case "$host_os" in
20679                    # Guess no on Solaris 8.
20680        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
20681                    # Guess yes otherwise.
20682        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
20683      esac
20684      if test $LOCALE_ZH_CN != none; then
20685        if test "$cross_compiling" = yes; then :
20686  :
20687else
20688  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20689/* end confdefs.h.  */
20690
20691#include <locale.h>
20692#include <stdlib.h>
20693#include <string.h>
20694/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20695   <wchar.h>.
20696   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
20697   included before <wchar.h>.  */
20698#include <stddef.h>
20699#include <stdio.h>
20700#include <time.h>
20701#include <wchar.h>
20702int main ()
20703{
20704  /* This fails on Solaris 8:
20705     mbrtowc returns 2, and sets wc to 0x00F0.
20706     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
20707  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
20708    {
20709      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
20710      mbstate_t state;
20711      wchar_t wc;
20712
20713      memset (&state, '\0', sizeof (mbstate_t));
20714      if (mbrtowc (&wc, input + 3, 6, &state) != 4
20715          && mbtowc (&wc, input + 3, 6) == 4)
20716        return 2;
20717    }
20718  return 0;
20719}
20720_ACEOF
20721if ac_fn_c_try_run "$LINENO"; then :
20722  gl_cv_func_mbrtowc_sanitycheck=yes
20723else
20724  gl_cv_func_mbrtowc_sanitycheck=no
20725fi
20726rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20727  conftest.$ac_objext conftest.beam conftest.$ac_ext
20728fi
20729
20730      fi
20731
20732fi
20733{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
20734$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
20735
20736    REPLACE_MBSTATE_T=0
20737    case "$gl_cv_func_mbrtowc_incomplete_state" in
20738      *yes) ;;
20739      *) REPLACE_MBSTATE_T=1 ;;
20740    esac
20741    case "$gl_cv_func_mbrtowc_sanitycheck" in
20742      *yes) ;;
20743      *) REPLACE_MBSTATE_T=1 ;;
20744    esac
20745  else
20746    REPLACE_MBSTATE_T=1
20747  fi
20748
20749
20750
20751  if test $ac_cv_func_mbrtowc = no; then
20752    HAVE_MBRTOWC=0
20753    ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
20754/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20755   <wchar.h>.
20756   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
20757   included before <wchar.h>.  */
20758#include <stddef.h>
20759#include <stdio.h>
20760#include <time.h>
20761#include <wchar.h>
20762
20763"
20764if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
20765  ac_have_decl=1
20766else
20767  ac_have_decl=0
20768fi
20769
20770cat >>confdefs.h <<_ACEOF
20771#define HAVE_DECL_MBRTOWC $ac_have_decl
20772_ACEOF
20773
20774    if test $ac_cv_have_decl_mbrtowc = yes; then
20775                        REPLACE_MBRTOWC=1
20776    fi
20777  else
20778    if test $REPLACE_MBSTATE_T = 1; then
20779      REPLACE_MBRTOWC=1
20780    else
20781
20782
20783
20784     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
20785$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
20786if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
20787  $as_echo_n "(cached) " >&6
20788else
20789
20790                  case "$host_os" in
20791                  # Guess no on Solaris.
20792        solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
20793                  # Guess yes otherwise.
20794        *)        gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
20795      esac
20796      if test $LOCALE_FR_UTF8 != none; then
20797        if test "$cross_compiling" = yes; then :
20798  :
20799else
20800  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20801/* end confdefs.h.  */
20802
20803#include <locale.h>
20804#include <stdlib.h>
20805#include <string.h>
20806/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20807   <wchar.h>.
20808   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
20809   included before <wchar.h>.  */
20810#include <stddef.h>
20811#include <stdio.h>
20812#include <time.h>
20813#include <wchar.h>
20814int main ()
20815{
20816  int result = 0;
20817
20818  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
20819    {
20820      char input[] = "\303\237er";
20821      mbstate_t state;
20822      wchar_t wc;
20823      size_t ret;
20824
20825      memset (&state, '\0', sizeof (mbstate_t));
20826      wc = (wchar_t) 0xBADFACE;
20827      ret = mbrtowc (&wc, input, 5, &state);
20828      if (ret != 2)
20829        result |= 1;
20830      if (!mbsinit (&state))
20831        result |= 2;
20832
20833      memset (&state, '\0', sizeof (mbstate_t));
20834      ret = mbrtowc (NULL, input, 5, &state);
20835      if (ret != 2) /* Solaris 7 fails here: ret is -1.  */
20836        result |= 4;
20837      if (!mbsinit (&state))
20838        result |= 8;
20839    }
20840  return result;
20841}
20842_ACEOF
20843if ac_fn_c_try_run "$LINENO"; then :
20844  gl_cv_func_mbrtowc_null_arg1=yes
20845else
20846  gl_cv_func_mbrtowc_null_arg1=no
20847fi
20848rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20849  conftest.$ac_objext conftest.beam conftest.$ac_ext
20850fi
20851
20852      fi
20853
20854fi
20855{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
20856$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
20857
20858
20859
20860
20861     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
20862$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
20863if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
20864  $as_echo_n "(cached) " >&6
20865else
20866
20867                  case "$host_os" in
20868              # Guess no on OSF/1.
20869        osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
20870              # Guess yes otherwise.
20871        *)    gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
20872      esac
20873      if test $LOCALE_FR_UTF8 != none; then
20874        if test "$cross_compiling" = yes; then :
20875  :
20876else
20877  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20878/* end confdefs.h.  */
20879
20880#include <locale.h>
20881#include <string.h>
20882/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20883   <wchar.h>.
20884   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
20885   included before <wchar.h>.  */
20886#include <stddef.h>
20887#include <stdio.h>
20888#include <time.h>
20889#include <wchar.h>
20890int main ()
20891{
20892  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
20893    {
20894      mbstate_t state;
20895      wchar_t wc;
20896      int ret;
20897
20898      memset (&state, '\0', sizeof (mbstate_t));
20899      wc = (wchar_t) 0xBADFACE;
20900      mbrtowc (&wc, NULL, 5, &state);
20901      /* Check that wc was not modified.  */
20902      if (wc != (wchar_t) 0xBADFACE)
20903        return 2;
20904    }
20905  return 0;
20906}
20907_ACEOF
20908if ac_fn_c_try_run "$LINENO"; then :
20909  gl_cv_func_mbrtowc_null_arg2=yes
20910else
20911  gl_cv_func_mbrtowc_null_arg2=no
20912fi
20913rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20914  conftest.$ac_objext conftest.beam conftest.$ac_ext
20915fi
20916
20917      fi
20918
20919fi
20920{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
20921$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
20922
20923
20924
20925
20926
20927
20928  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
20929$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
20930if ${gl_cv_func_mbrtowc_retval+:} false; then :
20931  $as_echo_n "(cached) " >&6
20932else
20933
20934                  case "$host_os" in
20935                                   # Guess no on HP-UX, Solaris, native Windows.
20936        hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
20937                                   # Guess yes otherwise.
20938        *)                         gl_cv_func_mbrtowc_retval="guessing yes" ;;
20939      esac
20940      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
20941         || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
20942        if test "$cross_compiling" = yes; then :
20943  :
20944else
20945  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20946/* end confdefs.h.  */
20947
20948#include <locale.h>
20949#include <string.h>
20950/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20951   <wchar.h>.
20952   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
20953   included before <wchar.h>.  */
20954#include <stddef.h>
20955#include <stdio.h>
20956#include <time.h>
20957#include <wchar.h>
20958int main ()
20959{
20960  int result = 0;
20961  int found_some_locale = 0;
20962  /* This fails on Solaris.  */
20963  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
20964    {
20965      char input[] = "B\303\274\303\237er"; /* "Büßer" */
20966      mbstate_t state;
20967      wchar_t wc;
20968
20969      memset (&state, '\0', sizeof (mbstate_t));
20970      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
20971        {
20972          input[1] = '\0';
20973          if (mbrtowc (&wc, input + 2, 5, &state) != 1)
20974            result |= 1;
20975        }
20976      found_some_locale = 1;
20977    }
20978  /* This fails on HP-UX 11.11.  */
20979  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
20980    {
20981      char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
20982      mbstate_t state;
20983      wchar_t wc;
20984
20985      memset (&state, '\0', sizeof (mbstate_t));
20986      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
20987        {
20988          input[1] = '\0';
20989          if (mbrtowc (&wc, input + 2, 5, &state) != 2)
20990            result |= 2;
20991        }
20992      found_some_locale = 1;
20993    }
20994  /* This fails on native Windows.  */
20995  if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
20996    {
20997      char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
20998      mbstate_t state;
20999      wchar_t wc;
21000
21001      memset (&state, '\0', sizeof (mbstate_t));
21002      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
21003        {
21004          input[3] = '\0';
21005          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
21006            result |= 4;
21007        }
21008      found_some_locale = 1;
21009    }
21010  if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
21011    {
21012      char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
21013      mbstate_t state;
21014      wchar_t wc;
21015
21016      memset (&state, '\0', sizeof (mbstate_t));
21017      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
21018        {
21019          input[3] = '\0';
21020          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
21021            result |= 8;
21022        }
21023      found_some_locale = 1;
21024    }
21025  if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
21026    {
21027      char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
21028      mbstate_t state;
21029      wchar_t wc;
21030
21031      memset (&state, '\0', sizeof (mbstate_t));
21032      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
21033        {
21034          input[3] = '\0';
21035          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
21036            result |= 16;
21037        }
21038      found_some_locale = 1;
21039    }
21040  return (found_some_locale ? result : 77);
21041}
21042_ACEOF
21043if ac_fn_c_try_run "$LINENO"; then :
21044  gl_cv_func_mbrtowc_retval=yes
21045else
21046  if test $? != 77; then
21047             gl_cv_func_mbrtowc_retval=no
21048           fi
21049
21050fi
21051rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21052  conftest.$ac_objext conftest.beam conftest.$ac_ext
21053fi
21054
21055      fi
21056
21057fi
21058{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
21059$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
21060
21061
21062
21063
21064     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
21065$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
21066if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
21067  $as_echo_n "(cached) " >&6
21068else
21069
21070                  case "$host_os" in
21071                       # Guess no on Solaris 8 and 9.
21072        solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
21073                       # Guess yes otherwise.
21074        *)             gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
21075      esac
21076      if test $LOCALE_ZH_CN != none; then
21077        if test "$cross_compiling" = yes; then :
21078  :
21079else
21080  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21081/* end confdefs.h.  */
21082
21083#include <locale.h>
21084#include <string.h>
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>
21093int main ()
21094{
21095  /* This fails on Solaris 8 and 9.  */
21096  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
21097    {
21098      mbstate_t state;
21099      wchar_t wc;
21100
21101      memset (&state, '\0', sizeof (mbstate_t));
21102      if (mbrtowc (&wc, "", 1, &state) != 0)
21103        return 2;
21104    }
21105  return 0;
21106}
21107_ACEOF
21108if ac_fn_c_try_run "$LINENO"; then :
21109  gl_cv_func_mbrtowc_nul_retval=yes
21110else
21111  gl_cv_func_mbrtowc_nul_retval=no
21112fi
21113rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21114  conftest.$ac_objext conftest.beam conftest.$ac_ext
21115fi
21116
21117      fi
21118
21119fi
21120{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
21121$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
21122
21123
21124
21125     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
21126$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
21127if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
21128  $as_echo_n "(cached) " >&6
21129else
21130
21131                  case "$host_os" in
21132                              # Guess no on AIX and glibc systems.
21133        aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
21134                              # Guess yes on native Windows.
21135        mingw*)               gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
21136        *)                    gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
21137      esac
21138      if test "$cross_compiling" = yes; then :
21139  :
21140else
21141  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21142/* end confdefs.h.  */
21143
21144           #include <wchar.h>
21145           static wchar_t wc;
21146           static mbstate_t mbs;
21147           int
21148           main (void)
21149           {
21150             return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
21151           }
21152_ACEOF
21153if ac_fn_c_try_run "$LINENO"; then :
21154  gl_cv_func_mbrtowc_empty_input=yes
21155else
21156  gl_cv_func_mbrtowc_empty_input=no
21157fi
21158rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21159  conftest.$ac_objext conftest.beam conftest.$ac_ext
21160fi
21161
21162
21163fi
21164{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
21165$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
21166
21167
21168     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
21169$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
21170if ${gl_cv_C_locale_sans_EILSEQ+:} false; then :
21171  $as_echo_n "(cached) " >&6
21172else
21173
21174               gl_cv_C_locale_sans_EILSEQ="guessing no"
21175
21176     if test "$cross_compiling" = yes; then :
21177  case "$host_os" in
21178                 # Guess yes on native Windows.
21179         mingw*) gl_cv_C_locale_sans_EILSEQ="guessing yes" ;;
21180       esac
21181
21182else
21183  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21184/* end confdefs.h.  */
21185#include <limits.h>
21186            #include <locale.h>
21187            #include <wchar.h>
21188
21189int
21190main ()
21191{
21192
21193            int i;
21194            char *locale = setlocale (LC_ALL, "C");
21195            if (! locale)
21196              return 2;
21197            for (i = CHAR_MIN; i <= CHAR_MAX; i++)
21198              {
21199                char c = i;
21200                wchar_t wc;
21201                mbstate_t mbs = { 0, };
21202                size_t ss = mbrtowc (&wc, &c, 1, &mbs);
21203                if (1 < ss)
21204                  return 3;
21205              }
21206            return 0;
21207
21208  ;
21209  return 0;
21210}
21211_ACEOF
21212if ac_fn_c_try_run "$LINENO"; then :
21213  gl_cv_C_locale_sans_EILSEQ=yes
21214else
21215  gl_cv_C_locale_sans_EILSEQ=no
21216fi
21217rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21218  conftest.$ac_objext conftest.beam conftest.$ac_ext
21219fi
21220
21221
21222fi
21223{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5
21224$as_echo "$gl_cv_C_locale_sans_EILSEQ" >&6; }
21225
21226      case "$gl_cv_func_mbrtowc_null_arg1" in
21227        *yes) ;;
21228        *)
21229$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
21230
21231           REPLACE_MBRTOWC=1
21232           ;;
21233      esac
21234      case "$gl_cv_func_mbrtowc_null_arg2" in
21235        *yes) ;;
21236        *)
21237$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
21238
21239           REPLACE_MBRTOWC=1
21240           ;;
21241      esac
21242      case "$gl_cv_func_mbrtowc_retval" in
21243        *yes) ;;
21244        *)
21245$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
21246
21247           REPLACE_MBRTOWC=1
21248           ;;
21249      esac
21250      case "$gl_cv_func_mbrtowc_nul_retval" in
21251        *yes) ;;
21252        *)
21253$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
21254
21255           REPLACE_MBRTOWC=1
21256           ;;
21257      esac
21258      case "$gl_cv_func_mbrtowc_empty_input" in
21259        *yes) ;;
21260        *)
21261$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
21262
21263           REPLACE_MBRTOWC=1
21264           ;;
21265      esac
21266      case $gl_cv_C_locale_sans_EILSEQ in
21267        *yes) ;;
21268        *)
21269$as_echo "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
21270
21271           REPLACE_MBRTOWC=1
21272           ;;
21273      esac
21274    fi
21275  fi
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
21293  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
21294  # irrelevant for anonymous mappings.
21295  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
21296if test "x$ac_cv_func_mmap" = xyes; then :
21297  gl_have_mmap=yes
21298else
21299  gl_have_mmap=no
21300fi
21301
21302
21303  # Try to allow MAP_ANONYMOUS.
21304  gl_have_mmap_anonymous=no
21305  if test $gl_have_mmap = yes; then
21306    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
21307$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
21308    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21309/* end confdefs.h.  */
21310
21311#include <sys/mman.h>
21312#ifdef MAP_ANONYMOUS
21313    I cannot identify this map
21314#endif
21315
21316_ACEOF
21317if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21318  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
21319  gl_have_mmap_anonymous=yes
21320fi
21321rm -f conftest*
21322
21323    if test $gl_have_mmap_anonymous != yes; then
21324      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21325/* end confdefs.h.  */
21326
21327#include <sys/mman.h>
21328#ifdef MAP_ANON
21329    I cannot identify this map
21330#endif
21331
21332_ACEOF
21333if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21334  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
21335
21336$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
21337
21338         gl_have_mmap_anonymous=yes
21339fi
21340rm -f conftest*
21341
21342    fi
21343    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
21344$as_echo "$gl_have_mmap_anonymous" >&6; }
21345    if test $gl_have_mmap_anonymous = yes; then
21346
21347$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
21348
21349    fi
21350  fi
21351
21352
21353
21354
21355
21356
21357  if test $HAVE_MEMCHR = 1; then
21358    # Detect platform-specific bugs in some versions of glibc:
21359    # memchr should not dereference anything with length 0
21360    #   https://bugzilla.redhat.com/show_bug.cgi?id=499689
21361    # memchr should not dereference overestimated length after a match
21362    #   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
21363    #   https://sourceware.org/bugzilla/show_bug.cgi?id=10162
21364    # Assume that memchr works on platforms that lack mprotect.
21365    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
21366$as_echo_n "checking whether memchr works... " >&6; }
21367if ${gl_cv_func_memchr_works+:} false; then :
21368  $as_echo_n "(cached) " >&6
21369else
21370  if test "$cross_compiling" = yes; then :
21371  case "$host_os" in
21372                    # Guess yes on native Windows.
21373            mingw*) gl_cv_func_memchr_works="guessing yes" ;;
21374                    # Be pessimistic for now.
21375            *)      gl_cv_func_memchr_works="guessing no" ;;
21376          esac
21377
21378else
21379  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21380/* end confdefs.h.  */
21381
21382#include <string.h>
21383#if HAVE_SYS_MMAN_H
21384# include <fcntl.h>
21385# include <unistd.h>
21386# include <sys/types.h>
21387# include <sys/mman.h>
21388# ifndef MAP_FILE
21389#  define MAP_FILE 0
21390# endif
21391#endif
21392
21393int
21394main ()
21395{
21396
21397  int result = 0;
21398  char *fence = NULL;
21399#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
21400# if HAVE_MAP_ANONYMOUS
21401  const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
21402  const int fd = -1;
21403# else /* !HAVE_MAP_ANONYMOUS */
21404  const int flags = MAP_FILE | MAP_PRIVATE;
21405  int fd = open ("/dev/zero", O_RDONLY, 0666);
21406  if (fd >= 0)
21407# endif
21408    {
21409      int pagesize = getpagesize ();
21410      char *two_pages =
21411        (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
21412                       flags, fd, 0);
21413      if (two_pages != (char *)(-1)
21414          && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
21415        fence = two_pages + pagesize;
21416    }
21417#endif
21418  if (fence)
21419    {
21420      if (memchr (fence, 0, 0))
21421        result |= 1;
21422      strcpy (fence - 9, "12345678");
21423      if (memchr (fence - 9, 0, 79) != fence - 1)
21424        result |= 2;
21425      if (memchr (fence - 1, 0, 3) != fence - 1)
21426        result |= 4;
21427    }
21428  return result;
21429
21430  ;
21431  return 0;
21432}
21433_ACEOF
21434if ac_fn_c_try_run "$LINENO"; then :
21435  gl_cv_func_memchr_works=yes
21436else
21437  gl_cv_func_memchr_works=no
21438fi
21439rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21440  conftest.$ac_objext conftest.beam conftest.$ac_ext
21441fi
21442
21443
21444fi
21445{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
21446$as_echo "$gl_cv_func_memchr_works" >&6; }
21447    case "$gl_cv_func_memchr_works" in
21448      *yes) ;;
21449      *) REPLACE_MEMCHR=1 ;;
21450    esac
21451  fi
21452
21453ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
21454if test "x$ac_cv_have_decl_memrchr" = xyes; then :
21455  ac_have_decl=1
21456else
21457  ac_have_decl=0
21458fi
21459
21460cat >>confdefs.h <<_ACEOF
21461#define HAVE_DECL_MEMRCHR $ac_have_decl
21462_ACEOF
21463
21464
21465
21466
21467
21468
21469
21470  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5
21471$as_echo_n "checking whether <limits.h> defines MIN and MAX... " >&6; }
21472if ${gl_cv_minmax_in_limits_h+:} false; then :
21473  $as_echo_n "(cached) " >&6
21474else
21475  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21476/* end confdefs.h.  */
21477#include <limits.h>
21478            int x = MIN (42, 17);
21479int
21480main ()
21481{
21482
21483  ;
21484  return 0;
21485}
21486_ACEOF
21487if ac_fn_c_try_compile "$LINENO"; then :
21488  gl_cv_minmax_in_limits_h=yes
21489else
21490  gl_cv_minmax_in_limits_h=no
21491fi
21492rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21493fi
21494{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5
21495$as_echo "$gl_cv_minmax_in_limits_h" >&6; }
21496  if test $gl_cv_minmax_in_limits_h = yes; then
21497
21498$as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h
21499
21500  fi
21501
21502
21503
21504
21505
21506
21507  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5
21508$as_echo_n "checking whether <sys/param.h> defines MIN and MAX... " >&6; }
21509if ${gl_cv_minmax_in_sys_param_h+:} false; then :
21510  $as_echo_n "(cached) " >&6
21511else
21512  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21513/* end confdefs.h.  */
21514#include <sys/param.h>
21515            int x = MIN (42, 17);
21516int
21517main ()
21518{
21519
21520  ;
21521  return 0;
21522}
21523_ACEOF
21524if ac_fn_c_try_compile "$LINENO"; then :
21525  gl_cv_minmax_in_sys_param_h=yes
21526else
21527  gl_cv_minmax_in_sys_param_h=no
21528fi
21529rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21530fi
21531{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5
21532$as_echo "$gl_cv_minmax_in_sys_param_h" >&6; }
21533  if test $gl_cv_minmax_in_sys_param_h = yes; then
21534
21535$as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h
21536
21537  fi
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time_t is signed" >&5
21550$as_echo_n "checking whether time_t is signed... " >&6; }
21551if ${gl_cv_time_t_is_signed+:} false; then :
21552  $as_echo_n "(cached) " >&6
21553else
21554  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21555/* end confdefs.h.  */
21556#include <time.h>
21557                          char time_t_signed[(time_t) -1 < 0 ? 1 : -1];
21558int
21559main ()
21560{
21561
21562  ;
21563  return 0;
21564}
21565_ACEOF
21566if ac_fn_c_try_compile "$LINENO"; then :
21567  gl_cv_time_t_is_signed=yes
21568else
21569  gl_cv_time_t_is_signed=no
21570fi
21571rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21572fi
21573{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_t_is_signed" >&5
21574$as_echo "$gl_cv_time_t_is_signed" >&6; }
21575  if test $gl_cv_time_t_is_signed = yes; then
21576
21577$as_echo "#define TIME_T_IS_SIGNED 1" >>confdefs.h
21578
21579  fi
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590  if test $APPLE_UNIVERSAL_BUILD = 1; then
21591    # A universal build on Apple Mac OS X platforms.
21592    # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
21593    # But we need a configuration result that is valid in both modes.
21594    gl_cv_func_working_mktime=no
21595  fi
21596  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
21597$as_echo_n "checking for working mktime... " >&6; }
21598if ${gl_cv_func_working_mktime+:} false; then :
21599  $as_echo_n "(cached) " >&6
21600else
21601  if test "$cross_compiling" = yes; then :
21602  case "$host_os" in
21603                  # Guess no on native Windows.
21604          mingw*) gl_cv_func_working_mktime="guessing no" ;;
21605          *)      gl_cv_func_working_mktime="guessing no" ;;
21606        esac
21607
21608else
21609  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21610/* end confdefs.h.  */
21611/* Test program from Paul Eggert and Tony Leneis.  */
21612#include <limits.h>
21613#include <stdlib.h>
21614#include <time.h>
21615
21616#ifdef HAVE_UNISTD_H
21617# include <unistd.h>
21618#endif
21619
21620#if HAVE_DECL_ALARM
21621# include <signal.h>
21622#endif
21623
21624#ifndef TIME_T_IS_SIGNED
21625# define TIME_T_IS_SIGNED 0
21626#endif
21627
21628/* Work around redefinition to rpl_putenv by other config tests.  */
21629#undef putenv
21630
21631static time_t time_t_max;
21632static time_t time_t_min;
21633
21634/* Values we'll use to set the TZ environment variable.  */
21635static char *tz_strings[] = {
21636  (char *) 0, "TZ=GMT0", "TZ=JST-9",
21637  "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
21638};
21639#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
21640
21641/* Return 0 if mktime fails to convert a date in the spring-forward gap.
21642   Based on a problem report from Andreas Jaeger.  */
21643static int
21644spring_forward_gap ()
21645{
21646  /* glibc (up to about 1998-10-07) failed this test. */
21647  struct tm tm;
21648
21649  /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
21650     instead of "TZ=America/Vancouver" in order to detect the bug even
21651     on systems that don't support the Olson extension, or don't have the
21652     full zoneinfo tables installed.  */
21653  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
21654
21655  tm.tm_year = 98;
21656  tm.tm_mon = 3;
21657  tm.tm_mday = 5;
21658  tm.tm_hour = 2;
21659  tm.tm_min = 0;
21660  tm.tm_sec = 0;
21661  tm.tm_isdst = -1;
21662  return mktime (&tm) != (time_t) -1;
21663}
21664
21665static int
21666mktime_test1 (time_t now)
21667{
21668  struct tm *lt;
21669  return ! (lt = localtime (&now)) || mktime (lt) == now;
21670}
21671
21672static int
21673mktime_test (time_t now)
21674{
21675  return (mktime_test1 (now)
21676          && mktime_test1 ((time_t) (time_t_max - now))
21677          && mktime_test1 ((time_t) (time_t_min + now)));
21678}
21679
21680static int
21681irix_6_4_bug ()
21682{
21683  /* Based on code from Ariel Faigon.  */
21684  struct tm tm;
21685  tm.tm_year = 96;
21686  tm.tm_mon = 3;
21687  tm.tm_mday = 0;
21688  tm.tm_hour = 0;
21689  tm.tm_min = 0;
21690  tm.tm_sec = 0;
21691  tm.tm_isdst = -1;
21692  mktime (&tm);
21693  return tm.tm_mon == 2 && tm.tm_mday == 31;
21694}
21695
21696static int
21697bigtime_test (int j)
21698{
21699  struct tm tm;
21700  time_t now;
21701  tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
21702  now = mktime (&tm);
21703  if (now != (time_t) -1)
21704    {
21705      struct tm *lt = localtime (&now);
21706      if (! (lt
21707             && lt->tm_year == tm.tm_year
21708             && lt->tm_mon == tm.tm_mon
21709             && lt->tm_mday == tm.tm_mday
21710             && lt->tm_hour == tm.tm_hour
21711             && lt->tm_min == tm.tm_min
21712             && lt->tm_sec == tm.tm_sec
21713             && lt->tm_yday == tm.tm_yday
21714             && lt->tm_wday == tm.tm_wday
21715             && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
21716                  == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
21717        return 0;
21718    }
21719  return 1;
21720}
21721
21722static int
21723year_2050_test ()
21724{
21725  /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
21726     ignoring leap seconds.  */
21727  unsigned long int answer = 2527315200UL;
21728
21729  struct tm tm;
21730  time_t t;
21731  tm.tm_year = 2050 - 1900;
21732  tm.tm_mon = 2 - 1;
21733  tm.tm_mday = 1;
21734  tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
21735  tm.tm_isdst = -1;
21736
21737  /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
21738     instead of "TZ=America/Vancouver" in order to detect the bug even
21739     on systems that don't support the Olson extension, or don't have the
21740     full zoneinfo tables installed.  */
21741  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
21742
21743  t = mktime (&tm);
21744
21745  /* Check that the result is either a failure, or close enough
21746     to the correct answer that we can assume the discrepancy is
21747     due to leap seconds.  */
21748  return (t == (time_t) -1
21749          || (0 < t && answer - 120 <= t && t <= answer + 120));
21750}
21751
21752int
21753main ()
21754{
21755  int result = 0;
21756  time_t t, delta;
21757  int i, j;
21758  int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
21759
21760#if HAVE_DECL_ALARM
21761  /* This test makes some buggy mktime implementations loop.
21762     Give up after 60 seconds; a mktime slower than that
21763     isn't worth using anyway.  */
21764  signal (SIGALRM, SIG_DFL);
21765  alarm (60);
21766#endif
21767
21768  time_t_max = (! TIME_T_IS_SIGNED
21769                ? (time_t) -1
21770                : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
21771                   * 2 + 1));
21772  time_t_min = (! TIME_T_IS_SIGNED
21773                ? (time_t) 0
21774                : time_t_signed_magnitude
21775                ? ~ (time_t) 0
21776                : ~ time_t_max);
21777
21778  delta = time_t_max / 997; /* a suitable prime number */
21779  for (i = 0; i < N_STRINGS; i++)
21780    {
21781      if (tz_strings[i])
21782        putenv (tz_strings[i]);
21783
21784      for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta)
21785        if (! mktime_test (t))
21786          result |= 1;
21787      if ((result & 2) == 0
21788          && ! (mktime_test ((time_t) 1)
21789                && mktime_test ((time_t) (60 * 60))
21790                && mktime_test ((time_t) (60 * 60 * 24))))
21791        result |= 2;
21792
21793      for (j = 1; (result & 4) == 0; j <<= 1)
21794        {
21795          if (! bigtime_test (j))
21796            result |= 4;
21797          if (INT_MAX / 2 < j)
21798            break;
21799        }
21800      if ((result & 8) == 0 && ! bigtime_test (INT_MAX))
21801        result |= 8;
21802    }
21803  if (! irix_6_4_bug ())
21804    result |= 16;
21805  if (! spring_forward_gap ())
21806    result |= 32;
21807  if (! year_2050_test ())
21808    result |= 64;
21809  return result;
21810}
21811_ACEOF
21812if ac_fn_c_try_run "$LINENO"; then :
21813  gl_cv_func_working_mktime=yes
21814else
21815  gl_cv_func_working_mktime=no
21816fi
21817rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
21818  conftest.$ac_objext conftest.beam conftest.$ac_ext
21819fi
21820
21821
21822fi
21823{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mktime" >&5
21824$as_echo "$gl_cv_func_working_mktime" >&6; }
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834  GNULIB_PSELECT=0;
21835  GNULIB_SELECT=0;
21836    HAVE_PSELECT=1;
21837  REPLACE_PSELECT=0;
21838  REPLACE_SELECT=0;
21839
21840
21841
21842
21843
21844
21845  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/select.h> is self-contained" >&5
21846$as_echo_n "checking whether <sys/select.h> is self-contained... " >&6; }
21847if ${gl_cv_header_sys_select_h_selfcontained+:} false; then :
21848  $as_echo_n "(cached) " >&6
21849else
21850
21851                                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21852/* end confdefs.h.  */
21853#include <sys/select.h>
21854int
21855main ()
21856{
21857struct timeval b;
21858  ;
21859  return 0;
21860}
21861_ACEOF
21862if ac_fn_c_try_compile "$LINENO"; then :
21863  gl_cv_header_sys_select_h_selfcontained=yes
21864else
21865  gl_cv_header_sys_select_h_selfcontained=no
21866fi
21867rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21868                        if test $gl_cv_header_sys_select_h_selfcontained = yes; then
21869        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21870/* end confdefs.h.  */
21871#include <sys/select.h>
21872int
21873main ()
21874{
21875int memset; int bzero;
21876  ;
21877  return 0;
21878}
21879
21880_ACEOF
21881if ac_fn_c_try_compile "$LINENO"; then :
21882  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21883/* end confdefs.h.  */
21884#include <sys/select.h>
21885int
21886main ()
21887{
21888
21889                  #undef memset
21890                  #define memset nonexistent_memset
21891                  extern
21892                  #ifdef __cplusplus
21893                  "C"
21894                  #endif
21895                  void *memset (void *, int, unsigned long);
21896                  #undef bzero
21897                  #define bzero nonexistent_bzero
21898                  extern
21899                  #ifdef __cplusplus
21900                  "C"
21901                  #endif
21902                  void bzero (void *, unsigned long);
21903                  fd_set fds;
21904                  FD_ZERO (&fds);
21905
21906  ;
21907  return 0;
21908}
21909
21910_ACEOF
21911if ac_fn_c_try_link "$LINENO"; then :
21912
21913else
21914  gl_cv_header_sys_select_h_selfcontained=no
21915fi
21916rm -f core conftest.err conftest.$ac_objext \
21917    conftest$ac_exeext conftest.$ac_ext
21918
21919fi
21920rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21921      fi
21922
21923fi
21924{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5
21925$as_echo "$gl_cv_header_sys_select_h_selfcontained" >&6; }
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935     if test $gl_cv_have_include_next = yes; then
21936       gl_cv_next_sys_select_h='<'sys/select.h'>'
21937     else
21938       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/select.h>" >&5
21939$as_echo_n "checking absolute name of <sys/select.h>... " >&6; }
21940if ${gl_cv_next_sys_select_h+:} false; then :
21941  $as_echo_n "(cached) " >&6
21942else
21943
21944             if test $ac_cv_header_sys_select_h = yes; then
21945
21946
21947
21948
21949  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21950/* end confdefs.h.  */
21951#include <sys/select.h>
21952_ACEOF
21953                case "$host_os" in
21954    aix*) gl_absname_cpp="$ac_cpp -C" ;;
21955    *)    gl_absname_cpp="$ac_cpp" ;;
21956  esac
21957
21958  case "$host_os" in
21959    mingw*)
21960                                          gl_dirsep_regex='[/\\]'
21961      ;;
21962    *)
21963      gl_dirsep_regex='\/'
21964      ;;
21965  esac
21966      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
21967  gl_header_literal_regex=`echo 'sys/select.h' \
21968                           | sed -e "$gl_make_literal_regex_sed"`
21969  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
21970      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
21971      s|^/[^/]|//&|
21972      p
21973      q
21974    }'
21975
21976        gl_cv_absolute_sys_select_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
21977  sed -n "$gl_absolute_header_sed"`
21978
21979           gl_header=$gl_cv_absolute_sys_select_h
21980           gl_cv_next_sys_select_h='"'$gl_header'"'
21981          else
21982               gl_cv_next_sys_select_h='<'sys/select.h'>'
21983             fi
21984
21985
21986fi
21987{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5
21988$as_echo "$gl_cv_next_sys_select_h" >&6; }
21989     fi
21990     NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h
21991
21992     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
21993       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
21994       gl_next_as_first_directive='<'sys/select.h'>'
21995     else
21996       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
21997       gl_next_as_first_directive=$gl_cv_next_sys_select_h
21998     fi
21999     NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive
22000
22001
22002
22003
22004  if test $ac_cv_header_sys_select_h = yes; then
22005    HAVE_SYS_SELECT_H=1
22006  else
22007    HAVE_SYS_SELECT_H=0
22008  fi
22009
22010
22011
22012
22013
22014  if test $ac_cv_header_sys_socket_h != yes; then
22015                    for ac_header in winsock2.h
22016do :
22017  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
22018if test "x$ac_cv_header_winsock2_h" = xyes; then :
22019  cat >>confdefs.h <<_ACEOF
22020#define HAVE_WINSOCK2_H 1
22021_ACEOF
22022
22023fi
22024
22025done
22026
22027  fi
22028  if test "$ac_cv_header_winsock2_h" = yes; then
22029    HAVE_WINSOCK2_H=1
22030    UNISTD_H_HAVE_WINSOCK2_H=1
22031    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
22032  else
22033    HAVE_WINSOCK2_H=0
22034  fi
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045  if test $ac_cv_header_sys_socket_h != yes; then
22046                    for ac_header in winsock2.h
22047do :
22048  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
22049if test "x$ac_cv_header_winsock2_h" = xyes; then :
22050  cat >>confdefs.h <<_ACEOF
22051#define HAVE_WINSOCK2_H 1
22052_ACEOF
22053
22054fi
22055
22056done
22057
22058  fi
22059  if test "$ac_cv_header_winsock2_h" = yes; then
22060    HAVE_WINSOCK2_H=1
22061    UNISTD_H_HAVE_WINSOCK2_H=1
22062    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
22063  else
22064    HAVE_WINSOCK2_H=0
22065  fi
22066
22067   LIBSOCKET=
22068  if test $HAVE_WINSOCK2_H = 1; then
22069        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to call WSAStartup in winsock2.h and -lws2_32" >&5
22070$as_echo_n "checking if we need to call WSAStartup in winsock2.h and -lws2_32... " >&6; }
22071if ${gl_cv_func_wsastartup+:} false; then :
22072  $as_echo_n "(cached) " >&6
22073else
22074
22075      gl_save_LIBS="$LIBS"
22076      LIBS="$LIBS -lws2_32"
22077      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22078/* end confdefs.h.  */
22079
22080#ifdef HAVE_WINSOCK2_H
22081# include <winsock2.h>
22082#endif
22083int
22084main ()
22085{
22086
22087          WORD wVersionRequested = MAKEWORD(1, 1);
22088          WSADATA wsaData;
22089          int err = WSAStartup(wVersionRequested, &wsaData);
22090          WSACleanup ();
22091  ;
22092  return 0;
22093}
22094_ACEOF
22095if ac_fn_c_try_link "$LINENO"; then :
22096  gl_cv_func_wsastartup=yes
22097else
22098  gl_cv_func_wsastartup=no
22099fi
22100rm -f core conftest.err conftest.$ac_objext \
22101    conftest$ac_exeext conftest.$ac_ext
22102      LIBS="$gl_save_LIBS"
22103
22104fi
22105{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wsastartup" >&5
22106$as_echo "$gl_cv_func_wsastartup" >&6; }
22107    if test "$gl_cv_func_wsastartup" = "yes"; then
22108
22109$as_echo "#define WINDOWS_SOCKETS 1" >>confdefs.h
22110
22111      LIBSOCKET='-lws2_32'
22112    fi
22113  else
22114                                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5
22115$as_echo_n "checking for library containing setsockopt... " >&6; }
22116if ${gl_cv_lib_socket+:} false; then :
22117  $as_echo_n "(cached) " >&6
22118else
22119
22120      gl_cv_lib_socket=
22121      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22122/* end confdefs.h.  */
22123extern
22124#ifdef __cplusplus
22125"C"
22126#endif
22127char setsockopt();
22128int
22129main ()
22130{
22131setsockopt();
22132  ;
22133  return 0;
22134}
22135_ACEOF
22136if ac_fn_c_try_link "$LINENO"; then :
22137
22138else
22139  gl_save_LIBS="$LIBS"
22140         LIBS="$gl_save_LIBS -lsocket"
22141         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22142/* end confdefs.h.  */
22143extern
22144#ifdef __cplusplus
22145"C"
22146#endif
22147char setsockopt();
22148int
22149main ()
22150{
22151setsockopt();
22152  ;
22153  return 0;
22154}
22155_ACEOF
22156if ac_fn_c_try_link "$LINENO"; then :
22157  gl_cv_lib_socket="-lsocket"
22158fi
22159rm -f core conftest.err conftest.$ac_objext \
22160    conftest$ac_exeext conftest.$ac_ext
22161         if test -z "$gl_cv_lib_socket"; then
22162           LIBS="$gl_save_LIBS -lnetwork"
22163           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22164/* end confdefs.h.  */
22165extern
22166#ifdef __cplusplus
22167"C"
22168#endif
22169char setsockopt();
22170int
22171main ()
22172{
22173setsockopt();
22174  ;
22175  return 0;
22176}
22177_ACEOF
22178if ac_fn_c_try_link "$LINENO"; then :
22179  gl_cv_lib_socket="-lnetwork"
22180fi
22181rm -f core conftest.err conftest.$ac_objext \
22182    conftest$ac_exeext conftest.$ac_ext
22183           if test -z "$gl_cv_lib_socket"; then
22184             LIBS="$gl_save_LIBS -lnet"
22185             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22186/* end confdefs.h.  */
22187extern
22188#ifdef __cplusplus
22189"C"
22190#endif
22191char setsockopt();
22192int
22193main ()
22194{
22195setsockopt();
22196  ;
22197  return 0;
22198}
22199_ACEOF
22200if ac_fn_c_try_link "$LINENO"; then :
22201  gl_cv_lib_socket="-lnet"
22202fi
22203rm -f core conftest.err conftest.$ac_objext \
22204    conftest$ac_exeext conftest.$ac_ext
22205           fi
22206         fi
22207         LIBS="$gl_save_LIBS"
22208
22209fi
22210rm -f core conftest.err conftest.$ac_objext \
22211    conftest$ac_exeext conftest.$ac_ext
22212      if test -z "$gl_cv_lib_socket"; then
22213        gl_cv_lib_socket="none needed"
22214      fi
22215
22216fi
22217{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_socket" >&5
22218$as_echo "$gl_cv_lib_socket" >&6; }
22219    if test "$gl_cv_lib_socket" != "none needed"; then
22220      LIBSOCKET="$gl_cv_lib_socket"
22221    fi
22222  fi
22223
22224
22225
22226
22227
22228
22229  :
22230
22231
22232
22233
22234
22235
22236  if test "$ac_cv_header_winsock2_h" = yes; then
22237    REPLACE_SELECT=1
22238  else
22239
22240    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5
22241$as_echo_n "checking whether select supports a 0 argument... " >&6; }
22242if ${gl_cv_func_select_supports0+:} false; then :
22243  $as_echo_n "(cached) " >&6
22244else
22245
22246        if test "$cross_compiling" = yes; then :
22247
22248           case "$host_os" in
22249                       # Guess no on Interix.
22250             interix*) gl_cv_func_select_supports0="guessing no";;
22251                       # Guess yes otherwise.
22252             *)        gl_cv_func_select_supports0="guessing yes";;
22253           esac
22254
22255else
22256  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22257/* end confdefs.h.  */
22258
22259#include <sys/types.h>
22260#include <sys/time.h>
22261#if HAVE_SYS_SELECT_H
22262#include <sys/select.h>
22263#endif
22264int main ()
22265{
22266  struct timeval timeout;
22267  timeout.tv_sec = 0;
22268  timeout.tv_usec = 5;
22269  return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0;
22270}
22271_ACEOF
22272if ac_fn_c_try_run "$LINENO"; then :
22273  gl_cv_func_select_supports0=yes
22274else
22275  gl_cv_func_select_supports0=no
22276fi
22277rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22278  conftest.$ac_objext conftest.beam conftest.$ac_ext
22279fi
22280
22281
22282fi
22283{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5
22284$as_echo "$gl_cv_func_select_supports0" >&6; }
22285    case "$gl_cv_func_select_supports0" in
22286      *yes) ;;
22287      *) REPLACE_SELECT=1 ;;
22288    esac
22289
22290        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5
22291$as_echo_n "checking whether select detects invalid fds... " >&6; }
22292if ${gl_cv_func_select_detects_ebadf+:} false; then :
22293  $as_echo_n "(cached) " >&6
22294else
22295
22296        if test "$cross_compiling" = yes; then :
22297
22298           case "$host_os" in
22299                             # Guess yes on Linux systems.
22300            linux-* | linux) gl_cv_func_select_detects_ebadf="guessing yes" ;;
22301                             # Guess yes on glibc systems.
22302            *-gnu* | gnu*)   gl_cv_func_select_detects_ebadf="guessing yes" ;;
22303                             # If we don't know, assume the worst.
22304            *)               gl_cv_func_select_detects_ebadf="guessing no" ;;
22305           esac
22306
22307else
22308  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22309/* end confdefs.h.  */
22310
22311#include <sys/types.h>
22312#include <sys/time.h>
22313#if HAVE_SYS_SELECT_H
22314# include <sys/select.h>
22315#endif
22316#include <unistd.h>
22317#include <errno.h>
22318
22319int
22320main ()
22321{
22322
22323  fd_set set;
22324  dup2(0, 16);
22325  FD_ZERO(&set);
22326  FD_SET(16, &set);
22327  close(16);
22328  struct timeval timeout;
22329  timeout.tv_sec = 0;
22330  timeout.tv_usec = 5;
22331  return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF;
22332
22333  ;
22334  return 0;
22335}
22336_ACEOF
22337if ac_fn_c_try_run "$LINENO"; then :
22338  gl_cv_func_select_detects_ebadf=yes
22339else
22340  gl_cv_func_select_detects_ebadf=no
22341fi
22342rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22343  conftest.$ac_objext conftest.beam conftest.$ac_ext
22344fi
22345
22346
22347fi
22348{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5
22349$as_echo "$gl_cv_func_select_detects_ebadf" >&6; }
22350    case $gl_cv_func_select_detects_ebadf in
22351      *yes) ;;
22352      *) REPLACE_SELECT=1 ;;
22353    esac
22354  fi
22355
22356    LIB_SELECT="$LIBSOCKET"
22357  if test $REPLACE_SELECT = 1; then
22358    case "$host_os" in
22359      mingw*)
22360                                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22361/* end confdefs.h.  */
22362
22363#define WIN32_LEAN_AND_MEAN
22364#include <windows.h>
22365int
22366main ()
22367{
22368  MsgWaitForMultipleObjects (0, NULL, 0, 0, 0);
22369  return 0;
22370}
22371_ACEOF
22372if ac_fn_c_try_link "$LINENO"; then :
22373
22374else
22375  LIB_SELECT="$LIB_SELECT -luser32"
22376fi
22377rm -f core conftest.err conftest.$ac_objext \
22378    conftest$ac_exeext conftest.$ac_ext
22379        ;;
22380    esac
22381  fi
22382
22383
22384
22385
22386{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
22387$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
22388if ${ac_cv_struct_tm+:} false; then :
22389  $as_echo_n "(cached) " >&6
22390else
22391  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22392/* end confdefs.h.  */
22393#include <sys/types.h>
22394#include <time.h>
22395
22396int
22397main ()
22398{
22399struct tm tm;
22400				     int *p = &tm.tm_sec;
22401				     return !p;
22402  ;
22403  return 0;
22404}
22405_ACEOF
22406if ac_fn_c_try_compile "$LINENO"; then :
22407  ac_cv_struct_tm=time.h
22408else
22409  ac_cv_struct_tm=sys/time.h
22410fi
22411rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22412fi
22413{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
22414$as_echo "$ac_cv_struct_tm" >&6; }
22415if test $ac_cv_struct_tm = sys/time.h; then
22416
22417$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
22418
22419fi
22420
22421ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
22422#include <$ac_cv_struct_tm>
22423
22424"
22425if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
22426
22427cat >>confdefs.h <<_ACEOF
22428#define HAVE_STRUCT_TM_TM_ZONE 1
22429_ACEOF
22430
22431
22432fi
22433
22434if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
22435
22436$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
22437
22438else
22439  ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h>
22440"
22441if test "x$ac_cv_have_decl_tzname" = xyes; then :
22442  ac_have_decl=1
22443else
22444  ac_have_decl=0
22445fi
22446
22447cat >>confdefs.h <<_ACEOF
22448#define HAVE_DECL_TZNAME $ac_have_decl
22449_ACEOF
22450
22451  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
22452$as_echo_n "checking for tzname... " >&6; }
22453if ${ac_cv_var_tzname+:} false; then :
22454  $as_echo_n "(cached) " >&6
22455else
22456  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22457/* end confdefs.h.  */
22458#include <time.h>
22459#if !HAVE_DECL_TZNAME
22460extern char *tzname[];
22461#endif
22462
22463int
22464main ()
22465{
22466return tzname[0][0];
22467  ;
22468  return 0;
22469}
22470_ACEOF
22471if ac_fn_c_try_link "$LINENO"; then :
22472  ac_cv_var_tzname=yes
22473else
22474  ac_cv_var_tzname=no
22475fi
22476rm -f core conftest.err conftest.$ac_objext \
22477    conftest$ac_exeext conftest.$ac_ext
22478fi
22479{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
22480$as_echo "$ac_cv_var_tzname" >&6; }
22481  if test $ac_cv_var_tzname = yes; then
22482
22483$as_echo "#define HAVE_TZNAME 1" >>confdefs.h
22484
22485  fi
22486fi
22487
22488
22489 ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h>
22490"
22491if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then :
22492
22493$as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h
22494
22495fi
22496
22497
22498{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
22499$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
22500if ${ac_cv_header_stdbool_h+:} false; then :
22501  $as_echo_n "(cached) " >&6
22502else
22503  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22504/* end confdefs.h.  */
22505
22506             #include <stdbool.h>
22507
22508             #ifdef __cplusplus
22509              typedef bool Bool;
22510             #else
22511              typedef _Bool Bool;
22512              #ifndef bool
22513               "error: bool is not defined"
22514              #endif
22515              #ifndef false
22516               "error: false is not defined"
22517              #endif
22518              #if false
22519               "error: false is not 0"
22520              #endif
22521              #ifndef true
22522               "error: true is not defined"
22523              #endif
22524              #if true != 1
22525               "error: true is not 1"
22526              #endif
22527             #endif
22528
22529             #ifndef __bool_true_false_are_defined
22530              "error: __bool_true_false_are_defined is not defined"
22531             #endif
22532
22533             struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
22534
22535             char a[true == 1 ? 1 : -1];
22536             char b[false == 0 ? 1 : -1];
22537             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
22538             char d[(bool) 0.5 == true ? 1 : -1];
22539             /* See body of main program for 'e'.  */
22540             char f[(Bool) 0.0 == false ? 1 : -1];
22541             char g[true];
22542             char h[sizeof (Bool)];
22543             char i[sizeof s.t];
22544             enum { j = false, k = true, l = false * true, m = true * 256 };
22545             /* The following fails for
22546                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
22547             Bool n[m];
22548             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
22549             char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
22550             /* Catch a bug in an HP-UX C compiler.  See
22551                https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
22552                https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
22553              */
22554             Bool q = true;
22555             Bool *pq = &q;
22556             bool *qq = &q;
22557
22558int
22559main ()
22560{
22561
22562             bool e = &s;
22563             *pq |= q; *pq |= ! q;
22564             *qq |= q; *qq |= ! q;
22565             /* Refer to every declared value, to avoid compiler optimizations.  */
22566             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
22567                     + !m + !n + !o + !p + !q + !pq + !qq);
22568
22569  ;
22570  return 0;
22571}
22572_ACEOF
22573if ac_fn_c_try_compile "$LINENO"; then :
22574  ac_cv_header_stdbool_h=yes
22575else
22576  ac_cv_header_stdbool_h=no
22577fi
22578rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22579fi
22580{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
22581$as_echo "$ac_cv_header_stdbool_h" >&6; }
22582   ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
22583if test "x$ac_cv_type__Bool" = xyes; then :
22584
22585cat >>confdefs.h <<_ACEOF
22586#define HAVE__BOOL 1
22587_ACEOF
22588
22589
22590fi
22591
22592
22593
22594
22595
22596  # Define two additional variables used in the Makefile substitution.
22597
22598  if test "$ac_cv_header_stdbool_h" = yes; then
22599    STDBOOL_H=''
22600  else
22601    STDBOOL_H='stdbool.h'
22602  fi
22603
22604   if test -n "$STDBOOL_H"; then
22605  GL_GENERATE_STDBOOL_H_TRUE=
22606  GL_GENERATE_STDBOOL_H_FALSE='#'
22607else
22608  GL_GENERATE_STDBOOL_H_TRUE='#'
22609  GL_GENERATE_STDBOOL_H_FALSE=
22610fi
22611
22612
22613  if test "$ac_cv_type__Bool" = yes; then
22614    HAVE__BOOL=1
22615  else
22616    HAVE__BOOL=0
22617  fi
22618
22619
22620
22621  # parse-datetime.y works with bison only.
22622  : ${YACC='bison -y'}
22623
22624
22625  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compound literals" >&5
22626$as_echo_n "checking for compound literals... " >&6; }
22627if ${gl_cv_compound_literals+:} false; then :
22628  $as_echo_n "(cached) " >&6
22629else
22630  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22631/* end confdefs.h.  */
22632struct s { int i, j; };
22633int
22634main ()
22635{
22636struct s t = (struct s) { 3, 4 };
22637        if (t.i != 0) return 0;
22638  ;
22639  return 0;
22640}
22641_ACEOF
22642if ac_fn_c_try_compile "$LINENO"; then :
22643  gl_cv_compound_literals=yes
22644else
22645  gl_cv_compound_literals=no
22646fi
22647rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22648fi
22649{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compound_literals" >&5
22650$as_echo "$gl_cv_compound_literals" >&6; }
22651  if test $gl_cv_compound_literals = yes; then
22652
22653$as_echo "#define HAVE_COMPOUND_LITERALS 1" >>confdefs.h
22654
22655  fi
22656
22657{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for external symbol _system_configuration" >&5
22658$as_echo_n "checking for external symbol _system_configuration... " >&6; }
22659if ${gl_cv_var__system_configuration+:} false; then :
22660  $as_echo_n "(cached) " >&6
22661else
22662  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22663/* end confdefs.h.  */
22664#include <sys/systemcfg.h>
22665
22666int
22667main ()
22668{
22669double x = _system_configuration.physmem;
22670                        if (x > 0.0) return 0;
22671  ;
22672  return 0;
22673}
22674_ACEOF
22675if ac_fn_c_try_link "$LINENO"; then :
22676  gl_cv_var__system_configuration=yes
22677else
22678  gl_cv_var__system_configuration=no
22679fi
22680rm -f core conftest.err conftest.$ac_objext \
22681    conftest$ac_exeext conftest.$ac_ext
22682fi
22683{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var__system_configuration" >&5
22684$as_echo "$gl_cv_var__system_configuration" >&6; }
22685
22686    if test $gl_cv_var__system_configuration = yes; then
22687
22688$as_echo "#define HAVE__SYSTEM_CONFIGURATION 1" >>confdefs.h
22689
22690    fi
22691
22692
22693
22694
22695
22696
22697
22698  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for desired default level of POSIX conformance" >&5
22699$as_echo_n "checking for desired default level of POSIX conformance... " >&6; }
22700  gl_default_posix2_version=none-specified
22701  if test -n "$ac_cv_env_DEFAULT_POSIX2_VERSION_set"; then
22702    gl_default_posix2_version=$ac_cv_env_DEFAULT_POSIX2_VERSION_value
22703
22704cat >>confdefs.h <<_ACEOF
22705#define DEFAULT_POSIX2_VERSION $gl_default_posix2_version
22706_ACEOF
22707
22708  fi
22709  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_default_posix2_version" >&5
22710$as_echo "$gl_default_posix2_version" >&6; }
22711
22712
22713
22714
22715
22716    HAVE_PTHREAD_H=1;
22717  HAVE_PTHREAD_T=1;
22718  HAVE_PTHREAD_SPINLOCK_T=1;
22719
22720
22721
22722
22723  GNULIB_PTHREAD_SIGMASK=0;
22724  GNULIB_RAISE=0;
22725  GNULIB_SIGNAL_H_SIGPIPE=0;
22726  GNULIB_SIGPROCMASK=0;
22727  GNULIB_SIGACTION=0;
22728    HAVE_POSIX_SIGNALBLOCKING=1;
22729  HAVE_PTHREAD_SIGMASK=1;
22730  HAVE_RAISE=1;
22731  HAVE_SIGSET_T=1;
22732  HAVE_SIGINFO_T=1;
22733  HAVE_SIGACTION=1;
22734  HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
22735
22736  HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
22737
22738  HAVE_SIGHANDLER_T=1;
22739  REPLACE_PTHREAD_SIGMASK=0;
22740  REPLACE_RAISE=0;
22741
22742
22743  ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
22744      #include <signal.h>
22745      /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.  */
22746      #include <sys/types.h>
22747
22748"
22749if test "x$ac_cv_type_sigset_t" = xyes; then :
22750
22751cat >>confdefs.h <<_ACEOF
22752#define HAVE_SIGSET_T 1
22753_ACEOF
22754
22755gl_cv_type_sigset_t=yes
22756else
22757  gl_cv_type_sigset_t=no
22758fi
22759
22760  if test $gl_cv_type_sigset_t != yes; then
22761    HAVE_SIGSET_T=0
22762  fi
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5
22776$as_echo_n "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; }
22777if ${ac_cv_gnu_library_2_1+:} false; then :
22778  $as_echo_n "(cached) " >&6
22779else
22780  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22781/* end confdefs.h.  */
22782
22783#include <features.h>
22784#ifdef __GNU_LIBRARY__
22785 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
22786  Lucky GNU user
22787 #endif
22788#endif
22789#ifdef __UCLIBC__
22790 Lucky user
22791#endif
22792
22793_ACEOF
22794if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
22795  $EGREP "Lucky" >/dev/null 2>&1; then :
22796  ac_cv_gnu_library_2_1=yes
22797else
22798  ac_cv_gnu_library_2_1=no
22799fi
22800rm -f conftest*
22801
22802
22803
22804fi
22805{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5
22806$as_echo "$ac_cv_gnu_library_2_1" >&6; }
22807
22808    GLIBC21="$ac_cv_gnu_library_2_1"
22809
22810
22811
22812
22813
22814  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
22815$as_echo_n "checking whether rmdir works... " >&6; }
22816if ${gl_cv_func_rmdir_works+:} false; then :
22817  $as_echo_n "(cached) " >&6
22818else
22819  mkdir conftest.dir
22820     touch conftest.file
22821     if test "$cross_compiling" = yes; then :
22822  case "$host_os" in
22823                           # Guess yes on Linux systems.
22824          linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
22825                           # Guess yes on glibc systems.
22826          *-gnu* | gnu*)   gl_cv_func_rmdir_works="guessing yes" ;;
22827                           # Guess no on native Windows.
22828          mingw*)          gl_cv_func_rmdir_works="guessing no" ;;
22829                           # If we don't know, assume the worst.
22830          *)               gl_cv_func_rmdir_works="guessing no" ;;
22831        esac
22832
22833else
22834  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22835/* end confdefs.h.  */
22836#include <stdio.h>
22837           #include <errno.h>
22838           #if HAVE_UNISTD_H
22839           # include <unistd.h>
22840           #else /* on Windows with MSVC */
22841           # include <direct.h>
22842           #endif
22843
22844int
22845main ()
22846{
22847int result = 0;
22848      if (!rmdir ("conftest.file/"))
22849        result |= 1;
22850      else if (errno != ENOTDIR)
22851        result |= 2;
22852      if (!rmdir ("conftest.dir/./"))
22853        result |= 4;
22854      return result;
22855
22856  ;
22857  return 0;
22858}
22859_ACEOF
22860if ac_fn_c_try_run "$LINENO"; then :
22861  gl_cv_func_rmdir_works=yes
22862else
22863  gl_cv_func_rmdir_works=no
22864fi
22865rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22866  conftest.$ac_objext conftest.beam conftest.$ac_ext
22867fi
22868
22869     rm -rf conftest.dir conftest.file
22870fi
22871{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
22872$as_echo "$gl_cv_func_rmdir_works" >&6; }
22873  case "$gl_cv_func_rmdir_works" in
22874    *yes) ;;
22875    *)
22876      REPLACE_RMDIR=1
22877      ;;
22878  esac
22879
22880
22881
22882
22883
22884
22885    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unlink honors trailing slashes" >&5
22886$as_echo_n "checking whether unlink honors trailing slashes... " >&6; }
22887if ${gl_cv_func_unlink_honors_slashes+:} false; then :
22888  $as_echo_n "(cached) " >&6
22889else
22890  touch conftest.file
22891     # Assume that if we have lstat, we can also check symlinks.
22892     if test $ac_cv_func_lstat = yes; then
22893       ln -s conftest.file conftest.lnk
22894     fi
22895     if test "$cross_compiling" = yes; then :
22896  case "$host_os" in
22897                          # Guess yes on Linux systems.
22898         linux-* | linux) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
22899                          # Guess yes on glibc systems.
22900         *-gnu*)          gl_cv_func_unlink_honors_slashes="guessing yes" ;;
22901                          # Guess no on native Windows.
22902         mingw*)          gl_cv_func_unlink_honors_slashes="guessing no" ;;
22903                          # If we don't know, assume the worst.
22904         *)               gl_cv_func_unlink_honors_slashes="guessing no" ;;
22905       esac
22906
22907else
22908  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22909/* end confdefs.h.  */
22910#if HAVE_UNISTD_H
22911           # include <unistd.h>
22912           #else /* on Windows with MSVC */
22913           # include <io.h>
22914           #endif
22915           #include <errno.h>
22916
22917int
22918main ()
22919{
22920int result = 0;
22921           if (!unlink ("conftest.file/"))
22922             result |= 1;
22923           else if (errno != ENOTDIR)
22924             result |= 2;
22925#if HAVE_LSTAT
22926           if (!unlink ("conftest.lnk/"))
22927             result |= 4;
22928           else if (errno != ENOTDIR)
22929             result |= 8;
22930#endif
22931           return result;
22932
22933  ;
22934  return 0;
22935}
22936_ACEOF
22937if ac_fn_c_try_run "$LINENO"; then :
22938  gl_cv_func_unlink_honors_slashes=yes
22939else
22940  gl_cv_func_unlink_honors_slashes=no
22941fi
22942rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
22943  conftest.$ac_objext conftest.beam conftest.$ac_ext
22944fi
22945
22946     rm -f conftest.file conftest.lnk
22947fi
22948{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_honors_slashes" >&5
22949$as_echo "$gl_cv_func_unlink_honors_slashes" >&6; }
22950  case "$gl_cv_func_unlink_honors_slashes" in
22951    *no)
22952      REPLACE_UNLINK=1
22953      ;;
22954  esac
22955
22956      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unlink of a parent directory fails as it should" >&5
22957$as_echo_n "checking whether unlink of a parent directory fails as it should... " >&6; }
22958if ${gl_cv_func_unlink_parent_fails+:} false; then :
22959  $as_echo_n "(cached) " >&6
22960else
22961  case "$host_os" in
22962       darwin*)
22963                                                      if {
22964              # Use the mktemp program if available. If not available, hide the error
22965              # message.
22966              tmp=`(umask 077 && mktemp -d /tmp/gtXXXXXX) 2>/dev/null` &&
22967              test -n "$tmp" && test -d "$tmp"
22968            } ||
22969            {
22970              # Use a simple mkdir command. It is guaranteed to fail if the directory
22971              # already exists.  $RANDOM is bash specific and expands to empty in shells
22972              # other than bash, ksh and zsh.  Its use does not increase security;
22973              # rather, it minimizes the probability of failure in a very cluttered /tmp
22974              # directory.
22975              tmp=/tmp/gt$$-$RANDOM
22976              (umask 077 && mkdir "$tmp")
22977            }; then
22978           mkdir "$tmp/subdir"
22979           GL_SUBDIR_FOR_UNLINK="$tmp/subdir"
22980           export GL_SUBDIR_FOR_UNLINK
22981           if test "$cross_compiling" = yes; then :
22982  # If we don't know, assume the worst.
22983              gl_cv_func_unlink_parent_fails="guessing no"
22984
22985else
22986  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22987/* end confdefs.h.  */
22988
22989                #include <stdlib.h>
22990                #if HAVE_UNISTD_H
22991                # include <unistd.h>
22992                #else /* on Windows with MSVC */
22993                # include <direct.h>
22994                # include <io.h>
22995                #endif
22996                int main ()
22997                {
22998                  int result = 0;
22999                  if (chdir (getenv ("GL_SUBDIR_FOR_UNLINK")) != 0)
23000                    result |= 1;
23001                  else if (unlink ("..") == 0)
23002                    result |= 2;
23003                  return result;
23004                }
23005
23006_ACEOF
23007if ac_fn_c_try_run "$LINENO"; then :
23008  gl_cv_func_unlink_parent_fails=yes
23009else
23010  gl_cv_func_unlink_parent_fails=no
23011fi
23012rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23013  conftest.$ac_objext conftest.beam conftest.$ac_ext
23014fi
23015
23016           unset GL_SUBDIR_FOR_UNLINK
23017           rm -rf "$tmp"
23018         else
23019           gl_cv_func_unlink_parent_fails="guessing no"
23020         fi
23021         ;;
23022       *)
23023         gl_cv_func_unlink_parent_fails="guessing yes"
23024         ;;
23025     esac
23026
23027fi
23028{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_parent_fails" >&5
23029$as_echo "$gl_cv_func_unlink_parent_fails" >&6; }
23030  case "$gl_cv_func_unlink_parent_fails" in
23031    *no)
23032      REPLACE_UNLINK=1
23033
23034$as_echo "#define UNLINK_PARENT_BUG 1" >>confdefs.h
23035
23036      ;;
23037  esac
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048# Check whether --with-selinux was given.
23049if test "${with_selinux+set}" = set; then :
23050  withval=$with_selinux;
23051else
23052  with_selinux=maybe
23053fi
23054
23055
23056  LIB_SELINUX=
23057  if test "$with_selinux" != no; then
23058    gl_save_LIBS=$LIBS
23059    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setfilecon" >&5
23060$as_echo_n "checking for library containing setfilecon... " >&6; }
23061if ${ac_cv_search_setfilecon+:} false; then :
23062  $as_echo_n "(cached) " >&6
23063else
23064  ac_func_search_save_LIBS=$LIBS
23065cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23066/* end confdefs.h.  */
23067
23068/* Override any GCC internal prototype to avoid an error.
23069   Use char because int might match the return type of a GCC
23070   builtin and then its argument prototype would still apply.  */
23071#ifdef __cplusplus
23072extern "C"
23073#endif
23074char setfilecon ();
23075int
23076main ()
23077{
23078return setfilecon ();
23079  ;
23080  return 0;
23081}
23082_ACEOF
23083for ac_lib in '' selinux; do
23084  if test -z "$ac_lib"; then
23085    ac_res="none required"
23086  else
23087    ac_res=-l$ac_lib
23088    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
23089  fi
23090  if ac_fn_c_try_link "$LINENO"; then :
23091  ac_cv_search_setfilecon=$ac_res
23092fi
23093rm -f core conftest.err conftest.$ac_objext \
23094    conftest$ac_exeext
23095  if ${ac_cv_search_setfilecon+:} false; then :
23096  break
23097fi
23098done
23099if ${ac_cv_search_setfilecon+:} false; then :
23100
23101else
23102  ac_cv_search_setfilecon=no
23103fi
23104rm conftest.$ac_ext
23105LIBS=$ac_func_search_save_LIBS
23106fi
23107{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setfilecon" >&5
23108$as_echo "$ac_cv_search_setfilecon" >&6; }
23109ac_res=$ac_cv_search_setfilecon
23110if test "$ac_res" != no; then :
23111  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
23112  test "$ac_cv_search_setfilecon" = "none required" ||
23113                    LIB_SELINUX=$ac_cv_search_setfilecon
23114fi
23115
23116    LIBS=$gl_save_LIBS
23117  fi
23118
23119
23120  # Warn if SELinux is found but libselinux is absent;
23121  if test "$ac_cv_search_setfilecon" = no; then
23122    if test "$host" = "$build" && test -d /selinux; then
23123      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This system supports SELinux but libselinux is missing." >&5
23124$as_echo "$as_me: WARNING: This system supports SELinux but libselinux is missing." >&2;}
23125      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GNU coreutils will be compiled without SELinux support." >&5
23126$as_echo "$as_me: WARNING: GNU coreutils will be compiled without SELinux support." >&2;}
23127    fi
23128    with_selinux=no
23129  fi
23130
23131
23132
23133ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
23134if test "x$ac_cv_have_decl_setenv" = xyes; then :
23135  ac_have_decl=1
23136else
23137  ac_have_decl=0
23138fi
23139
23140cat >>confdefs.h <<_ACEOF
23141#define HAVE_DECL_SETENV $ac_have_decl
23142_ACEOF
23143
23144
23145
23146
23147
23148
23149  if test $ac_cv_have_decl_setenv = no; then
23150    HAVE_DECL_SETENV=0
23151  fi
23152
23153
23154
23155
23156
23157  for ac_header in search.h
23158do :
23159  ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
23160if test "x$ac_cv_header_search_h" = xyes; then :
23161  cat >>confdefs.h <<_ACEOF
23162#define HAVE_SEARCH_H 1
23163_ACEOF
23164
23165fi
23166
23167done
23168
23169  for ac_func in tsearch
23170do :
23171  ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
23172if test "x$ac_cv_func_tsearch" = xyes; then :
23173  cat >>confdefs.h <<_ACEOF
23174#define HAVE_TSEARCH 1
23175_ACEOF
23176
23177fi
23178done
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5
23201$as_echo_n "checking whether snprintf returns a byte count as in C99... " >&6; }
23202if ${gl_cv_func_snprintf_retval_c99+:} false; then :
23203  $as_echo_n "(cached) " >&6
23204else
23205
23206      if test "$cross_compiling" = yes; then :
23207  case "$host_os" in
23208                                 # Guess yes on glibc systems.
23209           *-gnu* | gnu*)        gl_cv_func_snprintf_retval_c99="guessing yes";;
23210                                 # Guess yes on FreeBSD >= 5.
23211           freebsd[1-4].*)       gl_cv_func_snprintf_retval_c99="guessing no";;
23212           freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
23213                                 # Guess yes on Mac OS X >= 10.3.
23214           darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
23215           darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
23216                                 # Guess yes on OpenBSD >= 3.9.
23217           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
23218                                 gl_cv_func_snprintf_retval_c99="guessing no";;
23219           openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
23220                                 # Guess yes on Solaris >= 2.10.
23221           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
23222           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
23223                                 # Guess yes on AIX >= 4.
23224           aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
23225           aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
23226                                 # Guess yes on NetBSD >= 3.
23227           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
23228                                 gl_cv_func_snprintf_retval_c99="guessing no";;
23229           netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
23230                                 # Guess yes on BeOS.
23231           beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
23232                                 # Guess yes on MSVC, no on mingw.
23233           mingw*)               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23234/* end confdefs.h.  */
23235
23236#ifdef _MSC_VER
23237 Known
23238#endif
23239
23240_ACEOF
23241if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
23242  $EGREP "Known" >/dev/null 2>&1; then :
23243  gl_cv_func_snprintf_retval_c99="guessing yes"
23244else
23245  gl_cv_func_snprintf_retval_c99="guessing no"
23246fi
23247rm -f conftest*
23248
23249                                 ;;
23250                                 # If we don't know, assume the worst.
23251           *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
23252         esac
23253
23254else
23255  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23256/* end confdefs.h.  */
23257
23258#include <stdio.h>
23259#include <string.h>
23260#if HAVE_SNPRINTF
23261# define my_snprintf snprintf
23262#else
23263# include <stdarg.h>
23264static int my_snprintf (char *buf, int size, const char *format, ...)
23265{
23266  va_list args;
23267  int ret;
23268  va_start (args, format);
23269  ret = vsnprintf (buf, size, format, args);
23270  va_end (args);
23271  return ret;
23272}
23273#endif
23274static char buf[100];
23275int main ()
23276{
23277  strcpy (buf, "ABCDEF");
23278  if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
23279    return 1;
23280  if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
23281    return 2;
23282  if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
23283    return 3;
23284  return 0;
23285}
23286_ACEOF
23287if ac_fn_c_try_run "$LINENO"; then :
23288  gl_cv_func_snprintf_retval_c99=yes
23289else
23290  gl_cv_func_snprintf_retval_c99=no
23291fi
23292rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23293  conftest.$ac_objext conftest.beam conftest.$ac_ext
23294fi
23295
23296
23297fi
23298{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5
23299$as_echo "$gl_cv_func_snprintf_retval_c99" >&6; }
23300
23301ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
23302if test "x$ac_cv_have_decl_snprintf" = xyes; then :
23303  ac_have_decl=1
23304else
23305  ac_have_decl=0
23306fi
23307
23308cat >>confdefs.h <<_ACEOF
23309#define HAVE_DECL_SNPRINTF $ac_have_decl
23310_ACEOF
23311
23312ac_fn_c_check_decl "$LINENO" "stpncpy" "ac_cv_have_decl_stpncpy" "$ac_includes_default"
23313if test "x$ac_cv_have_decl_stpncpy" = xyes; then :
23314  ac_have_decl=1
23315else
23316  ac_have_decl=0
23317fi
23318
23319cat >>confdefs.h <<_ACEOF
23320#define HAVE_DECL_STPNCPY $ac_have_decl
23321_ACEOF
23322
23323
23324
23325
23326
23327ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
23328if test "x$ac_cv_have_decl_strdup" = xyes; then :
23329  ac_have_decl=1
23330else
23331  ac_have_decl=0
23332fi
23333
23334cat >>confdefs.h <<_ACEOF
23335#define HAVE_DECL_STRDUP $ac_have_decl
23336_ACEOF
23337
23338
23339     REPLACE_STRERROR_0=0
23340  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
23341$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
23342if ${gl_cv_func_strerror_0_works+:} false; then :
23343  $as_echo_n "(cached) " >&6
23344else
23345  if test "$cross_compiling" = yes; then :
23346  case "$host_os" in
23347                        # Guess yes on glibc systems.
23348         *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
23349                        # Guess yes on native Windows.
23350         mingw*)        gl_cv_func_strerror_0_works="guessing yes" ;;
23351                        # If we don't know, assume the worst.
23352         *)             gl_cv_func_strerror_0_works="guessing no" ;;
23353       esac
23354
23355else
23356  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23357/* end confdefs.h.  */
23358#include <string.h>
23359           #include <errno.h>
23360
23361int
23362main ()
23363{
23364int result = 0;
23365           char *str;
23366           errno = 0;
23367           str = strerror (0);
23368           if (!*str) result |= 1;
23369           if (errno) result |= 2;
23370           if (strstr (str, "nknown") || strstr (str, "ndefined"))
23371             result |= 4;
23372           return result;
23373  ;
23374  return 0;
23375}
23376_ACEOF
23377if ac_fn_c_try_run "$LINENO"; then :
23378  gl_cv_func_strerror_0_works=yes
23379else
23380  gl_cv_func_strerror_0_works=no
23381fi
23382rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23383  conftest.$ac_objext conftest.beam conftest.$ac_ext
23384fi
23385
23386
23387fi
23388{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
23389$as_echo "$gl_cv_func_strerror_0_works" >&6; }
23390  case "$gl_cv_func_strerror_0_works" in
23391    *yes) ;;
23392    *)
23393      REPLACE_STRERROR_0=1
23394
23395$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
23396
23397      ;;
23398  esac
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409  if test $ac_cv_func_strerror_r = yes; then
23410    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
23411                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
23412$as_echo_n "checking for strerror_r with POSIX signature... " >&6; }
23413if ${gl_cv_func_strerror_r_posix_signature+:} false; then :
23414  $as_echo_n "(cached) " >&6
23415else
23416  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23417/* end confdefs.h.  */
23418#include <string.h>
23419                int strerror_r (int, char *, size_t);
23420
23421int
23422main ()
23423{
23424
23425  ;
23426  return 0;
23427}
23428_ACEOF
23429if ac_fn_c_try_compile "$LINENO"; then :
23430  gl_cv_func_strerror_r_posix_signature=yes
23431else
23432  gl_cv_func_strerror_r_posix_signature=no
23433fi
23434rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23435
23436fi
23437{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
23438$as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; }
23439      if test $gl_cv_func_strerror_r_posix_signature = yes; then
23440                                                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
23441$as_echo_n "checking whether strerror_r works... " >&6; }
23442if ${gl_cv_func_strerror_r_works+:} false; then :
23443  $as_echo_n "(cached) " >&6
23444else
23445  if test "$cross_compiling" = yes; then :
23446
23447              case "$host_os" in
23448                       # Guess no on AIX.
23449                aix*)  gl_cv_func_strerror_r_works="guessing no";;
23450                       # Guess no on HP-UX.
23451                hpux*) gl_cv_func_strerror_r_works="guessing no";;
23452                       # Guess no on BSD variants.
23453                *bsd*)  gl_cv_func_strerror_r_works="guessing no";;
23454                       # Guess yes otherwise.
23455                *)     gl_cv_func_strerror_r_works="guessing yes";;
23456              esac
23457
23458else
23459  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23460/* end confdefs.h.  */
23461#include <errno.h>
23462                  #include <string.h>
23463
23464int
23465main ()
23466{
23467int result = 0;
23468                  char buf[79];
23469                  if (strerror_r (EACCES, buf, 0) < 0)
23470                    result |= 1;
23471                  errno = 0;
23472                  if (strerror_r (EACCES, buf, sizeof buf) != 0)
23473                    result |= 2;
23474                  strcpy (buf, "Unknown");
23475                  if (strerror_r (0, buf, sizeof buf) != 0)
23476                    result |= 4;
23477                  if (errno)
23478                    result |= 8;
23479                  if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
23480                    result |= 0x10;
23481                  errno = 0;
23482                  *buf = 0;
23483                  if (strerror_r (-3, buf, sizeof buf) < 0)
23484                    result |= 0x20;
23485                  if (errno)
23486                    result |= 0x40;
23487                  if (!*buf)
23488                    result |= 0x80;
23489                  return result;
23490
23491  ;
23492  return 0;
23493}
23494_ACEOF
23495if ac_fn_c_try_run "$LINENO"; then :
23496  gl_cv_func_strerror_r_works=yes
23497else
23498  gl_cv_func_strerror_r_works=no
23499fi
23500rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23501  conftest.$ac_objext conftest.beam conftest.$ac_ext
23502fi
23503
23504
23505fi
23506{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
23507$as_echo "$gl_cv_func_strerror_r_works" >&6; }
23508      else
23509
23510                        if test $ac_cv_func___xpg_strerror_r = yes; then
23511          { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
23512$as_echo_n "checking whether __xpg_strerror_r works... " >&6; }
23513if ${gl_cv_func_strerror_r_works+:} false; then :
23514  $as_echo_n "(cached) " >&6
23515else
23516  if test "$cross_compiling" = yes; then :
23517                                  gl_cv_func_strerror_r_works="guessing no"
23518
23519else
23520  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23521/* end confdefs.h.  */
23522#include <errno.h>
23523                    #include <string.h>
23524                    extern
23525                    #ifdef __cplusplus
23526                    "C"
23527                    #endif
23528                    int __xpg_strerror_r(int, char *, size_t);
23529
23530int
23531main ()
23532{
23533int result = 0;
23534                    char buf[256] = "^";
23535                    char copy[256];
23536                    char *str = strerror (-1);
23537                    strcpy (copy, str);
23538                    if (__xpg_strerror_r (-2, buf, 1) == 0)
23539                      result |= 1;
23540                    if (*buf)
23541                      result |= 2;
23542                    __xpg_strerror_r (-2, buf, 256);
23543                    if (strcmp (str, copy))
23544                      result |= 4;
23545                    return result;
23546
23547  ;
23548  return 0;
23549}
23550_ACEOF
23551if ac_fn_c_try_run "$LINENO"; then :
23552  gl_cv_func_strerror_r_works=yes
23553else
23554  gl_cv_func_strerror_r_works=no
23555fi
23556rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23557  conftest.$ac_objext conftest.beam conftest.$ac_ext
23558fi
23559
23560
23561fi
23562{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
23563$as_echo "$gl_cv_func_strerror_r_works" >&6; }
23564        fi
23565      fi
23566    fi
23567  fi
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580     if test $gl_cv_have_include_next = yes; then
23581       gl_cv_next_string_h='<'string.h'>'
23582     else
23583       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
23584$as_echo_n "checking absolute name of <string.h>... " >&6; }
23585if ${gl_cv_next_string_h+:} false; then :
23586  $as_echo_n "(cached) " >&6
23587else
23588
23589
23590
23591  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23592/* end confdefs.h.  */
23593#include <string.h>
23594_ACEOF
23595                case "$host_os" in
23596    aix*) gl_absname_cpp="$ac_cpp -C" ;;
23597    *)    gl_absname_cpp="$ac_cpp" ;;
23598  esac
23599
23600  case "$host_os" in
23601    mingw*)
23602                                          gl_dirsep_regex='[/\\]'
23603      ;;
23604    *)
23605      gl_dirsep_regex='\/'
23606      ;;
23607  esac
23608      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
23609  gl_header_literal_regex=`echo 'string.h' \
23610                           | sed -e "$gl_make_literal_regex_sed"`
23611  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
23612      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
23613      s|^/[^/]|//&|
23614      p
23615      q
23616    }'
23617
23618        gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
23619  sed -n "$gl_absolute_header_sed"`
23620
23621           gl_header=$gl_cv_absolute_string_h
23622           gl_cv_next_string_h='"'$gl_header'"'
23623
23624
23625fi
23626{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
23627$as_echo "$gl_cv_next_string_h" >&6; }
23628     fi
23629     NEXT_STRING_H=$gl_cv_next_string_h
23630
23631     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
23632       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
23633       gl_next_as_first_directive='<'string.h'>'
23634     else
23635       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
23636       gl_next_as_first_directive=$gl_cv_next_string_h
23637     fi
23638     NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
23654  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
23655  # irrelevant for anonymous mappings.
23656  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
23657if test "x$ac_cv_func_mmap" = xyes; then :
23658  gl_have_mmap=yes
23659else
23660  gl_have_mmap=no
23661fi
23662
23663
23664  # Try to allow MAP_ANONYMOUS.
23665  gl_have_mmap_anonymous=no
23666  if test $gl_have_mmap = yes; then
23667    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
23668$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
23669    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23670/* end confdefs.h.  */
23671
23672#include <sys/mman.h>
23673#ifdef MAP_ANONYMOUS
23674    I cannot identify this map
23675#endif
23676
23677_ACEOF
23678if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
23679  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
23680  gl_have_mmap_anonymous=yes
23681fi
23682rm -f conftest*
23683
23684    if test $gl_have_mmap_anonymous != yes; then
23685      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23686/* end confdefs.h.  */
23687
23688#include <sys/mman.h>
23689#ifdef MAP_ANON
23690    I cannot identify this map
23691#endif
23692
23693_ACEOF
23694if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
23695  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
23696
23697$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
23698
23699         gl_have_mmap_anonymous=yes
23700fi
23701rm -f conftest*
23702
23703    fi
23704    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
23705$as_echo "$gl_have_mmap_anonymous" >&6; }
23706    if test $gl_have_mmap_anonymous = yes; then
23707
23708$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
23709
23710    fi
23711  fi
23712
23713
23714
23715
23716          { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strncat works" >&5
23717$as_echo_n "checking whether strncat works... " >&6; }
23718if ${gl_cv_func_strncat_works+:} false; then :
23719  $as_echo_n "(cached) " >&6
23720else
23721  if test "$cross_compiling" = yes; then :
23722
23723        case "$host_os" in
23724                    # Guess no on Solaris.
23725          solaris*) gl_cv_func_strncat_works="guessing no" ;;
23726                    # Guess yes on native Windows.
23727          mingw*)   gl_cv_func_strncat_works="guessing yes" ;;
23728                    # Guess yes otherwise.
23729          *)        gl_cv_func_strncat_works="guessing yes" ;;
23730        esac
23731
23732else
23733  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23734/* end confdefs.h.  */
23735
23736#include <string.h>
23737#if HAVE_SYS_MMAN_H
23738# include <fcntl.h>
23739# include <unistd.h>
23740# include <sys/types.h>
23741# include <sys/mman.h>
23742# ifndef MAP_FILE
23743#  define MAP_FILE 0
23744# endif
23745#endif
23746
23747int
23748main ()
23749{
23750
23751  char *fence = NULL;
23752#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
23753# if HAVE_MAP_ANONYMOUS
23754  const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
23755  const int fd = -1;
23756# else /* !HAVE_MAP_ANONYMOUS */
23757  const int flags = MAP_FILE | MAP_PRIVATE;
23758  int fd = open ("/dev/zero", O_RDONLY, 0666);
23759  if (fd >= 0)
23760# endif
23761    {
23762      int pagesize = getpagesize ();
23763      char *two_pages =
23764        (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
23765                       flags, fd, 0);
23766      if (two_pages != (char *)(-1)
23767          && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
23768        fence = two_pages + pagesize;
23769    }
23770#endif
23771  if (fence)
23772    {
23773      char dest[8];
23774
23775      dest[0] = '*';
23776      dest[1] = 'a';
23777      dest[2] = '\0';
23778      dest[3] = 'w';
23779      dest[4] = 'x';
23780      dest[5] = 'y';
23781      dest[6] = 'z';
23782
23783      *(fence - 3) = '7';
23784      *(fence - 2) = '2';
23785      *(fence - 1) = '9';
23786
23787      if (strncat (dest + 1, fence - 3, 3) != dest + 1)
23788        return 1;
23789      if (dest[0] != '*')
23790        return 2;
23791      if (dest[1] != 'a'
23792          || dest[2] != '7' || dest[3] != '2' || dest[4] != '9'
23793          || dest[5] != '\0')
23794        return 3;
23795      if (dest[6] != 'z')
23796        return 4;
23797    }
23798  return 0;
23799
23800  ;
23801  return 0;
23802}
23803_ACEOF
23804if ac_fn_c_try_run "$LINENO"; then :
23805  gl_cv_func_strncat_works=yes
23806else
23807  gl_cv_func_strncat_works=no
23808fi
23809rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23810  conftest.$ac_objext conftest.beam conftest.$ac_ext
23811fi
23812
23813
23814fi
23815{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strncat_works" >&5
23816$as_echo "$gl_cv_func_strncat_works" >&6; }
23817  case "$gl_cv_func_strncat_works" in
23818    *yes) ;;
23819    *) REPLACE_STRNCAT=1 ;;
23820  esac
23821
23822ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default"
23823if test "x$ac_cv_have_decl_strndup" = xyes; then :
23824  ac_have_decl=1
23825else
23826  ac_have_decl=0
23827fi
23828
23829cat >>confdefs.h <<_ACEOF
23830#define HAVE_DECL_STRNDUP $ac_have_decl
23831_ACEOF
23832
23833
23834
23835ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
23836if test "x$ac_cv_have_decl_strnlen" = xyes; then :
23837  ac_have_decl=1
23838else
23839  ac_have_decl=0
23840fi
23841
23842cat >>confdefs.h <<_ACEOF
23843#define HAVE_DECL_STRNLEN $ac_have_decl
23844_ACEOF
23845
23846ac_fn_c_check_decl "$LINENO" "strsignal" "ac_cv_have_decl_strsignal" "$ac_includes_default"
23847if test "x$ac_cv_have_decl_strsignal" = xyes; then :
23848  ac_have_decl=1
23849else
23850  ac_have_decl=0
23851fi
23852
23853cat >>confdefs.h <<_ACEOF
23854#define HAVE_DECL_STRSIGNAL $ac_have_decl
23855_ACEOF
23856
23857ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
23858/* NetBSD declares sys_siglist in unistd.h.  */
23859#ifdef HAVE_UNISTD_H
23860# include <unistd.h>
23861#endif
23862
23863"
23864if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
23865  ac_have_decl=1
23866else
23867  ac_have_decl=0
23868fi
23869
23870cat >>confdefs.h <<_ACEOF
23871#define HAVE_DECL_SYS_SIGLIST $ac_have_decl
23872_ACEOF
23873
23874
23875
23876  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp() can be used without linking with libm" >&5
23877$as_echo_n "checking whether ldexp() can be used without linking with libm... " >&6; }
23878if ${gl_cv_func_ldexp_no_libm+:} false; then :
23879  $as_echo_n "(cached) " >&6
23880else
23881
23882      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23883/* end confdefs.h.  */
23884#ifndef __NO_MATH_INLINES
23885                           # define __NO_MATH_INLINES 1 /* for glibc */
23886                           #endif
23887                           #include <math.h>
23888                           double (*funcptr) (double, int) = ldexp;
23889                           double x;
23890int
23891main ()
23892{
23893return ldexp (x, -1) > 0;
23894  ;
23895  return 0;
23896}
23897_ACEOF
23898if ac_fn_c_try_link "$LINENO"; then :
23899  gl_cv_func_ldexp_no_libm=yes
23900else
23901  gl_cv_func_ldexp_no_libm=no
23902fi
23903rm -f core conftest.err conftest.$ac_objext \
23904    conftest$ac_exeext conftest.$ac_ext
23905
23906fi
23907{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5
23908$as_echo "$gl_cv_func_ldexp_no_libm" >&6; }
23909
23910
23911
23912ac_fn_c_check_decl "$LINENO" "strtoimax" "ac_cv_have_decl_strtoimax" "$ac_includes_default"
23913if test "x$ac_cv_have_decl_strtoimax" = xyes; then :
23914  ac_have_decl=1
23915else
23916  ac_have_decl=0
23917fi
23918
23919cat >>confdefs.h <<_ACEOF
23920#define HAVE_DECL_STRTOIMAX $ac_have_decl
23921_ACEOF
23922
23923
23924
23925ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default"
23926if test "x$ac_cv_have_decl_strtoumax" = xyes; then :
23927  ac_have_decl=1
23928else
23929  ac_have_decl=0
23930fi
23931
23932cat >>confdefs.h <<_ACEOF
23933#define HAVE_DECL_STRTOUMAX $ac_have_decl
23934_ACEOF
23935
23936
23937
23938
23939
23940
23941  GNULIB_GETRUSAGE=0;
23942    HAVE_GETRUSAGE=1;
23943
23944
23945
23946
23947
23948
23949
23950
23951  GNULIB_UNAME=0;
23952    HAVE_UNAME=1;
23953  HAVE_STRUCT_UTSNAME=1;
23954
23955
23956
23957
23958  GNULIB_WAITPID=0;
23959
23960
23961
23962
23963  GNULIB_TCGETSID=0;
23964    HAVE_DECL_TCGETSID=1;
23965  HAVE_TERMIOS_H=1;
23966
23967
23968
23969  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
23970$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
23971if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
23972  $as_echo_n "(cached) " >&6
23973else
23974  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23975/* end confdefs.h.  */
23976#include <time.h>
23977
23978int
23979main ()
23980{
23981static struct timespec x; x.tv_sec = x.tv_nsec;
23982  ;
23983  return 0;
23984}
23985_ACEOF
23986if ac_fn_c_try_compile "$LINENO"; then :
23987  gl_cv_sys_struct_timespec_in_time_h=yes
23988else
23989  gl_cv_sys_struct_timespec_in_time_h=no
23990fi
23991rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23992fi
23993{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
23994$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
23995
23996  TIME_H_DEFINES_STRUCT_TIMESPEC=0
23997  SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
23998  PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
23999  UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
24000  if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
24001    TIME_H_DEFINES_STRUCT_TIMESPEC=1
24002  else
24003    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
24004$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
24005if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
24006  $as_echo_n "(cached) " >&6
24007else
24008  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24009/* end confdefs.h.  */
24010#include <sys/time.h>
24011
24012int
24013main ()
24014{
24015static struct timespec x; x.tv_sec = x.tv_nsec;
24016  ;
24017  return 0;
24018}
24019_ACEOF
24020if ac_fn_c_try_compile "$LINENO"; then :
24021  gl_cv_sys_struct_timespec_in_sys_time_h=yes
24022else
24023  gl_cv_sys_struct_timespec_in_sys_time_h=no
24024fi
24025rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24026fi
24027{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
24028$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
24029    if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
24030      SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
24031    else
24032      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
24033$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
24034if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
24035  $as_echo_n "(cached) " >&6
24036else
24037  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24038/* end confdefs.h.  */
24039#include <pthread.h>
24040
24041int
24042main ()
24043{
24044static struct timespec x; x.tv_sec = x.tv_nsec;
24045  ;
24046  return 0;
24047}
24048_ACEOF
24049if ac_fn_c_try_compile "$LINENO"; then :
24050  gl_cv_sys_struct_timespec_in_pthread_h=yes
24051else
24052  gl_cv_sys_struct_timespec_in_pthread_h=no
24053fi
24054rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24055fi
24056{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
24057$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
24058      if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
24059        PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
24060      else
24061        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
24062$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; }
24063if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then :
24064  $as_echo_n "(cached) " >&6
24065else
24066  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24067/* end confdefs.h.  */
24068#include <unistd.h>
24069
24070int
24071main ()
24072{
24073static struct timespec x; x.tv_sec = x.tv_nsec;
24074  ;
24075  return 0;
24076}
24077_ACEOF
24078if ac_fn_c_try_compile "$LINENO"; then :
24079  gl_cv_sys_struct_timespec_in_unistd_h=yes
24080else
24081  gl_cv_sys_struct_timespec_in_unistd_h=no
24082fi
24083rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24084fi
24085{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
24086$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
24087        if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
24088          UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
24089        fi
24090      fi
24091    fi
24092  fi
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109     if test $gl_cv_have_include_next = yes; then
24110       gl_cv_next_time_h='<'time.h'>'
24111     else
24112       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
24113$as_echo_n "checking absolute name of <time.h>... " >&6; }
24114if ${gl_cv_next_time_h+:} false; then :
24115  $as_echo_n "(cached) " >&6
24116else
24117
24118
24119
24120  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24121/* end confdefs.h.  */
24122#include <time.h>
24123_ACEOF
24124                case "$host_os" in
24125    aix*) gl_absname_cpp="$ac_cpp -C" ;;
24126    *)    gl_absname_cpp="$ac_cpp" ;;
24127  esac
24128
24129  case "$host_os" in
24130    mingw*)
24131                                          gl_dirsep_regex='[/\\]'
24132      ;;
24133    *)
24134      gl_dirsep_regex='\/'
24135      ;;
24136  esac
24137      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
24138  gl_header_literal_regex=`echo 'time.h' \
24139                           | sed -e "$gl_make_literal_regex_sed"`
24140  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
24141      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
24142      s|^/[^/]|//&|
24143      p
24144      q
24145    }'
24146
24147        gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
24148  sed -n "$gl_absolute_header_sed"`
24149
24150           gl_header=$gl_cv_absolute_time_h
24151           gl_cv_next_time_h='"'$gl_header'"'
24152
24153
24154fi
24155{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
24156$as_echo "$gl_cv_next_time_h" >&6; }
24157     fi
24158     NEXT_TIME_H=$gl_cv_next_time_h
24159
24160     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
24161       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
24162       gl_next_as_first_directive='<'time.h'>'
24163     else
24164       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
24165       gl_next_as_first_directive=$gl_cv_next_time_h
24166     fi
24167     NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;}
24185i\
241860
24187q
24188'
24189gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;}
24190i\
241910
24192q
24193'
24194gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;}
24195i\
241960
24197q
24198'
24199
24200
24201  if test "$HAVE_LIBUNISTRING" = yes; then
24202    LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"`
24203    LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"`
24204    LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"`
24205  fi
24206
24207
24208
24209ac_fn_c_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default"
24210if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes; then :
24211  ac_have_decl=1
24212else
24213  ac_have_decl=0
24214fi
24215
24216cat >>confdefs.h <<_ACEOF
24217#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl
24218_ACEOF
24219
24220ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default"
24221if test "x$ac_cv_have_decl_feof_unlocked" = xyes; then :
24222  ac_have_decl=1
24223else
24224  ac_have_decl=0
24225fi
24226
24227cat >>confdefs.h <<_ACEOF
24228#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl
24229_ACEOF
24230
24231ac_fn_c_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default"
24232if test "x$ac_cv_have_decl_ferror_unlocked" = xyes; then :
24233  ac_have_decl=1
24234else
24235  ac_have_decl=0
24236fi
24237
24238cat >>confdefs.h <<_ACEOF
24239#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl
24240_ACEOF
24241
24242ac_fn_c_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default"
24243if test "x$ac_cv_have_decl_fgets_unlocked" = xyes; then :
24244  ac_have_decl=1
24245else
24246  ac_have_decl=0
24247fi
24248
24249cat >>confdefs.h <<_ACEOF
24250#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl
24251_ACEOF
24252
24253ac_fn_c_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default"
24254if test "x$ac_cv_have_decl_fputc_unlocked" = xyes; then :
24255  ac_have_decl=1
24256else
24257  ac_have_decl=0
24258fi
24259
24260cat >>confdefs.h <<_ACEOF
24261#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl
24262_ACEOF
24263
24264ac_fn_c_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default"
24265if test "x$ac_cv_have_decl_fread_unlocked" = xyes; then :
24266  ac_have_decl=1
24267else
24268  ac_have_decl=0
24269fi
24270
24271cat >>confdefs.h <<_ACEOF
24272#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl
24273_ACEOF
24274
24275ac_fn_c_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default"
24276if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes; then :
24277  ac_have_decl=1
24278else
24279  ac_have_decl=0
24280fi
24281
24282cat >>confdefs.h <<_ACEOF
24283#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl
24284_ACEOF
24285
24286ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
24287if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then :
24288  ac_have_decl=1
24289else
24290  ac_have_decl=0
24291fi
24292
24293cat >>confdefs.h <<_ACEOF
24294#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
24295_ACEOF
24296
24297ac_fn_c_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default"
24298if test "x$ac_cv_have_decl_getchar_unlocked" = xyes; then :
24299  ac_have_decl=1
24300else
24301  ac_have_decl=0
24302fi
24303
24304cat >>confdefs.h <<_ACEOF
24305#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl
24306_ACEOF
24307
24308ac_fn_c_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default"
24309if test "x$ac_cv_have_decl_putchar_unlocked" = xyes; then :
24310  ac_have_decl=1
24311else
24312  ac_have_decl=0
24313fi
24314
24315cat >>confdefs.h <<_ACEOF
24316#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl
24317_ACEOF
24318
24319ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
24320if test "x$ac_cv_have_decl_unsetenv" = xyes; then :
24321  ac_have_decl=1
24322else
24323  ac_have_decl=0
24324fi
24325
24326cat >>confdefs.h <<_ACEOF
24327#define HAVE_DECL_UNSETENV $ac_have_decl
24328_ACEOF
24329
24330
24331  GNULIB_UTIME=0;
24332    HAVE_UTIME=1;
24333  REPLACE_UTIME=0;
24334
24335
24336
24337
24338
24339
24340     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the utimes function works" >&5
24341$as_echo_n "checking whether the utimes function works... " >&6; }
24342if ${gl_cv_func_working_utimes+:} false; then :
24343  $as_echo_n "(cached) " >&6
24344else
24345  if test "$cross_compiling" = yes; then :
24346  case "$host_os" in
24347                  # Guess no on native Windows.
24348          mingw*) gl_cv_func_working_utimes="guessing no" ;;
24349          *)      gl_cv_func_working_utimes="guessing no" ;;
24350        esac
24351
24352else
24353  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24354/* end confdefs.h.  */
24355
24356#include <sys/types.h>
24357#include <sys/stat.h>
24358#include <fcntl.h>
24359#include <sys/time.h>
24360#include <time.h>
24361#include <unistd.h>
24362#include <stdlib.h>
24363#include <stdio.h>
24364#include <utime.h>
24365#include <errno.h>
24366
24367static int
24368inorder (time_t a, time_t b, time_t c)
24369{
24370  return a <= b && b <= c;
24371}
24372
24373int
24374main ()
24375{
24376  int result = 0;
24377  char const *file = "conftest.utimes";
24378  /* On OS/2, file timestamps must be on or after 1980 in local time,
24379     with an even number of seconds.  */
24380  static struct timeval timeval[2] = {{315620000 + 10, 10},
24381                                      {315620000 + 1000000, 999998}};
24382
24383  /* Test whether utimes() essentially works.  */
24384  {
24385    struct stat sbuf;
24386    FILE *f = fopen (file, "w");
24387    if (f == NULL)
24388      result |= 1;
24389    else if (fclose (f) != 0)
24390      result |= 1;
24391    else if (utimes (file, timeval) != 0)
24392      result |= 2;
24393    else if (lstat (file, &sbuf) != 0)
24394      result |= 1;
24395    else if (!(sbuf.st_atime == timeval[0].tv_sec
24396               && sbuf.st_mtime == timeval[1].tv_sec))
24397      result |= 4;
24398    if (unlink (file) != 0)
24399      result |= 1;
24400  }
24401
24402  /* Test whether utimes() with a NULL argument sets the file's timestamp
24403     to the current time.  Use 'fstat' as well as 'time' to
24404     determine the "current" time, to accommodate NFS file systems
24405     if there is a time skew between the host and the NFS server.  */
24406  {
24407    int fd = open (file, O_WRONLY|O_CREAT, 0644);
24408    if (fd < 0)
24409      result |= 1;
24410    else
24411      {
24412        time_t t0, t2;
24413        struct stat st0, st1, st2;
24414        if (time (&t0) == (time_t) -1)
24415          result |= 1;
24416        else if (fstat (fd, &st0) != 0)
24417          result |= 1;
24418        else if (utimes (file, timeval) != 0
24419                 && (errno != EACCES
24420                     /* OS/2 kLIBC utimes fails on opened files.  */
24421                     || close (fd) != 0
24422                     || utimes (file, timeval) != 0
24423                     || (fd = open (file, O_WRONLY)) < 0))
24424          result |= 2;
24425        else if (utimes (file, NULL) != 0
24426                 && (errno != EACCES
24427                     /* OS/2 kLIBC utimes fails on opened files.  */
24428                     || close (fd) != 0
24429                     || utimes (file, NULL) != 0
24430                     || (fd = open (file, O_WRONLY)) < 0))
24431          result |= 8;
24432        else if (fstat (fd, &st1) != 0)
24433          result |= 1;
24434        else if (write (fd, "\n", 1) != 1)
24435          result |= 1;
24436        else if (fstat (fd, &st2) != 0)
24437          result |= 1;
24438        else if (time (&t2) == (time_t) -1)
24439          result |= 1;
24440        else
24441          {
24442            int m_ok_POSIX = inorder (t0, st1.st_mtime, t2);
24443            int m_ok_NFS = inorder (st0.st_mtime, st1.st_mtime, st2.st_mtime);
24444            if (! (st1.st_atime == st1.st_mtime))
24445              result |= 16;
24446            if (! (m_ok_POSIX || m_ok_NFS))
24447              result |= 32;
24448          }
24449        if (close (fd) != 0)
24450          result |= 1;
24451      }
24452    if (unlink (file) != 0)
24453      result |= 1;
24454  }
24455
24456  /* Test whether utimes() with a NULL argument works on read-only files.  */
24457  {
24458    int fd = open (file, O_WRONLY|O_CREAT, 0444);
24459    if (fd < 0)
24460      result |= 1;
24461    else if (close (fd) != 0)
24462      result |= 1;
24463    else if (utimes (file, NULL) != 0)
24464      result |= 64;
24465    if (unlink (file) != 0)
24466      result |= 1;
24467  }
24468
24469  return result;
24470}
24471
24472_ACEOF
24473if ac_fn_c_try_run "$LINENO"; then :
24474  gl_cv_func_working_utimes=yes
24475else
24476  gl_cv_func_working_utimes=no
24477fi
24478rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24479  conftest.$ac_objext conftest.beam conftest.$ac_ext
24480fi
24481
24482
24483fi
24484{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_utimes" >&5
24485$as_echo "$gl_cv_func_working_utimes" >&6; }
24486
24487  case "$gl_cv_func_working_utimes" in
24488    *yes)
24489
24490$as_echo "#define HAVE_WORKING_UTIMES 1" >>confdefs.h
24491
24492      ;;
24493  esac
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5
24507$as_echo_n "checking for inttypes.h... " >&6; }
24508if ${gl_cv_header_inttypes_h+:} false; then :
24509  $as_echo_n "(cached) " >&6
24510else
24511  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24512/* end confdefs.h.  */
24513
24514#include <sys/types.h>
24515#include <inttypes.h>
24516
24517int
24518main ()
24519{
24520uintmax_t i = (uintmax_t) -1; return !i;
24521  ;
24522  return 0;
24523}
24524_ACEOF
24525if ac_fn_c_try_compile "$LINENO"; then :
24526  gl_cv_header_inttypes_h=yes
24527else
24528  gl_cv_header_inttypes_h=no
24529fi
24530rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24531fi
24532{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5
24533$as_echo "$gl_cv_header_inttypes_h" >&6; }
24534  if test $gl_cv_header_inttypes_h = yes; then
24535
24536cat >>confdefs.h <<_ACEOF
24537#define HAVE_INTTYPES_H_WITH_UINTMAX 1
24538_ACEOF
24539
24540  fi
24541
24542
24543  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5
24544$as_echo_n "checking for stdint.h... " >&6; }
24545if ${gl_cv_header_stdint_h+:} false; then :
24546  $as_echo_n "(cached) " >&6
24547else
24548  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24549/* end confdefs.h.  */
24550#include <sys/types.h>
24551            #include <stdint.h>
24552int
24553main ()
24554{
24555uintmax_t i = (uintmax_t) -1; return !i;
24556  ;
24557  return 0;
24558}
24559_ACEOF
24560if ac_fn_c_try_compile "$LINENO"; then :
24561  gl_cv_header_stdint_h=yes
24562else
24563  gl_cv_header_stdint_h=no
24564fi
24565rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24566fi
24567{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5
24568$as_echo "$gl_cv_header_stdint_h" >&6; }
24569  if test $gl_cv_header_stdint_h = yes; then
24570
24571cat >>confdefs.h <<_ACEOF
24572#define HAVE_STDINT_H_WITH_UINTMAX 1
24573_ACEOF
24574
24575  fi
24576
24577
24578
24579
24580  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5
24581$as_echo_n "checking for intmax_t... " >&6; }
24582if ${gt_cv_c_intmax_t+:} false; then :
24583  $as_echo_n "(cached) " >&6
24584else
24585  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24586/* end confdefs.h.  */
24587
24588#include <stddef.h>
24589#include <stdlib.h>
24590#if HAVE_STDINT_H_WITH_UINTMAX
24591#include <stdint.h>
24592#endif
24593#if HAVE_INTTYPES_H_WITH_UINTMAX
24594#include <inttypes.h>
24595#endif
24596
24597int
24598main ()
24599{
24600intmax_t x = -1; return !x;
24601  ;
24602  return 0;
24603}
24604_ACEOF
24605if ac_fn_c_try_compile "$LINENO"; then :
24606  gt_cv_c_intmax_t=yes
24607else
24608  gt_cv_c_intmax_t=no
24609fi
24610rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24611fi
24612{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5
24613$as_echo "$gt_cv_c_intmax_t" >&6; }
24614  if test $gt_cv_c_intmax_t = yes; then
24615
24616$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
24617
24618  else
24619
24620    test $ac_cv_type_long_long_int = yes \
24621      && ac_type='long long' \
24622      || ac_type='long'
24623
24624cat >>confdefs.h <<_ACEOF
24625#define intmax_t $ac_type
24626_ACEOF
24627
24628  fi
24629
24630
24631
24632
24633
24634
24635  for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb
24636do :
24637  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
24638ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
24639if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
24640  cat >>confdefs.h <<_ACEOF
24641#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
24642_ACEOF
24643
24644fi
24645done
24646
24647      ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h>
24648"
24649if test "x$ac_cv_have_decl__snprintf" = xyes; then :
24650  ac_have_decl=1
24651else
24652  ac_have_decl=0
24653fi
24654
24655cat >>confdefs.h <<_ACEOF
24656#define HAVE_DECL__SNPRINTF $ac_have_decl
24657_ACEOF
24658
24659
24660
24661  case "$gl_cv_func_snprintf_retval_c99" in
24662    *yes)
24663
24664$as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h
24665
24666      ;;
24667  esac
24668
24669
24670
24671
24672
24673     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports size specifiers as in C99" >&5
24674$as_echo_n "checking whether printf supports size specifiers as in C99... " >&6; }
24675if ${gl_cv_func_printf_sizes_c99+:} false; then :
24676  $as_echo_n "(cached) " >&6
24677else
24678
24679      if test "$cross_compiling" = yes; then :
24680
24681         case "$host_os" in
24682                                 # Guess yes on glibc systems.
24683           *-gnu* | gnu*)        gl_cv_func_printf_sizes_c99="guessing yes";;
24684                                 # Guess yes on FreeBSD >= 5.
24685           freebsd[1-4].*)       gl_cv_func_printf_sizes_c99="guessing no";;
24686           freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
24687                                 # Guess yes on Mac OS X >= 10.3.
24688           darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
24689           darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
24690                                 # Guess yes on OpenBSD >= 3.9.
24691           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
24692                                 gl_cv_func_printf_sizes_c99="guessing no";;
24693           openbsd*)             gl_cv_func_printf_sizes_c99="guessing yes";;
24694                                 # Guess yes on Solaris >= 2.10.
24695           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
24696           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
24697                                 # Guess yes on NetBSD >= 3.
24698           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
24699                                 gl_cv_func_printf_sizes_c99="guessing no";;
24700           netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
24701                                 # Guess yes on MSVC, no on mingw.
24702           mingw*)               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24703/* end confdefs.h.  */
24704
24705#ifdef _MSC_VER
24706 Known
24707#endif
24708
24709_ACEOF
24710if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24711  $EGREP "Known" >/dev/null 2>&1; then :
24712  gl_cv_func_printf_sizes_c99="guessing yes"
24713else
24714  gl_cv_func_printf_sizes_c99="guessing no"
24715fi
24716rm -f conftest*
24717
24718                                 ;;
24719                                 # If we don't know, assume the worst.
24720           *)                    gl_cv_func_printf_sizes_c99="guessing no";;
24721         esac
24722
24723else
24724  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24725/* end confdefs.h.  */
24726
24727#include <stddef.h>
24728#include <stdio.h>
24729#include <string.h>
24730#include <sys/types.h>
24731#if HAVE_STDINT_H_WITH_UINTMAX
24732# include <stdint.h>
24733#endif
24734#if HAVE_INTTYPES_H_WITH_UINTMAX
24735# include <inttypes.h>
24736#endif
24737static char buf[100];
24738int main ()
24739{
24740  int result = 0;
24741#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
24742  buf[0] = '\0';
24743  if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
24744      || strcmp (buf, "12345671 33") != 0)
24745    result |= 1;
24746#else
24747  result |= 1;
24748#endif
24749  buf[0] = '\0';
24750  if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
24751      || strcmp (buf, "12345672 33") != 0)
24752    result |= 2;
24753  buf[0] = '\0';
24754  if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
24755      || strcmp (buf, "12345673 33") != 0)
24756    result |= 4;
24757  buf[0] = '\0';
24758  if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
24759      || strcmp (buf, "1.5 33") != 0)
24760    result |= 8;
24761  return result;
24762}
24763_ACEOF
24764if ac_fn_c_try_run "$LINENO"; then :
24765  gl_cv_func_printf_sizes_c99=yes
24766else
24767  gl_cv_func_printf_sizes_c99=no
24768fi
24769rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24770  conftest.$ac_objext conftest.beam conftest.$ac_ext
24771fi
24772
24773
24774fi
24775{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_sizes_c99" >&5
24776$as_echo "$gl_cv_func_printf_sizes_c99" >&6; }
24777
24778
24779
24780     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports 'long double' arguments" >&5
24781$as_echo_n "checking whether printf supports 'long double' arguments... " >&6; }
24782if ${gl_cv_func_printf_long_double+:} false; then :
24783  $as_echo_n "(cached) " >&6
24784else
24785
24786      if test "$cross_compiling" = yes; then :
24787  case "$host_os" in
24788           beos*)  gl_cv_func_printf_long_double="guessing no";;
24789                   # Guess yes on MSVC, no on mingw.
24790           mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24791/* end confdefs.h.  */
24792
24793#ifdef _MSC_VER
24794 Known
24795#endif
24796
24797_ACEOF
24798if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24799  $EGREP "Known" >/dev/null 2>&1; then :
24800  gl_cv_func_printf_long_double="guessing yes"
24801else
24802  gl_cv_func_printf_long_double="guessing no"
24803fi
24804rm -f conftest*
24805
24806                   ;;
24807           *)      gl_cv_func_printf_long_double="guessing yes";;
24808         esac
24809
24810else
24811  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24812/* end confdefs.h.  */
24813
24814#include <stdio.h>
24815#include <string.h>
24816static char buf[10000];
24817int main ()
24818{
24819  int result = 0;
24820  buf[0] = '\0';
24821  if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
24822      || strcmp (buf, "1.750000 33") != 0)
24823    result |= 1;
24824  buf[0] = '\0';
24825  if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
24826      || strcmp (buf, "1.750000e+00 33") != 0)
24827    result |= 2;
24828  buf[0] = '\0';
24829  if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
24830      || strcmp (buf, "1.75 33") != 0)
24831    result |= 4;
24832  return result;
24833}
24834_ACEOF
24835if ac_fn_c_try_run "$LINENO"; then :
24836  gl_cv_func_printf_long_double=yes
24837else
24838  gl_cv_func_printf_long_double=no
24839fi
24840rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24841  conftest.$ac_objext conftest.beam conftest.$ac_ext
24842fi
24843
24844
24845fi
24846{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_long_double" >&5
24847$as_echo "$gl_cv_func_printf_long_double" >&6; }
24848
24849
24850
24851     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'double' arguments" >&5
24852$as_echo_n "checking whether printf supports infinite 'double' arguments... " >&6; }
24853if ${gl_cv_func_printf_infinite+:} false; then :
24854  $as_echo_n "(cached) " >&6
24855else
24856
24857      if test "$cross_compiling" = yes; then :
24858
24859         case "$host_os" in
24860                                 # Guess yes on glibc systems.
24861           *-gnu* | gnu*)        gl_cv_func_printf_infinite="guessing yes";;
24862                                 # Guess yes on FreeBSD >= 6.
24863           freebsd[1-5].*)       gl_cv_func_printf_infinite="guessing no";;
24864           freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
24865                                 # Guess yes on Mac OS X >= 10.3.
24866           darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
24867           darwin*)              gl_cv_func_printf_infinite="guessing yes";;
24868                                 # Guess yes on HP-UX >= 11.
24869           hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
24870           hpux*)                gl_cv_func_printf_infinite="guessing yes";;
24871                                 # Guess yes on NetBSD >= 3.
24872           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
24873                                 gl_cv_func_printf_infinite="guessing no";;
24874           netbsd*)              gl_cv_func_printf_infinite="guessing yes";;
24875                                 # Guess yes on BeOS.
24876           beos*)                gl_cv_func_printf_infinite="guessing yes";;
24877                                 # Guess yes on MSVC, no on mingw.
24878           mingw*)               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24879/* end confdefs.h.  */
24880
24881#ifdef _MSC_VER
24882 Known
24883#endif
24884
24885_ACEOF
24886if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24887  $EGREP "Known" >/dev/null 2>&1; then :
24888  gl_cv_func_printf_infinite="guessing yes"
24889else
24890  gl_cv_func_printf_infinite="guessing no"
24891fi
24892rm -f conftest*
24893
24894                                 ;;
24895                                 # If we don't know, assume the worst.
24896           *)                    gl_cv_func_printf_infinite="guessing no";;
24897         esac
24898
24899else
24900  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24901/* end confdefs.h.  */
24902
24903#include <stdio.h>
24904#include <string.h>
24905static int
24906strisnan (const char *string, size_t start_index, size_t end_index)
24907{
24908  if (start_index < end_index)
24909    {
24910      if (string[start_index] == '-')
24911        start_index++;
24912      if (start_index + 3 <= end_index
24913          && memcmp (string + start_index, "nan", 3) == 0)
24914        {
24915          start_index += 3;
24916          if (start_index == end_index
24917              || (string[start_index] == '(' && string[end_index - 1] == ')'))
24918            return 1;
24919        }
24920    }
24921  return 0;
24922}
24923static int
24924have_minus_zero ()
24925{
24926  static double plus_zero = 0.0;
24927  double minus_zero = - plus_zero;
24928  return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0;
24929}
24930static char buf[10000];
24931static double zero = 0.0;
24932int main ()
24933{
24934  int result = 0;
24935  if (sprintf (buf, "%f", 1.0 / zero) < 0
24936      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
24937    result |= 1;
24938  if (sprintf (buf, "%f", -1.0 / zero) < 0
24939      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
24940    result |= 1;
24941  if (sprintf (buf, "%f", zero / zero) < 0
24942      || !strisnan (buf, 0, strlen (buf)))
24943    result |= 2;
24944  if (sprintf (buf, "%e", 1.0 / zero) < 0
24945      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
24946    result |= 4;
24947  if (sprintf (buf, "%e", -1.0 / zero) < 0
24948      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
24949    result |= 4;
24950  if (sprintf (buf, "%e", zero / zero) < 0
24951      || !strisnan (buf, 0, strlen (buf)))
24952    result |= 8;
24953  if (sprintf (buf, "%g", 1.0 / zero) < 0
24954      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
24955    result |= 16;
24956  if (sprintf (buf, "%g", -1.0 / zero) < 0
24957      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
24958    result |= 16;
24959  if (sprintf (buf, "%g", zero / zero) < 0
24960      || !strisnan (buf, 0, strlen (buf)))
24961    result |= 32;
24962  /* This test fails on HP-UX 10.20.  */
24963  if (have_minus_zero ())
24964    if (sprintf (buf, "%g", - zero) < 0
24965        || strcmp (buf, "-0") != 0)
24966    result |= 64;
24967  return result;
24968}
24969_ACEOF
24970if ac_fn_c_try_run "$LINENO"; then :
24971  gl_cv_func_printf_infinite=yes
24972else
24973  gl_cv_func_printf_infinite=no
24974fi
24975rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
24976  conftest.$ac_objext conftest.beam conftest.$ac_ext
24977fi
24978
24979
24980fi
24981{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite" >&5
24982$as_echo "$gl_cv_func_printf_infinite" >&6; }
24983
24984
24985
24986
24987
24988
24989         if test -n "$gl_printf_safe"; then
24990
24991$as_echo "#define CHECK_PRINTF_SAFE 1" >>confdefs.h
24992
24993  fi
24994  case "$gl_cv_func_printf_long_double" in
24995    *yes)
24996      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'long double' arguments" >&5
24997$as_echo_n "checking whether printf supports infinite 'long double' arguments... " >&6; }
24998if ${gl_cv_func_printf_infinite_long_double+:} false; then :
24999  $as_echo_n "(cached) " >&6
25000else
25001
25002          if test "$cross_compiling" = yes; then :
25003  case "$host_cpu" in
25004                                     # Guess no on ia64, x86_64, i386.
25005               ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
25006               *)
25007                 case "$host_os" in
25008                                         # Guess yes on glibc systems.
25009                   *-gnu* | gnu*)        gl_cv_func_printf_infinite_long_double="guessing yes";;
25010                                         # Guess yes on FreeBSD >= 6.
25011                   freebsd[1-5].*)       gl_cv_func_printf_infinite_long_double="guessing no";;
25012                   freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
25013                                         # Guess yes on HP-UX >= 11.
25014                   hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
25015                   hpux*)                gl_cv_func_printf_infinite_long_double="guessing yes";;
25016                                         # Guess yes on MSVC, no on mingw.
25017                   mingw*)               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25018/* end confdefs.h.  */
25019
25020#ifdef _MSC_VER
25021 Known
25022#endif
25023
25024_ACEOF
25025if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25026  $EGREP "Known" >/dev/null 2>&1; then :
25027  gl_cv_func_printf_infinite_long_double="guessing yes"
25028else
25029  gl_cv_func_printf_infinite_long_double="guessing no"
25030fi
25031rm -f conftest*
25032
25033                                         ;;
25034                                         # If we don't know, assume the worst.
25035                   *)                    gl_cv_func_printf_infinite_long_double="guessing no";;
25036                 esac
25037                 ;;
25038             esac
25039
25040else
25041  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25042/* end confdefs.h.  */
25043
25044
25045#include <stdlib.h>
25046#if defined __MACH__ && defined __APPLE__
25047/* Avoid a crash on Mac OS X.  */
25048#include <mach/mach.h>
25049#include <mach/mach_error.h>
25050#include <mach/thread_status.h>
25051#include <mach/exception.h>
25052#include <mach/task.h>
25053#include <pthread.h>
25054/* The exception port on which our thread listens.  */
25055static mach_port_t our_exception_port;
25056/* The main function of the thread listening for exceptions of type
25057   EXC_BAD_ACCESS.  */
25058static void *
25059mach_exception_thread (void *arg)
25060{
25061  /* Buffer for a message to be received.  */
25062  struct {
25063    mach_msg_header_t head;
25064    mach_msg_body_t msgh_body;
25065    char data[1024];
25066  } msg;
25067  mach_msg_return_t retval;
25068  /* Wait for a message on the exception port.  */
25069  retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
25070                     our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
25071  if (retval != MACH_MSG_SUCCESS)
25072    abort ();
25073  exit (1);
25074}
25075static void
25076nocrash_init (void)
25077{
25078  mach_port_t self = mach_task_self ();
25079  /* Allocate a port on which the thread shall listen for exceptions.  */
25080  if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
25081      == KERN_SUCCESS) {
25082    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
25083    if (mach_port_insert_right (self, our_exception_port, our_exception_port,
25084                                MACH_MSG_TYPE_MAKE_SEND)
25085        == KERN_SUCCESS) {
25086      /* The exceptions we want to catch.  Only EXC_BAD_ACCESS is interesting
25087         for us.  */
25088      exception_mask_t mask = EXC_MASK_BAD_ACCESS;
25089      /* Create the thread listening on the exception port.  */
25090      pthread_attr_t attr;
25091      pthread_t thread;
25092      if (pthread_attr_init (&attr) == 0
25093          && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
25094          && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
25095        pthread_attr_destroy (&attr);
25096        /* Replace the exception port info for these exceptions with our own.
25097           Note that we replace the exception port for the entire task, not only
25098           for a particular thread.  This has the effect that when our exception
25099           port gets the message, the thread specific exception port has already
25100           been asked, and we don't need to bother about it.
25101           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
25102        task_set_exception_ports (self, mask, our_exception_port,
25103                                  EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
25104      }
25105    }
25106  }
25107}
25108#elif defined _WIN32 && ! defined __CYGWIN__
25109/* Avoid a crash on native Windows.  */
25110#define WIN32_LEAN_AND_MEAN
25111#include <windows.h>
25112#include <winerror.h>
25113static LONG WINAPI
25114exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
25115{
25116  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
25117    {
25118    case EXCEPTION_ACCESS_VIOLATION:
25119    case EXCEPTION_IN_PAGE_ERROR:
25120    case EXCEPTION_STACK_OVERFLOW:
25121    case EXCEPTION_GUARD_PAGE:
25122    case EXCEPTION_PRIV_INSTRUCTION:
25123    case EXCEPTION_ILLEGAL_INSTRUCTION:
25124    case EXCEPTION_DATATYPE_MISALIGNMENT:
25125    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
25126    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
25127      exit (1);
25128    }
25129  return EXCEPTION_CONTINUE_SEARCH;
25130}
25131static void
25132nocrash_init (void)
25133{
25134  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
25135}
25136#else
25137/* Avoid a crash on POSIX systems.  */
25138#include <signal.h>
25139#include <unistd.h>
25140/* A POSIX signal handler.  */
25141static void
25142exception_handler (int sig)
25143{
25144  _exit (1);
25145}
25146static void
25147nocrash_init (void)
25148{
25149#ifdef SIGSEGV
25150  signal (SIGSEGV, exception_handler);
25151#endif
25152#ifdef SIGBUS
25153  signal (SIGBUS, exception_handler);
25154#endif
25155}
25156#endif
25157
25158#include <float.h>
25159#include <stdio.h>
25160#include <string.h>
25161static int
25162strisnan (const char *string, size_t start_index, size_t end_index)
25163{
25164  if (start_index < end_index)
25165    {
25166      if (string[start_index] == '-')
25167        start_index++;
25168      if (start_index + 3 <= end_index
25169          && memcmp (string + start_index, "nan", 3) == 0)
25170        {
25171          start_index += 3;
25172          if (start_index == end_index
25173              || (string[start_index] == '(' && string[end_index - 1] == ')'))
25174            return 1;
25175        }
25176    }
25177  return 0;
25178}
25179static char buf[10000];
25180static long double zeroL = 0.0L;
25181int main ()
25182{
25183  int result = 0;
25184  nocrash_init();
25185  if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0
25186      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
25187    result |= 1;
25188  if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0
25189      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
25190    result |= 1;
25191  if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
25192      || !strisnan (buf, 0, strlen (buf)))
25193    result |= 1;
25194  if (sprintf (buf, "%Le", 1.0L / zeroL) < 0
25195      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
25196    result |= 1;
25197  if (sprintf (buf, "%Le", -1.0L / zeroL) < 0
25198      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
25199    result |= 1;
25200  if (sprintf (buf, "%Le", zeroL / zeroL) < 0
25201      || !strisnan (buf, 0, strlen (buf)))
25202    result |= 1;
25203  if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0
25204      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
25205    result |= 1;
25206  if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0
25207      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
25208    result |= 1;
25209  if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
25210      || !strisnan (buf, 0, strlen (buf)))
25211    result |= 1;
25212#if CHECK_PRINTF_SAFE && ((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
25213/* Representation of an 80-bit 'long double' as an initializer for a sequence
25214   of 'unsigned int' words.  */
25215# ifdef WORDS_BIGENDIAN
25216#  define LDBL80_WORDS(exponent,manthi,mantlo) \
25217     { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
25218       ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16),   \
25219       (unsigned int) (mantlo) << 16                                        \
25220     }
25221# else
25222#  define LDBL80_WORDS(exponent,manthi,mantlo) \
25223     { mantlo, manthi, exponent }
25224# endif
25225  { /* Quiet NaN.  */
25226    static union { unsigned int word[4]; long double value; } x =
25227      { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
25228    if (sprintf (buf, "%Lf", x.value) < 0
25229        || !strisnan (buf, 0, strlen (buf)))
25230      result |= 2;
25231    if (sprintf (buf, "%Le", x.value) < 0
25232        || !strisnan (buf, 0, strlen (buf)))
25233      result |= 2;
25234    if (sprintf (buf, "%Lg", x.value) < 0
25235        || !strisnan (buf, 0, strlen (buf)))
25236      result |= 2;
25237  }
25238  {
25239    /* Signalling NaN.  */
25240    static union { unsigned int word[4]; long double value; } x =
25241      { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
25242    if (sprintf (buf, "%Lf", x.value) < 0
25243        || !strisnan (buf, 0, strlen (buf)))
25244      result |= 2;
25245    if (sprintf (buf, "%Le", x.value) < 0
25246        || !strisnan (buf, 0, strlen (buf)))
25247      result |= 2;
25248    if (sprintf (buf, "%Lg", x.value) < 0
25249        || !strisnan (buf, 0, strlen (buf)))
25250      result |= 2;
25251  }
25252  { /* Pseudo-NaN.  */
25253    static union { unsigned int word[4]; long double value; } x =
25254      { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
25255    if (sprintf (buf, "%Lf", x.value) <= 0)
25256      result |= 4;
25257    if (sprintf (buf, "%Le", x.value) <= 0)
25258      result |= 4;
25259    if (sprintf (buf, "%Lg", x.value) <= 0)
25260      result |= 4;
25261  }
25262  { /* Pseudo-Infinity.  */
25263    static union { unsigned int word[4]; long double value; } x =
25264      { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
25265    if (sprintf (buf, "%Lf", x.value) <= 0)
25266      result |= 8;
25267    if (sprintf (buf, "%Le", x.value) <= 0)
25268      result |= 8;
25269    if (sprintf (buf, "%Lg", x.value) <= 0)
25270      result |= 8;
25271  }
25272  { /* Pseudo-Zero.  */
25273    static union { unsigned int word[4]; long double value; } x =
25274      { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
25275    if (sprintf (buf, "%Lf", x.value) <= 0)
25276      result |= 16;
25277    if (sprintf (buf, "%Le", x.value) <= 0)
25278      result |= 16;
25279    if (sprintf (buf, "%Lg", x.value) <= 0)
25280      result |= 16;
25281  }
25282  { /* Unnormalized number.  */
25283    static union { unsigned int word[4]; long double value; } x =
25284      { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
25285    if (sprintf (buf, "%Lf", x.value) <= 0)
25286      result |= 32;
25287    if (sprintf (buf, "%Le", x.value) <= 0)
25288      result |= 32;
25289    if (sprintf (buf, "%Lg", x.value) <= 0)
25290      result |= 32;
25291  }
25292  { /* Pseudo-Denormal.  */
25293    static union { unsigned int word[4]; long double value; } x =
25294      { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
25295    if (sprintf (buf, "%Lf", x.value) <= 0)
25296      result |= 64;
25297    if (sprintf (buf, "%Le", x.value) <= 0)
25298      result |= 64;
25299    if (sprintf (buf, "%Lg", x.value) <= 0)
25300      result |= 64;
25301  }
25302#endif
25303  return result;
25304}
25305_ACEOF
25306if ac_fn_c_try_run "$LINENO"; then :
25307  gl_cv_func_printf_infinite_long_double=yes
25308else
25309  gl_cv_func_printf_infinite_long_double=no
25310fi
25311rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25312  conftest.$ac_objext conftest.beam conftest.$ac_ext
25313fi
25314
25315
25316fi
25317{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite_long_double" >&5
25318$as_echo "$gl_cv_func_printf_infinite_long_double" >&6; }
25319      ;;
25320    *)
25321      gl_cv_func_printf_infinite_long_double="irrelevant"
25322      ;;
25323  esac
25324
25325
25326
25327     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'a' and 'A' directives" >&5
25328$as_echo_n "checking whether printf supports the 'a' and 'A' directives... " >&6; }
25329if ${gl_cv_func_printf_directive_a+:} false; then :
25330  $as_echo_n "(cached) " >&6
25331else
25332
25333      if test "$cross_compiling" = yes; then :
25334
25335         case "$host_os" in
25336                                 # Guess yes on glibc >= 2.5 systems.
25337           *-gnu* | gnu*)
25338             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25339/* end confdefs.h.  */
25340
25341               #include <features.h>
25342               #ifdef __GNU_LIBRARY__
25343                #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__
25344                 BZ2908
25345                #endif
25346               #endif
25347
25348_ACEOF
25349if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25350  $EGREP "BZ2908" >/dev/null 2>&1; then :
25351  gl_cv_func_printf_directive_a="guessing yes"
25352else
25353  gl_cv_func_printf_directive_a="guessing no"
25354fi
25355rm -f conftest*
25356
25357             ;;
25358                                 # Guess no on native Windows.
25359           mingw*)               gl_cv_func_printf_directive_a="guessing no";;
25360                                 # If we don't know, assume the worst.
25361           *)                    gl_cv_func_printf_directive_a="guessing no";;
25362         esac
25363
25364else
25365  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25366/* end confdefs.h.  */
25367
25368#include <stdio.h>
25369#include <string.h>
25370static char buf[100];
25371static double zero = 0.0;
25372int main ()
25373{
25374  int result = 0;
25375  if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
25376      || (strcmp (buf, "0x1.922p+1 33") != 0
25377          && strcmp (buf, "0x3.244p+0 33") != 0
25378          && strcmp (buf, "0x6.488p-1 33") != 0
25379          && strcmp (buf, "0xc.91p-2 33") != 0))
25380    result |= 1;
25381  if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
25382      || (strcmp (buf, "-0X1.922P+1 33") != 0
25383          && strcmp (buf, "-0X3.244P+0 33") != 0
25384          && strcmp (buf, "-0X6.488P-1 33") != 0
25385          && strcmp (buf, "-0XC.91P-2 33") != 0))
25386    result |= 2;
25387  /* This catches a FreeBSD 6.1 bug: it doesn't round.  */
25388  if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
25389      || (strcmp (buf, "0x1.83p+0 33") != 0
25390          && strcmp (buf, "0x3.05p-1 33") != 0
25391          && strcmp (buf, "0x6.0ap-2 33") != 0
25392          && strcmp (buf, "0xc.14p-3 33") != 0))
25393    result |= 4;
25394  /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round.  */
25395  if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
25396      || (strcmp (buf, "0x2p+0 33") != 0
25397          && strcmp (buf, "0x3p-1 33") != 0
25398          && strcmp (buf, "0x6p-2 33") != 0
25399          && strcmp (buf, "0xcp-3 33") != 0))
25400    result |= 4;
25401  /* This catches a FreeBSD 6.1 bug.  See
25402     <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
25403  if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
25404      || buf[0] == '0')
25405    result |= 8;
25406  /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug.  */
25407  if (sprintf (buf, "%.1a", 1.999) < 0
25408      || (strcmp (buf, "0x1.0p+1") != 0
25409          && strcmp (buf, "0x2.0p+0") != 0
25410          && strcmp (buf, "0x4.0p-1") != 0
25411          && strcmp (buf, "0x8.0p-2") != 0))
25412    result |= 16;
25413  /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
25414     glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
25415  if (sprintf (buf, "%.1La", 1.999L) < 0
25416      || (strcmp (buf, "0x1.0p+1") != 0
25417          && strcmp (buf, "0x2.0p+0") != 0
25418          && strcmp (buf, "0x4.0p-1") != 0
25419          && strcmp (buf, "0x8.0p-2") != 0))
25420    result |= 32;
25421  return result;
25422}
25423_ACEOF
25424if ac_fn_c_try_run "$LINENO"; then :
25425  gl_cv_func_printf_directive_a=yes
25426else
25427  gl_cv_func_printf_directive_a=no
25428fi
25429rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25430  conftest.$ac_objext conftest.beam conftest.$ac_ext
25431fi
25432
25433
25434fi
25435{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_a" >&5
25436$as_echo "$gl_cv_func_printf_directive_a" >&6; }
25437
25438
25439
25440     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'F' directive" >&5
25441$as_echo_n "checking whether printf supports the 'F' directive... " >&6; }
25442if ${gl_cv_func_printf_directive_f+:} false; then :
25443  $as_echo_n "(cached) " >&6
25444else
25445
25446      if test "$cross_compiling" = yes; then :
25447
25448         case "$host_os" in
25449                                 # Guess yes on glibc systems.
25450           *-gnu* | gnu*)        gl_cv_func_printf_directive_f="guessing yes";;
25451                                 # Guess yes on FreeBSD >= 6.
25452           freebsd[1-5].*)       gl_cv_func_printf_directive_f="guessing no";;
25453           freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
25454                                 # Guess yes on Mac OS X >= 10.3.
25455           darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
25456           darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
25457                                 # Guess yes on Solaris >= 2.10.
25458           solaris2.[1-9][0-9]*) gl_cv_func_printf_directive_f="guessing yes";;
25459           solaris*)             gl_cv_func_printf_directive_f="guessing no";;
25460                                 # Guess yes on MSVC, no on mingw.
25461           mingw*)               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25462/* end confdefs.h.  */
25463
25464#ifdef _MSC_VER
25465 Known
25466#endif
25467
25468_ACEOF
25469if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
25470  $EGREP "Known" >/dev/null 2>&1; then :
25471  gl_cv_func_printf_directive_f="guessing yes"
25472else
25473  gl_cv_func_printf_directive_f="guessing no"
25474fi
25475rm -f conftest*
25476
25477                                 ;;
25478                                 # If we don't know, assume the worst.
25479           *)                    gl_cv_func_printf_directive_f="guessing no";;
25480         esac
25481
25482else
25483  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25484/* end confdefs.h.  */
25485
25486#include <stdio.h>
25487#include <string.h>
25488static char buf[100];
25489static double zero = 0.0;
25490int main ()
25491{
25492  int result = 0;
25493  if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
25494      || strcmp (buf, "1234567.000000 33") != 0)
25495    result |= 1;
25496  if (sprintf (buf, "%F", 1.0 / zero) < 0
25497      || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
25498    result |= 2;
25499  /* This catches a Cygwin 1.5.x bug.  */
25500  if (sprintf (buf, "%.F", 1234.0) < 0
25501      || strcmp (buf, "1234") != 0)
25502    result |= 4;
25503  return result;
25504}
25505_ACEOF
25506if ac_fn_c_try_run "$LINENO"; then :
25507  gl_cv_func_printf_directive_f=yes
25508else
25509  gl_cv_func_printf_directive_f=no
25510fi
25511rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25512  conftest.$ac_objext conftest.beam conftest.$ac_ext
25513fi
25514
25515
25516fi
25517{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_f" >&5
25518$as_echo "$gl_cv_func_printf_directive_f" >&6; }
25519
25520
25521
25522     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'n' directive" >&5
25523$as_echo_n "checking whether printf supports the 'n' directive... " >&6; }
25524if ${gl_cv_func_printf_directive_n+:} false; then :
25525  $as_echo_n "(cached) " >&6
25526else
25527
25528      if test "$cross_compiling" = yes; then :
25529  case "$host_os" in
25530                   # Guess no on native Windows.
25531           mingw*) gl_cv_func_printf_directive_n="guessing no";;
25532           *)      gl_cv_func_printf_directive_n="guessing yes";;
25533         esac
25534
25535else
25536  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25537/* end confdefs.h.  */
25538
25539#include <stdio.h>
25540#include <stdlib.h>
25541#include <string.h>
25542#ifdef _MSC_VER
25543/* See page about "Parameter Validation" on msdn.microsoft.com.  */
25544static void cdecl
25545invalid_parameter_handler (const wchar_t *expression,
25546                           const wchar_t *function,
25547                           const wchar_t *file, unsigned int line,
25548                           uintptr_t dummy)
25549{
25550  exit (1);
25551}
25552#endif
25553static char fmtstring[10];
25554static char buf[100];
25555int main ()
25556{
25557  int count = -1;
25558#ifdef _MSC_VER
25559  _set_invalid_parameter_handler (invalid_parameter_handler);
25560#endif
25561  /* Copy the format string.  Some systems (glibc with _FORTIFY_SOURCE=2)
25562     support %n in format strings in read-only memory but not in writable
25563     memory.  */
25564  strcpy (fmtstring, "%d %n");
25565  if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
25566      || strcmp (buf, "123 ") != 0
25567      || count != 4)
25568    return 1;
25569  return 0;
25570}
25571_ACEOF
25572if ac_fn_c_try_run "$LINENO"; then :
25573  gl_cv_func_printf_directive_n=yes
25574else
25575  gl_cv_func_printf_directive_n=no
25576fi
25577rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25578  conftest.$ac_objext conftest.beam conftest.$ac_ext
25579fi
25580
25581
25582fi
25583{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_n" >&5
25584$as_echo "$gl_cv_func_printf_directive_n" >&6; }
25585
25586
25587
25588     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'ls' directive" >&5
25589$as_echo_n "checking whether printf supports the 'ls' directive... " >&6; }
25590if ${gl_cv_func_printf_directive_ls+:} false; then :
25591  $as_echo_n "(cached) " >&6
25592else
25593
25594      if test "$cross_compiling" = yes; then :
25595
25596         case "$host_os" in
25597           openbsd*)       gl_cv_func_printf_directive_ls="guessing no";;
25598           irix*)          gl_cv_func_printf_directive_ls="guessing no";;
25599           solaris*)       gl_cv_func_printf_directive_ls="guessing no";;
25600           cygwin*)        gl_cv_func_printf_directive_ls="guessing no";;
25601           beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
25602                           # Guess yes on native Windows.
25603           mingw*)         gl_cv_func_printf_directive_ls="guessing yes";;
25604           *)              gl_cv_func_printf_directive_ls="guessing yes";;
25605         esac
25606
25607else
25608  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25609/* end confdefs.h.  */
25610
25611/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
25612   <wchar.h>.
25613   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
25614   included before <wchar.h>.  */
25615#include <stddef.h>
25616#include <stdio.h>
25617#include <time.h>
25618#include <wchar.h>
25619#include <string.h>
25620int main ()
25621{
25622  int result = 0;
25623  char buf[100];
25624  /* Test whether %ls works at all.
25625     This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
25626     Cygwin 1.5.  */
25627  {
25628    static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
25629    buf[0] = '\0';
25630    if (sprintf (buf, "%ls", wstring) < 0
25631        || strcmp (buf, "abc") != 0)
25632      result |= 1;
25633  }
25634  /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
25635     assertion failure inside libc), but not on OpenBSD 4.0.  */
25636  {
25637    static const wchar_t wstring[] = { 'a', 0 };
25638    buf[0] = '\0';
25639    if (sprintf (buf, "%ls", wstring) < 0
25640        || strcmp (buf, "a") != 0)
25641      result |= 2;
25642  }
25643  /* Test whether precisions in %ls are supported as specified in ISO C 99
25644     section 7.19.6.1:
25645       "If a precision is specified, no more than that many bytes are written
25646        (including shift sequences, if any), and the array shall contain a
25647        null wide character if, to equal the multibyte character sequence
25648        length given by the precision, the function would need to access a
25649        wide character one past the end of the array."
25650     This test fails on Solaris 10.  */
25651  {
25652    static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 };
25653    buf[0] = '\0';
25654    if (sprintf (buf, "%.2ls", wstring) < 0
25655        || strcmp (buf, "ab") != 0)
25656      result |= 8;
25657  }
25658  return result;
25659}
25660_ACEOF
25661if ac_fn_c_try_run "$LINENO"; then :
25662  gl_cv_func_printf_directive_ls=yes
25663else
25664  gl_cv_func_printf_directive_ls=no
25665fi
25666rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25667  conftest.$ac_objext conftest.beam conftest.$ac_ext
25668fi
25669
25670
25671fi
25672{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_ls" >&5
25673$as_echo "$gl_cv_func_printf_directive_ls" >&6; }
25674
25675
25676
25677     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the grouping flag" >&5
25678$as_echo_n "checking whether printf supports the grouping flag... " >&6; }
25679if ${gl_cv_func_printf_flag_grouping+:} false; then :
25680  $as_echo_n "(cached) " >&6
25681else
25682
25683      if test "$cross_compiling" = yes; then :
25684
25685         case "$host_os" in
25686           cygwin*)      gl_cv_func_printf_flag_grouping="guessing no";;
25687           netbsd*)      gl_cv_func_printf_flag_grouping="guessing no";;
25688                         # Guess no on native Windows.
25689           mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
25690           *)            gl_cv_func_printf_flag_grouping="guessing yes";;
25691         esac
25692
25693else
25694  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25695/* end confdefs.h.  */
25696
25697#include <stdio.h>
25698#include <string.h>
25699static char buf[100];
25700int main ()
25701{
25702  if (sprintf (buf, "%'d %d", 1234567, 99) < 0
25703      || buf[strlen (buf) - 1] != '9')
25704    return 1;
25705  return 0;
25706}
25707_ACEOF
25708if ac_fn_c_try_run "$LINENO"; then :
25709  gl_cv_func_printf_flag_grouping=yes
25710else
25711  gl_cv_func_printf_flag_grouping=no
25712fi
25713rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25714  conftest.$ac_objext conftest.beam conftest.$ac_ext
25715fi
25716
25717
25718fi
25719{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_grouping" >&5
25720$as_echo "$gl_cv_func_printf_flag_grouping" >&6; }
25721
25722
25723
25724     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the left-adjust flag correctly" >&5
25725$as_echo_n "checking whether printf supports the left-adjust flag correctly... " >&6; }
25726if ${gl_cv_func_printf_flag_leftadjust+:} false; then :
25727  $as_echo_n "(cached) " >&6
25728else
25729
25730      if test "$cross_compiling" = yes; then :
25731
25732         case "$host_os" in
25733                    # Guess yes on HP-UX 11.
25734           hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
25735                    # Guess no on HP-UX 10 and older.
25736           hpux*)   gl_cv_func_printf_flag_leftadjust="guessing no";;
25737                    # Guess yes on native Windows.
25738           mingw*)  gl_cv_func_printf_flag_leftadjust="guessing yes";;
25739                    # Guess yes otherwise.
25740           *)       gl_cv_func_printf_flag_leftadjust="guessing yes";;
25741         esac
25742
25743else
25744  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25745/* end confdefs.h.  */
25746
25747#include <stdio.h>
25748#include <string.h>
25749static char buf[100];
25750int main ()
25751{
25752  /* Check that a '-' flag is not annihilated by a negative width.  */
25753  if (sprintf (buf, "a%-*sc", -3, "b") < 0
25754      || strcmp (buf, "ab  c") != 0)
25755    return 1;
25756  return 0;
25757}
25758_ACEOF
25759if ac_fn_c_try_run "$LINENO"; then :
25760  gl_cv_func_printf_flag_leftadjust=yes
25761else
25762  gl_cv_func_printf_flag_leftadjust=no
25763fi
25764rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25765  conftest.$ac_objext conftest.beam conftest.$ac_ext
25766fi
25767
25768
25769fi
25770{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_leftadjust" >&5
25771$as_echo "$gl_cv_func_printf_flag_leftadjust" >&6; }
25772
25773
25774
25775     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the zero flag correctly" >&5
25776$as_echo_n "checking whether printf supports the zero flag correctly... " >&6; }
25777if ${gl_cv_func_printf_flag_zero+:} false; then :
25778  $as_echo_n "(cached) " >&6
25779else
25780
25781      if test "$cross_compiling" = yes; then :
25782
25783         case "$host_os" in
25784                          # Guess yes on glibc systems.
25785           *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
25786                          # Guess yes on BeOS.
25787           beos*)         gl_cv_func_printf_flag_zero="guessing yes";;
25788                          # Guess no on native Windows.
25789           mingw*)        gl_cv_func_printf_flag_zero="guessing no";;
25790                          # If we don't know, assume the worst.
25791           *)             gl_cv_func_printf_flag_zero="guessing no";;
25792         esac
25793
25794else
25795  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25796/* end confdefs.h.  */
25797
25798#include <stdio.h>
25799#include <string.h>
25800static char buf[100];
25801static double zero = 0.0;
25802int main ()
25803{
25804  if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0
25805      || (strcmp (buf, "       inf") != 0
25806          && strcmp (buf, "  infinity") != 0))
25807    return 1;
25808  return 0;
25809}
25810_ACEOF
25811if ac_fn_c_try_run "$LINENO"; then :
25812  gl_cv_func_printf_flag_zero=yes
25813else
25814  gl_cv_func_printf_flag_zero=no
25815fi
25816rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25817  conftest.$ac_objext conftest.beam conftest.$ac_ext
25818fi
25819
25820
25821fi
25822{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_zero" >&5
25823$as_echo "$gl_cv_func_printf_flag_zero" >&6; }
25824
25825
25826
25827     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports large precisions" >&5
25828$as_echo_n "checking whether printf supports large precisions... " >&6; }
25829if ${gl_cv_func_printf_precision+:} false; then :
25830  $as_echo_n "(cached) " >&6
25831else
25832
25833      if test "$cross_compiling" = yes; then :
25834
25835         case "$host_os" in
25836           # Guess no only on Solaris, native Windows, and BeOS systems.
25837           solaris*)     gl_cv_func_printf_precision="guessing no" ;;
25838           mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
25839           beos*)        gl_cv_func_printf_precision="guessing no" ;;
25840           *)            gl_cv_func_printf_precision="guessing yes" ;;
25841         esac
25842
25843else
25844  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25845/* end confdefs.h.  */
25846
25847#include <stdio.h>
25848#include <string.h>
25849static char buf[5000];
25850int main ()
25851{
25852  int result = 0;
25853#ifdef __BEOS__
25854  /* On BeOS, this would crash and show a dialog box.  Avoid the crash.  */
25855  return 1;
25856#endif
25857  if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
25858    result |= 1;
25859  if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
25860    result |= 2;
25861  if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
25862      || buf[0] != '1')
25863    result |= 4;
25864  if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5
25865      || buf[0] != '1')
25866    result |= 4;
25867  return result;
25868}
25869_ACEOF
25870if ac_fn_c_try_run "$LINENO"; then :
25871  gl_cv_func_printf_precision=yes
25872else
25873  gl_cv_func_printf_precision=no
25874fi
25875rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
25876  conftest.$ac_objext conftest.beam conftest.$ac_ext
25877fi
25878
25879
25880fi
25881{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_precision" >&5
25882$as_echo "$gl_cv_func_printf_precision" >&6; }
25883
25884
25885
25886
25887     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf survives out-of-memory conditions" >&5
25888$as_echo_n "checking whether printf survives out-of-memory conditions... " >&6; }
25889if ${gl_cv_func_printf_enomem+:} false; then :
25890  $as_echo_n "(cached) " >&6
25891else
25892
25893      gl_cv_func_printf_enomem="guessing no"
25894      if test "$cross_compiling" = no; then
25895        if test $APPLE_UNIVERSAL_BUILD = 0; then
25896          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25897/* end confdefs.h.  */
25898
25899
25900#include <stdlib.h>
25901#if defined __MACH__ && defined __APPLE__
25902/* Avoid a crash on Mac OS X.  */
25903#include <mach/mach.h>
25904#include <mach/mach_error.h>
25905#include <mach/thread_status.h>
25906#include <mach/exception.h>
25907#include <mach/task.h>
25908#include <pthread.h>
25909/* The exception port on which our thread listens.  */
25910static mach_port_t our_exception_port;
25911/* The main function of the thread listening for exceptions of type
25912   EXC_BAD_ACCESS.  */
25913static void *
25914mach_exception_thread (void *arg)
25915{
25916  /* Buffer for a message to be received.  */
25917  struct {
25918    mach_msg_header_t head;
25919    mach_msg_body_t msgh_body;
25920    char data1024;
25921  } msg;
25922  mach_msg_return_t retval;
25923  /* Wait for a message on the exception port.  */
25924  retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
25925                     our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
25926  if (retval != MACH_MSG_SUCCESS)
25927    abort ();
25928  exit (1);
25929}
25930static void
25931nocrash_init (void)
25932{
25933  mach_port_t self = mach_task_self ();
25934  /* Allocate a port on which the thread shall listen for exceptions.  */
25935  if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
25936      == KERN_SUCCESS) {
25937    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
25938    if (mach_port_insert_right (self, our_exception_port, our_exception_port,
25939                                MACH_MSG_TYPE_MAKE_SEND)
25940        == KERN_SUCCESS) {
25941      /* The exceptions we want to catch.  Only EXC_BAD_ACCESS is interesting
25942         for us.  */
25943      exception_mask_t mask = EXC_MASK_BAD_ACCESS;
25944      /* Create the thread listening on the exception port.  */
25945      pthread_attr_t attr;
25946      pthread_t thread;
25947      if (pthread_attr_init (&attr) == 0
25948          && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
25949          && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
25950        pthread_attr_destroy (&attr);
25951        /* Replace the exception port info for these exceptions with our own.
25952           Note that we replace the exception port for the entire task, not only
25953           for a particular thread.  This has the effect that when our exception
25954           port gets the message, the thread specific exception port has already
25955           been asked, and we don't need to bother about it.
25956           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
25957        task_set_exception_ports (self, mask, our_exception_port,
25958                                  EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
25959      }
25960    }
25961  }
25962}
25963#elif defined _WIN32 && ! defined __CYGWIN__
25964/* Avoid a crash on native Windows.  */
25965#define WIN32_LEAN_AND_MEAN
25966#include <windows.h>
25967#include <winerror.h>
25968static LONG WINAPI
25969exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
25970{
25971  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
25972    {
25973    case EXCEPTION_ACCESS_VIOLATION:
25974    case EXCEPTION_IN_PAGE_ERROR:
25975    case EXCEPTION_STACK_OVERFLOW:
25976    case EXCEPTION_GUARD_PAGE:
25977    case EXCEPTION_PRIV_INSTRUCTION:
25978    case EXCEPTION_ILLEGAL_INSTRUCTION:
25979    case EXCEPTION_DATATYPE_MISALIGNMENT:
25980    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
25981    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
25982      exit (1);
25983    }
25984  return EXCEPTION_CONTINUE_SEARCH;
25985}
25986static void
25987nocrash_init (void)
25988{
25989  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
25990}
25991#else
25992/* Avoid a crash on POSIX systems.  */
25993#include <signal.h>
25994#include <unistd.h>
25995/* A POSIX signal handler.  */
25996static void
25997exception_handler (int sig)
25998{
25999  _exit (1);
26000}
26001static void
26002nocrash_init (void)
26003{
26004#ifdef SIGSEGV
26005  signal (SIGSEGV, exception_handler);
26006#endif
26007#ifdef SIGBUS
26008  signal (SIGBUS, exception_handler);
26009#endif
26010}
26011#endif
26012
26013#include <stdio.h>
26014#include <sys/types.h>
26015#include <sys/time.h>
26016#include <sys/resource.h>
26017#include <errno.h>
26018int main()
26019{
26020  struct rlimit limit;
26021  int ret;
26022  nocrash_init ();
26023  /* Some printf implementations allocate temporary space with malloc.  */
26024  /* On BSD systems, malloc() is limited by RLIMIT_DATA.  */
26025#ifdef RLIMIT_DATA
26026  if (getrlimit (RLIMIT_DATA, &limit) < 0)
26027    return 77;
26028  if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
26029    limit.rlim_max = 5000000;
26030  limit.rlim_cur = limit.rlim_max;
26031  if (setrlimit (RLIMIT_DATA, &limit) < 0)
26032    return 77;
26033#endif
26034  /* On Linux systems, malloc() is limited by RLIMIT_AS.  */
26035#ifdef RLIMIT_AS
26036  if (getrlimit (RLIMIT_AS, &limit) < 0)
26037    return 77;
26038  if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
26039    limit.rlim_max = 5000000;
26040  limit.rlim_cur = limit.rlim_max;
26041  if (setrlimit (RLIMIT_AS, &limit) < 0)
26042    return 77;
26043#endif
26044  /* Some printf implementations allocate temporary space on the stack.  */
26045#ifdef RLIMIT_STACK
26046  if (getrlimit (RLIMIT_STACK, &limit) < 0)
26047    return 77;
26048  if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
26049    limit.rlim_max = 5000000;
26050  limit.rlim_cur = limit.rlim_max;
26051  if (setrlimit (RLIMIT_STACK, &limit) < 0)
26052    return 77;
26053#endif
26054  ret = printf ("%.5000000f", 1.0);
26055  return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
26056}
26057
26058_ACEOF
26059          if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
26060  (eval $ac_link) 2>&5
26061  ac_status=$?
26062  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
26063  test $ac_status = 0; } && test -s conftest$ac_exeext; then
26064            (./conftest 2>&5
26065             result=$?
26066             $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $result" >&5
26067             if test $result != 0 && test $result != 77; then result=1; fi
26068             exit $result
26069            ) >/dev/null 2>/dev/null
26070            case $? in
26071              0) gl_cv_func_printf_enomem="yes" ;;
26072              77) gl_cv_func_printf_enomem="guessing no" ;;
26073              *) gl_cv_func_printf_enomem="no" ;;
26074            esac
26075          else
26076            gl_cv_func_printf_enomem="guessing no"
26077          fi
26078          rm -fr conftest*
26079        else
26080                                        gl_cv_func_printf_enomem="guessing no"
26081        fi
26082      fi
26083      if test "$gl_cv_func_printf_enomem" = "guessing no"; then
26084        case "$host_os" in
26085                         # Guess yes on glibc systems.
26086          *-gnu* | gnu*) gl_cv_func_printf_enomem="guessing yes";;
26087                         # Guess yes on Solaris.
26088          solaris*)      gl_cv_func_printf_enomem="guessing yes";;
26089                         # Guess yes on AIX.
26090          aix*)          gl_cv_func_printf_enomem="guessing yes";;
26091                         # Guess yes on HP-UX/hppa.
26092          hpux*)         case "$host_cpu" in
26093                           hppa*) gl_cv_func_printf_enomem="guessing yes";;
26094                           *)     gl_cv_func_printf_enomem="guessing no";;
26095                         esac
26096                         ;;
26097                         # Guess yes on IRIX.
26098          irix*)         gl_cv_func_printf_enomem="guessing yes";;
26099                         # Guess yes on OSF/1.
26100          osf*)          gl_cv_func_printf_enomem="guessing yes";;
26101                         # Guess yes on BeOS.
26102          beos*)         gl_cv_func_printf_enomem="guessing yes";;
26103                         # Guess yes on Haiku.
26104          haiku*)        gl_cv_func_printf_enomem="guessing yes";;
26105                         # If we don't know, assume the worst.
26106          *)             gl_cv_func_printf_enomem="guessing no";;
26107        esac
26108      fi
26109
26110fi
26111{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_enomem" >&5
26112$as_echo "$gl_cv_func_printf_enomem" >&6; }
26113
26114
26115
26116  case "$gl_cv_func_printf_long_double" in
26117    *yes)
26118      ;;
26119    *)
26120
26121$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
26122
26123      ;;
26124  esac
26125
26126
26127
26128
26129
26130
26131
26132
26133
26134
26135
26136
26137
26138
26139
26140
26141  ac_fn_c_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" "
26142/* AIX 3.2.5 declares wcwidth in <string.h>. */
26143#include <string.h>
26144/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
26145   <wchar.h>.
26146   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
26147   before <wchar.h>.  */
26148#include <stddef.h>
26149#include <stdio.h>
26150#include <time.h>
26151#include <wchar.h>
26152
26153"
26154if test "x$ac_cv_have_decl_wcwidth" = xyes; then :
26155  ac_have_decl=1
26156else
26157  ac_have_decl=0
26158fi
26159
26160cat >>confdefs.h <<_ACEOF
26161#define HAVE_DECL_WCWIDTH $ac_have_decl
26162_ACEOF
26163
26164  if test $ac_cv_have_decl_wcwidth != yes; then
26165    HAVE_DECL_WCWIDTH=0
26166  fi
26167
26168  if test $ac_cv_func_wcwidth != yes; then
26169    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth is a macro" >&5
26170$as_echo_n "checking whether wcwidth is a macro... " >&6; }
26171if ${gl_cv_func_wcwidth_macro+:} false; then :
26172  $as_echo_n "(cached) " >&6
26173else
26174  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26175/* end confdefs.h.  */
26176
26177#include <wchar.h>
26178#ifdef wcwidth
26179 wchar_header_defines_wcwidth
26180#endif
26181_ACEOF
26182if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
26183  $EGREP "wchar_header_defines_wcwidth" >/dev/null 2>&1; then :
26184  gl_cv_func_wcwidth_macro=yes
26185else
26186  gl_cv_func_wcwidth_macro=no
26187fi
26188rm -f conftest*
26189
26190
26191fi
26192{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_macro" >&5
26193$as_echo "$gl_cv_func_wcwidth_macro" >&6; }
26194  fi
26195
26196  if test $ac_cv_func_wcwidth = yes || test $gl_cv_func_wcwidth_macro = yes; then
26197    HAVE_WCWIDTH=1
26198                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5
26199$as_echo_n "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; }
26200if ${gl_cv_func_wcwidth_works+:} false; then :
26201  $as_echo_n "(cached) " >&6
26202else
26203
26204        if test "$cross_compiling" = yes; then :
26205
26206           case "$host_os" in
26207                                        # Guess yes on glibc and AIX 7 systems.
26208             *-gnu* | gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";;
26209             *)                         gl_cv_func_wcwidth_works="guessing no";;
26210           esac
26211
26212else
26213  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26214/* end confdefs.h.  */
26215
26216#include <locale.h>
26217/* AIX 3.2.5 declares wcwidth in <string.h>. */
26218#include <string.h>
26219/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
26220   <wchar.h>.
26221   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
26222   before <wchar.h>.  */
26223#include <stddef.h>
26224#include <stdio.h>
26225#include <time.h>
26226#include <wchar.h>
26227#if !HAVE_DECL_WCWIDTH
26228extern
26229# ifdef __cplusplus
26230"C"
26231# endif
26232int wcwidth (int);
26233#endif
26234int main ()
26235{
26236  int result = 0;
26237  if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL)
26238    {
26239      if (wcwidth (0x0301) > 0)
26240        result |= 1;
26241      if (wcwidth (0x05B0) > 0)
26242        result |= 2;
26243      if (wcwidth (0x200B) > 0)
26244        result |= 4;
26245      if (wcwidth (0xFF1A) == 0)
26246        result |= 8;
26247    }
26248  return result;
26249}
26250_ACEOF
26251if ac_fn_c_try_run "$LINENO"; then :
26252  gl_cv_func_wcwidth_works=yes
26253else
26254  gl_cv_func_wcwidth_works=no
26255fi
26256rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26257  conftest.$ac_objext conftest.beam conftest.$ac_ext
26258fi
26259
26260
26261fi
26262{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5
26263$as_echo "$gl_cv_func_wcwidth_works" >&6; }
26264    case "$gl_cv_func_wcwidth_works" in
26265      *yes) ;;
26266      *no) REPLACE_WCWIDTH=1 ;;
26267    esac
26268  else
26269    HAVE_WCWIDTH=0
26270  fi
26271
26272
26273
26274{ $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX termios" >&5
26275$as_echo_n "checking POSIX termios... " >&6; }
26276if ${ac_cv_sys_posix_termios+:} false; then :
26277  $as_echo_n "(cached) " >&6
26278else
26279  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26280/* end confdefs.h.  */
26281#include <sys/types.h>
26282#include <unistd.h>
26283#include <termios.h>
26284
26285int
26286main ()
26287{
26288/* SunOS 4.0.3 has termios.h but not the library calls.  */
26289   tcgetattr(0, 0);
26290  ;
26291  return 0;
26292}
26293_ACEOF
26294if ac_fn_c_try_link "$LINENO"; then :
26295  ac_cv_sys_posix_termios=yes
26296else
26297  ac_cv_sys_posix_termios=no
26298fi
26299rm -f core conftest.err conftest.$ac_objext \
26300    conftest$ac_exeext conftest.$ac_ext
26301fi
26302{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_posix_termios" >&5
26303$as_echo "$ac_cv_sys_posix_termios" >&6; }
26304
26305
26306 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of TIOCGWINSZ requires termios.h" >&5
26307$as_echo_n "checking whether use of TIOCGWINSZ requires termios.h... " >&6; }
26308if ${gl_cv_sys_tiocgwinsz_needs_termios_h+:} false; then :
26309  $as_echo_n "(cached) " >&6
26310else
26311  gl_cv_sys_tiocgwinsz_needs_termios_h=no
26312
26313   if test $ac_cv_sys_posix_termios = yes; then
26314     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26315/* end confdefs.h.  */
26316#include <sys/types.h>
26317#      include <termios.h>
26318#      ifdef TIOCGWINSZ
26319         yes
26320#      endif
26321
26322_ACEOF
26323if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
26324  $EGREP "yes" >/dev/null 2>&1; then :
26325  gl_cv_sys_tiocgwinsz_needs_termios_h=yes
26326fi
26327rm -f conftest*
26328
26329   fi
26330
26331fi
26332{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_tiocgwinsz_needs_termios_h" >&5
26333$as_echo "$gl_cv_sys_tiocgwinsz_needs_termios_h" >&6; }
26334
26335
26336                              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit time_t" >&5
26337$as_echo_n "checking for 64-bit time_t... " >&6; }
26338if ${gl_cv_type_time_t_64+:} false; then :
26339  $as_echo_n "(cached) " >&6
26340else
26341  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26342/* end confdefs.h.  */
26343#include <time.h>
26344            int verify_time_t_size[sizeof (time_t) >= 8 ? 1 : -1];
26345
26346int
26347main ()
26348{
26349
26350  ;
26351  return 0;
26352}
26353_ACEOF
26354if ac_fn_c_try_compile "$LINENO"; then :
26355  gl_cv_type_time_t_64=yes
26356else
26357  gl_cv_type_time_t_64=no
26358fi
26359rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26360
26361fi
26362{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_time_t_64" >&5
26363$as_echo "$gl_cv_type_time_t_64" >&6; }
26364  if test $gl_cv_type_time_t_64 = no; then
26365    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26366/* end confdefs.h.  */
26367#ifdef _USE_32BIT_TIME_T
26368             int ok;
26369           #else
26370             error fail
26371           #endif
26372
26373_ACEOF
26374if ac_fn_c_try_compile "$LINENO"; then :
26375  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
26376$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
26377as_fn_error $? "This package requires a 64-bit 'time_t' type. Remove _USE_32BIT_TIME_T from the compiler flags.
26378See \`config.log' for more details" "$LINENO" 5; }
26379else
26380  # If TIME_T_32_BIT_OK is "no" (the default) and not cross-compiling
26381       # and 'touch' works with a large timestamp, then evidently 64-bit time_t
26382       # is desired and supported, so fail and ask the builder to fix the
26383       # problem.  Otherwise, just warn the builder.
26384       if test "${TIME_T_32_BIT_OK-no}" = no \
26385          && test $cross_compiling = no \
26386          && TZ=UTC0 touch -t 210602070628.16 conftest.time 2>/dev/null; then
26387         rm -f conftest.time
26388         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
26389$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
26390as_fn_error $? "This package requires a 64-bit 'time_t' type, which your system appears to support. You might try configuring with 'CPPFLAGS=\"-m64\" LDFLAGS=\"-m64\"'. To build with a 32-bit time_t anyway (not recommended), configure with 'TIME_T_32_BIT_OK=yes'.
26391See \`config.log' for more details" "$LINENO" 5; }
26392       else
26393         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This package requires a 64-bit 'time_t' type if there is any way to access timestamps outside the year range 1901-2038 on your platform. Perhaps you should configure with 'CPPFLAGS=\"-m64\" LDFLAGS=\"-m64\"'?" >&5
26394$as_echo "$as_me: WARNING: This package requires a 64-bit 'time_t' type if there is any way to access timestamps outside the year range 1901-2038 on your platform. Perhaps you should configure with 'CPPFLAGS=\"-m64\" LDFLAGS=\"-m64\"'?" >&2;}
26395       fi
26396
26397fi
26398rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26399  fi
26400
26401
26402
26403
26404
26405
26406  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ungetc works on arbitrary bytes" >&5
26407$as_echo_n "checking whether ungetc works on arbitrary bytes... " >&6; }
26408if ${gl_cv_func_ungetc_works+:} false; then :
26409  $as_echo_n "(cached) " >&6
26410else
26411  if test "$cross_compiling" = yes; then :
26412  case "$host_os" in
26413                                       # Guess yes on glibc and bionic systems.
26414           *-gnu* | gnu* | *-android*) gl_cv_func_ungetc_works="guessing yes" ;;
26415                                       # Guess yes on native Windows.
26416           mingw*)                     gl_cv_func_ungetc_works="guessing yes" ;;
26417                                       # If we don't know, assume the worst.
26418           *)                          gl_cv_func_ungetc_works="guessing no" ;;
26419         esac
26420
26421else
26422  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26423/* end confdefs.h.  */
26424
26425#include <stdio.h>
26426
26427int
26428main ()
26429{
26430FILE *f;
26431           if (!(f = fopen ("conftest.tmp", "w+")))
26432             return 1;
26433           if (fputs ("abc", f) < 0)
26434             { fclose (f); return 2; }
26435           rewind (f);
26436           if (fgetc (f) != 'a')
26437             { fclose (f); return 3; }
26438           if (fgetc (f) != 'b')
26439             { fclose (f); return 4; }
26440           if (ungetc ('d', f) != 'd')
26441             { fclose (f); return 5; }
26442           if (ftell (f) != 1)
26443             { fclose (f); return 6; }
26444           if (fgetc (f) != 'd')
26445             { fclose (f); return 7; }
26446           if (ftell (f) != 2)
26447             { fclose (f); return 8; }
26448           if (fseek (f, 0, SEEK_CUR) != 0)
26449             { fclose (f); return 9; }
26450           if (ftell (f) != 2)
26451             { fclose (f); return 10; }
26452           if (fgetc (f) != 'c')
26453             { fclose (f); return 11; }
26454           fclose (f);
26455           remove ("conftest.tmp");
26456  ;
26457  return 0;
26458}
26459_ACEOF
26460if ac_fn_c_try_run "$LINENO"; then :
26461  gl_cv_func_ungetc_works=yes
26462else
26463  gl_cv_func_ungetc_works=no
26464fi
26465rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
26466  conftest.$ac_objext conftest.beam conftest.$ac_ext
26467fi
26468
26469
26470fi
26471{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ungetc_works" >&5
26472$as_echo "$gl_cv_func_ungetc_works" >&6; }
26473  case "$gl_cv_func_ungetc_works" in
26474    *yes) ;;
26475    *)
26476
26477$as_echo "#define FUNC_UNGETC_BROKEN 1" >>confdefs.h
26478
26479      ;;
26480  esac
26481
26482
26483
26484
26485
26486
26487  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
26488$as_echo_n "checking for LC_MESSAGES... " >&6; }
26489if ${gt_cv_val_LC_MESSAGES+:} false; then :
26490  $as_echo_n "(cached) " >&6
26491else
26492  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26493/* end confdefs.h.  */
26494#include <locale.h>
26495int
26496main ()
26497{
26498return LC_MESSAGES
26499  ;
26500  return 0;
26501}
26502_ACEOF
26503if ac_fn_c_try_link "$LINENO"; then :
26504  gt_cv_val_LC_MESSAGES=yes
26505else
26506  gt_cv_val_LC_MESSAGES=no
26507fi
26508rm -f core conftest.err conftest.$ac_objext \
26509    conftest$ac_exeext conftest.$ac_ext
26510fi
26511{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_val_LC_MESSAGES" >&5
26512$as_echo "$gt_cv_val_LC_MESSAGES" >&6; }
26513  if test $gt_cv_val_LC_MESSAGES = yes; then
26514
26515$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
26516
26517  fi
26518
26519
26520    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
26521$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; }
26522if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then :
26523  $as_echo_n "(cached) " >&6
26524else
26525  gt_save_LIBS="$LIBS"
26526     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
26527     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26528/* end confdefs.h.  */
26529#include <CoreFoundation/CFPreferences.h>
26530int
26531main ()
26532{
26533CFPreferencesCopyAppValue(NULL, NULL)
26534  ;
26535  return 0;
26536}
26537_ACEOF
26538if ac_fn_c_try_link "$LINENO"; then :
26539  gt_cv_func_CFPreferencesCopyAppValue=yes
26540else
26541  gt_cv_func_CFPreferencesCopyAppValue=no
26542fi
26543rm -f core conftest.err conftest.$ac_objext \
26544    conftest$ac_exeext conftest.$ac_ext
26545     LIBS="$gt_save_LIBS"
26546fi
26547{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
26548$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
26549  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
26550
26551$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
26552
26553  fi
26554    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5
26555$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; }
26556if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then :
26557  $as_echo_n "(cached) " >&6
26558else
26559  gt_save_LIBS="$LIBS"
26560     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
26561     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26562/* end confdefs.h.  */
26563#include <CoreFoundation/CFLocale.h>
26564int
26565main ()
26566{
26567CFLocaleCopyCurrent();
26568  ;
26569  return 0;
26570}
26571_ACEOF
26572if ac_fn_c_try_link "$LINENO"; then :
26573  gt_cv_func_CFLocaleCopyCurrent=yes
26574else
26575  gt_cv_func_CFLocaleCopyCurrent=no
26576fi
26577rm -f core conftest.err conftest.$ac_objext \
26578    conftest$ac_exeext conftest.$ac_ext
26579     LIBS="$gt_save_LIBS"
26580fi
26581{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5
26582$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; }
26583  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
26584
26585$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
26586
26587  fi
26588  INTL_MACOSX_LIBS=
26589  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
26590    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
26591  fi
26592
26593
26594
26595
26596ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
26597if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
26598  ac_have_decl=1
26599else
26600  ac_have_decl=0
26601fi
26602
26603cat >>confdefs.h <<_ACEOF
26604#define HAVE_DECL_STRERROR_R $ac_have_decl
26605_ACEOF
26606
26607
26608
26609
26610
26611
26612
26613
26614  if test $ac_cv_have_decl_strerror_r = no; then
26615    HAVE_DECL_STRERROR_R=0
26616  fi
26617
26618  if test $ac_cv_func_strerror_r = yes; then
26619    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
26620      if test $gl_cv_func_strerror_r_posix_signature = yes; then
26621        case "$gl_cv_func_strerror_r_works" in
26622                    *no) REPLACE_STRERROR_R=1 ;;
26623        esac
26624      else
26625                REPLACE_STRERROR_R=1
26626      fi
26627    else
26628                  REPLACE_STRERROR_R=1
26629    fi
26630  fi
26631
26632
26633
26634
26635
26636
26637
26638
26639
26640
26641
26642
26643
26644
26645   if false; then
26646  GL_COND_LIBTOOL_TRUE=
26647  GL_COND_LIBTOOL_FALSE='#'
26648else
26649  GL_COND_LIBTOOL_TRUE='#'
26650  GL_COND_LIBTOOL_FALSE=
26651fi
26652
26653  gl_cond_libtool=false
26654  gl_libdeps=
26655  gl_ltlibdeps=
26656  gl_m4_base='m4'
26657
26658
26659
26660
26661
26662
26663
26664
26665
26666  gl_source_base='lib'
26667
26668
26669
26670  LIB_ACL=
26671  use_acl=0
26672  if test "$enable_acl" != no; then
26673        for ac_header in sys/acl.h
26674do :
26675  ac_fn_c_check_header_mongrel "$LINENO" "sys/acl.h" "ac_cv_header_sys_acl_h" "$ac_includes_default"
26676if test "x$ac_cv_header_sys_acl_h" = xyes; then :
26677  cat >>confdefs.h <<_ACEOF
26678#define HAVE_SYS_ACL_H 1
26679_ACEOF
26680
26681fi
26682
26683done
26684
26685    if test $ac_cv_header_sys_acl_h = yes; then
26686      ac_save_LIBS=$LIBS
26687
26688                  if test $use_acl = 0; then
26689        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing acl_get_file" >&5
26690$as_echo_n "checking for library containing acl_get_file... " >&6; }
26691if ${ac_cv_search_acl_get_file+:} false; then :
26692  $as_echo_n "(cached) " >&6
26693else
26694  ac_func_search_save_LIBS=$LIBS
26695cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26696/* end confdefs.h.  */
26697
26698/* Override any GCC internal prototype to avoid an error.
26699   Use char because int might match the return type of a GCC
26700   builtin and then its argument prototype would still apply.  */
26701#ifdef __cplusplus
26702extern "C"
26703#endif
26704char acl_get_file ();
26705int
26706main ()
26707{
26708return acl_get_file ();
26709  ;
26710  return 0;
26711}
26712_ACEOF
26713for ac_lib in '' acl pacl; do
26714  if test -z "$ac_lib"; then
26715    ac_res="none required"
26716  else
26717    ac_res=-l$ac_lib
26718    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
26719  fi
26720  if ac_fn_c_try_link "$LINENO"; then :
26721  ac_cv_search_acl_get_file=$ac_res
26722fi
26723rm -f core conftest.err conftest.$ac_objext \
26724    conftest$ac_exeext
26725  if ${ac_cv_search_acl_get_file+:} false; then :
26726  break
26727fi
26728done
26729if ${ac_cv_search_acl_get_file+:} false; then :
26730
26731else
26732  ac_cv_search_acl_get_file=no
26733fi
26734rm conftest.$ac_ext
26735LIBS=$ac_func_search_save_LIBS
26736fi
26737{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_acl_get_file" >&5
26738$as_echo "$ac_cv_search_acl_get_file" >&6; }
26739ac_res=$ac_cv_search_acl_get_file
26740if test "$ac_res" != no; then :
26741  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
26742  if test "$ac_cv_search_acl_get_file" != "none required"; then
26743             LIB_ACL=$ac_cv_search_acl_get_file
26744           fi
26745           for ac_func in acl_get_file acl_get_fd acl_set_file acl_set_fd \
26746              acl_free acl_from_mode acl_from_text \
26747              acl_delete_def_file acl_extended_file \
26748              acl_delete_fd_np acl_delete_file_np \
26749              acl_copy_ext_native acl_create_entry_np \
26750              acl_to_short_text acl_free_text
26751do :
26752  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
26753ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
26754if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
26755  cat >>confdefs.h <<_ACEOF
26756#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
26757_ACEOF
26758
26759fi
26760done
26761
26762           # If the acl_get_file bug is detected, don't enable the ACL support.
26763
26764  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working acl_get_file" >&5
26765$as_echo_n "checking for working acl_get_file... " >&6; }
26766if ${gl_cv_func_working_acl_get_file+:} false; then :
26767  $as_echo_n "(cached) " >&6
26768else
26769  gl_cv_func_working_acl_get_file=no
26770     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26771/* end confdefs.h.  */
26772#include <sys/types.h>
26773           #include <sys/acl.h>
26774           #include <errno.h>
26775
26776int
26777main ()
26778{
26779acl_t acl = acl_get_file (".", ACL_TYPE_ACCESS);
26780            return acl ? acl_free (acl) != 0 : errno == ENOENT;
26781
26782  ;
26783  return 0;
26784}
26785_ACEOF
26786if ac_fn_c_try_link "$LINENO"; then :
26787  if test $cross_compiling = yes; then
26788          gl_cv_func_working_acl_get_file="guessing yes"
26789        elif ./conftest$ac_exeext; then
26790          gl_cv_func_working_acl_get_file=yes
26791        fi
26792fi
26793rm -f core conftest.err conftest.$ac_objext \
26794    conftest$ac_exeext conftest.$ac_ext
26795fi
26796{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_acl_get_file" >&5
26797$as_echo "$gl_cv_func_working_acl_get_file" >&6; }
26798  if test "$gl_cv_func_working_acl_get_file" != no; then :
26799  use_acl=1
26800fi
26801
26802           if test $use_acl = 1; then
26803                          for ac_header in acl/libacl.h
26804do :
26805  ac_fn_c_check_header_mongrel "$LINENO" "acl/libacl.h" "ac_cv_header_acl_libacl_h" "$ac_includes_default"
26806if test "x$ac_cv_header_acl_libacl_h" = xyes; then :
26807  cat >>confdefs.h <<_ACEOF
26808#define HAVE_ACL_LIBACL_H 1
26809_ACEOF
26810
26811fi
26812
26813done
26814
26815
26816
26817
26818
26819
26820
26821
26822
26823  for ac_func in acl_entries
26824do :
26825  ac_fn_c_check_func "$LINENO" "acl_entries" "ac_cv_func_acl_entries"
26826if test "x$ac_cv_func_acl_entries" = xyes; then :
26827  cat >>confdefs.h <<_ACEOF
26828#define HAVE_ACL_ENTRIES 1
26829_ACEOF
26830
26831else
26832
26833    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
26834
26835fi
26836done
26837
26838
26839             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ACL_FIRST_ENTRY" >&5
26840$as_echo_n "checking for ACL_FIRST_ENTRY... " >&6; }
26841if ${gl_cv_acl_ACL_FIRST_ENTRY+:} false; then :
26842  $as_echo_n "(cached) " >&6
26843else
26844  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26845/* end confdefs.h.  */
26846#include <sys/types.h>
26847#include <sys/acl.h>
26848int type = ACL_FIRST_ENTRY;
26849int
26850main ()
26851{
26852
26853  ;
26854  return 0;
26855}
26856_ACEOF
26857if ac_fn_c_try_compile "$LINENO"; then :
26858  gl_cv_acl_ACL_FIRST_ENTRY=yes
26859else
26860  gl_cv_acl_ACL_FIRST_ENTRY=no
26861fi
26862rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26863fi
26864{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_acl_ACL_FIRST_ENTRY" >&5
26865$as_echo "$gl_cv_acl_ACL_FIRST_ENTRY" >&6; }
26866             if test $gl_cv_acl_ACL_FIRST_ENTRY = yes; then
26867
26868$as_echo "#define HAVE_ACL_FIRST_ENTRY 1" >>confdefs.h
26869
26870             fi
26871                          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ACL_TYPE_EXTENDED" >&5
26872$as_echo_n "checking for ACL_TYPE_EXTENDED... " >&6; }
26873if ${gl_cv_acl_ACL_TYPE_EXTENDED+:} false; then :
26874  $as_echo_n "(cached) " >&6
26875else
26876  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26877/* end confdefs.h.  */
26878#include <sys/types.h>
26879#include <sys/acl.h>
26880int type = ACL_TYPE_EXTENDED;
26881int
26882main ()
26883{
26884
26885  ;
26886  return 0;
26887}
26888_ACEOF
26889if ac_fn_c_try_compile "$LINENO"; then :
26890  gl_cv_acl_ACL_TYPE_EXTENDED=yes
26891else
26892  gl_cv_acl_ACL_TYPE_EXTENDED=no
26893fi
26894rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26895fi
26896{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_acl_ACL_TYPE_EXTENDED" >&5
26897$as_echo "$gl_cv_acl_ACL_TYPE_EXTENDED" >&6; }
26898             if test $gl_cv_acl_ACL_TYPE_EXTENDED = yes; then
26899
26900$as_echo "#define HAVE_ACL_TYPE_EXTENDED 1" >>confdefs.h
26901
26902             fi
26903           else
26904             LIB_ACL=
26905           fi
26906
26907fi
26908
26909      fi
26910
26911            if test $use_acl = 0; then
26912        for ac_func in facl
26913do :
26914  ac_fn_c_check_func "$LINENO" "facl" "ac_cv_func_facl"
26915if test "x$ac_cv_func_facl" = xyes; then :
26916  cat >>confdefs.h <<_ACEOF
26917#define HAVE_FACL 1
26918_ACEOF
26919
26920fi
26921done
26922
26923        if test $ac_cv_func_facl = yes; then
26924          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing acl_trivial" >&5
26925$as_echo_n "checking for library containing acl_trivial... " >&6; }
26926if ${ac_cv_search_acl_trivial+:} false; then :
26927  $as_echo_n "(cached) " >&6
26928else
26929  ac_func_search_save_LIBS=$LIBS
26930cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26931/* end confdefs.h.  */
26932
26933/* Override any GCC internal prototype to avoid an error.
26934   Use char because int might match the return type of a GCC
26935   builtin and then its argument prototype would still apply.  */
26936#ifdef __cplusplus
26937extern "C"
26938#endif
26939char acl_trivial ();
26940int
26941main ()
26942{
26943return acl_trivial ();
26944  ;
26945  return 0;
26946}
26947_ACEOF
26948for ac_lib in '' sec; do
26949  if test -z "$ac_lib"; then
26950    ac_res="none required"
26951  else
26952    ac_res=-l$ac_lib
26953    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
26954  fi
26955  if ac_fn_c_try_link "$LINENO"; then :
26956  ac_cv_search_acl_trivial=$ac_res
26957fi
26958rm -f core conftest.err conftest.$ac_objext \
26959    conftest$ac_exeext
26960  if ${ac_cv_search_acl_trivial+:} false; then :
26961  break
26962fi
26963done
26964if ${ac_cv_search_acl_trivial+:} false; then :
26965
26966else
26967  ac_cv_search_acl_trivial=no
26968fi
26969rm conftest.$ac_ext
26970LIBS=$ac_func_search_save_LIBS
26971fi
26972{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_acl_trivial" >&5
26973$as_echo "$ac_cv_search_acl_trivial" >&6; }
26974ac_res=$ac_cv_search_acl_trivial
26975if test "$ac_res" != no; then :
26976  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
26977  if test "$ac_cv_search_acl_trivial" != "none required"; then
26978               LIB_ACL=$ac_cv_search_acl_trivial
26979             fi
26980
26981fi
26982
26983          for ac_func in acl_trivial
26984do :
26985  ac_fn_c_check_func "$LINENO" "acl_trivial" "ac_cv_func_acl_trivial"
26986if test "x$ac_cv_func_acl_trivial" = xyes; then :
26987  cat >>confdefs.h <<_ACEOF
26988#define HAVE_ACL_TRIVIAL 1
26989_ACEOF
26990
26991fi
26992done
26993
26994          use_acl=1
26995        fi
26996      fi
26997
26998            if test $use_acl = 0; then
26999        for ac_func in getacl
27000do :
27001  ac_fn_c_check_func "$LINENO" "getacl" "ac_cv_func_getacl"
27002if test "x$ac_cv_func_getacl" = xyes; then :
27003  cat >>confdefs.h <<_ACEOF
27004#define HAVE_GETACL 1
27005_ACEOF
27006
27007fi
27008done
27009
27010        if test $ac_cv_func_getacl = yes; then
27011          use_acl=1
27012        fi
27013                for ac_header in aclv.h
27014do :
27015  ac_fn_c_check_header_compile "$LINENO" "aclv.h" "ac_cv_header_aclv_h" "#include <sys/types.h>
27016"
27017if test "x$ac_cv_header_aclv_h" = xyes; then :
27018  cat >>confdefs.h <<_ACEOF
27019#define HAVE_ACLV_H 1
27020_ACEOF
27021
27022fi
27023
27024done
27025
27026      fi
27027
27028            if test $use_acl = 0; then
27029        for ac_func in aclx_get
27030do :
27031  ac_fn_c_check_func "$LINENO" "aclx_get" "ac_cv_func_aclx_get"
27032if test "x$ac_cv_func_aclx_get" = xyes; then :
27033  cat >>confdefs.h <<_ACEOF
27034#define HAVE_ACLX_GET 1
27035_ACEOF
27036
27037fi
27038done
27039
27040        if test $ac_cv_func_aclx_get = yes; then
27041          use_acl=1
27042        fi
27043      fi
27044
27045            if test $use_acl = 0 || test "$ac_cv_func_aclx_get" = yes; then
27046        for ac_func in statacl
27047do :
27048  ac_fn_c_check_func "$LINENO" "statacl" "ac_cv_func_statacl"
27049if test "x$ac_cv_func_statacl" = xyes; then :
27050  cat >>confdefs.h <<_ACEOF
27051#define HAVE_STATACL 1
27052_ACEOF
27053
27054fi
27055done
27056
27057        if test $ac_cv_func_statacl = yes; then
27058          use_acl=1
27059        fi
27060      fi
27061
27062            if test $use_acl = 0; then
27063        for ac_func in aclsort
27064do :
27065  ac_fn_c_check_func "$LINENO" "aclsort" "ac_cv_func_aclsort"
27066if test "x$ac_cv_func_aclsort" = xyes; then :
27067  cat >>confdefs.h <<_ACEOF
27068#define HAVE_ACLSORT 1
27069_ACEOF
27070
27071fi
27072done
27073
27074        if test $ac_cv_func_aclsort = yes; then
27075          use_acl=1
27076        fi
27077      fi
27078
27079      LIBS=$ac_save_LIBS
27080    fi
27081
27082    if test "$enable_acl$use_acl" = yes0; then
27083      as_fn_error $? "ACLs enabled but support not detected" "$LINENO" 5
27084    elif test "$enable_acl$use_acl" = auto0; then
27085      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libacl development library was not found or not usable." >&5
27086$as_echo "$as_me: WARNING: libacl development library was not found or not usable." >&2;}
27087      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GNU coreutils will be built without ACL support." >&5
27088$as_echo "$as_me: WARNING: GNU coreutils will be built without ACL support." >&2;}
27089    fi
27090  fi
27091  test $gl_need_lib_has_acl && LIB_HAS_ACL=$LIB_ACL
27092
27093
27094cat >>confdefs.h <<_ACEOF
27095#define USE_ACL $use_acl
27096_ACEOF
27097
27098  USE_ACL=$use_acl
27099
27100
27101
27102
27103  if test $ac_cv_func_alloca_works = no; then
27104    :
27105  fi
27106
27107  # Define an additional variable used in the Makefile substitution.
27108  if test $ac_cv_working_alloca_h = yes; then
27109    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
27110$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
27111if ${gl_cv_rpl_alloca+:} false; then :
27112  $as_echo_n "(cached) " >&6
27113else
27114
27115      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27116/* end confdefs.h.  */
27117
27118#if defined __GNUC__ || defined _AIX || defined _MSC_VER
27119        Need own alloca
27120#endif
27121
27122_ACEOF
27123if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
27124  $EGREP "Need own alloca" >/dev/null 2>&1; then :
27125  gl_cv_rpl_alloca=yes
27126else
27127  gl_cv_rpl_alloca=no
27128fi
27129rm -f conftest*
27130
27131
27132fi
27133{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
27134$as_echo "$gl_cv_rpl_alloca" >&6; }
27135    if test $gl_cv_rpl_alloca = yes; then
27136
27137$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
27138
27139      ALLOCA_H=alloca.h
27140    else
27141                  ALLOCA_H=
27142    fi
27143  else
27144    ALLOCA_H=alloca.h
27145  fi
27146
27147   if test -n "$ALLOCA_H"; then
27148  GL_GENERATE_ALLOCA_H_TRUE=
27149  GL_GENERATE_ALLOCA_H_FALSE='#'
27150else
27151  GL_GENERATE_ALLOCA_H_TRUE='#'
27152  GL_GENERATE_ALLOCA_H_FALSE=
27153fi
27154
27155
27156
27157
27158cat >>confdefs.h <<_ACEOF
27159#define GNULIB_AREADLINKAT 1
27160_ACEOF
27161
27162
27163
27164
27165
27166
27167  if test $ac_cv_header_arpa_inet_h = yes; then
27168    HAVE_ARPA_INET_H=1
27169  else
27170    HAVE_ARPA_INET_H=0
27171  fi
27172
27173
27174
27175
27176
27177
27178
27179
27180
27181
27182     if test $gl_cv_have_include_next = yes; then
27183       gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
27184     else
27185       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
27186$as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; }
27187if ${gl_cv_next_arpa_inet_h+:} false; then :
27188  $as_echo_n "(cached) " >&6
27189else
27190
27191             if test $ac_cv_header_arpa_inet_h = yes; then
27192
27193
27194
27195
27196  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27197/* end confdefs.h.  */
27198#include <arpa/inet.h>
27199_ACEOF
27200                case "$host_os" in
27201    aix*) gl_absname_cpp="$ac_cpp -C" ;;
27202    *)    gl_absname_cpp="$ac_cpp" ;;
27203  esac
27204
27205  case "$host_os" in
27206    mingw*)
27207                                          gl_dirsep_regex='[/\\]'
27208      ;;
27209    *)
27210      gl_dirsep_regex='\/'
27211      ;;
27212  esac
27213      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
27214  gl_header_literal_regex=`echo 'arpa/inet.h' \
27215                           | sed -e "$gl_make_literal_regex_sed"`
27216  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
27217      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
27218      s|^/[^/]|//&|
27219      p
27220      q
27221    }'
27222
27223        gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
27224  sed -n "$gl_absolute_header_sed"`
27225
27226           gl_header=$gl_cv_absolute_arpa_inet_h
27227           gl_cv_next_arpa_inet_h='"'$gl_header'"'
27228          else
27229               gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
27230             fi
27231
27232
27233fi
27234{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
27235$as_echo "$gl_cv_next_arpa_inet_h" >&6; }
27236     fi
27237     NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
27238
27239     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
27240       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
27241       gl_next_as_first_directive='<'arpa/inet.h'>'
27242     else
27243       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
27244       gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
27245     fi
27246     NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
27247
27248
27249
27250
27251
27252
27253
27254
27255
27256
27257
27258  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5
27259$as_echo_n "checking whether to enable assertions... " >&6; }
27260  # Check whether --enable-assert was given.
27261if test "${enable_assert+set}" = set; then :
27262  enableval=$enable_assert; if test "x$enableval" = xno; then :
27263
27264$as_echo "#define NDEBUG 1" >>confdefs.h
27265
27266elif test "x$enableval" != xyes; then :
27267  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-assert" >&5
27268$as_echo "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;}
27269      enable_assert=yes
27270fi
27271else
27272  enable_assert=yes
27273fi
27274
27275  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5
27276$as_echo "$enable_assert" >&6; }
27277
27278
27279
27280
27281
27282
27283
27284
27285
27286  gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext"
27287
27288
27289
27290
27291
27292
27293
27294
27295
27296
27297
27298
27299
27300
27301
27302
27303
27304
27305
27306
27307
27308
27309
27310
27311
27312
27313
27314  if test $ac_cv_func_btowc = no; then
27315    HAVE_BTOWC=0
27316  else
27317
27318
27319
27320
27321        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5
27322$as_echo_n "checking whether btowc(0) is correct... " >&6; }
27323if ${gl_cv_func_btowc_nul+:} false; then :
27324  $as_echo_n "(cached) " >&6
27325else
27326
27327        if test "$cross_compiling" = yes; then :
27328
27329           case "$host_os" in
27330                      # Guess no on Cygwin.
27331             cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
27332                      # Guess yes on native Windows.
27333             mingw*)  gl_cv_func_btowc_nul="guessing yes" ;;
27334                      # Guess yes otherwise.
27335             *)       gl_cv_func_btowc_nul="guessing yes" ;;
27336           esac
27337
27338else
27339  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27340/* end confdefs.h.  */
27341
27342#include <string.h>
27343/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
27344   <wchar.h>.
27345   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
27346   included before <wchar.h>.  */
27347#include <stddef.h>
27348#include <stdio.h>
27349#include <time.h>
27350#include <wchar.h>
27351int main ()
27352{
27353  if (btowc ('\0') != 0)
27354    return 1;
27355  return 0;
27356}
27357_ACEOF
27358if ac_fn_c_try_run "$LINENO"; then :
27359  gl_cv_func_btowc_nul=yes
27360else
27361  gl_cv_func_btowc_nul=no
27362fi
27363rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27364  conftest.$ac_objext conftest.beam conftest.$ac_ext
27365fi
27366
27367
27368fi
27369{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5
27370$as_echo "$gl_cv_func_btowc_nul" >&6; }
27371
27372        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5
27373$as_echo_n "checking whether btowc(EOF) is correct... " >&6; }
27374if ${gl_cv_func_btowc_eof+:} false; then :
27375  $as_echo_n "(cached) " >&6
27376else
27377
27378                        case "$host_os" in
27379                  # Guess no on IRIX.
27380          irix*)  gl_cv_func_btowc_eof="guessing no" ;;
27381                  # Guess yes on native Windows.
27382          mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
27383                  # Guess yes otherwise.
27384          *)      gl_cv_func_btowc_eof="guessing yes" ;;
27385        esac
27386        if test $LOCALE_FR != none; then
27387          if test "$cross_compiling" = yes; then :
27388  :
27389else
27390  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27391/* end confdefs.h.  */
27392
27393#include <locale.h>
27394#include <string.h>
27395/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
27396   <wchar.h>.
27397   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
27398   included before <wchar.h>.  */
27399#include <stddef.h>
27400#include <stdio.h>
27401#include <time.h>
27402#include <wchar.h>
27403int main ()
27404{
27405  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
27406    {
27407      if (btowc (EOF) != WEOF)
27408        return 1;
27409    }
27410  return 0;
27411}
27412_ACEOF
27413if ac_fn_c_try_run "$LINENO"; then :
27414  gl_cv_func_btowc_eof=yes
27415else
27416  gl_cv_func_btowc_eof=no
27417fi
27418rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27419  conftest.$ac_objext conftest.beam conftest.$ac_ext
27420fi
27421
27422        fi
27423
27424fi
27425{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5
27426$as_echo "$gl_cv_func_btowc_eof" >&6; }
27427
27428    case "$gl_cv_func_btowc_nul" in
27429      *yes) ;;
27430      *) REPLACE_BTOWC=1 ;;
27431    esac
27432    case "$gl_cv_func_btowc_eof" in
27433      *yes) ;;
27434      *) REPLACE_BTOWC=1 ;;
27435    esac
27436  fi
27437
27438  if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
27439
27440
27441
27442
27443
27444
27445
27446
27447  gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext"
27448
27449
27450  :
27451
27452  fi
27453
27454
27455
27456
27457
27458          GNULIB_BTOWC=1
27459
27460
27461
27462
27463
27464$as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
27465
27466
27467
27468
27469  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
27470$as_echo_n "checking for __builtin_expect... " >&6; }
27471if ${gl_cv___builtin_expect+:} false; then :
27472  $as_echo_n "(cached) " >&6
27473else
27474  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27475/* end confdefs.h.  */
27476
27477         int
27478         main (int argc, char **argv)
27479         {
27480           argc = __builtin_expect (argc, 100);
27481           return argv[argc != 100][0];
27482         }
27483_ACEOF
27484if ac_fn_c_try_link "$LINENO"; then :
27485  gl_cv___builtin_expect=yes
27486else
27487  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27488/* end confdefs.h.  */
27489
27490             #include <builtins.h>
27491             int
27492             main (int argc, char **argv)
27493             {
27494               argc = __builtin_expect (argc, 100);
27495               return argv[argc != 100][0];
27496             }
27497_ACEOF
27498if ac_fn_c_try_link "$LINENO"; then :
27499  gl_cv___builtin_expect="in <builtins.h>"
27500else
27501  gl_cv___builtin_expect=no
27502fi
27503rm -f core conftest.err conftest.$ac_objext \
27504    conftest$ac_exeext conftest.$ac_ext
27505fi
27506rm -f core conftest.err conftest.$ac_objext \
27507    conftest$ac_exeext conftest.$ac_ext
27508fi
27509{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
27510$as_echo "$gl_cv___builtin_expect" >&6; }
27511  if test "$gl_cv___builtin_expect" = yes; then
27512    $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
27513
27514  elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
27515    $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
27516
27517  fi
27518
27519
27520
27521    for ac_header in byteswap.h
27522do :
27523  ac_fn_c_check_header_mongrel "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default"
27524if test "x$ac_cv_header_byteswap_h" = xyes; then :
27525  cat >>confdefs.h <<_ACEOF
27526#define HAVE_BYTESWAP_H 1
27527_ACEOF
27528
27529    BYTESWAP_H=''
27530
27531else
27532
27533    BYTESWAP_H='byteswap.h'
27534
27535fi
27536
27537done
27538
27539
27540   if test -n "$BYTESWAP_H"; then
27541  GL_GENERATE_BYTESWAP_H_TRUE=
27542  GL_GENERATE_BYTESWAP_H_FALSE='#'
27543else
27544  GL_GENERATE_BYTESWAP_H_TRUE='#'
27545  GL_GENERATE_BYTESWAP_H_FALSE=
27546fi
27547
27548
27549
27550
27551
27552
27553      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strtod_l" >&5
27554$as_echo_n "checking for strtod_l... " >&6; }
27555if ${gl_cv_func_strtod_l+:} false; then :
27556  $as_echo_n "(cached) " >&6
27557else
27558  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27559/* end confdefs.h.  */
27560#include <stdlib.h>
27561            #include <locale.h>
27562            #if HAVE_XLOCALE_H
27563            # include <xlocale.h>
27564            #endif
27565            locale_t loc;
27566
27567int
27568main ()
27569{
27570char *end;
27571            return strtod_l("0",&end,loc) < 0.0;
27572
27573  ;
27574  return 0;
27575}
27576
27577_ACEOF
27578if ac_fn_c_try_link "$LINENO"; then :
27579  gl_cv_func_strtod_l=yes
27580else
27581  gl_cv_func_strtod_l=no
27582fi
27583rm -f core conftest.err conftest.$ac_objext \
27584    conftest$ac_exeext conftest.$ac_ext
27585
27586fi
27587{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtod_l" >&5
27588$as_echo "$gl_cv_func_strtod_l" >&6; }
27589  if test $gl_cv_func_strtod_l = yes; then
27590    HAVE_STRTOD_L=1
27591  else
27592    HAVE_STRTOD_L=0
27593  fi
27594
27595cat >>confdefs.h <<_ACEOF
27596#define HAVE_STRTOD_L $HAVE_STRTOD_L
27597_ACEOF
27598
27599
27600
27601
27602
27603  for ac_func in strtold_l
27604do :
27605  ac_fn_c_check_func "$LINENO" "strtold_l" "ac_cv_func_strtold_l"
27606if test "x$ac_cv_func_strtold_l" = xyes; then :
27607  cat >>confdefs.h <<_ACEOF
27608#define HAVE_STRTOLD_L 1
27609_ACEOF
27610
27611fi
27612done
27613
27614
27615
27616
27617
27618       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible calloc" >&5
27619$as_echo_n "checking for GNU libc compatible calloc... " >&6; }
27620if ${ac_cv_func_calloc_0_nonnull+:} false; then :
27621  $as_echo_n "(cached) " >&6
27622else
27623  if test "$cross_compiling" = yes; then :
27624  case "$host_os" in
27625                         # Guess yes on glibc systems.
27626          *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
27627                         # Guess yes on native Windows.
27628          mingw*)        ac_cv_func_calloc_0_nonnull="guessing yes" ;;
27629                         # If we don't know, assume the worst.
27630          *)             ac_cv_func_calloc_0_nonnull="guessing no" ;;
27631        esac
27632
27633else
27634  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27635/* end confdefs.h.  */
27636$ac_includes_default
27637int
27638main ()
27639{
27640int result = 0;
27641            char *p = calloc (0, 0);
27642            if (!p)
27643              result |= 1;
27644            free (p);
27645            p = calloc ((size_t) -1 / 8 + 1, 8);
27646            if (p)
27647              result |= 2;
27648            free (p);
27649            return result;
27650
27651  ;
27652  return 0;
27653}
27654_ACEOF
27655if ac_fn_c_try_run "$LINENO"; then :
27656  ac_cv_func_calloc_0_nonnull=yes
27657else
27658  ac_cv_func_calloc_0_nonnull=no
27659fi
27660rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
27661  conftest.$ac_objext conftest.beam conftest.$ac_ext
27662fi
27663
27664fi
27665{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_calloc_0_nonnull" >&5
27666$as_echo "$ac_cv_func_calloc_0_nonnull" >&6; }
27667  case "$ac_cv_func_calloc_0_nonnull" in
27668    *yes)
27669
27670$as_echo "#define HAVE_CALLOC_GNU 1" >>confdefs.h
27671
27672      ;;
27673    *)
27674      $as_echo "#define HAVE_CALLOC_GNU 0" >>confdefs.h
27675
27676     REPLACE_CALLOC=1
27677
27678      ;;
27679  esac
27680
27681
27682  if test $REPLACE_CALLOC = 1; then
27683
27684
27685
27686
27687
27688
27689
27690
27691  gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext"
27692
27693  fi
27694
27695
27696cat >>confdefs.h <<_ACEOF
27697#define GNULIB_CALLOC_GNU 1
27698_ACEOF
27699
27700
27701
27702
27703
27704  if test $gl_cv_func_malloc_posix = yes; then
27705
27706$as_echo "#define HAVE_CALLOC_POSIX 1" >>confdefs.h
27707
27708  else
27709    REPLACE_CALLOC=1
27710  fi
27711
27712  if test $REPLACE_CALLOC = 1; then
27713
27714
27715
27716
27717
27718
27719
27720
27721  gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext"
27722
27723  fi
27724
27725
27726
27727
27728
27729          GNULIB_CALLOC_POSIX=1
27730
27731
27732
27733
27734
27735$as_echo "#define GNULIB_TEST_CALLOC_POSIX 1" >>confdefs.h
27736
27737
27738
27739
27740  :
27741
27742
27743
27744
27745
27746
27747  if test $ac_cv_func_canonicalize_file_name = no; then
27748    HAVE_CANONICALIZE_FILE_NAME=0
27749  else
27750    case "$gl_cv_func_realpath_works" in
27751      *yes) ;;
27752      *)    REPLACE_CANONICALIZE_FILE_NAME=1 ;;
27753    esac
27754  fi
27755
27756
27757
27758cat >>confdefs.h <<_ACEOF
27759#define GNULIB_CANONICALIZE 1
27760_ACEOF
27761
27762
27763
27764
27765$as_echo "#define GNULIB_TEST_CANONICALIZE 1" >>confdefs.h
27766
27767
27768
27769
27770
27771
27772
27773          GNULIB_CANONICALIZE_FILE_NAME=1
27774
27775
27776
27777
27778
27779$as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
27780
27781
27782
27783
27784
27785
27786
27787
27788
27789          GNULIB_CHDIR=1
27790
27791
27792
27793
27794
27795$as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
27796
27797
27798
27799
27800
27801  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system has an arbitrary file name length limit" >&5
27802$as_echo_n "checking whether this system has an arbitrary file name length limit... " >&6; }
27803if ${gl_cv_have_arbitrary_file_name_length_limit+:} false; then :
27804  $as_echo_n "(cached) " >&6
27805else
27806  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27807/* end confdefs.h.  */
27808
27809/* Arrange to define PATH_MAX, like "pathmax.h" does. */
27810#if HAVE_UNISTD_H
27811# include <unistd.h>
27812#endif
27813#include <limits.h>
27814#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
27815# include <sys/param.h>
27816#endif
27817#if !defined PATH_MAX && defined MAXPATHLEN
27818# define PATH_MAX MAXPATHLEN
27819#endif
27820#ifdef __hpux
27821# undef PATH_MAX
27822# define PATH_MAX 1024
27823#endif
27824#if defined _WIN32 && ! defined __CYGWIN__
27825# undef PATH_MAX
27826# define PATH_MAX 260
27827#endif
27828
27829#ifdef PATH_MAX
27830have_arbitrary_file_name_length_limit
27831#endif
27832_ACEOF
27833if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
27834  $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then :
27835  gl_cv_have_arbitrary_file_name_length_limit=yes
27836else
27837  gl_cv_have_arbitrary_file_name_length_limit=no
27838fi
27839rm -f conftest*
27840
27841fi
27842{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5
27843$as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; }
27844
27845  if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then
27846
27847
27848
27849
27850
27851
27852
27853
27854  gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext"
27855
27856    :
27857  fi
27858
27859  if test $HAVE_CHOWN = 0 || test $REPLACE_CHOWN = 1; then
27860
27861
27862
27863
27864
27865
27866
27867
27868  gl_LIBOBJS="$gl_LIBOBJS chown.$ac_objext"
27869
27870  fi
27871  if test $REPLACE_CHOWN = 1 && test $ac_cv_func_fchown = no; then
27872
27873
27874
27875
27876
27877
27878
27879
27880  gl_LIBOBJS="$gl_LIBOBJS fchown-stub.$ac_objext"
27881
27882  fi
27883
27884
27885
27886
27887
27888          GNULIB_CHOWN=1
27889
27890
27891
27892
27893
27894$as_echo "#define GNULIB_TEST_CHOWN 1" >>confdefs.h
27895
27896
27897
27898
27899
27900
27901  # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
27902  # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
27903
27904  # Save and restore LIBS so e.g., -lrt, isn't added to it.  Otherwise, *all*
27905  # programs in the package would end up linked with that potentially-shared
27906  # library, inducing unnecessary run-time overhead.
27907  LIB_CLOCK_GETTIME=
27908
27909  gl_saved_libs=$LIBS
27910    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
27911$as_echo_n "checking for library containing clock_gettime... " >&6; }
27912if ${ac_cv_search_clock_gettime+:} false; then :
27913  $as_echo_n "(cached) " >&6
27914else
27915  ac_func_search_save_LIBS=$LIBS
27916cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27917/* end confdefs.h.  */
27918
27919/* Override any GCC internal prototype to avoid an error.
27920   Use char because int might match the return type of a GCC
27921   builtin and then its argument prototype would still apply.  */
27922#ifdef __cplusplus
27923extern "C"
27924#endif
27925char clock_gettime ();
27926int
27927main ()
27928{
27929return clock_gettime ();
27930  ;
27931  return 0;
27932}
27933_ACEOF
27934for ac_lib in '' rt posix4; do
27935  if test -z "$ac_lib"; then
27936    ac_res="none required"
27937  else
27938    ac_res=-l$ac_lib
27939    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
27940  fi
27941  if ac_fn_c_try_link "$LINENO"; then :
27942  ac_cv_search_clock_gettime=$ac_res
27943fi
27944rm -f core conftest.err conftest.$ac_objext \
27945    conftest$ac_exeext
27946  if ${ac_cv_search_clock_gettime+:} false; then :
27947  break
27948fi
27949done
27950if ${ac_cv_search_clock_gettime+:} false; then :
27951
27952else
27953  ac_cv_search_clock_gettime=no
27954fi
27955rm conftest.$ac_ext
27956LIBS=$ac_func_search_save_LIBS
27957fi
27958{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
27959$as_echo "$ac_cv_search_clock_gettime" >&6; }
27960ac_res=$ac_cv_search_clock_gettime
27961if test "$ac_res" != no; then :
27962  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
27963  test "$ac_cv_search_clock_gettime" = "none required" ||
27964                    LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
27965fi
27966
27967    for ac_func in clock_gettime clock_settime
27968do :
27969  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
27970ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
27971if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
27972  cat >>confdefs.h <<_ACEOF
27973#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
27974_ACEOF
27975
27976fi
27977done
27978
27979  LIBS=$gl_saved_libs
27980
27981
27982
27983$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
27984
27985
27986
27987
27988
27989
27990    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
27991      REPLACE_CLOSE=1
27992    fi
27993
27994
27995
27996
27997
27998
27999  if test $ac_cv_header_sys_socket_h != yes; then
28000                    for ac_header in winsock2.h
28001do :
28002  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
28003if test "x$ac_cv_header_winsock2_h" = xyes; then :
28004  cat >>confdefs.h <<_ACEOF
28005#define HAVE_WINSOCK2_H 1
28006_ACEOF
28007
28008fi
28009
28010done
28011
28012  fi
28013  if test "$ac_cv_header_winsock2_h" = yes; then
28014    HAVE_WINSOCK2_H=1
28015    UNISTD_H_HAVE_WINSOCK2_H=1
28016    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
28017  else
28018    HAVE_WINSOCK2_H=0
28019  fi
28020
28021
28022    if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
28023                        REPLACE_CLOSE=1
28024    fi
28025
28026
28027    if test $REPLACE_CLOSE = 0; then
28028
28029
28030
28031  if test $ac_cv_func_fchdir = no; then
28032    HAVE_FCHDIR=0
28033  fi
28034
28035      if test $HAVE_FCHDIR = 0; then
28036        REPLACE_CLOSE=1
28037      fi
28038    fi
28039
28040
28041  if test $REPLACE_CLOSE = 1; then
28042
28043
28044
28045
28046
28047
28048
28049
28050  gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
28051
28052  fi
28053
28054
28055
28056
28057
28058          GNULIB_CLOSE=1
28059
28060
28061
28062
28063
28064$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
28065
28066
28067
28068
28069  :
28070
28071
28072
28073cat >>confdefs.h <<_ACEOF
28074#define GNULIB_CLOSE_STREAM 1
28075_ACEOF
28076
28077
28078
28079
28080
28081  for ac_func in closedir
28082do :
28083  ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
28084if test "x$ac_cv_func_closedir" = xyes; then :
28085  cat >>confdefs.h <<_ACEOF
28086#define HAVE_CLOSEDIR 1
28087_ACEOF
28088
28089fi
28090done
28091
28092  if test $ac_cv_func_closedir = no; then
28093    HAVE_CLOSEDIR=0
28094  fi
28095
28096
28097
28098
28099  if test $ac_cv_func_fchdir = no; then
28100    HAVE_FCHDIR=0
28101  fi
28102
28103    if test $HAVE_FCHDIR = 0; then
28104      if test $HAVE_CLOSEDIR = 1; then
28105        REPLACE_CLOSEDIR=1
28106      fi
28107    fi
28108
28109    case $host_os,$HAVE_CLOSEDIR in
28110    os2*,1)
28111      REPLACE_CLOSEDIR=1;;
28112  esac
28113
28114  if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
28115
28116
28117
28118
28119
28120
28121
28122
28123  gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext"
28124
28125  fi
28126
28127
28128
28129
28130
28131          GNULIB_CLOSEDIR=1
28132
28133
28134
28135
28136
28137$as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
28138
28139
28140
28141
28142  :
28143
28144
28145  :
28146
28147
28148
28149          if test "x$datarootdir" = x; then
28150    datarootdir='${datadir}'
28151
28152  fi
28153    if test "x$docdir" = x; then
28154    docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
28155
28156  fi
28157    if test "x$htmldir" = x; then
28158    htmldir='${docdir}'
28159
28160  fi
28161  if test "x$dvidir" = x; then
28162    dvidir='${docdir}'
28163
28164  fi
28165  if test "x$pdfdir" = x; then
28166    pdfdir='${docdir}'
28167
28168  fi
28169  if test "x$psdir" = x; then
28170    psdir='${docdir}'
28171
28172  fi
28173  if test "x$lispdir" = x; then
28174    lispdir='${datarootdir}/emacs/site-lisp'
28175
28176  fi
28177  if test "x$localedir" = x; then
28178    localedir='${datarootdir}/locale'
28179
28180  fi
28181    if test "x$runstatedir" = x; then
28182    runstatedir='${localstatedir}/run'
28183
28184  fi
28185
28186      pkglibexecdir='${libexecdir}/${PACKAGE}'
28187
28188
28189
28190
28191$as_echo "#define GL_COMPILE_CRYPTO_STREAM 1" >>confdefs.h
28192
28193
28194
28195
28196
28197
28198
28199
28200
28201
28202# Check whether --with-openssl was given.
28203if test "${with_openssl+set}" = set; then :
28204  withval=$with_openssl;
28205else
28206  with_openssl=$with_openssl_default
28207fi
28208
28209
28210  if test "xMD5" = xMD5; then
28211    ALG_header=md5.h
28212  else
28213    ALG_header=sha.h
28214  fi
28215
28216
28217  if test "x$with_openssl" != xno; then
28218    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lcrypto" >&5
28219$as_echo_n "checking for MD5 in -lcrypto... " >&6; }
28220if ${ac_cv_lib_crypto_MD5+:} false; then :
28221  $as_echo_n "(cached) " >&6
28222else
28223  ac_check_lib_save_LIBS=$LIBS
28224LIBS="-lcrypto  $LIBS"
28225cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28226/* end confdefs.h.  */
28227
28228/* Override any GCC internal prototype to avoid an error.
28229   Use char because int might match the return type of a GCC
28230   builtin and then its argument prototype would still apply.  */
28231#ifdef __cplusplus
28232extern "C"
28233#endif
28234char MD5 ();
28235int
28236main ()
28237{
28238return MD5 ();
28239  ;
28240  return 0;
28241}
28242_ACEOF
28243if ac_fn_c_try_link "$LINENO"; then :
28244  ac_cv_lib_crypto_MD5=yes
28245else
28246  ac_cv_lib_crypto_MD5=no
28247fi
28248rm -f core conftest.err conftest.$ac_objext \
28249    conftest$ac_exeext conftest.$ac_ext
28250LIBS=$ac_check_lib_save_LIBS
28251fi
28252{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5
28253$as_echo "$ac_cv_lib_crypto_MD5" >&6; }
28254if test "x$ac_cv_lib_crypto_MD5" = xyes; then :
28255  for ac_header in openssl/$ALG_header
28256do :
28257  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
28258ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
28259if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
28260  cat >>confdefs.h <<_ACEOF
28261#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
28262_ACEOF
28263 LIB_CRYPTO=-lcrypto
28264
28265$as_echo "#define HAVE_OPENSSL_MD5 1" >>confdefs.h
28266
28267fi
28268
28269done
28270
28271fi
28272
28273    if test "x$LIB_CRYPTO" = x; then
28274      if test "x$with_openssl" = xyes; then
28275        as_fn_error $? "openssl development library not found for MD5" "$LINENO" 5
28276      elif test "x$with_openssl" = xoptional; then
28277        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: openssl development library not found for MD5" >&5
28278$as_echo "$as_me: WARNING: openssl development library not found for MD5" >&2;}
28279      fi
28280    fi
28281  fi
28282
28283
28284
28285$as_echo "#define GL_COMPILE_CRYPTO_STREAM 1" >>confdefs.h
28286
28287
28288
28289
28290
28291
28292
28293
28294
28295
28296# Check whether --with-openssl was given.
28297if test "${with_openssl+set}" = set; then :
28298  withval=$with_openssl;
28299else
28300  with_openssl=$with_openssl_default
28301fi
28302
28303
28304  if test "xSHA1" = xMD5; then
28305    ALG_header=md5.h
28306  else
28307    ALG_header=sha.h
28308  fi
28309
28310
28311  if test "x$with_openssl" != xno; then
28312    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA1 in -lcrypto" >&5
28313$as_echo_n "checking for SHA1 in -lcrypto... " >&6; }
28314if ${ac_cv_lib_crypto_SHA1+:} false; then :
28315  $as_echo_n "(cached) " >&6
28316else
28317  ac_check_lib_save_LIBS=$LIBS
28318LIBS="-lcrypto  $LIBS"
28319cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28320/* end confdefs.h.  */
28321
28322/* Override any GCC internal prototype to avoid an error.
28323   Use char because int might match the return type of a GCC
28324   builtin and then its argument prototype would still apply.  */
28325#ifdef __cplusplus
28326extern "C"
28327#endif
28328char SHA1 ();
28329int
28330main ()
28331{
28332return SHA1 ();
28333  ;
28334  return 0;
28335}
28336_ACEOF
28337if ac_fn_c_try_link "$LINENO"; then :
28338  ac_cv_lib_crypto_SHA1=yes
28339else
28340  ac_cv_lib_crypto_SHA1=no
28341fi
28342rm -f core conftest.err conftest.$ac_objext \
28343    conftest$ac_exeext conftest.$ac_ext
28344LIBS=$ac_check_lib_save_LIBS
28345fi
28346{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1" >&5
28347$as_echo "$ac_cv_lib_crypto_SHA1" >&6; }
28348if test "x$ac_cv_lib_crypto_SHA1" = xyes; then :
28349  for ac_header in openssl/$ALG_header
28350do :
28351  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
28352ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
28353if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
28354  cat >>confdefs.h <<_ACEOF
28355#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
28356_ACEOF
28357 LIB_CRYPTO=-lcrypto
28358
28359$as_echo "#define HAVE_OPENSSL_SHA1 1" >>confdefs.h
28360
28361fi
28362
28363done
28364
28365fi
28366
28367    if test "x$LIB_CRYPTO" = x; then
28368      if test "x$with_openssl" = xyes; then
28369        as_fn_error $? "openssl development library not found for SHA1" "$LINENO" 5
28370      elif test "x$with_openssl" = xoptional; then
28371        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: openssl development library not found for SHA1" >&5
28372$as_echo "$as_me: WARNING: openssl development library not found for SHA1" >&2;}
28373      fi
28374    fi
28375  fi
28376
28377
28378
28379$as_echo "#define GL_COMPILE_CRYPTO_STREAM 1" >>confdefs.h
28380
28381
28382
28383
28384
28385
28386
28387
28388
28389
28390# Check whether --with-openssl was given.
28391if test "${with_openssl+set}" = set; then :
28392  withval=$with_openssl;
28393else
28394  with_openssl=$with_openssl_default
28395fi
28396
28397
28398  if test "xSHA256" = xMD5; then
28399    ALG_header=md5.h
28400  else
28401    ALG_header=sha.h
28402  fi
28403
28404
28405  if test "x$with_openssl" != xno; then
28406    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256 in -lcrypto" >&5
28407$as_echo_n "checking for SHA256 in -lcrypto... " >&6; }
28408if ${ac_cv_lib_crypto_SHA256+:} false; then :
28409  $as_echo_n "(cached) " >&6
28410else
28411  ac_check_lib_save_LIBS=$LIBS
28412LIBS="-lcrypto  $LIBS"
28413cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28414/* end confdefs.h.  */
28415
28416/* Override any GCC internal prototype to avoid an error.
28417   Use char because int might match the return type of a GCC
28418   builtin and then its argument prototype would still apply.  */
28419#ifdef __cplusplus
28420extern "C"
28421#endif
28422char SHA256 ();
28423int
28424main ()
28425{
28426return SHA256 ();
28427  ;
28428  return 0;
28429}
28430_ACEOF
28431if ac_fn_c_try_link "$LINENO"; then :
28432  ac_cv_lib_crypto_SHA256=yes
28433else
28434  ac_cv_lib_crypto_SHA256=no
28435fi
28436rm -f core conftest.err conftest.$ac_objext \
28437    conftest$ac_exeext conftest.$ac_ext
28438LIBS=$ac_check_lib_save_LIBS
28439fi
28440{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256" >&5
28441$as_echo "$ac_cv_lib_crypto_SHA256" >&6; }
28442if test "x$ac_cv_lib_crypto_SHA256" = xyes; then :
28443  for ac_header in openssl/$ALG_header
28444do :
28445  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
28446ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
28447if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
28448  cat >>confdefs.h <<_ACEOF
28449#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
28450_ACEOF
28451 LIB_CRYPTO=-lcrypto
28452
28453$as_echo "#define HAVE_OPENSSL_SHA256 1" >>confdefs.h
28454
28455fi
28456
28457done
28458
28459fi
28460
28461    if test "x$LIB_CRYPTO" = x; then
28462      if test "x$with_openssl" = xyes; then
28463        as_fn_error $? "openssl development library not found for SHA256" "$LINENO" 5
28464      elif test "x$with_openssl" = xoptional; then
28465        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: openssl development library not found for SHA256" >&5
28466$as_echo "$as_me: WARNING: openssl development library not found for SHA256" >&2;}
28467      fi
28468    fi
28469  fi
28470
28471
28472
28473$as_echo "#define GL_COMPILE_CRYPTO_STREAM 1" >>confdefs.h
28474
28475
28476
28477
28478
28479
28480
28481
28482
28483
28484# Check whether --with-openssl was given.
28485if test "${with_openssl+set}" = set; then :
28486  withval=$with_openssl;
28487else
28488  with_openssl=$with_openssl_default
28489fi
28490
28491
28492  if test "xSHA512" = xMD5; then
28493    ALG_header=md5.h
28494  else
28495    ALG_header=sha.h
28496  fi
28497
28498
28499  if test "x$with_openssl" != xno; then
28500    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512 in -lcrypto" >&5
28501$as_echo_n "checking for SHA512 in -lcrypto... " >&6; }
28502if ${ac_cv_lib_crypto_SHA512+:} false; then :
28503  $as_echo_n "(cached) " >&6
28504else
28505  ac_check_lib_save_LIBS=$LIBS
28506LIBS="-lcrypto  $LIBS"
28507cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28508/* end confdefs.h.  */
28509
28510/* Override any GCC internal prototype to avoid an error.
28511   Use char because int might match the return type of a GCC
28512   builtin and then its argument prototype would still apply.  */
28513#ifdef __cplusplus
28514extern "C"
28515#endif
28516char SHA512 ();
28517int
28518main ()
28519{
28520return SHA512 ();
28521  ;
28522  return 0;
28523}
28524_ACEOF
28525if ac_fn_c_try_link "$LINENO"; then :
28526  ac_cv_lib_crypto_SHA512=yes
28527else
28528  ac_cv_lib_crypto_SHA512=no
28529fi
28530rm -f core conftest.err conftest.$ac_objext \
28531    conftest$ac_exeext conftest.$ac_ext
28532LIBS=$ac_check_lib_save_LIBS
28533fi
28534{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512" >&5
28535$as_echo "$ac_cv_lib_crypto_SHA512" >&6; }
28536if test "x$ac_cv_lib_crypto_SHA512" = xyes; then :
28537  for ac_header in openssl/$ALG_header
28538do :
28539  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
28540ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
28541if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
28542  cat >>confdefs.h <<_ACEOF
28543#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
28544_ACEOF
28545 LIB_CRYPTO=-lcrypto
28546
28547$as_echo "#define HAVE_OPENSSL_SHA512 1" >>confdefs.h
28548
28549fi
28550
28551done
28552
28553fi
28554
28555    if test "x$LIB_CRYPTO" = x; then
28556      if test "x$with_openssl" = xyes; then
28557        as_fn_error $? "openssl development library not found for SHA512" "$LINENO" 5
28558      elif test "x$with_openssl" = xoptional; then
28559        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: openssl development library not found for SHA512" >&5
28560$as_echo "$as_me: WARNING: openssl development library not found for SHA512" >&2;}
28561      fi
28562    fi
28563  fi
28564
28565
28566
28567
28568
28569
28570
28571
28572
28573
28574
28575
28576
28577     if test $gl_cv_have_include_next = yes; then
28578       gl_cv_next_ctype_h='<'ctype.h'>'
28579     else
28580       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5
28581$as_echo_n "checking absolute name of <ctype.h>... " >&6; }
28582if ${gl_cv_next_ctype_h+:} false; then :
28583  $as_echo_n "(cached) " >&6
28584else
28585
28586
28587
28588  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28589/* end confdefs.h.  */
28590#include <ctype.h>
28591_ACEOF
28592                case "$host_os" in
28593    aix*) gl_absname_cpp="$ac_cpp -C" ;;
28594    *)    gl_absname_cpp="$ac_cpp" ;;
28595  esac
28596
28597  case "$host_os" in
28598    mingw*)
28599                                          gl_dirsep_regex='[/\\]'
28600      ;;
28601    *)
28602      gl_dirsep_regex='\/'
28603      ;;
28604  esac
28605      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28606  gl_header_literal_regex=`echo 'ctype.h' \
28607                           | sed -e "$gl_make_literal_regex_sed"`
28608  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28609      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28610      s|^/[^/]|//&|
28611      p
28612      q
28613    }'
28614
28615        gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28616  sed -n "$gl_absolute_header_sed"`
28617
28618           gl_header=$gl_cv_absolute_ctype_h
28619           gl_cv_next_ctype_h='"'$gl_header'"'
28620
28621
28622fi
28623{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5
28624$as_echo "$gl_cv_next_ctype_h" >&6; }
28625     fi
28626     NEXT_CTYPE_H=$gl_cv_next_ctype_h
28627
28628     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28629       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28630       gl_next_as_first_directive='<'ctype.h'>'
28631     else
28632       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28633       gl_next_as_first_directive=$gl_cv_next_ctype_h
28634     fi
28635     NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive
28636
28637
28638
28639
28640
28641
28642
28643  :
28644      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
28645$as_echo_n "checking for d_ino member in directory struct... " >&6; }
28646if ${gl_cv_struct_dirent_d_ino+:} false; then :
28647  $as_echo_n "(cached) " >&6
28648else
28649  if test "$cross_compiling" = yes; then :
28650  case "$host_os" in
28651                           # Guess yes on glibc systems with Linux kernel.
28652              linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
28653                           # Guess no on native Windows.
28654              mingw*)      gl_cv_struct_dirent_d_ino="guessing no" ;;
28655                           # If we don't know, assume the worst.
28656              *)           gl_cv_struct_dirent_d_ino="guessing no" ;;
28657            esac
28658
28659else
28660  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28661/* end confdefs.h.  */
28662#include <sys/types.h>
28663             #include <sys/stat.h>
28664             #include <dirent.h>
28665
28666int
28667main ()
28668{
28669DIR *dp = opendir (".");
28670             struct dirent *e;
28671             struct stat st;
28672             if (! dp)
28673               return 1;
28674             e = readdir (dp);
28675             if (! e)
28676               { closedir (dp); return 2; }
28677             if (lstat (e->d_name, &st) != 0)
28678               { closedir (dp); return 3; }
28679             if (e->d_ino != st.st_ino)
28680               { closedir (dp); return 4; }
28681             closedir (dp);
28682             return 0;
28683
28684  ;
28685  return 0;
28686}
28687_ACEOF
28688if ac_fn_c_try_run "$LINENO"; then :
28689  gl_cv_struct_dirent_d_ino=yes
28690else
28691  gl_cv_struct_dirent_d_ino=no
28692fi
28693rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
28694  conftest.$ac_objext conftest.beam conftest.$ac_ext
28695fi
28696
28697fi
28698{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
28699$as_echo "$gl_cv_struct_dirent_d_ino" >&6; }
28700   case "$gl_cv_struct_dirent_d_ino" in
28701     *yes)
28702
28703$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
28704
28705       ;;
28706   esac
28707
28708
28709  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5
28710$as_echo_n "checking for d_type member in directory struct... " >&6; }
28711if ${gl_cv_struct_dirent_d_type+:} false; then :
28712  $as_echo_n "(cached) " >&6
28713else
28714  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28715/* end confdefs.h.  */
28716
28717#include <sys/types.h>
28718#include <dirent.h>
28719
28720int
28721main ()
28722{
28723struct dirent dp; dp.d_type = 0;
28724  ;
28725  return 0;
28726}
28727_ACEOF
28728if ac_fn_c_try_link "$LINENO"; then :
28729  gl_cv_struct_dirent_d_type=yes
28730else
28731  gl_cv_struct_dirent_d_type=no
28732fi
28733rm -f core conftest.err conftest.$ac_objext \
28734    conftest$ac_exeext conftest.$ac_ext
28735
28736
28737fi
28738{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5
28739$as_echo "$gl_cv_struct_dirent_d_type" >&6; }
28740   if test $gl_cv_struct_dirent_d_type = yes; then
28741
28742$as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h
28743
28744   fi
28745
28746
28747
28748
28749
28750
28751
28752
28753
28754
28755
28756
28757
28758
28759     if test $gl_cv_have_include_next = yes; then
28760       gl_cv_next_dirent_h='<'dirent.h'>'
28761     else
28762       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
28763$as_echo_n "checking absolute name of <dirent.h>... " >&6; }
28764if ${gl_cv_next_dirent_h+:} false; then :
28765  $as_echo_n "(cached) " >&6
28766else
28767
28768             if test $ac_cv_header_dirent_h = yes; then
28769
28770
28771
28772
28773  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28774/* end confdefs.h.  */
28775#include <dirent.h>
28776_ACEOF
28777                case "$host_os" in
28778    aix*) gl_absname_cpp="$ac_cpp -C" ;;
28779    *)    gl_absname_cpp="$ac_cpp" ;;
28780  esac
28781
28782  case "$host_os" in
28783    mingw*)
28784                                          gl_dirsep_regex='[/\\]'
28785      ;;
28786    *)
28787      gl_dirsep_regex='\/'
28788      ;;
28789  esac
28790      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
28791  gl_header_literal_regex=`echo 'dirent.h' \
28792                           | sed -e "$gl_make_literal_regex_sed"`
28793  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
28794      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
28795      s|^/[^/]|//&|
28796      p
28797      q
28798    }'
28799
28800        gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
28801  sed -n "$gl_absolute_header_sed"`
28802
28803           gl_header=$gl_cv_absolute_dirent_h
28804           gl_cv_next_dirent_h='"'$gl_header'"'
28805          else
28806               gl_cv_next_dirent_h='<'dirent.h'>'
28807             fi
28808
28809
28810fi
28811{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
28812$as_echo "$gl_cv_next_dirent_h" >&6; }
28813     fi
28814     NEXT_DIRENT_H=$gl_cv_next_dirent_h
28815
28816     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
28817       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
28818       gl_next_as_first_directive='<'dirent.h'>'
28819     else
28820       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
28821       gl_next_as_first_directive=$gl_cv_next_dirent_h
28822     fi
28823     NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
28824
28825
28826
28827
28828  if test $ac_cv_header_dirent_h = yes; then
28829    HAVE_DIRENT_H=1
28830  else
28831    HAVE_DIRENT_H=0
28832  fi
28833
28834
28835
28836
28837
28838
28839
28840
28841
28842cat >>confdefs.h <<_ACEOF
28843#define GNULIB_DIRENT_SAFER 1
28844_ACEOF
28845
28846
28847
28848
28849
28850
28851
28852  for ac_func in dirfd
28853do :
28854  ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
28855if test "x$ac_cv_func_dirfd" = xyes; then :
28856  cat >>confdefs.h <<_ACEOF
28857#define HAVE_DIRFD 1
28858_ACEOF
28859
28860fi
28861done
28862
28863  ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
28864      #include <dirent.h>
28865"
28866if test "x$ac_cv_have_decl_dirfd" = xyes; then :
28867  ac_have_decl=1
28868else
28869  ac_have_decl=0
28870fi
28871
28872cat >>confdefs.h <<_ACEOF
28873#define HAVE_DECL_DIRFD $ac_have_decl
28874_ACEOF
28875
28876  if test $ac_cv_have_decl_dirfd = no; then
28877    HAVE_DECL_DIRFD=0
28878  fi
28879
28880  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
28881$as_echo_n "checking whether dirfd is a macro... " >&6; }
28882if ${gl_cv_func_dirfd_macro+:} false; then :
28883  $as_echo_n "(cached) " >&6
28884else
28885  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28886/* end confdefs.h.  */
28887
28888#include <sys/types.h>
28889#include <dirent.h>
28890#ifdef dirfd
28891 dirent_header_defines_dirfd
28892#endif
28893_ACEOF
28894if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28895  $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then :
28896  gl_cv_func_dirfd_macro=yes
28897else
28898  gl_cv_func_dirfd_macro=no
28899fi
28900rm -f conftest*
28901
28902fi
28903{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
28904$as_echo "$gl_cv_func_dirfd_macro" >&6; }
28905
28906  # Use the replacement if we have no function or macro with that name,
28907  # or if OS/2 kLIBC whose dirfd() does not work.
28908  # Replace only if the system declares dirfd already.
28909  case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
28910    no,no,*,yes | *,*,os2*,yes)
28911      REPLACE_DIRFD=1
28912
28913$as_echo "#define REPLACE_DIRFD 1" >>confdefs.h
28914;;
28915  esac
28916
28917  if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
28918     || test $REPLACE_DIRFD = 1; then
28919
28920
28921
28922
28923
28924
28925
28926
28927  gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext"
28928
28929
28930  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
28931$as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; }
28932if ${gl_cv_sys_dir_fd_member_name+:} false; then :
28933  $as_echo_n "(cached) " >&6
28934else
28935
28936      dirfd_save_CFLAGS=$CFLAGS
28937      for ac_expr in d_fd dd_fd; do
28938
28939        CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
28940        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28941/* end confdefs.h.  */
28942
28943           #include <sys/types.h>
28944           #include <dirent.h>
28945int
28946main ()
28947{
28948DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;
28949  ;
28950  return 0;
28951}
28952_ACEOF
28953if ac_fn_c_try_compile "$LINENO"; then :
28954  dir_fd_found=yes
28955
28956fi
28957rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
28958        CFLAGS=$dirfd_save_CFLAGS
28959        test "$dir_fd_found" = yes && break
28960      done
28961      test "$dir_fd_found" = yes || ac_expr=no_such_member
28962
28963      gl_cv_sys_dir_fd_member_name=$ac_expr
28964
28965
28966fi
28967{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
28968$as_echo "$gl_cv_sys_dir_fd_member_name" >&6; }
28969  if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
28970
28971cat >>confdefs.h <<_ACEOF
28972#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name
28973_ACEOF
28974
28975  fi
28976
28977
28978  fi
28979
28980
28981
28982
28983
28984          GNULIB_DIRFD=1
28985
28986
28987
28988
28989
28990$as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
28991
28992
28993
28994
28995
28996
28997
28998
28999cat >>confdefs.h <<_ACEOF
29000#define GNULIB_DIRNAME 1
29001_ACEOF
29002
29003
29004
29005
29006
29007
29008
29009
29010  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
29011$as_echo_n "checking whether // is distinct from /... " >&6; }
29012if ${gl_cv_double_slash_root+:} false; then :
29013  $as_echo_n "(cached) " >&6
29014else
29015   if test x"$cross_compiling" = xyes ; then
29016        # When cross-compiling, there is no way to tell whether // is special
29017        # short of a list of hosts.  However, the only known hosts to date
29018        # that have a distinct // are Apollo DomainOS (too old to port to),
29019        # Cygwin, and z/OS.  If anyone knows of another system for which // has
29020        # special semantics and is distinct from /, please report it to
29021        # <bug-gnulib@gnu.org>.
29022        case $host in
29023          *-cygwin | i370-ibm-openedition)
29024            gl_cv_double_slash_root=yes ;;
29025          *)
29026            # Be optimistic and assume that / and // are the same when we
29027            # don't know.
29028            gl_cv_double_slash_root='unknown, assuming no' ;;
29029        esac
29030      else
29031        set x `ls -di / // 2>/dev/null`
29032        if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
29033          gl_cv_double_slash_root=no
29034        else
29035          gl_cv_double_slash_root=yes
29036        fi
29037      fi
29038fi
29039{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
29040$as_echo "$gl_cv_double_slash_root" >&6; }
29041  if test "$gl_cv_double_slash_root" = yes; then
29042
29043$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
29044
29045  fi
29046
29047
29048
29049
29050
29051
29052    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
29053      REPLACE_DUP=1
29054    fi
29055
29056
29057
29058
29059
29060  if test $ac_cv_func_fchdir = no; then
29061    HAVE_FCHDIR=0
29062  fi
29063
29064    if test $HAVE_FCHDIR = 0; then
29065      REPLACE_DUP=1
29066    fi
29067
29068  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5
29069$as_echo_n "checking whether dup works... " >&6; }
29070if ${gl_cv_func_dup_works+:} false; then :
29071  $as_echo_n "(cached) " >&6
29072else
29073  if test "$cross_compiling" = yes; then :
29074  case "$host_os" in
29075                 # Guess no on native Windows.
29076         mingw*) gl_cv_func_dup_works="guessing no" ;;
29077         *)      gl_cv_func_dup_works="guessing yes" ;;
29078       esac
29079
29080else
29081  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29082/* end confdefs.h.  */
29083#include <unistd.h>
29084                         #include <fcntl.h>
29085                         #include <errno.h>
29086int
29087main ()
29088{
29089/* On OS/2 kLIBC, dup does not work on a directory fd.  */
29090           int fd = open (".", O_RDONLY);
29091           return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
29092
29093  ;
29094  return 0;
29095}
29096
29097_ACEOF
29098if ac_fn_c_try_run "$LINENO"; then :
29099  gl_cv_func_dup_works=yes
29100else
29101  gl_cv_func_dup_works=no
29102fi
29103rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29104  conftest.$ac_objext conftest.beam conftest.$ac_ext
29105fi
29106
29107
29108fi
29109{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5
29110$as_echo "$gl_cv_func_dup_works" >&6; }
29111  case "$gl_cv_func_dup_works" in
29112    *yes) ;;
29113    *)
29114      REPLACE_DUP=1
29115      ;;
29116  esac
29117
29118  if test $REPLACE_DUP = 1; then
29119
29120
29121
29122
29123
29124
29125
29126
29127  gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext"
29128
29129    :
29130  fi
29131
29132
29133
29134
29135
29136          GNULIB_DUP=1
29137
29138
29139
29140
29141
29142$as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h
29143
29144
29145
29146
29147
29148
29149
29150
29151$as_echo "#define HAVE_DUP2 1" >>confdefs.h
29152
29153
29154  if test $HAVE_DUP2 = 1; then
29155    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
29156$as_echo_n "checking whether dup2 works... " >&6; }
29157if ${gl_cv_func_dup2_works+:} false; then :
29158  $as_echo_n "(cached) " >&6
29159else
29160  if test "$cross_compiling" = yes; then :
29161  case "$host_os" in
29162           mingw*) # on this platform, dup2 always returns 0 for success
29163             gl_cv_func_dup2_works="guessing no" ;;
29164           cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
29165             gl_cv_func_dup2_works="guessing no" ;;
29166           aix* | freebsd*)
29167                   # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
29168                   # not EBADF.
29169             gl_cv_func_dup2_works="guessing no" ;;
29170           haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
29171             gl_cv_func_dup2_works="guessing no" ;;
29172           *-android*) # implemented using dup3(), which fails if oldfd == newfd
29173             gl_cv_func_dup2_works="guessing no" ;;
29174           os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
29175             gl_cv_func_dup2_works="guessing no" ;;
29176           *) gl_cv_func_dup2_works="guessing yes" ;;
29177         esac
29178else
29179  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29180/* end confdefs.h.  */
29181
29182         #include <errno.h>
29183             #include <fcntl.h>
29184             #include <limits.h>
29185             #include <sys/resource.h>
29186             #include <unistd.h>
29187             #ifndef RLIM_SAVED_CUR
29188             # define RLIM_SAVED_CUR RLIM_INFINITY
29189             #endif
29190             #ifndef RLIM_SAVED_MAX
29191             # define RLIM_SAVED_MAX RLIM_INFINITY
29192             #endif
29193
29194int
29195main ()
29196{
29197int result = 0;
29198             int bad_fd = INT_MAX;
29199             struct rlimit rlim;
29200             if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
29201                 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
29202                 && rlim.rlim_cur != RLIM_INFINITY
29203                 && rlim.rlim_cur != RLIM_SAVED_MAX
29204                 && rlim.rlim_cur != RLIM_SAVED_CUR)
29205               bad_fd = rlim.rlim_cur;
29206             #ifdef FD_CLOEXEC
29207               if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
29208                 result |= 1;
29209             #endif
29210             if (dup2 (1, 1) != 1)
29211               result |= 2;
29212             #ifdef FD_CLOEXEC
29213               if (fcntl (1, F_GETFD) != FD_CLOEXEC)
29214                 result |= 4;
29215             #endif
29216             close (0);
29217             if (dup2 (0, 0) != -1)
29218               result |= 8;
29219             /* Many gnulib modules require POSIX conformance of EBADF.  */
29220             if (dup2 (2, bad_fd) == -1 && errno != EBADF)
29221               result |= 16;
29222             /* Flush out some cygwin core dumps.  */
29223             if (dup2 (2, -1) != -1 || errno != EBADF)
29224               result |= 32;
29225             dup2 (2, 255);
29226             dup2 (2, 256);
29227             /* On OS/2 kLIBC, dup2() does not work on a directory fd.  */
29228             {
29229               int fd = open (".", O_RDONLY);
29230               if (fd == -1)
29231                 result |= 64;
29232               else if (dup2 (fd, fd + 1) == -1)
29233                 result |= 128;
29234
29235               close (fd);
29236             }
29237             return result;
29238  ;
29239  return 0;
29240}
29241
29242_ACEOF
29243if ac_fn_c_try_run "$LINENO"; then :
29244  gl_cv_func_dup2_works=yes
29245else
29246  gl_cv_func_dup2_works=no
29247fi
29248rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29249  conftest.$ac_objext conftest.beam conftest.$ac_ext
29250fi
29251
29252
29253fi
29254{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
29255$as_echo "$gl_cv_func_dup2_works" >&6; }
29256    case "$gl_cv_func_dup2_works" in
29257      *yes) ;;
29258      *)
29259        REPLACE_DUP2=1
29260        for ac_func in setdtablesize
29261do :
29262  ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
29263if test "x$ac_cv_func_setdtablesize" = xyes; then :
29264  cat >>confdefs.h <<_ACEOF
29265#define HAVE_SETDTABLESIZE 1
29266_ACEOF
29267
29268fi
29269done
29270
29271        ;;
29272    esac
29273  fi
29274
29275
29276
29277
29278  if test $ac_cv_func_fchdir = no; then
29279    HAVE_FCHDIR=0
29280  fi
29281
29282    if test $HAVE_FCHDIR = 0; then
29283      if test $HAVE_DUP2 = 1; then
29284        REPLACE_DUP2=1
29285      fi
29286    fi
29287
29288
29289  if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
29290
29291
29292
29293
29294
29295
29296
29297
29298  gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
29299
29300
29301  fi
29302
29303
29304
29305
29306
29307          GNULIB_DUP2=1
29308
29309
29310
29311
29312
29313$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
29314
29315
29316
29317
29318
29319
29320
29321
29322
29323          GNULIB_ENVIRON=1
29324
29325
29326
29327
29328
29329$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
29330
29331
29332
29333
29334
29335      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
29336$as_echo_n "checking for error_at_line... " >&6; }
29337if ${ac_cv_lib_error_at_line+:} false; then :
29338  $as_echo_n "(cached) " >&6
29339else
29340  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29341/* end confdefs.h.  */
29342#include <error.h>
29343int
29344main ()
29345{
29346error_at_line (0, 0, "", 0, "an error occurred");
29347  ;
29348  return 0;
29349}
29350_ACEOF
29351if ac_fn_c_try_link "$LINENO"; then :
29352  ac_cv_lib_error_at_line=yes
29353else
29354  ac_cv_lib_error_at_line=no
29355fi
29356rm -f core conftest.err conftest.$ac_objext \
29357    conftest$ac_exeext conftest.$ac_ext
29358fi
29359{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
29360$as_echo "$ac_cv_lib_error_at_line" >&6; }
29361
29362  if test $ac_cv_lib_error_at_line = no; then
29363
29364
29365
29366
29367
29368
29369
29370
29371  gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
29372
29373
29374
29375  :
29376
29377  fi
29378
29379
29380  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format"
29381
29382
29383
29384  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format"
29385
29386
29387
29388
29389
29390
29391  for ac_func in euidaccess
29392do :
29393  ac_fn_c_check_func "$LINENO" "euidaccess" "ac_cv_func_euidaccess"
29394if test "x$ac_cv_func_euidaccess" = xyes; then :
29395  cat >>confdefs.h <<_ACEOF
29396#define HAVE_EUIDACCESS 1
29397_ACEOF
29398
29399fi
29400done
29401
29402  if test $ac_cv_func_euidaccess = no; then
29403    HAVE_EUIDACCESS=0
29404  fi
29405
29406  if test $HAVE_EUIDACCESS = 0; then
29407
29408
29409
29410
29411
29412
29413
29414
29415  gl_LIBOBJS="$gl_LIBOBJS euidaccess.$ac_objext"
29416
29417
29418
29419    for ac_header in libgen.h
29420do :
29421  ac_fn_c_check_header_mongrel "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default"
29422if test "x$ac_cv_header_libgen_h" = xyes; then :
29423  cat >>confdefs.h <<_ACEOF
29424#define HAVE_LIBGEN_H 1
29425_ACEOF
29426
29427fi
29428
29429done
29430
29431
29432        ac_fn_c_check_func "$LINENO" "getgroups" "ac_cv_func_getgroups"
29433if test "x$ac_cv_func_getgroups" = xyes; then :
29434
29435fi
29436
29437
29438  # If we don't yet have getgroups, see if it's in -lbsd.
29439  # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
29440  ac_save_LIBS=$LIBS
29441  if test $ac_cv_func_getgroups = no; then
29442    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getgroups in -lbsd" >&5
29443$as_echo_n "checking for getgroups in -lbsd... " >&6; }
29444if ${ac_cv_lib_bsd_getgroups+:} false; then :
29445  $as_echo_n "(cached) " >&6
29446else
29447  ac_check_lib_save_LIBS=$LIBS
29448LIBS="-lbsd  $LIBS"
29449cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29450/* end confdefs.h.  */
29451
29452/* Override any GCC internal prototype to avoid an error.
29453   Use char because int might match the return type of a GCC
29454   builtin and then its argument prototype would still apply.  */
29455#ifdef __cplusplus
29456extern "C"
29457#endif
29458char getgroups ();
29459int
29460main ()
29461{
29462return getgroups ();
29463  ;
29464  return 0;
29465}
29466_ACEOF
29467if ac_fn_c_try_link "$LINENO"; then :
29468  ac_cv_lib_bsd_getgroups=yes
29469else
29470  ac_cv_lib_bsd_getgroups=no
29471fi
29472rm -f core conftest.err conftest.$ac_objext \
29473    conftest$ac_exeext conftest.$ac_ext
29474LIBS=$ac_check_lib_save_LIBS
29475fi
29476{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_getgroups" >&5
29477$as_echo "$ac_cv_lib_bsd_getgroups" >&6; }
29478if test "x$ac_cv_lib_bsd_getgroups" = xyes; then :
29479  GETGROUPS_LIB=-lbsd
29480fi
29481
29482  fi
29483
29484  # Run the program to test the functionality of the system-supplied
29485  # getgroups function only if there is such a function.
29486  if test $ac_cv_func_getgroups = yes; then
29487    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getgroups" >&5
29488$as_echo_n "checking for working getgroups... " >&6; }
29489if ${ac_cv_func_getgroups_works+:} false; then :
29490  $as_echo_n "(cached) " >&6
29491else
29492  if test "$cross_compiling" = yes; then :
29493  case "$host_os" in # ((
29494                           # Guess yes on glibc systems.
29495            *-gnu* | gnu*) ac_cv_func_getgroups_works="guessing yes" ;;
29496                           # If we don't know, assume the worst.
29497            *)             ac_cv_func_getgroups_works="guessing no" ;;
29498          esac
29499
29500else
29501  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29502/* end confdefs.h.  */
29503$ac_includes_default
29504int
29505main ()
29506{
29507/* On Ultrix 4.3, getgroups (0, 0) always fails.  */
29508              return getgroups (0, 0) == -1;
29509  ;
29510  return 0;
29511}
29512
29513_ACEOF
29514if ac_fn_c_try_run "$LINENO"; then :
29515  ac_cv_func_getgroups_works=yes
29516else
29517  ac_cv_func_getgroups_works=no
29518fi
29519rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29520  conftest.$ac_objext conftest.beam conftest.$ac_ext
29521fi
29522
29523
29524fi
29525{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getgroups_works" >&5
29526$as_echo "$ac_cv_func_getgroups_works" >&6; }
29527  else
29528    ac_cv_func_getgroups_works=no
29529  fi
29530  case "$ac_cv_func_getgroups_works" in
29531    *yes)
29532
29533$as_echo "#define HAVE_GETGROUPS 1" >>confdefs.h
29534
29535      ;;
29536  esac
29537  LIBS=$ac_save_LIBS
29538
29539
29540  # Solaris 9 and 10 need -lgen to get the eaccess function.
29541  # Save and restore LIBS so -lgen isn't added to it.  Otherwise, *all*
29542  # programs in the package would end up linked with that potentially-shared
29543  # library, inducing unnecessary run-time overhead.
29544  LIB_EACCESS=
29545
29546  gl_saved_libs=$LIBS
29547    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing eaccess" >&5
29548$as_echo_n "checking for library containing eaccess... " >&6; }
29549if ${ac_cv_search_eaccess+:} false; then :
29550  $as_echo_n "(cached) " >&6
29551else
29552  ac_func_search_save_LIBS=$LIBS
29553cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29554/* end confdefs.h.  */
29555
29556/* Override any GCC internal prototype to avoid an error.
29557   Use char because int might match the return type of a GCC
29558   builtin and then its argument prototype would still apply.  */
29559#ifdef __cplusplus
29560extern "C"
29561#endif
29562char eaccess ();
29563int
29564main ()
29565{
29566return eaccess ();
29567  ;
29568  return 0;
29569}
29570_ACEOF
29571for ac_lib in '' gen; do
29572  if test -z "$ac_lib"; then
29573    ac_res="none required"
29574  else
29575    ac_res=-l$ac_lib
29576    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
29577  fi
29578  if ac_fn_c_try_link "$LINENO"; then :
29579  ac_cv_search_eaccess=$ac_res
29580fi
29581rm -f core conftest.err conftest.$ac_objext \
29582    conftest$ac_exeext
29583  if ${ac_cv_search_eaccess+:} false; then :
29584  break
29585fi
29586done
29587if ${ac_cv_search_eaccess+:} false; then :
29588
29589else
29590  ac_cv_search_eaccess=no
29591fi
29592rm conftest.$ac_ext
29593LIBS=$ac_func_search_save_LIBS
29594fi
29595{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_eaccess" >&5
29596$as_echo "$ac_cv_search_eaccess" >&6; }
29597ac_res=$ac_cv_search_eaccess
29598if test "$ac_res" != no; then :
29599  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
29600  test "$ac_cv_search_eaccess" = "none required" ||
29601                    LIB_EACCESS=$ac_cv_search_eaccess
29602fi
29603
29604    for ac_func in eaccess
29605do :
29606  ac_fn_c_check_func "$LINENO" "eaccess" "ac_cv_func_eaccess"
29607if test "x$ac_cv_func_eaccess" = xyes; then :
29608  cat >>confdefs.h <<_ACEOF
29609#define HAVE_EACCESS 1
29610_ACEOF
29611
29612fi
29613done
29614
29615  LIBS=$gl_saved_libs
29616
29617  fi
29618
29619
29620
29621
29622
29623          GNULIB_EUIDACCESS=1
29624
29625
29626
29627
29628
29629$as_echo "#define GNULIB_TEST_EUIDACCESS 1" >>confdefs.h
29630
29631
29632
29633
29634
29635
29636
29637
29638
29639  if test $ac_cv_func_explicit_bzero = no; then
29640    HAVE_EXPLICIT_BZERO=0
29641  fi
29642
29643  if test $HAVE_EXPLICIT_BZERO = 0; then
29644
29645
29646
29647
29648
29649
29650
29651
29652  gl_LIBOBJS="$gl_LIBOBJS explicit_bzero.$ac_objext"
29653
29654
29655  for ac_func in explicit_memset
29656do :
29657  ac_fn_c_check_func "$LINENO" "explicit_memset" "ac_cv_func_explicit_memset"
29658if test "x$ac_cv_func_explicit_memset" = xyes; then :
29659  cat >>confdefs.h <<_ACEOF
29660#define HAVE_EXPLICIT_MEMSET 1
29661_ACEOF
29662
29663fi
29664done
29665
29666
29667  fi
29668
29669
29670
29671
29672
29673          GNULIB_EXPLICIT_BZERO=1
29674
29675
29676
29677
29678
29679$as_echo "#define GNULIB_TEST_EXPLICIT_BZERO 1" >>confdefs.h
29680
29681
29682
29683
29684
29685
29686
29687
29688
29689
29690
29691  if test $ac_cv_func_faccessat = no; then
29692    HAVE_FACCESSAT=0
29693  else
29694    case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
29695      *yes) ;;
29696      *)    REPLACE_FACCESSAT=1 ;;
29697    esac
29698  fi
29699
29700  if test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1; then
29701
29702
29703
29704
29705
29706
29707
29708
29709  gl_LIBOBJS="$gl_LIBOBJS faccessat.$ac_objext"
29710
29711
29712  for ac_func in access
29713do :
29714  ac_fn_c_check_func "$LINENO" "access" "ac_cv_func_access"
29715if test "x$ac_cv_func_access" = xyes; then :
29716  cat >>confdefs.h <<_ACEOF
29717#define HAVE_ACCESS 1
29718_ACEOF
29719
29720fi
29721done
29722
29723
29724  fi
29725
29726
29727cat >>confdefs.h <<_ACEOF
29728#define GNULIB_FACCESSAT 1
29729_ACEOF
29730
29731
29732
29733
29734
29735
29736
29737          GNULIB_FACCESSAT=1
29738
29739
29740
29741
29742
29743$as_echo "#define GNULIB_TEST_FACCESSAT 1" >>confdefs.h
29744
29745
29746
29747
29748
29749
29750
29751
29752
29753  if test $ac_cv_have_decl_fchdir = no; then
29754    HAVE_DECL_FCHDIR=0
29755  fi
29756
29757
29758  if test $HAVE_FCHDIR = 0; then
29759
29760
29761
29762
29763
29764
29765
29766
29767  gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext"
29768
29769    :
29770
29771$as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h
29772
29773                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
29774$as_echo_n "checking whether open can visit directories... " >&6; }
29775if ${gl_cv_func_open_directory_works+:} false; then :
29776  $as_echo_n "(cached) " >&6
29777else
29778  if test "$cross_compiling" = yes; then :
29779  case "$host_os" in
29780                            # Guess yes on Linux systems.
29781           linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
29782                            # Guess yes on glibc systems.
29783           *-gnu* | gnu*)   gl_cv_func_open_directory_works="guessing yes" ;;
29784                            # Guess no on native Windows.
29785           mingw*)          gl_cv_func_open_directory_works="guessing no" ;;
29786                            # If we don't know, assume the worst.
29787           *)               gl_cv_func_open_directory_works="guessing no" ;;
29788         esac
29789
29790else
29791  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29792/* end confdefs.h.  */
29793#include <fcntl.h>
29794
29795int
29796main ()
29797{
29798return open(".", O_RDONLY) < 0;
29799  ;
29800  return 0;
29801}
29802_ACEOF
29803if ac_fn_c_try_run "$LINENO"; then :
29804  gl_cv_func_open_directory_works=yes
29805else
29806  gl_cv_func_open_directory_works=no
29807fi
29808rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29809  conftest.$ac_objext conftest.beam conftest.$ac_ext
29810fi
29811
29812fi
29813{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
29814$as_echo "$gl_cv_func_open_directory_works" >&6; }
29815    case "$gl_cv_func_open_directory_works" in
29816      *yes) ;;
29817      *)
29818
29819$as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
29820
29821        ;;
29822    esac
29823  fi
29824
29825
29826
29827
29828
29829
29830          GNULIB_FCHDIR=1
29831
29832
29833
29834
29835
29836$as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h
29837
29838
29839
29840
29841
29842
29843
29844  if test $ac_cv_func_fchmodat != yes; then
29845    HAVE_FCHMODAT=0
29846  fi
29847
29848  if test $HAVE_FCHMODAT = 0; then
29849
29850
29851
29852
29853
29854
29855
29856
29857  gl_LIBOBJS="$gl_LIBOBJS fchmodat.$ac_objext"
29858
29859  fi
29860
29861
29862cat >>confdefs.h <<_ACEOF
29863#define GNULIB_FCHMODAT 1
29864_ACEOF
29865
29866
29867
29868
29869
29870
29871          GNULIB_FCHMODAT=1
29872
29873
29874
29875
29876
29877$as_echo "#define GNULIB_TEST_FCHMODAT 1" >>confdefs.h
29878
29879
29880
29881
29882
29883
29884
29885  ac_fn_c_check_func "$LINENO" "fchownat" "ac_cv_func_fchownat"
29886if test "x$ac_cv_func_fchownat" = xyes; then :
29887
29888
29889
29890  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fchownat works with AT_SYMLINK_NOFOLLOW" >&5
29891$as_echo_n "checking whether fchownat works with AT_SYMLINK_NOFOLLOW... " >&6; }
29892if ${gl_cv_func_fchownat_nofollow_works+:} false; then :
29893  $as_echo_n "(cached) " >&6
29894else
29895
29896     gl_dangle=conftest.dangle
29897     # Remove any remnants of a previous test.
29898     rm -f $gl_dangle
29899     # Arrange for deletion of the temporary file this test creates.
29900     ac_clean_files="$ac_clean_files $gl_dangle"
29901     ln -s conftest.no-such $gl_dangle
29902     if test "$cross_compiling" = yes; then :
29903  gl_cv_func_fchownat_nofollow_works=no
29904else
29905  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29906/* end confdefs.h.  */
29907
29908#include <fcntl.h>
29909#include <unistd.h>
29910#include <stdlib.h>
29911#include <errno.h>
29912#include <sys/types.h>
29913int
29914main ()
29915{
29916  return (fchownat (AT_FDCWD, "$gl_dangle", -1, getgid (),
29917                    AT_SYMLINK_NOFOLLOW) != 0
29918          && errno == ENOENT);
29919}
29920
29921_ACEOF
29922if ac_fn_c_try_run "$LINENO"; then :
29923  gl_cv_func_fchownat_nofollow_works=yes
29924else
29925  gl_cv_func_fchownat_nofollow_works=no
29926fi
29927rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29928  conftest.$ac_objext conftest.beam conftest.$ac_ext
29929fi
29930
29931
29932fi
29933{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fchownat_nofollow_works" >&5
29934$as_echo "$gl_cv_func_fchownat_nofollow_works" >&6; }
29935  if test $gl_cv_func_fchownat_nofollow_works = no; then :
29936  REPLACE_FCHOWNAT=1
29937
29938$as_echo "#define FCHOWNAT_NOFOLLOW_BUG 1" >>confdefs.h
29939
29940
29941fi
29942
29943
29944
29945
29946  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fchownat works with an empty file name" >&5
29947$as_echo_n "checking whether fchownat works with an empty file name... " >&6; }
29948if ${gl_cv_func_fchownat_empty_filename_works+:} false; then :
29949  $as_echo_n "(cached) " >&6
29950else
29951  if test "$cross_compiling" = yes; then :
29952  gl_cv_func_fchownat_empty_filename_works="guessing no"
29953else
29954  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29955/* end confdefs.h.  */
29956#include <unistd.h>
29957            #include <fcntl.h>
29958
29959int
29960main ()
29961{
29962int fd;
29963            int ret;
29964            if (mkdir ("conftestdir", 0700) < 0)
29965              return 2;
29966            fd = open ("conftestdir", O_RDONLY);
29967            if (fd < 0)
29968              return 3;
29969            ret = fchownat (fd, "", -1, -1, 0);
29970            close (fd);
29971            rmdir ("conftestdir");
29972            return ret == 0;
29973
29974  ;
29975  return 0;
29976}
29977_ACEOF
29978if ac_fn_c_try_run "$LINENO"; then :
29979  gl_cv_func_fchownat_empty_filename_works=yes
29980else
29981  gl_cv_func_fchownat_empty_filename_works=no
29982fi
29983rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29984  conftest.$ac_objext conftest.beam conftest.$ac_ext
29985fi
29986
29987
29988fi
29989{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fchownat_empty_filename_works" >&5
29990$as_echo "$gl_cv_func_fchownat_empty_filename_works" >&6; }
29991  if test "$gl_cv_func_fchownat_empty_filename_works" != yes; then :
29992  REPLACE_FCHOWNAT=1
29993
29994$as_echo "#define FCHOWNAT_EMPTY_FILENAME_BUG 1" >>confdefs.h
29995
29996
29997fi
29998
29999     if test $REPLACE_CHOWN = 1; then
30000       REPLACE_FCHOWNAT=1
30001     fi
30002else
30003  HAVE_FCHOWNAT=0
30004fi
30005
30006
30007  if test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1; then
30008
30009
30010
30011
30012
30013
30014
30015
30016  gl_LIBOBJS="$gl_LIBOBJS fchownat.$ac_objext"
30017
30018  fi
30019
30020
30021cat >>confdefs.h <<_ACEOF
30022#define GNULIB_FCHOWNAT 1
30023_ACEOF
30024
30025
30026
30027
30028
30029
30030          GNULIB_FCHOWNAT=1
30031
30032
30033
30034
30035
30036$as_echo "#define GNULIB_TEST_FCHOWNAT 1" >>confdefs.h
30037
30038
30039
30040
30041
30042
30043
30044
30045
30046  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
30047$as_echo_n "checking whether fflush works on input streams... " >&6; }
30048if ${gl_cv_func_fflush_stdin+:} false; then :
30049  $as_echo_n "(cached) " >&6
30050else
30051  echo hello world > conftest.txt
30052     if test "$cross_compiling" = yes; then :
30053  case "$host_os" in
30054                  # Guess no on native Windows.
30055          mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
30056          *)      gl_cv_func_fflush_stdin=cross ;;
30057        esac
30058
30059else
30060  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30061/* end confdefs.h.  */
30062
30063#include <stdio.h>
30064#if HAVE_UNISTD_H
30065# include <unistd.h>
30066#else /* on Windows with MSVC */
30067# include <io.h>
30068#endif
30069
30070int
30071main ()
30072{
30073FILE *f = fopen ("conftest.txt", "r");
30074         char buffer[10];
30075         int fd;
30076         int c;
30077         if (f == NULL)
30078           return 1;
30079         fd = fileno (f);
30080         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
30081           { fclose (f); return 2; }
30082         /* For deterministic results, ensure f read a bigger buffer.  */
30083         if (lseek (fd, 0, SEEK_CUR) == 5)
30084           { fclose (f); return 3; }
30085         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
30086            on BSD systems and on mingw.  */
30087         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
30088           { fclose (f); return 4; }
30089         if (lseek (fd, 0, SEEK_CUR) != 5)
30090           { fclose (f); return 5; }
30091         /* Verify behaviour of fflush after ungetc. See
30092            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
30093         /* Verify behaviour of fflush after a backup ungetc.  This fails on
30094            mingw.  */
30095         c = fgetc (f);
30096         ungetc (c, f);
30097         fflush (f);
30098         if (fgetc (f) != c)
30099           { fclose (f); return 6; }
30100         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
30101            on glibc 2.8 and on BSD systems.  */
30102         c = fgetc (f);
30103         ungetc ('@', f);
30104         fflush (f);
30105         if (fgetc (f) != c)
30106           { fclose (f); return 7; }
30107         fclose (f);
30108         return 0;
30109
30110  ;
30111  return 0;
30112}
30113_ACEOF
30114if ac_fn_c_try_run "$LINENO"; then :
30115  gl_cv_func_fflush_stdin=yes
30116else
30117  gl_cv_func_fflush_stdin=no
30118fi
30119rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
30120  conftest.$ac_objext conftest.beam conftest.$ac_ext
30121fi
30122
30123     rm conftest.txt
30124
30125fi
30126{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
30127$as_echo "$gl_cv_func_fflush_stdin" >&6; }
30128  case "$gl_cv_func_fflush_stdin" in
30129    *yes) gl_func_fflush_stdin=1 ;;
30130    *no)  gl_func_fflush_stdin=0 ;;
30131    *)    gl_func_fflush_stdin='(-1)' ;;
30132  esac
30133
30134cat >>confdefs.h <<_ACEOF
30135#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
30136_ACEOF
30137
30138
30139  case "$gl_cv_func_fflush_stdin" in
30140    *yes) ;;
30141    *) REPLACE_FCLOSE=1 ;;
30142  esac
30143
30144
30145  if test $REPLACE_CLOSE = 1; then
30146    REPLACE_FCLOSE=1
30147  fi
30148
30149  case "$host_os" in
30150    openedition) REPLACE_FCLOSE=1 ;;
30151  esac
30152
30153  if test $REPLACE_FCLOSE = 1; then
30154
30155
30156
30157
30158
30159
30160
30161
30162  gl_LIBOBJS="$gl_LIBOBJS fclose.$ac_objext"
30163
30164  fi
30165
30166
30167
30168
30169
30170          GNULIB_FCLOSE=1
30171
30172
30173
30174
30175
30176$as_echo "#define GNULIB_TEST_FCLOSE 1" >>confdefs.h
30177
30178
30179
30180
30181
30182
30183
30184
30185  if test $ac_cv_func_fcntl = no; then
30186
30187
30188
30189  if test $ac_cv_func_fcntl = no; then
30190    HAVE_FCNTL=0
30191  else
30192    REPLACE_FCNTL=1
30193  fi
30194
30195  else
30196            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
30197$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
30198if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
30199  $as_echo_n "(cached) " >&6
30200else
30201  if test "$cross_compiling" = yes; then :
30202  case $host_os in
30203            aix* | cygwin* | haiku*)
30204               gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
30205            *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
30206          esac
30207else
30208  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30209/* end confdefs.h.  */
30210#include <errno.h>
30211              #include <fcntl.h>
30212              #include <limits.h>
30213              #include <sys/resource.h>
30214              #include <unistd.h>
30215              #ifndef RLIM_SAVED_CUR
30216              # define RLIM_SAVED_CUR RLIM_INFINITY
30217              #endif
30218              #ifndef RLIM_SAVED_MAX
30219              # define RLIM_SAVED_MAX RLIM_INFINITY
30220              #endif
30221
30222int
30223main ()
30224{
30225int result = 0;
30226              int bad_fd = INT_MAX;
30227              struct rlimit rlim;
30228              if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
30229                  && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
30230                  && rlim.rlim_cur != RLIM_INFINITY
30231                  && rlim.rlim_cur != RLIM_SAVED_MAX
30232                  && rlim.rlim_cur != RLIM_SAVED_CUR)
30233                bad_fd = rlim.rlim_cur;
30234              if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
30235              if (errno != EINVAL) result |= 2;
30236              if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
30237              if (errno != EINVAL) result |= 8;
30238              /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
30239              {
30240                int fd;
30241                fd = open (".", O_RDONLY);
30242                if (fd == -1)
30243                  result |= 16;
30244                else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
30245                  result |= 32;
30246
30247                close (fd);
30248              }
30249              return result;
30250  ;
30251  return 0;
30252}
30253_ACEOF
30254if ac_fn_c_try_run "$LINENO"; then :
30255  gl_cv_func_fcntl_f_dupfd_works=yes
30256else
30257  gl_cv_func_fcntl_f_dupfd_works=no
30258fi
30259rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
30260  conftest.$ac_objext conftest.beam conftest.$ac_ext
30261fi
30262
30263fi
30264{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
30265$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
30266    case $gl_cv_func_fcntl_f_dupfd_works in
30267      *yes) ;;
30268      *)
30269
30270
30271  if test $ac_cv_func_fcntl = no; then
30272    HAVE_FCNTL=0
30273  else
30274    REPLACE_FCNTL=1
30275  fi
30276
30277
30278$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
30279 ;;
30280    esac
30281
30282        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
30283$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
30284if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
30285  $as_echo_n "(cached) " >&6
30286else
30287  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30288/* end confdefs.h.  */
30289
30290#include <fcntl.h>
30291#ifndef F_DUPFD_CLOEXEC
30292choke me
30293#endif
30294
30295int
30296main ()
30297{
30298
30299  ;
30300  return 0;
30301}
30302_ACEOF
30303if ac_fn_c_try_compile "$LINENO"; then :
30304  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30305/* end confdefs.h.  */
30306
30307#ifdef __linux__
30308/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
30309   it to support the semantics on older kernels that failed with EINVAL.  */
30310choke me
30311#endif
30312
30313int
30314main ()
30315{
30316
30317  ;
30318  return 0;
30319}
30320_ACEOF
30321if ac_fn_c_try_compile "$LINENO"; then :
30322  gl_cv_func_fcntl_f_dupfd_cloexec=yes
30323else
30324  gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
30325fi
30326rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
30327else
30328  gl_cv_func_fcntl_f_dupfd_cloexec=no
30329fi
30330rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
30331fi
30332{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
30333$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
30334    if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
30335
30336
30337
30338  if test $ac_cv_func_fcntl = no; then
30339    HAVE_FCNTL=0
30340  else
30341    REPLACE_FCNTL=1
30342  fi
30343
30344          fi
30345  fi
30346
30347
30348
30349
30350  if test $ac_cv_func_fchdir = no; then
30351    HAVE_FCHDIR=0
30352  fi
30353
30354    if test $HAVE_FCHDIR = 0; then
30355
30356
30357
30358  if test $ac_cv_func_fcntl = no; then
30359    HAVE_FCNTL=0
30360  else
30361    REPLACE_FCNTL=1
30362  fi
30363
30364    fi
30365
30366
30367  if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
30368
30369
30370
30371
30372
30373
30374
30375
30376  gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
30377
30378  fi
30379
30380
30381
30382
30383
30384          GNULIB_FCNTL=1
30385
30386
30387
30388
30389
30390$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
30391
30392
30393
30394
30395
30396
30397
30398
30399
30400
30401
30402
30403
30404
30405     if test $gl_cv_have_include_next = yes; then
30406       gl_cv_next_fcntl_h='<'fcntl.h'>'
30407     else
30408       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
30409$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
30410if ${gl_cv_next_fcntl_h+:} false; then :
30411  $as_echo_n "(cached) " >&6
30412else
30413
30414
30415
30416  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30417/* end confdefs.h.  */
30418#include <fcntl.h>
30419_ACEOF
30420                case "$host_os" in
30421    aix*) gl_absname_cpp="$ac_cpp -C" ;;
30422    *)    gl_absname_cpp="$ac_cpp" ;;
30423  esac
30424
30425  case "$host_os" in
30426    mingw*)
30427                                          gl_dirsep_regex='[/\\]'
30428      ;;
30429    *)
30430      gl_dirsep_regex='\/'
30431      ;;
30432  esac
30433      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
30434  gl_header_literal_regex=`echo 'fcntl.h' \
30435                           | sed -e "$gl_make_literal_regex_sed"`
30436  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
30437      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
30438      s|^/[^/]|//&|
30439      p
30440      q
30441    }'
30442
30443        gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
30444  sed -n "$gl_absolute_header_sed"`
30445
30446           gl_header=$gl_cv_absolute_fcntl_h
30447           gl_cv_next_fcntl_h='"'$gl_header'"'
30448
30449
30450fi
30451{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
30452$as_echo "$gl_cv_next_fcntl_h" >&6; }
30453     fi
30454     NEXT_FCNTL_H=$gl_cv_next_fcntl_h
30455
30456     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
30457       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
30458       gl_next_as_first_directive='<'fcntl.h'>'
30459     else
30460       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
30461       gl_next_as_first_directive=$gl_cv_next_fcntl_h
30462     fi
30463     NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
30464
30465
30466
30467
30468
30469
30470
30471
30472
30473
30474
30475
30476
30477
30478
30479
30480cat >>confdefs.h <<_ACEOF
30481#define GNULIB_FCNTL_SAFER 1
30482_ACEOF
30483
30484
30485
30486
30487cat >>confdefs.h <<_ACEOF
30488#define GNULIB_FD_SAFER_FLAG 1
30489_ACEOF
30490
30491
30492
30493
30494
30495
30496  LIB_FDATASYNC=
30497
30498
30499  if test $ac_cv_have_decl_fdatasync = no; then
30500    HAVE_DECL_FDATASYNC=0
30501        for ac_func in fdatasync
30502do :
30503  ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync"
30504if test "x$ac_cv_func_fdatasync" = xyes; then :
30505  cat >>confdefs.h <<_ACEOF
30506#define HAVE_FDATASYNC 1
30507_ACEOF
30508
30509fi
30510done
30511
30512    if test $ac_cv_func_fdatasync = no; then
30513      HAVE_FDATASYNC=0
30514    fi
30515  else
30516            gl_saved_libs=$LIBS
30517    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5
30518$as_echo_n "checking for library containing fdatasync... " >&6; }
30519if ${ac_cv_search_fdatasync+:} false; then :
30520  $as_echo_n "(cached) " >&6
30521else
30522  ac_func_search_save_LIBS=$LIBS
30523cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30524/* end confdefs.h.  */
30525
30526/* Override any GCC internal prototype to avoid an error.
30527   Use char because int might match the return type of a GCC
30528   builtin and then its argument prototype would still apply.  */
30529#ifdef __cplusplus
30530extern "C"
30531#endif
30532char fdatasync ();
30533int
30534main ()
30535{
30536return fdatasync ();
30537  ;
30538  return 0;
30539}
30540_ACEOF
30541for ac_lib in '' rt posix4; do
30542  if test -z "$ac_lib"; then
30543    ac_res="none required"
30544  else
30545    ac_res=-l$ac_lib
30546    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
30547  fi
30548  if ac_fn_c_try_link "$LINENO"; then :
30549  ac_cv_search_fdatasync=$ac_res
30550fi
30551rm -f core conftest.err conftest.$ac_objext \
30552    conftest$ac_exeext
30553  if ${ac_cv_search_fdatasync+:} false; then :
30554  break
30555fi
30556done
30557if ${ac_cv_search_fdatasync+:} false; then :
30558
30559else
30560  ac_cv_search_fdatasync=no
30561fi
30562rm conftest.$ac_ext
30563LIBS=$ac_func_search_save_LIBS
30564fi
30565{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fdatasync" >&5
30566$as_echo "$ac_cv_search_fdatasync" >&6; }
30567ac_res=$ac_cv_search_fdatasync
30568if test "$ac_res" != no; then :
30569  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
30570  test "$ac_cv_search_fdatasync" = "none required" ||
30571                    LIB_FDATASYNC=$ac_cv_search_fdatasync
30572fi
30573
30574    LIBS=$gl_saved_libs
30575  fi
30576
30577  if test $HAVE_FDATASYNC = 0; then
30578
30579
30580
30581
30582
30583
30584
30585
30586  gl_LIBOBJS="$gl_LIBOBJS fdatasync.$ac_objext"
30587
30588  fi
30589
30590
30591
30592
30593
30594          GNULIB_FDATASYNC=1
30595
30596
30597
30598
30599
30600$as_echo "#define GNULIB_TEST_FDATASYNC 1" >>confdefs.h
30601
30602
30603
30604
30605
30606
30607
30608    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
30609      REPLACE_FDOPEN=1
30610    fi
30611
30612  if test $REPLACE_FDOPEN = 0; then
30613        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopen sets errno" >&5
30614$as_echo_n "checking whether fdopen sets errno... " >&6; }
30615if ${gl_cv_func_fdopen_works+:} false; then :
30616  $as_echo_n "(cached) " >&6
30617else
30618
30619        if test "$cross_compiling" = yes; then :
30620  case "$host_os" in
30621             mingw*) gl_cv_func_fdopen_works="guessing no" ;;
30622             *)      gl_cv_func_fdopen_works="guessing yes" ;;
30623           esac
30624
30625else
30626  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30627/* end confdefs.h.  */
30628
30629#include <stdio.h>
30630#include <errno.h>
30631int
30632main (void)
30633{
30634  FILE *fp;
30635  errno = 0;
30636  fp = fdopen (-1, "r");
30637  if (fp == NULL && errno == 0)
30638    return 1;
30639  return 0;
30640}
30641_ACEOF
30642if ac_fn_c_try_run "$LINENO"; then :
30643  gl_cv_func_fdopen_works=yes
30644else
30645  gl_cv_func_fdopen_works=no
30646fi
30647rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
30648  conftest.$ac_objext conftest.beam conftest.$ac_ext
30649fi
30650
30651
30652fi
30653{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopen_works" >&5
30654$as_echo "$gl_cv_func_fdopen_works" >&6; }
30655    case "$gl_cv_func_fdopen_works" in
30656      *no) REPLACE_FDOPEN=1 ;;
30657    esac
30658  fi
30659
30660  if test $REPLACE_FDOPEN = 1; then
30661
30662
30663
30664
30665
30666
30667
30668
30669  gl_LIBOBJS="$gl_LIBOBJS fdopen.$ac_objext"
30670
30671
30672  fi
30673
30674
30675
30676
30677
30678          GNULIB_FDOPEN=1
30679
30680
30681
30682
30683
30684$as_echo "#define GNULIB_TEST_FDOPEN 1" >>confdefs.h
30685
30686
30687
30688
30689
30690
30691
30692
30693    ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
30694#include <dirent.h>
30695
30696"
30697if test "x$ac_cv_have_decl_fdopendir" = xyes; then :
30698  ac_have_decl=1
30699else
30700  ac_have_decl=0
30701fi
30702
30703cat >>confdefs.h <<_ACEOF
30704#define HAVE_DECL_FDOPENDIR $ac_have_decl
30705_ACEOF
30706if test $ac_have_decl = 1; then :
30707
30708else
30709  HAVE_DECL_FDOPENDIR=0
30710fi
30711
30712
30713  if test $ac_cv_func_fdopendir = no; then
30714    HAVE_FDOPENDIR=0
30715  else
30716    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
30717$as_echo_n "checking whether fdopendir works... " >&6; }
30718if ${gl_cv_func_fdopendir_works+:} false; then :
30719  $as_echo_n "(cached) " >&6
30720else
30721  if test "$cross_compiling" = yes; then :
30722  case "$host_os" in
30723                    # Guess yes on glibc systems.
30724            *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
30725                    # If we don't know, assume the worst.
30726            *)      gl_cv_func_fdopendir_works="guessing no" ;;
30727          esac
30728
30729else
30730  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30731/* end confdefs.h.  */
30732
30733#include <dirent.h>
30734#include <fcntl.h>
30735#include <unistd.h>
30736#if !HAVE_DECL_FDOPENDIR
30737extern
30738# ifdef __cplusplus
30739"C"
30740# endif
30741DIR *fdopendir (int);
30742#endif
30743
30744int
30745main ()
30746{
30747int result = 0;
30748     int fd = open ("conftest.c", O_RDONLY);
30749     if (fd < 0) result |= 1;
30750     if (fdopendir (fd)) result |= 2;
30751     if (close (fd)) result |= 4;
30752     return result;
30753  ;
30754  return 0;
30755}
30756_ACEOF
30757if ac_fn_c_try_run "$LINENO"; then :
30758  gl_cv_func_fdopendir_works=yes
30759else
30760  gl_cv_func_fdopendir_works=no
30761fi
30762rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
30763  conftest.$ac_objext conftest.beam conftest.$ac_ext
30764fi
30765
30766fi
30767{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
30768$as_echo "$gl_cv_func_fdopendir_works" >&6; }
30769    case "$gl_cv_func_fdopendir_works" in
30770      *yes) ;;
30771      *)
30772        REPLACE_FDOPENDIR=1
30773        ;;
30774    esac
30775  fi
30776
30777  if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
30778
30779
30780
30781
30782
30783
30784
30785
30786  gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
30787
30788  fi
30789
30790
30791
30792
30793
30794          GNULIB_FDOPENDIR=1
30795
30796
30797
30798
30799
30800$as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h
30801
30802
30803
30804
30805
30806cat >>confdefs.h <<_ACEOF
30807#define GNULIB_FDOPENDIR 1
30808_ACEOF
30809
30810
30811
30812
30813cat >>confdefs.h <<_ACEOF
30814#define GNULIB_FDUTIMENSAT 1
30815_ACEOF
30816
30817
30818
30819
30820
30821
30822  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
30823$as_echo_n "checking whether fflush works on input streams... " >&6; }
30824if ${gl_cv_func_fflush_stdin+:} false; then :
30825  $as_echo_n "(cached) " >&6
30826else
30827  echo hello world > conftest.txt
30828     if test "$cross_compiling" = yes; then :
30829  case "$host_os" in
30830                  # Guess no on native Windows.
30831          mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
30832          *)      gl_cv_func_fflush_stdin=cross ;;
30833        esac
30834
30835else
30836  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30837/* end confdefs.h.  */
30838
30839#include <stdio.h>
30840#if HAVE_UNISTD_H
30841# include <unistd.h>
30842#else /* on Windows with MSVC */
30843# include <io.h>
30844#endif
30845
30846int
30847main ()
30848{
30849FILE *f = fopen ("conftest.txt", "r");
30850         char buffer[10];
30851         int fd;
30852         int c;
30853         if (f == NULL)
30854           return 1;
30855         fd = fileno (f);
30856         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
30857           { fclose (f); return 2; }
30858         /* For deterministic results, ensure f read a bigger buffer.  */
30859         if (lseek (fd, 0, SEEK_CUR) == 5)
30860           { fclose (f); return 3; }
30861         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
30862            on BSD systems and on mingw.  */
30863         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
30864           { fclose (f); return 4; }
30865         if (lseek (fd, 0, SEEK_CUR) != 5)
30866           { fclose (f); return 5; }
30867         /* Verify behaviour of fflush after ungetc. See
30868            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
30869         /* Verify behaviour of fflush after a backup ungetc.  This fails on
30870            mingw.  */
30871         c = fgetc (f);
30872         ungetc (c, f);
30873         fflush (f);
30874         if (fgetc (f) != c)
30875           { fclose (f); return 6; }
30876         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
30877            on glibc 2.8 and on BSD systems.  */
30878         c = fgetc (f);
30879         ungetc ('@', f);
30880         fflush (f);
30881         if (fgetc (f) != c)
30882           { fclose (f); return 7; }
30883         fclose (f);
30884         return 0;
30885
30886  ;
30887  return 0;
30888}
30889_ACEOF
30890if ac_fn_c_try_run "$LINENO"; then :
30891  gl_cv_func_fflush_stdin=yes
30892else
30893  gl_cv_func_fflush_stdin=no
30894fi
30895rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
30896  conftest.$ac_objext conftest.beam conftest.$ac_ext
30897fi
30898
30899     rm conftest.txt
30900
30901fi
30902{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
30903$as_echo "$gl_cv_func_fflush_stdin" >&6; }
30904  case "$gl_cv_func_fflush_stdin" in
30905    *yes) gl_func_fflush_stdin=1 ;;
30906    *no)  gl_func_fflush_stdin=0 ;;
30907    *)    gl_func_fflush_stdin='(-1)' ;;
30908  esac
30909
30910cat >>confdefs.h <<_ACEOF
30911#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
30912_ACEOF
30913
30914
30915  case "$gl_cv_func_fflush_stdin" in
30916    *yes) ;;
30917    *) REPLACE_FFLUSH=1 ;;
30918  esac
30919
30920  if test $REPLACE_FFLUSH = 1; then
30921
30922
30923
30924
30925
30926
30927
30928
30929  gl_LIBOBJS="$gl_LIBOBJS fflush.$ac_objext"
30930
30931    :
30932  fi
30933
30934
30935cat >>confdefs.h <<_ACEOF
30936#define GNULIB_FFLUSH 1
30937_ACEOF
30938
30939
30940
30941
30942
30943
30944
30945          GNULIB_FFLUSH=1
30946
30947
30948
30949
30950
30951$as_echo "#define GNULIB_TEST_FFLUSH 1" >>confdefs.h
30952
30953
30954
30955
30956
30957  if test "$enable_acl" != no; then
30958    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getxattr with XATTR_NAME_POSIX_ACL macros" >&5
30959$as_echo_n "checking for getxattr with XATTR_NAME_POSIX_ACL macros... " >&6; }
30960if ${gl_cv_getxattr_with_posix_acls+:} false; then :
30961  $as_echo_n "(cached) " >&6
30962else
30963  gl_cv_getxattr_with_posix_acls=no
30964       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30965/* end confdefs.h.  */
30966#include <sys/types.h>
30967              #include <sys/xattr.h>
30968              #include <linux/xattr.h>
30969
30970int
30971main ()
30972{
30973ssize_t a = getxattr (".", XATTR_NAME_POSIX_ACL_ACCESS, 0, 0);
30974              ssize_t b = getxattr (".", XATTR_NAME_POSIX_ACL_DEFAULT, 0, 0);
30975              return a < 0 || b < 0;
30976
30977  ;
30978  return 0;
30979}
30980_ACEOF
30981if ac_fn_c_try_link "$LINENO"; then :
30982  gl_cv_getxattr_with_posix_acls=yes
30983fi
30984rm -f core conftest.err conftest.$ac_objext \
30985    conftest$ac_exeext conftest.$ac_ext
30986fi
30987{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_getxattr_with_posix_acls" >&5
30988$as_echo "$gl_cv_getxattr_with_posix_acls" >&6; }
30989  fi
30990  if test "$gl_cv_getxattr_with_posix_acls" = yes; then
30991    LIB_HAS_ACL=
30992
30993$as_echo "#define GETXATTR_WITH_POSIX_ACLS 1" >>confdefs.h
30994
30995  else
30996            gl_need_lib_has_acl=1
30997    LIB_HAS_ACL=$LIB_ACL
30998  fi
30999
31000
31001
31002
31003    ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
31004if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
31005
31006cat >>confdefs.h <<_ACEOF
31007#define HAVE_STRUCT_STAT_ST_BLOCKS 1
31008_ACEOF
31009
31010
31011$as_echo "#define HAVE_ST_BLOCKS 1" >>confdefs.h
31012
31013else
31014  :
31015fi
31016
31017
31018
31019
31020  if test $ac_cv_member_struct_stat_st_blocks = no; then
31021
31022
31023
31024
31025
31026
31027
31028
31029  gl_LIBOBJS="$gl_LIBOBJS fileblocks.$ac_objext"
31030
31031
31032
31033  :
31034
31035  fi
31036
31037
31038
31039
31040
31041
31042
31043
31044
31045cat >>confdefs.h <<_ACEOF
31046#define GNULIB_FILENAMECAT 1
31047_ACEOF
31048
31049
31050
31051
31052
31053
31054  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
31055$as_echo_n "checking for flexible array member... " >&6; }
31056if ${ac_cv_c_flexmember+:} false; then :
31057  $as_echo_n "(cached) " >&6
31058else
31059  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31060/* end confdefs.h.  */
31061#include <stdlib.h>
31062            #include <stdio.h>
31063            #include <stddef.h>
31064            struct m { struct m *next, **list; char name[]; };
31065            struct s { struct s *p; struct m *m; int n; double d[]; };
31066int
31067main ()
31068{
31069int m = getchar ();
31070            size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
31071            nbytes += sizeof (struct s) - 1;
31072            nbytes -= nbytes % sizeof (struct s);
31073            struct s *p = malloc (nbytes);
31074            p->p = p;
31075            p->m = NULL;
31076            p->d[0] = 0.0;
31077            return p->d != (double *) NULL;
31078  ;
31079  return 0;
31080}
31081_ACEOF
31082if ac_fn_c_try_compile "$LINENO"; then :
31083  ac_cv_c_flexmember=yes
31084else
31085  ac_cv_c_flexmember=no
31086fi
31087rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
31088fi
31089{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
31090$as_echo "$ac_cv_c_flexmember" >&6; }
31091  if test $ac_cv_c_flexmember = yes; then
31092
31093$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
31094
31095  else
31096    $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
31097
31098  fi
31099
31100
31101
31102
31103  FLOAT_H=
31104  REPLACE_FLOAT_LDBL=0
31105  case "$host_os" in
31106    aix* | beos* | openbsd* | mirbsd* | irix*)
31107      FLOAT_H=float.h
31108      ;;
31109    freebsd* | dragonfly*)
31110      case "$host_cpu" in
31111        i[34567]86 )
31112          FLOAT_H=float.h
31113          ;;
31114        x86_64 )
31115          # On x86_64 systems, the C compiler may still be generating
31116          # 32-bit code.
31117          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31118/* end confdefs.h.  */
31119#if defined __LP64__ || defined __x86_64__ || defined __amd64__
31120                  int ok;
31121                 #else
31122                  error fail
31123                 #endif
31124
31125_ACEOF
31126if ac_fn_c_try_compile "$LINENO"; then :
31127
31128else
31129  FLOAT_H=float.h
31130fi
31131rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
31132          ;;
31133      esac
31134      ;;
31135    linux*)
31136      case "$host_cpu" in
31137        powerpc*)
31138          FLOAT_H=float.h
31139          ;;
31140      esac
31141      ;;
31142  esac
31143  case "$host_os" in
31144    aix* | freebsd* | dragonfly* | linux*)
31145      if test -n "$FLOAT_H"; then
31146        REPLACE_FLOAT_LDBL=1
31147      fi
31148      ;;
31149  esac
31150
31151    REPLACE_ITOLD=0
31152  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
31153$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
31154if ${gl_cv_func_itold_works+:} false; then :
31155  $as_echo_n "(cached) " >&6
31156else
31157
31158      if test "$cross_compiling" = yes; then :
31159  case "$host" in
31160           sparc*-*-linux*)
31161             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31162/* end confdefs.h.  */
31163#if defined __LP64__ || defined __arch64__
31164                    int ok;
31165                   #else
31166                    error fail
31167                   #endif
31168
31169_ACEOF
31170if ac_fn_c_try_compile "$LINENO"; then :
31171  gl_cv_func_itold_works="guessing no"
31172else
31173  gl_cv_func_itold_works="guessing yes"
31174fi
31175rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
31176             ;;
31177                   # Guess yes on native Windows.
31178           mingw*) gl_cv_func_itold_works="guessing yes" ;;
31179           *)      gl_cv_func_itold_works="guessing yes" ;;
31180         esac
31181
31182else
31183  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31184/* end confdefs.h.  */
31185
31186int i = -1;
31187volatile long double ld;
31188int main ()
31189{
31190  ld += i * 1.0L;
31191  if (ld > 0)
31192    return 1;
31193  return 0;
31194}
31195_ACEOF
31196if ac_fn_c_try_run "$LINENO"; then :
31197  gl_cv_func_itold_works=yes
31198else
31199  gl_cv_func_itold_works=no
31200fi
31201rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
31202  conftest.$ac_objext conftest.beam conftest.$ac_ext
31203fi
31204
31205
31206fi
31207{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
31208$as_echo "$gl_cv_func_itold_works" >&6; }
31209  case "$gl_cv_func_itold_works" in
31210    *no)
31211      REPLACE_ITOLD=1
31212                  FLOAT_H=float.h
31213      ;;
31214  esac
31215
31216  if test -n "$FLOAT_H"; then
31217
31218
31219
31220
31221
31222
31223
31224
31225     if test $gl_cv_have_include_next = yes; then
31226       gl_cv_next_float_h='<'float.h'>'
31227     else
31228       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
31229$as_echo_n "checking absolute name of <float.h>... " >&6; }
31230if ${gl_cv_next_float_h+:} false; then :
31231  $as_echo_n "(cached) " >&6
31232else
31233
31234
31235
31236  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31237/* end confdefs.h.  */
31238#include <float.h>
31239_ACEOF
31240                case "$host_os" in
31241    aix*) gl_absname_cpp="$ac_cpp -C" ;;
31242    *)    gl_absname_cpp="$ac_cpp" ;;
31243  esac
31244
31245  case "$host_os" in
31246    mingw*)
31247                                          gl_dirsep_regex='[/\\]'
31248      ;;
31249    *)
31250      gl_dirsep_regex='\/'
31251      ;;
31252  esac
31253      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
31254  gl_header_literal_regex=`echo 'float.h' \
31255                           | sed -e "$gl_make_literal_regex_sed"`
31256  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
31257      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
31258      s|^/[^/]|//&|
31259      p
31260      q
31261    }'
31262
31263        gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
31264  sed -n "$gl_absolute_header_sed"`
31265
31266           gl_header=$gl_cv_absolute_float_h
31267           gl_cv_next_float_h='"'$gl_header'"'
31268
31269
31270fi
31271{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
31272$as_echo "$gl_cv_next_float_h" >&6; }
31273     fi
31274     NEXT_FLOAT_H=$gl_cv_next_float_h
31275
31276     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
31277       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
31278       gl_next_as_first_directive='<'float.h'>'
31279     else
31280       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
31281       gl_next_as_first_directive=$gl_cv_next_float_h
31282     fi
31283     NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
31284
31285
31286
31287
31288  fi
31289
31290   if test -n "$FLOAT_H"; then
31291  GL_GENERATE_FLOAT_H_TRUE=
31292  GL_GENERATE_FLOAT_H_FALSE='#'
31293else
31294  GL_GENERATE_FLOAT_H_TRUE='#'
31295  GL_GENERATE_FLOAT_H_FALSE=
31296fi
31297
31298
31299
31300  if test $REPLACE_FLOAT_LDBL = 1; then
31301
31302
31303
31304
31305
31306
31307
31308
31309  gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
31310
31311  fi
31312  if test $REPLACE_ITOLD = 1; then
31313
31314
31315
31316
31317
31318
31319
31320
31321  gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
31322
31323  fi
31324
31325
31326
31327
31328
31329  FNMATCH_H=
31330  gl_fnmatch_required_lowercase=`
31331    echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
31332  `
31333  gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
31334  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5
31335$as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; }
31336if eval \${$gl_fnmatch_cache_var+:} false; then :
31337  $as_echo_n "(cached) " >&6
31338else
31339                           if test $gl_fnmatch_required = GNU; then
31340       gl_fnmatch_gnu_start=
31341       gl_fnmatch_gnu_end=
31342     else
31343       gl_fnmatch_gnu_start='#if 0'
31344       gl_fnmatch_gnu_end='#endif'
31345     fi
31346     if test "$cross_compiling" = yes; then :
31347  eval "$gl_fnmatch_cache_var=\"guessing no\""
31348else
31349  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31350/* end confdefs.h.  */
31351#include <fnmatch.h>
31352            static int
31353            y (char const *pattern, char const *string, int flags)
31354            {
31355              return fnmatch (pattern, string, flags) == 0;
31356            }
31357            static int
31358            n (char const *pattern, char const *string, int flags)
31359            {
31360              return fnmatch (pattern, string, flags) == FNM_NOMATCH;
31361            }
31362
31363int
31364main ()
31365{
31366char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
31367            char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]";
31368            static char const A_1[] = { 'A' - 1, 0 };
31369            static char const A01[] = { 'A' + 1, 0 };
31370            static char const a_1[] = { 'a' - 1, 0 };
31371            static char const a01[] = { 'a' + 1, 0 };
31372            static char const bs_1[] = { '\\\\' - 1, 0 };
31373            static char const bs01[] = { '\\\\' + 1, 0 };
31374            int result = 0;
31375            if (!n ("a*", "", 0))
31376              return 1;
31377            if (!y ("a*", "abc", 0))
31378              return 1;
31379            if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
31380              return 1;
31381            if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
31382              return 2;
31383            if (!y ("a\\\\bc", "abc", 0))
31384              return 3;
31385            if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
31386              return 3;
31387            if (!y ("*x", ".x", 0))
31388              return 4;
31389            if (!n ("*x", ".x", FNM_PERIOD))
31390              return 4;
31391            if (!y (Apat, "\\\\", 0))
31392              return 5;
31393            if (!y (Apat, "A", 0))
31394              return 5;
31395            if (!y (apat, "\\\\", 0))
31396              return 5;
31397            if (!y (apat, "a", 0))
31398              return 5;
31399            if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
31400              return 5;
31401            if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
31402              return 5;
31403            if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
31404              return 5;
31405            if (!(y (apat, a01, 0) == ('a' < '\\\\')))
31406              return 5;
31407            if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
31408              return 5;
31409            if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
31410              return 5;
31411            if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
31412              return 5;
31413            if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
31414              return 5;
31415            $gl_fnmatch_gnu_start
31416            if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
31417              result |= 8;
31418            if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
31419              result |= 16;
31420            if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
31421              result |= 32;
31422            if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
31423              result |= 64;
31424            if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
31425              result |= 64;
31426            if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
31427              result |= 64;
31428            $gl_fnmatch_gnu_end
31429            return result;
31430
31431  ;
31432  return 0;
31433}
31434_ACEOF
31435if ac_fn_c_try_run "$LINENO"; then :
31436  eval "$gl_fnmatch_cache_var=yes"
31437else
31438  eval "$gl_fnmatch_cache_var=no"
31439fi
31440rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
31441  conftest.$ac_objext conftest.beam conftest.$ac_ext
31442fi
31443
31444
31445fi
31446eval ac_res=\$$gl_fnmatch_cache_var
31447	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
31448$as_echo "$ac_res" >&6; }
31449  eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
31450  if test "$gl_fnmatch_result" = yes; then
31451            rm -f "$gl_source_base/fnmatch.h"
31452  else
31453    FNMATCH_H=fnmatch.h
31454  fi
31455
31456   if test -n "$FNMATCH_H"; then
31457  GL_GENERATE_FNMATCH_H_TRUE=
31458  GL_GENERATE_FNMATCH_H_FALSE='#'
31459else
31460  GL_GENERATE_FNMATCH_H_TRUE='#'
31461  GL_GENERATE_FNMATCH_H_FALSE=
31462fi
31463
31464
31465  if test -n "$FNMATCH_H"; then
31466
31467
31468
31469
31470
31471
31472
31473
31474  gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
31475
31476
31477
31478cat >>confdefs.h <<_ACEOF
31479#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch
31480_ACEOF
31481
31482
31483  ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
31484"
31485if test "x$ac_cv_have_decl_isblank" = xyes; then :
31486  ac_have_decl=1
31487else
31488  ac_have_decl=0
31489fi
31490
31491cat >>confdefs.h <<_ACEOF
31492#define HAVE_DECL_ISBLANK $ac_have_decl
31493_ACEOF
31494
31495
31496
31497
31498  fi
31499
31500
31501
31502
31503
31504  if test -n "$FNMATCH_H"; then
31505
31506
31507
31508
31509
31510
31511
31512
31513  gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
31514
31515
31516
31517cat >>confdefs.h <<_ACEOF
31518#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch
31519_ACEOF
31520
31521
31522  ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
31523"
31524if test "x$ac_cv_have_decl_isblank" = xyes; then :
31525  ac_have_decl=1
31526else
31527  ac_have_decl=0
31528fi
31529
31530cat >>confdefs.h <<_ACEOF
31531#define HAVE_DECL_ISBLANK $ac_have_decl
31532_ACEOF
31533
31534
31535
31536
31537  fi
31538
31539
31540
31541  case "$host_os" in
31542    mingw* | pw*)
31543            REPLACE_FOPEN=1
31544            gl_cv_func_fopen_slash="guessing no"
31545      ;;
31546    *)
31547                  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen recognizes a trailing slash" >&5
31548$as_echo_n "checking whether fopen recognizes a trailing slash... " >&6; }
31549if ${gl_cv_func_fopen_slash+:} false; then :
31550  $as_echo_n "(cached) " >&6
31551else
31552
31553          if test "$cross_compiling" = yes; then :
31554
31555             case "$host_os" in
31556               aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
31557                 gl_cv_func_fopen_slash="guessing no" ;;
31558               *)
31559                 gl_cv_func_fopen_slash="guessing yes" ;;
31560             esac
31561
31562else
31563  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31564/* end confdefs.h.  */
31565
31566#include <stddef.h>
31567#include <stdio.h>
31568int main ()
31569{
31570  FILE *fp = fopen ("conftest.sl/", "w");
31571  int result = (fp != NULL);
31572  if (fp != NULL)
31573    fclose (fp);
31574  return result;
31575}
31576_ACEOF
31577if ac_fn_c_try_run "$LINENO"; then :
31578  gl_cv_func_fopen_slash=yes
31579else
31580  gl_cv_func_fopen_slash=no
31581fi
31582rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
31583  conftest.$ac_objext conftest.beam conftest.$ac_ext
31584fi
31585
31586          rm -f conftest.sl
31587
31588fi
31589{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fopen_slash" >&5
31590$as_echo "$gl_cv_func_fopen_slash" >&6; }
31591      ;;
31592  esac
31593  case "$gl_cv_func_fopen_slash" in
31594    *no)
31595
31596$as_echo "#define FOPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
31597
31598      REPLACE_FOPEN=1
31599      ;;
31600  esac
31601
31602  if test $REPLACE_FOPEN = 1; then
31603
31604
31605
31606
31607
31608
31609
31610
31611  gl_LIBOBJS="$gl_LIBOBJS fopen.$ac_objext"
31612
31613    :
31614  fi
31615
31616
31617
31618
31619
31620          GNULIB_FOPEN=1
31621
31622
31623
31624
31625
31626$as_echo "#define GNULIB_TEST_FOPEN 1" >>confdefs.h
31627
31628
31629
31630
31631
31632cat >>confdefs.h <<_ACEOF
31633#define GNULIB_FOPEN_SAFER 1
31634_ACEOF
31635
31636
31637
31638
31639  fp_headers='
31640    #include <stdio.h>
31641    #if HAVE_STDIO_EXT_H
31642    # include <stdio_ext.h>
31643    #endif
31644  '
31645  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpending" >&5
31646$as_echo_n "checking for __fpending... " >&6; }
31647if ${gl_cv_func___fpending+:} false; then :
31648  $as_echo_n "(cached) " >&6
31649else
31650
31651      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31652/* end confdefs.h.  */
31653$fp_headers
31654int
31655main ()
31656{
31657return ! __fpending (stdin);
31658  ;
31659  return 0;
31660}
31661_ACEOF
31662if ac_fn_c_try_link "$LINENO"; then :
31663  gl_cv_func___fpending=yes
31664else
31665  gl_cv_func___fpending=no
31666fi
31667rm -f core conftest.err conftest.$ac_objext \
31668    conftest$ac_exeext conftest.$ac_ext
31669
31670fi
31671{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func___fpending" >&5
31672$as_echo "$gl_cv_func___fpending" >&6; }
31673  if test $gl_cv_func___fpending = yes; then
31674    ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers
31675"
31676if test "x$ac_cv_have_decl___fpending" = xyes; then :
31677  ac_have_decl=1
31678else
31679  ac_have_decl=0
31680fi
31681
31682cat >>confdefs.h <<_ACEOF
31683#define HAVE_DECL___FPENDING $ac_have_decl
31684_ACEOF
31685
31686  fi
31687
31688  if test $gl_cv_func___fpending = no; then
31689
31690
31691
31692
31693
31694
31695
31696
31697  gl_LIBOBJS="$gl_LIBOBJS fpending.$ac_objext"
31698
31699  fi
31700
31701
31702
31703
31704  ac_fn_c_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" "#include <stdio.h>
31705"
31706if test "x$ac_cv_have_decl_fpurge" = xyes; then :
31707  ac_have_decl=1
31708else
31709  ac_have_decl=0
31710fi
31711
31712cat >>confdefs.h <<_ACEOF
31713#define HAVE_DECL_FPURGE $ac_have_decl
31714_ACEOF
31715
31716  if test "x$ac_cv_func_fpurge" = xyes; then
31717    HAVE_FPURGE=1
31718    # Detect BSD bug.  Only cygwin 1.7 is known to be immune.
31719    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fpurge works" >&5
31720$as_echo_n "checking whether fpurge works... " >&6; }
31721if ${gl_cv_func_fpurge_works+:} false; then :
31722  $as_echo_n "(cached) " >&6
31723else
31724  if test "$cross_compiling" = yes; then :
31725  gl_cv_func_fpurge_works='guessing no'
31726else
31727  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31728/* end confdefs.h.  */
31729#include <stdio.h>
31730
31731int
31732main ()
31733{
31734FILE *f = fopen ("conftest.txt", "w+");
31735             if (!f)
31736               return 1;
31737             if (fputc ('a', f) != 'a')
31738               { fclose (f); return 2; }
31739             rewind (f);
31740             if (fgetc (f) != 'a')
31741               { fclose (f); return 3; }
31742             if (fgetc (f) != EOF)
31743               { fclose (f); return 4; }
31744             if (fpurge (f) != 0)
31745               { fclose (f); return 5; }
31746             if (putc ('b', f) != 'b')
31747               { fclose (f); return 6; }
31748             if (fclose (f) != 0)
31749               return 7;
31750             if ((f = fopen ("conftest.txt", "r")) == NULL)
31751               return 8;
31752             if (fgetc (f) != 'a')
31753               { fclose (f); return 9; }
31754             if (fgetc (f) != 'b')
31755               { fclose (f); return 10; }
31756             if (fgetc (f) != EOF)
31757               { fclose (f); return 11; }
31758             if (fclose (f) != 0)
31759               return 12;
31760             if (remove ("conftest.txt") != 0)
31761               return 13;
31762             return 0;
31763
31764  ;
31765  return 0;
31766}
31767_ACEOF
31768if ac_fn_c_try_run "$LINENO"; then :
31769  gl_cv_func_fpurge_works=yes
31770else
31771  gl_cv_func_fpurge_works=no
31772fi
31773rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
31774  conftest.$ac_objext conftest.beam conftest.$ac_ext
31775fi
31776
31777fi
31778{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fpurge_works" >&5
31779$as_echo "$gl_cv_func_fpurge_works" >&6; }
31780    if test "x$gl_cv_func_fpurge_works" != xyes; then
31781      REPLACE_FPURGE=1
31782    fi
31783  else
31784    HAVE_FPURGE=0
31785  fi
31786  if test "x$ac_cv_have_decl_fpurge" = xno; then
31787    HAVE_DECL_FPURGE=0
31788  fi
31789
31790  if test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1; then
31791
31792
31793
31794
31795
31796
31797
31798
31799  gl_LIBOBJS="$gl_LIBOBJS fpurge.$ac_objext"
31800
31801  fi
31802
31803
31804
31805
31806
31807          GNULIB_FPURGE=1
31808
31809
31810
31811
31812
31813$as_echo "#define GNULIB_TEST_FPURGE 1" >>confdefs.h
31814
31815
31816
31817
31818
31819
31820  if test $ac_cv_func___freadahead = no; then
31821
31822
31823
31824
31825
31826
31827
31828
31829  gl_LIBOBJS="$gl_LIBOBJS freadahead.$ac_objext"
31830
31831  fi
31832
31833
31834
31835
31836
31837
31838  if test $ac_cv_func___freadptr = no; then
31839
31840
31841
31842
31843
31844
31845
31846
31847  gl_LIBOBJS="$gl_LIBOBJS freadptr.$ac_objext"
31848
31849  fi
31850
31851
31852
31853
31854
31855
31856  case "$host_os" in
31857    mingw* | pw* | os2*)
31858      REPLACE_FREOPEN=1
31859      ;;
31860    *)
31861      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether freopen works on closed fds" >&5
31862$as_echo_n "checking whether freopen works on closed fds... " >&6; }
31863if ${gl_cv_func_freopen_works_on_closed+:} false; then :
31864  $as_echo_n "(cached) " >&6
31865else
31866  if test "$cross_compiling" = yes; then :
31867  case $host_os in
31868              *gnu*) gl_cv_func_freopen_works_on_closed="guessing no" ;;
31869              *)     gl_cv_func_freopen_works_on_closed="guessing yes";;
31870            esac
31871else
31872  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31873/* end confdefs.h.  */
31874#include <stdio.h>
31875                #include <unistd.h>
31876
31877int
31878main ()
31879{
31880close (0);
31881                return !(freopen ("/dev/null", "r", stdin)
31882                         && getchar () == EOF
31883                         && !ferror (stdin) && feof (stdin));
31884  ;
31885  return 0;
31886}
31887_ACEOF
31888if ac_fn_c_try_run "$LINENO"; then :
31889  gl_cv_func_freopen_works_on_closed=yes
31890else
31891  gl_cv_func_freopen_works_on_closed=no
31892fi
31893rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
31894  conftest.$ac_objext conftest.beam conftest.$ac_ext
31895fi
31896
31897fi
31898{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_freopen_works_on_closed" >&5
31899$as_echo "$gl_cv_func_freopen_works_on_closed" >&6; }
31900      case $gl_cv_func_freopen_works_on_closed in
31901        *no) REPLACE_FREOPEN=1;;
31902      esac
31903  esac
31904
31905  if test $REPLACE_FREOPEN = 1; then
31906
31907
31908
31909
31910
31911
31912
31913
31914  gl_LIBOBJS="$gl_LIBOBJS freopen.$ac_objext"
31915
31916    :
31917  fi
31918
31919
31920
31921
31922
31923          GNULIB_FREOPEN=1
31924
31925
31926
31927
31928
31929$as_echo "#define GNULIB_TEST_FREOPEN 1" >>confdefs.h
31930
31931
31932
31933
31934
31935cat >>confdefs.h <<_ACEOF
31936#define GNULIB_FREOPEN_SAFER 1
31937_ACEOF
31938
31939
31940
31941
31942
31943  if test $gl_cv_func_frexp_no_libm = yes; then
31944
31945
31946
31947  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
31948$as_echo_n "checking whether frexp works... " >&6; }
31949if ${gl_cv_func_frexp_works+:} false; then :
31950  $as_echo_n "(cached) " >&6
31951else
31952
31953      if test "$cross_compiling" = yes; then :
31954  case "$host_os" in
31955           netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
31956           mingw*) # Guess yes with MSVC, no with mingw.
31957             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31958/* end confdefs.h.  */
31959
31960#ifdef _MSC_VER
31961 Good
31962#endif
31963
31964_ACEOF
31965if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
31966  $EGREP "Good" >/dev/null 2>&1; then :
31967  gl_cv_func_frexp_works="guessing yes"
31968else
31969  gl_cv_func_frexp_works="guessing no"
31970fi
31971rm -f conftest*
31972
31973             ;;
31974           *) gl_cv_func_frexp_works="guessing yes" ;;
31975         esac
31976
31977else
31978  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31979/* end confdefs.h.  */
31980
31981#include <float.h>
31982#include <math.h>
31983#include <string.h>
31984#if HAVE_DECL_ALARM
31985# include <signal.h>
31986# include <unistd.h>
31987#endif
31988/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
31989   ICC 10.0 has a bug when optimizing the expression -zero.
31990   The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
31991   to PowerPC on Mac OS X 10.5.  */
31992#if defined __hpux || defined __sgi || defined __ICC
31993static double
31994compute_minus_zero (void)
31995{
31996  return -DBL_MIN * DBL_MIN;
31997}
31998# define minus_zero compute_minus_zero ()
31999#else
32000double minus_zero = -0.0;
32001#endif
32002int main()
32003{
32004  int result = 0;
32005  int i;
32006  volatile double x;
32007  double zero = 0.0;
32008#if HAVE_DECL_ALARM
32009  /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
32010     number.  Let the test fail in this case.  */
32011  signal (SIGALRM, SIG_DFL);
32012  alarm (5);
32013#endif
32014  /* Test on denormalized numbers.  */
32015  for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
32016    ;
32017  if (x > 0.0)
32018    {
32019      int exp;
32020      double y = frexp (x, &exp);
32021      /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
32022         On NetBSD: y = 0.75. Correct: y = 0.5.  */
32023      if (y != 0.5)
32024        result |= 1;
32025    }
32026  /* Test on infinite numbers.  */
32027  x = 1.0 / zero;
32028  {
32029    int exp;
32030    double y = frexp (x, &exp);
32031    if (y != x)
32032      result |= 2;
32033  }
32034  /* Test on negative zero.  */
32035  x = minus_zero;
32036  {
32037    int exp;
32038    double y = frexp (x, &exp);
32039    if (memcmp (&y, &x, sizeof x))
32040      result |= 4;
32041  }
32042  return result;
32043}
32044_ACEOF
32045if ac_fn_c_try_run "$LINENO"; then :
32046  gl_cv_func_frexp_works=yes
32047else
32048  gl_cv_func_frexp_works=no
32049fi
32050rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32051  conftest.$ac_objext conftest.beam conftest.$ac_ext
32052fi
32053
32054
32055fi
32056{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
32057$as_echo "$gl_cv_func_frexp_works" >&6; }
32058
32059    case "$gl_cv_func_frexp_works" in
32060      *yes) gl_func_frexp_no_libm=yes ;;
32061      *)    gl_func_frexp_no_libm=no; REPLACE_FREXP=1 ;;
32062    esac
32063  else
32064    gl_func_frexp_no_libm=no
32065        REPLACE_FREXP=1
32066  fi
32067  if test $gl_func_frexp_no_libm = yes; then
32068
32069$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h
32070
32071  fi
32072
32073  if test $gl_func_frexp_no_libm != yes; then
32074
32075
32076
32077
32078
32079
32080
32081
32082  gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext"
32083
32084  fi
32085
32086
32087
32088
32089
32090          GNULIB_FREXP=1
32091
32092
32093
32094
32095
32096$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h
32097
32098
32099
32100
32101
32102
32103      ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
32104"
32105if test "x$ac_cv_have_decl_frexpl" = xyes; then :
32106
32107else
32108  HAVE_DECL_FREXPL=0
32109fi
32110
32111  if test $HAVE_DECL_FREXPL = 1; then
32112
32113  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
32114$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
32115if ${gl_cv_func_frexpl_no_libm+:} false; then :
32116  $as_echo_n "(cached) " >&6
32117else
32118
32119      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32120/* end confdefs.h.  */
32121#include <math.h>
32122             long double x;
32123int
32124main ()
32125{
32126int e; return frexpl (x, &e) > 0;
32127  ;
32128  return 0;
32129}
32130_ACEOF
32131if ac_fn_c_try_link "$LINENO"; then :
32132  gl_cv_func_frexpl_no_libm=yes
32133else
32134  gl_cv_func_frexpl_no_libm=no
32135fi
32136rm -f core conftest.err conftest.$ac_objext \
32137    conftest$ac_exeext conftest.$ac_ext
32138
32139fi
32140{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
32141$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
32142
32143    if test $gl_cv_func_frexpl_no_libm = yes; then
32144
32145
32146     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
32147$as_echo_n "checking whether frexpl works... " >&6; }
32148if ${gl_cv_func_frexpl_works+:} false; then :
32149  $as_echo_n "(cached) " >&6
32150else
32151
32152      if test "$cross_compiling" = yes; then :
32153
32154         case "$host_os" in
32155           aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
32156              gl_cv_func_frexpl_works="guessing no";;
32157           *) gl_cv_func_frexpl_works="guessing yes";;
32158         esac
32159
32160else
32161  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32162/* end confdefs.h.  */
32163
32164#include <float.h>
32165#include <math.h>
32166/* Override the values of <float.h>, like done in float.in.h.  */
32167#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
32168# undef LDBL_MIN_EXP
32169# define LDBL_MIN_EXP    (-16381)
32170#endif
32171#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
32172# undef LDBL_MIN_EXP
32173# define LDBL_MIN_EXP    (-16381)
32174#endif
32175#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
32176# undef LDBL_MIN_EXP
32177# define LDBL_MIN_EXP DBL_MIN_EXP
32178#endif
32179#if defined __sgi && (LDBL_MANT_DIG >= 106)
32180# if defined __GNUC__
32181#  undef LDBL_MIN_EXP
32182#  define LDBL_MIN_EXP DBL_MIN_EXP
32183# endif
32184#endif
32185extern
32186#ifdef __cplusplus
32187"C"
32188#endif
32189long double frexpl (long double, int *);
32190int main()
32191{
32192  int result = 0;
32193  volatile long double x;
32194  /* Test on finite numbers that fails on AIX 5.1.  */
32195  x = 16.0L;
32196  {
32197    int exp = -9999;
32198    frexpl (x, &exp);
32199    if (exp != 5)
32200      result |= 1;
32201  }
32202  /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
32203     function returns an invalid (incorrectly normalized) value: it returns
32204               y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
32205     but the correct result is
32206          0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 }  */
32207  x = 1.01L;
32208  {
32209    int exp = -9999;
32210    long double y = frexpl (x, &exp);
32211    if (!(exp == 1 && y == 0.505L))
32212      result |= 2;
32213  }
32214  /* Test on large finite numbers.  This fails on BeOS at i = 16322, while
32215     LDBL_MAX_EXP = 16384.
32216     In the loop end test, we test x against Infinity, rather than comparing
32217     i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP.  */
32218  {
32219    int i;
32220    for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
32221      {
32222        int exp = -9999;
32223        frexpl (x, &exp);
32224        if (exp != i)
32225          {
32226            result |= 4;
32227            break;
32228          }
32229      }
32230  }
32231  /* Test on denormalized numbers.  */
32232  {
32233    int i;
32234    for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
32235      ;
32236    if (x > 0.0L)
32237      {
32238        int exp;
32239        long double y = frexpl (x, &exp);
32240        /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
32241           exp = -16382, y = 0.5.  On Mac OS X 10.5: exp = -16384, y = 0.5.  */
32242        if (exp != LDBL_MIN_EXP - 1)
32243          result |= 8;
32244      }
32245  }
32246  /* Test on infinite numbers.  */
32247  x = 1.0L / 0.0L;
32248  {
32249    int exp;
32250    long double y = frexpl (x, &exp);
32251    if (y != x)
32252      result |= 16;
32253  }
32254  return result;
32255}
32256_ACEOF
32257if ac_fn_c_try_run "$LINENO"; then :
32258  gl_cv_func_frexpl_works=yes
32259else
32260  gl_cv_func_frexpl_works=no
32261fi
32262rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32263  conftest.$ac_objext conftest.beam conftest.$ac_ext
32264fi
32265
32266
32267fi
32268{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
32269$as_echo "$gl_cv_func_frexpl_works" >&6; }
32270
32271      case "$gl_cv_func_frexpl_works" in
32272        *yes) gl_func_frexpl_no_libm=yes ;;
32273        *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
32274      esac
32275    else
32276      gl_func_frexpl_no_libm=no
32277            REPLACE_FREXPL=1
32278    fi
32279    if test $gl_func_frexpl_no_libm = yes; then
32280
32281$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h
32282
32283    fi
32284  fi
32285
32286  if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then
32287
32288
32289
32290
32291
32292
32293
32294
32295  gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext"
32296
32297  fi
32298
32299
32300
32301
32302
32303          GNULIB_FREXPL=1
32304
32305
32306
32307
32308
32309$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
32310
32311
32312
32313
32314
32315
32316    if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
32317    REPLACE_FSEEK=1
32318  fi
32319
32320  if test $REPLACE_FSEEK = 1; then
32321
32322
32323
32324
32325
32326
32327
32328
32329  gl_LIBOBJS="$gl_LIBOBJS fseek.$ac_objext"
32330
32331  fi
32332
32333
32334
32335
32336
32337          GNULIB_FSEEK=1
32338
32339
32340
32341
32342
32343$as_echo "#define GNULIB_TEST_FSEEK 1" >>confdefs.h
32344
32345
32346
32347
32348
32349
32350
32351
32352
32353
32354
32355  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5
32356$as_echo_n "checking for fseeko... " >&6; }
32357if ${gl_cv_func_fseeko+:} false; then :
32358  $as_echo_n "(cached) " >&6
32359else
32360
32361      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32362/* end confdefs.h.  */
32363#include <stdio.h>
32364
32365int
32366main ()
32367{
32368fseeko (stdin, 0, 0);
32369  ;
32370  return 0;
32371}
32372_ACEOF
32373if ac_fn_c_try_link "$LINENO"; then :
32374  gl_cv_func_fseeko=yes
32375else
32376  gl_cv_func_fseeko=no
32377fi
32378rm -f core conftest.err conftest.$ac_objext \
32379    conftest$ac_exeext conftest.$ac_ext
32380
32381fi
32382{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5
32383$as_echo "$gl_cv_func_fseeko" >&6; }
32384
32385
32386  if test $ac_cv_have_decl_fseeko = no; then
32387    HAVE_DECL_FSEEKO=0
32388  fi
32389
32390  if test $gl_cv_func_fseeko = no; then
32391    HAVE_FSEEKO=0
32392  else
32393    if test $WINDOWS_64_BIT_OFF_T = 1; then
32394      REPLACE_FSEEKO=1
32395    fi
32396    if test $gl_cv_var_stdin_large_offset = no; then
32397      REPLACE_FSEEKO=1
32398    fi
32399
32400
32401
32402  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
32403$as_echo_n "checking whether fflush works on input streams... " >&6; }
32404if ${gl_cv_func_fflush_stdin+:} false; then :
32405  $as_echo_n "(cached) " >&6
32406else
32407  echo hello world > conftest.txt
32408     if test "$cross_compiling" = yes; then :
32409  case "$host_os" in
32410                  # Guess no on native Windows.
32411          mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
32412          *)      gl_cv_func_fflush_stdin=cross ;;
32413        esac
32414
32415else
32416  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32417/* end confdefs.h.  */
32418
32419#include <stdio.h>
32420#if HAVE_UNISTD_H
32421# include <unistd.h>
32422#else /* on Windows with MSVC */
32423# include <io.h>
32424#endif
32425
32426int
32427main ()
32428{
32429FILE *f = fopen ("conftest.txt", "r");
32430         char buffer[10];
32431         int fd;
32432         int c;
32433         if (f == NULL)
32434           return 1;
32435         fd = fileno (f);
32436         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
32437           { fclose (f); return 2; }
32438         /* For deterministic results, ensure f read a bigger buffer.  */
32439         if (lseek (fd, 0, SEEK_CUR) == 5)
32440           { fclose (f); return 3; }
32441         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
32442            on BSD systems and on mingw.  */
32443         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
32444           { fclose (f); return 4; }
32445         if (lseek (fd, 0, SEEK_CUR) != 5)
32446           { fclose (f); return 5; }
32447         /* Verify behaviour of fflush after ungetc. See
32448            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
32449         /* Verify behaviour of fflush after a backup ungetc.  This fails on
32450            mingw.  */
32451         c = fgetc (f);
32452         ungetc (c, f);
32453         fflush (f);
32454         if (fgetc (f) != c)
32455           { fclose (f); return 6; }
32456         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
32457            on glibc 2.8 and on BSD systems.  */
32458         c = fgetc (f);
32459         ungetc ('@', f);
32460         fflush (f);
32461         if (fgetc (f) != c)
32462           { fclose (f); return 7; }
32463         fclose (f);
32464         return 0;
32465
32466  ;
32467  return 0;
32468}
32469_ACEOF
32470if ac_fn_c_try_run "$LINENO"; then :
32471  gl_cv_func_fflush_stdin=yes
32472else
32473  gl_cv_func_fflush_stdin=no
32474fi
32475rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32476  conftest.$ac_objext conftest.beam conftest.$ac_ext
32477fi
32478
32479     rm conftest.txt
32480
32481fi
32482{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
32483$as_echo "$gl_cv_func_fflush_stdin" >&6; }
32484  case "$gl_cv_func_fflush_stdin" in
32485    *yes) gl_func_fflush_stdin=1 ;;
32486    *no)  gl_func_fflush_stdin=0 ;;
32487    *)    gl_func_fflush_stdin='(-1)' ;;
32488  esac
32489
32490cat >>confdefs.h <<_ACEOF
32491#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
32492_ACEOF
32493
32494
32495      case "$gl_cv_func_fflush_stdin" in
32496        *yes) ;;
32497        *) REPLACE_FSEEKO=1 ;;
32498      esac
32499
32500  fi
32501
32502  if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
32503
32504
32505
32506
32507
32508
32509
32510
32511  gl_LIBOBJS="$gl_LIBOBJS fseeko.$ac_objext"
32512
32513
32514      for ac_func in _fseeki64
32515do :
32516  ac_fn_c_check_func "$LINENO" "_fseeki64" "ac_cv_func__fseeki64"
32517if test "x$ac_cv_func__fseeki64" = xyes; then :
32518  cat >>confdefs.h <<_ACEOF
32519#define HAVE__FSEEKI64 1
32520_ACEOF
32521
32522fi
32523done
32524
32525  if test $ac_cv_func__fseeki64 = yes; then
32526    ac_fn_c_check_decl "$LINENO" "_fseeki64" "ac_cv_have_decl__fseeki64" "$ac_includes_default"
32527if test "x$ac_cv_have_decl__fseeki64" = xyes; then :
32528  ac_have_decl=1
32529else
32530  ac_have_decl=0
32531fi
32532
32533cat >>confdefs.h <<_ACEOF
32534#define HAVE_DECL__FSEEKI64 $ac_have_decl
32535_ACEOF
32536
32537  fi
32538
32539  fi
32540
32541
32542
32543
32544
32545          GNULIB_FSEEKO=1
32546
32547
32548
32549
32550
32551$as_echo "#define GNULIB_TEST_FSEEKO 1" >>confdefs.h
32552
32553
32554
32555
32556
32557
32558  if test $ac_cv_func___fseterr = no; then
32559
32560
32561
32562
32563
32564
32565
32566
32567  gl_LIBOBJS="$gl_LIBOBJS fseterr.$ac_objext"
32568
32569  fi
32570
32571
32572
32573
32574  case "$host_os" in
32575    mingw* | solaris*)
32576                        REPLACE_FSTAT=1
32577      ;;
32578  esac
32579
32580
32581
32582
32583
32584  if test $ac_cv_func_fchdir = no; then
32585    HAVE_FCHDIR=0
32586  fi
32587
32588    if test $HAVE_FCHDIR = 0; then
32589      case "$gl_cv_func_open_directory_works" in
32590        *yes) ;;
32591        *)
32592          REPLACE_FSTAT=1
32593          ;;
32594      esac
32595    fi
32596
32597
32598  if test $REPLACE_FSTAT = 1; then
32599
32600
32601
32602
32603
32604
32605
32606
32607  gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext"
32608
32609    case "$host_os" in
32610      mingw*)
32611
32612
32613
32614
32615
32616
32617
32618
32619  gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
32620
32621        ;;
32622    esac
32623
32624
32625  :
32626
32627  fi
32628
32629
32630
32631
32632
32633          GNULIB_FSTAT=1
32634
32635
32636
32637
32638
32639$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
32640
32641
32642
32643
32644
32645
32646
32647
32648
32649
32650  if test $ac_cv_func_fstatat = no; then
32651    HAVE_FSTATAT=0
32652  else
32653            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5
32654$as_echo_n "checking whether fstatat (..., 0) works... " >&6; }
32655if ${gl_cv_func_fstatat_zero_flag+:} false; then :
32656  $as_echo_n "(cached) " >&6
32657else
32658  if test "$cross_compiling" = yes; then :
32659  case "$host_os" in
32660            aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
32661            *)    gl_cv_func_fstatat_zero_flag="guessing yes";;
32662          esac
32663
32664else
32665  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32666/* end confdefs.h.  */
32667
32668              #include <fcntl.h>
32669              #include <sys/stat.h>
32670              int
32671              main (void)
32672              {
32673                struct stat a;
32674                return fstatat (AT_FDCWD, ".", &a, 0) != 0;
32675              }
32676
32677_ACEOF
32678if ac_fn_c_try_run "$LINENO"; then :
32679  gl_cv_func_fstatat_zero_flag=yes
32680else
32681  gl_cv_func_fstatat_zero_flag=no
32682fi
32683rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32684  conftest.$ac_objext conftest.beam conftest.$ac_ext
32685fi
32686
32687
32688fi
32689{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5
32690$as_echo "$gl_cv_func_fstatat_zero_flag" >&6; }
32691
32692    case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
32693    *yes+*yes) ;;
32694    *) REPLACE_FSTATAT=1 ;;
32695    esac
32696
32697    case $host_os in
32698      solaris*)
32699        REPLACE_FSTATAT=1 ;;
32700    esac
32701
32702    case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
32703      1,*yes)
32704
32705$as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h
32706
32707         ;;
32708    esac
32709  fi
32710
32711  if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
32712
32713
32714
32715
32716
32717
32718
32719
32720  gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext"
32721
32722  fi
32723
32724
32725
32726
32727
32728          GNULIB_FSTATAT=1
32729
32730
32731
32732
32733
32734$as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h
32735
32736
32737
32738
32739
32740
32741  for ac_header in sys/mount.h
32742do :
32743  ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$ac_includes_default
32744     #if HAVE_SYS_PARAM_H
32745       #include <sys/param.h>
32746      #endif
32747"
32748if test "x$ac_cv_header_sys_mount_h" = xyes; then :
32749  cat >>confdefs.h <<_ACEOF
32750#define HAVE_SYS_MOUNT_H 1
32751_ACEOF
32752
32753fi
32754
32755done
32756
32757
32758
32759
32760{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get file system space usage" >&5
32761$as_echo_n "checking how to get file system space usage... " >&6; }
32762ac_fsusage_space=no
32763
32764# Perform only the link test since it seems there are no variants of the
32765# statvfs function.  This check is more than just AC_CHECK_FUNCS([statvfs])
32766# because that got a false positive on SCO OSR5.  Adding the declaration
32767# of a 'struct statvfs' causes this test to fail (as it should) on such
32768# systems.  That system is reported to work fine with STAT_STATFS4 which
32769# is what it gets when this test fails.
32770if test $ac_fsusage_space = no; then
32771  # glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
32772  # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS.
32773  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for statvfs function (SVR4)" >&5
32774$as_echo_n "checking for statvfs function (SVR4)... " >&6; }
32775if ${fu_cv_sys_stat_statvfs+:} false; then :
32776  $as_echo_n "(cached) " >&6
32777else
32778  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32779/* end confdefs.h.  */
32780#include <sys/types.h>
32781#ifdef __osf__
32782"Do not use Tru64's statvfs implementation"
32783#endif
32784
32785#include <sys/statvfs.h>
32786
32787struct statvfs fsd;
32788
32789#if defined __APPLE__ && defined __MACH__
32790#include <limits.h>
32791/* On Mac OS X >= 10.5, f_blocks in 'struct statvfs' is a 32-bit quantity;
32792   that commonly limits file systems to 4 TiB.  Whereas f_blocks in
32793   'struct statfs' is a 64-bit type, thanks to the large-file support
32794   that was enabled above.  In this case, don't use statvfs(); use statfs()
32795   instead.  */
32796int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
32797#endif
32798
32799int
32800main ()
32801{
32802statvfs (0, &fsd);
32803  ;
32804  return 0;
32805}
32806_ACEOF
32807if ac_fn_c_try_link "$LINENO"; then :
32808  fu_cv_sys_stat_statvfs=yes
32809else
32810  fu_cv_sys_stat_statvfs=no
32811fi
32812rm -f core conftest.err conftest.$ac_objext \
32813    conftest$ac_exeext conftest.$ac_ext
32814fi
32815{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statvfs" >&5
32816$as_echo "$fu_cv_sys_stat_statvfs" >&6; }
32817  if test $fu_cv_sys_stat_statvfs = yes; then
32818    ac_fsusage_space=yes
32819    # AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs.
32820    # glibc, HP-UX, IRIX, Solaris have statvfs64 as well, but on these systems
32821    # statvfs with large-file support is already equivalent to statvfs64.
32822    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use statvfs64" >&5
32823$as_echo_n "checking whether to use statvfs64... " >&6; }
32824if ${fu_cv_sys_stat_statvfs64+:} false; then :
32825  $as_echo_n "(cached) " >&6
32826else
32827  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32828/* end confdefs.h.  */
32829#include <sys/types.h>
32830              #include <sys/statvfs.h>
32831              struct statvfs64 fsd;
32832              int check_f_blocks_larger_in_statvfs64
32833                [sizeof (((struct statvfs64 *) 0)->f_blocks)
32834                 > sizeof (((struct statvfs *) 0)->f_blocks)
32835                 ? 1 : -1];
32836
32837int
32838main ()
32839{
32840statvfs64 (0, &fsd);
32841  ;
32842  return 0;
32843}
32844_ACEOF
32845if ac_fn_c_try_link "$LINENO"; then :
32846  fu_cv_sys_stat_statvfs64=yes
32847else
32848  fu_cv_sys_stat_statvfs64=no
32849fi
32850rm -f core conftest.err conftest.$ac_objext \
32851    conftest$ac_exeext conftest.$ac_ext
32852
32853fi
32854{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statvfs64" >&5
32855$as_echo "$fu_cv_sys_stat_statvfs64" >&6; }
32856    if test $fu_cv_sys_stat_statvfs64 = yes; then
32857
32858$as_echo "#define STAT_STATVFS64 1" >>confdefs.h
32859
32860    else
32861
32862$as_echo "#define STAT_STATVFS 1" >>confdefs.h
32863
32864    fi
32865  fi
32866fi
32867
32868# Check for this unconditionally so we have a
32869# good fallback on glibc/Linux > 2.6 < 2.6.36
32870{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.f_frsize member" >&5
32871$as_echo_n "checking for two-argument statfs with statfs.f_frsize member... " >&6; }
32872if ${fu_cv_sys_stat_statfs2_frsize+:} false; then :
32873  $as_echo_n "(cached) " >&6
32874else
32875  if test "$cross_compiling" = yes; then :
32876  fu_cv_sys_stat_statfs2_frsize=no
32877else
32878  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32879/* end confdefs.h.  */
32880
32881#ifdef HAVE_SYS_PARAM_H
32882#include <sys/param.h>
32883#endif
32884#ifdef HAVE_SYS_MOUNT_H
32885#include <sys/mount.h>
32886#endif
32887#ifdef HAVE_SYS_VFS_H
32888#include <sys/vfs.h>
32889#endif
32890  int
32891  main ()
32892  {
32893  struct statfs fsd;
32894  fsd.f_frsize = 0;
32895  return statfs (".", &fsd) != 0;
32896  }
32897_ACEOF
32898if ac_fn_c_try_run "$LINENO"; then :
32899  fu_cv_sys_stat_statfs2_frsize=yes
32900else
32901  fu_cv_sys_stat_statfs2_frsize=no
32902fi
32903rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32904  conftest.$ac_objext conftest.beam conftest.$ac_ext
32905fi
32906
32907fi
32908
32909{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs2_frsize" >&5
32910$as_echo "$fu_cv_sys_stat_statfs2_frsize" >&6; }
32911if test $fu_cv_sys_stat_statfs2_frsize = yes; then
32912    ac_fsusage_space=yes
32913
32914$as_echo "#define STAT_STATFS2_FRSIZE 1" >>confdefs.h
32915
32916fi
32917
32918if test $ac_fsusage_space = no; then
32919  # DEC Alpha running OSF/1
32920  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 3-argument statfs function (DEC OSF/1)" >&5
32921$as_echo_n "checking for 3-argument statfs function (DEC OSF/1)... " >&6; }
32922  if ${fu_cv_sys_stat_statfs3_osf1+:} false; then :
32923  $as_echo_n "(cached) " >&6
32924else
32925  if test "$cross_compiling" = yes; then :
32926  fu_cv_sys_stat_statfs3_osf1=no
32927else
32928  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32929/* end confdefs.h.  */
32930
32931#include <sys/param.h>
32932#include <sys/types.h>
32933#include <sys/mount.h>
32934  int
32935  main ()
32936  {
32937    struct statfs fsd;
32938    fsd.f_fsize = 0;
32939    return statfs (".", &fsd, sizeof (struct statfs)) != 0;
32940  }
32941_ACEOF
32942if ac_fn_c_try_run "$LINENO"; then :
32943  fu_cv_sys_stat_statfs3_osf1=yes
32944else
32945  fu_cv_sys_stat_statfs3_osf1=no
32946fi
32947rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32948  conftest.$ac_objext conftest.beam conftest.$ac_ext
32949fi
32950
32951fi
32952
32953  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs3_osf1" >&5
32954$as_echo "$fu_cv_sys_stat_statfs3_osf1" >&6; }
32955  if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
32956    ac_fsusage_space=yes
32957
32958$as_echo "#define STAT_STATFS3_OSF1 1" >>confdefs.h
32959
32960  fi
32961fi
32962
32963if test $ac_fsusage_space = no; then
32964  # glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4.
32965  # (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
32966  # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.)
32967  # (On IRIX you need to include <sys/statfs.h>, not only <sys/mount.h> and
32968  # <sys/vfs.h>.)
32969  # (On Solaris, statfs has 4 arguments.)
32970  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)" >&5
32971$as_echo_n "checking for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)... " >&6; }
32972  if ${fu_cv_sys_stat_statfs2_bsize+:} false; then :
32973  $as_echo_n "(cached) " >&6
32974else
32975  if test "$cross_compiling" = yes; then :
32976  fu_cv_sys_stat_statfs2_bsize=no
32977else
32978  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32979/* end confdefs.h.  */
32980
32981#ifdef HAVE_SYS_PARAM_H
32982#include <sys/param.h>
32983#endif
32984#ifdef HAVE_SYS_MOUNT_H
32985#include <sys/mount.h>
32986#endif
32987#ifdef HAVE_SYS_VFS_H
32988#include <sys/vfs.h>
32989#endif
32990  int
32991  main ()
32992  {
32993  struct statfs fsd;
32994  fsd.f_bsize = 0;
32995  return statfs (".", &fsd) != 0;
32996  }
32997_ACEOF
32998if ac_fn_c_try_run "$LINENO"; then :
32999  fu_cv_sys_stat_statfs2_bsize=yes
33000else
33001  fu_cv_sys_stat_statfs2_bsize=no
33002fi
33003rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
33004  conftest.$ac_objext conftest.beam conftest.$ac_ext
33005fi
33006
33007fi
33008
33009  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs2_bsize" >&5
33010$as_echo "$fu_cv_sys_stat_statfs2_bsize" >&6; }
33011  if test $fu_cv_sys_stat_statfs2_bsize = yes; then
33012    ac_fsusage_space=yes
33013
33014$as_echo "#define STAT_STATFS2_BSIZE 1" >>confdefs.h
33015
33016  fi
33017fi
33018
33019if test $ac_fsusage_space = no; then
33020  # SVR3
33021  # (Solaris already handled above.)
33022  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5
33023$as_echo_n "checking for four-argument statfs (AIX-3.2.5, SVR3)... " >&6; }
33024  if ${fu_cv_sys_stat_statfs4+:} false; then :
33025  $as_echo_n "(cached) " >&6
33026else
33027  if test "$cross_compiling" = yes; then :
33028  fu_cv_sys_stat_statfs4=no
33029else
33030  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33031/* end confdefs.h.  */
33032
33033#include <sys/types.h>
33034#include <sys/statfs.h>
33035  int
33036  main ()
33037  {
33038  struct statfs fsd;
33039  return statfs (".", &fsd, sizeof fsd, 0) != 0;
33040  }
33041_ACEOF
33042if ac_fn_c_try_run "$LINENO"; then :
33043  fu_cv_sys_stat_statfs4=yes
33044else
33045  fu_cv_sys_stat_statfs4=no
33046fi
33047rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
33048  conftest.$ac_objext conftest.beam conftest.$ac_ext
33049fi
33050
33051fi
33052
33053  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs4" >&5
33054$as_echo "$fu_cv_sys_stat_statfs4" >&6; }
33055  if test $fu_cv_sys_stat_statfs4 = yes; then
33056    ac_fsusage_space=yes
33057
33058$as_echo "#define STAT_STATFS4 1" >>confdefs.h
33059
33060  fi
33061fi
33062
33063if test $ac_fsusage_space = no; then
33064  # 4.4BSD and older NetBSD
33065  # (OSF/1 already handled above.)
33066  # (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.)
33067  # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in
33068  # <sys/mount.h>.)
33069  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.f_fsize member (4.4BSD and NetBSD)" >&5
33070$as_echo_n "checking for two-argument statfs with statfs.f_fsize member (4.4BSD and NetBSD)... " >&6; }
33071  if ${fu_cv_sys_stat_statfs2_fsize+:} false; then :
33072  $as_echo_n "(cached) " >&6
33073else
33074  if test "$cross_compiling" = yes; then :
33075  fu_cv_sys_stat_statfs2_fsize=no
33076else
33077  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33078/* end confdefs.h.  */
33079
33080#include <sys/types.h>
33081#ifdef HAVE_SYS_PARAM_H
33082#include <sys/param.h>
33083#endif
33084#ifdef HAVE_SYS_MOUNT_H
33085#include <sys/mount.h>
33086#endif
33087  int
33088  main ()
33089  {
33090  struct statfs fsd;
33091  fsd.f_fsize = 0;
33092  return statfs (".", &fsd) != 0;
33093  }
33094_ACEOF
33095if ac_fn_c_try_run "$LINENO"; then :
33096  fu_cv_sys_stat_statfs2_fsize=yes
33097else
33098  fu_cv_sys_stat_statfs2_fsize=no
33099fi
33100rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
33101  conftest.$ac_objext conftest.beam conftest.$ac_ext
33102fi
33103
33104fi
33105
33106  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs2_fsize" >&5
33107$as_echo "$fu_cv_sys_stat_statfs2_fsize" >&6; }
33108  if test $fu_cv_sys_stat_statfs2_fsize = yes; then
33109    ac_fsusage_space=yes
33110
33111$as_echo "#define STAT_STATFS2_FSIZE 1" >>confdefs.h
33112
33113  fi
33114fi
33115
33116if test $ac_fsusage_space = no; then
33117  # Ultrix
33118  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with struct fs_data (Ultrix)" >&5
33119$as_echo_n "checking for two-argument statfs with struct fs_data (Ultrix)... " >&6; }
33120  if ${fu_cv_sys_stat_fs_data+:} false; then :
33121  $as_echo_n "(cached) " >&6
33122else
33123  if test "$cross_compiling" = yes; then :
33124  fu_cv_sys_stat_fs_data=no
33125else
33126  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33127/* end confdefs.h.  */
33128
33129#include <sys/types.h>
33130#ifdef HAVE_SYS_PARAM_H
33131#include <sys/param.h>
33132#endif
33133#ifdef HAVE_SYS_MOUNT_H
33134#include <sys/mount.h>
33135#endif
33136#ifdef HAVE_SYS_FS_TYPES_H
33137#include <sys/fs_types.h>
33138#endif
33139  int
33140  main ()
33141  {
33142  struct fs_data fsd;
33143  /* Ultrix's statfs returns 1 for success,
33144     0 for not mounted, -1 for failure.  */
33145  return statfs (".", &fsd) != 1;
33146  }
33147_ACEOF
33148if ac_fn_c_try_run "$LINENO"; then :
33149  fu_cv_sys_stat_fs_data=yes
33150else
33151  fu_cv_sys_stat_fs_data=no
33152fi
33153rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
33154  conftest.$ac_objext conftest.beam conftest.$ac_ext
33155fi
33156
33157fi
33158
33159  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_fs_data" >&5
33160$as_echo "$fu_cv_sys_stat_fs_data" >&6; }
33161  if test $fu_cv_sys_stat_fs_data = yes; then
33162    ac_fsusage_space=yes
33163
33164$as_echo "#define STAT_STATFS2_FS_DATA 1" >>confdefs.h
33165
33166  fi
33167fi
33168
33169if test $ac_fsusage_space = yes; then :
33170  gl_cv_fs_space=yes
33171else
33172  gl_cv_fs_space=no
33173fi
33174
33175
33176
33177  if test $gl_cv_fs_space = yes; then
33178
33179
33180
33181
33182
33183
33184
33185
33186  gl_LIBOBJS="$gl_LIBOBJS fsusage.$ac_objext"
33187
33188
33189  for ac_header in dustat.h sys/fs/s5param.h sys/statfs.h
33190do :
33191  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
33192ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
33193if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
33194  cat >>confdefs.h <<_ACEOF
33195#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
33196_ACEOF
33197
33198fi
33199
33200done
33201
33202
33203  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for statfs that truncates block counts" >&5
33204$as_echo_n "checking for statfs that truncates block counts... " >&6; }
33205  if ${fu_cv_sys_truncating_statfs+:} false; then :
33206  $as_echo_n "(cached) " >&6
33207else
33208  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33209/* end confdefs.h.  */
33210
33211#if !defined(sun) && !defined(__sun)
33212choke -- this is a workaround for a Sun-specific problem
33213#endif
33214#include <sys/types.h>
33215#include <sys/vfs.h>
33216int
33217main ()
33218{
33219struct statfs t; long c = *(t.f_spare);
33220        if (c) return 0;
33221  ;
33222  return 0;
33223}
33224_ACEOF
33225if ac_fn_c_try_compile "$LINENO"; then :
33226  fu_cv_sys_truncating_statfs=yes
33227else
33228  fu_cv_sys_truncating_statfs=no
33229fi
33230rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33231fi
33232
33233  if test $fu_cv_sys_truncating_statfs = yes; then
33234
33235$as_echo "#define STATFS_TRUNCATES_BLOCK_COUNTS 1" >>confdefs.h
33236
33237  fi
33238  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_truncating_statfs" >&5
33239$as_echo "$fu_cv_sys_truncating_statfs" >&6; }
33240
33241
33242  fi
33243
33244
33245
33246  if test $ac_cv_func_fsync = no; then
33247    HAVE_FSYNC=0
33248  fi
33249
33250  if test $HAVE_FSYNC = 0; then
33251
33252
33253
33254
33255
33256
33257
33258
33259  gl_LIBOBJS="$gl_LIBOBJS fsync.$ac_objext"
33260
33261    :
33262  fi
33263
33264
33265
33266
33267
33268          GNULIB_FSYNC=1
33269
33270
33271
33272
33273
33274$as_echo "#define GNULIB_TEST_FSYNC 1" >>confdefs.h
33275
33276
33277
33278
33279
33280
33281    if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
33282    REPLACE_FTELL=1
33283  fi
33284
33285  if test $REPLACE_FTELL = 1; then
33286
33287
33288
33289
33290
33291
33292
33293
33294  gl_LIBOBJS="$gl_LIBOBJS ftell.$ac_objext"
33295
33296  fi
33297
33298
33299
33300
33301
33302          GNULIB_FTELL=1
33303
33304
33305
33306
33307
33308$as_echo "#define GNULIB_TEST_FTELL 1" >>confdefs.h
33309
33310
33311
33312
33313
33314
33315
33316
33317
33318
33319
33320
33321  if test $ac_cv_have_decl_ftello = no; then
33322    HAVE_DECL_FTELLO=0
33323  fi
33324
33325  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
33326$as_echo_n "checking for ftello... " >&6; }
33327if ${gl_cv_func_ftello+:} false; then :
33328  $as_echo_n "(cached) " >&6
33329else
33330
33331      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33332/* end confdefs.h.  */
33333#include <stdio.h>
33334int
33335main ()
33336{
33337ftello (stdin);
33338  ;
33339  return 0;
33340}
33341_ACEOF
33342if ac_fn_c_try_link "$LINENO"; then :
33343  gl_cv_func_ftello=yes
33344else
33345  gl_cv_func_ftello=no
33346fi
33347rm -f core conftest.err conftest.$ac_objext \
33348    conftest$ac_exeext conftest.$ac_ext
33349
33350fi
33351{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
33352$as_echo "$gl_cv_func_ftello" >&6; }
33353  if test $gl_cv_func_ftello = no; then
33354    HAVE_FTELLO=0
33355  else
33356    if test $WINDOWS_64_BIT_OFF_T = 1; then
33357      REPLACE_FTELLO=1
33358    fi
33359    if test $gl_cv_var_stdin_large_offset = no; then
33360      REPLACE_FTELLO=1
33361    fi
33362    if test $REPLACE_FTELLO = 0; then
33363
33364      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ftello works" >&5
33365$as_echo_n "checking whether ftello works... " >&6; }
33366if ${gl_cv_func_ftello_works+:} false; then :
33367  $as_echo_n "(cached) " >&6
33368else
33369
33370                              case "$host_os" in
33371                      # Guess no on Solaris.
33372            solaris*) gl_cv_func_ftello_works="guessing no" ;;
33373                      # Guess yes on native Windows.
33374            mingw*)   gl_cv_func_ftello_works="guessing yes" ;;
33375                      # Guess yes otherwise.
33376            *)        gl_cv_func_ftello_works="guessing yes" ;;
33377          esac
33378          if test "$cross_compiling" = yes; then :
33379  :
33380else
33381  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33382/* end confdefs.h.  */
33383
33384#include <stdio.h>
33385#include <stdlib.h>
33386#include <string.h>
33387#define TESTFILE "conftest.tmp"
33388int
33389main (void)
33390{
33391  FILE *fp;
33392
33393  /* Create a file with some contents.  */
33394  fp = fopen (TESTFILE, "w");
33395  if (fp == NULL)
33396    return 70;
33397  if (fwrite ("foogarsh", 1, 8, fp) < 8)
33398    { fclose (fp); return 71; }
33399  if (fclose (fp))
33400    return 72;
33401
33402  /* The file's contents is now "foogarsh".  */
33403
33404  /* Try writing after reading to EOF.  */
33405  fp = fopen (TESTFILE, "r+");
33406  if (fp == NULL)
33407    return 73;
33408  if (fseek (fp, -1, SEEK_END))
33409    { fclose (fp); return 74; }
33410  if (!(getc (fp) == 'h'))
33411    { fclose (fp); return 1; }
33412  if (!(getc (fp) == EOF))
33413    { fclose (fp); return 2; }
33414  if (!(ftell (fp) == 8))
33415    { fclose (fp); return 3; }
33416  if (!(ftell (fp) == 8))
33417    { fclose (fp); return 4; }
33418  if (!(putc ('!', fp) == '!'))
33419    { fclose (fp); return 5; }
33420  if (!(ftell (fp) == 9))
33421    { fclose (fp); return 6; }
33422  if (!(fclose (fp) == 0))
33423    return 7;
33424  fp = fopen (TESTFILE, "r");
33425  if (fp == NULL)
33426    return 75;
33427  {
33428    char buf[10];
33429    if (!(fread (buf, 1, 10, fp) == 9))
33430      { fclose (fp); return 10; }
33431    if (!(memcmp (buf, "foogarsh!", 9) == 0))
33432      { fclose (fp); return 11; }
33433  }
33434  if (!(fclose (fp) == 0))
33435    return 12;
33436
33437  /* The file's contents is now "foogarsh!".  */
33438
33439  return 0;
33440}
33441_ACEOF
33442if ac_fn_c_try_run "$LINENO"; then :
33443  gl_cv_func_ftello_works=yes
33444else
33445  gl_cv_func_ftello_works=no
33446fi
33447rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
33448  conftest.$ac_objext conftest.beam conftest.$ac_ext
33449fi
33450
33451
33452fi
33453{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello_works" >&5
33454$as_echo "$gl_cv_func_ftello_works" >&6; }
33455      case "$gl_cv_func_ftello_works" in
33456        *yes) ;;
33457        *)
33458          REPLACE_FTELLO=1
33459
33460$as_echo "#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1" >>confdefs.h
33461
33462          ;;
33463      esac
33464    fi
33465  fi
33466
33467  if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
33468
33469
33470
33471
33472
33473
33474
33475
33476  gl_LIBOBJS="$gl_LIBOBJS ftello.$ac_objext"
33477
33478
33479      for ac_func in _ftelli64
33480do :
33481  ac_fn_c_check_func "$LINENO" "_ftelli64" "ac_cv_func__ftelli64"
33482if test "x$ac_cv_func__ftelli64" = xyes; then :
33483  cat >>confdefs.h <<_ACEOF
33484#define HAVE__FTELLI64 1
33485_ACEOF
33486
33487fi
33488done
33489
33490
33491  fi
33492
33493
33494
33495
33496
33497          GNULIB_FTELLO=1
33498
33499
33500
33501
33502
33503$as_echo "#define GNULIB_TEST_FTELLO 1" >>confdefs.h
33504
33505
33506
33507
33508
33509
33510
33511
33512  if test $ac_cv_func_ftruncate = yes; then
33513
33514
33515      case "$host_os" in
33516        mingw*)
33517                                                                      REPLACE_FTRUNCATE=1
33518          ;;
33519      esac
33520
33521  else
33522    HAVE_FTRUNCATE=0
33523  fi
33524
33525  if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then
33526
33527
33528
33529
33530
33531
33532
33533
33534  gl_LIBOBJS="$gl_LIBOBJS ftruncate.$ac_objext"
33535
33536
33537  for ac_func in chsize
33538do :
33539  ac_fn_c_check_func "$LINENO" "chsize" "ac_cv_func_chsize"
33540if test "x$ac_cv_func_chsize" = xyes; then :
33541  cat >>confdefs.h <<_ACEOF
33542#define HAVE_CHSIZE 1
33543_ACEOF
33544
33545fi
33546done
33547
33548
33549  fi
33550
33551
33552
33553
33554
33555          GNULIB_FTRUNCATE=1
33556
33557
33558
33559
33560
33561$as_echo "#define GNULIB_TEST_FTRUNCATE 1" >>confdefs.h
33562
33563
33564
33565
33566
33567
33568
33569
33570
33571
33572
33573  case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
33574  yes+*yes+yes)
33575    ;;
33576  yes+*)
33577    # Solaris 10 lacks O_CLOEXEC.
33578    # Solaris 9 has *at functions, but uniformly mishandles trailing
33579    # slash in all of them.
33580    REPLACE_OPENAT=1
33581    ;;
33582  *)
33583    HAVE_OPENAT=0
33584    ;;
33585  esac
33586
33587
33588
33589    if test "$ac_cv_func_fstatfs,$ac_cv_header_sys_vfs_h" = yes,yes; then
33590    ac_fn_c_check_member "$LINENO" "struct statfs" "f_type" "ac_cv_member_struct_statfs_f_type" "$ac_includes_default
33591        #include <sys/vfs.h>
33592
33593"
33594if test "x$ac_cv_member_struct_statfs_f_type" = xyes; then :
33595
33596cat >>confdefs.h <<_ACEOF
33597#define HAVE_STRUCT_STATFS_F_TYPE 1
33598_ACEOF
33599
33600
33601fi
33602
33603    if test "$ac_cv_member_struct_statfs_f_type" = yes; then
33604      ac_fn_c_check_type "$LINENO" "__fsword_t" "ac_cv_type___fsword_t" "$ac_includes_default
33605          #include <sys/vfs.h>
33606
33607"
33608if test "x$ac_cv_type___fsword_t" = xyes; then :
33609
33610cat >>confdefs.h <<_ACEOF
33611#define HAVE___FSWORD_T 1
33612_ACEOF
33613
33614
33615fi
33616
33617    fi
33618  fi
33619
33620
33621
33622
33623
33624
33625
33626
33627
33628
33629  gl_LIBOBJS="$gl_LIBOBJS fts.$ac_objext"
33630
33631
33632
33633
33634
33635  if test $ac_cv_func_futimens = no; then
33636    HAVE_FUTIMENS=0
33637  else
33638    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether futimens works" >&5
33639$as_echo_n "checking whether futimens works... " >&6; }
33640if ${gl_cv_func_futimens_works+:} false; then :
33641  $as_echo_n "(cached) " >&6
33642else
33643  if test "$cross_compiling" = yes; then :
33644  gl_cv_func_futimens_works="guessing yes"
33645else
33646  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33647/* end confdefs.h.  */
33648
33649#include <fcntl.h>
33650#include <sys/stat.h>
33651#include <unistd.h>
33652#include <errno.h>
33653
33654int
33655main ()
33656{
33657struct timespec ts[2];
33658      int fd = creat ("conftest.file", 0600);
33659      struct stat st;
33660      if (fd < 0) return 1;
33661      ts[0].tv_sec = 1;
33662      ts[0].tv_nsec = UTIME_OMIT;
33663      ts[1].tv_sec = 1;
33664      ts[1].tv_nsec = UTIME_NOW;
33665      errno = 0;
33666      if (futimens (AT_FDCWD, NULL) == 0) return 2;
33667      if (errno != EBADF) return 3;
33668      if (futimens (fd, ts)) return 4;
33669      sleep (1);
33670      ts[0].tv_nsec = UTIME_NOW;
33671      ts[1].tv_nsec = UTIME_OMIT;
33672      if (futimens (fd, ts)) return 5;
33673      if (fstat (fd, &st)) return 6;
33674      if (st.st_ctime < st.st_atime) return 7;
33675
33676  ;
33677  return 0;
33678}
33679_ACEOF
33680if ac_fn_c_try_run "$LINENO"; then :
33681  gl_cv_func_futimens_works=yes
33682else
33683  gl_cv_func_futimens_works=no
33684fi
33685rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
33686  conftest.$ac_objext conftest.beam conftest.$ac_ext
33687fi
33688
33689      rm -f conftest.file
33690fi
33691{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_futimens_works" >&5
33692$as_echo "$gl_cv_func_futimens_works" >&6; }
33693    if test "$gl_cv_func_futimens_works" = no; then
33694      REPLACE_FUTIMENS=1
33695    fi
33696  fi
33697
33698  if test $HAVE_FUTIMENS = 0 || test $REPLACE_FUTIMENS = 1; then
33699
33700
33701
33702
33703
33704
33705
33706
33707  gl_LIBOBJS="$gl_LIBOBJS futimens.$ac_objext"
33708
33709  fi
33710
33711
33712
33713
33714
33715          GNULIB_FUTIMENS=1
33716
33717
33718
33719
33720
33721$as_echo "#define GNULIB_TEST_FUTIMENS 1" >>confdefs.h
33722
33723
33724
33725
33726      { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5
33727$as_echo_n "checking how to do getaddrinfo, freeaddrinfo and getnameinfo... " >&6; }
33728  GETADDRINFO_LIB=
33729  gai_saved_LIBS="$LIBS"
33730
33731              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5
33732$as_echo_n "checking for library containing getaddrinfo... " >&6; }
33733if ${ac_cv_search_getaddrinfo+:} false; then :
33734  $as_echo_n "(cached) " >&6
33735else
33736  ac_func_search_save_LIBS=$LIBS
33737cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33738/* end confdefs.h.  */
33739
33740/* Override any GCC internal prototype to avoid an error.
33741   Use char because int might match the return type of a GCC
33742   builtin and then its argument prototype would still apply.  */
33743#ifdef __cplusplus
33744extern "C"
33745#endif
33746char getaddrinfo ();
33747int
33748main ()
33749{
33750return getaddrinfo ();
33751  ;
33752  return 0;
33753}
33754_ACEOF
33755for ac_lib in '' socket network net; do
33756  if test -z "$ac_lib"; then
33757    ac_res="none required"
33758  else
33759    ac_res=-l$ac_lib
33760    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
33761  fi
33762  if ac_fn_c_try_link "$LINENO"; then :
33763  ac_cv_search_getaddrinfo=$ac_res
33764fi
33765rm -f core conftest.err conftest.$ac_objext \
33766    conftest$ac_exeext
33767  if ${ac_cv_search_getaddrinfo+:} false; then :
33768  break
33769fi
33770done
33771if ${ac_cv_search_getaddrinfo+:} false; then :
33772
33773else
33774  ac_cv_search_getaddrinfo=no
33775fi
33776rm conftest.$ac_ext
33777LIBS=$ac_func_search_save_LIBS
33778fi
33779{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5
33780$as_echo "$ac_cv_search_getaddrinfo" >&6; }
33781ac_res=$ac_cv_search_getaddrinfo
33782if test "$ac_res" != no; then :
33783  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
33784  if test "$ac_cv_search_getaddrinfo" != "none required"; then
33785       GETADDRINFO_LIB="$ac_cv_search_getaddrinfo"
33786     fi
33787fi
33788
33789  LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
33790
33791  HAVE_GETADDRINFO=1
33792  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5
33793$as_echo_n "checking for getaddrinfo... " >&6; }
33794if ${gl_cv_func_getaddrinfo+:} false; then :
33795  $as_echo_n "(cached) " >&6
33796else
33797
33798    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33799/* end confdefs.h.  */
33800
33801#include <sys/types.h>
33802#ifdef HAVE_SYS_SOCKET_H
33803#include <sys/socket.h>
33804#endif
33805#ifdef HAVE_NETDB_H
33806#include <netdb.h>
33807#endif
33808#include <stddef.h>
33809
33810int
33811main ()
33812{
33813getaddrinfo("", "", NULL, NULL);
33814  ;
33815  return 0;
33816}
33817_ACEOF
33818if ac_fn_c_try_link "$LINENO"; then :
33819  gl_cv_func_getaddrinfo=yes
33820else
33821  gl_cv_func_getaddrinfo=no
33822fi
33823rm -f core conftest.err conftest.$ac_objext \
33824    conftest$ac_exeext conftest.$ac_ext
33825fi
33826{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getaddrinfo" >&5
33827$as_echo "$gl_cv_func_getaddrinfo" >&6; }
33828  if test $gl_cv_func_getaddrinfo = no; then
33829    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5
33830$as_echo_n "checking for getaddrinfo in ws2tcpip.h and -lws2_32... " >&6; }
33831if ${gl_cv_w32_getaddrinfo+:} false; then :
33832  $as_echo_n "(cached) " >&6
33833else
33834
33835      gl_cv_w32_getaddrinfo=no
33836      am_save_LIBS="$LIBS"
33837      LIBS="$LIBS -lws2_32"
33838      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33839/* end confdefs.h.  */
33840
33841#ifdef HAVE_WS2TCPIP_H
33842#include <ws2tcpip.h>
33843#endif
33844#include <stddef.h>
33845
33846int
33847main ()
33848{
33849getaddrinfo(NULL, NULL, NULL, NULL);
33850  ;
33851  return 0;
33852}
33853_ACEOF
33854if ac_fn_c_try_link "$LINENO"; then :
33855  gl_cv_w32_getaddrinfo=yes
33856fi
33857rm -f core conftest.err conftest.$ac_objext \
33858    conftest$ac_exeext conftest.$ac_ext
33859      LIBS="$am_save_LIBS"
33860
33861fi
33862{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_getaddrinfo" >&5
33863$as_echo "$gl_cv_w32_getaddrinfo" >&6; }
33864    if test "$gl_cv_w32_getaddrinfo" = "yes"; then
33865      GETADDRINFO_LIB="-lws2_32"
33866      LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
33867    else
33868      HAVE_GETADDRINFO=0
33869    fi
33870  fi
33871
33872  # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
33873  # inline function declared in ws2tcpip.h, so we need to get that
33874  # header included somehow.
33875  ac_fn_c_check_decl "$LINENO" "gai_strerror" "ac_cv_have_decl_gai_strerror" "
33876#include <sys/types.h>
33877#ifdef HAVE_SYS_SOCKET_H
33878#include <sys/socket.h>
33879#endif
33880#ifdef HAVE_NETDB_H
33881#include <netdb.h>
33882#endif
33883#ifdef HAVE_WS2TCPIP_H
33884#include <ws2tcpip.h>
33885#endif
33886#include <stddef.h>
33887
33888"
33889if test "x$ac_cv_have_decl_gai_strerror" = xyes; then :
33890  ac_have_decl=1
33891else
33892  ac_have_decl=0
33893fi
33894
33895cat >>confdefs.h <<_ACEOF
33896#define HAVE_DECL_GAI_STRERROR $ac_have_decl
33897_ACEOF
33898
33899  if test $ac_cv_have_decl_gai_strerror = yes; then
33900    ac_fn_c_check_decl "$LINENO" "gai_strerrorA" "ac_cv_have_decl_gai_strerrorA" "
33901#include <sys/types.h>
33902#ifdef HAVE_SYS_SOCKET_H
33903#include <sys/socket.h>
33904#endif
33905#ifdef HAVE_NETDB_H
33906#include <netdb.h>
33907#endif
33908#ifdef HAVE_WS2TCPIP_H
33909#include <ws2tcpip.h>
33910#endif
33911#include <stddef.h>
33912
33913"
33914if test "x$ac_cv_have_decl_gai_strerrorA" = xyes; then :
33915  ac_have_decl=1
33916else
33917  ac_have_decl=0
33918fi
33919
33920cat >>confdefs.h <<_ACEOF
33921#define HAVE_DECL_GAI_STRERRORA $ac_have_decl
33922_ACEOF
33923
33924        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gai_strerror with POSIX signature" >&5
33925$as_echo_n "checking for gai_strerror with POSIX signature... " >&6; }
33926if ${gl_cv_func_gai_strerror_posix_signature+:} false; then :
33927  $as_echo_n "(cached) " >&6
33928else
33929
33930      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33931/* end confdefs.h.  */
33932
33933#include <sys/types.h>
33934#ifdef HAVE_SYS_SOCKET_H
33935#include <sys/socket.h>
33936#endif
33937#ifdef HAVE_NETDB_H
33938#include <netdb.h>
33939#endif
33940#ifdef HAVE_WS2TCPIP_H
33941#include <ws2tcpip.h>
33942#endif
33943#include <stddef.h>
33944extern
33945#ifdef __cplusplus
33946"C"
33947#endif
33948const char *gai_strerror(int);
33949_ACEOF
33950if ac_fn_c_try_compile "$LINENO"; then :
33951  gl_cv_func_gai_strerror_posix_signature=yes
33952else
33953  gl_cv_func_gai_strerror_posix_signature=no
33954fi
33955rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33956fi
33957{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gai_strerror_posix_signature" >&5
33958$as_echo "$gl_cv_func_gai_strerror_posix_signature" >&6; }
33959    if test $gl_cv_func_gai_strerror_posix_signature = no; then
33960      REPLACE_GAI_STRERROR=1
33961    fi
33962  fi
33963
33964  LIBS="$gai_saved_LIBS"
33965
33966
33967
33968
33969
33970
33971
33972
33973      ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "
33974#include <sys/types.h>
33975#include <sys/socket.h>
33976
33977"
33978if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
33979
33980cat >>confdefs.h <<_ACEOF
33981#define HAVE_STRUCT_SOCKADDR_SA_LEN 1
33982_ACEOF
33983
33984
33985fi
33986
33987
33988
33989
33990  ac_fn_c_check_decl "$LINENO" "getaddrinfo" "ac_cv_have_decl_getaddrinfo" "
33991  /* sys/types.h is not needed according to POSIX, but the
33992     sys/socket.h in i386-unknown-freebsd4.10 and
33993     powerpc-apple-darwin5.5 required it. */
33994#include <sys/types.h>
33995#ifdef HAVE_SYS_SOCKET_H
33996#include <sys/socket.h>
33997#endif
33998#ifdef HAVE_NETDB_H
33999#include <netdb.h>
34000#endif
34001#ifdef HAVE_WS2TCPIP_H
34002#include <ws2tcpip.h>
34003#endif
34004
34005"
34006if test "x$ac_cv_have_decl_getaddrinfo" = xyes; then :
34007  ac_have_decl=1
34008else
34009  ac_have_decl=0
34010fi
34011
34012cat >>confdefs.h <<_ACEOF
34013#define HAVE_DECL_GETADDRINFO $ac_have_decl
34014_ACEOF
34015ac_fn_c_check_decl "$LINENO" "freeaddrinfo" "ac_cv_have_decl_freeaddrinfo" "
34016  /* sys/types.h is not needed according to POSIX, but the
34017     sys/socket.h in i386-unknown-freebsd4.10 and
34018     powerpc-apple-darwin5.5 required it. */
34019#include <sys/types.h>
34020#ifdef HAVE_SYS_SOCKET_H
34021#include <sys/socket.h>
34022#endif
34023#ifdef HAVE_NETDB_H
34024#include <netdb.h>
34025#endif
34026#ifdef HAVE_WS2TCPIP_H
34027#include <ws2tcpip.h>
34028#endif
34029
34030"
34031if test "x$ac_cv_have_decl_freeaddrinfo" = xyes; then :
34032  ac_have_decl=1
34033else
34034  ac_have_decl=0
34035fi
34036
34037cat >>confdefs.h <<_ACEOF
34038#define HAVE_DECL_FREEADDRINFO $ac_have_decl
34039_ACEOF
34040ac_fn_c_check_decl "$LINENO" "getnameinfo" "ac_cv_have_decl_getnameinfo" "
34041  /* sys/types.h is not needed according to POSIX, but the
34042     sys/socket.h in i386-unknown-freebsd4.10 and
34043     powerpc-apple-darwin5.5 required it. */
34044#include <sys/types.h>
34045#ifdef HAVE_SYS_SOCKET_H
34046#include <sys/socket.h>
34047#endif
34048#ifdef HAVE_NETDB_H
34049#include <netdb.h>
34050#endif
34051#ifdef HAVE_WS2TCPIP_H
34052#include <ws2tcpip.h>
34053#endif
34054
34055"
34056if test "x$ac_cv_have_decl_getnameinfo" = xyes; then :
34057  ac_have_decl=1
34058else
34059  ac_have_decl=0
34060fi
34061
34062cat >>confdefs.h <<_ACEOF
34063#define HAVE_DECL_GETNAMEINFO $ac_have_decl
34064_ACEOF
34065
34066  if test $ac_cv_have_decl_getaddrinfo = no; then
34067    HAVE_DECL_GETADDRINFO=0
34068  fi
34069  if test $ac_cv_have_decl_freeaddrinfo = no; then
34070    HAVE_DECL_FREEADDRINFO=0
34071  fi
34072  if test $ac_cv_have_decl_gai_strerror = no; then
34073    HAVE_DECL_GAI_STRERROR=0
34074  fi
34075  if test $ac_cv_have_decl_getnameinfo = no; then
34076    HAVE_DECL_GETNAMEINFO=0
34077  fi
34078
34079  ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "
34080#include <sys/types.h>
34081#ifdef HAVE_SYS_SOCKET_H
34082#include <sys/socket.h>
34083#endif
34084#ifdef HAVE_NETDB_H
34085#include <netdb.h>
34086#endif
34087#ifdef HAVE_WS2TCPIP_H
34088#include <ws2tcpip.h>
34089#endif
34090
34091"
34092if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
34093
34094cat >>confdefs.h <<_ACEOF
34095#define HAVE_STRUCT_ADDRINFO 1
34096_ACEOF
34097
34098
34099fi
34100
34101  if test $ac_cv_type_struct_addrinfo = no; then
34102    HAVE_STRUCT_ADDRINFO=0
34103  fi
34104
34105    case " $GETADDRINFO_LIB " in
34106    *" $HOSTENT_LIB "*) ;;
34107    *) GETADDRINFO_LIB="$GETADDRINFO_LIB $HOSTENT_LIB" ;;
34108  esac
34109
34110    case " $GETADDRINFO_LIB " in
34111    *" $SERVENT_LIB "*) ;;
34112    *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;;
34113  esac
34114
34115    case " $GETADDRINFO_LIB " in
34116    *" $INET_NTOP_LIB "*) ;;
34117    *) GETADDRINFO_LIB="$GETADDRINFO_LIB $INET_NTOP_LIB" ;;
34118  esac
34119
34120
34121
34122
34123  if test $HAVE_GETADDRINFO = 0; then
34124
34125
34126
34127
34128
34129
34130
34131
34132  gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext"
34133
34134  fi
34135  if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then
34136
34137
34138
34139
34140
34141
34142
34143
34144  gl_LIBOBJS="$gl_LIBOBJS gai_strerror.$ac_objext"
34145
34146  fi
34147
34148
34149
34150
34151
34152          GNULIB_GETADDRINFO=1
34153
34154
34155
34156
34157
34158$as_echo "#define GNULIB_TEST_GETADDRINFO 1" >>confdefs.h
34159
34160
34161
34162
34163
34164
34165
34166
34167  gl_abort_bug=no
34168  case "$host_os" in
34169    mingw*)
34170      gl_cv_func_getcwd_path_max=yes
34171      ;;
34172    *)
34173
34174
34175
34176
34177
34178  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5
34179$as_echo_n "checking whether getcwd handles long file names properly... " >&6; }
34180if ${gl_cv_func_getcwd_path_max+:} false; then :
34181  $as_echo_n "(cached) " >&6
34182else
34183  # Arrange for deletion of the temporary directory this test creates.
34184     ac_clean_files="$ac_clean_files confdir3"
34185          if test "$cross_compiling" = yes; then :
34186  case "$host_os" in
34187          aix*) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
34188          *) gl_cv_func_getcwd_path_max=no;;
34189        esac
34190else
34191  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34192/* end confdefs.h.  */
34193
34194#include <errno.h>
34195#include <stdlib.h>
34196#if HAVE_UNISTD_H
34197# include <unistd.h>
34198#else
34199# include <direct.h>
34200#endif
34201#include <string.h>
34202#include <limits.h>
34203#include <sys/stat.h>
34204#include <sys/types.h>
34205#include <fcntl.h>
34206
34207
34208/* Arrange to define PATH_MAX, like "pathmax.h" does. */
34209#if HAVE_UNISTD_H
34210# include <unistd.h>
34211#endif
34212#include <limits.h>
34213#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
34214# include <sys/param.h>
34215#endif
34216#if !defined PATH_MAX && defined MAXPATHLEN
34217# define PATH_MAX MAXPATHLEN
34218#endif
34219#ifdef __hpux
34220# undef PATH_MAX
34221# define PATH_MAX 1024
34222#endif
34223#if defined _WIN32 && ! defined __CYGWIN__
34224# undef PATH_MAX
34225# define PATH_MAX 260
34226#endif
34227
34228
34229#ifndef AT_FDCWD
34230# define AT_FDCWD 0
34231#endif
34232#ifdef ENAMETOOLONG
34233# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
34234#else
34235# define is_ENAMETOOLONG(x) 0
34236#endif
34237
34238/* Use the getcwd function, not any macro.  */
34239#undef getcwd
34240
34241/* Don't get link errors because mkdir is redefined to rpl_mkdir.  */
34242#undef mkdir
34243
34244#ifndef S_IRWXU
34245# define S_IRWXU 0700
34246#endif
34247
34248/* The length of this name must be 8.  */
34249#define DIR_NAME "confdir3"
34250#define DIR_NAME_LEN 8
34251#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
34252
34253/* The length of "../".  */
34254#define DOTDOTSLASH_LEN 3
34255
34256/* Leftover bytes in the buffer, to work around library or OS bugs.  */
34257#define BUF_SLOP 20
34258
34259int
34260main ()
34261{
34262#ifndef PATH_MAX
34263  /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
34264     at least not on a local file system.  And if we were to start worrying
34265     about remote file systems, we'd have to enable the wrapper function
34266     all of the time, just to be safe.  That's not worth the cost.  */
34267  exit (0);
34268#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
34269        - DIR_NAME_SIZE - BUF_SLOP) \
34270       <= PATH_MAX)
34271  /* FIXME: Assuming there's a system for which this is true,
34272     this should be done in a compile test.  */
34273  exit (0);
34274#else
34275  char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
34276           + DIR_NAME_SIZE + BUF_SLOP];
34277  char *cwd = getcwd (buf, PATH_MAX);
34278  size_t initial_cwd_len;
34279  size_t cwd_len;
34280  int fail = 0;
34281  size_t n_chdirs = 0;
34282
34283  if (cwd == NULL)
34284    exit (10);
34285
34286  cwd_len = initial_cwd_len = strlen (cwd);
34287
34288  while (1)
34289    {
34290      size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
34291      char *c = NULL;
34292
34293      cwd_len += DIR_NAME_SIZE;
34294      /* If mkdir or chdir fails, it could be that this system cannot create
34295         any file with an absolute name longer than PATH_MAX, such as cygwin.
34296         If so, leave fail as 0, because the current working directory can't
34297         be too long for getcwd if it can't even be created.  For other
34298         errors, be pessimistic and consider that as a failure, too.  */
34299      if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
34300        {
34301          if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
34302            fail = 20;
34303          break;
34304        }
34305
34306      if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
34307        {
34308          struct stat sb;
34309
34310          c = getcwd (buf, PATH_MAX);
34311          if (!c && errno == ENOENT)
34312            {
34313              fail = 11;
34314              break;
34315            }
34316          if (c)
34317            {
34318              fail = 31;
34319              break;
34320            }
34321          if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
34322            {
34323              fail = 21;
34324              break;
34325            }
34326
34327          /* Our replacement needs to be able to stat() long ../../paths,
34328             so generate a path larger than PATH_MAX to check,
34329             avoiding the replacement if we can't stat().  */
34330          c = getcwd (buf, cwd_len + 1);
34331          if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
34332            {
34333              fail = 32;
34334              break;
34335            }
34336        }
34337
34338      if (dotdot_max <= cwd_len - initial_cwd_len)
34339        {
34340          if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
34341            break;
34342          c = getcwd (buf, cwd_len + 1);
34343          if (!c)
34344            {
34345              if (! (errno == ERANGE || errno == ENOENT
34346                     || is_ENAMETOOLONG (errno)))
34347                {
34348                  fail = 22;
34349                  break;
34350                }
34351              if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
34352                {
34353                  fail = 12;
34354                  break;
34355                }
34356            }
34357        }
34358
34359      if (c && strlen (c) != cwd_len)
34360        {
34361          fail = 23;
34362          break;
34363        }
34364      ++n_chdirs;
34365    }
34366
34367  /* Leaving behind such a deep directory is not polite.
34368     So clean up here, right away, even though the driving
34369     shell script would also clean up.  */
34370  {
34371    size_t i;
34372
34373    /* Try rmdir first, in case the chdir failed.  */
34374    rmdir (DIR_NAME);
34375    for (i = 0; i <= n_chdirs; i++)
34376      {
34377        if (chdir ("..") < 0)
34378          break;
34379        if (rmdir (DIR_NAME) != 0)
34380          break;
34381      }
34382  }
34383
34384  exit (fail);
34385#endif
34386}
34387
34388_ACEOF
34389if ac_fn_c_try_run "$LINENO"; then :
34390  gl_cv_func_getcwd_path_max=yes
34391else
34392  case $? in
34393        10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
34394        31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
34395        32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
34396        *) gl_cv_func_getcwd_path_max=no;;
34397        esac
34398fi
34399rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
34400  conftest.$ac_objext conftest.beam conftest.$ac_ext
34401fi
34402
34403
34404fi
34405{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5
34406$as_echo "$gl_cv_func_getcwd_path_max" >&6; }
34407
34408      case "$gl_cv_func_getcwd_null" in
34409        *yes)
34410
34411
34412
34413
34414
34415
34416      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
34417$as_echo_n "checking for getpagesize... " >&6; }
34418if ${gl_cv_func_getpagesize+:} false; then :
34419  $as_echo_n "(cached) " >&6
34420else
34421  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34422/* end confdefs.h.  */
34423#include <unistd.h>
34424int
34425main ()
34426{
34427return getpagesize();
34428  ;
34429  return 0;
34430}
34431
34432_ACEOF
34433if ac_fn_c_try_link "$LINENO"; then :
34434  gl_cv_func_getpagesize=yes
34435else
34436  gl_cv_func_getpagesize=no
34437fi
34438rm -f core conftest.err conftest.$ac_objext \
34439    conftest$ac_exeext conftest.$ac_ext
34440
34441fi
34442{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
34443$as_echo "$gl_cv_func_getpagesize" >&6; }
34444
34445  if test $gl_cv_func_getpagesize = yes; then
34446
34447cat >>confdefs.h <<_ACEOF
34448#define HAVE_GETPAGESIZE 1
34449_ACEOF
34450
34451  fi
34452
34453  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5
34454$as_echo_n "checking whether getcwd aborts when 4k < cwd_length < 16k... " >&6; }
34455if ${gl_cv_func_getcwd_abort_bug+:} false; then :
34456  $as_echo_n "(cached) " >&6
34457else
34458  # Remove any remnants of a previous test.
34459     rm -rf confdir-14B---
34460     # Arrange for deletion of the temporary directory this test creates.
34461     ac_clean_files="$ac_clean_files confdir-14B---"
34462          if test "$cross_compiling" = yes; then :
34463  gl_cv_func_getcwd_abort_bug=yes
34464else
34465  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34466/* end confdefs.h.  */
34467
34468#include <errno.h>
34469#include <stdlib.h>
34470#if HAVE_UNISTD_H
34471# include <unistd.h>
34472#else /* on Windows with MSVC */
34473# include <direct.h>
34474#endif
34475#include <string.h>
34476#include <sys/stat.h>
34477
34478
34479/* Arrange to define PATH_MAX, like "pathmax.h" does. */
34480#if HAVE_UNISTD_H
34481# include <unistd.h>
34482#endif
34483#include <limits.h>
34484#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
34485# include <sys/param.h>
34486#endif
34487#if !defined PATH_MAX && defined MAXPATHLEN
34488# define PATH_MAX MAXPATHLEN
34489#endif
34490#ifdef __hpux
34491# undef PATH_MAX
34492# define PATH_MAX 1024
34493#endif
34494#if defined _WIN32 && ! defined __CYGWIN__
34495# undef PATH_MAX
34496# define PATH_MAX 260
34497#endif
34498
34499
34500/* Don't get link errors because mkdir is redefined to rpl_mkdir.  */
34501#undef mkdir
34502
34503#ifndef S_IRWXU
34504# define S_IRWXU 0700
34505#endif
34506
34507/* FIXME: skip the run-test altogether on systems without getpagesize.  */
34508#if ! HAVE_GETPAGESIZE
34509# define getpagesize() 0
34510#endif
34511
34512/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
34513   the 16kB pagesize on ia64 linux.  Those conditions make the code below
34514   trigger a bug in glibc's getcwd implementation before 2.4.90-10.  */
34515#define TARGET_LEN (5 * 1024)
34516
34517int
34518main ()
34519{
34520  char *cwd;
34521  size_t initial_cwd_len;
34522  int fail = 0;
34523
34524  /* The bug is triggered when PATH_MAX < getpagesize (), so skip
34525     this relatively expensive and invasive test if that's not true.  */
34526#ifdef PATH_MAX
34527  int bug_possible = PATH_MAX < getpagesize ();
34528#else
34529  int bug_possible = 0;
34530#endif
34531  if (! bug_possible)
34532    return 0;
34533
34534  cwd = getcwd (NULL, 0);
34535  if (cwd == NULL)
34536    return 2;
34537
34538  initial_cwd_len = strlen (cwd);
34539  free (cwd);
34540
34541  if (1)
34542    {
34543      static char const dir_name[] = "confdir-14B---";
34544      size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
34545                              / sizeof dir_name);
34546      size_t d;
34547      for (d = 0; d < desired_depth; d++)
34548        {
34549          if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
34550            {
34551              if (! (errno == ERANGE || errno == ENAMETOOLONG
34552                     || errno == ENOENT))
34553                fail = 3; /* Unable to construct deep hierarchy.  */
34554              break;
34555            }
34556        }
34557
34558      /* If libc has the bug in question, this invocation of getcwd
34559         results in a failed assertion.  */
34560      cwd = getcwd (NULL, 0);
34561      if (cwd == NULL)
34562        fail = 4; /* getcwd didn't assert, but it failed for a long name
34563                     where the answer could have been learned.  */
34564      free (cwd);
34565
34566      /* Call rmdir first, in case the above chdir failed.  */
34567      rmdir (dir_name);
34568      while (0 < d--)
34569        {
34570          if (chdir ("..") < 0)
34571            {
34572              fail = 5;
34573              break;
34574            }
34575          rmdir (dir_name);
34576        }
34577    }
34578
34579  return fail;
34580}
34581
34582_ACEOF
34583if ac_fn_c_try_run "$LINENO"; then :
34584  gl_cv_func_getcwd_abort_bug=no
34585else
34586                                                  ret=$?
34587        if test $ret -ge 128 || test $ret = 4; then
34588          gl_cv_func_getcwd_abort_bug=yes
34589        else
34590          gl_cv_func_getcwd_abort_bug=no
34591        fi
34592fi
34593rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
34594  conftest.$ac_objext conftest.beam conftest.$ac_ext
34595fi
34596
34597
34598fi
34599{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_abort_bug" >&5
34600$as_echo "$gl_cv_func_getcwd_abort_bug" >&6; }
34601  if test $gl_cv_func_getcwd_abort_bug = yes; then :
34602  gl_abort_bug=yes
34603fi
34604
34605          ;;
34606      esac
34607      ;;
34608  esac
34609      case "$gl_cv_func_getcwd_path_max" in
34610    "no"|"no, it has the AIX bug") ;;
34611    *)
34612
34613$as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h
34614
34615      ;;
34616  esac
34617  case "$gl_cv_func_getcwd_path_max" in
34618    "no, but it is partly working")
34619
34620$as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h
34621
34622      ;;
34623    "yes, but with shorter paths")
34624
34625$as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h
34626
34627      ;;
34628  esac
34629
34630  if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
34631     || test $gl_cv_func_getcwd_posix_signature != yes \
34632     || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \
34633     || test $gl_abort_bug = yes; then
34634    REPLACE_GETCWD=1
34635  fi
34636
34637  if test $REPLACE_GETCWD = 1; then
34638
34639
34640
34641
34642
34643
34644
34645
34646  gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext"
34647
34648
34649
34650
34651  :
34652
34653  fi
34654
34655
34656cat >>confdefs.h <<_ACEOF
34657#define GNULIB_GETCWD 1
34658_ACEOF
34659
34660
34661
34662
34663
34664
34665
34666          GNULIB_GETCWD=1
34667
34668
34669
34670
34671
34672$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
34673
34674
34675
34676
34677
34678
34679
34680
34681  case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
34682  *yes,yes) ;;
34683  *)
34684        REPLACE_GETCWD=1
34685    ;;
34686  esac
34687
34688  if test $REPLACE_GETCWD = 1; then
34689
34690
34691
34692
34693
34694
34695
34696
34697  gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext"
34698
34699  fi
34700
34701
34702
34703
34704
34705          GNULIB_GETCWD=1
34706
34707
34708
34709
34710
34711$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
34712
34713
34714
34715
34716
34717
34718
34719
34720
34721
34722
34723  if test $ac_cv_func_getdelim = yes; then
34724    HAVE_GETDELIM=1
34725        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getdelim function" >&5
34726$as_echo_n "checking for working getdelim function... " >&6; }
34727if ${gl_cv_func_working_getdelim+:} false; then :
34728  $as_echo_n "(cached) " >&6
34729else
34730  echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
34731    if test "$cross_compiling" = yes; then :
34732        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34733/* end confdefs.h.  */
34734
34735#include <features.h>
34736#ifdef __GNU_LIBRARY__
34737 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
34738  Lucky GNU user
34739 #endif
34740#endif
34741
34742_ACEOF
34743if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
34744  $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
34745  gl_cv_func_working_getdelim="guessing yes"
34746else
34747  gl_cv_func_working_getdelim="guessing no"
34748fi
34749rm -f conftest*
34750
34751
34752else
34753  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34754/* end confdefs.h.  */
34755
34756#    include <stdio.h>
34757#    include <stdlib.h>
34758#    include <string.h>
34759    int main ()
34760    {
34761      FILE *in = fopen ("./conftest.data", "r");
34762      if (!in)
34763        return 1;
34764      {
34765        /* Test result for a NULL buffer and a zero size.
34766           Based on a test program from Karl Heuer.  */
34767        char *line = NULL;
34768        size_t siz = 0;
34769        int len = getdelim (&line, &siz, '\n', in);
34770        if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
34771          { free (line); fclose (in); return 2; }
34772      }
34773      {
34774        /* Test result for a NULL buffer and a non-zero size.
34775           This crashes on FreeBSD 8.0.  */
34776        char *line = NULL;
34777        size_t siz = (size_t)(~0) / 4;
34778        if (getdelim (&line, &siz, '\n', in) == -1)
34779          { fclose (in); return 3; }
34780        free (line);
34781      }
34782      fclose (in);
34783      return 0;
34784    }
34785
34786_ACEOF
34787if ac_fn_c_try_run "$LINENO"; then :
34788  gl_cv_func_working_getdelim=yes
34789else
34790  gl_cv_func_working_getdelim=no
34791fi
34792rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
34793  conftest.$ac_objext conftest.beam conftest.$ac_ext
34794fi
34795
34796fi
34797{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_getdelim" >&5
34798$as_echo "$gl_cv_func_working_getdelim" >&6; }
34799    case "$gl_cv_func_working_getdelim" in
34800      *no)
34801        REPLACE_GETDELIM=1
34802        ;;
34803    esac
34804  else
34805    HAVE_GETDELIM=0
34806  fi
34807
34808  if test $ac_cv_have_decl_getdelim = no; then
34809    HAVE_DECL_GETDELIM=0
34810  fi
34811
34812  if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then
34813
34814
34815
34816
34817
34818
34819
34820
34821  gl_LIBOBJS="$gl_LIBOBJS getdelim.$ac_objext"
34822
34823
34824  for ac_func in flockfile funlockfile
34825do :
34826  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
34827ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
34828if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
34829  cat >>confdefs.h <<_ACEOF
34830#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
34831_ACEOF
34832
34833fi
34834done
34835
34836  ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
34837if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then :
34838  ac_have_decl=1
34839else
34840  ac_have_decl=0
34841fi
34842
34843cat >>confdefs.h <<_ACEOF
34844#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
34845_ACEOF
34846
34847
34848  fi
34849
34850
34851
34852
34853
34854          GNULIB_GETDELIM=1
34855
34856
34857
34858
34859
34860$as_echo "#define GNULIB_TEST_GETDELIM 1" >>confdefs.h
34861
34862
34863
34864
34865
34866
34867
34868
34869  if test $ac_cv_func_getdtablesize = yes &&
34870     test $ac_cv_have_decl_getdtablesize = yes; then
34871    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
34872$as_echo_n "checking whether getdtablesize works... " >&6; }
34873if ${gl_cv_func_getdtablesize_works+:} false; then :
34874  $as_echo_n "(cached) " >&6
34875else
34876                                                   case "$host_os" in
34877         vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
34878         *)
34879                                                       if test "$cross_compiling" = yes; then :
34880  case "$host_os" in
34881                cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
34882                  gl_cv_func_getdtablesize_works="guessing no" ;;
34883                *) gl_cv_func_getdtablesize_works="guessing yes" ;;
34884              esac
34885
34886else
34887  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34888/* end confdefs.h.  */
34889
34890             #include <unistd.h>
34891int
34892main ()
34893{
34894int size = getdtablesize();
34895                if (dup2 (0, getdtablesize()) != -1)
34896                  return 1;
34897                if (size != getdtablesize())
34898                  return 2;
34899
34900  ;
34901  return 0;
34902}
34903_ACEOF
34904if ac_fn_c_try_run "$LINENO"; then :
34905  gl_cv_func_getdtablesize_works=yes
34906else
34907  gl_cv_func_getdtablesize_works=no
34908fi
34909rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
34910  conftest.$ac_objext conftest.beam conftest.$ac_ext
34911fi
34912
34913           ;;
34914       esac
34915
34916fi
34917{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
34918$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
34919    case "$gl_cv_func_getdtablesize_works" in
34920      *yes | "no (limitation)") ;;
34921      *) REPLACE_GETDTABLESIZE=1 ;;
34922    esac
34923  else
34924    HAVE_GETDTABLESIZE=0
34925  fi
34926
34927  if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
34928
34929
34930
34931
34932
34933
34934
34935
34936  gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext"
34937
34938    :
34939  fi
34940
34941
34942
34943
34944
34945          GNULIB_GETDTABLESIZE=1
34946
34947
34948
34949
34950
34951$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
34952
34953
34954
34955
34956
34957
34958
34959
34960        ac_fn_c_check_func "$LINENO" "getgroups" "ac_cv_func_getgroups"
34961if test "x$ac_cv_func_getgroups" = xyes; then :
34962
34963fi
34964
34965
34966  # If we don't yet have getgroups, see if it's in -lbsd.
34967  # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
34968  ac_save_LIBS=$LIBS
34969  if test $ac_cv_func_getgroups = no; then
34970    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getgroups in -lbsd" >&5
34971$as_echo_n "checking for getgroups in -lbsd... " >&6; }
34972if ${ac_cv_lib_bsd_getgroups+:} false; then :
34973  $as_echo_n "(cached) " >&6
34974else
34975  ac_check_lib_save_LIBS=$LIBS
34976LIBS="-lbsd  $LIBS"
34977cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34978/* end confdefs.h.  */
34979
34980/* Override any GCC internal prototype to avoid an error.
34981   Use char because int might match the return type of a GCC
34982   builtin and then its argument prototype would still apply.  */
34983#ifdef __cplusplus
34984extern "C"
34985#endif
34986char getgroups ();
34987int
34988main ()
34989{
34990return getgroups ();
34991  ;
34992  return 0;
34993}
34994_ACEOF
34995if ac_fn_c_try_link "$LINENO"; then :
34996  ac_cv_lib_bsd_getgroups=yes
34997else
34998  ac_cv_lib_bsd_getgroups=no
34999fi
35000rm -f core conftest.err conftest.$ac_objext \
35001    conftest$ac_exeext conftest.$ac_ext
35002LIBS=$ac_check_lib_save_LIBS
35003fi
35004{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_getgroups" >&5
35005$as_echo "$ac_cv_lib_bsd_getgroups" >&6; }
35006if test "x$ac_cv_lib_bsd_getgroups" = xyes; then :
35007  GETGROUPS_LIB=-lbsd
35008fi
35009
35010  fi
35011
35012  # Run the program to test the functionality of the system-supplied
35013  # getgroups function only if there is such a function.
35014  if test $ac_cv_func_getgroups = yes; then
35015    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getgroups" >&5
35016$as_echo_n "checking for working getgroups... " >&6; }
35017if ${ac_cv_func_getgroups_works+:} false; then :
35018  $as_echo_n "(cached) " >&6
35019else
35020  if test "$cross_compiling" = yes; then :
35021  case "$host_os" in # ((
35022                           # Guess yes on glibc systems.
35023            *-gnu* | gnu*) ac_cv_func_getgroups_works="guessing yes" ;;
35024                           # If we don't know, assume the worst.
35025            *)             ac_cv_func_getgroups_works="guessing no" ;;
35026          esac
35027
35028else
35029  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35030/* end confdefs.h.  */
35031$ac_includes_default
35032int
35033main ()
35034{
35035/* On Ultrix 4.3, getgroups (0, 0) always fails.  */
35036              return getgroups (0, 0) == -1;
35037  ;
35038  return 0;
35039}
35040
35041_ACEOF
35042if ac_fn_c_try_run "$LINENO"; then :
35043  ac_cv_func_getgroups_works=yes
35044else
35045  ac_cv_func_getgroups_works=no
35046fi
35047rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
35048  conftest.$ac_objext conftest.beam conftest.$ac_ext
35049fi
35050
35051
35052fi
35053{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getgroups_works" >&5
35054$as_echo "$ac_cv_func_getgroups_works" >&6; }
35055  else
35056    ac_cv_func_getgroups_works=no
35057  fi
35058  case "$ac_cv_func_getgroups_works" in
35059    *yes)
35060
35061$as_echo "#define HAVE_GETGROUPS 1" >>confdefs.h
35062
35063      ;;
35064  esac
35065  LIBS=$ac_save_LIBS
35066
35067  if test $ac_cv_func_getgroups != yes; then
35068    HAVE_GETGROUPS=0
35069  else
35070    if test "$ac_cv_type_getgroups" != gid_t \
35071       || { case "$ac_cv_func_getgroups_works" in
35072              *yes) false;;
35073              *) true;;
35074            esac
35075          }; then
35076      REPLACE_GETGROUPS=1
35077
35078$as_echo "#define GETGROUPS_ZERO_BUG 1" >>confdefs.h
35079
35080    else
35081            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getgroups handles negative values" >&5
35082$as_echo_n "checking whether getgroups handles negative values... " >&6; }
35083if ${gl_cv_func_getgroups_works+:} false; then :
35084  $as_echo_n "(cached) " >&6
35085else
35086  if test "$cross_compiling" = yes; then :
35087  case "$host_os" in
35088                            # Guess yes on glibc systems.
35089             *-gnu* | gnu*) gl_cv_func_getgroups_works="guessing yes" ;;
35090                            # If we don't know, assume the worst.
35091             *)             gl_cv_func_getgroups_works="guessing no" ;;
35092           esac
35093
35094else
35095  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35096/* end confdefs.h.  */
35097$ac_includes_default
35098int
35099main ()
35100{
35101int size = getgroups (0, 0);
35102            gid_t *list = malloc (size * sizeof *list);
35103            int result = getgroups (-1, list) != -1;
35104            free (list);
35105            return result;
35106  ;
35107  return 0;
35108}
35109_ACEOF
35110if ac_fn_c_try_run "$LINENO"; then :
35111  gl_cv_func_getgroups_works=yes
35112else
35113  gl_cv_func_getgroups_works=no
35114fi
35115rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
35116  conftest.$ac_objext conftest.beam conftest.$ac_ext
35117fi
35118
35119fi
35120{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getgroups_works" >&5
35121$as_echo "$gl_cv_func_getgroups_works" >&6; }
35122      case "$gl_cv_func_getgroups_works" in
35123        *yes) ;;
35124        *) REPLACE_GETGROUPS=1 ;;
35125      esac
35126    fi
35127  fi
35128  test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
35129
35130  if test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1; then
35131
35132
35133
35134
35135
35136
35137
35138
35139  gl_LIBOBJS="$gl_LIBOBJS getgroups.$ac_objext"
35140
35141  fi
35142
35143
35144
35145
35146
35147          GNULIB_GETGROUPS=1
35148
35149
35150
35151
35152
35153$as_echo "#define GNULIB_TEST_GETGROUPS 1" >>confdefs.h
35154
35155
35156
35157
35158
35159
35160
35161
35162
35163  if test $ac_cv_header_sys_socket_h != yes; then
35164                    for ac_header in winsock2.h
35165do :
35166  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
35167if test "x$ac_cv_header_winsock2_h" = xyes; then :
35168  cat >>confdefs.h <<_ACEOF
35169#define HAVE_WINSOCK2_H 1
35170_ACEOF
35171
35172fi
35173
35174done
35175
35176  fi
35177  if test "$ac_cv_header_winsock2_h" = yes; then
35178    HAVE_WINSOCK2_H=1
35179    UNISTD_H_HAVE_WINSOCK2_H=1
35180    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
35181  else
35182    HAVE_WINSOCK2_H=0
35183  fi
35184
35185
35186
35187        GETHOSTNAME_LIB=
35188  for ac_func in gethostname
35189do :
35190  ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname"
35191if test "x$ac_cv_func_gethostname" = xyes; then :
35192  cat >>confdefs.h <<_ACEOF
35193#define HAVE_GETHOSTNAME 1
35194_ACEOF
35195
35196else
35197
35198    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostname in winsock2.h and -lws2_32" >&5
35199$as_echo_n "checking for gethostname in winsock2.h and -lws2_32... " >&6; }
35200if ${gl_cv_w32_gethostname+:} false; then :
35201  $as_echo_n "(cached) " >&6
35202else
35203  gl_cv_w32_gethostname=no
35204       gl_save_LIBS="$LIBS"
35205       LIBS="$LIBS -lws2_32"
35206       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35207/* end confdefs.h.  */
35208
35209#ifdef HAVE_WINSOCK2_H
35210#include <winsock2.h>
35211#endif
35212#include <stddef.h>
35213
35214int
35215main ()
35216{
35217gethostname(NULL, 0);
35218  ;
35219  return 0;
35220}
35221_ACEOF
35222if ac_fn_c_try_link "$LINENO"; then :
35223  gl_cv_w32_gethostname=yes
35224fi
35225rm -f core conftest.err conftest.$ac_objext \
35226    conftest$ac_exeext conftest.$ac_ext
35227       LIBS="$gl_save_LIBS"
35228
35229fi
35230{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_gethostname" >&5
35231$as_echo "$gl_cv_w32_gethostname" >&6; }
35232    if test "$gl_cv_w32_gethostname" = "yes"; then
35233      GETHOSTNAME_LIB="-lws2_32"
35234    fi
35235
35236fi
35237done
35238
35239
35240
35241  if test "$ac_cv_func_gethostname" = no; then
35242    HAVE_GETHOSTNAME=0
35243  fi
35244
35245
35246
35247
35248
35249  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HOST_NAME_MAX" >&5
35250$as_echo_n "checking for HOST_NAME_MAX... " >&6; }
35251if ${gl_cv_decl_HOST_NAME_MAX+:} false; then :
35252  $as_echo_n "(cached) " >&6
35253else
35254
35255    gl_cv_decl_HOST_NAME_MAX=
35256    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35257/* end confdefs.h.  */
35258
35259#include <limits.h>
35260#ifdef HOST_NAME_MAX
35261lucky
35262#endif
35263
35264_ACEOF
35265if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
35266  $EGREP "lucky" >/dev/null 2>&1; then :
35267  gl_cv_decl_HOST_NAME_MAX=yes
35268fi
35269rm -f conftest*
35270
35271    if test -z "$gl_cv_decl_HOST_NAME_MAX"; then
35272            if test "$gl_cv_w32_gethostname" = yes; then
35273                gl_cv_decl_HOST_NAME_MAX=256
35274      else
35275        if ac_fn_c_compute_int "$LINENO" "MAXHOSTNAMELEN" "gl_cv_decl_HOST_NAME_MAX"        "
35276#include <sys/types.h>
35277#if HAVE_SYS_PARAM_H
35278# include <sys/param.h>
35279#endif
35280#if HAVE_SYS_SOCKET_H
35281# include <sys/socket.h>
35282#endif
35283#if HAVE_NETDB_H
35284# include <netdb.h>
35285#endif
35286"; then :
35287
35288else
35289                        gl_cv_decl_HOST_NAME_MAX=256
35290
35291fi
35292
35293
35294      fi
35295    fi
35296
35297fi
35298{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_HOST_NAME_MAX" >&5
35299$as_echo "$gl_cv_decl_HOST_NAME_MAX" >&6; }
35300  if test "$gl_cv_decl_HOST_NAME_MAX" != yes; then
35301
35302cat >>confdefs.h <<_ACEOF
35303#define HOST_NAME_MAX $gl_cv_decl_HOST_NAME_MAX
35304_ACEOF
35305
35306  fi
35307
35308
35309  if test $HAVE_GETHOSTNAME = 0; then
35310
35311
35312
35313
35314
35315
35316
35317
35318  gl_LIBOBJS="$gl_LIBOBJS gethostname.$ac_objext"
35319
35320
35321  if test "$gl_cv_w32_gethostname" != "yes"; then
35322    for ac_func in uname
35323do :
35324  ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname"
35325if test "x$ac_cv_func_uname" = xyes; then :
35326  cat >>confdefs.h <<_ACEOF
35327#define HAVE_UNAME 1
35328_ACEOF
35329
35330fi
35331done
35332
35333  fi
35334
35335  fi
35336
35337
35338
35339
35340
35341          GNULIB_GETHOSTNAME=1
35342
35343
35344
35345
35346
35347$as_echo "#define GNULIB_TEST_GETHOSTNAME 1" >>confdefs.h
35348
35349
35350
35351
35352
35353
35354
35355  ac_fn_c_check_decl "$LINENO" "gethrtime" "ac_cv_have_decl_gethrtime" "#include <time.h>
35356"
35357if test "x$ac_cv_have_decl_gethrtime" = xyes; then :
35358  ac_have_decl=1
35359else
35360  ac_have_decl=0
35361fi
35362
35363cat >>confdefs.h <<_ACEOF
35364#define HAVE_DECL_GETHRTIME $ac_have_decl
35365_ACEOF
35366
35367  LIB_GETHRXTIME=
35368  if test $ac_cv_have_decl_gethrtime = no \
35369     || test $gl_cv_arithmetic_hrtime_t = no; then
35370
35371
35372
35373    if test $ac_cv_func_nanouptime != yes \
35374       && { test $ac_cv_have_decl_gethrtime = no \
35375            || test $gl_cv_arithmetic_hrtime_t = no; }; then
35376      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CLOCK_MONOTONIC or CLOCK_REALTIME is defined" >&5
35377$as_echo_n "checking whether CLOCK_MONOTONIC or CLOCK_REALTIME is defined... " >&6; }
35378if ${gl_cv_have_clock_gettime_macro+:} false; then :
35379  $as_echo_n "(cached) " >&6
35380else
35381  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35382/* end confdefs.h.  */
35383
35384#          include <time.h>
35385#          if defined CLOCK_MONOTONIC || defined CLOCK_REALTIME
35386            have_clock_gettime_macro
35387#          endif
35388
35389_ACEOF
35390if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
35391  $EGREP "have_clock_gettime_macro" >/dev/null 2>&1; then :
35392  gl_cv_have_clock_gettime_macro=yes
35393else
35394  gl_cv_have_clock_gettime_macro=no
35395fi
35396rm -f conftest*
35397
35398fi
35399{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_clock_gettime_macro" >&5
35400$as_echo "$gl_cv_have_clock_gettime_macro" >&6; }
35401      if test $gl_cv_have_clock_gettime_macro = yes; then
35402        LIB_GETHRXTIME=$LIB_CLOCK_GETTIME
35403      fi
35404    fi
35405  fi
35406
35407
35408
35409
35410
35411
35412
35413
35414
35415  gl_getline_needs_run_time_check=no
35416  ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline"
35417if test "x$ac_cv_func_getline" = xyes; then :
35418                   gl_getline_needs_run_time_check=yes
35419else
35420  am_cv_func_working_getline=no
35421fi
35422
35423  if test $gl_getline_needs_run_time_check = yes; then
35424    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getline function" >&5
35425$as_echo_n "checking for working getline function... " >&6; }
35426if ${am_cv_func_working_getline+:} false; then :
35427  $as_echo_n "(cached) " >&6
35428else
35429  echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
35430    if test "$cross_compiling" = yes; then :
35431        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35432/* end confdefs.h.  */
35433
35434#include <features.h>
35435#ifdef __GNU_LIBRARY__
35436 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
35437  Lucky GNU user
35438 #endif
35439#endif
35440
35441_ACEOF
35442if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
35443  $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
35444  am_cv_func_working_getline="guessing yes"
35445else
35446  am_cv_func_working_getline="guessing no"
35447fi
35448rm -f conftest*
35449
35450
35451else
35452  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35453/* end confdefs.h.  */
35454
35455#    include <stdio.h>
35456#    include <stdlib.h>
35457#    include <string.h>
35458    int main ()
35459    {
35460      FILE *in = fopen ("./conftest.data", "r");
35461      if (!in)
35462        return 1;
35463      {
35464        /* Test result for a NULL buffer and a zero size.
35465           Based on a test program from Karl Heuer.  */
35466        char *line = NULL;
35467        size_t siz = 0;
35468        int len = getline (&line, &siz, in);
35469        if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
35470          { free (line); fclose (in); return 2; }
35471        free (line);
35472      }
35473      {
35474        /* Test result for a NULL buffer and a non-zero size.
35475           This crashes on FreeBSD 8.0.  */
35476        char *line = NULL;
35477        size_t siz = (size_t)(~0) / 4;
35478        if (getline (&line, &siz, in) == -1)
35479          { fclose (in); return 3; }
35480        free (line);
35481      }
35482      fclose (in);
35483      return 0;
35484    }
35485
35486_ACEOF
35487if ac_fn_c_try_run "$LINENO"; then :
35488  am_cv_func_working_getline=yes
35489else
35490  am_cv_func_working_getline=no
35491fi
35492rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
35493  conftest.$ac_objext conftest.beam conftest.$ac_ext
35494fi
35495
35496fi
35497{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_working_getline" >&5
35498$as_echo "$am_cv_func_working_getline" >&6; }
35499  fi
35500
35501  if test $ac_cv_have_decl_getline = no; then
35502    HAVE_DECL_GETLINE=0
35503  fi
35504
35505  case "$am_cv_func_working_getline" in
35506    *no)
35507                        REPLACE_GETLINE=1
35508      ;;
35509  esac
35510
35511  if test $REPLACE_GETLINE = 1; then
35512
35513
35514
35515
35516
35517
35518
35519
35520  gl_LIBOBJS="$gl_LIBOBJS getline.$ac_objext"
35521
35522
35523  :
35524
35525  fi
35526
35527
35528
35529
35530
35531          GNULIB_GETLINE=1
35532
35533
35534
35535
35536
35537$as_echo "#define GNULIB_TEST_GETLINE 1" >>confdefs.h
35538
35539
35540
35541
35542
35543# Persuade glibc <stdlib.h> to declare getloadavg().
35544
35545
35546gl_save_LIBS=$LIBS
35547
35548# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
35549# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
35550HAVE_GETLOADAVG=1
35551ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg"
35552if test "x$ac_cv_func_getloadavg" = xyes; then :
35553
35554else
35555  gl_func_getloadavg_done=no
35556
35557   # Some systems with -lutil have (and need) -lkvm as well, some do not.
35558   # On Solaris, -lkvm requires nlist from -lelf, so check that first
35559   # to get the right answer into the cache.
35560   # For kstat on solaris, we need to test for libelf and libkvm to force the
35561   # definition of SVR4 below.
35562   if test $gl_func_getloadavg_done = no; then
35563     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_begin in -lelf" >&5
35564$as_echo_n "checking for elf_begin in -lelf... " >&6; }
35565if ${ac_cv_lib_elf_elf_begin+:} false; then :
35566  $as_echo_n "(cached) " >&6
35567else
35568  ac_check_lib_save_LIBS=$LIBS
35569LIBS="-lelf  $LIBS"
35570cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35571/* end confdefs.h.  */
35572
35573/* Override any GCC internal prototype to avoid an error.
35574   Use char because int might match the return type of a GCC
35575   builtin and then its argument prototype would still apply.  */
35576#ifdef __cplusplus
35577extern "C"
35578#endif
35579char elf_begin ();
35580int
35581main ()
35582{
35583return elf_begin ();
35584  ;
35585  return 0;
35586}
35587_ACEOF
35588if ac_fn_c_try_link "$LINENO"; then :
35589  ac_cv_lib_elf_elf_begin=yes
35590else
35591  ac_cv_lib_elf_elf_begin=no
35592fi
35593rm -f core conftest.err conftest.$ac_objext \
35594    conftest$ac_exeext conftest.$ac_ext
35595LIBS=$ac_check_lib_save_LIBS
35596fi
35597{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_elf_begin" >&5
35598$as_echo "$ac_cv_lib_elf_elf_begin" >&6; }
35599if test "x$ac_cv_lib_elf_elf_begin" = xyes; then :
35600  LIBS="-lelf $LIBS"
35601fi
35602
35603     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5
35604$as_echo_n "checking for kvm_open in -lkvm... " >&6; }
35605if ${ac_cv_lib_kvm_kvm_open+:} false; then :
35606  $as_echo_n "(cached) " >&6
35607else
35608  ac_check_lib_save_LIBS=$LIBS
35609LIBS="-lkvm  $LIBS"
35610cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35611/* end confdefs.h.  */
35612
35613/* Override any GCC internal prototype to avoid an error.
35614   Use char because int might match the return type of a GCC
35615   builtin and then its argument prototype would still apply.  */
35616#ifdef __cplusplus
35617extern "C"
35618#endif
35619char kvm_open ();
35620int
35621main ()
35622{
35623return kvm_open ();
35624  ;
35625  return 0;
35626}
35627_ACEOF
35628if ac_fn_c_try_link "$LINENO"; then :
35629  ac_cv_lib_kvm_kvm_open=yes
35630else
35631  ac_cv_lib_kvm_kvm_open=no
35632fi
35633rm -f core conftest.err conftest.$ac_objext \
35634    conftest$ac_exeext conftest.$ac_ext
35635LIBS=$ac_check_lib_save_LIBS
35636fi
35637{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5
35638$as_echo "$ac_cv_lib_kvm_kvm_open" >&6; }
35639if test "x$ac_cv_lib_kvm_kvm_open" = xyes; then :
35640  LIBS="-lkvm $LIBS"
35641fi
35642
35643     # Check for the 4.4BSD definition of getloadavg.
35644     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lutil" >&5
35645$as_echo_n "checking for getloadavg in -lutil... " >&6; }
35646if ${ac_cv_lib_util_getloadavg+:} false; then :
35647  $as_echo_n "(cached) " >&6
35648else
35649  ac_check_lib_save_LIBS=$LIBS
35650LIBS="-lutil  $LIBS"
35651cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35652/* end confdefs.h.  */
35653
35654/* Override any GCC internal prototype to avoid an error.
35655   Use char because int might match the return type of a GCC
35656   builtin and then its argument prototype would still apply.  */
35657#ifdef __cplusplus
35658extern "C"
35659#endif
35660char getloadavg ();
35661int
35662main ()
35663{
35664return getloadavg ();
35665  ;
35666  return 0;
35667}
35668_ACEOF
35669if ac_fn_c_try_link "$LINENO"; then :
35670  ac_cv_lib_util_getloadavg=yes
35671else
35672  ac_cv_lib_util_getloadavg=no
35673fi
35674rm -f core conftest.err conftest.$ac_objext \
35675    conftest$ac_exeext conftest.$ac_ext
35676LIBS=$ac_check_lib_save_LIBS
35677fi
35678{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_getloadavg" >&5
35679$as_echo "$ac_cv_lib_util_getloadavg" >&6; }
35680if test "x$ac_cv_lib_util_getloadavg" = xyes; then :
35681  LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes
35682fi
35683
35684   fi
35685
35686   if test $gl_func_getloadavg_done = no; then
35687     # There is a commonly available library for RS/6000 AIX.
35688     # Since it is not a standard part of AIX, it might be installed locally.
35689     gl_getloadavg_LIBS=$LIBS
35690     LIBS="-L/usr/local/lib $LIBS"
35691     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lgetloadavg" >&5
35692$as_echo_n "checking for getloadavg in -lgetloadavg... " >&6; }
35693if ${ac_cv_lib_getloadavg_getloadavg+:} false; then :
35694  $as_echo_n "(cached) " >&6
35695else
35696  ac_check_lib_save_LIBS=$LIBS
35697LIBS="-lgetloadavg  $LIBS"
35698cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35699/* end confdefs.h.  */
35700
35701/* Override any GCC internal prototype to avoid an error.
35702   Use char because int might match the return type of a GCC
35703   builtin and then its argument prototype would still apply.  */
35704#ifdef __cplusplus
35705extern "C"
35706#endif
35707char getloadavg ();
35708int
35709main ()
35710{
35711return getloadavg ();
35712  ;
35713  return 0;
35714}
35715_ACEOF
35716if ac_fn_c_try_link "$LINENO"; then :
35717  ac_cv_lib_getloadavg_getloadavg=yes
35718else
35719  ac_cv_lib_getloadavg_getloadavg=no
35720fi
35721rm -f core conftest.err conftest.$ac_objext \
35722    conftest$ac_exeext conftest.$ac_ext
35723LIBS=$ac_check_lib_save_LIBS
35724fi
35725{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_getloadavg_getloadavg" >&5
35726$as_echo "$ac_cv_lib_getloadavg_getloadavg" >&6; }
35727if test "x$ac_cv_lib_getloadavg_getloadavg" = xyes; then :
35728  LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes
35729else
35730  LIBS=$gl_getloadavg_LIBS
35731fi
35732
35733   fi
35734
35735   # Set up the replacement function if necessary.
35736   if test $gl_func_getloadavg_done = no; then
35737     HAVE_GETLOADAVG=0
35738
35739     # Solaris has libkstat which does not require root.
35740     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5
35741$as_echo_n "checking for kstat_open in -lkstat... " >&6; }
35742if ${ac_cv_lib_kstat_kstat_open+:} false; then :
35743  $as_echo_n "(cached) " >&6
35744else
35745  ac_check_lib_save_LIBS=$LIBS
35746LIBS="-lkstat  $LIBS"
35747cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35748/* end confdefs.h.  */
35749
35750/* Override any GCC internal prototype to avoid an error.
35751   Use char because int might match the return type of a GCC
35752   builtin and then its argument prototype would still apply.  */
35753#ifdef __cplusplus
35754extern "C"
35755#endif
35756char kstat_open ();
35757int
35758main ()
35759{
35760return kstat_open ();
35761  ;
35762  return 0;
35763}
35764_ACEOF
35765if ac_fn_c_try_link "$LINENO"; then :
35766  ac_cv_lib_kstat_kstat_open=yes
35767else
35768  ac_cv_lib_kstat_kstat_open=no
35769fi
35770rm -f core conftest.err conftest.$ac_objext \
35771    conftest$ac_exeext conftest.$ac_ext
35772LIBS=$ac_check_lib_save_LIBS
35773fi
35774{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kstat_kstat_open" >&5
35775$as_echo "$ac_cv_lib_kstat_kstat_open" >&6; }
35776if test "x$ac_cv_lib_kstat_kstat_open" = xyes; then :
35777  cat >>confdefs.h <<_ACEOF
35778#define HAVE_LIBKSTAT 1
35779_ACEOF
35780
35781  LIBS="-lkstat $LIBS"
35782
35783fi
35784
35785     test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
35786
35787     # AIX has libperfstat which does not require root
35788     if test $gl_func_getloadavg_done = no; then
35789       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perfstat_cpu_total in -lperfstat" >&5
35790$as_echo_n "checking for perfstat_cpu_total in -lperfstat... " >&6; }
35791if ${ac_cv_lib_perfstat_perfstat_cpu_total+:} false; then :
35792  $as_echo_n "(cached) " >&6
35793else
35794  ac_check_lib_save_LIBS=$LIBS
35795LIBS="-lperfstat  $LIBS"
35796cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35797/* end confdefs.h.  */
35798
35799/* Override any GCC internal prototype to avoid an error.
35800   Use char because int might match the return type of a GCC
35801   builtin and then its argument prototype would still apply.  */
35802#ifdef __cplusplus
35803extern "C"
35804#endif
35805char perfstat_cpu_total ();
35806int
35807main ()
35808{
35809return perfstat_cpu_total ();
35810  ;
35811  return 0;
35812}
35813_ACEOF
35814if ac_fn_c_try_link "$LINENO"; then :
35815  ac_cv_lib_perfstat_perfstat_cpu_total=yes
35816else
35817  ac_cv_lib_perfstat_perfstat_cpu_total=no
35818fi
35819rm -f core conftest.err conftest.$ac_objext \
35820    conftest$ac_exeext conftest.$ac_ext
35821LIBS=$ac_check_lib_save_LIBS
35822fi
35823{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_perfstat_perfstat_cpu_total" >&5
35824$as_echo "$ac_cv_lib_perfstat_perfstat_cpu_total" >&6; }
35825if test "x$ac_cv_lib_perfstat_perfstat_cpu_total" = xyes; then :
35826  cat >>confdefs.h <<_ACEOF
35827#define HAVE_LIBPERFSTAT 1
35828_ACEOF
35829
35830  LIBS="-lperfstat $LIBS"
35831
35832fi
35833
35834       test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
35835     fi
35836
35837     if test $gl_func_getloadavg_done = no; then
35838       ac_fn_c_check_header_mongrel "$LINENO" "sys/dg_sys_info.h" "ac_cv_header_sys_dg_sys_info_h" "$ac_includes_default"
35839if test "x$ac_cv_header_sys_dg_sys_info_h" = xyes; then :
35840  gl_func_getloadavg_done=yes
35841
35842$as_echo "#define DGUX 1" >>confdefs.h
35843
35844          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dg_sys_info in -ldgc" >&5
35845$as_echo_n "checking for dg_sys_info in -ldgc... " >&6; }
35846if ${ac_cv_lib_dgc_dg_sys_info+:} false; then :
35847  $as_echo_n "(cached) " >&6
35848else
35849  ac_check_lib_save_LIBS=$LIBS
35850LIBS="-ldgc  $LIBS"
35851cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35852/* end confdefs.h.  */
35853
35854/* Override any GCC internal prototype to avoid an error.
35855   Use char because int might match the return type of a GCC
35856   builtin and then its argument prototype would still apply.  */
35857#ifdef __cplusplus
35858extern "C"
35859#endif
35860char dg_sys_info ();
35861int
35862main ()
35863{
35864return dg_sys_info ();
35865  ;
35866  return 0;
35867}
35868_ACEOF
35869if ac_fn_c_try_link "$LINENO"; then :
35870  ac_cv_lib_dgc_dg_sys_info=yes
35871else
35872  ac_cv_lib_dgc_dg_sys_info=no
35873fi
35874rm -f core conftest.err conftest.$ac_objext \
35875    conftest$ac_exeext conftest.$ac_ext
35876LIBS=$ac_check_lib_save_LIBS
35877fi
35878{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dgc_dg_sys_info" >&5
35879$as_echo "$ac_cv_lib_dgc_dg_sys_info" >&6; }
35880if test "x$ac_cv_lib_dgc_dg_sys_info" = xyes; then :
35881  cat >>confdefs.h <<_ACEOF
35882#define HAVE_LIBDGC 1
35883_ACEOF
35884
35885  LIBS="-ldgc $LIBS"
35886
35887fi
35888
35889fi
35890
35891
35892     fi
35893   fi
35894fi
35895
35896
35897if test "x$gl_save_LIBS" = x; then
35898  GETLOADAVG_LIBS=$LIBS
35899else
35900  GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
35901fi
35902LIBS=$gl_save_LIBS
35903
35904
35905# Test whether the system declares getloadavg. Solaris has the function
35906# but declares it in <sys/loadavg.h>, not <stdlib.h>.
35907for ac_header in sys/loadavg.h
35908do :
35909  ac_fn_c_check_header_mongrel "$LINENO" "sys/loadavg.h" "ac_cv_header_sys_loadavg_h" "$ac_includes_default"
35910if test "x$ac_cv_header_sys_loadavg_h" = xyes; then :
35911  cat >>confdefs.h <<_ACEOF
35912#define HAVE_SYS_LOADAVG_H 1
35913_ACEOF
35914
35915fi
35916
35917done
35918
35919if test $ac_cv_header_sys_loadavg_h = yes; then
35920  HAVE_SYS_LOADAVG_H=1
35921else
35922  HAVE_SYS_LOADAVG_H=0
35923fi
35924ac_fn_c_check_decl "$LINENO" "getloadavg" "ac_cv_have_decl_getloadavg" "#if HAVE_SYS_LOADAVG_H
35925    /* OpenIndiana has a bug: <sys/time.h> must be included before
35926       <sys/loadavg.h>.  */
35927    # include <sys/time.h>
35928    # include <sys/loadavg.h>
35929    #endif
35930    #include <stdlib.h>
35931"
35932if test "x$ac_cv_have_decl_getloadavg" = xyes; then :
35933
35934else
35935  HAVE_DECL_GETLOADAVG=0
35936fi
35937
35938
35939  if test $HAVE_GETLOADAVG = 0; then
35940
35941
35942
35943
35944
35945
35946
35947
35948  gl_LIBOBJS="$gl_LIBOBJS getloadavg.$ac_objext"
35949
35950
35951# Figure out what our getloadavg.c needs.
35952
35953
35954
35955# On HPUX9, an unprivileged user can get load averages this way.
35956if test $gl_func_getloadavg_done = no; then
35957  for ac_func in pstat_getdynamic
35958do :
35959  ac_fn_c_check_func "$LINENO" "pstat_getdynamic" "ac_cv_func_pstat_getdynamic"
35960if test "x$ac_cv_func_pstat_getdynamic" = xyes; then :
35961  cat >>confdefs.h <<_ACEOF
35962#define HAVE_PSTAT_GETDYNAMIC 1
35963_ACEOF
35964 gl_func_getloadavg_done=yes
35965fi
35966done
35967
35968fi
35969
35970# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
35971# uses stabs), but it is still SVR4.  We cannot check for <elf.h> because
35972# Irix 4.0.5F has the header but not the library.
35973if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
35974    && test "$ac_cv_lib_kvm_kvm_open" = yes; then
35975  gl_func_getloadavg_done=yes
35976
35977$as_echo "#define SVR4 1" >>confdefs.h
35978
35979fi
35980
35981if test $gl_func_getloadavg_done = no; then
35982  ac_fn_c_check_header_mongrel "$LINENO" "inq_stats/cpustats.h" "ac_cv_header_inq_stats_cpustats_h" "$ac_includes_default"
35983if test "x$ac_cv_header_inq_stats_cpustats_h" = xyes; then :
35984  gl_func_getloadavg_done=yes
35985
35986$as_echo "#define UMAX 1" >>confdefs.h
35987
35988
35989$as_echo "#define UMAX4_3 1" >>confdefs.h
35990
35991fi
35992
35993
35994fi
35995
35996if test $gl_func_getloadavg_done = no; then
35997  ac_fn_c_check_header_mongrel "$LINENO" "sys/cpustats.h" "ac_cv_header_sys_cpustats_h" "$ac_includes_default"
35998if test "x$ac_cv_header_sys_cpustats_h" = xyes; then :
35999  gl_func_getloadavg_done=yes; $as_echo "#define UMAX 1" >>confdefs.h
36000
36001fi
36002
36003
36004fi
36005
36006if test $gl_func_getloadavg_done = no; then
36007  for ac_header in mach/mach.h
36008do :
36009  ac_fn_c_check_header_mongrel "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default"
36010if test "x$ac_cv_header_mach_mach_h" = xyes; then :
36011  cat >>confdefs.h <<_ACEOF
36012#define HAVE_MACH_MACH_H 1
36013_ACEOF
36014
36015fi
36016
36017done
36018
36019fi
36020
36021for ac_header in nlist.h
36022do :
36023  ac_fn_c_check_header_mongrel "$LINENO" "nlist.h" "ac_cv_header_nlist_h" "$ac_includes_default"
36024if test "x$ac_cv_header_nlist_h" = xyes; then :
36025  cat >>confdefs.h <<_ACEOF
36026#define HAVE_NLIST_H 1
36027_ACEOF
36028 ac_fn_c_check_member "$LINENO" "struct nlist" "n_un.n_name" "ac_cv_member_struct_nlist_n_un_n_name" "#include <nlist.h>
36029"
36030if test "x$ac_cv_member_struct_nlist_n_un_n_name" = xyes; then :
36031
36032cat >>confdefs.h <<_ACEOF
36033#define HAVE_STRUCT_NLIST_N_UN_N_NAME 1
36034_ACEOF
36035
36036
36037fi
36038
36039 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36040/* end confdefs.h.  */
36041#include <nlist.h>
36042int
36043main ()
36044{
36045struct nlist x;
36046                    #ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
36047                    x.n_un.n_name = "";
36048                    #else
36049                    x.n_name = "";
36050                    #endif
36051  ;
36052  return 0;
36053}
36054_ACEOF
36055if ac_fn_c_try_link "$LINENO"; then :
36056
36057$as_echo "#define N_NAME_POINTER 1" >>confdefs.h
36058
36059fi
36060rm -f core conftest.err conftest.$ac_objext \
36061    conftest$ac_exeext conftest.$ac_ext
36062
36063fi
36064
36065done
36066
36067  fi
36068
36069
36070
36071
36072
36073          GNULIB_GETLOADAVG=1
36074
36075
36076
36077
36078
36079$as_echo "#define GNULIB_TEST_GETLOADAVG 1" >>confdefs.h
36080
36081
36082
36083
36084
36085
36086  if test $ac_cv_have_decl_getlogin = no; then
36087    HAVE_DECL_GETLOGIN=0
36088  fi
36089
36090  if test $ac_cv_func_getlogin = no; then
36091    HAVE_GETLOGIN=0
36092  fi
36093
36094  if test $HAVE_GETLOGIN = 0; then
36095
36096
36097
36098
36099
36100
36101
36102
36103  gl_LIBOBJS="$gl_LIBOBJS getlogin.$ac_objext"
36104
36105  fi
36106
36107
36108
36109
36110
36111          GNULIB_GETLOGIN=1
36112
36113
36114
36115
36116
36117$as_echo "#define GNULIB_TEST_GETLOGIN 1" >>confdefs.h
36118
36119
36120
36121
36122
36123
36124
36125
36126
36127
36128
36129
36130
36131
36132
36133
36134
36135
36136
36137
36138    REPLACE_GETOPT=0
36139    if test -n "$gl_replace_getopt"; then
36140      REPLACE_GETOPT=1
36141    fi
36142
36143  if test $REPLACE_GETOPT = 1; then
36144
36145
36146  if test $ac_cv_header_sys_cdefs_h = yes; then
36147    HAVE_SYS_CDEFS_H=1
36148  else
36149    HAVE_SYS_CDEFS_H=0
36150  fi
36151
36152
36153
36154$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
36155
36156  GETOPT_H=getopt.h
36157  GETOPT_CDEFS_H=getopt-cdefs.h
36158
36159
36160
36161  fi
36162
36163  if test $REPLACE_GETOPT = 1; then
36164
36165
36166
36167
36168
36169
36170
36171
36172  gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
36173
36174
36175
36176
36177
36178
36179
36180
36181
36182  gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
36183
36184        GNULIB_GL_UNISTD_H_GETOPT=1
36185  fi
36186
36187
36188
36189
36190
36191      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
36192$as_echo_n "checking for getpagesize... " >&6; }
36193if ${gl_cv_func_getpagesize+:} false; then :
36194  $as_echo_n "(cached) " >&6
36195else
36196  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36197/* end confdefs.h.  */
36198#include <unistd.h>
36199int
36200main ()
36201{
36202return getpagesize();
36203  ;
36204  return 0;
36205}
36206
36207_ACEOF
36208if ac_fn_c_try_link "$LINENO"; then :
36209  gl_cv_func_getpagesize=yes
36210else
36211  gl_cv_func_getpagesize=no
36212fi
36213rm -f core conftest.err conftest.$ac_objext \
36214    conftest$ac_exeext conftest.$ac_ext
36215
36216fi
36217{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
36218$as_echo "$gl_cv_func_getpagesize" >&6; }
36219
36220  if test $gl_cv_func_getpagesize = no; then
36221    HAVE_GETPAGESIZE=0
36222    for ac_header in OS.h
36223do :
36224  ac_fn_c_check_header_mongrel "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default"
36225if test "x$ac_cv_header_OS_h" = xyes; then :
36226  cat >>confdefs.h <<_ACEOF
36227#define HAVE_OS_H 1
36228_ACEOF
36229
36230fi
36231
36232done
36233
36234    if test $ac_cv_header_OS_h = yes; then
36235      HAVE_OS_H=1
36236    fi
36237    for ac_header in sys/param.h
36238do :
36239  ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default"
36240if test "x$ac_cv_header_sys_param_h" = xyes; then :
36241  cat >>confdefs.h <<_ACEOF
36242#define HAVE_SYS_PARAM_H 1
36243_ACEOF
36244
36245fi
36246
36247done
36248
36249    if test $ac_cv_header_sys_param_h = yes; then
36250      HAVE_SYS_PARAM_H=1
36251    fi
36252  fi
36253  case "$host_os" in
36254    mingw*)
36255      REPLACE_GETPAGESIZE=1
36256      ;;
36257  esac
36258      ac_fn_c_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default"
36259if test "x$ac_cv_have_decl_getpagesize" = xyes; then :
36260
36261else
36262  HAVE_DECL_GETPAGESIZE=0
36263fi
36264
36265
36266  if test $REPLACE_GETPAGESIZE = 1; then
36267
36268
36269
36270
36271
36272
36273
36274
36275  gl_LIBOBJS="$gl_LIBOBJS getpagesize.$ac_objext"
36276
36277  fi
36278
36279
36280
36281
36282
36283          GNULIB_GETPAGESIZE=1
36284
36285
36286
36287
36288
36289$as_echo "#define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h
36290
36291
36292
36293
36294
36295
36296
36297    REPLACE_GETPASS=1
36298
36299  if test $REPLACE_GETPASS = 1; then
36300
36301$as_echo "#define getpass gnu_getpass" >>confdefs.h
36302
36303  fi
36304
36305  if test $REPLACE_GETPASS = 1; then
36306
36307
36308
36309
36310
36311
36312
36313
36314  gl_LIBOBJS="$gl_LIBOBJS getpass.$ac_objext"
36315
36316
36317
36318
36319  ac_fn_c_check_decl "$LINENO" "__fsetlocking" "ac_cv_have_decl___fsetlocking" "#include <stdio.h>
36320      #if HAVE_STDIO_EXT_H
36321       #include <stdio_ext.h>
36322      #endif
36323"
36324if test "x$ac_cv_have_decl___fsetlocking" = xyes; then :
36325  ac_have_decl=1
36326else
36327  ac_have_decl=0
36328fi
36329
36330cat >>confdefs.h <<_ACEOF
36331#define HAVE_DECL___FSETLOCKING $ac_have_decl
36332_ACEOF
36333
36334
36335
36336
36337
36338
36339
36340      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcgetattr" >&5
36341$as_echo_n "checking for tcgetattr... " >&6; }
36342if ${gl_cv_func_tcgetattr+:} false; then :
36343  $as_echo_n "(cached) " >&6
36344else
36345  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36346/* end confdefs.h.  */
36347#include <termios.h>
36348            struct termios x;
36349
36350int
36351main ()
36352{
36353return tcgetattr(0,&x);
36354  ;
36355  return 0;
36356}
36357
36358_ACEOF
36359if ac_fn_c_try_link "$LINENO"; then :
36360  gl_cv_func_tcgetattr=yes
36361else
36362  gl_cv_func_tcgetattr=no
36363fi
36364rm -f core conftest.err conftest.$ac_objext \
36365    conftest$ac_exeext conftest.$ac_ext
36366
36367fi
36368{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_tcgetattr" >&5
36369$as_echo "$gl_cv_func_tcgetattr" >&6; }
36370  if test $gl_cv_func_tcgetattr = yes; then
36371    HAVE_TCGETATTR=1
36372  else
36373    HAVE_TCGETATTR=0
36374  fi
36375
36376cat >>confdefs.h <<_ACEOF
36377#define HAVE_TCGETATTR $HAVE_TCGETATTR
36378_ACEOF
36379
36380
36381      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcsetattr" >&5
36382$as_echo_n "checking for tcsetattr... " >&6; }
36383if ${gl_cv_func_tcsetattr+:} false; then :
36384  $as_echo_n "(cached) " >&6
36385else
36386  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36387/* end confdefs.h.  */
36388#include <termios.h>
36389            struct termios x;
36390
36391int
36392main ()
36393{
36394return tcsetattr(0,0,&x);
36395  ;
36396  return 0;
36397}
36398
36399_ACEOF
36400if ac_fn_c_try_link "$LINENO"; then :
36401  gl_cv_func_tcsetattr=yes
36402else
36403  gl_cv_func_tcsetattr=no
36404fi
36405rm -f core conftest.err conftest.$ac_objext \
36406    conftest$ac_exeext conftest.$ac_ext
36407
36408fi
36409{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_tcsetattr" >&5
36410$as_echo "$gl_cv_func_tcsetattr" >&6; }
36411  if test $gl_cv_func_tcsetattr = yes; then
36412    HAVE_TCSETATTR=1
36413  else
36414    HAVE_TCSETATTR=0
36415  fi
36416
36417cat >>confdefs.h <<_ACEOF
36418#define HAVE_TCSETATTR $HAVE_TCSETATTR
36419_ACEOF
36420
36421
36422  fi
36423
36424
36425
36426  ac_found=0
36427  ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
36428"
36429if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
36430  ac_have_decl=1
36431else
36432  ac_have_decl=0
36433fi
36434
36435cat >>confdefs.h <<_ACEOF
36436#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
36437_ACEOF
36438if test $ac_have_decl = 1; then :
36439  ac_found=1
36440fi
36441
36442  ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
36443"
36444if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
36445  ac_have_decl=1
36446else
36447  ac_have_decl=0
36448fi
36449
36450cat >>confdefs.h <<_ACEOF
36451#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
36452_ACEOF
36453if test $ac_have_decl = 1; then :
36454  ac_found=1
36455fi
36456
36457  ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
36458"
36459if test "x$ac_cv_have_decl___argv" = xyes; then :
36460  ac_have_decl=1
36461else
36462  ac_have_decl=0
36463fi
36464
36465cat >>confdefs.h <<_ACEOF
36466#define HAVE_DECL___ARGV $ac_have_decl
36467_ACEOF
36468if test $ac_have_decl = 1; then :
36469  ac_found=1
36470fi
36471
36472
36473  # Incur the cost of this test only if none of the above worked.
36474  if test $ac_found = 0; then
36475    # On OpenBSD 5.1, using the global __progname variable appears to be
36476    # the only way to implement getprogname.
36477    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
36478$as_echo_n "checking whether __progname is defined in default libraries... " >&6; }
36479if ${gl_cv_var___progname+:} false; then :
36480  $as_echo_n "(cached) " >&6
36481else
36482
36483        gl_cv_var___progname=
36484        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36485/* end confdefs.h.  */
36486extern char *__progname;
36487int
36488main ()
36489{
36490return *__progname;
36491
36492  ;
36493  return 0;
36494}
36495_ACEOF
36496if ac_fn_c_try_link "$LINENO"; then :
36497  gl_cv_var___progname=yes
36498
36499fi
36500rm -f core conftest.err conftest.$ac_objext \
36501    conftest$ac_exeext conftest.$ac_ext
36502
36503
36504fi
36505{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
36506$as_echo "$gl_cv_var___progname" >&6; }
36507    if test "$gl_cv_var___progname" = yes; then
36508
36509$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
36510
36511    fi
36512  fi
36513
36514
36515
36516
36517
36518
36519
36520
36521
36522
36523
36524
36525
36526
36527
36528  gl_gettimeofday_timezone=void
36529  if test $ac_cv_func_gettimeofday != yes; then
36530    HAVE_GETTIMEOFDAY=0
36531  else
36532
36533
36534
36535
36536 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
36537$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
36538if ${gl_cv_func_gettimeofday_clobber+:} false; then :
36539  $as_echo_n "(cached) " >&6
36540else
36541  if test "$cross_compiling" = yes; then :
36542  # When cross-compiling:
36543      case "$host_os" in
36544                       # Guess all is fine on glibc systems.
36545        *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
36546                       # Guess no on native Windows.
36547        mingw*)        gl_cv_func_gettimeofday_clobber="guessing no" ;;
36548                       # If we don't know, assume the worst.
36549        *)             gl_cv_func_gettimeofday_clobber="guessing yes" ;;
36550      esac
36551
36552else
36553  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36554/* end confdefs.h.  */
36555#include <string.h>
36556          #include <sys/time.h>
36557          #include <time.h>
36558          #include <stdlib.h>
36559
36560int
36561main ()
36562{
36563
36564          time_t t = 0;
36565          struct tm *lt;
36566          struct tm saved_lt;
36567          struct timeval tv;
36568          lt = localtime (&t);
36569          saved_lt = *lt;
36570          gettimeofday (&tv, NULL);
36571          return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
36572
36573  ;
36574  return 0;
36575}
36576_ACEOF
36577if ac_fn_c_try_run "$LINENO"; then :
36578  gl_cv_func_gettimeofday_clobber=no
36579else
36580  gl_cv_func_gettimeofday_clobber=yes
36581fi
36582rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
36583  conftest.$ac_objext conftest.beam conftest.$ac_ext
36584fi
36585
36586fi
36587{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5
36588$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
36589
36590 case "$gl_cv_func_gettimeofday_clobber" in
36591   *yes)
36592     REPLACE_GETTIMEOFDAY=1
36593
36594$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
36595
36596
36597
36598
36599  NEED_LOCALTIME_BUFFER=1
36600  REPLACE_GMTIME=1
36601  REPLACE_LOCALTIME=1
36602
36603     ;;
36604 esac
36605
36606    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
36607$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
36608if ${gl_cv_func_gettimeofday_posix_signature+:} false; then :
36609  $as_echo_n "(cached) " >&6
36610else
36611  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36612/* end confdefs.h.  */
36613#include <sys/time.h>
36614              struct timeval c;
36615              int gettimeofday (struct timeval *restrict, void *restrict);
36616
36617int
36618main ()
36619{
36620/* glibc uses struct timezone * rather than the POSIX void *
36621                 if _GNU_SOURCE is defined.  However, since the only portable
36622                 use of gettimeofday uses NULL as the second parameter, and
36623                 since the glibc definition is actually more typesafe, it is
36624                 not worth wrapping this to get a compliant signature.  */
36625              int (*f) (struct timeval *restrict, void *restrict)
36626                = gettimeofday;
36627              int x = f (&c, 0);
36628              return !(x | c.tv_sec | c.tv_usec);
36629
36630  ;
36631  return 0;
36632}
36633_ACEOF
36634if ac_fn_c_try_compile "$LINENO"; then :
36635  gl_cv_func_gettimeofday_posix_signature=yes
36636else
36637  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36638/* end confdefs.h.  */
36639#include <sys/time.h>
36640int gettimeofday (struct timeval *restrict, struct timezone *restrict);
36641
36642int
36643main ()
36644{
36645
36646  ;
36647  return 0;
36648}
36649_ACEOF
36650if ac_fn_c_try_compile "$LINENO"; then :
36651  gl_cv_func_gettimeofday_posix_signature=almost
36652else
36653  gl_cv_func_gettimeofday_posix_signature=no
36654fi
36655rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36656fi
36657rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36658fi
36659{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
36660$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
36661    if test $gl_cv_func_gettimeofday_posix_signature = almost; then
36662      gl_gettimeofday_timezone='struct timezone'
36663    elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
36664      REPLACE_GETTIMEOFDAY=1
36665    fi
36666        if test $REPLACE_STRUCT_TIMEVAL = 1; then
36667      REPLACE_GETTIMEOFDAY=1
36668    fi
36669            case "$host_os" in
36670      mingw*) REPLACE_GETTIMEOFDAY=1 ;;
36671    esac
36672  fi
36673
36674cat >>confdefs.h <<_ACEOF
36675#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
36676_ACEOF
36677
36678
36679  if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
36680
36681
36682
36683
36684
36685
36686
36687
36688  gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
36689
36690    :
36691  fi
36692
36693
36694
36695
36696
36697          GNULIB_GETTIMEOFDAY=1
36698
36699
36700
36701
36702
36703$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
36704
36705
36706
36707
36708
36709
36710
36711
36712
36713
36714
36715
36716  if test $ac_cv_func_getusershell = yes; then
36717    HAVE_GETUSERSHELL=1
36718        ac_fn_c_check_decl "$LINENO" "getusershell" "ac_cv_have_decl_getusershell" "$ac_includes_default"
36719if test "x$ac_cv_have_decl_getusershell" = xyes; then :
36720  ac_have_decl=1
36721else
36722  ac_have_decl=0
36723fi
36724
36725cat >>confdefs.h <<_ACEOF
36726#define HAVE_DECL_GETUSERSHELL $ac_have_decl
36727_ACEOF
36728
36729    if test $ac_cv_have_decl_getusershell = no; then
36730      HAVE_DECL_GETUSERSHELL=0
36731    fi
36732  else
36733    HAVE_GETUSERSHELL=0
36734        HAVE_DECL_GETUSERSHELL=0
36735  fi
36736
36737  if test $HAVE_GETUSERSHELL = 0; then
36738
36739
36740
36741
36742
36743
36744
36745
36746  gl_LIBOBJS="$gl_LIBOBJS getusershell.$ac_objext"
36747
36748  fi
36749
36750
36751
36752
36753
36754          GNULIB_GETUSERSHELL=1
36755
36756
36757
36758
36759
36760$as_echo "#define GNULIB_TEST_GETUSERSHELL 1" >>confdefs.h
36761
36762
36763
36764
36765   if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
36766  GNU_MAKE_TRUE=
36767  GNU_MAKE_FALSE='#'
36768else
36769  GNU_MAKE_TRUE='#'
36770  GNU_MAKE_FALSE=
36771fi
36772
36773
36774  # Autoconf 2.61a.99 and earlier don't support linking a file only
36775  # in VPATH builds.  But since GNUmakefile is for maintainer use
36776  # only, it does not matter if we skip the link with older autoconf.
36777  # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
36778  # builds, so use a shell variable to bypass this.
36779  GNUmakefile=GNUmakefile
36780  ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
36781
36782
36783
36784
36785
36786
36787      ac_fn_c_check_func "$LINENO" "group_member" "ac_cv_func_group_member"
36788if test "x$ac_cv_func_group_member" = xyes; then :
36789
36790else
36791
36792    HAVE_GROUP_MEMBER=0
36793
36794fi
36795
36796
36797  if test $HAVE_GROUP_MEMBER = 0; then
36798
36799
36800
36801
36802
36803
36804
36805
36806  gl_LIBOBJS="$gl_LIBOBJS group-member.$ac_objext"
36807
36808
36809
36810
36811  fi
36812
36813
36814
36815
36816
36817          GNULIB_GROUP_MEMBER=1
36818
36819
36820
36821
36822
36823$as_echo "#define GNULIB_TEST_GROUP_MEMBER 1" >>confdefs.h
36824
36825
36826
36827
36828  :
36829
36830
36831
36832    { $as_echo "$as_me:${as_lineno-$LINENO}: checking host operating system" >&5
36833$as_echo_n "checking host operating system... " >&6; }
36834if ${gl_cv_host_operating_system+:} false; then :
36835  $as_echo_n "(cached) " >&6
36836else
36837  case $host_os in
36838
36839       # These operating system names do not use the default heuristic below.
36840       # They are in reverse order, so that more-specific prefixes come first.
36841       winnt*)          os='Windows NT';;
36842       vos*)            os='VOS';;
36843       sysv*)           os='Unix System V';;
36844       superux*)        os='SUPER-UX';;
36845       sunos*)          os='SunOS';;
36846       stop*)           os='STOP';;
36847       sco*)            os='SCO Unix';;
36848       riscos*)         os='RISC OS';;
36849       riscix*)         os='RISCiX';;
36850       qnx*)            os='QNX';;
36851       pw32*)           os='PW32';;
36852       ptx*)            os='ptx';;
36853       plan9*)          os='Plan 9';;
36854       osf*)            os='Tru64';;
36855       os2*)            os='OS/2';;
36856       openbsd*)        os='OpenBSD';;
36857       nsk*)            os='NonStop Kernel';;
36858       nonstopux*)      os='NonStop-UX';;
36859       netbsd*-gnu*)    os='GNU/NetBSD';; # NetBSD kernel+libc, GNU userland
36860       netbsd*)         os='NetBSD';;
36861       mirbsd*)         os='MirBSD';;
36862       knetbsd*-gnu)    os='GNU/kNetBSD';; # NetBSD kernel, GNU libc+userland
36863       kfreebsd*-gnu)   os='GNU/kFreeBSD';; # FreeBSD kernel, GNU libc+userland
36864       msdosdjgpp*)     os='DJGPP';;
36865       mpeix*)          os='MPE/iX';;
36866       mint*)           os='MiNT';;
36867       mingw*)          os='MinGW';;
36868       lynxos*)         os='LynxOS';;
36869       linux*)          os='GNU/Linux';;
36870       hpux*)           os='HP-UX';;
36871       hiux*)           os='HI-UX';;
36872       gnu*)            os='GNU';;
36873       freebsd*)        os='FreeBSD';;
36874       dgux*)           os='DG/UX';;
36875       bsdi*)           os='BSD/OS';;
36876       bsd*)            os='BSD';;
36877       beos*)           os='BeOS';;
36878       aux*)            os='A/UX';;
36879       atheos*)         os='AtheOS';;
36880       amigaos*)        os='Amiga OS';;
36881       aix*)            os='AIX';;
36882
36883       # The default heuristic takes the initial alphabetic string
36884       # from $host_os, but capitalizes its first letter.
36885       [A-Za-z]*)
36886         os=`
36887           expr "X$host_os" : 'X\([A-Za-z]\)' | LC_ALL=C tr '[a-z]' '[A-Z]'
36888         ``
36889           expr "X$host_os" : 'X.\([A-Za-z]*\)'
36890         `
36891         ;;
36892
36893       # If $host_os does not start with an alphabetic string, use it unchanged.
36894       *)
36895         os=$host_os;;
36896     esac
36897     gl_cv_host_operating_system=$os
36898fi
36899{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_operating_system" >&5
36900$as_echo "$gl_cv_host_operating_system" >&6; }
36901
36902cat >>confdefs.h <<_ACEOF
36903#define HOST_OPERATING_SYSTEM "$gl_cv_host_operating_system"
36904_ACEOF
36905
36906
36907
36908                  HOSTENT_LIB=
36909  gl_saved_libs="$LIBS"
36910  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
36911$as_echo_n "checking for library containing gethostbyname... " >&6; }
36912if ${ac_cv_search_gethostbyname+:} false; then :
36913  $as_echo_n "(cached) " >&6
36914else
36915  ac_func_search_save_LIBS=$LIBS
36916cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36917/* end confdefs.h.  */
36918
36919/* Override any GCC internal prototype to avoid an error.
36920   Use char because int might match the return type of a GCC
36921   builtin and then its argument prototype would still apply.  */
36922#ifdef __cplusplus
36923extern "C"
36924#endif
36925char gethostbyname ();
36926int
36927main ()
36928{
36929return gethostbyname ();
36930  ;
36931  return 0;
36932}
36933_ACEOF
36934for ac_lib in '' nsl network net; do
36935  if test -z "$ac_lib"; then
36936    ac_res="none required"
36937  else
36938    ac_res=-l$ac_lib
36939    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
36940  fi
36941  if ac_fn_c_try_link "$LINENO"; then :
36942  ac_cv_search_gethostbyname=$ac_res
36943fi
36944rm -f core conftest.err conftest.$ac_objext \
36945    conftest$ac_exeext
36946  if ${ac_cv_search_gethostbyname+:} false; then :
36947  break
36948fi
36949done
36950if ${ac_cv_search_gethostbyname+:} false; then :
36951
36952else
36953  ac_cv_search_gethostbyname=no
36954fi
36955rm conftest.$ac_ext
36956LIBS=$ac_func_search_save_LIBS
36957fi
36958{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
36959$as_echo "$ac_cv_search_gethostbyname" >&6; }
36960ac_res=$ac_cv_search_gethostbyname
36961if test "$ac_res" != no; then :
36962  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
36963  if test "$ac_cv_search_gethostbyname" != "none required"; then
36964       HOSTENT_LIB="$ac_cv_search_gethostbyname"
36965     fi
36966fi
36967
36968  LIBS="$gl_saved_libs"
36969  if test -z "$HOSTENT_LIB"; then
36970    for ac_func in gethostbyname
36971do :
36972  ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
36973if test "x$ac_cv_func_gethostbyname" = xyes; then :
36974  cat >>confdefs.h <<_ACEOF
36975#define HAVE_GETHOSTBYNAME 1
36976_ACEOF
36977
36978else
36979
36980      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in winsock2.h and -lws2_32" >&5
36981$as_echo_n "checking for gethostbyname in winsock2.h and -lws2_32... " >&6; }
36982if ${gl_cv_w32_gethostbyname+:} false; then :
36983  $as_echo_n "(cached) " >&6
36984else
36985  gl_cv_w32_gethostbyname=no
36986         gl_save_LIBS="$LIBS"
36987         LIBS="$LIBS -lws2_32"
36988         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36989/* end confdefs.h.  */
36990
36991#ifdef HAVE_WINSOCK2_H
36992#include <winsock2.h>
36993#endif
36994#include <stddef.h>
36995
36996int
36997main ()
36998{
36999gethostbyname(NULL);
37000  ;
37001  return 0;
37002}
37003_ACEOF
37004if ac_fn_c_try_link "$LINENO"; then :
37005  gl_cv_w32_gethostbyname=yes
37006fi
37007rm -f core conftest.err conftest.$ac_objext \
37008    conftest$ac_exeext conftest.$ac_ext
37009         LIBS="$gl_save_LIBS"
37010
37011fi
37012{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_gethostbyname" >&5
37013$as_echo "$gl_cv_w32_gethostbyname" >&6; }
37014      if test "$gl_cv_w32_gethostbyname" = "yes"; then
37015        HOSTENT_LIB="-lws2_32"
37016      fi
37017
37018fi
37019done
37020
37021  fi
37022
37023
37024
37025  :
37026
37027
37028  :
37029
37030
37031
37032
37033
37034
37035
37036          GNULIB_ICONV=1
37037
37038
37039
37040
37041
37042
37043
37044
37045
37046
37047
37048
37049
37050
37051
37052
37053     if test $gl_cv_have_include_next = yes; then
37054       gl_cv_next_iconv_h='<'iconv.h'>'
37055     else
37056       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <iconv.h>" >&5
37057$as_echo_n "checking absolute name of <iconv.h>... " >&6; }
37058if ${gl_cv_next_iconv_h+:} false; then :
37059  $as_echo_n "(cached) " >&6
37060else
37061
37062             if test $ac_cv_header_iconv_h = yes; then
37063
37064
37065
37066
37067  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37068/* end confdefs.h.  */
37069#include <iconv.h>
37070_ACEOF
37071                case "$host_os" in
37072    aix*) gl_absname_cpp="$ac_cpp -C" ;;
37073    *)    gl_absname_cpp="$ac_cpp" ;;
37074  esac
37075
37076  case "$host_os" in
37077    mingw*)
37078                                          gl_dirsep_regex='[/\\]'
37079      ;;
37080    *)
37081      gl_dirsep_regex='\/'
37082      ;;
37083  esac
37084      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
37085  gl_header_literal_regex=`echo 'iconv.h' \
37086                           | sed -e "$gl_make_literal_regex_sed"`
37087  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
37088      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
37089      s|^/[^/]|//&|
37090      p
37091      q
37092    }'
37093
37094        gl_cv_absolute_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
37095  sed -n "$gl_absolute_header_sed"`
37096
37097           gl_header=$gl_cv_absolute_iconv_h
37098           gl_cv_next_iconv_h='"'$gl_header'"'
37099          else
37100               gl_cv_next_iconv_h='<'iconv.h'>'
37101             fi
37102
37103
37104fi
37105{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5
37106$as_echo "$gl_cv_next_iconv_h" >&6; }
37107     fi
37108     NEXT_ICONV_H=$gl_cv_next_iconv_h
37109
37110     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
37111       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
37112       gl_next_as_first_directive='<'iconv.h'>'
37113     else
37114       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
37115       gl_next_as_first_directive=$gl_cv_next_iconv_h
37116     fi
37117     NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive
37118
37119
37120
37121
37122
37123
37124
37125
37126
37127  if test "$am_cv_func_iconv" = yes; then
37128
37129
37130  ICONV_H='iconv.h'
37131   if test -n "$ICONV_H"; then
37132  GL_GENERATE_ICONV_H_TRUE=
37133  GL_GENERATE_ICONV_H_FALSE='#'
37134else
37135  GL_GENERATE_ICONV_H_TRUE='#'
37136  GL_GENERATE_ICONV_H_FALSE=
37137fi
37138
37139
37140            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37141/* end confdefs.h.  */
37142
37143      #include <iconv.h>
37144      #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
37145       gnu_iconv
37146      #endif
37147
37148_ACEOF
37149if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
37150  $EGREP "gnu_iconv" >/dev/null 2>&1; then :
37151  gl_func_iconv_gnu=yes
37152else
37153  gl_func_iconv_gnu=no
37154fi
37155rm -f conftest*
37156
37157    if test $gl_func_iconv_gnu = no; then
37158      iconv_flavor=
37159      case "$host_os" in
37160        aix*)     iconv_flavor=ICONV_FLAVOR_AIX ;;
37161        irix*)    iconv_flavor=ICONV_FLAVOR_IRIX ;;
37162        hpux*)    iconv_flavor=ICONV_FLAVOR_HPUX ;;
37163        osf*)     iconv_flavor=ICONV_FLAVOR_OSF ;;
37164        solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
37165      esac
37166      if test -n "$iconv_flavor"; then
37167
37168cat >>confdefs.h <<_ACEOF
37169#define ICONV_FLAVOR $iconv_flavor
37170_ACEOF
37171
37172
37173
37174
37175  ICONV_H='iconv.h'
37176   if test -n "$ICONV_H"; then
37177  GL_GENERATE_ICONV_H_TRUE=
37178  GL_GENERATE_ICONV_H_FALSE='#'
37179else
37180  GL_GENERATE_ICONV_H_TRUE='#'
37181  GL_GENERATE_ICONV_H_FALSE=
37182fi
37183
37184
37185  REPLACE_ICONV_OPEN=1
37186
37187      fi
37188    fi
37189
37190  fi
37191
37192  if test $REPLACE_ICONV_OPEN = 1; then
37193
37194
37195
37196
37197
37198
37199
37200
37201  gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext"
37202
37203  fi
37204  if test $REPLACE_ICONV = 1; then
37205
37206
37207
37208
37209
37210
37211
37212
37213  gl_LIBOBJS="$gl_LIBOBJS iconv.$ac_objext"
37214
37215
37216
37217
37218
37219
37220
37221
37222
37223  gl_LIBOBJS="$gl_LIBOBJS iconv_close.$ac_objext"
37224
37225  fi
37226
37227  :
37228
37229
37230
37231
37232
37233
37234
37235
37236                HAVE_INET_NTOP=1
37237  INET_NTOP_LIB=
37238
37239
37240
37241
37242  if test $ac_cv_header_sys_socket_h != yes; then
37243                    for ac_header in winsock2.h
37244do :
37245  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
37246if test "x$ac_cv_header_winsock2_h" = xyes; then :
37247  cat >>confdefs.h <<_ACEOF
37248#define HAVE_WINSOCK2_H 1
37249_ACEOF
37250
37251fi
37252
37253done
37254
37255  fi
37256  if test "$ac_cv_header_winsock2_h" = yes; then
37257    HAVE_WINSOCK2_H=1
37258    UNISTD_H_HAVE_WINSOCK2_H=1
37259    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
37260  else
37261    HAVE_WINSOCK2_H=0
37262  fi
37263
37264
37265  if test $HAVE_WINSOCK2_H = 1; then
37266    ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
37267"
37268if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
37269  ac_have_decl=1
37270else
37271  ac_have_decl=0
37272fi
37273
37274cat >>confdefs.h <<_ACEOF
37275#define HAVE_DECL_INET_NTOP $ac_have_decl
37276_ACEOF
37277
37278    if test $ac_cv_have_decl_inet_ntop = yes; then
37279                  REPLACE_INET_NTOP=1
37280      INET_NTOP_LIB="-lws2_32"
37281    else
37282      HAVE_DECL_INET_NTOP=0
37283      HAVE_INET_NTOP=0
37284    fi
37285  else
37286    gl_save_LIBS=$LIBS
37287    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
37288$as_echo_n "checking for library containing inet_ntop... " >&6; }
37289if ${ac_cv_search_inet_ntop+:} false; then :
37290  $as_echo_n "(cached) " >&6
37291else
37292  ac_func_search_save_LIBS=$LIBS
37293cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37294/* end confdefs.h.  */
37295
37296/* Override any GCC internal prototype to avoid an error.
37297   Use char because int might match the return type of a GCC
37298   builtin and then its argument prototype would still apply.  */
37299#ifdef __cplusplus
37300extern "C"
37301#endif
37302char inet_ntop ();
37303int
37304main ()
37305{
37306return inet_ntop ();
37307  ;
37308  return 0;
37309}
37310_ACEOF
37311for ac_lib in '' nsl resolv network; do
37312  if test -z "$ac_lib"; then
37313    ac_res="none required"
37314  else
37315    ac_res=-l$ac_lib
37316    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
37317  fi
37318  if ac_fn_c_try_link "$LINENO"; then :
37319  ac_cv_search_inet_ntop=$ac_res
37320fi
37321rm -f core conftest.err conftest.$ac_objext \
37322    conftest$ac_exeext
37323  if ${ac_cv_search_inet_ntop+:} false; then :
37324  break
37325fi
37326done
37327if ${ac_cv_search_inet_ntop+:} false; then :
37328
37329else
37330  ac_cv_search_inet_ntop=no
37331fi
37332rm conftest.$ac_ext
37333LIBS=$ac_func_search_save_LIBS
37334fi
37335{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
37336$as_echo "$ac_cv_search_inet_ntop" >&6; }
37337ac_res=$ac_cv_search_inet_ntop
37338if test "$ac_res" != no; then :
37339  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
37340
37341else
37342  for ac_func in inet_ntop
37343do :
37344  ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
37345if test "x$ac_cv_func_inet_ntop" = xyes; then :
37346  cat >>confdefs.h <<_ACEOF
37347#define HAVE_INET_NTOP 1
37348_ACEOF
37349
37350fi
37351done
37352
37353       if test $ac_cv_func_inet_ntop = no; then
37354         HAVE_INET_NTOP=0
37355       fi
37356
37357fi
37358
37359    LIBS=$gl_save_LIBS
37360
37361    if test "$ac_cv_search_inet_ntop" != "no" \
37362       && test "$ac_cv_search_inet_ntop" != "none required"; then
37363      INET_NTOP_LIB="$ac_cv_search_inet_ntop"
37364    fi
37365
37366
37367    ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
37368        #if HAVE_NETDB_H
37369        # include <netdb.h>
37370        #endif
37371
37372"
37373if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
37374  ac_have_decl=1
37375else
37376  ac_have_decl=0
37377fi
37378
37379cat >>confdefs.h <<_ACEOF
37380#define HAVE_DECL_INET_NTOP $ac_have_decl
37381_ACEOF
37382
37383    if test $ac_cv_have_decl_inet_ntop = no; then
37384      HAVE_DECL_INET_NTOP=0
37385    fi
37386  fi
37387
37388
37389  if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
37390
37391
37392
37393
37394
37395
37396
37397
37398  gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext"
37399
37400
37401
37402
37403  fi
37404
37405
37406
37407
37408
37409          GNULIB_INET_NTOP=1
37410
37411
37412
37413
37414
37415
37416  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5
37417$as_echo_n "checking whether the compiler generally respects inline... " >&6; }
37418if ${gl_cv_c_inline_effective+:} false; then :
37419  $as_echo_n "(cached) " >&6
37420else
37421  if test $ac_cv_c_inline = no; then
37422       gl_cv_c_inline_effective=no
37423     else
37424                                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37425/* end confdefs.h.  */
37426
37427int
37428main ()
37429{
37430#ifdef __NO_INLINE__
37431               #error "inline is not effective"
37432             #endif
37433  ;
37434  return 0;
37435}
37436_ACEOF
37437if ac_fn_c_try_compile "$LINENO"; then :
37438  gl_cv_c_inline_effective=yes
37439else
37440  gl_cv_c_inline_effective=no
37441fi
37442rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37443     fi
37444
37445fi
37446{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5
37447$as_echo "$gl_cv_c_inline_effective" >&6; }
37448  if test $gl_cv_c_inline_effective = yes; then
37449
37450$as_echo "#define HAVE_INLINE 1" >>confdefs.h
37451
37452  fi
37453
37454
37455
37456
37457  :
37458
37459  :
37460  :
37461  :
37462  :
37463
37464
37465
37466
37467
37468
37469  PRIPTR_PREFIX=
37470  if test -n "$STDINT_H"; then
37471        PRIPTR_PREFIX='"l"'
37472  else
37473        for glpfx in '' l ll I64; do
37474      case $glpfx in
37475        '')  gltype1='int';;
37476        l)   gltype1='long int';;
37477        ll)  gltype1='long long int';;
37478        I64) gltype1='__int64';;
37479      esac
37480      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37481/* end confdefs.h.  */
37482#include <stdint.h>
37483           extern intptr_t foo;
37484           extern $gltype1 foo;
37485int
37486main ()
37487{
37488
37489  ;
37490  return 0;
37491}
37492_ACEOF
37493if ac_fn_c_try_compile "$LINENO"; then :
37494  PRIPTR_PREFIX='"'$glpfx'"'
37495fi
37496rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37497      test -n "$PRIPTR_PREFIX" && break
37498    done
37499  fi
37500
37501
37502
37503  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
37504$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
37505if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then :
37506  $as_echo_n "(cached) " >&6
37507else
37508  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37509/* end confdefs.h.  */
37510/* Work also in C++ mode.  */
37511            #define __STDC_LIMIT_MACROS 1
37512
37513            /* Work if build is not clean.  */
37514            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
37515
37516            #include <limits.h>
37517            #if HAVE_STDINT_H
37518             #include <stdint.h>
37519            #endif
37520
37521            #if defined INT32_MAX && defined INTMAX_MAX
37522             #define CONDITION (INT32_MAX < INTMAX_MAX)
37523            #elif HAVE_LONG_LONG_INT
37524             #define CONDITION (sizeof (int) < sizeof (long long int))
37525            #else
37526             #define CONDITION 0
37527            #endif
37528            int test[CONDITION ? 1 : -1];
37529int
37530main ()
37531{
37532
37533  ;
37534  return 0;
37535}
37536_ACEOF
37537if ac_fn_c_try_compile "$LINENO"; then :
37538  gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
37539else
37540  gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
37541fi
37542rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37543fi
37544{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
37545$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
37546  if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
37547    INT32_MAX_LT_INTMAX_MAX=1;
37548  else
37549    INT32_MAX_LT_INTMAX_MAX=0;
37550  fi
37551
37552
37553  if test $APPLE_UNIVERSAL_BUILD = 0; then
37554
37555  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
37556$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; }
37557if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then :
37558  $as_echo_n "(cached) " >&6
37559else
37560  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37561/* end confdefs.h.  */
37562/* Work also in C++ mode.  */
37563            #define __STDC_LIMIT_MACROS 1
37564
37565            /* Work if build is not clean.  */
37566            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
37567
37568            #include <limits.h>
37569            #if HAVE_STDINT_H
37570             #include <stdint.h>
37571            #endif
37572
37573            #if defined INT64_MAX
37574             #define CONDITION (INT64_MAX == LONG_MAX)
37575            #elif HAVE_LONG_LONG_INT
37576             #define CONDITION (sizeof (long long int) == sizeof (long int))
37577            #else
37578             #define CONDITION 0
37579            #endif
37580            int test[CONDITION ? 1 : -1];
37581int
37582main ()
37583{
37584
37585  ;
37586  return 0;
37587}
37588_ACEOF
37589if ac_fn_c_try_compile "$LINENO"; then :
37590  gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
37591else
37592  gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
37593fi
37594rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37595fi
37596{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
37597$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
37598  if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
37599    INT64_MAX_EQ_LONG_MAX=1;
37600  else
37601    INT64_MAX_EQ_LONG_MAX=0;
37602  fi
37603
37604
37605  else
37606    INT64_MAX_EQ_LONG_MAX=-1
37607  fi
37608
37609  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
37610$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
37611if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then :
37612  $as_echo_n "(cached) " >&6
37613else
37614  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37615/* end confdefs.h.  */
37616/* Work also in C++ mode.  */
37617            #define __STDC_LIMIT_MACROS 1
37618
37619            /* Work if build is not clean.  */
37620            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
37621
37622            #include <limits.h>
37623            #if HAVE_STDINT_H
37624             #include <stdint.h>
37625            #endif
37626
37627            #if defined UINT32_MAX && defined UINTMAX_MAX
37628             #define CONDITION (UINT32_MAX < UINTMAX_MAX)
37629            #elif HAVE_LONG_LONG_INT
37630             #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
37631            #else
37632             #define CONDITION 0
37633            #endif
37634            int test[CONDITION ? 1 : -1];
37635int
37636main ()
37637{
37638
37639  ;
37640  return 0;
37641}
37642_ACEOF
37643if ac_fn_c_try_compile "$LINENO"; then :
37644  gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
37645else
37646  gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
37647fi
37648rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37649fi
37650{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
37651$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
37652  if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
37653    UINT32_MAX_LT_UINTMAX_MAX=1;
37654  else
37655    UINT32_MAX_LT_UINTMAX_MAX=0;
37656  fi
37657
37658
37659  if test $APPLE_UNIVERSAL_BUILD = 0; then
37660
37661  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
37662$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
37663if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then :
37664  $as_echo_n "(cached) " >&6
37665else
37666  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37667/* end confdefs.h.  */
37668/* Work also in C++ mode.  */
37669            #define __STDC_LIMIT_MACROS 1
37670
37671            /* Work if build is not clean.  */
37672            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
37673
37674            #include <limits.h>
37675            #if HAVE_STDINT_H
37676             #include <stdint.h>
37677            #endif
37678
37679            #if defined UINT64_MAX
37680             #define CONDITION (UINT64_MAX == ULONG_MAX)
37681            #elif HAVE_LONG_LONG_INT
37682             #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
37683            #else
37684             #define CONDITION 0
37685            #endif
37686            int test[CONDITION ? 1 : -1];
37687int
37688main ()
37689{
37690
37691  ;
37692  return 0;
37693}
37694_ACEOF
37695if ac_fn_c_try_compile "$LINENO"; then :
37696  gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
37697else
37698  gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
37699fi
37700rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37701fi
37702{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
37703$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
37704  if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
37705    UINT64_MAX_EQ_ULONG_MAX=1;
37706  else
37707    UINT64_MAX_EQ_ULONG_MAX=0;
37708  fi
37709
37710
37711  else
37712    UINT64_MAX_EQ_ULONG_MAX=-1
37713  fi
37714
37715
37716
37717
37718  # OpenVMS has isapipe already, so check for it.
37719  for ac_func in isapipe
37720do :
37721  ac_fn_c_check_func "$LINENO" "isapipe" "ac_cv_func_isapipe"
37722if test "x$ac_cv_func_isapipe" = xyes; then :
37723  cat >>confdefs.h <<_ACEOF
37724#define HAVE_ISAPIPE 1
37725_ACEOF
37726
37727fi
37728done
37729
37730  if test $ac_cv_func_isapipe = yes; then
37731    HAVE_ISAPIPE=1
37732  else
37733    HAVE_ISAPIPE=0
37734  fi
37735
37736  if test $HAVE_ISAPIPE = 0; then
37737
37738
37739
37740
37741
37742
37743
37744
37745  gl_LIBOBJS="$gl_LIBOBJS isapipe.$ac_objext"
37746
37747
37748  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pipes are FIFOs (and for their link count)" >&5
37749$as_echo_n "checking whether pipes are FIFOs (and for their link count)... " >&6; }
37750if ${gl_cv_pipes_are_fifos+:} false; then :
37751  $as_echo_n "(cached) " >&6
37752else
37753  if test "$cross_compiling" = yes; then :
37754  gl_cv_pipes_are_fifos=cross-compiling
37755else
37756  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37757/* end confdefs.h.  */
37758#include <stdio.h>
37759            #include <sys/types.h>
37760            #include <sys/stat.h>
37761            #include <unistd.h>
37762            #ifndef S_ISFIFO
37763             #define S_ISFIFO(m) 0
37764            #endif
37765            #ifndef S_ISSOCK
37766             #define S_ISSOCK(m) 0
37767            #endif
37768            int
37769            main (int argc, char **argv)
37770            {
37771              int fd[2];
37772              struct stat st;
37773              if (pipe (fd) != 0)
37774                return 1;
37775              if (fstat (fd[0], &st) != 0)
37776                return 2;
37777              if (2 <= argc && argv[1][0] == '-')
37778                {
37779                  char const *yesno = (S_ISFIFO (st.st_mode) ? "yes" : "no");
37780                  if (st.st_nlink <= 1)
37781                    {
37782                      long int i = st.st_nlink;
37783                      if (i != st.st_nlink)
37784                        return 3;
37785                      printf ("%s (%ld)\n", yesno, i);
37786                    }
37787                  else
37788                    {
37789                      unsigned long int i = st.st_nlink;
37790                      if (i != st.st_nlink)
37791                        return 4;
37792                      printf ("%s (%lu)\n", yesno, i);
37793                    }
37794                }
37795              else
37796                {
37797                  if (! S_ISFIFO (st.st_mode) && ! S_ISSOCK (st.st_mode))
37798                    return 5;
37799                }
37800              return 0;
37801            }
37802_ACEOF
37803if ac_fn_c_try_run "$LINENO"; then :
37804  gl_cv_pipes_are_fifos=`./conftest$ac_exeext -`
37805        test -z "$gl_cv_pipes_are_fifos" && gl_cv_pipes_are_fifos=no
37806else
37807  gl_cv_pipes_are_fifos=unknown
37808fi
37809rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
37810  conftest.$ac_objext conftest.beam conftest.$ac_ext
37811fi
37812
37813fi
37814{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pipes_are_fifos" >&5
37815$as_echo "$gl_cv_pipes_are_fifos" >&6; }
37816
37817  case $gl_cv_pipes_are_fifos in #(
37818  'yes ('*')')
37819
37820$as_echo "#define HAVE_FIFO_PIPES 1" >>confdefs.h
37821;; #(
37822  'no ('*')')
37823    $as_echo "#define HAVE_FIFO_PIPES 0" >>confdefs.h
37824;;
37825  esac
37826
37827  case $gl_cv_pipes_are_fifos in #(
37828  *'('*')')
37829
37830cat >>confdefs.h <<_ACEOF
37831#define PIPE_LINK_COUNT_MAX `expr "$gl_cv_pipes_are_fifos" : '.*\((.*)\)'`
37832_ACEOF
37833;;
37834  esac
37835
37836  fi
37837
37838
37839         case $host_os in
37840    mingw*) REPLACE_ISATTY=1 ;;
37841  esac
37842
37843  if test $REPLACE_ISATTY = 1; then
37844
37845
37846
37847
37848
37849
37850
37851
37852  gl_LIBOBJS="$gl_LIBOBJS isatty.$ac_objext"
37853
37854    :
37855  fi
37856
37857
37858
37859
37860
37861          GNULIB_ISATTY=1
37862
37863
37864
37865
37866
37867$as_echo "#define GNULIB_TEST_ISATTY 1" >>confdefs.h
37868
37869
37870
37871
37872
37873
37874
37875
37876  if test $ac_cv_func_isblank = no; then
37877    HAVE_ISBLANK=0
37878  fi
37879
37880  if test $HAVE_ISBLANK = 0; then
37881
37882
37883
37884
37885
37886
37887
37888
37889  gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext"
37890
37891  fi
37892
37893
37894
37895
37896
37897          GNULIB_ISBLANK=1
37898
37899
37900
37901
37902
37903
37904  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
37905$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
37906if ${gl_cv_func_isnand_no_libm+:} false; then :
37907  $as_echo_n "(cached) " >&6
37908else
37909
37910      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37911/* end confdefs.h.  */
37912#include <math.h>
37913             #if __GNUC__ >= 4
37914             # undef isnand
37915             # define isnand(x) __builtin_isnan ((double)(x))
37916             #else
37917             # undef isnand
37918             # define isnand(x) isnan ((double)(x))
37919             #endif
37920             double x;
37921int
37922main ()
37923{
37924return isnand (x);
37925  ;
37926  return 0;
37927}
37928_ACEOF
37929if ac_fn_c_try_link "$LINENO"; then :
37930  gl_cv_func_isnand_no_libm=yes
37931else
37932  gl_cv_func_isnand_no_libm=no
37933fi
37934rm -f core conftest.err conftest.$ac_objext \
37935    conftest$ac_exeext conftest.$ac_ext
37936
37937fi
37938{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
37939$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
37940
37941  gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
37942  if test $gl_cv_func_isnand_no_libm = yes; then
37943
37944$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
37945
37946  fi
37947
37948  if test $gl_func_isnand_no_libm != yes; then
37949
37950
37951
37952
37953
37954
37955
37956
37957  gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext"
37958
37959
37960
37961
37962  fi
37963
37964
37965  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used without linking with libm" >&5
37966$as_echo_n "checking whether isnan(float) can be used without linking with libm... " >&6; }
37967if ${gl_cv_func_isnanf_no_libm+:} false; then :
37968  $as_echo_n "(cached) " >&6
37969else
37970
37971      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37972/* end confdefs.h.  */
37973#include <math.h>
37974             #if __GNUC__ >= 4
37975             # undef isnanf
37976             # define isnanf(x) __builtin_isnanf ((float)(x))
37977             #elif defined isnan
37978             # undef isnanf
37979             # define isnanf(x) isnan ((float)(x))
37980             #endif
37981             float x;
37982int
37983main ()
37984{
37985return isnanf (x);
37986  ;
37987  return 0;
37988}
37989_ACEOF
37990if ac_fn_c_try_link "$LINENO"; then :
37991  gl_cv_func_isnanf_no_libm=yes
37992else
37993  gl_cv_func_isnanf_no_libm=no
37994fi
37995rm -f core conftest.err conftest.$ac_objext \
37996    conftest$ac_exeext conftest.$ac_ext
37997
37998fi
37999{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_no_libm" >&5
38000$as_echo "$gl_cv_func_isnanf_no_libm" >&6; }
38001
38002  if test $gl_cv_func_isnanf_no_libm = yes; then
38003
38004
38005
38006  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) works" >&5
38007$as_echo_n "checking whether isnan(float) works... " >&6; }
38008if ${gl_cv_func_isnanf_works+:} false; then :
38009  $as_echo_n "(cached) " >&6
38010else
38011
38012      if test "$cross_compiling" = yes; then :
38013  case "$host_os" in
38014           irix* | solaris*) gl_cv_func_isnanf_works="guessing no" ;;
38015           mingw*) # Guess yes on mingw, no on MSVC.
38016             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38017/* end confdefs.h.  */
38018
38019#ifdef __MINGW32__
38020 Known
38021#endif
38022
38023_ACEOF
38024if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
38025  $EGREP "Known" >/dev/null 2>&1; then :
38026  gl_cv_func_isnanf_works="guessing yes"
38027else
38028  gl_cv_func_isnanf_works="guessing no"
38029fi
38030rm -f conftest*
38031
38032             ;;
38033           *) gl_cv_func_isnanf_works="guessing yes" ;;
38034         esac
38035
38036else
38037  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38038/* end confdefs.h.  */
38039
38040#include <math.h>
38041#if __GNUC__ >= 4
38042# undef isnanf
38043# define isnanf(x) __builtin_isnanf ((float)(x))
38044#elif defined isnan
38045# undef isnanf
38046# define isnanf(x) isnan ((float)(x))
38047#endif
38048/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
38049#ifdef __DECC
38050static float
38051NaN ()
38052{
38053  static float zero = 0.0f;
38054  return zero / zero;
38055}
38056#else
38057# define NaN() (0.0f / 0.0f)
38058#endif
38059#define NWORDS \
38060  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
38061typedef union { unsigned int word[NWORDS]; float value; } memory_float;
38062int main()
38063{
38064  int result = 0;
38065
38066  if (isnanf (1.0f / 0.0f))
38067    result |= 1;
38068
38069  if (!isnanf (NaN ()))
38070    result |= 2;
38071
38072#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
38073  /* The isnanf function should be immune against changes in the sign bit and
38074     in the mantissa bits.  The xor operation twiddles a bit that can only be
38075     a sign bit or a mantissa bit.  */
38076  if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0)
38077    {
38078      memory_float m;
38079
38080      m.value = NaN ();
38081      /* Set the bits below the exponent to 01111...111.  */
38082      m.word[0] &= -1U << FLT_EXPBIT0_BIT;
38083      m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1;
38084      if (!isnanf (m.value))
38085        result |= 4;
38086    }
38087#endif
38088
38089  return result;
38090}
38091_ACEOF
38092if ac_fn_c_try_run "$LINENO"; then :
38093  gl_cv_func_isnanf_works=yes
38094else
38095  gl_cv_func_isnanf_works=no
38096fi
38097rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
38098  conftest.$ac_objext conftest.beam conftest.$ac_ext
38099fi
38100
38101
38102fi
38103{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_works" >&5
38104$as_echo "$gl_cv_func_isnanf_works" >&6; }
38105
38106  fi
38107  if test $gl_cv_func_isnanf_no_libm = yes \
38108     && { case "$gl_cv_func_isnanf_works" in
38109            *yes) true;;
38110            *) false;;
38111          esac
38112        }; then
38113    gl_func_isnanf_no_libm=yes
38114
38115$as_echo "#define HAVE_ISNANF_IN_LIBC 1" >>confdefs.h
38116
38117  else
38118    gl_func_isnanf_no_libm=no
38119  fi
38120
38121  if test $gl_func_isnanf_no_libm != yes; then
38122
38123
38124
38125
38126
38127
38128
38129
38130  gl_LIBOBJS="$gl_LIBOBJS isnanf.$ac_objext"
38131
38132
38133
38134  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
38135$as_echo_n "checking where to find the exponent in a 'float'... " >&6; }
38136if ${gl_cv_cc_float_expbit0+:} false; then :
38137  $as_echo_n "(cached) " >&6
38138else
38139
38140      if test "$cross_compiling" = yes; then :
38141  gl_cv_cc_float_expbit0="word 0 bit 23"
38142else
38143  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38144/* end confdefs.h.  */
38145
38146#include <float.h>
38147#include <stddef.h>
38148#include <stdio.h>
38149#include <string.h>
38150#define NWORDS \
38151  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
38152typedef union { float value; unsigned int word[NWORDS]; } memory_float;
38153static unsigned int ored_words[NWORDS];
38154static unsigned int anded_words[NWORDS];
38155static void add_to_ored_words (float x)
38156{
38157  memory_float m;
38158  size_t i;
38159  /* Clear it first, in case
38160     sizeof (float) < sizeof (memory_float).  */
38161  memset (&m, 0, sizeof (memory_float));
38162  m.value = x;
38163  for (i = 0; i < NWORDS; i++)
38164    {
38165      ored_words[i] |= m.word[i];
38166      anded_words[i] &= m.word[i];
38167    }
38168}
38169int main ()
38170{
38171  size_t j;
38172  FILE *fp = fopen ("conftest.out", "w");
38173  if (fp == NULL)
38174    return 1;
38175  for (j = 0; j < NWORDS; j++)
38176    anded_words[j] = ~ (unsigned int) 0;
38177  add_to_ored_words (0.25f);
38178  add_to_ored_words (0.5f);
38179  add_to_ored_words (1.0f);
38180  add_to_ored_words (2.0f);
38181  add_to_ored_words (4.0f);
38182  /* Remove bits that are common (e.g. if representation of the first mantissa
38183     bit is explicit).  */
38184  for (j = 0; j < NWORDS; j++)
38185    ored_words[j] &= ~anded_words[j];
38186  /* Now find the nonzero word.  */
38187  for (j = 0; j < NWORDS; j++)
38188    if (ored_words[j] != 0)
38189      break;
38190  if (j < NWORDS)
38191    {
38192      size_t i;
38193      for (i = j + 1; i < NWORDS; i++)
38194        if (ored_words[i] != 0)
38195          {
38196            fprintf (fp, "unknown");
38197            return (fclose (fp) != 0);
38198          }
38199      for (i = 0; ; i++)
38200        if ((ored_words[j] >> i) & 1)
38201          {
38202            fprintf (fp, "word %d bit %d", (int) j, (int) i);
38203            return (fclose (fp) != 0);
38204          }
38205    }
38206  fprintf (fp, "unknown");
38207  return (fclose (fp) != 0);
38208}
38209
38210_ACEOF
38211if ac_fn_c_try_run "$LINENO"; then :
38212  gl_cv_cc_float_expbit0=`cat conftest.out`
38213else
38214  gl_cv_cc_float_expbit0="unknown"
38215fi
38216rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
38217  conftest.$ac_objext conftest.beam conftest.$ac_ext
38218fi
38219
38220      rm -f conftest.out
38221
38222fi
38223{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
38224$as_echo "$gl_cv_cc_float_expbit0" >&6; }
38225  case "$gl_cv_cc_float_expbit0" in
38226    word*bit*)
38227      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
38228      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
38229
38230cat >>confdefs.h <<_ACEOF
38231#define FLT_EXPBIT0_WORD $word
38232_ACEOF
38233
38234
38235cat >>confdefs.h <<_ACEOF
38236#define FLT_EXPBIT0_BIT $bit
38237_ACEOF
38238
38239      ;;
38240  esac
38241
38242
38243  fi
38244
38245
38246  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
38247$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; }
38248if ${gl_cv_func_isnanl_no_libm+:} false; then :
38249  $as_echo_n "(cached) " >&6
38250else
38251
38252      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38253/* end confdefs.h.  */
38254#include <math.h>
38255             #if __GNUC__ >= 4
38256             # undef isnanl
38257             # define isnanl(x) __builtin_isnanl ((long double)(x))
38258             #elif defined isnan
38259             # undef isnanl
38260             # define isnanl(x) isnan ((long double)(x))
38261             #endif
38262             long double x;
38263int
38264main ()
38265{
38266return isnanl (x);
38267  ;
38268  return 0;
38269}
38270_ACEOF
38271if ac_fn_c_try_link "$LINENO"; then :
38272  gl_cv_func_isnanl_no_libm=yes
38273else
38274  gl_cv_func_isnanl_no_libm=no
38275fi
38276rm -f core conftest.err conftest.$ac_objext \
38277    conftest$ac_exeext conftest.$ac_ext
38278
38279fi
38280{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5
38281$as_echo "$gl_cv_func_isnanl_no_libm" >&6; }
38282
38283  gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
38284  if test $gl_func_isnanl_no_libm = yes; then
38285
38286
38287
38288
38289     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
38290$as_echo_n "checking whether isnanl works... " >&6; }
38291if ${gl_cv_func_isnanl_works+:} false; then :
38292  $as_echo_n "(cached) " >&6
38293else
38294
38295      if test "$cross_compiling" = yes; then :
38296  case "$host_os" in
38297           mingw*) # Guess yes on mingw, no on MSVC.
38298             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38299/* end confdefs.h.  */
38300
38301#ifdef __MINGW32__
38302 Known
38303#endif
38304
38305_ACEOF
38306if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
38307  $EGREP "Known" >/dev/null 2>&1; then :
38308  gl_cv_func_isnanl_works="guessing yes"
38309else
38310  gl_cv_func_isnanl_works="guessing no"
38311fi
38312rm -f conftest*
38313
38314             ;;
38315           *) gl_cv_func_isnanl_works="guessing yes" ;;
38316         esac
38317
38318else
38319  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38320/* end confdefs.h.  */
38321
38322#include <float.h>
38323#include <limits.h>
38324#include <math.h>
38325#if __GNUC__ >= 4
38326# undef isnanl
38327# define isnanl(x) __builtin_isnanl ((long double)(x))
38328#elif defined isnan
38329# undef isnanl
38330# define isnanl(x) isnan ((long double)(x))
38331#endif
38332#define NWORDS \
38333  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
38334typedef union { unsigned int word[NWORDS]; long double value; }
38335        memory_long_double;
38336/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
38337   runtime type conversion.  */
38338#ifdef __sgi
38339static long double NaNl ()
38340{
38341  double zero = 0.0;
38342  return zero / zero;
38343}
38344#else
38345# define NaNl() (0.0L / 0.0L)
38346#endif
38347int main ()
38348{
38349  int result = 0;
38350
38351  if (!isnanl (NaNl ()))
38352    result |= 1;
38353
38354  {
38355    memory_long_double m;
38356    unsigned int i;
38357
38358    /* The isnanl function should be immune against changes in the sign bit and
38359       in the mantissa bits.  The xor operation twiddles a bit that can only be
38360       a sign bit or a mantissa bit (since the exponent never extends to
38361       bit 31).  */
38362    m.value = NaNl ();
38363    m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
38364    for (i = 0; i < NWORDS; i++)
38365      m.word[i] |= 1;
38366    if (!isnanl (m.value))
38367      result |= 1;
38368  }
38369
38370#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
38371/* Representation of an 80-bit 'long double' as an initializer for a sequence
38372   of 'unsigned int' words.  */
38373# ifdef WORDS_BIGENDIAN
38374#  define LDBL80_WORDS(exponent,manthi,mantlo) \
38375     { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
38376       ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16),   \
38377       (unsigned int) (mantlo) << 16                                        \
38378     }
38379# else
38380#  define LDBL80_WORDS(exponent,manthi,mantlo) \
38381     { mantlo, manthi, exponent }
38382# endif
38383  { /* Quiet NaN.  */
38384    static memory_long_double x =
38385      { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
38386    if (!isnanl (x.value))
38387      result |= 2;
38388  }
38389  {
38390    /* Signalling NaN.  */
38391    static memory_long_double x =
38392      { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
38393    if (!isnanl (x.value))
38394      result |= 2;
38395  }
38396  /* isnanl should return something even for noncanonical values.  */
38397  { /* Pseudo-NaN.  */
38398    static memory_long_double x =
38399      { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
38400    if (isnanl (x.value) && !isnanl (x.value))
38401      result |= 4;
38402  }
38403  { /* Pseudo-Infinity.  */
38404    static memory_long_double x =
38405      { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
38406    if (isnanl (x.value) && !isnanl (x.value))
38407      result |= 8;
38408  }
38409  { /* Pseudo-Zero.  */
38410    static memory_long_double x =
38411      { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
38412    if (isnanl (x.value) && !isnanl (x.value))
38413      result |= 16;
38414  }
38415  { /* Unnormalized number.  */
38416    static memory_long_double x =
38417      { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
38418    if (isnanl (x.value) && !isnanl (x.value))
38419      result |= 32;
38420  }
38421  { /* Pseudo-Denormal.  */
38422    static memory_long_double x =
38423      { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
38424    if (isnanl (x.value) && !isnanl (x.value))
38425      result |= 64;
38426  }
38427#endif
38428
38429  return result;
38430}
38431_ACEOF
38432if ac_fn_c_try_run "$LINENO"; then :
38433  gl_cv_func_isnanl_works=yes
38434else
38435  gl_cv_func_isnanl_works=no
38436fi
38437rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
38438  conftest.$ac_objext conftest.beam conftest.$ac_ext
38439fi
38440
38441
38442fi
38443{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5
38444$as_echo "$gl_cv_func_isnanl_works" >&6; }
38445
38446    case "$gl_cv_func_isnanl_works" in
38447      *yes) ;;
38448      *)    gl_func_isnanl_no_libm=no ;;
38449    esac
38450  fi
38451  if test $gl_func_isnanl_no_libm = yes; then
38452
38453$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
38454
38455  fi
38456
38457  if test $gl_func_isnanl_no_libm != yes; then
38458
38459
38460
38461
38462
38463
38464
38465
38466  gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext"
38467
38468
38469
38470
38471     { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
38472$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
38473if ${gl_cv_cc_long_double_expbit0+:} false; then :
38474  $as_echo_n "(cached) " >&6
38475else
38476
38477      if test "$cross_compiling" = yes; then :
38478
38479                              gl_cv_cc_long_double_expbit0="unknown"
38480          case "$host_os" in
38481            mingw*) # On native Windows (little-endian), we know the result
38482                    # in two cases: mingw, MSVC.
38483              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38484/* end confdefs.h.  */
38485
38486#ifdef __MINGW32__
38487 Known
38488#endif
38489
38490_ACEOF
38491if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
38492  $EGREP "Known" >/dev/null 2>&1; then :
38493  gl_cv_cc_long_double_expbit0="word 2 bit 0"
38494fi
38495rm -f conftest*
38496
38497              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38498/* end confdefs.h.  */
38499
38500#ifdef _MSC_VER
38501 Known
38502#endif
38503
38504_ACEOF
38505if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
38506  $EGREP "Known" >/dev/null 2>&1; then :
38507  gl_cv_cc_long_double_expbit0="word 1 bit 20"
38508fi
38509rm -f conftest*
38510
38511              ;;
38512          esac
38513
38514else
38515  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38516/* end confdefs.h.  */
38517
38518#include <float.h>
38519#include <stddef.h>
38520#include <stdio.h>
38521#include <string.h>
38522#define NWORDS \
38523  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
38524typedef union { long double value; unsigned int word[NWORDS]; }
38525        memory_long_double;
38526static unsigned int ored_words[NWORDS];
38527static unsigned int anded_words[NWORDS];
38528static void add_to_ored_words (long double x)
38529{
38530  memory_long_double m;
38531  size_t i;
38532  /* Clear it first, in case
38533     sizeof (long double) < sizeof (memory_long_double).  */
38534  memset (&m, 0, sizeof (memory_long_double));
38535  m.value = x;
38536  for (i = 0; i < NWORDS; i++)
38537    {
38538      ored_words[i] |= m.word[i];
38539      anded_words[i] &= m.word[i];
38540    }
38541}
38542int main ()
38543{
38544  size_t j;
38545  FILE *fp = fopen ("conftest.out", "w");
38546  if (fp == NULL)
38547    return 1;
38548  for (j = 0; j < NWORDS; j++)
38549    anded_words[j] = ~ (unsigned int) 0;
38550  add_to_ored_words (0.25L);
38551  add_to_ored_words (0.5L);
38552  add_to_ored_words (1.0L);
38553  add_to_ored_words (2.0L);
38554  add_to_ored_words (4.0L);
38555  /* Remove bits that are common (e.g. if representation of the first mantissa
38556     bit is explicit).  */
38557  for (j = 0; j < NWORDS; j++)
38558    ored_words[j] &= ~anded_words[j];
38559  /* Now find the nonzero word.  */
38560  for (j = 0; j < NWORDS; j++)
38561    if (ored_words[j] != 0)
38562      break;
38563  if (j < NWORDS)
38564    {
38565      size_t i;
38566      for (i = j + 1; i < NWORDS; i++)
38567        if (ored_words[i] != 0)
38568          {
38569            fprintf (fp, "unknown");
38570            return (fclose (fp) != 0);
38571          }
38572      for (i = 0; ; i++)
38573        if ((ored_words[j] >> i) & 1)
38574          {
38575            fprintf (fp, "word %d bit %d", (int) j, (int) i);
38576            return (fclose (fp) != 0);
38577          }
38578    }
38579  fprintf (fp, "unknown");
38580  return (fclose (fp) != 0);
38581}
38582
38583_ACEOF
38584if ac_fn_c_try_run "$LINENO"; then :
38585  gl_cv_cc_long_double_expbit0=`cat conftest.out`
38586else
38587  gl_cv_cc_long_double_expbit0="unknown"
38588fi
38589rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
38590  conftest.$ac_objext conftest.beam conftest.$ac_ext
38591fi
38592
38593      rm -f conftest.out
38594
38595fi
38596{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
38597$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
38598  case "$gl_cv_cc_long_double_expbit0" in
38599    word*bit*)
38600      word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
38601      bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
38602
38603cat >>confdefs.h <<_ACEOF
38604#define LDBL_EXPBIT0_WORD $word
38605_ACEOF
38606
38607
38608cat >>confdefs.h <<_ACEOF
38609#define LDBL_EXPBIT0_BIT $bit
38610_ACEOF
38611
38612      ;;
38613  esac
38614
38615
38616
38617  fi
38618
38619
38620
38621
38622
38623  ac_fn_c_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" "
38624/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
38625   <wchar.h>.
38626   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
38627   before <wchar.h>.  */
38628#include <stddef.h>
38629#include <stdio.h>
38630#include <time.h>
38631#include <wchar.h>
38632#include <wctype.h>
38633
38634"
38635if test "x$ac_cv_have_decl_iswblank" = xyes; then :
38636  ac_have_decl=1
38637else
38638  ac_have_decl=0
38639fi
38640
38641cat >>confdefs.h <<_ACEOF
38642#define HAVE_DECL_ISWBLANK $ac_have_decl
38643_ACEOF
38644
38645  if test $ac_cv_func_iswblank = no; then
38646    HAVE_ISWBLANK=0
38647    if test $ac_cv_have_decl_iswblank = yes; then
38648      REPLACE_ISWBLANK=1
38649    fi
38650  fi
38651  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
38652        :
38653  else
38654    if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
38655            :
38656    fi
38657  fi
38658
38659
38660  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
38661    :
38662  else
38663    if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
38664
38665
38666
38667
38668
38669
38670
38671
38672  gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext"
38673
38674    fi
38675  fi
38676
38677
38678
38679
38680
38681          GNULIB_ISWBLANK=1
38682
38683
38684
38685
38686
38687$as_echo "#define GNULIB_TEST_ISWBLANK 1" >>confdefs.h
38688
38689
38690
38691
38692
38693
38694
38695
38696
38697
38698
38699
38700
38701
38702
38703
38704
38705     if test $gl_cv_have_include_next = yes; then
38706       gl_cv_next_langinfo_h='<'langinfo.h'>'
38707     else
38708       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <langinfo.h>" >&5
38709$as_echo_n "checking absolute name of <langinfo.h>... " >&6; }
38710if ${gl_cv_next_langinfo_h+:} false; then :
38711  $as_echo_n "(cached) " >&6
38712else
38713
38714             if test $ac_cv_header_langinfo_h = yes; then
38715
38716
38717
38718
38719  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38720/* end confdefs.h.  */
38721#include <langinfo.h>
38722_ACEOF
38723                case "$host_os" in
38724    aix*) gl_absname_cpp="$ac_cpp -C" ;;
38725    *)    gl_absname_cpp="$ac_cpp" ;;
38726  esac
38727
38728  case "$host_os" in
38729    mingw*)
38730                                          gl_dirsep_regex='[/\\]'
38731      ;;
38732    *)
38733      gl_dirsep_regex='\/'
38734      ;;
38735  esac
38736      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
38737  gl_header_literal_regex=`echo 'langinfo.h' \
38738                           | sed -e "$gl_make_literal_regex_sed"`
38739  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
38740      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
38741      s|^/[^/]|//&|
38742      p
38743      q
38744    }'
38745
38746        gl_cv_absolute_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
38747  sed -n "$gl_absolute_header_sed"`
38748
38749           gl_header=$gl_cv_absolute_langinfo_h
38750           gl_cv_next_langinfo_h='"'$gl_header'"'
38751          else
38752               gl_cv_next_langinfo_h='<'langinfo.h'>'
38753             fi
38754
38755
38756fi
38757{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5
38758$as_echo "$gl_cv_next_langinfo_h" >&6; }
38759     fi
38760     NEXT_LANGINFO_H=$gl_cv_next_langinfo_h
38761
38762     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
38763       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
38764       gl_next_as_first_directive='<'langinfo.h'>'
38765     else
38766       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
38767       gl_next_as_first_directive=$gl_cv_next_langinfo_h
38768     fi
38769     NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive
38770
38771
38772
38773
38774
38775    HAVE_LANGINFO_CODESET=0
38776  HAVE_LANGINFO_T_FMT_AMPM=0
38777  HAVE_LANGINFO_ALTMON=0
38778  HAVE_LANGINFO_ERA=0
38779  HAVE_LANGINFO_YESEXPR=0
38780
38781  if test $ac_cv_header_langinfo_h = yes; then
38782    HAVE_LANGINFO_H=1
38783                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5
38784$as_echo_n "checking whether langinfo.h defines CODESET... " >&6; }
38785if ${gl_cv_header_langinfo_codeset+:} false; then :
38786  $as_echo_n "(cached) " >&6
38787else
38788  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38789/* end confdefs.h.  */
38790#include <langinfo.h>
38791int a = CODESET;
38792
38793int
38794main ()
38795{
38796
38797  ;
38798  return 0;
38799}
38800_ACEOF
38801if ac_fn_c_try_compile "$LINENO"; then :
38802  gl_cv_header_langinfo_codeset=yes
38803else
38804  gl_cv_header_langinfo_codeset=no
38805fi
38806rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38807
38808fi
38809{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5
38810$as_echo "$gl_cv_header_langinfo_codeset" >&6; }
38811    if test $gl_cv_header_langinfo_codeset = yes; then
38812      HAVE_LANGINFO_CODESET=1
38813    fi
38814    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5
38815$as_echo_n "checking whether langinfo.h defines T_FMT_AMPM... " >&6; }
38816if ${gl_cv_header_langinfo_t_fmt_ampm+:} false; then :
38817  $as_echo_n "(cached) " >&6
38818else
38819  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38820/* end confdefs.h.  */
38821#include <langinfo.h>
38822int a = T_FMT_AMPM;
38823
38824int
38825main ()
38826{
38827
38828  ;
38829  return 0;
38830}
38831_ACEOF
38832if ac_fn_c_try_compile "$LINENO"; then :
38833  gl_cv_header_langinfo_t_fmt_ampm=yes
38834else
38835  gl_cv_header_langinfo_t_fmt_ampm=no
38836fi
38837rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38838
38839fi
38840{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5
38841$as_echo "$gl_cv_header_langinfo_t_fmt_ampm" >&6; }
38842    if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
38843      HAVE_LANGINFO_T_FMT_AMPM=1
38844    fi
38845    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ALTMON_1" >&5
38846$as_echo_n "checking whether langinfo.h defines ALTMON_1... " >&6; }
38847if ${gl_cv_header_langinfo_altmon+:} false; then :
38848  $as_echo_n "(cached) " >&6
38849else
38850  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38851/* end confdefs.h.  */
38852#include <langinfo.h>
38853int a = ALTMON_1;
38854
38855int
38856main ()
38857{
38858
38859  ;
38860  return 0;
38861}
38862_ACEOF
38863if ac_fn_c_try_compile "$LINENO"; then :
38864  gl_cv_header_langinfo_altmon=yes
38865else
38866  gl_cv_header_langinfo_altmon=no
38867fi
38868rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38869
38870fi
38871{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_altmon" >&5
38872$as_echo "$gl_cv_header_langinfo_altmon" >&6; }
38873    if test $gl_cv_header_langinfo_altmon = yes; then
38874      HAVE_LANGINFO_ALTMON=1
38875    fi
38876    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5
38877$as_echo_n "checking whether langinfo.h defines ERA... " >&6; }
38878if ${gl_cv_header_langinfo_era+:} false; then :
38879  $as_echo_n "(cached) " >&6
38880else
38881  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38882/* end confdefs.h.  */
38883#include <langinfo.h>
38884int a = ERA;
38885
38886int
38887main ()
38888{
38889
38890  ;
38891  return 0;
38892}
38893_ACEOF
38894if ac_fn_c_try_compile "$LINENO"; then :
38895  gl_cv_header_langinfo_era=yes
38896else
38897  gl_cv_header_langinfo_era=no
38898fi
38899rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38900
38901fi
38902{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5
38903$as_echo "$gl_cv_header_langinfo_era" >&6; }
38904    if test $gl_cv_header_langinfo_era = yes; then
38905      HAVE_LANGINFO_ERA=1
38906    fi
38907    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5
38908$as_echo_n "checking whether langinfo.h defines YESEXPR... " >&6; }
38909if ${gl_cv_header_langinfo_yesexpr+:} false; then :
38910  $as_echo_n "(cached) " >&6
38911else
38912  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38913/* end confdefs.h.  */
38914#include <langinfo.h>
38915int a = YESEXPR;
38916
38917int
38918main ()
38919{
38920
38921  ;
38922  return 0;
38923}
38924_ACEOF
38925if ac_fn_c_try_compile "$LINENO"; then :
38926  gl_cv_header_langinfo_yesexpr=yes
38927else
38928  gl_cv_header_langinfo_yesexpr=no
38929fi
38930rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38931
38932fi
38933{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5
38934$as_echo "$gl_cv_header_langinfo_yesexpr" >&6; }
38935    if test $gl_cv_header_langinfo_yesexpr = yes; then
38936      HAVE_LANGINFO_YESEXPR=1
38937    fi
38938  else
38939    HAVE_LANGINFO_H=0
38940  fi
38941
38942
38943
38944
38945
38946
38947
38948
38949
38950
38951
38952
38953
38954
38955
38956
38957  if test $ac_cv_func_lchmod = no; then
38958    HAVE_LCHMOD=0
38959  fi
38960
38961
38962
38963
38964
38965
38966          GNULIB_LCHMOD=1
38967
38968
38969
38970
38971
38972$as_echo "#define GNULIB_TEST_LCHMOD 1" >>confdefs.h
38973
38974
38975
38976
38977
38978
38979
38980  for ac_func in lchown
38981do :
38982  ac_fn_c_check_func "$LINENO" "lchown" "ac_cv_func_lchown"
38983if test "x$ac_cv_func_lchown" = xyes; then :
38984  cat >>confdefs.h <<_ACEOF
38985#define HAVE_LCHOWN 1
38986_ACEOF
38987
38988fi
38989done
38990
38991  if test $ac_cv_func_lchown = no; then
38992    HAVE_LCHOWN=0
38993  else
38994        case "$gl_cv_func_chown_slash_works" in
38995      *yes) ;;
38996      *)
38997        REPLACE_LCHOWN=1
38998        ;;
38999    esac
39000    case "$gl_cv_func_chown_ctime_works" in
39001      *yes) ;;
39002      *)
39003        REPLACE_LCHOWN=1
39004        ;;
39005    esac
39006  fi
39007
39008  if test $HAVE_LCHOWN = 0 || test $REPLACE_LCHOWN = 1; then
39009
39010
39011
39012
39013
39014
39015
39016
39017  gl_LIBOBJS="$gl_LIBOBJS lchown.$ac_objext"
39018
39019  fi
39020
39021
39022
39023
39024
39025          GNULIB_LCHOWN=1
39026
39027
39028
39029
39030
39031$as_echo "#define GNULIB_TEST_LCHOWN 1" >>confdefs.h
39032
39033
39034
39035
39036
39037  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler flag to ignore unused libraries" >&5
39038$as_echo_n "checking for C compiler flag to ignore unused libraries... " >&6; }
39039if ${gl_cv_prog_c_ignore_unused_libraries+:} false; then :
39040  $as_echo_n "(cached) " >&6
39041else
39042  gl_cv_prog_c_ignore_unused_libraries=none
39043     gl_saved_ldflags=$LDFLAGS
39044     gl_saved_libs=$LIBS
39045     # Link with -lm to detect binutils 2.16 bug with --as-needed; see
39046     # <https://lists.gnu.org/r/bug-gnulib/2006-06/msg00131.html>.
39047     LIBS="$LIBS -lm"
39048     # Use long option sequences like '-z ignore' to test for the feature,
39049     # to forestall problems with linkers that have -z, -i, -g, -n, etc. flags.
39050     # GCC + binutils likes '-Wl,--as-needed'.
39051     # GCC + Solaris ld likes '-Wl,-z,ignore'.
39052     # Sun C likes '-Wl,-z,ignore'. '-z ignore' is accepted but has no effect.
39053     # Don't try bare '--as-needed'; nothing likes it and the HP-UX 11.11
39054     # native cc issues annoying warnings and then ignores it,
39055     # which would cause us to incorrectly conclude that it worked.
39056     for gl_flags in  '-Wl,--as-needed' \
39057  '-Wl,-z,ignore' \
39058  '-z ignore'
39059
39060     do
39061       LDFLAGS="$gl_flags $LDFLAGS"
39062       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39063/* end confdefs.h.  */
39064
39065int
39066main ()
39067{
39068
39069  ;
39070  return 0;
39071}
39072_ACEOF
39073if ac_fn_c_try_link "$LINENO"; then :
39074  gl_cv_prog_c_ignore_unused_libraries=$gl_flags
39075fi
39076rm -f core conftest.err conftest.$ac_objext \
39077    conftest$ac_exeext conftest.$ac_ext
39078       LDFLAGS=$gl_saved_ldflags
39079       test "$gl_cv_prog_c_ignore_unused_libraries" != none &&
39080         break
39081     done
39082     LIBS=$gl_saved_libs
39083
39084fi
39085{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_prog_c_ignore_unused_libraries" >&5
39086$as_echo "$gl_cv_prog_c_ignore_unused_libraries" >&6; }
39087  IGNORE_UNUSED_LIBRARIES_CFLAGS=
39088  if test "$gl_cv_prog_c_ignore_unused_libraries" != none; then
39089    IGNORE_UNUSED_LIBRARIES_CFLAGS="$gl_cv_prog_c_ignore_unused_libraries"
39090  fi
39091
39092
39093
39094
39095
39096
39097  if test $ac_cv_func_link = no; then
39098    HAVE_LINK=0
39099  else
39100    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether link obeys POSIX" >&5
39101$as_echo_n "checking whether link obeys POSIX... " >&6; }
39102if ${gl_cv_func_link_works+:} false; then :
39103  $as_echo_n "(cached) " >&6
39104else
39105  touch conftest.a
39106       # Assume that if we have lstat, we can also check symlinks.
39107       if test $ac_cv_func_lstat = yes; then
39108         ln -s conftest.a conftest.lnk
39109       fi
39110       if test "$cross_compiling" = yes; then :
39111  case "$host_os" in
39112                             # Guess yes on Linux systems.
39113            linux-* | linux) gl_cv_func_link_works="guessing yes" ;;
39114                             # Guess yes on glibc systems.
39115            *-gnu* | gnu*)   gl_cv_func_link_works="guessing yes" ;;
39116                             # If we don't know, assume the worst.
39117            *)               gl_cv_func_link_works="guessing no" ;;
39118          esac
39119
39120else
39121  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39122/* end confdefs.h.  */
39123#include <unistd.h>
39124             #include <stdio.h>
39125
39126int
39127main ()
39128{
39129int result = 0;
39130             if (!link ("conftest.a", "conftest.b/"))
39131               result |= 1;
39132#if HAVE_LSTAT
39133             if (!link ("conftest.lnk/", "conftest.b"))
39134               result |= 2;
39135             if (rename ("conftest.a", "conftest.b"))
39136               result |= 4;
39137             if (!link ("conftest.b", "conftest.lnk"))
39138               result |= 8;
39139#endif
39140             return result;
39141
39142  ;
39143  return 0;
39144}
39145_ACEOF
39146if ac_fn_c_try_run "$LINENO"; then :
39147  gl_cv_func_link_works=yes
39148else
39149  gl_cv_func_link_works=no
39150fi
39151rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
39152  conftest.$ac_objext conftest.beam conftest.$ac_ext
39153fi
39154
39155       rm -f conftest.a conftest.b conftest.lnk
39156fi
39157{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_link_works" >&5
39158$as_echo "$gl_cv_func_link_works" >&6; }
39159    case "$gl_cv_func_link_works" in
39160      *yes) ;;
39161      *)
39162        REPLACE_LINK=1
39163        ;;
39164    esac
39165  fi
39166
39167  if test $HAVE_LINK = 0 || test $REPLACE_LINK = 1; then
39168
39169
39170
39171
39172
39173
39174
39175
39176  gl_LIBOBJS="$gl_LIBOBJS link.$ac_objext"
39177
39178  fi
39179
39180
39181
39182
39183
39184          GNULIB_LINK=1
39185
39186
39187
39188
39189
39190$as_echo "#define GNULIB_TEST_LINK 1" >>confdefs.h
39191
39192
39193
39194
39195          gl_link_follows_symlinks=0 # assume GNU behavior
39196  if test $ac_cv_func_readlink = yes; then
39197                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __xpg4" >&5
39198$as_echo_n "checking for __xpg4... " >&6; }
39199if ${gl_cv_have___xpg4+:} false; then :
39200  $as_echo_n "(cached) " >&6
39201else
39202  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39203/* end confdefs.h.  */
39204extern int __xpg4;
39205int
39206main ()
39207{
39208return __xpg4;
39209  ;
39210  return 0;
39211}
39212_ACEOF
39213if ac_fn_c_try_link "$LINENO"; then :
39214  gl_cv_have___xpg4=yes
39215else
39216  gl_cv_have___xpg4=no
39217fi
39218rm -f core conftest.err conftest.$ac_objext \
39219    conftest$ac_exeext conftest.$ac_ext
39220
39221fi
39222{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have___xpg4" >&5
39223$as_echo "$gl_cv_have___xpg4" >&6; }
39224    if test $gl_cv_have___xpg4 = yes; then
39225      gl_link_follows_symlinks=-1
39226    else
39227      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether link(2) dereferences a symlink" >&5
39228$as_echo_n "checking whether link(2) dereferences a symlink... " >&6; }
39229if ${gl_cv_func_link_follows_symlink+:} false; then :
39230  $as_echo_n "(cached) " >&6
39231else
39232
39233         # Create a regular file.
39234         echo > conftest.file
39235         if test "$cross_compiling" = yes; then :
39236                                                 case "$host_os" in
39237                                  # On glibc/Linux we know the result.
39238              linux*-gnu* | gnu*) gl_cv_func_link_follows_symlink="guessing no" ;;
39239                                  # Otherwise, we don't know.
39240              *)                  gl_cv_func_link_follows_symlink=unknown ;;
39241            esac
39242
39243else
39244  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39245/* end confdefs.h.  */
39246
39247#       include <sys/types.h>
39248#       include <sys/stat.h>
39249#       include <unistd.h>
39250#       include <stdlib.h>
39251
39252#       define SAME_INODE(Stat_buf_1, Stat_buf_2) \
39253          ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
39254           && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
39255
39256        int
39257        main ()
39258        {
39259          const char *file = "conftest.file";
39260          const char *sym = "conftest.sym";
39261          const char *hard = "conftest.hard";
39262          struct stat sb_file, sb_hard;
39263
39264          /* Create a symlink to the regular file. */
39265          if (symlink (file, sym))
39266            return 2;
39267
39268          /* Create a hard link to that symlink.  */
39269          if (link (sym, hard))
39270            return 3;
39271
39272          if (lstat (hard, &sb_hard))
39273            return 4;
39274          if (lstat (file, &sb_file))
39275            return 5;
39276
39277          /* If the dev/inode of hard and file are the same, then
39278             the link call followed the symlink.  */
39279          return SAME_INODE (sb_hard, sb_file) ? 1 : 0;
39280        }
39281
39282_ACEOF
39283if ac_fn_c_try_run "$LINENO"; then :
39284  gl_cv_func_link_follows_symlink=no
39285else
39286             gl_cv_func_link_follows_symlink=yes
39287fi
39288rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
39289  conftest.$ac_objext conftest.beam conftest.$ac_ext
39290fi
39291
39292         rm -f conftest.file conftest.sym conftest.hard
39293
39294fi
39295{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_link_follows_symlink" >&5
39296$as_echo "$gl_cv_func_link_follows_symlink" >&6; }
39297      case "$gl_cv_func_link_follows_symlink" in
39298        *yes) gl_link_follows_symlinks=1 ;;
39299        *no) ;; # already defaulted to 0
39300        *) gl_link_follows_symlinks=-2 ;;
39301      esac
39302    fi
39303  fi
39304
39305cat >>confdefs.h <<_ACEOF
39306#define LINK_FOLLOWS_SYMLINKS $gl_link_follows_symlinks
39307_ACEOF
39308
39309
39310
39311
39312
39313
39314
39315
39316
39317  if test $ac_cv_func_linkat = no; then
39318    HAVE_LINKAT=0
39319  else
39320                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linkat() can link symlinks" >&5
39321$as_echo_n "checking whether linkat() can link symlinks... " >&6; }
39322if ${gl_cv_func_linkat_nofollow+:} false; then :
39323  $as_echo_n "(cached) " >&6
39324else
39325  rm -rf conftest.l1 conftest.l2
39326       ln -s target conftest.l1
39327       if test "$cross_compiling" = yes; then :
39328  case "$host_os" in
39329           darwin*) gl_cv_func_linkat_nofollow="guessing no" ;;
39330           *)       gl_cv_func_linkat_nofollow="guessing yes" ;;
39331          esac
39332else
39333  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39334/* end confdefs.h.  */
39335#include <fcntl.h>
39336                          #include <unistd.h>
39337
39338int
39339main ()
39340{
39341return linkat (AT_FDCWD, "conftest.l1", AT_FDCWD,
39342                                            "conftest.l2", 0);
39343
39344  ;
39345  return 0;
39346}
39347_ACEOF
39348if ac_fn_c_try_run "$LINENO"; then :
39349  gl_cv_func_linkat_nofollow=yes
39350else
39351  gl_cv_func_linkat_nofollow=no
39352fi
39353rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
39354  conftest.$ac_objext conftest.beam conftest.$ac_ext
39355fi
39356
39357
39358       rm -rf conftest.l1 conftest.l2
39359fi
39360{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_linkat_nofollow" >&5
39361$as_echo "$gl_cv_func_linkat_nofollow" >&6; }
39362
39363    case $gl_cv_func_linkat_nofollow in
39364      *no) LINKAT_SYMLINK_NOTSUP=1 ;;
39365      *yes) LINKAT_SYMLINK_NOTSUP=0 ;;
39366    esac
39367
39368    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linkat handles trailing slash correctly" >&5
39369$as_echo_n "checking whether linkat handles trailing slash correctly... " >&6; }
39370if ${gl_cv_func_linkat_slash+:} false; then :
39371  $as_echo_n "(cached) " >&6
39372else
39373  rm -rf conftest.a conftest.b conftest.c conftest.d conftest.e conftest.s
39374       if test "$cross_compiling" = yes; then :
39375
39376          case "$host_os" in
39377                             # Guess yes on Linux systems.
39378            linux-* | linux) gl_cv_func_linkat_slash="guessing yes";;
39379                             # Guess yes on glibc systems.
39380            *-gnu* | gnu*)   gl_cv_func_linkat_slash="guessing yes";;
39381                             # If we don't know, assume the worst.
39382            *)               gl_cv_func_linkat_slash="guessing no";;
39383          esac
39384
39385else
39386  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39387/* end confdefs.h.  */
39388#include <unistd.h>
39389              #include <fcntl.h>
39390              #include <errno.h>
39391              #include <stdio.h>
39392
39393int
39394main ()
39395{
39396int result;
39397              int fd;
39398              /* Create a regular file.  */
39399              fd = open ("conftest.a", O_CREAT | O_EXCL | O_WRONLY, 0600);
39400              if (fd < 0)
39401                return 1;
39402              if (write (fd, "hello", 5) < 5)
39403                return 2;
39404              if (close (fd) < 0)
39405                return 3;
39406              /* Test whether hard links are supported on the current
39407                 device.  */
39408              if (linkat (AT_FDCWD, "conftest.a", AT_FDCWD, "conftest.b",
39409                          AT_SYMLINK_FOLLOW) < 0)
39410                return 0;
39411              result = 0;
39412              /* Test whether a trailing "/" is treated like "/.".  */
39413              if (linkat (AT_FDCWD, "conftest.a/", AT_FDCWD, "conftest.c",
39414                          AT_SYMLINK_FOLLOW) == 0)
39415                result |= 4;
39416              if (linkat (AT_FDCWD, "conftest.a", AT_FDCWD, "conftest.d/",
39417                          AT_SYMLINK_FOLLOW) == 0)
39418                result |= 8;
39419
39420              /* On OS X 10.10 a trailing "/" will cause the second path to be
39421                 dereferenced, and thus will succeed on a dangling symlink.  */
39422              if (symlink ("conftest.e", "conftest.s") == 0)
39423                {
39424                  if (linkat (AT_FDCWD, "conftest.a", AT_FDCWD, "conftest.s/",
39425                      AT_SYMLINK_FOLLOW) == 0)
39426                    result |= 16;
39427                }
39428
39429              return result;
39430
39431  ;
39432  return 0;
39433}
39434_ACEOF
39435if ac_fn_c_try_run "$LINENO"; then :
39436  gl_cv_func_linkat_slash=yes
39437else
39438  gl_cv_func_linkat_slash=no
39439fi
39440rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
39441  conftest.$ac_objext conftest.beam conftest.$ac_ext
39442fi
39443
39444       rm -rf conftest.a conftest.b conftest.c conftest.d conftest.e conftest.s
39445fi
39446{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_linkat_slash" >&5
39447$as_echo "$gl_cv_func_linkat_slash" >&6; }
39448    case "$gl_cv_func_linkat_slash" in
39449      *yes) gl_linkat_slash_bug=0 ;;
39450      *)    gl_linkat_slash_bug=1 ;;
39451    esac
39452
39453    case "$gl_cv_func_linkat_nofollow" in
39454      *yes) linkat_nofollow=yes ;;
39455      *) linkat_nofollow=no ;;
39456    esac
39457
39458    if test "$linkat_nofollow" != yes \
39459       || test $gl_linkat_slash_bug = 1; then
39460      REPLACE_LINKAT=1
39461
39462cat >>confdefs.h <<_ACEOF
39463#define LINKAT_TRAILING_SLASH_BUG $gl_linkat_slash_bug
39464_ACEOF
39465
39466
39467cat >>confdefs.h <<_ACEOF
39468#define LINKAT_SYMLINK_NOTSUP $LINKAT_SYMLINK_NOTSUP
39469_ACEOF
39470
39471    fi
39472  fi
39473
39474  if test $HAVE_LINKAT = 0 || test $REPLACE_LINKAT = 1; then
39475
39476
39477
39478
39479
39480
39481
39482
39483  gl_LIBOBJS="$gl_LIBOBJS linkat.$ac_objext"
39484
39485
39486
39487
39488
39489
39490
39491
39492
39493  gl_LIBOBJS="$gl_LIBOBJS at-func2.$ac_objext"
39494
39495  fi
39496
39497
39498
39499
39500
39501          GNULIB_LINKAT=1
39502
39503
39504
39505
39506
39507$as_echo "#define GNULIB_TEST_LINKAT 1" >>confdefs.h
39508
39509
39510
39511
39512
39513
39514    LOCALCHARSET_TESTS_ENVIRONMENT=
39515
39516
39517
39518
39519
39520
39521
39522
39523
39524  case "$host_os" in
39525    solaris*)
39526
39527$as_echo "#define _LCONV_C99 1" >>confdefs.h
39528
39529      ;;
39530  esac
39531
39532  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5
39533$as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; }
39534if ${gl_cv_header_locale_h_posix2001+:} false; then :
39535  $as_echo_n "(cached) " >&6
39536else
39537  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39538/* end confdefs.h.  */
39539#include <locale.h>
39540            int x = LC_MESSAGES;
39541            int y = sizeof (((struct lconv *) 0)->decimal_point);
39542int
39543main ()
39544{
39545
39546  ;
39547  return 0;
39548}
39549_ACEOF
39550if ac_fn_c_try_compile "$LINENO"; then :
39551  gl_cv_header_locale_h_posix2001=yes
39552else
39553  gl_cv_header_locale_h_posix2001=no
39554fi
39555rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39556fi
39557{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5
39558$as_echo "$gl_cv_header_locale_h_posix2001" >&6; }
39559
39560
39561  if test $ac_cv_header_xlocale_h = yes; then
39562    HAVE_XLOCALE_H=1
39563                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5
39564$as_echo_n "checking whether locale.h defines locale_t... " >&6; }
39565if ${gl_cv_header_locale_has_locale_t+:} false; then :
39566  $as_echo_n "(cached) " >&6
39567else
39568  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39569/* end confdefs.h.  */
39570#include <locale.h>
39571              locale_t x;
39572int
39573main ()
39574{
39575
39576  ;
39577  return 0;
39578}
39579_ACEOF
39580if ac_fn_c_try_compile "$LINENO"; then :
39581  gl_cv_header_locale_has_locale_t=yes
39582else
39583  gl_cv_header_locale_has_locale_t=no
39584fi
39585rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39586
39587fi
39588{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5
39589$as_echo "$gl_cv_header_locale_has_locale_t" >&6; }
39590    if test $gl_cv_header_locale_has_locale_t = yes; then
39591      gl_cv_header_locale_h_needs_xlocale_h=no
39592    else
39593      gl_cv_header_locale_h_needs_xlocale_h=yes
39594    fi
39595  else
39596    HAVE_XLOCALE_H=0
39597    gl_cv_header_locale_h_needs_xlocale_h=no
39598  fi
39599
39600
39601          { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5
39602$as_echo_n "checking whether struct lconv is properly defined... " >&6; }
39603if ${gl_cv_sys_struct_lconv_ok+:} false; then :
39604  $as_echo_n "(cached) " >&6
39605else
39606  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39607/* end confdefs.h.  */
39608#include <locale.h>
39609            struct lconv l;
39610            int x = sizeof (l.decimal_point);
39611            int y = sizeof (l.int_p_cs_precedes);
39612int
39613main ()
39614{
39615
39616  ;
39617  return 0;
39618}
39619_ACEOF
39620if ac_fn_c_try_compile "$LINENO"; then :
39621  gl_cv_sys_struct_lconv_ok=yes
39622else
39623  gl_cv_sys_struct_lconv_ok=no
39624fi
39625rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39626
39627fi
39628{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5
39629$as_echo "$gl_cv_sys_struct_lconv_ok" >&6; }
39630  if test $gl_cv_sys_struct_lconv_ok = no; then
39631    REPLACE_STRUCT_LCONV=1
39632  fi
39633
39634
39635
39636
39637
39638
39639
39640
39641
39642     if test $gl_cv_have_include_next = yes; then
39643       gl_cv_next_locale_h='<'locale.h'>'
39644     else
39645       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5
39646$as_echo_n "checking absolute name of <locale.h>... " >&6; }
39647if ${gl_cv_next_locale_h+:} false; then :
39648  $as_echo_n "(cached) " >&6
39649else
39650
39651
39652
39653  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39654/* end confdefs.h.  */
39655#include <locale.h>
39656_ACEOF
39657                case "$host_os" in
39658    aix*) gl_absname_cpp="$ac_cpp -C" ;;
39659    *)    gl_absname_cpp="$ac_cpp" ;;
39660  esac
39661
39662  case "$host_os" in
39663    mingw*)
39664                                          gl_dirsep_regex='[/\\]'
39665      ;;
39666    *)
39667      gl_dirsep_regex='\/'
39668      ;;
39669  esac
39670      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
39671  gl_header_literal_regex=`echo 'locale.h' \
39672                           | sed -e "$gl_make_literal_regex_sed"`
39673  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
39674      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
39675      s|^/[^/]|//&|
39676      p
39677      q
39678    }'
39679
39680        gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
39681  sed -n "$gl_absolute_header_sed"`
39682
39683           gl_header=$gl_cv_absolute_locale_h
39684           gl_cv_next_locale_h='"'$gl_header'"'
39685
39686
39687fi
39688{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5
39689$as_echo "$gl_cv_next_locale_h" >&6; }
39690     fi
39691     NEXT_LOCALE_H=$gl_cv_next_locale_h
39692
39693     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
39694       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
39695       gl_next_as_first_directive='<'locale.h'>'
39696     else
39697       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
39698       gl_next_as_first_directive=$gl_cv_next_locale_h
39699     fi
39700     NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive
39701
39702
39703
39704
39705
39706
39707
39708
39709
39710
39711
39712  if test $REPLACE_STRUCT_LCONV = 1; then
39713    REPLACE_LOCALECONV=1
39714  fi
39715
39716  if test $REPLACE_LOCALECONV = 1; then
39717
39718
39719
39720
39721
39722
39723
39724
39725  gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext"
39726
39727
39728  ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h>
39729"
39730if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes; then :
39731
39732cat >>confdefs.h <<_ACEOF
39733#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1
39734_ACEOF
39735
39736
39737fi
39738
39739
39740  fi
39741
39742
39743
39744
39745
39746          GNULIB_LOCALECONV=1
39747
39748
39749
39750
39751
39752$as_echo "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h
39753
39754
39755
39756
39757
39758
39759
39760
39761
39762
39763
39764
39765  gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext"
39766
39767
39768
39769  if test "$gl_threads_api" = posix; then
39770    # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
39771    # pthread_rwlock_* functions.
39772    has_rwlock=false
39773    ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
39774"
39775if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
39776  has_rwlock=true
39777
39778$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
39779
39780fi
39781
39782    if $has_rwlock; then
39783
39784
39785  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5
39786$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; }
39787if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then :
39788  $as_echo_n "(cached) " >&6
39789else
39790  save_LIBS="$LIBS"
39791     LIBS="$LIBS $LIBMULTITHREAD"
39792     if test "$cross_compiling" = yes; then :
39793  gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
39794else
39795  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39796/* end confdefs.h.  */
39797
39798#include <errno.h>
39799#include <pthread.h>
39800#include <stdlib.h>
39801#include <unistd.h>
39802
39803#define SUCCEED() exit (0)
39804#define FAILURE() exit (1)
39805#define UNEXPECTED(n) (exit (10 + (n)))
39806
39807/* The main thread creates the waiting writer and the requesting reader threads
39808   in the default way; this guarantees that they have the same priority.
39809   We can reuse the main thread as first reader thread.  */
39810
39811static pthread_rwlock_t lock;
39812static pthread_t reader1;
39813static pthread_t writer;
39814static pthread_t reader2;
39815static pthread_t timer;
39816/* Used to pass control from writer to reader2 and from reader2 to timer,
39817   as in a relay race.
39818   Passing control from one running thread to another running thread
39819   is most likely faster than to create the second thread.  */
39820static pthread_mutex_t baton;
39821
39822static void *
39823timer_func (void *ignored)
39824{
39825  /* Step 13 (can be before or after step 12):
39826     The timer thread takes the baton, then waits a moment to make sure
39827     it can tell whether the second reader thread is blocked at step 12.  */
39828  if (pthread_mutex_lock (&baton))
39829    UNEXPECTED (13);
39830  usleep (100000);
39831  /* By the time we get here, it's clear that the second reader thread is
39832     blocked at step 12.  This is the desired behaviour.  */
39833  SUCCEED ();
39834}
39835
39836static void *
39837reader2_func (void *ignored)
39838{
39839  int err;
39840
39841  /* Step 8 (can be before or after step 7):
39842     The second reader thread takes the baton, then waits a moment to make sure
39843     the writer thread has reached step 7.  */
39844  if (pthread_mutex_lock (&baton))
39845    UNEXPECTED (8);
39846  usleep (100000);
39847  /* Step 9: The second reader thread requests the lock.  */
39848  err = pthread_rwlock_tryrdlock (&lock);
39849  if (err == 0)
39850    FAILURE ();
39851  else if (err != EBUSY)
39852    UNEXPECTED (9);
39853  /* Step 10: Launch a timer, to test whether the next call blocks.  */
39854  if (pthread_create (&timer, NULL, timer_func, NULL))
39855    UNEXPECTED (10);
39856  /* Step 11: Release the baton.  */
39857  if (pthread_mutex_unlock (&baton))
39858    UNEXPECTED (11);
39859  /* Step 12: The second reader thread requests the lock.  */
39860  err = pthread_rwlock_rdlock (&lock);
39861  if (err == 0)
39862    FAILURE ();
39863  else
39864    UNEXPECTED (12);
39865}
39866
39867static void *
39868writer_func (void *ignored)
39869{
39870  /* Step 4: Take the baton, so that the second reader thread does not go ahead
39871     too early.  */
39872  if (pthread_mutex_lock (&baton))
39873    UNEXPECTED (4);
39874  /* Step 5: Create the second reader thread.  */
39875  if (pthread_create (&reader2, NULL, reader2_func, NULL))
39876    UNEXPECTED (5);
39877  /* Step 6: Release the baton.  */
39878  if (pthread_mutex_unlock (&baton))
39879    UNEXPECTED (6);
39880  /* Step 7: The writer thread requests the lock.  */
39881  if (pthread_rwlock_wrlock (&lock))
39882    UNEXPECTED (7);
39883  return NULL;
39884}
39885
39886int
39887main ()
39888{
39889  reader1 = pthread_self ();
39890
39891  /* Step 1: The main thread initializes the lock and the baton.  */
39892  if (pthread_rwlock_init (&lock, NULL))
39893    UNEXPECTED (1);
39894  if (pthread_mutex_init (&baton, NULL))
39895    UNEXPECTED (1);
39896  /* Step 2: The main thread acquires the lock as a reader.  */
39897  if (pthread_rwlock_rdlock (&lock))
39898    UNEXPECTED (2);
39899  /* Step 3: Create the writer thread.  */
39900  if (pthread_create (&writer, NULL, writer_func, NULL))
39901    UNEXPECTED (3);
39902  /* Job done.  Go to sleep.  */
39903  for (;;)
39904    {
39905      sleep (1);
39906    }
39907}
39908
39909_ACEOF
39910if ac_fn_c_try_run "$LINENO"; then :
39911  gl_cv_pthread_rwlock_rdlock_prefer_writer=yes
39912else
39913  gl_cv_pthread_rwlock_rdlock_prefer_writer=no
39914fi
39915rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
39916  conftest.$ac_objext conftest.beam conftest.$ac_ext
39917fi
39918
39919     LIBS="$save_LIBS"
39920
39921fi
39922{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5
39923$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; }
39924  case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
39925    *yes)
39926
39927$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h
39928
39929      ;;
39930  esac
39931
39932    fi
39933    # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
39934    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39935/* end confdefs.h.  */
39936
39937      #include <pthread.h>
39938int
39939main ()
39940{
39941
39942#if __FreeBSD__ == 4
39943error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
39944#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
39945       && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
39946error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
39947#else
39948int x = (int)PTHREAD_MUTEX_RECURSIVE;
39949return !x;
39950#endif
39951
39952  ;
39953  return 0;
39954}
39955_ACEOF
39956if ac_fn_c_try_compile "$LINENO"; then :
39957
39958$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
39959
39960fi
39961rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39962  fi
39963  :
39964
39965
39966
39967cat >>confdefs.h <<_ACEOF
39968#define GNULIB_LOCK 1
39969_ACEOF
39970
39971
39972
39973
39974
39975
39976
39977
39978  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek detects pipes" >&5
39979$as_echo_n "checking whether lseek detects pipes... " >&6; }
39980if ${gl_cv_func_lseek_pipe+:} false; then :
39981  $as_echo_n "(cached) " >&6
39982else
39983  case "$host_os" in
39984       mingw*)
39985                                                               gl_cv_func_lseek_pipe=no
39986         ;;
39987       *)
39988         if test $cross_compiling = no; then
39989           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39990/* end confdefs.h.  */
39991
39992#include <sys/types.h> /* for off_t */
39993#include <stdio.h> /* for SEEK_CUR */
39994#if HAVE_UNISTD_H
39995# include <unistd.h>
39996#else /* on Windows with MSVC */
39997# include <io.h>
39998#endif
39999
40000int
40001main ()
40002{
40003
40004  /* Exit with success only if stdin is seekable.  */
40005  return lseek (0, (off_t)0, SEEK_CUR) < 0;
40006
40007  ;
40008  return 0;
40009}
40010_ACEOF
40011if ac_fn_c_try_link "$LINENO"; then :
40012  if test -s conftest$ac_exeext \
40013                 && ./conftest$ac_exeext < conftest.$ac_ext \
40014                 && test 1 = "`echo hi \
40015                   | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
40016                gl_cv_func_lseek_pipe=yes
40017              else
40018                gl_cv_func_lseek_pipe=no
40019              fi
40020
40021else
40022  gl_cv_func_lseek_pipe=no
40023fi
40024rm -f core conftest.err conftest.$ac_objext \
40025    conftest$ac_exeext conftest.$ac_ext
40026         else
40027           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40028/* end confdefs.h.  */
40029
40030#if defined __BEOS__
40031/* BeOS mistakenly return 0 when trying to seek on pipes.  */
40032  Choke me.
40033#endif
40034_ACEOF
40035if ac_fn_c_try_compile "$LINENO"; then :
40036  gl_cv_func_lseek_pipe=yes
40037else
40038  gl_cv_func_lseek_pipe=no
40039fi
40040rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40041         fi
40042         ;;
40043     esac
40044
40045fi
40046{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lseek_pipe" >&5
40047$as_echo "$gl_cv_func_lseek_pipe" >&6; }
40048  if test $gl_cv_func_lseek_pipe = no; then
40049    REPLACE_LSEEK=1
40050
40051$as_echo "#define LSEEK_PIPE_BROKEN 1" >>confdefs.h
40052
40053  fi
40054
40055
40056  if test $WINDOWS_64_BIT_OFF_T = 1; then
40057    REPLACE_LSEEK=1
40058  fi
40059
40060  if test $REPLACE_LSEEK = 1; then
40061
40062
40063
40064
40065
40066
40067
40068
40069  gl_LIBOBJS="$gl_LIBOBJS lseek.$ac_objext"
40070
40071  fi
40072
40073
40074
40075
40076
40077          GNULIB_LSEEK=1
40078
40079
40080
40081
40082
40083$as_echo "#define GNULIB_TEST_LSEEK 1" >>confdefs.h
40084
40085
40086
40087
40088
40089
40090
40091  if test $ac_cv_func_lstat = yes; then
40092
40093    case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
40094      solaris* | *no)
40095        REPLACE_LSTAT=1
40096        ;;
40097    esac
40098  else
40099    HAVE_LSTAT=0
40100  fi
40101
40102  if test $REPLACE_LSTAT = 1; then
40103
40104
40105
40106
40107
40108
40109
40110
40111  gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
40112
40113    :
40114  fi
40115
40116
40117
40118
40119
40120          GNULIB_LSTAT=1
40121
40122
40123
40124
40125
40126$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
40127
40128
40129
40130
40131
40132
40133
40134
40135      for ac_header in stdlib.h
40136do :
40137  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
40138if test "x$ac_cv_header_stdlib_h" = xyes; then :
40139  cat >>confdefs.h <<_ACEOF
40140#define HAVE_STDLIB_H 1
40141_ACEOF
40142
40143fi
40144
40145done
40146
40147  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
40148$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
40149if ${ac_cv_func_malloc_0_nonnull+:} false; then :
40150  $as_echo_n "(cached) " >&6
40151else
40152  if test "$cross_compiling" = yes; then :
40153  case "$host_os" in
40154          # Guess yes on platforms where we know the result.
40155          *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \
40156          | hpux* | solaris* | cygwin* | mingw*)
40157            ac_cv_func_malloc_0_nonnull=yes ;;
40158          # If we don't know, assume the worst.
40159          *) ac_cv_func_malloc_0_nonnull=no ;;
40160        esac
40161
40162else
40163  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40164/* end confdefs.h.  */
40165#if defined STDC_HEADERS || defined HAVE_STDLIB_H
40166            # include <stdlib.h>
40167            #else
40168            char *malloc ();
40169            #endif
40170
40171int
40172main ()
40173{
40174char *p = malloc (0);
40175            int result = !p;
40176            free (p);
40177            return result;
40178  ;
40179  return 0;
40180}
40181
40182_ACEOF
40183if ac_fn_c_try_run "$LINENO"; then :
40184  ac_cv_func_malloc_0_nonnull=yes
40185else
40186  ac_cv_func_malloc_0_nonnull=no
40187fi
40188rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
40189  conftest.$ac_objext conftest.beam conftest.$ac_ext
40190fi
40191
40192
40193fi
40194{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
40195$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
40196  if test $ac_cv_func_malloc_0_nonnull = yes; then :
40197
40198$as_echo "#define HAVE_MALLOC_GNU 1" >>confdefs.h
40199
40200else
40201  $as_echo "#define HAVE_MALLOC_GNU 0" >>confdefs.h
40202
40203     REPLACE_MALLOC=1
40204
40205fi
40206
40207
40208  if test $REPLACE_MALLOC = 1; then
40209
40210
40211
40212
40213
40214
40215
40216
40217  gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
40218
40219  fi
40220
40221
40222cat >>confdefs.h <<_ACEOF
40223#define GNULIB_MALLOC_GNU 1
40224_ACEOF
40225
40226
40227
40228
40229
40230  if test $gl_cv_func_malloc_posix = yes; then
40231
40232$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
40233
40234  else
40235    REPLACE_MALLOC=1
40236  fi
40237
40238  if test $REPLACE_MALLOC = 1; then
40239
40240
40241
40242
40243
40244
40245
40246
40247  gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
40248
40249  fi
40250
40251
40252
40253
40254
40255          GNULIB_MALLOC_POSIX=1
40256
40257
40258
40259
40260
40261$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
40262
40263
40264
40265
40266
40267
40268
40269
40270
40271
40272
40273
40274
40275
40276
40277
40278
40279
40280     if test $gl_cv_have_include_next = yes; then
40281       gl_cv_next_math_h='<'math.h'>'
40282     else
40283       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
40284$as_echo_n "checking absolute name of <math.h>... " >&6; }
40285if ${gl_cv_next_math_h+:} false; then :
40286  $as_echo_n "(cached) " >&6
40287else
40288
40289             if test $ac_cv_header_math_h = yes; then
40290
40291
40292
40293
40294  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40295/* end confdefs.h.  */
40296#include <math.h>
40297_ACEOF
40298                case "$host_os" in
40299    aix*) gl_absname_cpp="$ac_cpp -C" ;;
40300    *)    gl_absname_cpp="$ac_cpp" ;;
40301  esac
40302
40303  case "$host_os" in
40304    mingw*)
40305                                          gl_dirsep_regex='[/\\]'
40306      ;;
40307    *)
40308      gl_dirsep_regex='\/'
40309      ;;
40310  esac
40311      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
40312  gl_header_literal_regex=`echo 'math.h' \
40313                           | sed -e "$gl_make_literal_regex_sed"`
40314  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
40315      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
40316      s|^/[^/]|//&|
40317      p
40318      q
40319    }'
40320
40321        gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
40322  sed -n "$gl_absolute_header_sed"`
40323
40324           gl_header=$gl_cv_absolute_math_h
40325           gl_cv_next_math_h='"'$gl_header'"'
40326          else
40327               gl_cv_next_math_h='<'math.h'>'
40328             fi
40329
40330
40331fi
40332{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
40333$as_echo "$gl_cv_next_math_h" >&6; }
40334     fi
40335     NEXT_MATH_H=$gl_cv_next_math_h
40336
40337     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
40338       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
40339       gl_next_as_first_directive='<'math.h'>'
40340     else
40341       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
40342       gl_next_as_first_directive=$gl_cv_next_math_h
40343     fi
40344     NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
40345
40346
40347
40348
40349
40350  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
40351$as_echo_n "checking whether NAN macro works... " >&6; }
40352if ${gl_cv_header_math_nan_works+:} false; then :
40353  $as_echo_n "(cached) " >&6
40354else
40355  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40356/* end confdefs.h.  */
40357#include <math.h>
40358int
40359main ()
40360{
40361/* Solaris 10 has a broken definition of NAN.  Other platforms
40362        fail to provide NAN, or provide it only in C99 mode; this
40363        test only needs to fail when NAN is provided but wrong.  */
40364         float f = 1.0f;
40365#ifdef NAN
40366         f = NAN;
40367#endif
40368         return f == 0;
40369  ;
40370  return 0;
40371}
40372_ACEOF
40373if ac_fn_c_try_compile "$LINENO"; then :
40374  gl_cv_header_math_nan_works=yes
40375else
40376  gl_cv_header_math_nan_works=no
40377fi
40378rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40379fi
40380{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
40381$as_echo "$gl_cv_header_math_nan_works" >&6; }
40382  if test $gl_cv_header_math_nan_works = no; then
40383    REPLACE_NAN=1
40384  fi
40385  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
40386$as_echo_n "checking whether HUGE_VAL works... " >&6; }
40387if ${gl_cv_header_math_huge_val_works+:} false; then :
40388  $as_echo_n "(cached) " >&6
40389else
40390  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40391/* end confdefs.h.  */
40392#include <math.h>
40393int
40394main ()
40395{
40396/* Solaris 10 has a broken definition of HUGE_VAL.  */
40397         double d = HUGE_VAL;
40398         return d == 0;
40399  ;
40400  return 0;
40401}
40402_ACEOF
40403if ac_fn_c_try_compile "$LINENO"; then :
40404  gl_cv_header_math_huge_val_works=yes
40405else
40406  gl_cv_header_math_huge_val_works=no
40407fi
40408rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40409fi
40410{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
40411$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
40412  if test $gl_cv_header_math_huge_val_works = no; then
40413    REPLACE_HUGE_VAL=1
40414  fi
40415
40416
40417
40418
40419
40420
40421
40422
40423  :
40424
40425
40426
40427
40428
40429
40430
40431  if test $ac_cv_func_mbrlen = no; then
40432    HAVE_MBRLEN=0
40433    ac_fn_c_check_decl "$LINENO" "mbrlen" "ac_cv_have_decl_mbrlen" "
40434/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
40435   <wchar.h>.
40436   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
40437   included before <wchar.h>.  */
40438#include <stddef.h>
40439#include <stdio.h>
40440#include <time.h>
40441#include <wchar.h>
40442
40443"
40444if test "x$ac_cv_have_decl_mbrlen" = xyes; then :
40445  ac_have_decl=1
40446else
40447  ac_have_decl=0
40448fi
40449
40450cat >>confdefs.h <<_ACEOF
40451#define HAVE_DECL_MBRLEN $ac_have_decl
40452_ACEOF
40453
40454    if test $ac_cv_have_decl_mbrlen = yes; then
40455                        REPLACE_MBRLEN=1
40456    fi
40457  else
40458                    if test $REPLACE_MBRTOWC = 1; then
40459      REPLACE_MBRLEN=1
40460    fi
40461  fi
40462
40463  if test $HAVE_MBRLEN = 0 || test $REPLACE_MBRLEN = 1; then
40464
40465
40466
40467
40468
40469
40470
40471
40472  gl_LIBOBJS="$gl_LIBOBJS mbrlen.$ac_objext"
40473
40474
40475  :
40476
40477  fi
40478
40479
40480
40481
40482
40483          GNULIB_MBRLEN=1
40484
40485
40486
40487
40488
40489$as_echo "#define GNULIB_TEST_MBRLEN 1" >>confdefs.h
40490
40491
40492
40493
40494
40495
40496
40497
40498
40499
40500
40501
40502
40503  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
40504
40505
40506
40507     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
40508$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
40509if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
40510  $as_echo_n "(cached) " >&6
40511else
40512
40513                  case "$host_os" in
40514                     # Guess no on AIX and OSF/1.
40515        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
40516                     # Guess yes otherwise.
40517        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
40518      esac
40519      if test $LOCALE_JA != none; then
40520        if test "$cross_compiling" = yes; then :
40521  :
40522else
40523  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40524/* end confdefs.h.  */
40525
40526#include <locale.h>
40527#include <string.h>
40528/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
40529   <wchar.h>.
40530   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
40531   included before <wchar.h>.  */
40532#include <stddef.h>
40533#include <stdio.h>
40534#include <time.h>
40535#include <wchar.h>
40536int main ()
40537{
40538  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
40539    {
40540      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
40541      mbstate_t state;
40542      wchar_t wc;
40543
40544      memset (&state, '\0', sizeof (mbstate_t));
40545      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
40546        if (mbsinit (&state))
40547          return 2;
40548    }
40549  return 0;
40550}
40551_ACEOF
40552if ac_fn_c_try_run "$LINENO"; then :
40553  gl_cv_func_mbrtowc_incomplete_state=yes
40554else
40555  gl_cv_func_mbrtowc_incomplete_state=no
40556fi
40557rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
40558  conftest.$ac_objext conftest.beam conftest.$ac_ext
40559fi
40560
40561      fi
40562
40563fi
40564{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
40565$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
40566
40567
40568
40569
40570     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
40571$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
40572if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
40573  $as_echo_n "(cached) " >&6
40574else
40575
40576                  case "$host_os" in
40577                    # Guess no on Solaris 8.
40578        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
40579                    # Guess yes otherwise.
40580        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
40581      esac
40582      if test $LOCALE_ZH_CN != none; then
40583        if test "$cross_compiling" = yes; then :
40584  :
40585else
40586  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40587/* end confdefs.h.  */
40588
40589#include <locale.h>
40590#include <stdlib.h>
40591#include <string.h>
40592/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
40593   <wchar.h>.
40594   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
40595   included before <wchar.h>.  */
40596#include <stddef.h>
40597#include <stdio.h>
40598#include <time.h>
40599#include <wchar.h>
40600int main ()
40601{
40602  /* This fails on Solaris 8:
40603     mbrtowc returns 2, and sets wc to 0x00F0.
40604     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
40605  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
40606    {
40607      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
40608      mbstate_t state;
40609      wchar_t wc;
40610
40611      memset (&state, '\0', sizeof (mbstate_t));
40612      if (mbrtowc (&wc, input + 3, 6, &state) != 4
40613          && mbtowc (&wc, input + 3, 6) == 4)
40614        return 2;
40615    }
40616  return 0;
40617}
40618_ACEOF
40619if ac_fn_c_try_run "$LINENO"; then :
40620  gl_cv_func_mbrtowc_sanitycheck=yes
40621else
40622  gl_cv_func_mbrtowc_sanitycheck=no
40623fi
40624rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
40625  conftest.$ac_objext conftest.beam conftest.$ac_ext
40626fi
40627
40628      fi
40629
40630fi
40631{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
40632$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
40633
40634    REPLACE_MBSTATE_T=0
40635    case "$gl_cv_func_mbrtowc_incomplete_state" in
40636      *yes) ;;
40637      *) REPLACE_MBSTATE_T=1 ;;
40638    esac
40639    case "$gl_cv_func_mbrtowc_sanitycheck" in
40640      *yes) ;;
40641      *) REPLACE_MBSTATE_T=1 ;;
40642    esac
40643  else
40644    REPLACE_MBSTATE_T=1
40645  fi
40646
40647
40648
40649  if test $ac_cv_func_mbrtowc = no; then
40650    HAVE_MBRTOWC=0
40651    ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
40652/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
40653   <wchar.h>.
40654   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
40655   included before <wchar.h>.  */
40656#include <stddef.h>
40657#include <stdio.h>
40658#include <time.h>
40659#include <wchar.h>
40660
40661"
40662if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
40663  ac_have_decl=1
40664else
40665  ac_have_decl=0
40666fi
40667
40668cat >>confdefs.h <<_ACEOF
40669#define HAVE_DECL_MBRTOWC $ac_have_decl
40670_ACEOF
40671
40672    if test $ac_cv_have_decl_mbrtowc = yes; then
40673                        REPLACE_MBRTOWC=1
40674    fi
40675  else
40676    if test $REPLACE_MBSTATE_T = 1; then
40677      REPLACE_MBRTOWC=1
40678    else
40679
40680
40681
40682     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
40683$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
40684if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
40685  $as_echo_n "(cached) " >&6
40686else
40687
40688                  case "$host_os" in
40689                  # Guess no on Solaris.
40690        solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
40691                  # Guess yes otherwise.
40692        *)        gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
40693      esac
40694      if test $LOCALE_FR_UTF8 != none; then
40695        if test "$cross_compiling" = yes; then :
40696  :
40697else
40698  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40699/* end confdefs.h.  */
40700
40701#include <locale.h>
40702#include <stdlib.h>
40703#include <string.h>
40704/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
40705   <wchar.h>.
40706   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
40707   included before <wchar.h>.  */
40708#include <stddef.h>
40709#include <stdio.h>
40710#include <time.h>
40711#include <wchar.h>
40712int main ()
40713{
40714  int result = 0;
40715
40716  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
40717    {
40718      char input[] = "\303\237er";
40719      mbstate_t state;
40720      wchar_t wc;
40721      size_t ret;
40722
40723      memset (&state, '\0', sizeof (mbstate_t));
40724      wc = (wchar_t) 0xBADFACE;
40725      ret = mbrtowc (&wc, input, 5, &state);
40726      if (ret != 2)
40727        result |= 1;
40728      if (!mbsinit (&state))
40729        result |= 2;
40730
40731      memset (&state, '\0', sizeof (mbstate_t));
40732      ret = mbrtowc (NULL, input, 5, &state);
40733      if (ret != 2) /* Solaris 7 fails here: ret is -1.  */
40734        result |= 4;
40735      if (!mbsinit (&state))
40736        result |= 8;
40737    }
40738  return result;
40739}
40740_ACEOF
40741if ac_fn_c_try_run "$LINENO"; then :
40742  gl_cv_func_mbrtowc_null_arg1=yes
40743else
40744  gl_cv_func_mbrtowc_null_arg1=no
40745fi
40746rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
40747  conftest.$ac_objext conftest.beam conftest.$ac_ext
40748fi
40749
40750      fi
40751
40752fi
40753{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
40754$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
40755
40756
40757
40758
40759     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
40760$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
40761if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
40762  $as_echo_n "(cached) " >&6
40763else
40764
40765                  case "$host_os" in
40766              # Guess no on OSF/1.
40767        osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
40768              # Guess yes otherwise.
40769        *)    gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
40770      esac
40771      if test $LOCALE_FR_UTF8 != none; then
40772        if test "$cross_compiling" = yes; then :
40773  :
40774else
40775  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40776/* end confdefs.h.  */
40777
40778#include <locale.h>
40779#include <string.h>
40780/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
40781   <wchar.h>.
40782   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
40783   included before <wchar.h>.  */
40784#include <stddef.h>
40785#include <stdio.h>
40786#include <time.h>
40787#include <wchar.h>
40788int main ()
40789{
40790  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
40791    {
40792      mbstate_t state;
40793      wchar_t wc;
40794      int ret;
40795
40796      memset (&state, '\0', sizeof (mbstate_t));
40797      wc = (wchar_t) 0xBADFACE;
40798      mbrtowc (&wc, NULL, 5, &state);
40799      /* Check that wc was not modified.  */
40800      if (wc != (wchar_t) 0xBADFACE)
40801        return 2;
40802    }
40803  return 0;
40804}
40805_ACEOF
40806if ac_fn_c_try_run "$LINENO"; then :
40807  gl_cv_func_mbrtowc_null_arg2=yes
40808else
40809  gl_cv_func_mbrtowc_null_arg2=no
40810fi
40811rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
40812  conftest.$ac_objext conftest.beam conftest.$ac_ext
40813fi
40814
40815      fi
40816
40817fi
40818{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
40819$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
40820
40821
40822
40823
40824
40825
40826  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
40827$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
40828if ${gl_cv_func_mbrtowc_retval+:} false; then :
40829  $as_echo_n "(cached) " >&6
40830else
40831
40832                  case "$host_os" in
40833                                   # Guess no on HP-UX, Solaris, native Windows.
40834        hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
40835                                   # Guess yes otherwise.
40836        *)                         gl_cv_func_mbrtowc_retval="guessing yes" ;;
40837      esac
40838      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
40839         || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
40840        if test "$cross_compiling" = yes; then :
40841  :
40842else
40843  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40844/* end confdefs.h.  */
40845
40846#include <locale.h>
40847#include <string.h>
40848/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
40849   <wchar.h>.
40850   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
40851   included before <wchar.h>.  */
40852#include <stddef.h>
40853#include <stdio.h>
40854#include <time.h>
40855#include <wchar.h>
40856int main ()
40857{
40858  int result = 0;
40859  int found_some_locale = 0;
40860  /* This fails on Solaris.  */
40861  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
40862    {
40863      char input[] = "B\303\274\303\237er"; /* "Büßer" */
40864      mbstate_t state;
40865      wchar_t wc;
40866
40867      memset (&state, '\0', sizeof (mbstate_t));
40868      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
40869        {
40870          input[1] = '\0';
40871          if (mbrtowc (&wc, input + 2, 5, &state) != 1)
40872            result |= 1;
40873        }
40874      found_some_locale = 1;
40875    }
40876  /* This fails on HP-UX 11.11.  */
40877  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
40878    {
40879      char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
40880      mbstate_t state;
40881      wchar_t wc;
40882
40883      memset (&state, '\0', sizeof (mbstate_t));
40884      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
40885        {
40886          input[1] = '\0';
40887          if (mbrtowc (&wc, input + 2, 5, &state) != 2)
40888            result |= 2;
40889        }
40890      found_some_locale = 1;
40891    }
40892  /* This fails on native Windows.  */
40893  if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
40894    {
40895      char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
40896      mbstate_t state;
40897      wchar_t wc;
40898
40899      memset (&state, '\0', sizeof (mbstate_t));
40900      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
40901        {
40902          input[3] = '\0';
40903          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
40904            result |= 4;
40905        }
40906      found_some_locale = 1;
40907    }
40908  if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
40909    {
40910      char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
40911      mbstate_t state;
40912      wchar_t wc;
40913
40914      memset (&state, '\0', sizeof (mbstate_t));
40915      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
40916        {
40917          input[3] = '\0';
40918          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
40919            result |= 8;
40920        }
40921      found_some_locale = 1;
40922    }
40923  if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
40924    {
40925      char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
40926      mbstate_t state;
40927      wchar_t wc;
40928
40929      memset (&state, '\0', sizeof (mbstate_t));
40930      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
40931        {
40932          input[3] = '\0';
40933          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
40934            result |= 16;
40935        }
40936      found_some_locale = 1;
40937    }
40938  return (found_some_locale ? result : 77);
40939}
40940_ACEOF
40941if ac_fn_c_try_run "$LINENO"; then :
40942  gl_cv_func_mbrtowc_retval=yes
40943else
40944  if test $? != 77; then
40945             gl_cv_func_mbrtowc_retval=no
40946           fi
40947
40948fi
40949rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
40950  conftest.$ac_objext conftest.beam conftest.$ac_ext
40951fi
40952
40953      fi
40954
40955fi
40956{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
40957$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
40958
40959
40960
40961
40962     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
40963$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
40964if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
40965  $as_echo_n "(cached) " >&6
40966else
40967
40968                  case "$host_os" in
40969                       # Guess no on Solaris 8 and 9.
40970        solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
40971                       # Guess yes otherwise.
40972        *)             gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
40973      esac
40974      if test $LOCALE_ZH_CN != none; then
40975        if test "$cross_compiling" = yes; then :
40976  :
40977else
40978  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40979/* end confdefs.h.  */
40980
40981#include <locale.h>
40982#include <string.h>
40983/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
40984   <wchar.h>.
40985   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
40986   included before <wchar.h>.  */
40987#include <stddef.h>
40988#include <stdio.h>
40989#include <time.h>
40990#include <wchar.h>
40991int main ()
40992{
40993  /* This fails on Solaris 8 and 9.  */
40994  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
40995    {
40996      mbstate_t state;
40997      wchar_t wc;
40998
40999      memset (&state, '\0', sizeof (mbstate_t));
41000      if (mbrtowc (&wc, "", 1, &state) != 0)
41001        return 2;
41002    }
41003  return 0;
41004}
41005_ACEOF
41006if ac_fn_c_try_run "$LINENO"; then :
41007  gl_cv_func_mbrtowc_nul_retval=yes
41008else
41009  gl_cv_func_mbrtowc_nul_retval=no
41010fi
41011rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
41012  conftest.$ac_objext conftest.beam conftest.$ac_ext
41013fi
41014
41015      fi
41016
41017fi
41018{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
41019$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
41020
41021
41022
41023     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
41024$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
41025if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
41026  $as_echo_n "(cached) " >&6
41027else
41028
41029                  case "$host_os" in
41030                              # Guess no on AIX and glibc systems.
41031        aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
41032                              # Guess yes on native Windows.
41033        mingw*)               gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
41034        *)                    gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
41035      esac
41036      if test "$cross_compiling" = yes; then :
41037  :
41038else
41039  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41040/* end confdefs.h.  */
41041
41042           #include <wchar.h>
41043           static wchar_t wc;
41044           static mbstate_t mbs;
41045           int
41046           main (void)
41047           {
41048             return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
41049           }
41050_ACEOF
41051if ac_fn_c_try_run "$LINENO"; then :
41052  gl_cv_func_mbrtowc_empty_input=yes
41053else
41054  gl_cv_func_mbrtowc_empty_input=no
41055fi
41056rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
41057  conftest.$ac_objext conftest.beam conftest.$ac_ext
41058fi
41059
41060
41061fi
41062{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
41063$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
41064
41065
41066     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
41067$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
41068if ${gl_cv_C_locale_sans_EILSEQ+:} false; then :
41069  $as_echo_n "(cached) " >&6
41070else
41071
41072               gl_cv_C_locale_sans_EILSEQ="guessing no"
41073
41074     if test "$cross_compiling" = yes; then :
41075  case "$host_os" in
41076                 # Guess yes on native Windows.
41077         mingw*) gl_cv_C_locale_sans_EILSEQ="guessing yes" ;;
41078       esac
41079
41080else
41081  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41082/* end confdefs.h.  */
41083#include <limits.h>
41084            #include <locale.h>
41085            #include <wchar.h>
41086
41087int
41088main ()
41089{
41090
41091            int i;
41092            char *locale = setlocale (LC_ALL, "C");
41093            if (! locale)
41094              return 2;
41095            for (i = CHAR_MIN; i <= CHAR_MAX; i++)
41096              {
41097                char c = i;
41098                wchar_t wc;
41099                mbstate_t mbs = { 0, };
41100                size_t ss = mbrtowc (&wc, &c, 1, &mbs);
41101                if (1 < ss)
41102                  return 3;
41103              }
41104            return 0;
41105
41106  ;
41107  return 0;
41108}
41109_ACEOF
41110if ac_fn_c_try_run "$LINENO"; then :
41111  gl_cv_C_locale_sans_EILSEQ=yes
41112else
41113  gl_cv_C_locale_sans_EILSEQ=no
41114fi
41115rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
41116  conftest.$ac_objext conftest.beam conftest.$ac_ext
41117fi
41118
41119
41120fi
41121{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5
41122$as_echo "$gl_cv_C_locale_sans_EILSEQ" >&6; }
41123
41124      case "$gl_cv_func_mbrtowc_null_arg1" in
41125        *yes) ;;
41126        *)
41127$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
41128
41129           REPLACE_MBRTOWC=1
41130           ;;
41131      esac
41132      case "$gl_cv_func_mbrtowc_null_arg2" in
41133        *yes) ;;
41134        *)
41135$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
41136
41137           REPLACE_MBRTOWC=1
41138           ;;
41139      esac
41140      case "$gl_cv_func_mbrtowc_retval" in
41141        *yes) ;;
41142        *)
41143$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
41144
41145           REPLACE_MBRTOWC=1
41146           ;;
41147      esac
41148      case "$gl_cv_func_mbrtowc_nul_retval" in
41149        *yes) ;;
41150        *)
41151$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
41152
41153           REPLACE_MBRTOWC=1
41154           ;;
41155      esac
41156      case "$gl_cv_func_mbrtowc_empty_input" in
41157        *yes) ;;
41158        *)
41159$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
41160
41161           REPLACE_MBRTOWC=1
41162           ;;
41163      esac
41164      case $gl_cv_C_locale_sans_EILSEQ in
41165        *yes) ;;
41166        *)
41167$as_echo "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
41168
41169           REPLACE_MBRTOWC=1
41170           ;;
41171      esac
41172    fi
41173  fi
41174
41175  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
41176
41177
41178
41179
41180
41181
41182
41183
41184  gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
41185
41186
41187
41188  :
41189
41190  fi
41191
41192
41193
41194
41195
41196          GNULIB_MBRTOWC=1
41197
41198
41199
41200
41201
41202$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
41203
41204
41205
41206
41207
41208
41209
41210
41211          GNULIB_MBSCASECMP=1
41212
41213
41214
41215
41216
41217$as_echo "#define GNULIB_TEST_MBSCASECMP 1" >>confdefs.h
41218
41219
41220
41221
41222
41223
41224
41225
41226          GNULIB_MBSCHR=1
41227
41228
41229
41230
41231
41232$as_echo "#define GNULIB_TEST_MBSCHR 1" >>confdefs.h
41233
41234
41235
41236
41237
41238
41239
41240
41241
41242
41243
41244
41245
41246
41247  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
41248
41249
41250
41251     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
41252$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
41253if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
41254  $as_echo_n "(cached) " >&6
41255else
41256
41257                  case "$host_os" in
41258                     # Guess no on AIX and OSF/1.
41259        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
41260                     # Guess yes otherwise.
41261        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
41262      esac
41263      if test $LOCALE_JA != none; then
41264        if test "$cross_compiling" = yes; then :
41265  :
41266else
41267  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41268/* end confdefs.h.  */
41269
41270#include <locale.h>
41271#include <string.h>
41272/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
41273   <wchar.h>.
41274   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
41275   included before <wchar.h>.  */
41276#include <stddef.h>
41277#include <stdio.h>
41278#include <time.h>
41279#include <wchar.h>
41280int main ()
41281{
41282  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
41283    {
41284      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
41285      mbstate_t state;
41286      wchar_t wc;
41287
41288      memset (&state, '\0', sizeof (mbstate_t));
41289      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
41290        if (mbsinit (&state))
41291          return 2;
41292    }
41293  return 0;
41294}
41295_ACEOF
41296if ac_fn_c_try_run "$LINENO"; then :
41297  gl_cv_func_mbrtowc_incomplete_state=yes
41298else
41299  gl_cv_func_mbrtowc_incomplete_state=no
41300fi
41301rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
41302  conftest.$ac_objext conftest.beam conftest.$ac_ext
41303fi
41304
41305      fi
41306
41307fi
41308{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
41309$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
41310
41311
41312
41313
41314     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
41315$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
41316if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
41317  $as_echo_n "(cached) " >&6
41318else
41319
41320                  case "$host_os" in
41321                    # Guess no on Solaris 8.
41322        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
41323                    # Guess yes otherwise.
41324        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
41325      esac
41326      if test $LOCALE_ZH_CN != none; then
41327        if test "$cross_compiling" = yes; then :
41328  :
41329else
41330  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41331/* end confdefs.h.  */
41332
41333#include <locale.h>
41334#include <stdlib.h>
41335#include <string.h>
41336/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
41337   <wchar.h>.
41338   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
41339   included before <wchar.h>.  */
41340#include <stddef.h>
41341#include <stdio.h>
41342#include <time.h>
41343#include <wchar.h>
41344int main ()
41345{
41346  /* This fails on Solaris 8:
41347     mbrtowc returns 2, and sets wc to 0x00F0.
41348     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
41349  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
41350    {
41351      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
41352      mbstate_t state;
41353      wchar_t wc;
41354
41355      memset (&state, '\0', sizeof (mbstate_t));
41356      if (mbrtowc (&wc, input + 3, 6, &state) != 4
41357          && mbtowc (&wc, input + 3, 6) == 4)
41358        return 2;
41359    }
41360  return 0;
41361}
41362_ACEOF
41363if ac_fn_c_try_run "$LINENO"; then :
41364  gl_cv_func_mbrtowc_sanitycheck=yes
41365else
41366  gl_cv_func_mbrtowc_sanitycheck=no
41367fi
41368rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
41369  conftest.$ac_objext conftest.beam conftest.$ac_ext
41370fi
41371
41372      fi
41373
41374fi
41375{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
41376$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
41377
41378    REPLACE_MBSTATE_T=0
41379    case "$gl_cv_func_mbrtowc_incomplete_state" in
41380      *yes) ;;
41381      *) REPLACE_MBSTATE_T=1 ;;
41382    esac
41383    case "$gl_cv_func_mbrtowc_sanitycheck" in
41384      *yes) ;;
41385      *) REPLACE_MBSTATE_T=1 ;;
41386    esac
41387  else
41388    REPLACE_MBSTATE_T=1
41389  fi
41390
41391
41392
41393  if test $ac_cv_func_mbsinit = no; then
41394    HAVE_MBSINIT=0
41395    ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
41396/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
41397   <wchar.h>.
41398   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
41399   included before <wchar.h>.  */
41400#include <stddef.h>
41401#include <stdio.h>
41402#include <time.h>
41403#include <wchar.h>
41404
41405"
41406if test "x$ac_cv_have_decl_mbsinit" = xyes; then :
41407  ac_have_decl=1
41408else
41409  ac_have_decl=0
41410fi
41411
41412cat >>confdefs.h <<_ACEOF
41413#define HAVE_DECL_MBSINIT $ac_have_decl
41414_ACEOF
41415
41416    if test $ac_cv_have_decl_mbsinit = yes; then
41417                        REPLACE_MBSINIT=1
41418    fi
41419  else
41420    if test $REPLACE_MBSTATE_T = 1; then
41421      REPLACE_MBSINIT=1
41422    else
41423                        case "$host_os" in
41424        mingw*) REPLACE_MBSINIT=1 ;;
41425      esac
41426    fi
41427  fi
41428
41429  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
41430
41431
41432
41433
41434
41435
41436
41437
41438  gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
41439
41440
41441  :
41442
41443  fi
41444
41445
41446
41447
41448
41449          GNULIB_MBSINIT=1
41450
41451
41452
41453
41454
41455$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
41456
41457
41458
41459
41460
41461
41462  if test $ac_cv_func_mbslen = yes; then
41463    HAVE_MBSLEN=1
41464  else
41465    HAVE_MBSLEN=0
41466  fi
41467
41468
41469
41470
41471
41472
41473          GNULIB_MBSLEN=1
41474
41475
41476
41477
41478
41479$as_echo "#define GNULIB_TEST_MBSLEN 1" >>confdefs.h
41480
41481
41482
41483
41484
41485
41486
41487
41488
41489
41490
41491
41492
41493  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
41494
41495
41496
41497     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
41498$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
41499if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
41500  $as_echo_n "(cached) " >&6
41501else
41502
41503                  case "$host_os" in
41504                     # Guess no on AIX and OSF/1.
41505        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
41506                     # Guess yes otherwise.
41507        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
41508      esac
41509      if test $LOCALE_JA != none; then
41510        if test "$cross_compiling" = yes; then :
41511  :
41512else
41513  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41514/* end confdefs.h.  */
41515
41516#include <locale.h>
41517#include <string.h>
41518/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
41519   <wchar.h>.
41520   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
41521   included before <wchar.h>.  */
41522#include <stddef.h>
41523#include <stdio.h>
41524#include <time.h>
41525#include <wchar.h>
41526int main ()
41527{
41528  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
41529    {
41530      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
41531      mbstate_t state;
41532      wchar_t wc;
41533
41534      memset (&state, '\0', sizeof (mbstate_t));
41535      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
41536        if (mbsinit (&state))
41537          return 2;
41538    }
41539  return 0;
41540}
41541_ACEOF
41542if ac_fn_c_try_run "$LINENO"; then :
41543  gl_cv_func_mbrtowc_incomplete_state=yes
41544else
41545  gl_cv_func_mbrtowc_incomplete_state=no
41546fi
41547rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
41548  conftest.$ac_objext conftest.beam conftest.$ac_ext
41549fi
41550
41551      fi
41552
41553fi
41554{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
41555$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
41556
41557
41558
41559
41560     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
41561$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
41562if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
41563  $as_echo_n "(cached) " >&6
41564else
41565
41566                  case "$host_os" in
41567                    # Guess no on Solaris 8.
41568        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
41569                    # Guess yes otherwise.
41570        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
41571      esac
41572      if test $LOCALE_ZH_CN != none; then
41573        if test "$cross_compiling" = yes; then :
41574  :
41575else
41576  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41577/* end confdefs.h.  */
41578
41579#include <locale.h>
41580#include <stdlib.h>
41581#include <string.h>
41582/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
41583   <wchar.h>.
41584   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
41585   included before <wchar.h>.  */
41586#include <stddef.h>
41587#include <stdio.h>
41588#include <time.h>
41589#include <wchar.h>
41590int main ()
41591{
41592  /* This fails on Solaris 8:
41593     mbrtowc returns 2, and sets wc to 0x00F0.
41594     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
41595  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
41596    {
41597      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
41598      mbstate_t state;
41599      wchar_t wc;
41600
41601      memset (&state, '\0', sizeof (mbstate_t));
41602      if (mbrtowc (&wc, input + 3, 6, &state) != 4
41603          && mbtowc (&wc, input + 3, 6) == 4)
41604        return 2;
41605    }
41606  return 0;
41607}
41608_ACEOF
41609if ac_fn_c_try_run "$LINENO"; then :
41610  gl_cv_func_mbrtowc_sanitycheck=yes
41611else
41612  gl_cv_func_mbrtowc_sanitycheck=no
41613fi
41614rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
41615  conftest.$ac_objext conftest.beam conftest.$ac_ext
41616fi
41617
41618      fi
41619
41620fi
41621{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
41622$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
41623
41624    REPLACE_MBSTATE_T=0
41625    case "$gl_cv_func_mbrtowc_incomplete_state" in
41626      *yes) ;;
41627      *) REPLACE_MBSTATE_T=1 ;;
41628    esac
41629    case "$gl_cv_func_mbrtowc_sanitycheck" in
41630      *yes) ;;
41631      *) REPLACE_MBSTATE_T=1 ;;
41632    esac
41633  else
41634    REPLACE_MBSTATE_T=1
41635  fi
41636
41637
41638
41639  if test $ac_cv_func_mbsrtowcs = no; then
41640    HAVE_MBSRTOWCS=0
41641    ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" "
41642/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
41643   <wchar.h>.
41644   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
41645   included before <wchar.h>.  */
41646#include <stddef.h>
41647#include <stdio.h>
41648#include <time.h>
41649#include <wchar.h>
41650
41651"
41652if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then :
41653  ac_have_decl=1
41654else
41655  ac_have_decl=0
41656fi
41657
41658cat >>confdefs.h <<_ACEOF
41659#define HAVE_DECL_MBSRTOWCS $ac_have_decl
41660_ACEOF
41661
41662    if test $ac_cv_have_decl_mbsrtowcs = yes; then
41663                        REPLACE_MBSRTOWCS=1
41664    fi
41665  else
41666    if test $REPLACE_MBSTATE_T = 1; then
41667      REPLACE_MBSRTOWCS=1
41668    else
41669
41670
41671
41672
41673
41674
41675     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5
41676$as_echo_n "checking whether mbsrtowcs works... " >&6; }
41677if ${gl_cv_func_mbsrtowcs_works+:} false; then :
41678  $as_echo_n "(cached) " >&6
41679else
41680
41681                  case "$host_os" in
41682                                   # Guess no on HP-UX, Solaris, mingw.
41683        hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
41684                                   # Guess yes otherwise.
41685        *)                         gl_cv_func_mbsrtowcs_works="guessing yes" ;;
41686      esac
41687      if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
41688        if test "$cross_compiling" = yes; then :
41689  :
41690else
41691  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41692/* end confdefs.h.  */
41693
41694#include <locale.h>
41695#include <string.h>
41696/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
41697   <wchar.h>.
41698   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
41699   included before <wchar.h>.  */
41700#include <stddef.h>
41701#include <stdio.h>
41702#include <time.h>
41703#include <wchar.h>
41704int main ()
41705{
41706  int result = 0;
41707  /* Test whether the function supports a NULL destination argument.
41708     This fails on native Windows.  */
41709  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
41710    {
41711      const char input[] = "\337er";
41712      const char *src = input;
41713      mbstate_t state;
41714
41715      memset (&state, '\0', sizeof (mbstate_t));
41716      if (mbsrtowcs (NULL, &src, 1, &state) != 3
41717          || src != input)
41718        result |= 1;
41719    }
41720  /* Test whether the function works when started with a conversion state
41721     in non-initial state.  This fails on HP-UX 11.11 and Solaris 10.  */
41722  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
41723    {
41724      const char input[] = "B\303\274\303\237er";
41725      mbstate_t state;
41726
41727      memset (&state, '\0', sizeof (mbstate_t));
41728      if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
41729        if (!mbsinit (&state))
41730          {
41731            const char *src = input + 2;
41732            if (mbsrtowcs (NULL, &src, 10, &state) != 4)
41733              result |= 2;
41734          }
41735    }
41736  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
41737    {
41738      const char input[] = "<\306\374\313\334\270\354>";
41739      mbstate_t state;
41740
41741      memset (&state, '\0', sizeof (mbstate_t));
41742      if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2))
41743        if (!mbsinit (&state))
41744          {
41745            const char *src = input + 4;
41746            if (mbsrtowcs (NULL, &src, 10, &state) != 3)
41747              result |= 4;
41748          }
41749    }
41750  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
41751    {
41752      const char input[] = "B\250\271\201\060\211\070er";
41753      mbstate_t state;
41754
41755      memset (&state, '\0', sizeof (mbstate_t));
41756      if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
41757        if (!mbsinit (&state))
41758          {
41759            const char *src = input + 2;
41760            if (mbsrtowcs (NULL, &src, 10, &state) != 4)
41761              result |= 8;
41762          }
41763    }
41764  return result;
41765}
41766_ACEOF
41767if ac_fn_c_try_run "$LINENO"; then :
41768  gl_cv_func_mbsrtowcs_works=yes
41769else
41770  gl_cv_func_mbsrtowcs_works=no
41771fi
41772rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
41773  conftest.$ac_objext conftest.beam conftest.$ac_ext
41774fi
41775
41776      fi
41777
41778fi
41779{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5
41780$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
41781
41782      case "$gl_cv_func_mbsrtowcs_works" in
41783        *yes) ;;
41784        *) REPLACE_MBSRTOWCS=1 ;;
41785      esac
41786    fi
41787  fi
41788
41789  if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
41790
41791
41792
41793
41794
41795
41796
41797
41798  gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext"
41799
41800
41801
41802
41803
41804
41805
41806
41807
41808  gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext"
41809
41810
41811  :
41812
41813  fi
41814
41815
41816
41817
41818
41819          GNULIB_MBSRTOWCS=1
41820
41821
41822
41823
41824
41825$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
41826
41827
41828
41829
41830
41831
41832
41833
41834          GNULIB_MBSSTR=1
41835
41836
41837
41838
41839
41840$as_echo "#define GNULIB_TEST_MBSSTR 1" >>confdefs.h
41841
41842
41843
41844
41845
41846
41847
41848      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbswidth is declared in <wchar.h>" >&5
41849$as_echo_n "checking whether mbswidth is declared in <wchar.h>... " >&6; }
41850if ${ac_cv_have_decl_mbswidth+:} false; then :
41851  $as_echo_n "(cached) " >&6
41852else
41853  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41854/* end confdefs.h.  */
41855
41856/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
41857   <wchar.h>.
41858   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
41859   before <wchar.h>.  */
41860#include <stddef.h>
41861#include <stdio.h>
41862#include <time.h>
41863#include <wchar.h>
41864
41865int
41866main ()
41867{
41868
41869  char *p = (char *) mbswidth;
41870  return !p;
41871
41872  ;
41873  return 0;
41874}
41875_ACEOF
41876if ac_fn_c_try_compile "$LINENO"; then :
41877  ac_cv_have_decl_mbswidth=yes
41878else
41879  ac_cv_have_decl_mbswidth=no
41880fi
41881rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41882fi
41883{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_mbswidth" >&5
41884$as_echo "$ac_cv_have_decl_mbswidth" >&6; }
41885  if test $ac_cv_have_decl_mbswidth = yes; then
41886    ac_val=1
41887  else
41888    ac_val=0
41889  fi
41890
41891cat >>confdefs.h <<_ACEOF
41892#define HAVE_DECL_MBSWIDTH_IN_WCHAR_H $ac_val
41893_ACEOF
41894
41895
41896
41897
41898   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
41899$as_echo_n "checking for mbstate_t... " >&6; }
41900if ${ac_cv_type_mbstate_t+:} false; then :
41901  $as_echo_n "(cached) " >&6
41902else
41903  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41904/* end confdefs.h.  */
41905$ac_includes_default
41906/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
41907   <wchar.h>.
41908   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
41909   included before <wchar.h>.  */
41910#include <stddef.h>
41911#include <stdio.h>
41912#include <time.h>
41913#include <wchar.h>
41914int
41915main ()
41916{
41917mbstate_t x; return sizeof x;
41918  ;
41919  return 0;
41920}
41921_ACEOF
41922if ac_fn_c_try_compile "$LINENO"; then :
41923  ac_cv_type_mbstate_t=yes
41924else
41925  ac_cv_type_mbstate_t=no
41926fi
41927rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41928fi
41929{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
41930$as_echo "$ac_cv_type_mbstate_t" >&6; }
41931   if test $ac_cv_type_mbstate_t = yes; then
41932
41933$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
41934
41935   else
41936
41937$as_echo "#define mbstate_t int" >>confdefs.h
41938
41939   fi
41940
41941
41942
41943
41944
41945  if false; then
41946    REPLACE_MBTOWC=1
41947  fi
41948
41949  if test $REPLACE_MBTOWC = 1; then
41950
41951
41952
41953
41954
41955
41956
41957
41958  gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext"
41959
41960
41961  :
41962
41963  fi
41964
41965
41966
41967
41968
41969          GNULIB_MBTOWC=1
41970
41971
41972
41973
41974
41975$as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h
41976
41977
41978
41979
41980
41981  :
41982
41983
41984  :
41985
41986
41987  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
41988
41989
41990
41991
41992
41993
41994
41995
41996  gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
41997
41998
41999  for ac_header in bp-sym.h
42000do :
42001  ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
42002if test "x$ac_cv_header_bp_sym_h" = xyes; then :
42003  cat >>confdefs.h <<_ACEOF
42004#define HAVE_BP_SYM_H 1
42005_ACEOF
42006
42007fi
42008
42009done
42010
42011
42012  fi
42013
42014
42015
42016
42017
42018          GNULIB_MEMCHR=1
42019
42020
42021
42022
42023
42024$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
42025
42026
42027
42028  :
42029
42030
42031
42032
42033
42034
42035  for ac_func in mempcpy
42036do :
42037  ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
42038if test "x$ac_cv_func_mempcpy" = xyes; then :
42039  cat >>confdefs.h <<_ACEOF
42040#define HAVE_MEMPCPY 1
42041_ACEOF
42042
42043fi
42044done
42045
42046  if test $ac_cv_func_mempcpy = no; then
42047    HAVE_MEMPCPY=0
42048  fi
42049
42050  if test $HAVE_MEMPCPY = 0; then
42051
42052
42053
42054
42055
42056
42057
42058
42059  gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext"
42060
42061
42062  :
42063
42064  fi
42065
42066
42067
42068
42069
42070          GNULIB_MEMPCPY=1
42071
42072
42073
42074
42075
42076$as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
42077
42078
42079
42080
42081
42082
42083
42084
42085  if test $ac_cv_have_decl_memrchr = no; then
42086    HAVE_DECL_MEMRCHR=0
42087  fi
42088
42089  for ac_func in memrchr
42090do :
42091  ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
42092if test "x$ac_cv_func_memrchr" = xyes; then :
42093  cat >>confdefs.h <<_ACEOF
42094#define HAVE_MEMRCHR 1
42095_ACEOF
42096
42097fi
42098done
42099
42100
42101  if test $ac_cv_func_memrchr = no; then
42102
42103
42104
42105
42106
42107
42108
42109
42110  gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext"
42111
42112    :
42113  fi
42114
42115
42116
42117
42118
42119          GNULIB_MEMRCHR=1
42120
42121
42122
42123
42124
42125$as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h
42126
42127
42128
42129
42130
42131
42132
42133
42134
42135
42136  :
42137
42138
42139
42140  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5
42141$as_echo_n "checking whether mkdir handles trailing slash... " >&6; }
42142if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then :
42143  $as_echo_n "(cached) " >&6
42144else
42145  rm -rf conftest.dir
42146      if test "$cross_compiling" = yes; then :
42147  case "$host_os" in
42148                          # Guess yes on Linux systems.
42149         linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
42150                          # Guess yes on glibc systems.
42151         *-gnu* | gnu*)   gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
42152                          # Guess yes on MSVC, no on mingw.
42153         mingw*)          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42154/* end confdefs.h.  */
42155
42156#ifdef _MSC_VER
42157 Known
42158#endif
42159
42160_ACEOF
42161if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
42162  $EGREP "Known" >/dev/null 2>&1; then :
42163  gl_cv_func_mkdir_trailing_slash_works="guessing yes"
42164else
42165  gl_cv_func_mkdir_trailing_slash_works="guessing no"
42166fi
42167rm -f conftest*
42168
42169                          ;;
42170                          # If we don't know, assume the worst.
42171         *)               gl_cv_func_mkdir_trailing_slash_works="guessing no" ;;
42172       esac
42173
42174else
42175  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42176/* end confdefs.h.  */
42177
42178#       include <sys/types.h>
42179#       include <sys/stat.h>
42180
42181int
42182main ()
42183{
42184return mkdir ("conftest.dir/", 0700);
42185  ;
42186  return 0;
42187}
42188_ACEOF
42189if ac_fn_c_try_run "$LINENO"; then :
42190  gl_cv_func_mkdir_trailing_slash_works=yes
42191else
42192  gl_cv_func_mkdir_trailing_slash_works=no
42193fi
42194rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
42195  conftest.$ac_objext conftest.beam conftest.$ac_ext
42196fi
42197
42198    rm -rf conftest.dir
42199
42200
42201fi
42202{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5
42203$as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; }
42204  case "$gl_cv_func_mkdir_trailing_slash_works" in
42205    *yes) ;;
42206    *)
42207      REPLACE_MKDIR=1
42208      ;;
42209  esac
42210
42211  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5
42212$as_echo_n "checking whether mkdir handles trailing dot... " >&6; }
42213if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then :
42214  $as_echo_n "(cached) " >&6
42215else
42216  rm -rf conftest.dir
42217      if test "$cross_compiling" = yes; then :
42218  case "$host_os" in
42219                        # Guess yes on glibc systems.
42220         *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
42221                        # Guess no on native Windows.
42222         mingw*)        gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
42223                        # If we don't know, assume the worst.
42224         *)             gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
42225       esac
42226
42227else
42228  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42229/* end confdefs.h.  */
42230
42231#       include <sys/types.h>
42232#       include <sys/stat.h>
42233
42234int
42235main ()
42236{
42237return !mkdir ("conftest.dir/./", 0700);
42238  ;
42239  return 0;
42240}
42241_ACEOF
42242if ac_fn_c_try_run "$LINENO"; then :
42243  gl_cv_func_mkdir_trailing_dot_works=yes
42244else
42245  gl_cv_func_mkdir_trailing_dot_works=no
42246fi
42247rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
42248  conftest.$ac_objext conftest.beam conftest.$ac_ext
42249fi
42250
42251    rm -rf conftest.dir
42252
42253
42254fi
42255{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5
42256$as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; }
42257  case "$gl_cv_func_mkdir_trailing_dot_works" in
42258    *yes) ;;
42259    *)
42260      REPLACE_MKDIR=1
42261
42262$as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h
42263
42264      ;;
42265  esac
42266
42267  if test $REPLACE_MKDIR = 1; then
42268
42269
42270
42271
42272
42273
42274
42275
42276  gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext"
42277
42278  fi
42279
42280
42281
42282
42283
42284
42285      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkfifo" >&5
42286$as_echo_n "checking for mkfifo... " >&6; }
42287if ${gl_cv_func_mkfifo+:} false; then :
42288  $as_echo_n "(cached) " >&6
42289else
42290  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42291/* end confdefs.h.  */
42292#include <sys/stat.h>
42293int
42294main ()
42295{
42296return mkfifo("/",0);
42297  ;
42298  return 0;
42299}
42300
42301_ACEOF
42302if ac_fn_c_try_link "$LINENO"; then :
42303  gl_cv_func_mkfifo=yes
42304else
42305  gl_cv_func_mkfifo=no
42306fi
42307rm -f core conftest.err conftest.$ac_objext \
42308    conftest$ac_exeext conftest.$ac_ext
42309
42310fi
42311{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkfifo" >&5
42312$as_echo "$gl_cv_func_mkfifo" >&6; }
42313  if test $gl_cv_func_mkfifo = no; then
42314    HAVE_MKFIFO=0
42315  else
42316
42317    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkfifo rejects trailing slashes" >&5
42318$as_echo_n "checking whether mkfifo rejects trailing slashes... " >&6; }
42319if ${gl_cv_func_mkfifo_works+:} false; then :
42320  $as_echo_n "(cached) " >&6
42321else
42322  # Assume that if we have lstat, we can also check symlinks.
42323       if test $ac_cv_func_lstat = yes; then
42324         ln -s conftest.tmp conftest.lnk
42325       fi
42326       if test "$cross_compiling" = yes; then :
42327  case "$host_os" in
42328                             # Guess yes on Linux systems.
42329            linux-* | linux) gl_cv_func_mkfifo_works="guessing yes" ;;
42330                             # Guess yes on glibc systems.
42331            *-gnu* | gnu*)   gl_cv_func_mkfifo_works="guessing yes" ;;
42332                             # If we don't know, assume the worst.
42333            *)               gl_cv_func_mkfifo_works="guessing no" ;;
42334          esac
42335
42336else
42337  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42338/* end confdefs.h.  */
42339#include <sys/stat.h>
42340
42341int
42342main ()
42343{
42344int result = 0;
42345             if (!mkfifo ("conftest.tmp/", 0600))
42346               result |= 1;
42347#if HAVE_LSTAT
42348             if (!mkfifo ("conftest.lnk/", 0600))
42349               result |= 2;
42350#endif
42351             return result;
42352
42353  ;
42354  return 0;
42355}
42356_ACEOF
42357if ac_fn_c_try_run "$LINENO"; then :
42358  gl_cv_func_mkfifo_works=yes
42359else
42360  gl_cv_func_mkfifo_works=no
42361fi
42362rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
42363  conftest.$ac_objext conftest.beam conftest.$ac_ext
42364fi
42365
42366       rm -f conftest.tmp conftest.lnk
42367fi
42368{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkfifo_works" >&5
42369$as_echo "$gl_cv_func_mkfifo_works" >&6; }
42370    case "$gl_cv_func_mkfifo_works" in
42371      *yes) ;;
42372      *)
42373
42374$as_echo "#define MKFIFO_TRAILING_SLASH_BUG 1" >>confdefs.h
42375
42376        REPLACE_MKFIFO=1
42377        ;;
42378    esac
42379  fi
42380
42381  if test $HAVE_MKFIFO = 0 || test $REPLACE_MKFIFO = 1; then
42382
42383
42384
42385
42386
42387
42388
42389
42390  gl_LIBOBJS="$gl_LIBOBJS mkfifo.$ac_objext"
42391
42392  fi
42393
42394
42395
42396
42397
42398          GNULIB_MKFIFO=1
42399
42400
42401
42402
42403
42404$as_echo "#define GNULIB_TEST_MKFIFO 1" >>confdefs.h
42405
42406
42407
42408
42409
42410
42411
42412
42413  if test $ac_cv_func_mknod = no; then
42414    HAVE_MKNOD=0
42415  else
42416        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mknod can create fifo without root privileges" >&5
42417$as_echo_n "checking whether mknod can create fifo without root privileges... " >&6; }
42418if ${gl_cv_func_mknod_works+:} false; then :
42419  $as_echo_n "(cached) " >&6
42420else
42421  if test "$cross_compiling" = yes; then :
42422  case "$host_os" in
42423                             # Guess yes on Linux systems.
42424            linux-* | linux) gl_cv_func_mknod_works="guessing yes" ;;
42425                             # Guess yes on glibc systems.
42426            *-gnu* | gnu*)   gl_cv_func_mknod_works="guessing yes" ;;
42427                             # If we don't know, assume the worst.
42428            *)               gl_cv_func_mknod_works="guessing no" ;;
42429          esac
42430
42431else
42432  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42433/* end confdefs.h.  */
42434#include <sys/stat.h>
42435             #include <unistd.h>
42436
42437             /* Copied from root-uid.h.  FIXME: Just use root-uid.h.  */
42438             #ifdef __TANDEM
42439             # define ROOT_UID 65535
42440             #else
42441             # define ROOT_UID 0
42442             #endif
42443
42444int
42445main ()
42446{
42447/* Indeterminate for super-user, assume no.  Why are you running
42448         configure as root, anyway?  */
42449      if (geteuid () == ROOT_UID) return 99;
42450      if (mknod ("conftest.fifo", S_IFIFO | 0600, 0)) return 2;
42451  ;
42452  return 0;
42453}
42454_ACEOF
42455if ac_fn_c_try_run "$LINENO"; then :
42456  gl_cv_func_mknod_works=yes
42457else
42458  if test $? = 99 && test x"$FORCE_UNSAFE_CONFIGURE" = x; then
42459            { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
42460$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
42461as_fn_error $? "you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
42462See \`config.log' for more details" "$LINENO" 5; }
42463          fi
42464          gl_cv_func_mknod_works=no
42465fi
42466rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
42467  conftest.$ac_objext conftest.beam conftest.$ac_ext
42468fi
42469
42470       rm -f conftest.fifo
42471fi
42472{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mknod_works" >&5
42473$as_echo "$gl_cv_func_mknod_works" >&6; }
42474    case "$gl_cv_func_mknod_works" in
42475      *yes) ;;
42476      *)
42477        REPLACE_MKNOD=1
42478
42479$as_echo "#define MKNOD_FIFO_BUG 1" >>confdefs.h
42480
42481        ;;
42482    esac
42483        if test $REPLACE_MKFIFO = 1; then
42484      REPLACE_MKNOD=1
42485    fi
42486  fi
42487
42488  if test $HAVE_MKNOD = 0 || test $REPLACE_MKNOD = 1; then
42489
42490
42491
42492
42493
42494
42495
42496
42497  gl_LIBOBJS="$gl_LIBOBJS mknod.$ac_objext"
42498
42499  fi
42500
42501
42502
42503
42504
42505          GNULIB_MKNOD=1
42506
42507
42508
42509
42510
42511$as_echo "#define GNULIB_TEST_MKNOD 1" >>confdefs.h
42512
42513
42514
42515
42516
42517
42518
42519
42520
42521  if test $ac_cv_func_mkostemp != yes; then
42522    HAVE_MKOSTEMP=0
42523  fi
42524
42525  if test $HAVE_MKOSTEMP = 0; then
42526
42527
42528
42529
42530
42531
42532
42533
42534  gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext"
42535
42536
42537
42538  fi
42539
42540
42541cat >>confdefs.h <<_ACEOF
42542#define GNULIB_MKOSTEMP 1
42543_ACEOF
42544
42545
42546
42547
42548
42549
42550
42551          GNULIB_MKOSTEMP=1
42552
42553
42554
42555
42556
42557$as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h
42558
42559
42560
42561
42562
42563
42564
42565  if test $ac_cv_func_mkstemp = yes; then
42566    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5
42567$as_echo_n "checking for working mkstemp... " >&6; }
42568if ${gl_cv_func_working_mkstemp+:} false; then :
42569  $as_echo_n "(cached) " >&6
42570else
42571
42572        mkdir conftest.mkstemp
42573        if test "$cross_compiling" = yes; then :
42574  case "$host_os" in
42575                            # Guess yes on glibc systems.
42576             *-gnu* | gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
42577                            # Guess no on native Windows.
42578             mingw*)        gl_cv_func_working_mkstemp="guessing no" ;;
42579                            # If we don't know, assume the worst.
42580             *)             gl_cv_func_working_mkstemp="guessing no" ;;
42581           esac
42582
42583else
42584  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42585/* end confdefs.h.  */
42586$ac_includes_default
42587int
42588main ()
42589{
42590int result = 0;
42591              int i;
42592              off_t large = (off_t) 4294967295u;
42593              if (large < 0)
42594                large = 2147483647;
42595              umask (0);
42596              for (i = 0; i < 70; i++)
42597                {
42598                  char templ[] = "conftest.mkstemp/coXXXXXX";
42599                  int (*mkstemp_function) (char *) = mkstemp;
42600                  int fd = mkstemp_function (templ);
42601                  if (fd < 0)
42602                    result |= 1;
42603                  else
42604                    {
42605                      struct stat st;
42606                      if (lseek (fd, large, SEEK_SET) != large)
42607                        result |= 2;
42608                      if (fstat (fd, &st) < 0)
42609                        result |= 4;
42610                      else if (st.st_mode & 0077)
42611                        result |= 8;
42612                      if (close (fd))
42613                        result |= 16;
42614                    }
42615                }
42616              return result;
42617  ;
42618  return 0;
42619}
42620_ACEOF
42621if ac_fn_c_try_run "$LINENO"; then :
42622  gl_cv_func_working_mkstemp=yes
42623else
42624  gl_cv_func_working_mkstemp=no
42625fi
42626rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
42627  conftest.$ac_objext conftest.beam conftest.$ac_ext
42628fi
42629
42630        rm -rf conftest.mkstemp
42631
42632fi
42633{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5
42634$as_echo "$gl_cv_func_working_mkstemp" >&6; }
42635    case "$gl_cv_func_working_mkstemp" in
42636      *yes) ;;
42637      *)
42638        REPLACE_MKSTEMP=1
42639        ;;
42640    esac
42641  else
42642    HAVE_MKSTEMP=0
42643  fi
42644
42645  if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then
42646
42647
42648
42649
42650
42651
42652
42653
42654  gl_LIBOBJS="$gl_LIBOBJS mkstemp.$ac_objext"
42655
42656
42657
42658  fi
42659
42660
42661
42662
42663
42664          GNULIB_MKSTEMP=1
42665
42666
42667
42668
42669
42670$as_echo "#define GNULIB_TEST_MKSTEMP 1" >>confdefs.h
42671
42672
42673
42674
42675
42676
42677
42678
42679  REPLACE_MKTIME=0
42680  if test "$gl_cv_func_working_mktime" != yes; then
42681    REPLACE_MKTIME=1
42682
42683$as_echo "#define NEED_MKTIME_WORKING 1" >>confdefs.h
42684
42685  fi
42686  case "$host_os" in
42687    mingw*)
42688      REPLACE_MKTIME=1
42689
42690$as_echo "#define NEED_MKTIME_WINDOWS 1" >>confdefs.h
42691
42692      ;;
42693  esac
42694
42695  if test $REPLACE_MKTIME = 1; then
42696
42697
42698
42699
42700
42701
42702
42703
42704  gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext"
42705
42706    :
42707  fi
42708
42709
42710
42711
42712
42713          GNULIB_MKTIME=1
42714
42715
42716
42717
42718
42719$as_echo "#define GNULIB_TEST_MKTIME 1" >>confdefs.h
42720
42721
42722
42723
42724
42725
42726  WANT_MKTIME_INTERNAL=0
42727    ac_fn_c_check_func "$LINENO" "__mktime_internal" "ac_cv_func___mktime_internal"
42728if test "x$ac_cv_func___mktime_internal" = xyes; then :
42729
42730$as_echo "#define mktime_internal __mktime_internal" >>confdefs.h
42731
42732
42733else
42734            WANT_MKTIME_INTERNAL=1
42735
42736$as_echo "#define NEED_MKTIME_INTERNAL 1" >>confdefs.h
42737
42738
42739fi
42740
42741
42742  if test $WANT_MKTIME_INTERNAL = 1; then
42743
42744
42745
42746
42747
42748
42749
42750
42751  gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext"
42752
42753    :
42754  fi
42755
42756  :
42757
42758
42759
42760
42761for ac_func in listmntent getmntinfo
42762do :
42763  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
42764ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
42765if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
42766  cat >>confdefs.h <<_ACEOF
42767#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
42768_ACEOF
42769
42770fi
42771done
42772
42773
42774
42775# We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses
42776# NGROUPS (as the array dimension for a struct member) without a definition.
42777for ac_header in sys/ucred.h
42778do :
42779  ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "#include <grp.h>
42780"
42781if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
42782  cat >>confdefs.h <<_ACEOF
42783#define HAVE_SYS_UCRED_H 1
42784_ACEOF
42785
42786fi
42787
42788done
42789
42790
42791for ac_header in sys/mount.h
42792do :
42793  ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$ac_includes_default
42794   #if HAVE_SYS_PARAM_H
42795     #include <sys/param.h>
42796    #endif
42797"
42798if test "x$ac_cv_header_sys_mount_h" = xyes; then :
42799  cat >>confdefs.h <<_ACEOF
42800#define HAVE_SYS_MOUNT_H 1
42801_ACEOF
42802
42803fi
42804
42805done
42806
42807
42808for ac_header in mntent.h sys/fs_types.h
42809do :
42810  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
42811ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
42812if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
42813  cat >>confdefs.h <<_ACEOF
42814#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
42815_ACEOF
42816
42817fi
42818
42819done
42820
42821    getfsstat_includes="\
42822$ac_includes_default
42823#if HAVE_SYS_PARAM_H
42824# include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
42825#endif
42826#if HAVE_SYS_UCRED_H
42827# include <grp.h> /* needed for definition of NGROUPS */
42828# include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
42829#endif
42830#if HAVE_SYS_MOUNT_H
42831# include <sys/mount.h>
42832#endif
42833#if HAVE_SYS_FS_TYPES_H
42834# include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
42835#endif
42836"
42837ac_fn_c_check_member "$LINENO" "struct fsstat" "f_fstypename" "ac_cv_member_struct_fsstat_f_fstypename" "$getfsstat_includes
42838"
42839if test "x$ac_cv_member_struct_fsstat_f_fstypename" = xyes; then :
42840
42841cat >>confdefs.h <<_ACEOF
42842#define HAVE_STRUCT_FSSTAT_F_FSTYPENAME 1
42843_ACEOF
42844
42845
42846fi
42847
42848
42849# Determine how to get the list of mounted file systems.
42850ac_list_mounted_fs=
42851
42852# If the getmntent function is available but not in the standard library,
42853# make sure LIBS contains the appropriate -l option.
42854# getmntent is in the standard C library on UNICOS, in -lsun on Irix 4,
42855# -lseq on Dynix/PTX, -lgen on Unixware.
42856{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getmntent" >&5
42857$as_echo_n "checking for library containing getmntent... " >&6; }
42858if ${ac_cv_search_getmntent+:} false; then :
42859  $as_echo_n "(cached) " >&6
42860else
42861  ac_func_search_save_LIBS=$LIBS
42862cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42863/* end confdefs.h.  */
42864
42865/* Override any GCC internal prototype to avoid an error.
42866   Use char because int might match the return type of a GCC
42867   builtin and then its argument prototype would still apply.  */
42868#ifdef __cplusplus
42869extern "C"
42870#endif
42871char getmntent ();
42872int
42873main ()
42874{
42875return getmntent ();
42876  ;
42877  return 0;
42878}
42879_ACEOF
42880for ac_lib in '' sun seq gen; do
42881  if test -z "$ac_lib"; then
42882    ac_res="none required"
42883  else
42884    ac_res=-l$ac_lib
42885    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
42886  fi
42887  if ac_fn_c_try_link "$LINENO"; then :
42888  ac_cv_search_getmntent=$ac_res
42889fi
42890rm -f core conftest.err conftest.$ac_objext \
42891    conftest$ac_exeext
42892  if ${ac_cv_search_getmntent+:} false; then :
42893  break
42894fi
42895done
42896if ${ac_cv_search_getmntent+:} false; then :
42897
42898else
42899  ac_cv_search_getmntent=no
42900fi
42901rm conftest.$ac_ext
42902LIBS=$ac_func_search_save_LIBS
42903fi
42904{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getmntent" >&5
42905$as_echo "$ac_cv_search_getmntent" >&6; }
42906ac_res=$ac_cv_search_getmntent
42907if test "$ac_res" != no; then :
42908  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
42909
42910fi
42911
42912for ac_func in getmntent
42913do :
42914  ac_fn_c_check_func "$LINENO" "getmntent" "ac_cv_func_getmntent"
42915if test "x$ac_cv_func_getmntent" = xyes; then :
42916  cat >>confdefs.h <<_ACEOF
42917#define HAVE_GETMNTENT 1
42918_ACEOF
42919
42920fi
42921done
42922
42923
42924
42925# This test must precede the ones for getmntent because Unicos-9 is
42926# reported to have the getmntent function, but its support is incompatible
42927# with other getmntent implementations.
42928
42929# NOTE: Normally, I wouldn't use a check for system type as I've done for
42930# 'CRAY' below since that goes against the whole autoconf philosophy.  But
42931# I think there is too great a chance that some non-Cray system has a
42932# function named listmntent to risk the false positive.
42933
42934if test -z "$ac_list_mounted_fs"; then
42935  # Cray UNICOS 9
42936  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for listmntent of Cray/Unicos-9" >&5
42937$as_echo_n "checking for listmntent of Cray/Unicos-9... " >&6; }
42938  if ${fu_cv_sys_mounted_cray_listmntent+:} false; then :
42939  $as_echo_n "(cached) " >&6
42940else
42941  fu_cv_sys_mounted_cray_listmntent=no
42942      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42943/* end confdefs.h.  */
42944#ifdef _CRAY
42945yes
42946#endif
42947
42948_ACEOF
42949if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
42950  $EGREP "yes" >/dev/null 2>&1; then :
42951  test $ac_cv_func_listmntent = yes \
42952            && fu_cv_sys_mounted_cray_listmntent=yes
42953
42954fi
42955rm -f conftest*
42956
42957
42958
42959fi
42960
42961  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_cray_listmntent" >&5
42962$as_echo "$fu_cv_sys_mounted_cray_listmntent" >&6; }
42963  if test $fu_cv_sys_mounted_cray_listmntent = yes; then
42964    ac_list_mounted_fs=found
42965
42966$as_echo "#define MOUNTED_LISTMNTENT 1" >>confdefs.h
42967
42968  fi
42969fi
42970
42971if test -z "$ac_list_mounted_fs"; then
42972  # AIX.
42973  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mntctl function and struct vmount" >&5
42974$as_echo_n "checking for mntctl function and struct vmount... " >&6; }
42975  if ${fu_cv_sys_mounted_vmount+:} false; then :
42976  $as_echo_n "(cached) " >&6
42977else
42978  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42979/* end confdefs.h.  */
42980#include <fshelp.h>
42981_ACEOF
42982if ac_fn_c_try_cpp "$LINENO"; then :
42983  fu_cv_sys_mounted_vmount=yes
42984else
42985  fu_cv_sys_mounted_vmount=no
42986fi
42987rm -f conftest.err conftest.i conftest.$ac_ext
42988fi
42989
42990  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_vmount" >&5
42991$as_echo "$fu_cv_sys_mounted_vmount" >&6; }
42992  if test $fu_cv_sys_mounted_vmount = yes; then
42993    ac_list_mounted_fs=found
42994
42995$as_echo "#define MOUNTED_VMOUNT 1" >>confdefs.h
42996
42997  fi
42998fi
42999
43000if test $ac_cv_func_getmntent = yes; then
43001
43002  # This system has the getmntent function.
43003  # Determine whether it's the one-argument variant or the two-argument one.
43004
43005  if test -z "$ac_list_mounted_fs"; then
43006    # GNU/Linux, 4.3BSD, SunOS, HP-UX, Dynix, Irix
43007    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for one-argument getmntent function" >&5
43008$as_echo_n "checking for one-argument getmntent function... " >&6; }
43009    if ${fu_cv_sys_mounted_getmntent1+:} false; then :
43010  $as_echo_n "(cached) " >&6
43011else
43012  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43013/* end confdefs.h.  */
43014
43015/* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
43016#include <stdio.h>
43017
43018#include <mntent.h>
43019#if !defined MOUNTED
43020# if defined _PATH_MOUNTED      /* GNU libc  */
43021#  define MOUNTED _PATH_MOUNTED
43022# endif
43023# if defined MNT_MNTTAB /* HP-UX.  */
43024#  define MOUNTED MNT_MNTTAB
43025# endif
43026# if defined MNTTABNAME /* Dynix.  */
43027#  define MOUNTED MNTTABNAME
43028# endif
43029#endif
43030
43031int
43032main ()
43033{
43034 struct mntent *mnt = 0; char *table = MOUNTED;
43035                         if (sizeof mnt && sizeof table) return 0;
43036  ;
43037  return 0;
43038}
43039_ACEOF
43040if ac_fn_c_try_compile "$LINENO"; then :
43041  fu_cv_sys_mounted_getmntent1=yes
43042else
43043  fu_cv_sys_mounted_getmntent1=no
43044fi
43045rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43046fi
43047
43048    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntent1" >&5
43049$as_echo "$fu_cv_sys_mounted_getmntent1" >&6; }
43050    if test $fu_cv_sys_mounted_getmntent1 = yes; then
43051      ac_list_mounted_fs=found
43052
43053$as_echo "#define MOUNTED_GETMNTENT1 1" >>confdefs.h
43054
43055      for ac_func in hasmntopt
43056do :
43057  ac_fn_c_check_func "$LINENO" "hasmntopt" "ac_cv_func_hasmntopt"
43058if test "x$ac_cv_func_hasmntopt" = xyes; then :
43059  cat >>confdefs.h <<_ACEOF
43060#define HAVE_HASMNTOPT 1
43061_ACEOF
43062
43063fi
43064done
43065
43066    fi
43067  fi
43068
43069  if test -z "$ac_list_mounted_fs"; then
43070    # SVR4
43071    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument getmntent function" >&5
43072$as_echo_n "checking for two-argument getmntent function... " >&6; }
43073    if ${fu_cv_sys_mounted_getmntent2+:} false; then :
43074  $as_echo_n "(cached) " >&6
43075else
43076  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43077/* end confdefs.h.  */
43078#include <sys/mnttab.h>
43079
43080_ACEOF
43081if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
43082  $EGREP "getmntent" >/dev/null 2>&1; then :
43083  fu_cv_sys_mounted_getmntent2=yes
43084else
43085  fu_cv_sys_mounted_getmntent2=no
43086fi
43087rm -f conftest*
43088
43089fi
43090
43091    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntent2" >&5
43092$as_echo "$fu_cv_sys_mounted_getmntent2" >&6; }
43093    if test $fu_cv_sys_mounted_getmntent2 = yes; then
43094      ac_list_mounted_fs=found
43095
43096$as_echo "#define MOUNTED_GETMNTENT2 1" >>confdefs.h
43097
43098      for ac_func in hasmntopt
43099do :
43100  ac_fn_c_check_func "$LINENO" "hasmntopt" "ac_cv_func_hasmntopt"
43101if test "x$ac_cv_func_hasmntopt" = xyes; then :
43102  cat >>confdefs.h <<_ACEOF
43103#define HAVE_HASMNTOPT 1
43104_ACEOF
43105
43106fi
43107done
43108
43109    fi
43110  fi
43111
43112fi
43113
43114if test -z "$ac_list_mounted_fs"; then
43115  # DEC Alpha running OSF/1, and Apple Darwin 1.3.
43116  # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
43117
43118  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getfsstat function" >&5
43119$as_echo_n "checking for getfsstat function... " >&6; }
43120  if ${fu_cv_sys_mounted_getfsstat+:} false; then :
43121  $as_echo_n "(cached) " >&6
43122else
43123  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43124/* end confdefs.h.  */
43125
43126#include <sys/types.h>
43127#if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
43128# define FS_TYPE(Ent) ((Ent).f_fstypename)
43129#else
43130# define FS_TYPE(Ent) mnt_names[(Ent).f_type]
43131#endif
43132$getfsstat_includes
43133
43134int
43135main ()
43136{
43137struct statfs *stats;
43138        int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
43139        char *t = FS_TYPE (*stats);
43140  ;
43141  return 0;
43142}
43143_ACEOF
43144if ac_fn_c_try_link "$LINENO"; then :
43145  fu_cv_sys_mounted_getfsstat=yes
43146else
43147  fu_cv_sys_mounted_getfsstat=no
43148fi
43149rm -f core conftest.err conftest.$ac_objext \
43150    conftest$ac_exeext conftest.$ac_ext
43151fi
43152
43153  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getfsstat" >&5
43154$as_echo "$fu_cv_sys_mounted_getfsstat" >&6; }
43155  if test $fu_cv_sys_mounted_getfsstat = yes; then
43156    ac_list_mounted_fs=found
43157
43158$as_echo "#define MOUNTED_GETFSSTAT 1" >>confdefs.h
43159
43160  fi
43161fi
43162
43163if test -z "$ac_list_mounted_fs"; then
43164  # SVR3
43165  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FIXME existence of three headers" >&5
43166$as_echo_n "checking for FIXME existence of three headers... " >&6; }
43167  if ${fu_cv_sys_mounted_fread_fstyp+:} false; then :
43168  $as_echo_n "(cached) " >&6
43169else
43170  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43171/* end confdefs.h.  */
43172
43173#include <sys/statfs.h>
43174#include <sys/fstyp.h>
43175#include <mnttab.h>
43176_ACEOF
43177if ac_fn_c_try_cpp "$LINENO"; then :
43178  fu_cv_sys_mounted_fread_fstyp=yes
43179else
43180  fu_cv_sys_mounted_fread_fstyp=no
43181fi
43182rm -f conftest.err conftest.i conftest.$ac_ext
43183fi
43184
43185  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_fread_fstyp" >&5
43186$as_echo "$fu_cv_sys_mounted_fread_fstyp" >&6; }
43187  if test $fu_cv_sys_mounted_fread_fstyp = yes; then
43188    ac_list_mounted_fs=found
43189
43190$as_echo "#define MOUNTED_FREAD_FSTYP 1" >>confdefs.h
43191
43192  fi
43193fi
43194
43195if test -z "$ac_list_mounted_fs"; then
43196  # 4.4BSD and DEC OSF/1.
43197  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getmntinfo function" >&5
43198$as_echo_n "checking for getmntinfo function... " >&6; }
43199  if ${fu_cv_sys_mounted_getmntinfo+:} false; then :
43200  $as_echo_n "(cached) " >&6
43201else
43202
43203      test "$ac_cv_func_getmntinfo" = yes \
43204          && fu_cv_sys_mounted_getmntinfo=yes \
43205          || fu_cv_sys_mounted_getmntinfo=no
43206
43207fi
43208
43209  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntinfo" >&5
43210$as_echo "$fu_cv_sys_mounted_getmntinfo" >&6; }
43211  if test $fu_cv_sys_mounted_getmntinfo = yes; then
43212    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getmntinfo returns statvfs structures" >&5
43213$as_echo_n "checking whether getmntinfo returns statvfs structures... " >&6; }
43214    if ${fu_cv_sys_mounted_getmntinfo2+:} false; then :
43215  $as_echo_n "(cached) " >&6
43216else
43217
43218        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43219/* end confdefs.h.  */
43220
43221#if HAVE_SYS_PARAM_H
43222# include <sys/param.h>
43223#endif
43224#include <sys/types.h>
43225#if HAVE_SYS_MOUNT_H
43226# include <sys/mount.h>
43227#endif
43228#if HAVE_SYS_STATVFS_H
43229# include <sys/statvfs.h>
43230#endif
43231extern
43232#ifdef __cplusplus
43233"C"
43234#endif
43235int getmntinfo (struct statfs **, int);
43236
43237int
43238main ()
43239{
43240
43241  ;
43242  return 0;
43243}
43244_ACEOF
43245if ac_fn_c_try_compile "$LINENO"; then :
43246  fu_cv_sys_mounted_getmntinfo2=no
43247else
43248  fu_cv_sys_mounted_getmntinfo2=yes
43249fi
43250rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43251
43252fi
43253
43254    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntinfo2" >&5
43255$as_echo "$fu_cv_sys_mounted_getmntinfo2" >&6; }
43256    if test $fu_cv_sys_mounted_getmntinfo2 = no; then
43257      ac_list_mounted_fs=found
43258
43259$as_echo "#define MOUNTED_GETMNTINFO 1" >>confdefs.h
43260
43261    else
43262      ac_list_mounted_fs=found
43263
43264$as_echo "#define MOUNTED_GETMNTINFO2 1" >>confdefs.h
43265
43266    fi
43267  fi
43268fi
43269
43270if test -z "$ac_list_mounted_fs"; then
43271  # Ultrix
43272  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getmnt function" >&5
43273$as_echo_n "checking for getmnt function... " >&6; }
43274  if ${fu_cv_sys_mounted_getmnt+:} false; then :
43275  $as_echo_n "(cached) " >&6
43276else
43277  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43278/* end confdefs.h.  */
43279
43280#include <sys/fs_types.h>
43281#include <sys/mount.h>
43282_ACEOF
43283if ac_fn_c_try_cpp "$LINENO"; then :
43284  fu_cv_sys_mounted_getmnt=yes
43285else
43286  fu_cv_sys_mounted_getmnt=no
43287fi
43288rm -f conftest.err conftest.i conftest.$ac_ext
43289fi
43290
43291  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmnt" >&5
43292$as_echo "$fu_cv_sys_mounted_getmnt" >&6; }
43293  if test $fu_cv_sys_mounted_getmnt = yes; then
43294    ac_list_mounted_fs=found
43295
43296$as_echo "#define MOUNTED_GETMNT 1" >>confdefs.h
43297
43298  fi
43299fi
43300
43301if test -z "$ac_list_mounted_fs"; then
43302  # BeOS
43303  for ac_func in next_dev fs_stat_dev
43304do :
43305  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
43306ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
43307if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
43308  cat >>confdefs.h <<_ACEOF
43309#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
43310_ACEOF
43311
43312fi
43313done
43314
43315  for ac_header in fs_info.h
43316do :
43317  ac_fn_c_check_header_mongrel "$LINENO" "fs_info.h" "ac_cv_header_fs_info_h" "$ac_includes_default"
43318if test "x$ac_cv_header_fs_info_h" = xyes; then :
43319  cat >>confdefs.h <<_ACEOF
43320#define HAVE_FS_INFO_H 1
43321_ACEOF
43322
43323fi
43324
43325done
43326
43327  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BEOS mounted file system support functions" >&5
43328$as_echo_n "checking for BEOS mounted file system support functions... " >&6; }
43329  if test $ac_cv_header_fs_info_h = yes \
43330      && test $ac_cv_func_next_dev = yes \
43331        && test $ac_cv_func_fs_stat_dev = yes; then
43332    fu_result=yes
43333  else
43334    fu_result=no
43335  fi
43336  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_result" >&5
43337$as_echo "$fu_result" >&6; }
43338  if test $fu_result = yes; then
43339    ac_list_mounted_fs=found
43340
43341$as_echo "#define MOUNTED_FS_STAT_DEV 1" >>confdefs.h
43342
43343  fi
43344fi
43345
43346if test -z "$ac_list_mounted_fs"; then
43347  # SVR2
43348  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is possible to resort to fread on /etc/mnttab" >&5
43349$as_echo_n "checking whether it is possible to resort to fread on /etc/mnttab... " >&6; }
43350  if ${fu_cv_sys_mounted_fread+:} false; then :
43351  $as_echo_n "(cached) " >&6
43352else
43353  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43354/* end confdefs.h.  */
43355#include <mnttab.h>
43356_ACEOF
43357if ac_fn_c_try_cpp "$LINENO"; then :
43358  fu_cv_sys_mounted_fread=yes
43359else
43360  fu_cv_sys_mounted_fread=no
43361fi
43362rm -f conftest.err conftest.i conftest.$ac_ext
43363fi
43364
43365  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_fread" >&5
43366$as_echo "$fu_cv_sys_mounted_fread" >&6; }
43367  if test $fu_cv_sys_mounted_fread = yes; then
43368    ac_list_mounted_fs=found
43369
43370$as_echo "#define MOUNTED_FREAD 1" >>confdefs.h
43371
43372  fi
43373fi
43374
43375if test -z "$ac_list_mounted_fs"; then
43376  # Interix / BSD alike statvfs
43377  # the code is really interix specific, so make sure, we're on it.
43378  case "$host" in
43379  *-interix*)
43380    for ac_func in statvfs
43381do :
43382  ac_fn_c_check_func "$LINENO" "statvfs" "ac_cv_func_statvfs"
43383if test "x$ac_cv_func_statvfs" = xyes; then :
43384  cat >>confdefs.h <<_ACEOF
43385#define HAVE_STATVFS 1
43386_ACEOF
43387
43388fi
43389done
43390
43391    if test $ac_cv_func_statvfs = yes; then
43392      ac_list_mounted_fs=found
43393
43394$as_echo "#define MOUNTED_INTERIX_STATVFS 1" >>confdefs.h
43395
43396    fi
43397    ;;
43398  esac
43399fi
43400
43401if test -z "$ac_list_mounted_fs"; then
43402  as_fn_error $? "could not determine how to read list of mounted file systems" "$LINENO" 5
43403  # FIXME -- no need to abort building the whole package
43404  # Can't build mountlist.c or anything that needs its functions
43405fi
43406
43407if test $ac_list_mounted_fs = found; then :
43408  gl_cv_list_mounted_fs=yes
43409else
43410  gl_cv_list_mounted_fs=no
43411fi
43412
43413
43414
43415  if test $gl_cv_list_mounted_fs = yes; then
43416
43417
43418
43419
43420
43421
43422
43423
43424  gl_LIBOBJS="$gl_LIBOBJS mountlist.$ac_objext"
43425
43426
43427    for ac_header in sys/mntent.h
43428do :
43429  ac_fn_c_check_header_mongrel "$LINENO" "sys/mntent.h" "ac_cv_header_sys_mntent_h" "$ac_includes_default"
43430if test "x$ac_cv_header_sys_mntent_h" = xyes; then :
43431  cat >>confdefs.h <<_ACEOF
43432#define HAVE_SYS_MNTENT_H 1
43433_ACEOF
43434
43435fi
43436
43437done
43438
43439
43440ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
43441if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
43442
43443$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
43444
43445fi
43446
43447
43448if test $ac_cv_header_sys_mkdev_h = no; then
43449  ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
43450if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
43451
43452$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
43453
43454fi
43455
43456
43457fi
43458
43459  ac_fn_c_check_member "$LINENO" "struct statfs" "f_fstypename" "ac_cv_member_struct_statfs_f_fstypename" "
43460      #include <sys/types.h>
43461      #include <sys/param.h>
43462      #include <sys/mount.h>
43463
43464"
43465if test "x$ac_cv_member_struct_statfs_f_fstypename" = xyes; then :
43466
43467cat >>confdefs.h <<_ACEOF
43468#define HAVE_STRUCT_STATFS_F_FSTYPENAME 1
43469_ACEOF
43470
43471
43472fi
43473
43474
43475
43476  fi
43477
43478
43479
43480
43481  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
43482
43483
43484
43485
43486
43487
43488
43489
43490  gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext"
43491
43492  fi
43493
43494  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
43495
43496
43497
43498
43499
43500
43501
43502
43503  gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext"
43504
43505  fi
43506
43507
43508cat >>confdefs.h <<_ACEOF
43509#define GNULIB_MSVC_NOTHROW 1
43510_ACEOF
43511
43512
43513
43514
43515
43516
43517
43518
43519
43520
43521
43522
43523
43524 nanosleep_save_libs=$LIBS
43525
43526 # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
43527 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
43528 LIB_NANOSLEEP=
43529
43530 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5
43531$as_echo_n "checking for library containing nanosleep... " >&6; }
43532if ${ac_cv_search_nanosleep+:} false; then :
43533  $as_echo_n "(cached) " >&6
43534else
43535  ac_func_search_save_LIBS=$LIBS
43536cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43537/* end confdefs.h.  */
43538
43539/* Override any GCC internal prototype to avoid an error.
43540   Use char because int might match the return type of a GCC
43541   builtin and then its argument prototype would still apply.  */
43542#ifdef __cplusplus
43543extern "C"
43544#endif
43545char nanosleep ();
43546int
43547main ()
43548{
43549return nanosleep ();
43550  ;
43551  return 0;
43552}
43553_ACEOF
43554for ac_lib in '' rt posix4; do
43555  if test -z "$ac_lib"; then
43556    ac_res="none required"
43557  else
43558    ac_res=-l$ac_lib
43559    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
43560  fi
43561  if ac_fn_c_try_link "$LINENO"; then :
43562  ac_cv_search_nanosleep=$ac_res
43563fi
43564rm -f core conftest.err conftest.$ac_objext \
43565    conftest$ac_exeext
43566  if ${ac_cv_search_nanosleep+:} false; then :
43567  break
43568fi
43569done
43570if ${ac_cv_search_nanosleep+:} false; then :
43571
43572else
43573  ac_cv_search_nanosleep=no
43574fi
43575rm conftest.$ac_ext
43576LIBS=$ac_func_search_save_LIBS
43577fi
43578{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5
43579$as_echo "$ac_cv_search_nanosleep" >&6; }
43580ac_res=$ac_cv_search_nanosleep
43581if test "$ac_res" != no; then :
43582  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
43583  test "$ac_cv_search_nanosleep" = "none required" ||
43584                 LIB_NANOSLEEP=$ac_cv_search_nanosleep
43585fi
43586
43587 if test "x$ac_cv_search_nanosleep" != xno; then
43588
43589
43590   if test $APPLE_UNIVERSAL_BUILD = 1; then
43591     # A universal build on Apple Mac OS X platforms.
43592     # The test result would be 'no (mishandles large arguments)' in 64-bit
43593     # mode but 'yes' in 32-bit mode. But we need a configuration result that
43594     # is valid in both modes.
43595     gl_cv_func_nanosleep='no (mishandles large arguments)'
43596   fi
43597
43598   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working nanosleep" >&5
43599$as_echo_n "checking for working nanosleep... " >&6; }
43600if ${gl_cv_func_nanosleep+:} false; then :
43601  $as_echo_n "(cached) " >&6
43602else
43603
43604     if test "$cross_compiling" = yes; then :
43605  case "$host_os" in           linux*) # Guess it halfway works when the kernel is Linux.
43606            gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;;
43607          mingw*) # Guess no on native Windows.
43608            gl_cv_func_nanosleep='guessing no' ;;
43609          *)      # If we don't know, assume the worst.
43610            gl_cv_func_nanosleep='guessing no' ;;
43611        esac
43612
43613else
43614  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43615/* end confdefs.h.  */
43616
43617          #include <errno.h>
43618          #include <limits.h>
43619          #include <signal.h>
43620          #if HAVE_SYS_TIME_H
43621           #include <sys/time.h>
43622          #endif
43623          #include <time.h>
43624          #include <unistd.h>
43625          #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
43626          #define TYPE_MAXIMUM(t) \
43627            ((t) (! TYPE_SIGNED (t) \
43628                  ? (t) -1 \
43629                  : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
43630
43631          #if HAVE_DECL_ALARM
43632          static void
43633          check_for_SIGALRM (int sig)
43634          {
43635            if (sig != SIGALRM)
43636              _exit (1);
43637          }
43638          #endif
43639
43640          int
43641          main ()
43642          {
43643            static struct timespec ts_sleep;
43644            static struct timespec ts_remaining;
43645            /* Test for major problems first.  */
43646            if (! nanosleep)
43647              return 2;
43648            ts_sleep.tv_sec = 0;
43649            ts_sleep.tv_nsec = 1;
43650            #if HAVE_DECL_ALARM
43651            {
43652              static struct sigaction act;
43653              act.sa_handler = check_for_SIGALRM;
43654              sigemptyset (&act.sa_mask);
43655              sigaction (SIGALRM, &act, NULL);
43656              alarm (1);
43657              if (nanosleep (&ts_sleep, NULL) != 0)
43658                return 3;
43659              /* Test for a minor problem: the handling of large arguments.  */
43660              ts_sleep.tv_sec = TYPE_MAXIMUM (time_t);
43661              ts_sleep.tv_nsec = 999999999;
43662              alarm (1);
43663              if (nanosleep (&ts_sleep, &ts_remaining) != -1)
43664                return 4;
43665              if (errno != EINTR)
43666                return 5;
43667              if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10)
43668                return 6;
43669            }
43670            #else /* A simpler test for native Windows.  */
43671            if (nanosleep (&ts_sleep, &ts_remaining) < 0)
43672              return 3;
43673            #endif
43674            return 0;
43675          }
43676_ACEOF
43677if ac_fn_c_try_run "$LINENO"; then :
43678  gl_cv_func_nanosleep=yes
43679else
43680  case $? in         4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';;         *)   gl_cv_func_nanosleep=no;;
43681        esac
43682fi
43683rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
43684  conftest.$ac_objext conftest.beam conftest.$ac_ext
43685fi
43686
43687
43688fi
43689{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nanosleep" >&5
43690$as_echo "$gl_cv_func_nanosleep" >&6; }
43691   case "$gl_cv_func_nanosleep" in
43692     *yes)
43693       REPLACE_NANOSLEEP=0
43694       ;;
43695     *)
43696       REPLACE_NANOSLEEP=1
43697       case "$gl_cv_func_nanosleep" in
43698         *"mishandles large arguments"*)
43699
43700$as_echo "#define HAVE_BUG_BIG_NANOSLEEP 1" >>confdefs.h
43701
43702           ;;
43703         *)
43704           # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP.
43705           for ac_lib in $LIBSOCKET; do
43706             case " $LIB_NANOSLEEP " in
43707               *" $ac_lib "*) ;;
43708               *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";;
43709             esac
43710           done
43711           ;;
43712       esac
43713       ;;
43714   esac
43715 else
43716   HAVE_NANOSLEEP=0
43717 fi
43718 LIBS=$nanosleep_save_libs
43719
43720  if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then
43721
43722
43723
43724
43725
43726
43727
43728
43729  gl_LIBOBJS="$gl_LIBOBJS nanosleep.$ac_objext"
43730
43731
43732
43733  :
43734
43735  fi
43736
43737
43738
43739
43740
43741          GNULIB_NANOSLEEP=1
43742
43743
43744
43745
43746
43747$as_echo "#define GNULIB_TEST_NANOSLEEP 1" >>confdefs.h
43748
43749
43750
43751
43752
43753
43754
43755
43756
43757
43758
43759
43760
43761
43762     if test $gl_cv_have_include_next = yes; then
43763       gl_cv_next_netdb_h='<'netdb.h'>'
43764     else
43765       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netdb.h>" >&5
43766$as_echo_n "checking absolute name of <netdb.h>... " >&6; }
43767if ${gl_cv_next_netdb_h+:} false; then :
43768  $as_echo_n "(cached) " >&6
43769else
43770
43771             if test $ac_cv_header_netdb_h = yes; then
43772
43773
43774
43775
43776  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43777/* end confdefs.h.  */
43778#include <netdb.h>
43779_ACEOF
43780                case "$host_os" in
43781    aix*) gl_absname_cpp="$ac_cpp -C" ;;
43782    *)    gl_absname_cpp="$ac_cpp" ;;
43783  esac
43784
43785  case "$host_os" in
43786    mingw*)
43787                                          gl_dirsep_regex='[/\\]'
43788      ;;
43789    *)
43790      gl_dirsep_regex='\/'
43791      ;;
43792  esac
43793      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
43794  gl_header_literal_regex=`echo 'netdb.h' \
43795                           | sed -e "$gl_make_literal_regex_sed"`
43796  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
43797      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
43798      s|^/[^/]|//&|
43799      p
43800      q
43801    }'
43802
43803        gl_cv_absolute_netdb_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
43804  sed -n "$gl_absolute_header_sed"`
43805
43806           gl_header=$gl_cv_absolute_netdb_h
43807           gl_cv_next_netdb_h='"'$gl_header'"'
43808          else
43809               gl_cv_next_netdb_h='<'netdb.h'>'
43810             fi
43811
43812
43813fi
43814{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netdb_h" >&5
43815$as_echo "$gl_cv_next_netdb_h" >&6; }
43816     fi
43817     NEXT_NETDB_H=$gl_cv_next_netdb_h
43818
43819     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
43820       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
43821       gl_next_as_first_directive='<'netdb.h'>'
43822     else
43823       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
43824       gl_next_as_first_directive=$gl_cv_next_netdb_h
43825     fi
43826     NEXT_AS_FIRST_DIRECTIVE_NETDB_H=$gl_next_as_first_directive
43827
43828
43829
43830
43831  if test $ac_cv_header_netdb_h = yes; then
43832    HAVE_NETDB_H=1
43833  else
43834    HAVE_NETDB_H=0
43835  fi
43836
43837
43838
43839
43840
43841  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
43842$as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
43843if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then :
43844  $as_echo_n "(cached) " >&6
43845else
43846
43847      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43848/* end confdefs.h.  */
43849#include <netinet/in.h>
43850int
43851main ()
43852{
43853
43854  ;
43855  return 0;
43856}
43857_ACEOF
43858if ac_fn_c_try_compile "$LINENO"; then :
43859  gl_cv_header_netinet_in_h_selfcontained=yes
43860else
43861  gl_cv_header_netinet_in_h_selfcontained=no
43862fi
43863rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43864
43865fi
43866{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
43867$as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
43868  if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
43869    NETINET_IN_H=''
43870  else
43871    NETINET_IN_H='netinet/in.h'
43872    for ac_header in netinet/in.h
43873do :
43874  ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
43875if test "x$ac_cv_header_netinet_in_h" = xyes; then :
43876  cat >>confdefs.h <<_ACEOF
43877#define HAVE_NETINET_IN_H 1
43878_ACEOF
43879
43880fi
43881
43882done
43883
43884
43885
43886
43887
43888
43889
43890
43891
43892
43893     if test $gl_cv_have_include_next = yes; then
43894       gl_cv_next_netinet_in_h='<'netinet/in.h'>'
43895     else
43896       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
43897$as_echo_n "checking absolute name of <netinet/in.h>... " >&6; }
43898if ${gl_cv_next_netinet_in_h+:} false; then :
43899  $as_echo_n "(cached) " >&6
43900else
43901
43902             if test $ac_cv_header_netinet_in_h = yes; then
43903
43904
43905
43906
43907  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43908/* end confdefs.h.  */
43909#include <netinet/in.h>
43910_ACEOF
43911                case "$host_os" in
43912    aix*) gl_absname_cpp="$ac_cpp -C" ;;
43913    *)    gl_absname_cpp="$ac_cpp" ;;
43914  esac
43915
43916  case "$host_os" in
43917    mingw*)
43918                                          gl_dirsep_regex='[/\\]'
43919      ;;
43920    *)
43921      gl_dirsep_regex='\/'
43922      ;;
43923  esac
43924      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
43925  gl_header_literal_regex=`echo 'netinet/in.h' \
43926                           | sed -e "$gl_make_literal_regex_sed"`
43927  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
43928      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
43929      s|^/[^/]|//&|
43930      p
43931      q
43932    }'
43933
43934        gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
43935  sed -n "$gl_absolute_header_sed"`
43936
43937           gl_header=$gl_cv_absolute_netinet_in_h
43938           gl_cv_next_netinet_in_h='"'$gl_header'"'
43939          else
43940               gl_cv_next_netinet_in_h='<'netinet/in.h'>'
43941             fi
43942
43943
43944fi
43945{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
43946$as_echo "$gl_cv_next_netinet_in_h" >&6; }
43947     fi
43948     NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
43949
43950     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
43951       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
43952       gl_next_as_first_directive='<'netinet/in.h'>'
43953     else
43954       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
43955       gl_next_as_first_directive=$gl_cv_next_netinet_in_h
43956     fi
43957     NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
43958
43959
43960
43961
43962    if test $ac_cv_header_netinet_in_h = yes; then
43963      HAVE_NETINET_IN_H=1
43964    else
43965      HAVE_NETINET_IN_H=0
43966    fi
43967
43968  fi
43969
43970   if test -n "$NETINET_IN_H"; then
43971  GL_GENERATE_NETINET_IN_H_TRUE=
43972  GL_GENERATE_NETINET_IN_H_FALSE='#'
43973else
43974  GL_GENERATE_NETINET_IN_H_TRUE='#'
43975  GL_GENERATE_NETINET_IN_H_FALSE=
43976fi
43977
43978
43979
43980
43981
43982
43983
43984     if test $ac_cv_func_nl_langinfo = yes; then
43985    # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
43986    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5
43987$as_echo_n "checking whether YESEXPR works... " >&6; }
43988if ${gl_cv_func_nl_langinfo_yesexpr_works+:} false; then :
43989  $as_echo_n "(cached) " >&6
43990else
43991  if test "$cross_compiling" = yes; then :
43992
43993         case "$host_os" in
43994                   # Guess no on irix systems.
43995           irix*)  gl_cv_func_nl_langinfo_yesexpr_works="guessing no";;
43996                   # Guess yes elsewhere.
43997           *)      gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";;
43998         esac
43999
44000else
44001  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44002/* end confdefs.h.  */
44003#include <langinfo.h>
44004
44005int
44006main ()
44007{
44008return !*nl_langinfo(YESEXPR);
44009
44010  ;
44011  return 0;
44012}
44013_ACEOF
44014if ac_fn_c_try_run "$LINENO"; then :
44015  gl_cv_func_nl_langinfo_yesexpr_works=yes
44016else
44017  gl_cv_func_nl_langinfo_yesexpr_works=no
44018fi
44019rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
44020  conftest.$ac_objext conftest.beam conftest.$ac_ext
44021fi
44022
44023
44024fi
44025{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5
44026$as_echo "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; }
44027    case $gl_cv_func_nl_langinfo_yesexpr_works in
44028      *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;;
44029      *)    FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;;
44030    esac
44031
44032cat >>confdefs.h <<_ACEOF
44033#define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS
44034_ACEOF
44035
44036    if test $HAVE_LANGINFO_CODESET = 1 \
44037       && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
44038       && test $HAVE_LANGINFO_ALTMON = 1 \
44039       && test $HAVE_LANGINFO_ERA = 1 \
44040       && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then
44041      :
44042    else
44043      REPLACE_NL_LANGINFO=1
44044
44045$as_echo "#define REPLACE_NL_LANGINFO 1" >>confdefs.h
44046
44047    fi
44048  else
44049    HAVE_NL_LANGINFO=0
44050  fi
44051
44052  if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
44053
44054
44055
44056
44057
44058
44059
44060
44061  gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext"
44062
44063  fi
44064
44065
44066
44067
44068
44069          GNULIB_NL_LANGINFO=1
44070
44071
44072
44073
44074
44075$as_echo "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h
44076
44077
44078
44079
44080
44081
44082
44083
44084  for ac_header in sys/pstat.h sys/sysmp.h sys/param.h
44085do :
44086  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
44087ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
44088"
44089if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
44090  cat >>confdefs.h <<_ACEOF
44091#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
44092_ACEOF
44093
44094fi
44095
44096done
44097
44098    for ac_header in sys/sysctl.h
44099do :
44100  ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default
44101     #if HAVE_SYS_PARAM_H
44102     # include <sys/param.h>
44103     #endif
44104
44105"
44106if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
44107  cat >>confdefs.h <<_ACEOF
44108#define HAVE_SYS_SYSCTL_H 1
44109_ACEOF
44110
44111fi
44112
44113done
44114
44115
44116  for ac_func in sched_getaffinity sched_getaffinity_np \
44117                  pstat_getdynamic sysmp sysctl
44118do :
44119  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
44120ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
44121if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
44122  cat >>confdefs.h <<_ACEOF
44123#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
44124_ACEOF
44125
44126fi
44127done
44128
44129
44130                if test $ac_cv_func_sched_getaffinity = yes; then
44131    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc compatible sched_getaffinity" >&5
44132$as_echo_n "checking for glibc compatible sched_getaffinity... " >&6; }
44133if ${gl_cv_func_sched_getaffinity3+:} false; then :
44134  $as_echo_n "(cached) " >&6
44135else
44136  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44137/* end confdefs.h.  */
44138#include <errno.h>
44139              #include <sched.h>
44140int
44141main ()
44142{
44143sched_getaffinity (0, 0, (cpu_set_t *) 0);
44144  ;
44145  return 0;
44146}
44147_ACEOF
44148if ac_fn_c_try_compile "$LINENO"; then :
44149  gl_cv_func_sched_getaffinity3=yes
44150else
44151  gl_cv_func_sched_getaffinity3=no
44152fi
44153rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44154
44155fi
44156{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_sched_getaffinity3" >&5
44157$as_echo "$gl_cv_func_sched_getaffinity3" >&6; }
44158    if test $gl_cv_func_sched_getaffinity3 = yes; then
44159
44160$as_echo "#define HAVE_SCHED_GETAFFINITY_LIKE_GLIBC 1" >>confdefs.h
44161
44162    fi
44163  fi
44164
44165
44166
44167 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
44168
44169
44170
44171
44172
44173
44174
44175$as_echo "#define my_strftime nstrftime" >>confdefs.h
44176
44177
44178
44179
44180
44181
44182
44183
44184
44185
44186
44187
44188
44189
44190   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for obstacks that work with any size object" >&5
44191$as_echo_n "checking for obstacks that work with any size object... " >&6; }
44192if ${ac_cv_func_obstack+:} false; then :
44193  $as_echo_n "(cached) " >&6
44194else
44195  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44196/* end confdefs.h.  */
44197#include "obstack.h"
44198             void *obstack_chunk_alloc (size_t n) { return 0; }
44199             void obstack_chunk_free (void *p) { }
44200             /* Check that an internal function returns size_t, not int.  */
44201             size_t _obstack_memory_used (struct obstack *);
44202
44203int
44204main ()
44205{
44206struct obstack mem;
44207             obstack_init (&mem);
44208             obstack_free (&mem, 0);
44209
44210  ;
44211  return 0;
44212}
44213_ACEOF
44214if ac_fn_c_try_link "$LINENO"; then :
44215  ac_cv_func_obstack=yes
44216else
44217  ac_cv_func_obstack=no
44218fi
44219rm -f core conftest.err conftest.$ac_objext \
44220    conftest$ac_exeext conftest.$ac_ext
44221fi
44222{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_obstack" >&5
44223$as_echo "$ac_cv_func_obstack" >&6; }
44224   if test "$ac_cv_func_obstack" = yes; then
44225
44226$as_echo "#define HAVE_OBSTACK 1" >>confdefs.h
44227
44228   else
44229
44230
44231
44232
44233
44234
44235
44236
44237  gl_LIBOBJS="$gl_LIBOBJS obstack.$ac_objext"
44238
44239   fi
44240
44241
44242
44243
44244  case "$host_os" in
44245    mingw* | pw*)
44246      REPLACE_OPEN=1
44247      ;;
44248    *)
44249
44250      if test "$gl_cv_macro_O_CLOEXEC" != yes; then
44251        REPLACE_OPEN=1
44252      fi
44253      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
44254$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
44255if ${gl_cv_func_open_slash+:} false; then :
44256  $as_echo_n "(cached) " >&6
44257else
44258  # Assume that if we have lstat, we can also check symlinks.
44259          if test $ac_cv_func_lstat = yes; then
44260            touch conftest.tmp
44261            ln -s conftest.tmp conftest.lnk
44262          fi
44263          if test "$cross_compiling" = yes; then :
44264
44265             case "$host_os" in
44266               freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
44267                 gl_cv_func_open_slash="guessing no" ;;
44268               *)
44269                 gl_cv_func_open_slash="guessing yes" ;;
44270             esac
44271
44272else
44273  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44274/* end confdefs.h.  */
44275
44276#include <fcntl.h>
44277#if HAVE_UNISTD_H
44278# include <unistd.h>
44279#endif
44280int main ()
44281{
44282  int result = 0;
44283#if HAVE_LSTAT
44284  if (open ("conftest.lnk/", O_RDONLY) != -1)
44285    result |= 1;
44286#endif
44287  if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
44288    result |= 2;
44289  return result;
44290}
44291_ACEOF
44292if ac_fn_c_try_run "$LINENO"; then :
44293  gl_cv_func_open_slash=yes
44294else
44295  gl_cv_func_open_slash=no
44296fi
44297rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
44298  conftest.$ac_objext conftest.beam conftest.$ac_ext
44299fi
44300
44301          rm -f conftest.sl conftest.tmp conftest.lnk
44302
44303fi
44304{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
44305$as_echo "$gl_cv_func_open_slash" >&6; }
44306      case "$gl_cv_func_open_slash" in
44307        *no)
44308
44309$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
44310
44311          REPLACE_OPEN=1
44312          ;;
44313      esac
44314      ;;
44315  esac
44316
44317    if test $REPLACE_OPEN = 0; then
44318
44319
44320
44321  if test $ac_cv_func_fchdir = no; then
44322    HAVE_FCHDIR=0
44323  fi
44324
44325      if test $HAVE_FCHDIR = 0; then
44326        REPLACE_OPEN=1
44327      fi
44328    fi
44329
44330
44331
44332  if test $REPLACE_OPEN = 1; then
44333
44334
44335
44336
44337
44338
44339
44340
44341  gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
44342
44343
44344
44345  :
44346
44347  fi
44348
44349
44350
44351
44352
44353          GNULIB_OPEN=1
44354
44355
44356
44357
44358
44359$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
44360
44361
44362
44363
44364
44365
44366
44367
44368
44369  case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
44370  yes+*yes+yes)
44371    ;;
44372  yes+*)
44373    # Solaris 10 lacks O_CLOEXEC.
44374    # Solaris 9 has *at functions, but uniformly mishandles trailing
44375    # slash in all of them.
44376    REPLACE_OPENAT=1
44377    ;;
44378  *)
44379    HAVE_OPENAT=0
44380    ;;
44381  esac
44382
44383  if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
44384
44385
44386
44387
44388
44389
44390
44391
44392  gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext"
44393
44394
44395
44396  :
44397
44398  fi
44399
44400
44401cat >>confdefs.h <<_ACEOF
44402#define GNULIB_OPENAT 1
44403_ACEOF
44404
44405
44406
44407
44408
44409
44410          GNULIB_OPENAT=1
44411
44412
44413
44414
44415
44416$as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h
44417
44418
44419
44420
44421
44422
44423
44424
44425cat >>confdefs.h <<_ACEOF
44426#define GNULIB_OPENAT_SAFER 1
44427_ACEOF
44428
44429
44430
44431
44432
44433  for ac_func in opendir
44434do :
44435  ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
44436if test "x$ac_cv_func_opendir" = xyes; then :
44437  cat >>confdefs.h <<_ACEOF
44438#define HAVE_OPENDIR 1
44439_ACEOF
44440
44441fi
44442done
44443
44444  if test $ac_cv_func_opendir = no; then
44445    HAVE_OPENDIR=0
44446  fi
44447
44448
44449
44450
44451  if test $ac_cv_func_fchdir = no; then
44452    HAVE_FCHDIR=0
44453  fi
44454
44455    if test $HAVE_FCHDIR = 0; then
44456      if test $HAVE_OPENDIR = 1; then
44457        REPLACE_OPENDIR=1
44458      fi
44459    fi
44460
44461      case $host_os,$HAVE_OPENDIR in
44462    os2*,1)
44463      REPLACE_OPENDIR=1;;
44464  esac
44465
44466  if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
44467
44468
44469
44470
44471
44472
44473
44474
44475  gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext"
44476
44477  fi
44478
44479
44480
44481
44482
44483          GNULIB_OPENDIR=1
44484
44485
44486
44487
44488
44489$as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
44490
44491
44492
44493
44494
44495
44496
44497
44498
44499  ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
44500#include <$ac_cv_struct_tm>
44501
44502"
44503if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
44504
44505cat >>confdefs.h <<_ACEOF
44506#define HAVE_STRUCT_TM_TM_ZONE 1
44507_ACEOF
44508
44509
44510fi
44511
44512if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
44513
44514$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
44515
44516else
44517  ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h>
44518"
44519if test "x$ac_cv_have_decl_tzname" = xyes; then :
44520  ac_have_decl=1
44521else
44522  ac_have_decl=0
44523fi
44524
44525cat >>confdefs.h <<_ACEOF
44526#define HAVE_DECL_TZNAME $ac_have_decl
44527_ACEOF
44528
44529  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
44530$as_echo_n "checking for tzname... " >&6; }
44531if ${ac_cv_var_tzname+:} false; then :
44532  $as_echo_n "(cached) " >&6
44533else
44534  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44535/* end confdefs.h.  */
44536#include <time.h>
44537#if !HAVE_DECL_TZNAME
44538extern char *tzname[];
44539#endif
44540
44541int
44542main ()
44543{
44544return tzname[0][0];
44545  ;
44546  return 0;
44547}
44548_ACEOF
44549if ac_fn_c_try_link "$LINENO"; then :
44550  ac_cv_var_tzname=yes
44551else
44552  ac_cv_var_tzname=no
44553fi
44554rm -f core conftest.err conftest.$ac_objext \
44555    conftest$ac_exeext conftest.$ac_ext
44556fi
44557{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
44558$as_echo "$ac_cv_var_tzname" >&6; }
44559  if test $ac_cv_var_tzname = yes; then
44560
44561$as_echo "#define HAVE_TZNAME 1" >>confdefs.h
44562
44563  fi
44564fi
44565
44566
44567
44568
44569
44570
44571
44572
44573    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl5.005 or newer" >&5
44574$as_echo_n "checking for perl5.005 or newer... " >&6; }
44575  if test "${PERL+set}" = set; then
44576    # 'PERL' is set in the user's environment.
44577    candidate_perl_names="$PERL"
44578    perl_specified=yes
44579  else
44580    candidate_perl_names='perl perl5'
44581    perl_specified=no
44582  fi
44583
44584  found=no
44585
44586  PERL="$am_missing_run perl"
44587  for perl in $candidate_perl_names; do
44588    # Run test in a subshell; some versions of sh will print an error if
44589    # an executable is not found, even if stderr is redirected.
44590    if ( $perl -e 'require 5.005; use File::Compare' ) > /dev/null 2>&1; then
44591      PERL=$perl
44592      found=yes
44593      break
44594    fi
44595  done
44596
44597  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5
44598$as_echo "$found" >&6; }
44599  test $found = no && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
44600WARNING: You don't seem to have perl5.005 or newer installed, or you lack
44601         a usable version of the Perl File::Compare module.  As a result,
44602         you may be unable to run a few tests or to regenerate certain
44603         files if you modify the sources from which they are derived.
44604 " >&5
44605$as_echo "$as_me: WARNING:
44606WARNING: You don't seem to have perl5.005 or newer installed, or you lack
44607         a usable version of the Perl File::Compare module.  As a result,
44608         you may be unable to run a few tests or to regenerate certain
44609         files if you modify the sources from which they are derived.
44610 " >&2;}
44611
44612
44613  # Prerequisites of lib/physmem.c.
44614  for ac_header in sys/pstat.h sys/sysmp.h sys/sysinfo.h \
44615    machine/hal_sysinfo.h sys/table.h sys/param.h sys/systemcfg.h
44616do :
44617  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
44618ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
44619"
44620if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
44621  cat >>confdefs.h <<_ACEOF
44622#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
44623_ACEOF
44624
44625fi
44626
44627done
44628
44629    for ac_header in sys/sysctl.h
44630do :
44631  ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default
44632     #if HAVE_SYS_PARAM_H
44633     # include <sys/param.h>
44634     #endif
44635
44636"
44637if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
44638  cat >>confdefs.h <<_ACEOF
44639#define HAVE_SYS_SYSCTL_H 1
44640_ACEOF
44641
44642fi
44643
44644done
44645
44646
44647  for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table sysinfo
44648do :
44649  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
44650ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
44651if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
44652  cat >>confdefs.h <<_ACEOF
44653#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
44654_ACEOF
44655
44656fi
44657done
44658
44659  ac_fn_c_check_member "$LINENO" "struct sysinfo" "mem_unit" "ac_cv_member_struct_sysinfo_mem_unit" "#include <sys/sysinfo.h>
44660"
44661if test "x$ac_cv_member_struct_sysinfo_mem_unit" = xyes; then :
44662
44663cat >>confdefs.h <<_ACEOF
44664#define HAVE_STRUCT_SYSINFO_MEM_UNIT 1
44665_ACEOF
44666
44667
44668fi
44669
44670
44671
44672
44673
44674
44675
44676  if test $ac_cv_func_pipe != yes; then
44677    HAVE_PIPE=0
44678  fi
44679
44680  if test $HAVE_PIPE = 0; then
44681
44682
44683
44684
44685
44686
44687
44688
44689  gl_LIBOBJS="$gl_LIBOBJS pipe.$ac_objext"
44690
44691  fi
44692
44693
44694
44695
44696
44697          GNULIB_PIPE=1
44698
44699
44700
44701
44702
44703$as_echo "#define GNULIB_TEST_PIPE 1" >>confdefs.h
44704
44705
44706
44707
44708
44709
44710
44711
44712
44713  if test $ac_cv_func_pipe2 != yes; then
44714    HAVE_PIPE2=0
44715  fi
44716
44717
44718
44719
44720
44721
44722          GNULIB_PIPE2=1
44723
44724
44725
44726
44727
44728$as_echo "#define GNULIB_TEST_PIPE2 1" >>confdefs.h
44729
44730
44731
44732
44733  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a shell that conforms to POSIX" >&5
44734$as_echo_n "checking for a shell that conforms to POSIX... " >&6; }
44735if ${gl_cv_posix_shell+:} false; then :
44736  $as_echo_n "(cached) " >&6
44737else
44738  gl_test_posix_shell_script='
44739       func_return () {
44740         (exit $1)
44741       }
44742       func_success () {
44743         func_return 0
44744       }
44745       func_failure () {
44746         func_return 1
44747       }
44748       func_ret_success () {
44749         return 0
44750       }
44751       func_ret_failure () {
44752         return 1
44753       }
44754       subshell_umask_sanity () {
44755         (umask 22; (umask 0); test $(umask) -eq 22)
44756       }
44757       test "$(echo foo)" = foo &&
44758       func_success &&
44759       ! func_failure &&
44760       func_ret_success &&
44761       ! func_ret_failure &&
44762       (set x && func_ret_success y && test x = "$1") &&
44763       subshell_umask_sanity
44764     '
44765     for gl_cv_posix_shell in \
44766         "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do
44767       case $gl_cv_posix_shell in
44768         /*)
44769           "$gl_cv_posix_shell" -c "$gl_test_posix_shell_script" 2>/dev/null \
44770             && break;;
44771       esac
44772     done
44773fi
44774{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_posix_shell" >&5
44775$as_echo "$gl_cv_posix_shell" >&6; }
44776
44777  if test "$gl_cv_posix_shell" != no; then
44778    POSIX_SHELL=$gl_cv_posix_shell
44779    PREFERABLY_POSIX_SHELL=$POSIX_SHELL
44780  else
44781    POSIX_SHELL=
44782    PREFERABLY_POSIX_SHELL=/bin/sh
44783  fi
44784
44785
44786
44787
44788    :
44789
44790
44791
44792
44793
44794
44795  if test $gl_cv_func_frexp_no_libm = yes; then
44796
44797
44798
44799  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
44800$as_echo_n "checking whether frexp works... " >&6; }
44801if ${gl_cv_func_frexp_works+:} false; then :
44802  $as_echo_n "(cached) " >&6
44803else
44804
44805      if test "$cross_compiling" = yes; then :
44806  case "$host_os" in
44807           netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
44808           mingw*) # Guess yes with MSVC, no with mingw.
44809             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44810/* end confdefs.h.  */
44811
44812#ifdef _MSC_VER
44813 Good
44814#endif
44815
44816_ACEOF
44817if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
44818  $EGREP "Good" >/dev/null 2>&1; then :
44819  gl_cv_func_frexp_works="guessing yes"
44820else
44821  gl_cv_func_frexp_works="guessing no"
44822fi
44823rm -f conftest*
44824
44825             ;;
44826           *) gl_cv_func_frexp_works="guessing yes" ;;
44827         esac
44828
44829else
44830  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44831/* end confdefs.h.  */
44832
44833#include <float.h>
44834#include <math.h>
44835#include <string.h>
44836#if HAVE_DECL_ALARM
44837# include <signal.h>
44838# include <unistd.h>
44839#endif
44840/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
44841   ICC 10.0 has a bug when optimizing the expression -zero.
44842   The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
44843   to PowerPC on Mac OS X 10.5.  */
44844#if defined __hpux || defined __sgi || defined __ICC
44845static double
44846compute_minus_zero (void)
44847{
44848  return -DBL_MIN * DBL_MIN;
44849}
44850# define minus_zero compute_minus_zero ()
44851#else
44852double minus_zero = -0.0;
44853#endif
44854int main()
44855{
44856  int result = 0;
44857  int i;
44858  volatile double x;
44859  double zero = 0.0;
44860#if HAVE_DECL_ALARM
44861  /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
44862     number.  Let the test fail in this case.  */
44863  signal (SIGALRM, SIG_DFL);
44864  alarm (5);
44865#endif
44866  /* Test on denormalized numbers.  */
44867  for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
44868    ;
44869  if (x > 0.0)
44870    {
44871      int exp;
44872      double y = frexp (x, &exp);
44873      /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
44874         On NetBSD: y = 0.75. Correct: y = 0.5.  */
44875      if (y != 0.5)
44876        result |= 1;
44877    }
44878  /* Test on infinite numbers.  */
44879  x = 1.0 / zero;
44880  {
44881    int exp;
44882    double y = frexp (x, &exp);
44883    if (y != x)
44884      result |= 2;
44885  }
44886  /* Test on negative zero.  */
44887  x = minus_zero;
44888  {
44889    int exp;
44890    double y = frexp (x, &exp);
44891    if (memcmp (&y, &x, sizeof x))
44892      result |= 4;
44893  }
44894  return result;
44895}
44896_ACEOF
44897if ac_fn_c_try_run "$LINENO"; then :
44898  gl_cv_func_frexp_works=yes
44899else
44900  gl_cv_func_frexp_works=no
44901fi
44902rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
44903  conftest.$ac_objext conftest.beam conftest.$ac_ext
44904fi
44905
44906
44907fi
44908{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
44909$as_echo "$gl_cv_func_frexp_works" >&6; }
44910
44911    case "$gl_cv_func_frexp_works" in
44912      *yes)
44913
44914$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h
44915
44916        ;;
44917    esac
44918  fi
44919
44920  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp can be used without linking with libm" >&5
44921$as_echo_n "checking whether ldexp can be used without linking with libm... " >&6; }
44922if ${gl_cv_func_ldexp_no_libm+:} false; then :
44923  $as_echo_n "(cached) " >&6
44924else
44925
44926      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44927/* end confdefs.h.  */
44928#include <math.h>
44929             double x;
44930             int y;
44931int
44932main ()
44933{
44934return ldexp (x, y) < 1;
44935  ;
44936  return 0;
44937}
44938_ACEOF
44939if ac_fn_c_try_link "$LINENO"; then :
44940  gl_cv_func_ldexp_no_libm=yes
44941else
44942  gl_cv_func_ldexp_no_libm=no
44943fi
44944rm -f core conftest.err conftest.$ac_objext \
44945    conftest$ac_exeext conftest.$ac_ext
44946
44947fi
44948{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5
44949$as_echo "$gl_cv_func_ldexp_no_libm" >&6; }
44950  if test $gl_cv_func_ldexp_no_libm = yes; then
44951
44952$as_echo "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h
44953
44954  fi
44955
44956
44957
44958
44959
44960
44961  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
44962$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
44963if ${gl_cv_func_frexpl_no_libm+:} false; then :
44964  $as_echo_n "(cached) " >&6
44965else
44966
44967      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44968/* end confdefs.h.  */
44969#include <math.h>
44970             long double x;
44971int
44972main ()
44973{
44974int e; return frexpl (x, &e) > 0;
44975  ;
44976  return 0;
44977}
44978_ACEOF
44979if ac_fn_c_try_link "$LINENO"; then :
44980  gl_cv_func_frexpl_no_libm=yes
44981else
44982  gl_cv_func_frexpl_no_libm=no
44983fi
44984rm -f core conftest.err conftest.$ac_objext \
44985    conftest$ac_exeext conftest.$ac_ext
44986
44987fi
44988{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
44989$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
44990
44991  if test $gl_cv_func_frexpl_no_libm = yes; then
44992
44993
44994     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
44995$as_echo_n "checking whether frexpl works... " >&6; }
44996if ${gl_cv_func_frexpl_works+:} false; then :
44997  $as_echo_n "(cached) " >&6
44998else
44999
45000      if test "$cross_compiling" = yes; then :
45001
45002         case "$host_os" in
45003           aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
45004              gl_cv_func_frexpl_works="guessing no";;
45005           *) gl_cv_func_frexpl_works="guessing yes";;
45006         esac
45007
45008else
45009  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45010/* end confdefs.h.  */
45011
45012#include <float.h>
45013#include <math.h>
45014/* Override the values of <float.h>, like done in float.in.h.  */
45015#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
45016# undef LDBL_MIN_EXP
45017# define LDBL_MIN_EXP    (-16381)
45018#endif
45019#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
45020# undef LDBL_MIN_EXP
45021# define LDBL_MIN_EXP    (-16381)
45022#endif
45023#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
45024# undef LDBL_MIN_EXP
45025# define LDBL_MIN_EXP DBL_MIN_EXP
45026#endif
45027#if defined __sgi && (LDBL_MANT_DIG >= 106)
45028# if defined __GNUC__
45029#  undef LDBL_MIN_EXP
45030#  define LDBL_MIN_EXP DBL_MIN_EXP
45031# endif
45032#endif
45033extern
45034#ifdef __cplusplus
45035"C"
45036#endif
45037long double frexpl (long double, int *);
45038int main()
45039{
45040  int result = 0;
45041  volatile long double x;
45042  /* Test on finite numbers that fails on AIX 5.1.  */
45043  x = 16.0L;
45044  {
45045    int exp = -9999;
45046    frexpl (x, &exp);
45047    if (exp != 5)
45048      result |= 1;
45049  }
45050  /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
45051     function returns an invalid (incorrectly normalized) value: it returns
45052               y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
45053     but the correct result is
45054          0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 }  */
45055  x = 1.01L;
45056  {
45057    int exp = -9999;
45058    long double y = frexpl (x, &exp);
45059    if (!(exp == 1 && y == 0.505L))
45060      result |= 2;
45061  }
45062  /* Test on large finite numbers.  This fails on BeOS at i = 16322, while
45063     LDBL_MAX_EXP = 16384.
45064     In the loop end test, we test x against Infinity, rather than comparing
45065     i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP.  */
45066  {
45067    int i;
45068    for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
45069      {
45070        int exp = -9999;
45071        frexpl (x, &exp);
45072        if (exp != i)
45073          {
45074            result |= 4;
45075            break;
45076          }
45077      }
45078  }
45079  /* Test on denormalized numbers.  */
45080  {
45081    int i;
45082    for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
45083      ;
45084    if (x > 0.0L)
45085      {
45086        int exp;
45087        long double y = frexpl (x, &exp);
45088        /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
45089           exp = -16382, y = 0.5.  On Mac OS X 10.5: exp = -16384, y = 0.5.  */
45090        if (exp != LDBL_MIN_EXP - 1)
45091          result |= 8;
45092      }
45093  }
45094  /* Test on infinite numbers.  */
45095  x = 1.0L / 0.0L;
45096  {
45097    int exp;
45098    long double y = frexpl (x, &exp);
45099    if (y != x)
45100      result |= 16;
45101  }
45102  return result;
45103}
45104_ACEOF
45105if ac_fn_c_try_run "$LINENO"; then :
45106  gl_cv_func_frexpl_works=yes
45107else
45108  gl_cv_func_frexpl_works=no
45109fi
45110rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
45111  conftest.$ac_objext conftest.beam conftest.$ac_ext
45112fi
45113
45114
45115fi
45116{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
45117$as_echo "$gl_cv_func_frexpl_works" >&6; }
45118
45119    case "$gl_cv_func_frexpl_works" in
45120      *yes) gl_func_frexpl_no_libm=yes ;;
45121      *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
45122    esac
45123  else
45124    gl_func_frexpl_no_libm=no
45125        REPLACE_FREXPL=1
45126  fi
45127  if test $gl_func_frexpl_no_libm = yes; then
45128
45129$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h
45130
45131            ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
45132"
45133if test "x$ac_cv_have_decl_frexpl" = xyes; then :
45134
45135else
45136  HAVE_DECL_FREXPL=0
45137fi
45138
45139  fi
45140
45141
45142  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used without linking with libm" >&5
45143$as_echo_n "checking whether ldexpl() can be used without linking with libm... " >&6; }
45144if ${gl_cv_func_ldexpl_no_libm+:} false; then :
45145  $as_echo_n "(cached) " >&6
45146else
45147
45148      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45149/* end confdefs.h.  */
45150#include <math.h>
45151             long double x;
45152int
45153main ()
45154{
45155return ldexpl (x, -1) > 0;
45156  ;
45157  return 0;
45158}
45159_ACEOF
45160if ac_fn_c_try_link "$LINENO"; then :
45161  gl_cv_func_ldexpl_no_libm=yes
45162else
45163  gl_cv_func_ldexpl_no_libm=no
45164fi
45165rm -f core conftest.err conftest.$ac_objext \
45166    conftest$ac_exeext conftest.$ac_ext
45167
45168fi
45169{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5
45170$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; }
45171
45172  if test $gl_cv_func_ldexpl_no_libm = yes; then
45173
45174
45175     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5
45176$as_echo_n "checking whether ldexpl works... " >&6; }
45177if ${gl_cv_func_ldexpl_works+:} false; then :
45178  $as_echo_n "(cached) " >&6
45179else
45180
45181      if test "$cross_compiling" = yes; then :
45182
45183         case "$host_os" in
45184           aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no" ;;
45185                            # Guess yes on native Windows.
45186           mingw*)          gl_cv_func_ldexpl_works="guessing yes" ;;
45187           *)               gl_cv_func_ldexpl_works="guessing yes" ;;
45188         esac
45189
45190else
45191  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45192/* end confdefs.h.  */
45193
45194#include <math.h>
45195extern
45196#ifdef __cplusplus
45197"C"
45198#endif
45199long double ldexpl (long double, int);
45200int main()
45201{
45202  int result = 0;
45203  {
45204    volatile long double x = 1.0;
45205    volatile long double y = ldexpl (x, -1);
45206    if (y != 0.5L)
45207      result |= 1;
45208  }
45209  {
45210    volatile long double x = 1.73205L;
45211    volatile long double y = ldexpl (x, 0);
45212    if (y != x)
45213      result |= 2;
45214  }
45215  return result;
45216}
45217_ACEOF
45218if ac_fn_c_try_run "$LINENO"; then :
45219  gl_cv_func_ldexpl_works=yes
45220else
45221  gl_cv_func_ldexpl_works=no
45222fi
45223rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
45224  conftest.$ac_objext conftest.beam conftest.$ac_ext
45225fi
45226
45227
45228fi
45229{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5
45230$as_echo "$gl_cv_func_ldexpl_works" >&6; }
45231
45232    case "$gl_cv_func_ldexpl_works" in
45233      *yes)
45234
45235$as_echo "#define HAVE_LDEXPL_IN_LIBC 1" >>confdefs.h
45236
45237                        ac_fn_c_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include <math.h>
45238"
45239if test "x$ac_cv_have_decl_ldexpl" = xyes; then :
45240
45241else
45242  HAVE_DECL_LDEXPL=0
45243fi
45244
45245        ;;
45246    esac
45247  fi
45248
45249
45250
45251  for ac_func in getppriv
45252do :
45253  ac_fn_c_check_func "$LINENO" "getppriv" "ac_cv_func_getppriv"
45254if test "x$ac_cv_func_getppriv" = xyes; then :
45255  cat >>confdefs.h <<_ACEOF
45256#define HAVE_GETPPRIV 1
45257_ACEOF
45258
45259fi
45260done
45261
45262
45263
45264  ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
45265"
45266if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
45267  ac_have_decl=1
45268else
45269  ac_have_decl=0
45270fi
45271
45272cat >>confdefs.h <<_ACEOF
45273#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
45274_ACEOF
45275
45276  ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
45277"
45278if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
45279  ac_have_decl=1
45280else
45281  ac_have_decl=0
45282fi
45283
45284cat >>confdefs.h <<_ACEOF
45285#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
45286_ACEOF
45287
45288
45289
45290  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'"
45291
45292
45293
45294  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'"
45295
45296
45297
45298
45299
45300
45301
45302
45303
45304
45305
45306
45307     if test $gl_cv_have_include_next = yes; then
45308       gl_cv_next_pthread_h='<'pthread.h'>'
45309     else
45310       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <pthread.h>" >&5
45311$as_echo_n "checking absolute name of <pthread.h>... " >&6; }
45312if ${gl_cv_next_pthread_h+:} false; then :
45313  $as_echo_n "(cached) " >&6
45314else
45315
45316             if test $ac_cv_header_pthread_h = yes; then
45317
45318
45319
45320
45321  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45322/* end confdefs.h.  */
45323#include <pthread.h>
45324_ACEOF
45325                case "$host_os" in
45326    aix*) gl_absname_cpp="$ac_cpp -C" ;;
45327    *)    gl_absname_cpp="$ac_cpp" ;;
45328  esac
45329
45330  case "$host_os" in
45331    mingw*)
45332                                          gl_dirsep_regex='[/\\]'
45333      ;;
45334    *)
45335      gl_dirsep_regex='\/'
45336      ;;
45337  esac
45338      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
45339  gl_header_literal_regex=`echo 'pthread.h' \
45340                           | sed -e "$gl_make_literal_regex_sed"`
45341  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
45342      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
45343      s|^/[^/]|//&|
45344      p
45345      q
45346    }'
45347
45348        gl_cv_absolute_pthread_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
45349  sed -n "$gl_absolute_header_sed"`
45350
45351           gl_header=$gl_cv_absolute_pthread_h
45352           gl_cv_next_pthread_h='"'$gl_header'"'
45353          else
45354               gl_cv_next_pthread_h='<'pthread.h'>'
45355             fi
45356
45357
45358fi
45359{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_pthread_h" >&5
45360$as_echo "$gl_cv_next_pthread_h" >&6; }
45361     fi
45362     NEXT_PTHREAD_H=$gl_cv_next_pthread_h
45363
45364     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
45365       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
45366       gl_next_as_first_directive='<'pthread.h'>'
45367     else
45368       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
45369       gl_next_as_first_directive=$gl_cv_next_pthread_h
45370     fi
45371     NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H=$gl_next_as_first_directive
45372
45373
45374
45375
45376   if test $ac_cv_header_pthread_h = yes; then
45377     HAVE_PTHREAD_H=1
45378     # mingw 3.0 uses winpthreads which installs broken macros via <pthread.h>
45379     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <pthread.h> pollutes the namespace" >&5
45380$as_echo_n "checking whether <pthread.h> pollutes the namespace... " >&6; }
45381if ${gl_cv_header_pthread_h_pollution+:} false; then :
45382  $as_echo_n "(cached) " >&6
45383else
45384  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45385/* end confdefs.h.  */
45386#include <pthread.h>
45387            #if defined strtok_r || defined localtime_r
45388            #error
45389             break me
45390            #endif
45391
45392int
45393main ()
45394{
45395
45396  ;
45397  return 0;
45398}
45399_ACEOF
45400if ac_fn_c_try_compile "$LINENO"; then :
45401  gl_cv_header_pthread_h_pollution=no
45402else
45403  gl_cv_header_pthread_h_pollution=yes
45404fi
45405rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45406fi
45407{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_pthread_h_pollution" >&5
45408$as_echo "$gl_cv_header_pthread_h_pollution" >&6; }
45409   else
45410     HAVE_PTHREAD_H=0
45411   fi
45412
45413   ac_fn_c_check_type "$LINENO" "pthread_t" "ac_cv_type_pthread_t" "$ac_includes_default
45414      #if HAVE_PTHREAD_H
45415       #include <pthread.h>
45416      #endif
45417"
45418if test "x$ac_cv_type_pthread_t" = xyes; then :
45419
45420cat >>confdefs.h <<_ACEOF
45421#define HAVE_PTHREAD_T 1
45422_ACEOF
45423
45424
45425fi
45426ac_fn_c_check_type "$LINENO" "pthread_spinlock_t" "ac_cv_type_pthread_spinlock_t" "$ac_includes_default
45427      #if HAVE_PTHREAD_H
45428       #include <pthread.h>
45429      #endif
45430"
45431if test "x$ac_cv_type_pthread_spinlock_t" = xyes; then :
45432
45433cat >>confdefs.h <<_ACEOF
45434#define HAVE_PTHREAD_SPINLOCK_T 1
45435_ACEOF
45436
45437
45438fi
45439
45440   if test $ac_cv_type_pthread_t != yes; then
45441     HAVE_PTHREAD_T=0
45442   fi
45443   if test $ac_cv_type_pthread_spinlock_t != yes; then
45444     HAVE_PTHREAD_SPINLOCK_T=0
45445   fi
45446
45447   if test $ac_cv_header_pthread_h != yes ||
45448      test $ac_cv_type_pthread_t != yes ||
45449      test $ac_cv_type_pthread_spinlock_t != yes; then
45450     PTHREAD_H='pthread.h'
45451
45452
45453
45454
45455
45456
45457
45458
45459  gl_LIBOBJS="$gl_LIBOBJS pthread.$ac_objext"
45460
45461   elif test $gl_cv_header_pthread_h_pollution = yes; then
45462     PTHREAD_H=pthread.h
45463   else
45464     PTHREAD_H=
45465   fi
45466
45467    if test -n "$PTHREAD_H"; then
45468  GL_GENERATE_PTHREAD_H_TRUE=
45469  GL_GENERATE_PTHREAD_H_FALSE='#'
45470else
45471  GL_GENERATE_PTHREAD_H_TRUE='#'
45472  GL_GENERATE_PTHREAD_H_FALSE=
45473fi
45474
45475
45476   LIB_PTHREAD=
45477   if test $ac_cv_header_pthread_h = yes; then
45478                              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create and pthread_join" >&5
45479$as_echo_n "checking for library containing pthread_create and pthread_join... " >&6; }
45480if ${gl_cv_lib_pthread+:} false; then :
45481  $as_echo_n "(cached) " >&6
45482else
45483  gl_saved_libs=$LIBS
45484        gl_cv_lib_pthread=
45485        for gl_lib_prefix in '' '-pthread' '-lpthread'; do
45486          LIBS="$gl_lib_prefix $gl_saved_libs"
45487          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45488/* end confdefs.h.  */
45489#include <pthread.h>
45490                 void *noop (void *p) { return p; }
45491int
45492main ()
45493{
45494pthread_t pt;
45495                 void *arg = 0;
45496                 pthread_create (&pt, 0, noop, arg);
45497                 pthread_join (pthread_self (), &arg);
45498  ;
45499  return 0;
45500}
45501_ACEOF
45502if ac_fn_c_try_link "$LINENO"; then :
45503  if test -z "$gl_lib_prefix"; then
45504               gl_cv_lib_pthread="none required"
45505             else
45506               gl_cv_lib_pthread=$gl_lib_prefix
45507             fi
45508fi
45509rm -f core conftest.err conftest.$ac_objext \
45510    conftest$ac_exeext conftest.$ac_ext
45511          test -n "$gl_cv_lib_pthread" && break
45512        done
45513        LIBS="$gl_saved_libs"
45514
45515fi
45516{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_pthread" >&5
45517$as_echo "$gl_cv_lib_pthread" >&6; }
45518     if test "$gl_cv_lib_pthread" != "none required"; then
45519       LIB_PTHREAD="$gl_cv_lib_pthread"
45520     fi
45521   fi
45522
45523
45524
45525
45526
45527
45528cat >>confdefs.h <<_ACEOF
45529#define GNULIB_PTHREAD 1
45530_ACEOF
45531
45532
45533
45534
45535     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5
45536$as_echo_n "checking for putenv compatible with GNU and SVID... " >&6; }
45537if ${gl_cv_func_svid_putenv+:} false; then :
45538  $as_echo_n "(cached) " >&6
45539else
45540  if test "$cross_compiling" = yes; then :
45541               case "$host_os" in
45542                               # Guess yes on glibc systems.
45543                *-gnu* | gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
45544                               # Guess no on native Windows.
45545                mingw*)        gl_cv_func_svid_putenv="guessing no" ;;
45546                               # If we don't know, assume the worst.
45547                *)             gl_cv_func_svid_putenv="guessing no" ;;
45548              esac
45549
45550else
45551  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45552/* end confdefs.h.  */
45553$ac_includes_default
45554int
45555main ()
45556{
45557
45558    /* Put it in env.  */
45559    if (putenv ("CONFTEST_putenv=val"))
45560      return 1;
45561
45562    /* Try to remove it.  */
45563    if (putenv ("CONFTEST_putenv"))
45564      return 2;
45565
45566    /* Make sure it was deleted.  */
45567    if (getenv ("CONFTEST_putenv") != 0)
45568      return 3;
45569
45570    return 0;
45571
45572  ;
45573  return 0;
45574}
45575_ACEOF
45576if ac_fn_c_try_run "$LINENO"; then :
45577  gl_cv_func_svid_putenv=yes
45578else
45579  gl_cv_func_svid_putenv=no
45580fi
45581rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
45582  conftest.$ac_objext conftest.beam conftest.$ac_ext
45583fi
45584
45585
45586fi
45587{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5
45588$as_echo "$gl_cv_func_svid_putenv" >&6; }
45589  case "$gl_cv_func_svid_putenv" in
45590    *yes) ;;
45591    *)
45592      REPLACE_PUTENV=1
45593      ;;
45594  esac
45595
45596  if test $REPLACE_PUTENV = 1; then
45597
45598
45599
45600
45601
45602
45603
45604
45605  gl_LIBOBJS="$gl_LIBOBJS putenv.$ac_objext"
45606
45607
45608  ac_fn_c_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default"
45609if test "x$ac_cv_have_decl__putenv" = xyes; then :
45610  ac_have_decl=1
45611else
45612  ac_have_decl=0
45613fi
45614
45615cat >>confdefs.h <<_ACEOF
45616#define HAVE_DECL__PUTENV $ac_have_decl
45617_ACEOF
45618
45619
45620  fi
45621
45622
45623
45624
45625
45626          GNULIB_PUTENV=1
45627
45628
45629
45630
45631
45632$as_echo "#define GNULIB_TEST_PUTENV 1" >>confdefs.h
45633
45634
45635
45636
45637      :
45638
45639
45640  :
45641
45642
45643
45644
45645  for ac_func in raise
45646do :
45647  ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise"
45648if test "x$ac_cv_func_raise" = xyes; then :
45649  cat >>confdefs.h <<_ACEOF
45650#define HAVE_RAISE 1
45651_ACEOF
45652
45653fi
45654done
45655
45656  if test $ac_cv_func_raise = no; then
45657    HAVE_RAISE=0
45658  else
45659
45660
45661      if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
45662        REPLACE_RAISE=1
45663      fi
45664
45665
45666
45667
45668
45669  if test $gl_cv_type_sigset_t = yes; then
45670    ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
45671if test "x$ac_cv_func_sigprocmask" = xyes; then :
45672  gl_cv_func_sigprocmask=1
45673fi
45674
45675  fi
45676  if test -z "$gl_cv_func_sigprocmask"; then
45677    HAVE_POSIX_SIGNALBLOCKING=0
45678  fi
45679
45680      if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
45681        :
45682      fi
45683
45684  fi
45685
45686  if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then
45687
45688
45689
45690
45691
45692
45693
45694
45695  gl_LIBOBJS="$gl_LIBOBJS raise.$ac_objext"
45696
45697    :
45698  fi
45699
45700
45701
45702
45703
45704          GNULIB_RAISE=1
45705
45706
45707
45708
45709
45710$as_echo "#define GNULIB_TEST_RAISE 1" >>confdefs.h
45711
45712
45713
45714
45715
45716
45717
45718    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
45719      REPLACE_READ=1
45720    fi
45721
45722
45723
45724  if test $REPLACE_READ = 1; then
45725
45726
45727
45728
45729
45730
45731
45732
45733  gl_LIBOBJS="$gl_LIBOBJS read.$ac_objext"
45734
45735    :
45736  fi
45737
45738
45739
45740
45741
45742          GNULIB_READ=1
45743
45744
45745
45746
45747
45748$as_echo "#define GNULIB_TEST_READ 1" >>confdefs.h
45749
45750
45751
45752  :
45753
45754
45755
45756  for ac_func in readdir
45757do :
45758  ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
45759if test "x$ac_cv_func_readdir" = xyes; then :
45760  cat >>confdefs.h <<_ACEOF
45761#define HAVE_READDIR 1
45762_ACEOF
45763
45764fi
45765done
45766
45767  if test $ac_cv_func_readdir = no; then
45768    HAVE_READDIR=0
45769  fi
45770
45771  if test $HAVE_READDIR = 0; then
45772
45773
45774
45775
45776
45777
45778
45779
45780  gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext"
45781
45782  fi
45783
45784
45785
45786
45787
45788          GNULIB_READDIR=1
45789
45790
45791
45792
45793
45794$as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h
45795
45796
45797
45798
45799
45800
45801  if test $ac_cv_func_readlink = no; then
45802    HAVE_READLINK=0
45803  else
45804    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
45805$as_echo_n "checking whether readlink signature is correct... " >&6; }
45806if ${gl_cv_decl_readlink_works+:} false; then :
45807  $as_echo_n "(cached) " >&6
45808else
45809  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45810/* end confdefs.h.  */
45811#include <unistd.h>
45812      /* Cause compilation failure if original declaration has wrong type.  */
45813      ssize_t readlink (const char *, char *, size_t);
45814int
45815main ()
45816{
45817
45818  ;
45819  return 0;
45820}
45821_ACEOF
45822if ac_fn_c_try_compile "$LINENO"; then :
45823  gl_cv_decl_readlink_works=yes
45824else
45825  gl_cv_decl_readlink_works=no
45826fi
45827rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45828fi
45829{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
45830$as_echo "$gl_cv_decl_readlink_works" >&6; }
45831            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
45832$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
45833if ${gl_cv_func_readlink_works+:} false; then :
45834  $as_echo_n "(cached) " >&6
45835else
45836  # We have readlink, so assume ln -s works.
45837       ln -s conftest.no-such conftest.link
45838       ln -s conftest.link conftest.lnk2
45839       if test "$cross_compiling" = yes; then :
45840  case "$host_os" in
45841                             # Guess yes on Linux systems.
45842            linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;;
45843                             # Guess yes on glibc systems.
45844            *-gnu* | gnu*)   gl_cv_func_readlink_works="guessing yes" ;;
45845                             # If we don't know, assume the worst.
45846            *)               gl_cv_func_readlink_works="guessing no" ;;
45847          esac
45848
45849else
45850  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45851/* end confdefs.h.  */
45852#include <unistd.h>
45853
45854int
45855main ()
45856{
45857char buf[20];
45858      return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
45859  ;
45860  return 0;
45861}
45862_ACEOF
45863if ac_fn_c_try_run "$LINENO"; then :
45864  gl_cv_func_readlink_works=yes
45865else
45866  gl_cv_func_readlink_works=no
45867fi
45868rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
45869  conftest.$ac_objext conftest.beam conftest.$ac_ext
45870fi
45871
45872      rm -f conftest.link conftest.lnk2
45873fi
45874{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5
45875$as_echo "$gl_cv_func_readlink_works" >&6; }
45876    case "$gl_cv_func_readlink_works" in
45877      *yes)
45878        if test "$gl_cv_decl_readlink_works" != yes; then
45879          REPLACE_READLINK=1
45880        fi
45881        ;;
45882      *)
45883
45884$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
45885
45886        REPLACE_READLINK=1
45887        ;;
45888    esac
45889  fi
45890
45891  if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
45892
45893
45894
45895
45896
45897
45898
45899
45900  gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
45901
45902
45903  :
45904
45905  fi
45906
45907
45908
45909
45910
45911          GNULIB_READLINK=1
45912
45913
45914
45915
45916
45917$as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
45918
45919
45920
45921
45922
45923
45924
45925
45926  if test $ac_cv_func_readlinkat = no; then
45927    HAVE_READLINKAT=0
45928  else
45929    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlinkat signature is correct" >&5
45930$as_echo_n "checking whether readlinkat signature is correct... " >&6; }
45931if ${gl_cv_decl_readlinkat_works+:} false; then :
45932  $as_echo_n "(cached) " >&6
45933else
45934  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45935/* end confdefs.h.  */
45936#include <unistd.h>
45937             /* Check whether original declaration has correct type.  */
45938             ssize_t readlinkat (int, char const *, char *, size_t);
45939int
45940main ()
45941{
45942
45943  ;
45944  return 0;
45945}
45946_ACEOF
45947if ac_fn_c_try_compile "$LINENO"; then :
45948  gl_cv_decl_readlinkat_works=yes
45949else
45950  gl_cv_decl_readlinkat_works=no
45951fi
45952rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45953fi
45954{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlinkat_works" >&5
45955$as_echo "$gl_cv_decl_readlinkat_works" >&6; }
45956    # Assume readinkat has the same trailing slash bug as readlink,
45957    # as is the case on Mac Os X 10.10
45958    case "$gl_cv_func_readlink_works" in
45959      *yes)
45960        if test "$gl_cv_decl_readlinkat_works" != yes; then
45961          REPLACE_READLINKAT=1
45962        fi
45963        ;;
45964      *)
45965        REPLACE_READLINKAT=1
45966        ;;
45967    esac
45968  fi
45969
45970  if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then
45971
45972
45973
45974
45975
45976
45977
45978
45979  gl_LIBOBJS="$gl_LIBOBJS readlinkat.$ac_objext"
45980
45981  fi
45982
45983
45984
45985
45986
45987          GNULIB_READLINKAT=1
45988
45989
45990
45991
45992
45993$as_echo "#define GNULIB_TEST_READLINKAT 1" >>confdefs.h
45994
45995
45996
45997
45998  :
45999
46000
46001
46002
46003
46004  if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
46005
46006    ac_fn_c_check_decl "$LINENO" "getutent" "ac_cv_have_decl_getutent" "
46007/* <sys/types.h> is a prerequisite of <utmp.h> on FreeBSD 8.0, OpenBSD 4.6.  */
46008#include <sys/types.h>
46009#ifdef HAVE_UTMP_H
46010# include <utmp.h>
46011#endif
46012
46013"
46014if test "x$ac_cv_have_decl_getutent" = xyes; then :
46015  ac_have_decl=1
46016else
46017  ac_have_decl=0
46018fi
46019
46020cat >>confdefs.h <<_ACEOF
46021#define HAVE_DECL_GETUTENT $ac_have_decl
46022_ACEOF
46023
46024    utmp_includes="\
46025$ac_includes_default
46026#ifdef HAVE_UTMPX_H
46027# include <utmpx.h>
46028#endif
46029#ifdef HAVE_UTMP_H
46030# if defined _THREAD_SAFE && defined UTMP_DATA_INIT
46031   /* When including both utmp.h and utmpx.h on AIX 4.3, with _THREAD_SAFE
46032      defined, work around the duplicate struct utmp_data declaration.  */
46033#  define utmp_data gl_aix_4_3_workaround_utmp_data
46034# endif
46035# include <utmp.h>
46036#endif
46037"
46038    ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_user" "ac_cv_member_struct_utmpx_ut_user" "$utmp_includes
46039"
46040if test "x$ac_cv_member_struct_utmpx_ut_user" = xyes; then :
46041
46042cat >>confdefs.h <<_ACEOF
46043#define HAVE_STRUCT_UTMPX_UT_USER 1
46044_ACEOF
46045
46046
46047fi
46048
46049    ac_fn_c_check_member "$LINENO" "struct utmp" "ut_user" "ac_cv_member_struct_utmp_ut_user" "$utmp_includes
46050"
46051if test "x$ac_cv_member_struct_utmp_ut_user" = xyes; then :
46052
46053cat >>confdefs.h <<_ACEOF
46054#define HAVE_STRUCT_UTMP_UT_USER 1
46055_ACEOF
46056
46057
46058fi
46059
46060    ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_name" "ac_cv_member_struct_utmpx_ut_name" "$utmp_includes
46061"
46062if test "x$ac_cv_member_struct_utmpx_ut_name" = xyes; then :
46063
46064cat >>confdefs.h <<_ACEOF
46065#define HAVE_STRUCT_UTMPX_UT_NAME 1
46066_ACEOF
46067
46068
46069fi
46070
46071    ac_fn_c_check_member "$LINENO" "struct utmp" "ut_name" "ac_cv_member_struct_utmp_ut_name" "$utmp_includes
46072"
46073if test "x$ac_cv_member_struct_utmp_ut_name" = xyes; then :
46074
46075cat >>confdefs.h <<_ACEOF
46076#define HAVE_STRUCT_UTMP_UT_NAME 1
46077_ACEOF
46078
46079
46080fi
46081
46082    ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_type" "ac_cv_member_struct_utmpx_ut_type" "$utmp_includes
46083"
46084if test "x$ac_cv_member_struct_utmpx_ut_type" = xyes; then :
46085
46086cat >>confdefs.h <<_ACEOF
46087#define HAVE_STRUCT_UTMPX_UT_TYPE 1
46088_ACEOF
46089
46090
46091fi
46092
46093    ac_fn_c_check_member "$LINENO" "struct utmp" "ut_type" "ac_cv_member_struct_utmp_ut_type" "$utmp_includes
46094"
46095if test "x$ac_cv_member_struct_utmp_ut_type" = xyes; then :
46096
46097cat >>confdefs.h <<_ACEOF
46098#define HAVE_STRUCT_UTMP_UT_TYPE 1
46099_ACEOF
46100
46101
46102fi
46103
46104    ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_pid" "ac_cv_member_struct_utmpx_ut_pid" "$utmp_includes
46105"
46106if test "x$ac_cv_member_struct_utmpx_ut_pid" = xyes; then :
46107
46108cat >>confdefs.h <<_ACEOF
46109#define HAVE_STRUCT_UTMPX_UT_PID 1
46110_ACEOF
46111
46112
46113fi
46114
46115    ac_fn_c_check_member "$LINENO" "struct utmp" "ut_pid" "ac_cv_member_struct_utmp_ut_pid" "$utmp_includes
46116"
46117if test "x$ac_cv_member_struct_utmp_ut_pid" = xyes; then :
46118
46119cat >>confdefs.h <<_ACEOF
46120#define HAVE_STRUCT_UTMP_UT_PID 1
46121_ACEOF
46122
46123
46124fi
46125
46126    ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_id" "ac_cv_member_struct_utmpx_ut_id" "$utmp_includes
46127"
46128if test "x$ac_cv_member_struct_utmpx_ut_id" = xyes; then :
46129
46130cat >>confdefs.h <<_ACEOF
46131#define HAVE_STRUCT_UTMPX_UT_ID 1
46132_ACEOF
46133
46134
46135fi
46136
46137    ac_fn_c_check_member "$LINENO" "struct utmp" "ut_id" "ac_cv_member_struct_utmp_ut_id" "$utmp_includes
46138"
46139if test "x$ac_cv_member_struct_utmp_ut_id" = xyes; then :
46140
46141cat >>confdefs.h <<_ACEOF
46142#define HAVE_STRUCT_UTMP_UT_ID 1
46143_ACEOF
46144
46145
46146fi
46147
46148    ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_exit" "ac_cv_member_struct_utmpx_ut_exit" "$utmp_includes
46149"
46150if test "x$ac_cv_member_struct_utmpx_ut_exit" = xyes; then :
46151
46152cat >>confdefs.h <<_ACEOF
46153#define HAVE_STRUCT_UTMPX_UT_EXIT 1
46154_ACEOF
46155
46156
46157fi
46158
46159    ac_fn_c_check_member "$LINENO" "struct utmp" "ut_exit" "ac_cv_member_struct_utmp_ut_exit" "$utmp_includes
46160"
46161if test "x$ac_cv_member_struct_utmp_ut_exit" = xyes; then :
46162
46163cat >>confdefs.h <<_ACEOF
46164#define HAVE_STRUCT_UTMP_UT_EXIT 1
46165_ACEOF
46166
46167
46168fi
46169
46170
46171    ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_exit.ut_exit" "ac_cv_member_struct_utmpx_ut_exit_ut_exit" "$utmp_includes
46172"
46173if test "x$ac_cv_member_struct_utmpx_ut_exit_ut_exit" = xyes; then :
46174
46175cat >>confdefs.h <<_ACEOF
46176#define HAVE_STRUCT_UTMPX_UT_EXIT_UT_EXIT 1
46177_ACEOF
46178
46179
46180fi
46181
46182    ac_fn_c_check_member "$LINENO" "struct utmp" "ut_exit.ut_exit" "ac_cv_member_struct_utmp_ut_exit_ut_exit" "$utmp_includes
46183"
46184if test "x$ac_cv_member_struct_utmp_ut_exit_ut_exit" = xyes; then :
46185
46186cat >>confdefs.h <<_ACEOF
46187#define HAVE_STRUCT_UTMP_UT_EXIT_UT_EXIT 1
46188_ACEOF
46189
46190
46191fi
46192
46193    ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_exit.e_exit" "ac_cv_member_struct_utmpx_ut_exit_e_exit" "$utmp_includes
46194"
46195if test "x$ac_cv_member_struct_utmpx_ut_exit_e_exit" = xyes; then :
46196
46197cat >>confdefs.h <<_ACEOF
46198#define HAVE_STRUCT_UTMPX_UT_EXIT_E_EXIT 1
46199_ACEOF
46200
46201
46202fi
46203
46204    ac_fn_c_check_member "$LINENO" "struct utmp" "ut_exit.e_exit" "ac_cv_member_struct_utmp_ut_exit_e_exit" "$utmp_includes
46205"
46206if test "x$ac_cv_member_struct_utmp_ut_exit_e_exit" = xyes; then :
46207
46208cat >>confdefs.h <<_ACEOF
46209#define HAVE_STRUCT_UTMP_UT_EXIT_E_EXIT 1
46210_ACEOF
46211
46212
46213fi
46214
46215
46216    ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_exit.ut_termination" "ac_cv_member_struct_utmpx_ut_exit_ut_termination" "$utmp_includes
46217"
46218if test "x$ac_cv_member_struct_utmpx_ut_exit_ut_termination" = xyes; then :
46219
46220cat >>confdefs.h <<_ACEOF
46221#define HAVE_STRUCT_UTMPX_UT_EXIT_UT_TERMINATION 1
46222_ACEOF
46223
46224
46225fi
46226
46227    ac_fn_c_check_member "$LINENO" "struct utmp" "ut_exit.ut_termination" "ac_cv_member_struct_utmp_ut_exit_ut_termination" "$utmp_includes
46228"
46229if test "x$ac_cv_member_struct_utmp_ut_exit_ut_termination" = xyes; then :
46230
46231cat >>confdefs.h <<_ACEOF
46232#define HAVE_STRUCT_UTMP_UT_EXIT_UT_TERMINATION 1
46233_ACEOF
46234
46235
46236fi
46237
46238    ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_exit.e_termination" "ac_cv_member_struct_utmpx_ut_exit_e_termination" "$utmp_includes
46239"
46240if test "x$ac_cv_member_struct_utmpx_ut_exit_e_termination" = xyes; then :
46241
46242cat >>confdefs.h <<_ACEOF
46243#define HAVE_STRUCT_UTMPX_UT_EXIT_E_TERMINATION 1
46244_ACEOF
46245
46246
46247fi
46248
46249    ac_fn_c_check_member "$LINENO" "struct utmp" "ut_exit.e_termination" "ac_cv_member_struct_utmp_ut_exit_e_termination" "$utmp_includes
46250"
46251if test "x$ac_cv_member_struct_utmp_ut_exit_e_termination" = xyes; then :
46252
46253cat >>confdefs.h <<_ACEOF
46254#define HAVE_STRUCT_UTMP_UT_EXIT_E_TERMINATION 1
46255_ACEOF
46256
46257
46258fi
46259
46260  fi
46261
46262  if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
46263
46264
46265
46266
46267
46268
46269
46270
46271  gl_LIBOBJS="$gl_LIBOBJS readutmp.$ac_objext"
46272
46273  fi
46274
46275
46276
46277      for ac_header in stdlib.h
46278do :
46279  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
46280if test "x$ac_cv_header_stdlib_h" = xyes; then :
46281  cat >>confdefs.h <<_ACEOF
46282#define HAVE_STDLIB_H 1
46283_ACEOF
46284
46285fi
46286
46287done
46288
46289  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
46290$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
46291if ${ac_cv_func_realloc_0_nonnull+:} false; then :
46292  $as_echo_n "(cached) " >&6
46293else
46294  if test "$cross_compiling" = yes; then :
46295  case "$host_os" in
46296          # Guess yes on platforms where we know the result.
46297          *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \
46298          | hpux* | solaris* | cygwin* | mingw*)
46299            ac_cv_func_realloc_0_nonnull=yes ;;
46300          # If we don't know, assume the worst.
46301          *) ac_cv_func_realloc_0_nonnull=no ;;
46302        esac
46303
46304else
46305  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46306/* end confdefs.h.  */
46307#if defined STDC_HEADERS || defined HAVE_STDLIB_H
46308            # include <stdlib.h>
46309            #else
46310            char *realloc ();
46311            #endif
46312
46313int
46314main ()
46315{
46316char *p = realloc (0, 0);
46317            int result = !p;
46318            free (p);
46319            return result;
46320  ;
46321  return 0;
46322}
46323
46324_ACEOF
46325if ac_fn_c_try_run "$LINENO"; then :
46326  ac_cv_func_realloc_0_nonnull=yes
46327else
46328  ac_cv_func_realloc_0_nonnull=no
46329fi
46330rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
46331  conftest.$ac_objext conftest.beam conftest.$ac_ext
46332fi
46333
46334
46335fi
46336{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
46337$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
46338  if test $ac_cv_func_realloc_0_nonnull = yes; then :
46339
46340$as_echo "#define HAVE_REALLOC_GNU 1" >>confdefs.h
46341
46342else
46343  $as_echo "#define HAVE_REALLOC_GNU 0" >>confdefs.h
46344
46345     REPLACE_REALLOC=1
46346
46347fi
46348
46349
46350  if test $REPLACE_REALLOC = 1; then
46351
46352
46353
46354
46355
46356
46357
46358
46359  gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
46360
46361  fi
46362
46363
46364cat >>confdefs.h <<_ACEOF
46365#define GNULIB_REALLOC_GNU 1
46366_ACEOF
46367
46368
46369
46370
46371
46372  if test $gl_cv_func_malloc_posix = yes; then
46373
46374$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
46375
46376  else
46377    REPLACE_REALLOC=1
46378  fi
46379
46380  if test $REPLACE_REALLOC = 1; then
46381
46382
46383
46384
46385
46386
46387
46388
46389  gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
46390
46391  fi
46392
46393
46394
46395
46396
46397          GNULIB_REALLOC_POSIX=1
46398
46399
46400
46401
46402
46403$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
46404
46405
46406
46407
46408
46409# Check whether --with-included-regex was given.
46410if test "${with_included_regex+set}" = set; then :
46411  withval=$with_included_regex;
46412fi
46413
46414
46415  case $with_included_regex in #(
46416  yes|no) ac_use_included_regex=$with_included_regex
46417        ;;
46418  '')
46419    # If the system regex support is good enough that it passes the
46420    # following run test, then default to *not* using the included regex.c.
46421    # If cross compiling, assume the test would fail and use the included
46422    # regex.c.
46423
46424
46425    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5
46426$as_echo_n "checking for working re_compile_pattern... " >&6; }
46427if ${gl_cv_func_re_compile_pattern_working+:} false; then :
46428  $as_echo_n "(cached) " >&6
46429else
46430  if test "$cross_compiling" = yes; then :
46431  case "$host_os" in
46432                   # Guess no on native Windows.
46433           mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;;
46434                   # Otherwise, assume it is not working.
46435           *)      gl_cv_func_re_compile_pattern_working="guessing no" ;;
46436         esac
46437
46438else
46439  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46440/* end confdefs.h.  */
46441#include <regex.h>
46442
46443            #include <locale.h>
46444            #include <limits.h>
46445            #include <string.h>
46446
46447            #if defined M_CHECK_ACTION || HAVE_DECL_ALARM
46448            # include <signal.h>
46449            # include <unistd.h>
46450            #endif
46451
46452            #if HAVE_MALLOC_H
46453            # include <malloc.h>
46454            #endif
46455
46456            #ifdef M_CHECK_ACTION
46457            /* Exit with distinguishable exit code.  */
46458            static void sigabrt_no_core (int sig) { raise (SIGTERM); }
46459            #endif
46460
46461int
46462main ()
46463{
46464int result = 0;
46465            static struct re_pattern_buffer regex;
46466            unsigned char folded_chars[UCHAR_MAX + 1];
46467            int i;
46468            const char *s;
46469            struct re_registers regs;
46470
46471            /* Some builds of glibc go into an infinite loop on this
46472               test.  Use alarm to force death, and mallopt to avoid
46473               malloc recursion in diagnosing the corrupted heap. */
46474#if HAVE_DECL_ALARM
46475            signal (SIGALRM, SIG_DFL);
46476            alarm (2);
46477#endif
46478#ifdef M_CHECK_ACTION
46479            signal (SIGABRT, sigabrt_no_core);
46480            mallopt (M_CHECK_ACTION, 2);
46481#endif
46482
46483            if (setlocale (LC_ALL, "en_US.UTF-8"))
46484              {
46485                {
46486                  /* https://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
46487                     This test needs valgrind to catch the bug on Debian
46488                     GNU/Linux 3.1 x86, but it might catch the bug better
46489                     on other platforms and it shouldn't hurt to try the
46490                     test here.  */
46491                  static char const pat[] = "insert into";
46492                  static char const data[] =
46493                    "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
46494                  re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
46495                                 | RE_ICASE);
46496                  memset (&regex, 0, sizeof regex);
46497                  s = re_compile_pattern (pat, sizeof pat - 1, &regex);
46498                  if (s)
46499                    result |= 1;
46500                  else if (re_search (&regex, data, sizeof data - 1,
46501                                      0, sizeof data - 1, &regs)
46502                           != -1)
46503                    result |= 1;
46504                  regfree (&regex);
46505                }
46506
46507                {
46508                  /* This test is from glibc bug 15078.
46509                     The test case is from Andreas Schwab in
46510                     <https://sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
46511                     */
46512                  static char const pat[] = "[^x]x";
46513                  static char const data[] =
46514                    /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */
46515                    "\xe1\x80\x80"
46516                    "\xe1\x80\xbb"
46517                    "\xe1\x80\xbd"
46518                    "\xe1\x80\x94"
46519                    "\xe1\x80\xba"
46520                    "\xe1\x80\xaf"
46521                    "\xe1\x80\x95"
46522                    "\xe1\x80\xba"
46523                    "x";
46524                  re_set_syntax (0);
46525                  memset (&regex, 0, sizeof regex);
46526                  s = re_compile_pattern (pat, sizeof pat - 1, &regex);
46527                  if (s)
46528                    result |= 1;
46529                  else
46530                    {
46531                      i = re_search (&regex, data, sizeof data - 1,
46532                                     0, sizeof data - 1, 0);
46533                      if (i != 0 && i != 21)
46534                        result |= 1;
46535                    }
46536                  regfree (&regex);
46537                }
46538
46539                if (! setlocale (LC_ALL, "C"))
46540                  return 1;
46541              }
46542
46543            /* This test is from glibc bug 3957, reported by Andrew Mackey.  */
46544            re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE);
46545            memset (&regex, 0, sizeof regex);
46546            s = re_compile_pattern ("a[^x]b", 6, &regex);
46547            if (s)
46548              result |= 2;
46549            /* This should fail, but succeeds for glibc-2.5.  */
46550            else if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
46551              result |= 2;
46552
46553            /* This regular expression is from Spencer ere test number 75
46554               in grep-2.3.  */
46555            re_set_syntax (RE_SYNTAX_POSIX_EGREP);
46556            memset (&regex, 0, sizeof regex);
46557            for (i = 0; i <= UCHAR_MAX; i++)
46558              folded_chars[i] = i;
46559            regex.translate = folded_chars;
46560            s = re_compile_pattern ("a[[:]:]]b\n", 11, &regex);
46561            /* This should fail with _Invalid character class name_ error.  */
46562            if (!s)
46563              result |= 4;
46564
46565            /* Ensure that [b-a] is diagnosed as invalid, when
46566               using RE_NO_EMPTY_RANGES. */
46567            re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
46568            memset (&regex, 0, sizeof regex);
46569            s = re_compile_pattern ("a[b-a]", 6, &regex);
46570            if (s == 0)
46571              result |= 8;
46572
46573            /* This should succeed, but does not for glibc-2.1.3.  */
46574            memset (&regex, 0, sizeof regex);
46575            s = re_compile_pattern ("{1", 2, &regex);
46576            if (s)
46577              result |= 8;
46578
46579            /* The following example is derived from a problem report
46580               against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>.  */
46581            memset (&regex, 0, sizeof regex);
46582            s = re_compile_pattern ("[an\371]*n", 7, &regex);
46583            if (s)
46584              result |= 8;
46585            /* This should match, but does not for glibc-2.2.1.  */
46586            else if (re_match (&regex, "an", 2, 0, &regs) != 2)
46587              result |= 8;
46588
46589            memset (&regex, 0, sizeof regex);
46590            s = re_compile_pattern ("x", 1, &regex);
46591            if (s)
46592              result |= 8;
46593            /* glibc-2.2.93 does not work with a negative RANGE argument.  */
46594            else if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
46595              result |= 8;
46596
46597            /* The version of regex.c in older versions of gnulib
46598               ignored RE_ICASE.  Detect that problem too.  */
46599            re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
46600            memset (&regex, 0, sizeof regex);
46601            s = re_compile_pattern ("x", 1, &regex);
46602            if (s)
46603              result |= 16;
46604            else if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
46605              result |= 16;
46606
46607            /* Catch a bug reported by Vin Shelton in
46608               https://lists.gnu.org/r/bug-coreutils/2007-06/msg00089.html
46609               */
46610            re_set_syntax (RE_SYNTAX_POSIX_BASIC
46611                           & ~RE_CONTEXT_INVALID_DUP
46612                           & ~RE_NO_EMPTY_RANGES);
46613            memset (&regex, 0, sizeof regex);
46614            s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
46615            if (s)
46616              result |= 32;
46617
46618            /* REG_STARTEND was added to glibc on 2004-01-15.
46619               Reject older versions.  */
46620            if (! REG_STARTEND)
46621              result |= 64;
46622
46623#if 0
46624            /* It would be nice to reject hosts whose regoff_t values are too
46625               narrow (including glibc on hosts with 64-bit ptrdiff_t and
46626               32-bit int), but we should wait until glibc implements this
46627               feature.  Otherwise, support for equivalence classes and
46628               multibyte collation symbols would always be broken except
46629               when compiling --without-included-regex.   */
46630            if (sizeof (regoff_t) < sizeof (ptrdiff_t)
46631                || sizeof (regoff_t) < sizeof (ssize_t))
46632              result |= 64;
46633#endif
46634
46635            return result;
46636
46637  ;
46638  return 0;
46639}
46640_ACEOF
46641if ac_fn_c_try_run "$LINENO"; then :
46642  gl_cv_func_re_compile_pattern_working=yes
46643else
46644  gl_cv_func_re_compile_pattern_working=no
46645fi
46646rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
46647  conftest.$ac_objext conftest.beam conftest.$ac_ext
46648fi
46649
46650
46651fi
46652{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5
46653$as_echo "$gl_cv_func_re_compile_pattern_working" >&6; }
46654    case "$gl_cv_func_re_compile_pattern_working" in #(
46655      *yes) ac_use_included_regex=no;; #(
46656      *no) ac_use_included_regex=yes;;
46657    esac
46658    ;;
46659  *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5
46660    ;;
46661  esac
46662
46663  if test $ac_use_included_regex = yes; then
46664
46665$as_echo "#define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h
46666
46667
46668$as_echo "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h
46669
46670
46671$as_echo "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h
46672
46673
46674$as_echo "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h
46675
46676
46677$as_echo "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h
46678
46679
46680$as_echo "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h
46681
46682
46683$as_echo "#define re_search rpl_re_search" >>confdefs.h
46684
46685
46686$as_echo "#define re_search_2 rpl_re_search_2" >>confdefs.h
46687
46688
46689$as_echo "#define re_match rpl_re_match" >>confdefs.h
46690
46691
46692$as_echo "#define re_match_2 rpl_re_match_2" >>confdefs.h
46693
46694
46695$as_echo "#define re_set_registers rpl_re_set_registers" >>confdefs.h
46696
46697
46698$as_echo "#define re_comp rpl_re_comp" >>confdefs.h
46699
46700
46701$as_echo "#define re_exec rpl_re_exec" >>confdefs.h
46702
46703
46704$as_echo "#define regcomp rpl_regcomp" >>confdefs.h
46705
46706
46707$as_echo "#define regexec rpl_regexec" >>confdefs.h
46708
46709
46710$as_echo "#define regerror rpl_regerror" >>confdefs.h
46711
46712
46713$as_echo "#define regfree rpl_regfree" >>confdefs.h
46714
46715  fi
46716
46717  if test $ac_use_included_regex = yes; then
46718
46719
46720
46721
46722
46723
46724
46725
46726  gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext"
46727
46728
46729
46730
46731
46732
46733
46734
46735  for ac_header in libintl.h
46736do :
46737  ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
46738if test "x$ac_cv_header_libintl_h" = xyes; then :
46739  cat >>confdefs.h <<_ACEOF
46740#define HAVE_LIBINTL_H 1
46741_ACEOF
46742
46743fi
46744
46745done
46746
46747
46748  ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
46749"
46750if test "x$ac_cv_have_decl_isblank" = xyes; then :
46751  ac_have_decl=1
46752else
46753  ac_have_decl=0
46754fi
46755
46756cat >>confdefs.h <<_ACEOF
46757#define HAVE_DECL_ISBLANK $ac_have_decl
46758_ACEOF
46759
46760
46761  fi
46762
46763
46764
46765
46766  if { case "$gl_cv_func_rmdir_works:$gl_cv_func_unlink_honors_slashes" in
46767         *yes:*yes) false;;
46768         *) true;;
46769       esac
46770     }; then
46771            REPLACE_REMOVE=1
46772  else
46773            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether remove handles directories" >&5
46774$as_echo_n "checking whether remove handles directories... " >&6; }
46775if ${gl_cv_func_remove_dir_works+:} false; then :
46776  $as_echo_n "(cached) " >&6
46777else
46778  mkdir conftest.dir
46779       if test "$cross_compiling" = yes; then :
46780  case $host_os in
46781            mingw*) gl_cv_func_remove_dir_works="guessing no";;
46782            *) gl_cv_func_remove_dir_works="guessing yes";;
46783          esac
46784else
46785  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46786/* end confdefs.h.  */
46787#include <stdio.h>
46788
46789int
46790main ()
46791{
46792return remove ("conftest.dir");
46793  ;
46794  return 0;
46795}
46796_ACEOF
46797if ac_fn_c_try_run "$LINENO"; then :
46798  gl_cv_func_remove_dir_works=yes
46799else
46800  gl_cv_func_remove_dir_works=no
46801fi
46802rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
46803  conftest.$ac_objext conftest.beam conftest.$ac_ext
46804fi
46805
46806       rm -rf conftest.dir
46807fi
46808{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_remove_dir_works" >&5
46809$as_echo "$gl_cv_func_remove_dir_works" >&6; }
46810    case $gl_cv_func_remove_dir_works in
46811      *no*) REPLACE_REMOVE=1;;
46812    esac
46813  fi
46814
46815  if test $REPLACE_REMOVE = 1; then
46816
46817
46818
46819
46820
46821
46822
46823
46824  gl_LIBOBJS="$gl_LIBOBJS remove.$ac_objext"
46825
46826  fi
46827
46828
46829
46830
46831
46832          GNULIB_REMOVE=1
46833
46834
46835
46836
46837
46838$as_echo "#define GNULIB_TEST_REMOVE 1" >>confdefs.h
46839
46840
46841
46842
46843
46844
46845
46846
46847                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5
46848$as_echo_n "checking whether rename honors trailing slash on destination... " >&6; }
46849if ${gl_cv_func_rename_slash_dst_works+:} false; then :
46850  $as_echo_n "(cached) " >&6
46851else
46852  rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
46853    touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
46854      as_fn_error $? "cannot create temporary files" "$LINENO" 5
46855    # Assume that if we have lstat, we can also check symlinks.
46856    if test $ac_cv_func_lstat = yes; then
46857      ln -s conftest.f conftest.lnk
46858    fi
46859    if test "$cross_compiling" = yes; then :
46860        case "$host_os" in
46861                          # Guess yes on Linux systems.
46862         linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
46863                          # Guess yes on glibc systems.
46864         *-gnu*)          gl_cv_func_rename_slash_dst_works="guessing yes" ;;
46865                          # Guess no on native Windows.
46866         mingw*)          gl_cv_func_rename_slash_dst_works="guessing no" ;;
46867                          # If we don't know, assume the worst.
46868         *)               gl_cv_func_rename_slash_dst_works="guessing no" ;;
46869       esac
46870
46871else
46872  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46873/* end confdefs.h.  */
46874
46875#        include <stdio.h>
46876#        include <stdlib.h>
46877
46878int
46879main ()
46880{
46881int result = 0;
46882           if (rename ("conftest.f1", "conftest.f2/") == 0)
46883             result |= 1;
46884           if (rename ("conftest.d1", "conftest.d2/") != 0)
46885             result |= 2;
46886#if HAVE_LSTAT
46887           if (rename ("conftest.f", "conftest.lnk/") == 0)
46888             result |= 4;
46889#endif
46890           return result;
46891
46892  ;
46893  return 0;
46894}
46895_ACEOF
46896if ac_fn_c_try_run "$LINENO"; then :
46897  gl_cv_func_rename_slash_dst_works=yes
46898else
46899  gl_cv_func_rename_slash_dst_works=no
46900fi
46901rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
46902  conftest.$ac_objext conftest.beam conftest.$ac_ext
46903fi
46904
46905    rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
46906
46907fi
46908{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5
46909$as_echo "$gl_cv_func_rename_slash_dst_works" >&6; }
46910  case "$gl_cv_func_rename_slash_dst_works" in
46911    *yes) ;;
46912    *)
46913      REPLACE_RENAME=1
46914
46915$as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h
46916
46917      ;;
46918  esac
46919
46920            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5
46921$as_echo_n "checking whether rename honors trailing slash on source... " >&6; }
46922if ${gl_cv_func_rename_slash_src_works+:} false; then :
46923  $as_echo_n "(cached) " >&6
46924else
46925  rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
46926    touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
46927      as_fn_error $? "cannot create temporary files" "$LINENO" 5
46928    # Assume that if we have lstat, we can also check symlinks.
46929    if test $ac_cv_func_lstat = yes; then
46930      ln -s conftest.f conftest.lnk
46931    fi
46932    if test "$cross_compiling" = yes; then :
46933        case "$host_os" in
46934                          # Guess yes on Linux systems.
46935         linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
46936                          # Guess yes on glibc systems.
46937         *-gnu*)          gl_cv_func_rename_slash_src_works="guessing yes" ;;
46938                          # Guess yes on native Windows.
46939         mingw*)          gl_cv_func_rename_slash_src_works="guessing yes" ;;
46940                          # If we don't know, assume the worst.
46941         *)               gl_cv_func_rename_slash_src_works="guessing no" ;;
46942       esac
46943
46944else
46945  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46946/* end confdefs.h.  */
46947
46948#        include <stdio.h>
46949#        include <stdlib.h>
46950
46951int
46952main ()
46953{
46954int result = 0;
46955           if (rename ("conftest.f1/", "conftest.d3") == 0)
46956             result |= 1;
46957           if (rename ("conftest.d1/", "conftest.d2") != 0)
46958             result |= 2;
46959#if HAVE_LSTAT
46960           if (rename ("conftest.lnk/", "conftest.f") == 0)
46961             result |= 4;
46962#endif
46963           return result;
46964
46965  ;
46966  return 0;
46967}
46968_ACEOF
46969if ac_fn_c_try_run "$LINENO"; then :
46970  gl_cv_func_rename_slash_src_works=yes
46971else
46972  gl_cv_func_rename_slash_src_works=no
46973fi
46974rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
46975  conftest.$ac_objext conftest.beam conftest.$ac_ext
46976fi
46977
46978    rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
46979
46980fi
46981{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5
46982$as_echo "$gl_cv_func_rename_slash_src_works" >&6; }
46983  case "$gl_cv_func_rename_slash_src_works" in
46984    *yes) ;;
46985    *)
46986      REPLACE_RENAME=1
46987
46988$as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h
46989
46990      ;;
46991  esac
46992
46993
46994  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5
46995$as_echo_n "checking whether rename manages hard links correctly... " >&6; }
46996if ${gl_cv_func_rename_link_works+:} false; then :
46997  $as_echo_n "(cached) " >&6
46998else
46999  if test $ac_cv_func_link = yes; then
47000       rm -rf conftest.f conftest.f1 conftest.f2
47001       if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
47002           set x `ls -i conftest.f conftest.f1` && test "" = ""; then
47003         if test "$cross_compiling" = yes; then :
47004             case "$host_os" in
47005                               # Guess yes on Linux systems.
47006              linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
47007                               # Guess yes on glibc systems.
47008              *-gnu*)          gl_cv_func_rename_link_works="guessing yes" ;;
47009                               # Guess yes on native Windows.
47010              mingw*)          gl_cv_func_rename_link_works="guessing yes" ;;
47011                               # If we don't know, assume the worst.
47012              *)               gl_cv_func_rename_link_works="guessing no" ;;
47013            esac
47014
47015else
47016  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47017/* end confdefs.h.  */
47018
47019#             include <errno.h>
47020#             include <stdio.h>
47021#             include <stdlib.h>
47022#             include <unistd.h>
47023
47024int
47025main ()
47026{
47027int result = 0;
47028                if (rename ("conftest.f", "conftest.f1"))
47029                  result |= 1;
47030                if (unlink ("conftest.f1"))
47031                  result |= 2;
47032
47033                /* Allow either the POSIX-required behavior, where the
47034                   previous rename kept conftest.f, or the (better) NetBSD
47035                   behavior, where it removed conftest.f.  */
47036                if (rename ("conftest.f", "conftest.f") != 0
47037                    && errno != ENOENT)
47038                  result |= 4;
47039
47040                if (rename ("conftest.f1", "conftest.f1") == 0)
47041                  result |= 8;
47042                if (rename ("conftest.f2", "conftest.f2") != 0)
47043                  result |= 16;
47044                return result;
47045
47046  ;
47047  return 0;
47048}
47049_ACEOF
47050if ac_fn_c_try_run "$LINENO"; then :
47051  gl_cv_func_rename_link_works=yes
47052else
47053  gl_cv_func_rename_link_works=no
47054fi
47055rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
47056  conftest.$ac_objext conftest.beam conftest.$ac_ext
47057fi
47058
47059       else
47060         gl_cv_func_rename_link_works="guessing no"
47061       fi
47062       rm -rf conftest.f conftest.f1 conftest.f2
47063     else
47064       gl_cv_func_rename_link_works=yes
47065     fi
47066
47067fi
47068{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5
47069$as_echo "$gl_cv_func_rename_link_works" >&6; }
47070  case "$gl_cv_func_rename_link_works" in
47071    *yes) ;;
47072    *)
47073      REPLACE_RENAME=1
47074
47075$as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h
47076
47077      ;;
47078  esac
47079
47080          { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5
47081$as_echo_n "checking whether rename manages existing destinations correctly... " >&6; }
47082if ${gl_cv_func_rename_dest_works+:} false; then :
47083  $as_echo_n "(cached) " >&6
47084else
47085  rm -rf conftest.f conftest.d1 conftest.d2
47086    touch conftest.f && mkdir conftest.d1 conftest.d2 ||
47087      as_fn_error $? "cannot create temporary files" "$LINENO" 5
47088    if test "$cross_compiling" = yes; then :
47089        case "$host_os" in
47090                          # Guess yes on Linux systems.
47091         linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
47092                          # Guess yes on glibc systems.
47093         *-gnu*)          gl_cv_func_rename_dest_works="guessing yes" ;;
47094                          # Guess no on native Windows.
47095         mingw*)          gl_cv_func_rename_dest_works="guessing no" ;;
47096                          # If we don't know, assume the worst.
47097         *)               gl_cv_func_rename_dest_works="guessing no" ;;
47098       esac
47099
47100else
47101  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47102/* end confdefs.h.  */
47103
47104#        include <stdio.h>
47105#        include <stdlib.h>
47106
47107int
47108main ()
47109{
47110int result = 0;
47111           if (rename ("conftest.d1", "conftest.d2") != 0)
47112             result |= 1;
47113           if (rename ("conftest.d2", "conftest.f") == 0)
47114             result |= 2;
47115           return result;
47116
47117  ;
47118  return 0;
47119}
47120_ACEOF
47121if ac_fn_c_try_run "$LINENO"; then :
47122  gl_cv_func_rename_dest_works=yes
47123else
47124  gl_cv_func_rename_dest_works=no
47125fi
47126rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
47127  conftest.$ac_objext conftest.beam conftest.$ac_ext
47128fi
47129
47130    rm -rf conftest.f conftest.d1 conftest.d2
47131
47132fi
47133{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5
47134$as_echo "$gl_cv_func_rename_dest_works" >&6; }
47135  case "$gl_cv_func_rename_dest_works" in
47136    *yes) ;;
47137    *)
47138      REPLACE_RENAME=1
47139
47140$as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
47141
47142      ;;
47143  esac
47144
47145  if test $REPLACE_RENAME = 1; then
47146
47147
47148
47149
47150
47151
47152
47153
47154  gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext"
47155
47156  fi
47157
47158
47159
47160
47161
47162          GNULIB_RENAME=1
47163
47164
47165
47166
47167
47168$as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h
47169
47170
47171
47172
47173
47174
47175
47176
47177  for ac_header in linux/fs.h
47178do :
47179  ac_fn_c_check_header_mongrel "$LINENO" "linux/fs.h" "ac_cv_header_linux_fs_h" "$ac_includes_default"
47180if test "x$ac_cv_header_linux_fs_h" = xyes; then :
47181  cat >>confdefs.h <<_ACEOF
47182#define HAVE_LINUX_FS_H 1
47183_ACEOF
47184
47185fi
47186
47187done
47188
47189
47190  if test $ac_cv_func_renameat = no; then
47191    HAVE_RENAMEAT=0
47192  elif test $REPLACE_RENAME = 1; then
47193        REPLACE_RENAMEAT=1
47194  fi
47195
47196  if test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1; then
47197
47198
47199
47200
47201
47202
47203
47204
47205  gl_LIBOBJS="$gl_LIBOBJS renameat.$ac_objext"
47206
47207  fi
47208  if test $HAVE_RENAMEAT = 0; then
47209
47210
47211
47212
47213
47214
47215
47216
47217  gl_LIBOBJS="$gl_LIBOBJS at-func2.$ac_objext"
47218
47219  fi
47220
47221
47222
47223
47224
47225          GNULIB_RENAMEAT=1
47226
47227
47228
47229
47230
47231$as_echo "#define GNULIB_TEST_RENAMEAT 1" >>confdefs.h
47232
47233
47234
47235
47236
47237
47238
47239
47240  for ac_header in linux/fs.h
47241do :
47242  ac_fn_c_check_header_mongrel "$LINENO" "linux/fs.h" "ac_cv_header_linux_fs_h" "$ac_includes_default"
47243if test "x$ac_cv_header_linux_fs_h" = xyes; then :
47244  cat >>confdefs.h <<_ACEOF
47245#define HAVE_LINUX_FS_H 1
47246_ACEOF
47247
47248fi
47249
47250done
47251
47252
47253  if test $ac_cv_func_renameat = no; then
47254    HAVE_RENAMEAT=0
47255  elif test $REPLACE_RENAME = 1; then
47256        REPLACE_RENAMEAT=1
47257  fi
47258
47259  if test $HAVE_RENAMEAT = 0; then
47260
47261
47262
47263
47264
47265
47266
47267
47268  gl_LIBOBJS="$gl_LIBOBJS at-func2.$ac_objext"
47269
47270  fi
47271
47272
47273
47274  for ac_func in rewinddir
47275do :
47276  ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir"
47277if test "x$ac_cv_func_rewinddir" = xyes; then :
47278  cat >>confdefs.h <<_ACEOF
47279#define HAVE_REWINDDIR 1
47280_ACEOF
47281
47282fi
47283done
47284
47285  if test $ac_cv_func_rewinddir = no; then
47286    HAVE_REWINDDIR=0
47287  fi
47288
47289  if test $HAVE_REWINDDIR = 0; then
47290
47291
47292
47293
47294
47295
47296
47297
47298  gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext"
47299
47300  fi
47301
47302
47303
47304
47305
47306          GNULIB_REWINDDIR=1
47307
47308
47309
47310
47311
47312$as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h
47313
47314
47315
47316
47317
47318
47319  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
47320$as_echo_n "checking whether rmdir works... " >&6; }
47321if ${gl_cv_func_rmdir_works+:} false; then :
47322  $as_echo_n "(cached) " >&6
47323else
47324  mkdir conftest.dir
47325     touch conftest.file
47326     if test "$cross_compiling" = yes; then :
47327  case "$host_os" in
47328                           # Guess yes on Linux systems.
47329          linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
47330                           # Guess yes on glibc systems.
47331          *-gnu* | gnu*)   gl_cv_func_rmdir_works="guessing yes" ;;
47332                           # Guess no on native Windows.
47333          mingw*)          gl_cv_func_rmdir_works="guessing no" ;;
47334                           # If we don't know, assume the worst.
47335          *)               gl_cv_func_rmdir_works="guessing no" ;;
47336        esac
47337
47338else
47339  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47340/* end confdefs.h.  */
47341#include <stdio.h>
47342           #include <errno.h>
47343           #if HAVE_UNISTD_H
47344           # include <unistd.h>
47345           #else /* on Windows with MSVC */
47346           # include <direct.h>
47347           #endif
47348
47349int
47350main ()
47351{
47352int result = 0;
47353      if (!rmdir ("conftest.file/"))
47354        result |= 1;
47355      else if (errno != ENOTDIR)
47356        result |= 2;
47357      if (!rmdir ("conftest.dir/./"))
47358        result |= 4;
47359      return result;
47360
47361  ;
47362  return 0;
47363}
47364_ACEOF
47365if ac_fn_c_try_run "$LINENO"; then :
47366  gl_cv_func_rmdir_works=yes
47367else
47368  gl_cv_func_rmdir_works=no
47369fi
47370rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
47371  conftest.$ac_objext conftest.beam conftest.$ac_ext
47372fi
47373
47374     rm -rf conftest.dir conftest.file
47375fi
47376{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
47377$as_echo "$gl_cv_func_rmdir_works" >&6; }
47378  case "$gl_cv_func_rmdir_works" in
47379    *yes) ;;
47380    *)
47381      REPLACE_RMDIR=1
47382      ;;
47383  esac
47384
47385  if test $REPLACE_RMDIR = 1; then
47386
47387
47388
47389
47390
47391
47392
47393
47394  gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext"
47395
47396  fi
47397
47398
47399
47400
47401
47402          GNULIB_RMDIR=1
47403
47404
47405
47406
47407
47408$as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
47409
47410
47411
47412
47413
47414
47415
47416  for ac_func in rpmatch
47417do :
47418  ac_fn_c_check_func "$LINENO" "rpmatch" "ac_cv_func_rpmatch"
47419if test "x$ac_cv_func_rpmatch" = xyes; then :
47420  cat >>confdefs.h <<_ACEOF
47421#define HAVE_RPMATCH 1
47422_ACEOF
47423
47424fi
47425done
47426
47427  if test $ac_cv_func_rpmatch = no; then
47428    HAVE_RPMATCH=0
47429  fi
47430
47431  if test $HAVE_RPMATCH = 0; then
47432
47433
47434
47435
47436
47437
47438
47439
47440  gl_LIBOBJS="$gl_LIBOBJS rpmatch.$ac_objext"
47441
47442
47443  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and YESEXPR" >&5
47444$as_echo_n "checking for nl_langinfo and YESEXPR... " >&6; }
47445if ${gl_cv_langinfo_yesexpr+:} false; then :
47446  $as_echo_n "(cached) " >&6
47447else
47448  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47449/* end confdefs.h.  */
47450#include <langinfo.h>
47451int
47452main ()
47453{
47454char* cs = nl_langinfo(YESEXPR); return !cs;
47455  ;
47456  return 0;
47457}
47458_ACEOF
47459if ac_fn_c_try_link "$LINENO"; then :
47460  gl_cv_langinfo_yesexpr=yes
47461else
47462  gl_cv_langinfo_yesexpr=no
47463fi
47464rm -f core conftest.err conftest.$ac_objext \
47465    conftest$ac_exeext conftest.$ac_ext
47466
47467fi
47468{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_langinfo_yesexpr" >&5
47469$as_echo "$gl_cv_langinfo_yesexpr" >&6; }
47470  if test $gl_cv_langinfo_yesexpr = yes; then
47471
47472$as_echo "#define HAVE_LANGINFO_YESEXPR 1" >>confdefs.h
47473
47474  fi
47475
47476  fi
47477
47478
47479
47480
47481
47482          GNULIB_RPMATCH=1
47483
47484
47485
47486
47487
47488$as_echo "#define GNULIB_TEST_RPMATCH 1" >>confdefs.h
47489
47490
47491
47492
47493
47494
47495
47496
47497
47498
47499
47500
47501
47502
47503
47504
47505
47506
47507
47508  :
47509
47510  :
47511
47512
47513
47514  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47515/* end confdefs.h.  */
47516
47517       #include <sched.h>
47518       struct sched_param a;
47519       int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER };
47520       pid_t t1;
47521
47522int
47523main ()
47524{
47525
47526  ;
47527  return 0;
47528}
47529_ACEOF
47530if ac_fn_c_try_compile "$LINENO"; then :
47531  SCHED_H=''
47532else
47533  SCHED_H='sched.h'
47534     for ac_header in sched.h
47535do :
47536  ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "#if HAVE_SYS_CDEFS_H
47537          #include <sys/cdefs.h>
47538         #endif
47539
47540"
47541if test "x$ac_cv_header_sched_h" = xyes; then :
47542  cat >>confdefs.h <<_ACEOF
47543#define HAVE_SCHED_H 1
47544_ACEOF
47545
47546fi
47547
47548done
47549
47550
47551
47552
47553
47554
47555
47556
47557
47558     if test $gl_cv_have_include_next = yes; then
47559       gl_cv_next_sched_h='<'sched.h'>'
47560     else
47561       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sched.h>" >&5
47562$as_echo_n "checking absolute name of <sched.h>... " >&6; }
47563if ${gl_cv_next_sched_h+:} false; then :
47564  $as_echo_n "(cached) " >&6
47565else
47566
47567
47568
47569  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47570/* end confdefs.h.  */
47571#include <sched.h>
47572_ACEOF
47573                case "$host_os" in
47574    aix*) gl_absname_cpp="$ac_cpp -C" ;;
47575    *)    gl_absname_cpp="$ac_cpp" ;;
47576  esac
47577
47578  case "$host_os" in
47579    mingw*)
47580                                          gl_dirsep_regex='[/\\]'
47581      ;;
47582    *)
47583      gl_dirsep_regex='\/'
47584      ;;
47585  esac
47586      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
47587  gl_header_literal_regex=`echo 'sched.h' \
47588                           | sed -e "$gl_make_literal_regex_sed"`
47589  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
47590      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
47591      s|^/[^/]|//&|
47592      p
47593      q
47594    }'
47595
47596        gl_cv_absolute_sched_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
47597  sed -n "$gl_absolute_header_sed"`
47598
47599           gl_header=$gl_cv_absolute_sched_h
47600           gl_cv_next_sched_h='"'$gl_header'"'
47601
47602
47603fi
47604{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sched_h" >&5
47605$as_echo "$gl_cv_next_sched_h" >&6; }
47606     fi
47607     NEXT_SCHED_H=$gl_cv_next_sched_h
47608
47609     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
47610       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
47611       gl_next_as_first_directive='<'sched.h'>'
47612     else
47613       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
47614       gl_next_as_first_directive=$gl_cv_next_sched_h
47615     fi
47616     NEXT_AS_FIRST_DIRECTIVE_SCHED_H=$gl_next_as_first_directive
47617
47618
47619
47620
47621
47622     if test "$ac_cv_header_sched_h" = yes; then
47623       HAVE_SCHED_H=1
47624     else
47625       HAVE_SCHED_H=0
47626     fi
47627
47628
47629     if test "$HAVE_SCHED_H" = 1; then
47630       ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#if HAVE_SYS_CDEFS_H
47631            #include <sys/cdefs.h>
47632           #endif
47633           #include <sched.h>
47634
47635"
47636if test "x$ac_cv_type_struct_sched_param" = xyes; then :
47637  HAVE_STRUCT_SCHED_PARAM=1
47638else
47639  HAVE_STRUCT_SCHED_PARAM=0
47640fi
47641
47642     else
47643       HAVE_STRUCT_SCHED_PARAM=0
47644       case "$host_os" in
47645         os2*)
47646                      ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include <spawn.h>
47647"
47648if test "x$ac_cv_type_struct_sched_param" = xyes; then :
47649  HAVE_STRUCT_SCHED_PARAM=1
47650fi
47651
47652           ;;
47653         vms)
47654                      ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include <pthread.h>
47655"
47656if test "x$ac_cv_type_struct_sched_param" = xyes; then :
47657  HAVE_STRUCT_SCHED_PARAM=1
47658fi
47659
47660           ;;
47661       esac
47662     fi
47663
47664
47665     if test "$ac_cv_header_sys_cdefs_h" = yes; then
47666       HAVE_SYS_CDEFS_H=1
47667     else
47668       HAVE_SYS_CDEFS_H=0
47669     fi
47670
47671
47672
47673
47674fi
47675rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47676
47677   if test -n "$SCHED_H"; then
47678  GL_GENERATE_SCHED_H_TRUE=
47679  GL_GENERATE_SCHED_H_FALSE='#'
47680else
47681  GL_GENERATE_SCHED_H_TRUE='#'
47682  GL_GENERATE_SCHED_H_FALSE=
47683fi
47684
47685
47686
47687
47688
47689
47690  if test "$ac_cv_header_winsock2_h" = yes; then
47691    REPLACE_SELECT=1
47692  else
47693
47694    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5
47695$as_echo_n "checking whether select supports a 0 argument... " >&6; }
47696if ${gl_cv_func_select_supports0+:} false; then :
47697  $as_echo_n "(cached) " >&6
47698else
47699
47700        if test "$cross_compiling" = yes; then :
47701
47702           case "$host_os" in
47703                       # Guess no on Interix.
47704             interix*) gl_cv_func_select_supports0="guessing no";;
47705                       # Guess yes otherwise.
47706             *)        gl_cv_func_select_supports0="guessing yes";;
47707           esac
47708
47709else
47710  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47711/* end confdefs.h.  */
47712
47713#include <sys/types.h>
47714#include <sys/time.h>
47715#if HAVE_SYS_SELECT_H
47716#include <sys/select.h>
47717#endif
47718int main ()
47719{
47720  struct timeval timeout;
47721  timeout.tv_sec = 0;
47722  timeout.tv_usec = 5;
47723  return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0;
47724}
47725_ACEOF
47726if ac_fn_c_try_run "$LINENO"; then :
47727  gl_cv_func_select_supports0=yes
47728else
47729  gl_cv_func_select_supports0=no
47730fi
47731rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
47732  conftest.$ac_objext conftest.beam conftest.$ac_ext
47733fi
47734
47735
47736fi
47737{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5
47738$as_echo "$gl_cv_func_select_supports0" >&6; }
47739    case "$gl_cv_func_select_supports0" in
47740      *yes) ;;
47741      *) REPLACE_SELECT=1 ;;
47742    esac
47743
47744        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5
47745$as_echo_n "checking whether select detects invalid fds... " >&6; }
47746if ${gl_cv_func_select_detects_ebadf+:} false; then :
47747  $as_echo_n "(cached) " >&6
47748else
47749
47750        if test "$cross_compiling" = yes; then :
47751
47752           case "$host_os" in
47753                             # Guess yes on Linux systems.
47754            linux-* | linux) gl_cv_func_select_detects_ebadf="guessing yes" ;;
47755                             # Guess yes on glibc systems.
47756            *-gnu* | gnu*)   gl_cv_func_select_detects_ebadf="guessing yes" ;;
47757                             # If we don't know, assume the worst.
47758            *)               gl_cv_func_select_detects_ebadf="guessing no" ;;
47759           esac
47760
47761else
47762  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47763/* end confdefs.h.  */
47764
47765#include <sys/types.h>
47766#include <sys/time.h>
47767#if HAVE_SYS_SELECT_H
47768# include <sys/select.h>
47769#endif
47770#include <unistd.h>
47771#include <errno.h>
47772
47773int
47774main ()
47775{
47776
47777  fd_set set;
47778  dup2(0, 16);
47779  FD_ZERO(&set);
47780  FD_SET(16, &set);
47781  close(16);
47782  struct timeval timeout;
47783  timeout.tv_sec = 0;
47784  timeout.tv_usec = 5;
47785  return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF;
47786
47787  ;
47788  return 0;
47789}
47790_ACEOF
47791if ac_fn_c_try_run "$LINENO"; then :
47792  gl_cv_func_select_detects_ebadf=yes
47793else
47794  gl_cv_func_select_detects_ebadf=no
47795fi
47796rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
47797  conftest.$ac_objext conftest.beam conftest.$ac_ext
47798fi
47799
47800
47801fi
47802{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5
47803$as_echo "$gl_cv_func_select_detects_ebadf" >&6; }
47804    case $gl_cv_func_select_detects_ebadf in
47805      *yes) ;;
47806      *) REPLACE_SELECT=1 ;;
47807    esac
47808  fi
47809
47810    LIB_SELECT="$LIBSOCKET"
47811  if test $REPLACE_SELECT = 1; then
47812    case "$host_os" in
47813      mingw*)
47814                                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47815/* end confdefs.h.  */
47816
47817#define WIN32_LEAN_AND_MEAN
47818#include <windows.h>
47819int
47820main ()
47821{
47822  MsgWaitForMultipleObjects (0, NULL, 0, 0, 0);
47823  return 0;
47824}
47825_ACEOF
47826if ac_fn_c_try_link "$LINENO"; then :
47827
47828else
47829  LIB_SELECT="$LIB_SELECT -luser32"
47830fi
47831rm -f core conftest.err conftest.$ac_objext \
47832    conftest$ac_exeext conftest.$ac_ext
47833        ;;
47834    esac
47835  fi
47836
47837
47838  if test $REPLACE_SELECT = 1; then
47839
47840
47841
47842
47843
47844
47845
47846
47847  gl_LIBOBJS="$gl_LIBOBJS select.$ac_objext"
47848
47849  fi
47850
47851
47852
47853
47854
47855          GNULIB_SELECT=1
47856
47857
47858
47859
47860
47861$as_echo "#define GNULIB_TEST_SELECT 1" >>confdefs.h
47862
47863
47864
47865  for ac_header in selinux/flask.h
47866do :
47867  ac_fn_c_check_header_mongrel "$LINENO" "selinux/flask.h" "ac_cv_header_selinux_flask_h" "$ac_includes_default"
47868if test "x$ac_cv_header_selinux_flask_h" = xyes; then :
47869  cat >>confdefs.h <<_ACEOF
47870#define HAVE_SELINUX_FLASK_H 1
47871_ACEOF
47872
47873fi
47874
47875done
47876
47877
47878
47879
47880
47881
47882
47883
47884
47885  gl_LIBOBJS="$gl_LIBOBJS selinux-at.$ac_objext"
47886
47887
47888
47889  if test "$with_selinux" != no; then
47890    for ac_header in selinux/selinux.h
47891do :
47892  ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
47893if test "x$ac_cv_header_selinux_selinux_h" = xyes; then :
47894  cat >>confdefs.h <<_ACEOF
47895#define HAVE_SELINUX_SELINUX_H 1
47896_ACEOF
47897
47898fi
47899
47900done
47901
47902
47903    if test "$ac_cv_header_selinux_selinux_h" = yes; then
47904      # We do have <selinux/selinux.h>, so do compile getfilecon.c
47905      # and arrange to use its wrappers.
47906
47907
47908
47909
47910
47911
47912
47913
47914
47915     if test $gl_cv_have_include_next = yes; then
47916       gl_cv_next_selinux_selinux_h='<'selinux/selinux.h'>'
47917     else
47918       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <selinux/selinux.h>" >&5
47919$as_echo_n "checking absolute name of <selinux/selinux.h>... " >&6; }
47920if ${gl_cv_next_selinux_selinux_h+:} false; then :
47921  $as_echo_n "(cached) " >&6
47922else
47923
47924             if test $ac_cv_header_selinux_selinux_h = yes; then
47925
47926
47927
47928
47929  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47930/* end confdefs.h.  */
47931#include <selinux/selinux.h>
47932_ACEOF
47933                case "$host_os" in
47934    aix*) gl_absname_cpp="$ac_cpp -C" ;;
47935    *)    gl_absname_cpp="$ac_cpp" ;;
47936  esac
47937
47938  case "$host_os" in
47939    mingw*)
47940                                          gl_dirsep_regex='[/\\]'
47941      ;;
47942    *)
47943      gl_dirsep_regex='\/'
47944      ;;
47945  esac
47946      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
47947  gl_header_literal_regex=`echo 'selinux/selinux.h' \
47948                           | sed -e "$gl_make_literal_regex_sed"`
47949  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
47950      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
47951      s|^/[^/]|//&|
47952      p
47953      q
47954    }'
47955
47956        gl_cv_absolute_selinux_selinux_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
47957  sed -n "$gl_absolute_header_sed"`
47958
47959           gl_header=$gl_cv_absolute_selinux_selinux_h
47960           gl_cv_next_selinux_selinux_h='"'$gl_header'"'
47961          else
47962               gl_cv_next_selinux_selinux_h='<'selinux/selinux.h'>'
47963             fi
47964
47965
47966fi
47967{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_selinux_selinux_h" >&5
47968$as_echo "$gl_cv_next_selinux_selinux_h" >&6; }
47969     fi
47970     NEXT_SELINUX_SELINUX_H=$gl_cv_next_selinux_selinux_h
47971
47972     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
47973       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
47974       gl_next_as_first_directive='<'selinux/selinux.h'>'
47975     else
47976       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
47977       gl_next_as_first_directive=$gl_cv_next_selinux_selinux_h
47978     fi
47979     NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H=$gl_next_as_first_directive
47980
47981
47982
47983
47984
47985$as_echo "#define getfilecon rpl_getfilecon" >>confdefs.h
47986
47987
47988$as_echo "#define lgetfilecon rpl_lgetfilecon" >>confdefs.h
47989
47990
47991$as_echo "#define fgetfilecon rpl_fgetfilecon" >>confdefs.h
47992
47993    fi
47994
47995    case "$ac_cv_search_setfilecon:$ac_cv_header_selinux_selinux_h" in
47996      no:*) # already warned
47997        ;;
47998      *:no)
47999        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libselinux was found but selinux/selinux.h is missing." >&5
48000$as_echo "$as_me: WARNING: libselinux was found but selinux/selinux.h is missing." >&2;}
48001        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GNU coreutils will be compiled without SELinux support." >&5
48002$as_echo "$as_me: WARNING: GNU coreutils will be compiled without SELinux support." >&2;}
48003    esac
48004  else
48005    # Do as if <selinux/selinux.h> does not exist, even if
48006    # AC_CHECK_HEADERS_ONCE has already determined that it exists.
48007    $as_echo "#define HAVE_SELINUX_SELINUX_H 0" >>confdefs.h
48008
48009  fi
48010
48011
48012
48013  if test "$with_selinux" != no; then
48014    for ac_header in selinux/context.h
48015do :
48016  ac_fn_c_check_header_mongrel "$LINENO" "selinux/context.h" "ac_cv_header_selinux_context_h" "$ac_includes_default"
48017if test "x$ac_cv_header_selinux_context_h" = xyes; then :
48018  cat >>confdefs.h <<_ACEOF
48019#define HAVE_SELINUX_CONTEXT_H 1
48020_ACEOF
48021 SELINUX_CONTEXT_H=
48022else
48023  SELINUX_CONTEXT_H=selinux/context.h
48024fi
48025
48026done
48027
48028  else
48029    SELINUX_CONTEXT_H=selinux/context.h
48030  fi
48031
48032   if test -n "$SELINUX_CONTEXT_H"; then
48033  GL_GENERATE_SELINUX_CONTEXT_H_TRUE=
48034  GL_GENERATE_SELINUX_CONTEXT_H_FALSE='#'
48035else
48036  GL_GENERATE_SELINUX_CONTEXT_H_TRUE='#'
48037  GL_GENERATE_SELINUX_CONTEXT_H_FALSE=
48038fi
48039
48040
48041  if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
48042
48043
48044
48045
48046
48047
48048
48049
48050  gl_LIBOBJS="$gl_LIBOBJS getfilecon.$ac_objext"
48051
48052  fi
48053
48054                      SERVENT_LIB=
48055  gl_saved_libs="$LIBS"
48056  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getservbyname" >&5
48057$as_echo_n "checking for library containing getservbyname... " >&6; }
48058if ${ac_cv_search_getservbyname+:} false; then :
48059  $as_echo_n "(cached) " >&6
48060else
48061  ac_func_search_save_LIBS=$LIBS
48062cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48063/* end confdefs.h.  */
48064
48065/* Override any GCC internal prototype to avoid an error.
48066   Use char because int might match the return type of a GCC
48067   builtin and then its argument prototype would still apply.  */
48068#ifdef __cplusplus
48069extern "C"
48070#endif
48071char getservbyname ();
48072int
48073main ()
48074{
48075return getservbyname ();
48076  ;
48077  return 0;
48078}
48079_ACEOF
48080for ac_lib in '' socket network net; do
48081  if test -z "$ac_lib"; then
48082    ac_res="none required"
48083  else
48084    ac_res=-l$ac_lib
48085    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
48086  fi
48087  if ac_fn_c_try_link "$LINENO"; then :
48088  ac_cv_search_getservbyname=$ac_res
48089fi
48090rm -f core conftest.err conftest.$ac_objext \
48091    conftest$ac_exeext
48092  if ${ac_cv_search_getservbyname+:} false; then :
48093  break
48094fi
48095done
48096if ${ac_cv_search_getservbyname+:} false; then :
48097
48098else
48099  ac_cv_search_getservbyname=no
48100fi
48101rm conftest.$ac_ext
48102LIBS=$ac_func_search_save_LIBS
48103fi
48104{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getservbyname" >&5
48105$as_echo "$ac_cv_search_getservbyname" >&6; }
48106ac_res=$ac_cv_search_getservbyname
48107if test "$ac_res" != no; then :
48108  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
48109  if test "$ac_cv_search_getservbyname" != "none required"; then
48110       SERVENT_LIB="$ac_cv_search_getservbyname"
48111     fi
48112fi
48113
48114  LIBS="$gl_saved_libs"
48115  if test -z "$SERVENT_LIB"; then
48116    for ac_func in getservbyname
48117do :
48118  ac_fn_c_check_func "$LINENO" "getservbyname" "ac_cv_func_getservbyname"
48119if test "x$ac_cv_func_getservbyname" = xyes; then :
48120  cat >>confdefs.h <<_ACEOF
48121#define HAVE_GETSERVBYNAME 1
48122_ACEOF
48123
48124else
48125
48126      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getservbyname in winsock2.h and -lws2_32" >&5
48127$as_echo_n "checking for getservbyname in winsock2.h and -lws2_32... " >&6; }
48128if ${gl_cv_w32_getservbyname+:} false; then :
48129  $as_echo_n "(cached) " >&6
48130else
48131  gl_cv_w32_getservbyname=no
48132         gl_save_LIBS="$LIBS"
48133         LIBS="$LIBS -lws2_32"
48134         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48135/* end confdefs.h.  */
48136
48137#ifdef HAVE_WINSOCK2_H
48138#include <winsock2.h>
48139#endif
48140#include <stddef.h>
48141
48142int
48143main ()
48144{
48145getservbyname(NULL,NULL);
48146  ;
48147  return 0;
48148}
48149_ACEOF
48150if ac_fn_c_try_link "$LINENO"; then :
48151  gl_cv_w32_getservbyname=yes
48152fi
48153rm -f core conftest.err conftest.$ac_objext \
48154    conftest$ac_exeext conftest.$ac_ext
48155         LIBS="$gl_save_LIBS"
48156
48157fi
48158{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_getservbyname" >&5
48159$as_echo "$gl_cv_w32_getservbyname" >&6; }
48160      if test "$gl_cv_w32_getservbyname" = "yes"; then
48161        SERVENT_LIB="-lws2_32"
48162      fi
48163
48164fi
48165done
48166
48167  fi
48168
48169
48170
48171
48172     if test $ac_cv_func_setenv = no; then
48173    HAVE_SETENV=0
48174  else
48175    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
48176$as_echo_n "checking whether setenv validates arguments... " >&6; }
48177if ${gl_cv_func_setenv_works+:} false; then :
48178  $as_echo_n "(cached) " >&6
48179else
48180  if test "$cross_compiling" = yes; then :
48181  case "$host_os" in
48182                        # Guess yes on glibc systems.
48183         *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
48184                        # If we don't know, assume the worst.
48185         *)             gl_cv_func_setenv_works="guessing no" ;;
48186       esac
48187
48188else
48189  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48190/* end confdefs.h.  */
48191
48192       #include <stdlib.h>
48193       #include <errno.h>
48194       #include <string.h>
48195
48196int
48197main ()
48198{
48199
48200       int result = 0;
48201       {
48202         if (setenv ("", "", 0) != -1)
48203           result |= 1;
48204         else if (errno != EINVAL)
48205           result |= 2;
48206       }
48207       {
48208         if (setenv ("a", "=", 1) != 0)
48209           result |= 4;
48210         else if (strcmp (getenv ("a"), "=") != 0)
48211           result |= 8;
48212       }
48213       return result;
48214
48215  ;
48216  return 0;
48217}
48218_ACEOF
48219if ac_fn_c_try_run "$LINENO"; then :
48220  gl_cv_func_setenv_works=yes
48221else
48222  gl_cv_func_setenv_works=no
48223fi
48224rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
48225  conftest.$ac_objext conftest.beam conftest.$ac_ext
48226fi
48227
48228fi
48229{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
48230$as_echo "$gl_cv_func_setenv_works" >&6; }
48231    case "$gl_cv_func_setenv_works" in
48232      *yes) ;;
48233      *)
48234        REPLACE_SETENV=1
48235        ;;
48236    esac
48237  fi
48238
48239  if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
48240
48241
48242
48243
48244
48245
48246
48247
48248  gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext"
48249
48250  fi
48251
48252
48253
48254
48255
48256          GNULIB_SETENV=1
48257
48258
48259
48260
48261
48262$as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
48263
48264
48265
48266
48267
48268
48269
48270
48271
48272  for ac_func in sig2str
48273do :
48274  ac_fn_c_check_func "$LINENO" "sig2str" "ac_cv_func_sig2str"
48275if test "x$ac_cv_func_sig2str" = xyes; then :
48276  cat >>confdefs.h <<_ACEOF
48277#define HAVE_SIG2STR 1
48278_ACEOF
48279
48280fi
48281done
48282
48283
48284  if test $ac_cv_func_sig2str = no; then
48285
48286
48287
48288
48289
48290
48291
48292
48293  gl_LIBOBJS="$gl_LIBOBJS sig2str.$ac_objext"
48294
48295
48296  :
48297
48298  fi
48299
48300
48301
48302  if test $ac_cv_func_sigaction = yes; then
48303    ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include <signal.h>
48304"
48305if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes; then :
48306
48307cat >>confdefs.h <<_ACEOF
48308#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1
48309_ACEOF
48310
48311
48312fi
48313
48314    if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then
48315      HAVE_STRUCT_SIGACTION_SA_SIGACTION=0
48316    fi
48317  else
48318    HAVE_SIGACTION=0
48319  fi
48320
48321  if test $HAVE_SIGACTION = 0; then
48322
48323
48324
48325
48326
48327
48328
48329
48330  gl_LIBOBJS="$gl_LIBOBJS sigaction.$ac_objext"
48331
48332
48333
48334
48335
48336
48337
48338  ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" "
48339#include <signal.h>
48340
48341"
48342if test "x$ac_cv_type_siginfo_t" = xyes; then :
48343
48344cat >>confdefs.h <<_ACEOF
48345#define HAVE_SIGINFO_T 1
48346_ACEOF
48347
48348
48349fi
48350
48351  if test $ac_cv_type_siginfo_t = no; then
48352    HAVE_SIGINFO_T=0
48353  fi
48354
48355  fi
48356
48357
48358
48359
48360
48361          GNULIB_SIGACTION=1
48362
48363
48364
48365
48366
48367$as_echo "#define GNULIB_TEST_SIGACTION 1" >>confdefs.h
48368
48369
48370
48371
48372
48373
48374
48375
48376
48377
48378
48379
48380
48381
48382     if test $gl_cv_have_include_next = yes; then
48383       gl_cv_next_signal_h='<'signal.h'>'
48384     else
48385       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
48386$as_echo_n "checking absolute name of <signal.h>... " >&6; }
48387if ${gl_cv_next_signal_h+:} false; then :
48388  $as_echo_n "(cached) " >&6
48389else
48390
48391
48392
48393  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48394/* end confdefs.h.  */
48395#include <signal.h>
48396_ACEOF
48397                case "$host_os" in
48398    aix*) gl_absname_cpp="$ac_cpp -C" ;;
48399    *)    gl_absname_cpp="$ac_cpp" ;;
48400  esac
48401
48402  case "$host_os" in
48403    mingw*)
48404                                          gl_dirsep_regex='[/\\]'
48405      ;;
48406    *)
48407      gl_dirsep_regex='\/'
48408      ;;
48409  esac
48410      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
48411  gl_header_literal_regex=`echo 'signal.h' \
48412                           | sed -e "$gl_make_literal_regex_sed"`
48413  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
48414      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
48415      s|^/[^/]|//&|
48416      p
48417      q
48418    }'
48419
48420        gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
48421  sed -n "$gl_absolute_header_sed"`
48422
48423           gl_header=$gl_cv_absolute_signal_h
48424           gl_cv_next_signal_h='"'$gl_header'"'
48425
48426
48427fi
48428{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
48429$as_echo "$gl_cv_next_signal_h" >&6; }
48430     fi
48431     NEXT_SIGNAL_H=$gl_cv_next_signal_h
48432
48433     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
48434       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
48435       gl_next_as_first_directive='<'signal.h'>'
48436     else
48437       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
48438       gl_next_as_first_directive=$gl_cv_next_signal_h
48439     fi
48440     NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
48441
48442
48443
48444
48445
48446# AIX declares sig_atomic_t to already include volatile, and C89 compilers
48447# then choke on 'volatile sig_atomic_t'.  C99 requires that it compile.
48448  ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
48449#include <signal.h>
48450
48451"
48452if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then :
48453
48454else
48455  HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
48456fi
48457
48458
48459
48460
48461
48462
48463
48464  ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
48465#include <signal.h>
48466
48467"
48468if test "x$ac_cv_type_sighandler_t" = xyes; then :
48469
48470else
48471  HAVE_SIGHANDLER_T=0
48472fi
48473
48474
48475
48476
48477
48478
48479     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit macro" >&5
48480$as_echo_n "checking for signbit macro... " >&6; }
48481if ${gl_cv_func_signbit+:} false; then :
48482  $as_echo_n "(cached) " >&6
48483else
48484
48485      if test "$cross_compiling" = yes; then :
48486  case "$host_os" in
48487                          # Guess yes on glibc systems.
48488           *-gnu* | gnu*) gl_cv_func_signbit="guessing yes" ;;
48489                          # Guess yes on native Windows.
48490           mingw*)        gl_cv_func_signbit="guessing yes" ;;
48491                          # If we don't know, assume the worst.
48492           *)             gl_cv_func_signbit="guessing no" ;;
48493         esac
48494
48495else
48496  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48497/* end confdefs.h.  */
48498
48499#include <math.h>
48500/* If signbit is defined as a function, don't use it, since calling it for
48501   'float' or 'long double' arguments would involve conversions.
48502   If signbit is not declared at all but exists as a library function, don't
48503   use it, since the prototype may not match.
48504   If signbit is not declared at all but exists as a compiler built-in, don't
48505   use it, since it's preferable to use __builtin_signbit* (no warnings,
48506   no conversions).  */
48507#ifndef signbit
48508# error "signbit should be a macro"
48509#endif
48510#include <string.h>
48511
48512/* Global variables.
48513   Needed because GCC 4 constant-folds __builtin_signbitl (literal)
48514   but cannot constant-fold            __builtin_signbitl (variable).  */
48515float vf;
48516double vd;
48517long double vl;
48518int main ()
48519{
48520/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
48521   So we use -p0f and -p0d instead.  */
48522float p0f = 0.0f;
48523float m0f = -p0f;
48524double p0d = 0.0;
48525double m0d = -p0d;
48526/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
48527   So we use another constant expression instead.
48528   But that expression does not work on other platforms, such as when
48529   cross-compiling to PowerPC on Mac OS X 10.5.  */
48530long double p0l = 0.0L;
48531#if defined __hpux || defined __sgi
48532long double m0l = -LDBL_MIN * LDBL_MIN;
48533#else
48534long double m0l = -p0l;
48535#endif
48536  int result = 0;
48537  if (signbit (vf)) /* link check */
48538    vf++;
48539  {
48540    float plus_inf = 1.0f / p0f;
48541    float minus_inf = -1.0f / p0f;
48542    if (!(!signbit (255.0f)
48543          && signbit (-255.0f)
48544          && !signbit (p0f)
48545          && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
48546          && !signbit (plus_inf)
48547          && signbit (minus_inf)))
48548      result |= 1;
48549  }
48550  if (signbit (vd)) /* link check */
48551    vd++;
48552  {
48553    double plus_inf = 1.0 / p0d;
48554    double minus_inf = -1.0 / p0d;
48555    if (!(!signbit (255.0)
48556          && signbit (-255.0)
48557          && !signbit (p0d)
48558          && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
48559          && !signbit (plus_inf)
48560          && signbit (minus_inf)))
48561      result |= 2;
48562  }
48563  if (signbit (vl)) /* link check */
48564    vl++;
48565  {
48566    long double plus_inf = 1.0L / p0l;
48567    long double minus_inf = -1.0L / p0l;
48568    if (signbit (255.0L))
48569      result |= 4;
48570    if (!signbit (-255.0L))
48571      result |= 4;
48572    if (signbit (p0l))
48573      result |= 8;
48574    if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
48575      result |= 16;
48576    if (signbit (plus_inf))
48577      result |= 32;
48578    if (!signbit (minus_inf))
48579      result |= 64;
48580  }
48581  return result;
48582}
48583
48584
48585_ACEOF
48586if ac_fn_c_try_run "$LINENO"; then :
48587  gl_cv_func_signbit=yes
48588else
48589  gl_cv_func_signbit=no
48590fi
48591rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
48592  conftest.$ac_objext conftest.beam conftest.$ac_ext
48593fi
48594
48595
48596fi
48597{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit" >&5
48598$as_echo "$gl_cv_func_signbit" >&6; }
48599          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit compiler built-ins" >&5
48600$as_echo_n "checking for signbit compiler built-ins... " >&6; }
48601if ${gl_cv_func_signbit_gcc+:} false; then :
48602  $as_echo_n "(cached) " >&6
48603else
48604
48605      if test "$cross_compiling" = yes; then :
48606  case "$host_os" in
48607                          # Guess yes on glibc systems.
48608           *-gnu* | gnu*) gl_cv_func_signbit_gcc="guessing yes" ;;
48609                          # Guess yes on mingw, no on MSVC.
48610           mingw*)        if test -n "$GCC"; then
48611                            gl_cv_func_signbit_gcc="guessing yes"
48612                          else
48613                            gl_cv_func_signbit_gcc="guessing no"
48614                          fi
48615                          ;;
48616                          # If we don't know, assume the worst.
48617           *)             gl_cv_func_signbit_gcc="guessing no" ;;
48618         esac
48619
48620else
48621  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48622/* end confdefs.h.  */
48623
48624#if __GNUC__ >= 4
48625# define signbit(x) \
48626   (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
48627    sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
48628    __builtin_signbitf (x))
48629#else
48630# error "signbit should be three compiler built-ins"
48631#endif
48632#include <string.h>
48633
48634/* Global variables.
48635   Needed because GCC 4 constant-folds __builtin_signbitl (literal)
48636   but cannot constant-fold            __builtin_signbitl (variable).  */
48637float vf;
48638double vd;
48639long double vl;
48640int main ()
48641{
48642/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
48643   So we use -p0f and -p0d instead.  */
48644float p0f = 0.0f;
48645float m0f = -p0f;
48646double p0d = 0.0;
48647double m0d = -p0d;
48648/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
48649   So we use another constant expression instead.
48650   But that expression does not work on other platforms, such as when
48651   cross-compiling to PowerPC on Mac OS X 10.5.  */
48652long double p0l = 0.0L;
48653#if defined __hpux || defined __sgi
48654long double m0l = -LDBL_MIN * LDBL_MIN;
48655#else
48656long double m0l = -p0l;
48657#endif
48658  int result = 0;
48659  if (signbit (vf)) /* link check */
48660    vf++;
48661  {
48662    float plus_inf = 1.0f / p0f;
48663    float minus_inf = -1.0f / p0f;
48664    if (!(!signbit (255.0f)
48665          && signbit (-255.0f)
48666          && !signbit (p0f)
48667          && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
48668          && !signbit (plus_inf)
48669          && signbit (minus_inf)))
48670      result |= 1;
48671  }
48672  if (signbit (vd)) /* link check */
48673    vd++;
48674  {
48675    double plus_inf = 1.0 / p0d;
48676    double minus_inf = -1.0 / p0d;
48677    if (!(!signbit (255.0)
48678          && signbit (-255.0)
48679          && !signbit (p0d)
48680          && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
48681          && !signbit (plus_inf)
48682          && signbit (minus_inf)))
48683      result |= 2;
48684  }
48685  if (signbit (vl)) /* link check */
48686    vl++;
48687  {
48688    long double plus_inf = 1.0L / p0l;
48689    long double minus_inf = -1.0L / p0l;
48690    if (signbit (255.0L))
48691      result |= 4;
48692    if (!signbit (-255.0L))
48693      result |= 4;
48694    if (signbit (p0l))
48695      result |= 8;
48696    if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
48697      result |= 16;
48698    if (signbit (plus_inf))
48699      result |= 32;
48700    if (!signbit (minus_inf))
48701      result |= 64;
48702  }
48703  return result;
48704}
48705
48706
48707_ACEOF
48708if ac_fn_c_try_run "$LINENO"; then :
48709  gl_cv_func_signbit_gcc=yes
48710else
48711  gl_cv_func_signbit_gcc=no
48712fi
48713rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
48714  conftest.$ac_objext conftest.beam conftest.$ac_ext
48715fi
48716
48717
48718fi
48719{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit_gcc" >&5
48720$as_echo "$gl_cv_func_signbit_gcc" >&6; }
48721      case "$gl_cv_func_signbit_gcc" in
48722    *yes)
48723      REPLACE_SIGNBIT_USING_GCC=1
48724      ;;
48725    *)
48726      case "$gl_cv_func_signbit" in
48727        *yes) ;;
48728        *)
48729                    REPLACE_SIGNBIT=1
48730
48731
48732  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'float'" >&5
48733$as_echo_n "checking where to find the sign bit in a 'float'... " >&6; }
48734if ${gl_cv_cc_float_signbit+:} false; then :
48735  $as_echo_n "(cached) " >&6
48736else
48737
48738      if test "$cross_compiling" = yes; then :
48739
48740                              gl_cv_cc_float_signbit="unknown"
48741
48742else
48743  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48744/* end confdefs.h.  */
48745
48746#include <stddef.h>
48747#include <stdio.h>
48748#define NWORDS \
48749  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
48750typedef union { float value; unsigned int word[NWORDS]; }
48751        memory_float;
48752static memory_float plus = { 1.0f };
48753static memory_float minus = { -1.0f };
48754int main ()
48755{
48756  size_t j, k, i;
48757  unsigned int m;
48758  FILE *fp = fopen ("conftest.out", "w");
48759  if (fp == NULL)
48760    return 1;
48761  /* Find the different bit.  */
48762  k = 0; m = 0;
48763  for (j = 0; j < NWORDS; j++)
48764    {
48765      unsigned int x = plus.word[j] ^ minus.word[j];
48766      if ((x & (x - 1)) || (x && m))
48767        {
48768          /* More than one bit difference.  */
48769          fprintf (fp, "unknown");
48770          fclose (fp);
48771          return 2;
48772        }
48773      if (x)
48774        {
48775          k = j;
48776          m = x;
48777        }
48778    }
48779  if (m == 0)
48780    {
48781      /* No difference.  */
48782      fprintf (fp, "unknown");
48783      fclose (fp);
48784      return 3;
48785    }
48786  /* Now m = plus.word[k] ^ ~minus.word[k].  */
48787  if (plus.word[k] & ~minus.word[k])
48788    {
48789      /* Oh? The sign bit is set in the positive and cleared in the negative
48790         numbers?  */
48791      fprintf (fp, "unknown");
48792      fclose (fp);
48793      return 4;
48794    }
48795  for (i = 0; ; i++)
48796    if ((m >> i) & 1)
48797      break;
48798  fprintf (fp, "word %d bit %d", (int) k, (int) i);
48799  if (fclose (fp) != 0)
48800    return 5;
48801  return 0;
48802}
48803
48804_ACEOF
48805if ac_fn_c_try_run "$LINENO"; then :
48806  gl_cv_cc_float_signbit=`cat conftest.out`
48807else
48808  gl_cv_cc_float_signbit="unknown"
48809fi
48810rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
48811  conftest.$ac_objext conftest.beam conftest.$ac_ext
48812fi
48813
48814      rm -f conftest.out
48815
48816fi
48817{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_signbit" >&5
48818$as_echo "$gl_cv_cc_float_signbit" >&6; }
48819  case "$gl_cv_cc_float_signbit" in
48820    word*bit*)
48821      word=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
48822      bit=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word.*bit //'`
48823
48824cat >>confdefs.h <<_ACEOF
48825#define FLT_SIGNBIT_WORD $word
48826_ACEOF
48827
48828
48829cat >>confdefs.h <<_ACEOF
48830#define FLT_SIGNBIT_BIT $bit
48831_ACEOF
48832
48833      ;;
48834  esac
48835
48836
48837
48838
48839  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'double'" >&5
48840$as_echo_n "checking where to find the sign bit in a 'double'... " >&6; }
48841if ${gl_cv_cc_double_signbit+:} false; then :
48842  $as_echo_n "(cached) " >&6
48843else
48844
48845      if test "$cross_compiling" = yes; then :
48846
48847                              gl_cv_cc_double_signbit="unknown"
48848
48849else
48850  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48851/* end confdefs.h.  */
48852
48853#include <stddef.h>
48854#include <stdio.h>
48855#define NWORDS \
48856  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
48857typedef union { double value; unsigned int word[NWORDS]; }
48858        memory_float;
48859static memory_float plus = { 1.0 };
48860static memory_float minus = { -1.0 };
48861int main ()
48862{
48863  size_t j, k, i;
48864  unsigned int m;
48865  FILE *fp = fopen ("conftest.out", "w");
48866  if (fp == NULL)
48867    return 1;
48868  /* Find the different bit.  */
48869  k = 0; m = 0;
48870  for (j = 0; j < NWORDS; j++)
48871    {
48872      unsigned int x = plus.word[j] ^ minus.word[j];
48873      if ((x & (x - 1)) || (x && m))
48874        {
48875          /* More than one bit difference.  */
48876          fprintf (fp, "unknown");
48877          fclose (fp);
48878          return 2;
48879        }
48880      if (x)
48881        {
48882          k = j;
48883          m = x;
48884        }
48885    }
48886  if (m == 0)
48887    {
48888      /* No difference.  */
48889      fprintf (fp, "unknown");
48890      fclose (fp);
48891      return 3;
48892    }
48893  /* Now m = plus.word[k] ^ ~minus.word[k].  */
48894  if (plus.word[k] & ~minus.word[k])
48895    {
48896      /* Oh? The sign bit is set in the positive and cleared in the negative
48897         numbers?  */
48898      fprintf (fp, "unknown");
48899      fclose (fp);
48900      return 4;
48901    }
48902  for (i = 0; ; i++)
48903    if ((m >> i) & 1)
48904      break;
48905  fprintf (fp, "word %d bit %d", (int) k, (int) i);
48906  if (fclose (fp) != 0)
48907    return 5;
48908  return 0;
48909}
48910
48911_ACEOF
48912if ac_fn_c_try_run "$LINENO"; then :
48913  gl_cv_cc_double_signbit=`cat conftest.out`
48914else
48915  gl_cv_cc_double_signbit="unknown"
48916fi
48917rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
48918  conftest.$ac_objext conftest.beam conftest.$ac_ext
48919fi
48920
48921      rm -f conftest.out
48922
48923fi
48924{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_signbit" >&5
48925$as_echo "$gl_cv_cc_double_signbit" >&6; }
48926  case "$gl_cv_cc_double_signbit" in
48927    word*bit*)
48928      word=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
48929      bit=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word.*bit //'`
48930
48931cat >>confdefs.h <<_ACEOF
48932#define DBL_SIGNBIT_WORD $word
48933_ACEOF
48934
48935
48936cat >>confdefs.h <<_ACEOF
48937#define DBL_SIGNBIT_BIT $bit
48938_ACEOF
48939
48940      ;;
48941  esac
48942
48943
48944
48945
48946  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'long double'" >&5
48947$as_echo_n "checking where to find the sign bit in a 'long double'... " >&6; }
48948if ${gl_cv_cc_long_double_signbit+:} false; then :
48949  $as_echo_n "(cached) " >&6
48950else
48951
48952      if test "$cross_compiling" = yes; then :
48953
48954                              gl_cv_cc_long_double_signbit="unknown"
48955
48956else
48957  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48958/* end confdefs.h.  */
48959
48960#include <stddef.h>
48961#include <stdio.h>
48962#define NWORDS \
48963  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
48964typedef union { long double value; unsigned int word[NWORDS]; }
48965        memory_float;
48966static memory_float plus = { 1.0L };
48967static memory_float minus = { -1.0L };
48968int main ()
48969{
48970  size_t j, k, i;
48971  unsigned int m;
48972  FILE *fp = fopen ("conftest.out", "w");
48973  if (fp == NULL)
48974    return 1;
48975  /* Find the different bit.  */
48976  k = 0; m = 0;
48977  for (j = 0; j < NWORDS; j++)
48978    {
48979      unsigned int x = plus.word[j] ^ minus.word[j];
48980      if ((x & (x - 1)) || (x && m))
48981        {
48982          /* More than one bit difference.  */
48983          fprintf (fp, "unknown");
48984          fclose (fp);
48985          return 2;
48986        }
48987      if (x)
48988        {
48989          k = j;
48990          m = x;
48991        }
48992    }
48993  if (m == 0)
48994    {
48995      /* No difference.  */
48996      fprintf (fp, "unknown");
48997      fclose (fp);
48998      return 3;
48999    }
49000  /* Now m = plus.word[k] ^ ~minus.word[k].  */
49001  if (plus.word[k] & ~minus.word[k])
49002    {
49003      /* Oh? The sign bit is set in the positive and cleared in the negative
49004         numbers?  */
49005      fprintf (fp, "unknown");
49006      fclose (fp);
49007      return 4;
49008    }
49009  for (i = 0; ; i++)
49010    if ((m >> i) & 1)
49011      break;
49012  fprintf (fp, "word %d bit %d", (int) k, (int) i);
49013  if (fclose (fp) != 0)
49014    return 5;
49015  return 0;
49016}
49017
49018_ACEOF
49019if ac_fn_c_try_run "$LINENO"; then :
49020  gl_cv_cc_long_double_signbit=`cat conftest.out`
49021else
49022  gl_cv_cc_long_double_signbit="unknown"
49023fi
49024rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
49025  conftest.$ac_objext conftest.beam conftest.$ac_ext
49026fi
49027
49028      rm -f conftest.out
49029
49030fi
49031{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_signbit" >&5
49032$as_echo "$gl_cv_cc_long_double_signbit" >&6; }
49033  case "$gl_cv_cc_long_double_signbit" in
49034    word*bit*)
49035      word=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
49036      bit=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word.*bit //'`
49037
49038cat >>confdefs.h <<_ACEOF
49039#define LDBL_SIGNBIT_WORD $word
49040_ACEOF
49041
49042
49043cat >>confdefs.h <<_ACEOF
49044#define LDBL_SIGNBIT_BIT $bit
49045_ACEOF
49046
49047      ;;
49048  esac
49049
49050
49051          if test "$gl_cv_cc_float_signbit" = unknown; then
49052                        ac_fn_c_check_decl "$LINENO" "copysignf" "ac_cv_have_decl_copysignf" "#include <math.h>
49053"
49054if test "x$ac_cv_have_decl_copysignf" = xyes; then :
49055  ac_have_decl=1
49056else
49057  ac_have_decl=0
49058fi
49059
49060cat >>confdefs.h <<_ACEOF
49061#define HAVE_DECL_COPYSIGNF $ac_have_decl
49062_ACEOF
49063
49064            if test "$ac_cv_have_decl_copysignf" = yes; then
49065                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignf can be used without linking with libm" >&5
49066$as_echo_n "checking whether copysignf can be used without linking with libm... " >&6; }
49067if ${gl_cv_func_copysignf_no_libm+:} false; then :
49068  $as_echo_n "(cached) " >&6
49069else
49070
49071                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49072/* end confdefs.h.  */
49073#include <math.h>
49074                         float x, y;
49075int
49076main ()
49077{
49078return copysignf (x, y) < 0;
49079  ;
49080  return 0;
49081}
49082_ACEOF
49083if ac_fn_c_try_link "$LINENO"; then :
49084  gl_cv_func_copysignf_no_libm=yes
49085else
49086  gl_cv_func_copysignf_no_libm=no
49087fi
49088rm -f core conftest.err conftest.$ac_objext \
49089    conftest$ac_exeext conftest.$ac_ext
49090
49091fi
49092{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignf_no_libm" >&5
49093$as_echo "$gl_cv_func_copysignf_no_libm" >&6; }
49094              if test $gl_cv_func_copysignf_no_libm = yes; then
49095
49096$as_echo "#define HAVE_COPYSIGNF_IN_LIBC 1" >>confdefs.h
49097
49098              fi
49099            fi
49100          fi
49101          if test "$gl_cv_cc_double_signbit" = unknown; then
49102                        ac_fn_c_check_decl "$LINENO" "copysign" "ac_cv_have_decl_copysign" "#include <math.h>
49103"
49104if test "x$ac_cv_have_decl_copysign" = xyes; then :
49105  ac_have_decl=1
49106else
49107  ac_have_decl=0
49108fi
49109
49110cat >>confdefs.h <<_ACEOF
49111#define HAVE_DECL_COPYSIGN $ac_have_decl
49112_ACEOF
49113
49114            if test "$ac_cv_have_decl_copysign" = yes; then
49115                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysign can be used without linking with libm" >&5
49116$as_echo_n "checking whether copysign can be used without linking with libm... " >&6; }
49117if ${gl_cv_func_copysign_no_libm+:} false; then :
49118  $as_echo_n "(cached) " >&6
49119else
49120
49121                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49122/* end confdefs.h.  */
49123#include <math.h>
49124                         double x, y;
49125int
49126main ()
49127{
49128return copysign (x, y) < 0;
49129  ;
49130  return 0;
49131}
49132_ACEOF
49133if ac_fn_c_try_link "$LINENO"; then :
49134  gl_cv_func_copysign_no_libm=yes
49135else
49136  gl_cv_func_copysign_no_libm=no
49137fi
49138rm -f core conftest.err conftest.$ac_objext \
49139    conftest$ac_exeext conftest.$ac_ext
49140
49141fi
49142{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysign_no_libm" >&5
49143$as_echo "$gl_cv_func_copysign_no_libm" >&6; }
49144              if test $gl_cv_func_copysign_no_libm = yes; then
49145
49146$as_echo "#define HAVE_COPYSIGN_IN_LIBC 1" >>confdefs.h
49147
49148              fi
49149            fi
49150          fi
49151          if test "$gl_cv_cc_long_double_signbit" = unknown; then
49152                        ac_fn_c_check_decl "$LINENO" "copysignl" "ac_cv_have_decl_copysignl" "#include <math.h>
49153"
49154if test "x$ac_cv_have_decl_copysignl" = xyes; then :
49155  ac_have_decl=1
49156else
49157  ac_have_decl=0
49158fi
49159
49160cat >>confdefs.h <<_ACEOF
49161#define HAVE_DECL_COPYSIGNL $ac_have_decl
49162_ACEOF
49163
49164            if test "$ac_cv_have_decl_copysignl" = yes; then
49165                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignl can be used without linking with libm" >&5
49166$as_echo_n "checking whether copysignl can be used without linking with libm... " >&6; }
49167if ${gl_cv_func_copysignl_no_libm+:} false; then :
49168  $as_echo_n "(cached) " >&6
49169else
49170
49171                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49172/* end confdefs.h.  */
49173#include <math.h>
49174                         long double x, y;
49175int
49176main ()
49177{
49178return copysignl (x, y) < 0;
49179  ;
49180  return 0;
49181}
49182_ACEOF
49183if ac_fn_c_try_link "$LINENO"; then :
49184  gl_cv_func_copysignl_no_libm=yes
49185else
49186  gl_cv_func_copysignl_no_libm=no
49187fi
49188rm -f core conftest.err conftest.$ac_objext \
49189    conftest$ac_exeext conftest.$ac_ext
49190
49191fi
49192{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignl_no_libm" >&5
49193$as_echo "$gl_cv_func_copysignl_no_libm" >&6; }
49194              if test $gl_cv_func_copysignl_no_libm = yes; then
49195
49196$as_echo "#define HAVE_COPYSIGNL_IN_LIBC 1" >>confdefs.h
49197
49198              fi
49199            fi
49200          fi
49201          ;;
49202      esac
49203      ;;
49204  esac
49205
49206  if test $REPLACE_SIGNBIT = 1; then
49207
49208
49209
49210
49211
49212
49213
49214
49215  gl_LIBOBJS="$gl_LIBOBJS signbitf.$ac_objext"
49216
49217
49218
49219
49220
49221
49222
49223
49224
49225  gl_LIBOBJS="$gl_LIBOBJS signbitd.$ac_objext"
49226
49227
49228
49229
49230
49231
49232
49233
49234
49235  gl_LIBOBJS="$gl_LIBOBJS signbitl.$ac_objext"
49236
49237  fi
49238
49239
49240
49241
49242
49243          GNULIB_SIGNBIT=1
49244
49245
49246
49247
49248
49249$as_echo "#define GNULIB_TEST_SIGNBIT 1" >>confdefs.h
49250
49251
49252
49253
49254
49255
49256  if test $gl_cv_type_sigset_t = yes; then
49257    ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
49258if test "x$ac_cv_func_sigprocmask" = xyes; then :
49259  gl_cv_func_sigprocmask=1
49260fi
49261
49262  fi
49263  if test -z "$gl_cv_func_sigprocmask"; then
49264    HAVE_POSIX_SIGNALBLOCKING=0
49265  fi
49266
49267  if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
49268
49269
49270
49271
49272
49273
49274
49275
49276  gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext"
49277
49278    :
49279  fi
49280
49281
49282
49283
49284
49285          GNULIB_SIGPROCMASK=1
49286
49287
49288
49289
49290
49291$as_echo "#define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h
49292
49293
49294
49295
49296  for ac_header in stdint.h
49297do :
49298  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
49299if test "x$ac_cv_header_stdint_h" = xyes; then :
49300  cat >>confdefs.h <<_ACEOF
49301#define HAVE_STDINT_H 1
49302_ACEOF
49303
49304fi
49305
49306done
49307
49308    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5
49309$as_echo_n "checking for SIZE_MAX... " >&6; }
49310if ${gl_cv_size_max+:} false; then :
49311  $as_echo_n "(cached) " >&6
49312else
49313
49314    gl_cv_size_max=
49315    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49316/* end confdefs.h.  */
49317
49318#include <limits.h>
49319#if HAVE_STDINT_H
49320#include <stdint.h>
49321#endif
49322#ifdef SIZE_MAX
49323Found it
49324#endif
49325
49326_ACEOF
49327if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
49328  $EGREP "Found it" >/dev/null 2>&1; then :
49329  gl_cv_size_max=yes
49330fi
49331rm -f conftest*
49332
49333    if test -z "$gl_cv_size_max"; then
49334                        if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1"        "#include <stddef.h>
49335#include <limits.h>"; then :
49336
49337else
49338  size_t_bits_minus_1=
49339fi
49340
49341      if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint"        "#include <stddef.h>"; then :
49342
49343else
49344  fits_in_uint=
49345fi
49346
49347      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
49348        if test $fits_in_uint = 1; then
49349                              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49350/* end confdefs.h.  */
49351#include <stddef.h>
49352                 extern size_t foo;
49353                 extern unsigned long foo;
49354
49355int
49356main ()
49357{
49358
49359  ;
49360  return 0;
49361}
49362_ACEOF
49363if ac_fn_c_try_compile "$LINENO"; then :
49364  fits_in_uint=0
49365fi
49366rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49367        fi
49368                                if test $fits_in_uint = 1; then
49369          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
49370        else
49371          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
49372        fi
49373      else
49374                gl_cv_size_max='((size_t)~(size_t)0)'
49375      fi
49376    fi
49377
49378fi
49379{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5
49380$as_echo "$gl_cv_size_max" >&6; }
49381  if test "$gl_cv_size_max" != yes; then
49382
49383cat >>confdefs.h <<_ACEOF
49384#define SIZE_MAX $gl_cv_size_max
49385_ACEOF
49386
49387  fi
49388
49389
49390  # Check whether libsmack is available
49391  LIB_SMACK=
49392  # Check whether --enable-libsmack was given.
49393if test "${enable_libsmack+set}" = set; then :
49394  enableval=$enable_libsmack;
49395fi
49396
49397  if test "X$enable_libsmack" != "Xno"; then
49398    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for smack_new_label_from_self in -lsmack" >&5
49399$as_echo_n "checking for smack_new_label_from_self in -lsmack... " >&6; }
49400if ${ac_cv_lib_smack_smack_new_label_from_self+:} false; then :
49401  $as_echo_n "(cached) " >&6
49402else
49403  ac_check_lib_save_LIBS=$LIBS
49404LIBS="-lsmack  $LIBS"
49405cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49406/* end confdefs.h.  */
49407
49408/* Override any GCC internal prototype to avoid an error.
49409   Use char because int might match the return type of a GCC
49410   builtin and then its argument prototype would still apply.  */
49411#ifdef __cplusplus
49412extern "C"
49413#endif
49414char smack_new_label_from_self ();
49415int
49416main ()
49417{
49418return smack_new_label_from_self ();
49419  ;
49420  return 0;
49421}
49422_ACEOF
49423if ac_fn_c_try_link "$LINENO"; then :
49424  ac_cv_lib_smack_smack_new_label_from_self=yes
49425else
49426  ac_cv_lib_smack_smack_new_label_from_self=no
49427fi
49428rm -f core conftest.err conftest.$ac_objext \
49429    conftest$ac_exeext conftest.$ac_ext
49430LIBS=$ac_check_lib_save_LIBS
49431fi
49432{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smack_smack_new_label_from_self" >&5
49433$as_echo "$ac_cv_lib_smack_smack_new_label_from_self" >&6; }
49434if test "x$ac_cv_lib_smack_smack_new_label_from_self" = xyes; then :
49435  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for smack_new_label_from_path in -lsmack" >&5
49436$as_echo_n "checking for smack_new_label_from_path in -lsmack... " >&6; }
49437if ${ac_cv_lib_smack_smack_new_label_from_path+:} false; then :
49438  $as_echo_n "(cached) " >&6
49439else
49440  ac_check_lib_save_LIBS=$LIBS
49441LIBS="-lsmack  $LIBS"
49442cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49443/* end confdefs.h.  */
49444
49445/* Override any GCC internal prototype to avoid an error.
49446   Use char because int might match the return type of a GCC
49447   builtin and then its argument prototype would still apply.  */
49448#ifdef __cplusplus
49449extern "C"
49450#endif
49451char smack_new_label_from_path ();
49452int
49453main ()
49454{
49455return smack_new_label_from_path ();
49456  ;
49457  return 0;
49458}
49459_ACEOF
49460if ac_fn_c_try_link "$LINENO"; then :
49461  ac_cv_lib_smack_smack_new_label_from_path=yes
49462else
49463  ac_cv_lib_smack_smack_new_label_from_path=no
49464fi
49465rm -f core conftest.err conftest.$ac_objext \
49466    conftest$ac_exeext conftest.$ac_ext
49467LIBS=$ac_check_lib_save_LIBS
49468fi
49469{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smack_smack_new_label_from_path" >&5
49470$as_echo "$ac_cv_lib_smack_smack_new_label_from_path" >&6; }
49471if test "x$ac_cv_lib_smack_smack_new_label_from_path" = xyes; then :
49472  ac_fn_c_check_header_mongrel "$LINENO" "sys/smack.h" "ac_cv_header_sys_smack_h" "$ac_includes_default"
49473if test "x$ac_cv_header_sys_smack_h" = xyes; then :
49474  LIB_SMACK=-lsmack
49475
49476$as_echo "#define HAVE_SMACK 1" >>confdefs.h
49477
49478
49479fi
49480
49481
49482fi
49483
49484fi
49485
49486    if test "X$LIB_SMACK" = "X"; then
49487      if test "X$enable_libsmack" = "Xyes"; then
49488        as_fn_error $? "libsmack library was not found or not usable" "$LINENO" 5
49489      fi
49490    fi
49491  else
49492    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libsmack support disabled by user" >&5
49493$as_echo "$as_me: WARNING: libsmack support disabled by user" >&2;}
49494  fi
49495
49496
49497
49498  gl_cv_func_snprintf_usable=no
49499  for ac_func in snprintf
49500do :
49501  ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
49502if test "x$ac_cv_func_snprintf" = xyes; then :
49503  cat >>confdefs.h <<_ACEOF
49504#define HAVE_SNPRINTF 1
49505_ACEOF
49506
49507fi
49508done
49509
49510  if test $ac_cv_func_snprintf = yes; then
49511
49512
49513
49514  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5
49515$as_echo_n "checking whether snprintf respects a size of 1... " >&6; }
49516if ${gl_cv_func_snprintf_size1+:} false; then :
49517  $as_echo_n "(cached) " >&6
49518else
49519
49520      if test "$cross_compiling" = yes; then :
49521  case "$host_os" in
49522                   # Guess yes on native Windows.
49523           mingw*) gl_cv_func_snprintf_size1="guessing yes" ;;
49524           *)      gl_cv_func_snprintf_size1="guessing yes" ;;
49525         esac
49526
49527else
49528  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49529/* end confdefs.h.  */
49530
49531#include <stdio.h>
49532#if HAVE_SNPRINTF
49533# define my_snprintf snprintf
49534#else
49535# include <stdarg.h>
49536static int my_snprintf (char *buf, int size, const char *format, ...)
49537{
49538  va_list args;
49539  int ret;
49540  va_start (args, format);
49541  ret = vsnprintf (buf, size, format, args);
49542  va_end (args);
49543  return ret;
49544}
49545#endif
49546int main()
49547{
49548  static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
49549  my_snprintf (buf, 1, "%d", 12345);
49550  return buf[1] != 'E';
49551}
49552_ACEOF
49553if ac_fn_c_try_run "$LINENO"; then :
49554  gl_cv_func_snprintf_size1=yes
49555else
49556  gl_cv_func_snprintf_size1=no
49557fi
49558rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
49559  conftest.$ac_objext conftest.beam conftest.$ac_ext
49560fi
49561
49562
49563fi
49564{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5
49565$as_echo "$gl_cv_func_snprintf_size1" >&6; }
49566
49567    case "$gl_cv_func_snprintf_size1" in
49568      *yes)
49569
49570        case "$gl_cv_func_snprintf_retval_c99" in
49571          *yes)
49572
49573
49574     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5
49575$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; }
49576if ${gl_cv_func_printf_positions+:} false; then :
49577  $as_echo_n "(cached) " >&6
49578else
49579
49580      if test "$cross_compiling" = yes; then :
49581
49582         case "$host_os" in
49583           netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
49584                         gl_cv_func_printf_positions="guessing no";;
49585           beos*)        gl_cv_func_printf_positions="guessing no";;
49586                         # Guess no on native Windows.
49587           mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
49588           *)            gl_cv_func_printf_positions="guessing yes";;
49589         esac
49590
49591else
49592  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49593/* end confdefs.h.  */
49594
49595#include <stdio.h>
49596#include <string.h>
49597/* The string "%2$d %1$d", with dollar characters protected from the shell's
49598   dollar expansion (possibly an autoconf bug).  */
49599static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
49600static char buf[100];
49601int main ()
49602{
49603  sprintf (buf, format, 33, 55);
49604  return (strcmp (buf, "55 33") != 0);
49605}
49606_ACEOF
49607if ac_fn_c_try_run "$LINENO"; then :
49608  gl_cv_func_printf_positions=yes
49609else
49610  gl_cv_func_printf_positions=no
49611fi
49612rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
49613  conftest.$ac_objext conftest.beam conftest.$ac_ext
49614fi
49615
49616
49617fi
49618{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5
49619$as_echo "$gl_cv_func_printf_positions" >&6; }
49620
49621            case "$gl_cv_func_printf_positions" in
49622              *yes)
49623                gl_cv_func_snprintf_usable=yes
49624                ;;
49625            esac
49626            ;;
49627        esac
49628        ;;
49629    esac
49630  fi
49631  if test $gl_cv_func_snprintf_usable = no; then
49632
49633
49634
49635
49636
49637
49638
49639
49640
49641
49642  gl_LIBOBJS="$gl_LIBOBJS snprintf.$ac_objext"
49643
49644  if test $ac_cv_func_snprintf = yes; then
49645    REPLACE_SNPRINTF=1
49646  else
49647
49648    if test $ac_cv_have_decl_snprintf = yes; then
49649                        REPLACE_SNPRINTF=1
49650    fi
49651  fi
49652  :
49653
49654  fi
49655
49656  if test $ac_cv_have_decl_snprintf = no; then
49657    HAVE_DECL_SNPRINTF=0
49658  fi
49659
49660
49661
49662
49663
49664
49665          GNULIB_SNPRINTF=1
49666
49667
49668
49669
49670
49671$as_echo "#define GNULIB_TEST_SNPRINTF 1" >>confdefs.h
49672
49673
49674
49675
49676
49677cat >>confdefs.h <<_ACEOF
49678#define GNULIB_SNPRINTF 1
49679_ACEOF
49680
49681
49682
49683
49684     ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
49685/* <sys/types.h> is not needed according to POSIX, but the
49686   <sys/socket.h> in i386-unknown-freebsd4.10 and
49687   powerpc-apple-darwin5.5 required it. */
49688#include <sys/types.h>
49689#if HAVE_SYS_SOCKET_H
49690# include <sys/socket.h>
49691#elif HAVE_WS2TCPIP_H
49692# include <ws2tcpip.h>
49693#endif
49694
49695"
49696if test "x$ac_cv_type_socklen_t" = xyes; then :
49697
49698else
49699  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
49700$as_echo_n "checking for socklen_t equivalent... " >&6; }
49701      if ${gl_cv_socklen_t_equiv+:} false; then :
49702  $as_echo_n "(cached) " >&6
49703else
49704  # Systems have either "struct sockaddr *" or
49705         # "void *" as the second argument to getpeername
49706         gl_cv_socklen_t_equiv=
49707         for arg2 in "struct sockaddr" void; do
49708           for t in int size_t "unsigned int" "long int" "unsigned long int"; do
49709             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49710/* end confdefs.h.  */
49711#include <sys/types.h>
49712                   #include <sys/socket.h>
49713
49714                   int getpeername (int, $arg2 *, $t *);
49715int
49716main ()
49717{
49718$t len;
49719                  getpeername (0, 0, &len);
49720  ;
49721  return 0;
49722}
49723_ACEOF
49724if ac_fn_c_try_compile "$LINENO"; then :
49725  gl_cv_socklen_t_equiv="$t"
49726fi
49727rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49728             test "$gl_cv_socklen_t_equiv" != "" && break
49729           done
49730           test "$gl_cv_socklen_t_equiv" != "" && break
49731         done
49732
49733fi
49734
49735      if test "$gl_cv_socklen_t_equiv" = ""; then
49736        as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
49737      fi
49738      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
49739$as_echo "$gl_cv_socklen_t_equiv" >&6; }
49740
49741cat >>confdefs.h <<_ACEOF
49742#define socklen_t $gl_cv_socklen_t_equiv
49743_ACEOF
49744
49745fi
49746
49747
49748  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
49749$as_echo_n "checking for ssize_t... " >&6; }
49750if ${gt_cv_ssize_t+:} false; then :
49751  $as_echo_n "(cached) " >&6
49752else
49753  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49754/* end confdefs.h.  */
49755#include <sys/types.h>
49756int
49757main ()
49758{
49759int x = sizeof (ssize_t *) + sizeof (ssize_t);
49760            return !x;
49761  ;
49762  return 0;
49763}
49764_ACEOF
49765if ac_fn_c_try_compile "$LINENO"; then :
49766  gt_cv_ssize_t=yes
49767else
49768  gt_cv_ssize_t=no
49769fi
49770rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49771fi
49772{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
49773$as_echo "$gt_cv_ssize_t" >&6; }
49774  if test $gt_cv_ssize_t = no; then
49775
49776$as_echo "#define ssize_t int" >>confdefs.h
49777
49778  fi
49779
49780
49781
49782
49783
49784  case "$host_os" in
49785    mingw*)
49786                  REPLACE_STAT=1
49787      ;;
49788    *)
49789                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
49790$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
49791if ${gl_cv_func_stat_file_slash+:} false; then :
49792  $as_echo_n "(cached) " >&6
49793else
49794  touch conftest.tmp
49795         # Assume that if we have lstat, we can also check symlinks.
49796         if test $ac_cv_func_lstat = yes; then
49797           ln -s conftest.tmp conftest.lnk
49798         fi
49799         if test "$cross_compiling" = yes; then :
49800  case "$host_os" in
49801                               # Guess yes on Linux systems.
49802              linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
49803                               # Guess yes on glibc systems.
49804              *-gnu* | gnu*)   gl_cv_func_stat_file_slash="guessing yes" ;;
49805                               # If we don't know, assume the worst.
49806              *)               gl_cv_func_stat_file_slash="guessing no" ;;
49807            esac
49808
49809else
49810  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49811/* end confdefs.h.  */
49812#include <sys/stat.h>
49813
49814int
49815main ()
49816{
49817int result = 0;
49818               struct stat st;
49819               if (!stat ("conftest.tmp/", &st))
49820                 result |= 1;
49821#if HAVE_LSTAT
49822               if (!stat ("conftest.lnk/", &st))
49823                 result |= 2;
49824#endif
49825               return result;
49826
49827  ;
49828  return 0;
49829}
49830_ACEOF
49831if ac_fn_c_try_run "$LINENO"; then :
49832  gl_cv_func_stat_file_slash=yes
49833else
49834  gl_cv_func_stat_file_slash=no
49835fi
49836rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
49837  conftest.$ac_objext conftest.beam conftest.$ac_ext
49838fi
49839
49840         rm -f conftest.tmp conftest.lnk
49841fi
49842{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
49843$as_echo "$gl_cv_func_stat_file_slash" >&6; }
49844      case $gl_cv_func_stat_file_slash in
49845        *no)
49846          REPLACE_STAT=1
49847
49848$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
49849;;
49850      esac
49851      case $host_os in
49852                solaris*)
49853          REPLACE_FSTAT=1 ;;
49854      esac
49855      ;;
49856  esac
49857
49858  if test $REPLACE_STAT = 1; then
49859
49860
49861
49862
49863
49864
49865
49866
49867  gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
49868
49869    case "$host_os" in
49870      mingw*)
49871
49872
49873
49874
49875
49876
49877
49878
49879  gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
49880
49881        ;;
49882    esac
49883
49884
49885  :
49886
49887  fi
49888
49889
49890
49891
49892
49893          GNULIB_STAT=1
49894
49895
49896
49897
49898
49899$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
49900
49901
49902
49903
49904  # Don't call AC_STRUCT_ST_BLOCKS because it causes bugs.  Details at
49905  # https://lists.gnu.org/r/bug-gnulib/2011-06/msg00051.html
49906
49907
49908
49909
49910
49911
49912  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>
49913     #include <sys/stat.h>
49914"
49915if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
49916
49917cat >>confdefs.h <<_ACEOF
49918#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
49919_ACEOF
49920
49921{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
49922$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
49923if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
49924  $as_echo_n "(cached) " >&6
49925else
49926  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49927/* end confdefs.h.  */
49928
49929            #include <sys/types.h>
49930            #include <sys/stat.h>
49931            #if HAVE_SYS_TIME_H
49932            # include <sys/time.h>
49933            #endif
49934            #include <time.h>
49935            struct timespec ts;
49936            struct stat st;
49937
49938int
49939main ()
49940{
49941
49942            st.st_atim = ts;
49943
49944  ;
49945  return 0;
49946}
49947_ACEOF
49948if ac_fn_c_try_compile "$LINENO"; then :
49949  ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
49950else
49951  ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
49952fi
49953rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49954fi
49955{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
49956$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
49957     if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
49958
49959$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
49960
49961     fi
49962else
49963  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>
49964        #include <sys/stat.h>
49965"
49966if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
49967
49968cat >>confdefs.h <<_ACEOF
49969#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
49970_ACEOF
49971
49972
49973else
49974  ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
49975           #include <sys/stat.h>
49976"
49977if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
49978
49979cat >>confdefs.h <<_ACEOF
49980#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
49981_ACEOF
49982
49983
49984else
49985  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>
49986              #include <sys/stat.h>
49987"
49988if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
49989
49990cat >>confdefs.h <<_ACEOF
49991#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
49992_ACEOF
49993
49994
49995fi
49996
49997fi
49998
49999fi
50000
50001fi
50002
50003
50004
50005
50006
50007  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>
50008     #include <sys/stat.h>
50009"
50010if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then :
50011
50012cat >>confdefs.h <<_ACEOF
50013#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
50014_ACEOF
50015
50016
50017else
50018  ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
50019        #include <sys/stat.h>
50020"
50021if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then :
50022
50023cat >>confdefs.h <<_ACEOF
50024#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
50025_ACEOF
50026
50027
50028else
50029  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>
50030          #include <sys/stat.h>
50031"
50032if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then :
50033
50034cat >>confdefs.h <<_ACEOF
50035#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
50036_ACEOF
50037
50038
50039fi
50040
50041fi
50042
50043fi
50044
50045
50046
50047
50048cat >>confdefs.h <<_ACEOF
50049#define GNULIB_STATAT 1
50050_ACEOF
50051
50052
50053  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
50054$as_echo_n "checking for working stdalign.h... " >&6; }
50055if ${gl_cv_header_working_stdalign_h+:} false; then :
50056  $as_echo_n "(cached) " >&6
50057else
50058  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50059/* end confdefs.h.  */
50060#include <stdalign.h>
50061            #include <stddef.h>
50062
50063            /* Test that alignof yields a result consistent with offsetof.
50064               This catches GCC bug 52023
50065               <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.  */
50066            #ifdef __cplusplus
50067               template <class t> struct alignof_helper { char a; t b; };
50068            # define ao(type) offsetof (alignof_helper<type>, b)
50069            #else
50070            # define ao(type) offsetof (struct { char a; type b; }, b)
50071            #endif
50072            char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
50073            char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
50074            char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
50075
50076            /* Test _Alignas only on platforms where gnulib can help.  */
50077            #if \
50078                ((defined __cplusplus && 201103 <= __cplusplus) \
50079                 || (defined __APPLE__ && defined __MACH__ \
50080                     ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
50081                     : __GNUC__) \
50082                 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
50083                 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
50084                 || 1300 <= _MSC_VER)
50085              struct alignas_test { char c; char alignas (8) alignas_8; };
50086              char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
50087                                ? 1 : -1];
50088            #endif
50089
50090int
50091main ()
50092{
50093
50094  ;
50095  return 0;
50096}
50097_ACEOF
50098if ac_fn_c_try_compile "$LINENO"; then :
50099  gl_cv_header_working_stdalign_h=yes
50100else
50101  gl_cv_header_working_stdalign_h=no
50102fi
50103rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50104fi
50105{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
50106$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
50107
50108  if test $gl_cv_header_working_stdalign_h = yes; then
50109    STDALIGN_H=''
50110  else
50111    STDALIGN_H='stdalign.h'
50112  fi
50113
50114
50115   if test -n "$STDALIGN_H"; then
50116  GL_GENERATE_STDALIGN_H_TRUE=
50117  GL_GENERATE_STDALIGN_H_FALSE='#'
50118else
50119  GL_GENERATE_STDALIGN_H_TRUE='#'
50120  GL_GENERATE_STDALIGN_H_FALSE=
50121fi
50122
50123
50124
50125  STDARG_H=''
50126  NEXT_STDARG_H='<stdarg.h>'
50127  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5
50128$as_echo_n "checking for va_copy... " >&6; }
50129  if ${gl_cv_func_va_copy+:} false; then :
50130  $as_echo_n "(cached) " >&6
50131else
50132
50133    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50134/* end confdefs.h.  */
50135#include <stdarg.h>
50136int
50137main ()
50138{
50139
50140#ifndef va_copy
50141void (*func) (va_list, va_list) = va_copy;
50142#endif
50143
50144  ;
50145  return 0;
50146}
50147_ACEOF
50148if ac_fn_c_try_compile "$LINENO"; then :
50149  gl_cv_func_va_copy=yes
50150else
50151  gl_cv_func_va_copy=no
50152fi
50153rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50154fi
50155
50156  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5
50157$as_echo "$gl_cv_func_va_copy" >&6; }
50158  if test $gl_cv_func_va_copy = no; then
50159                                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50160/* end confdefs.h.  */
50161#if defined _AIX && !defined __GNUC__
50162        AIX vaccine
50163       #endif
50164
50165_ACEOF
50166if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
50167  $EGREP "vaccine" >/dev/null 2>&1; then :
50168  gl_aixcc=yes
50169else
50170  gl_aixcc=no
50171fi
50172rm -f conftest*
50173
50174    if test $gl_aixcc = yes; then
50175            STDARG_H=stdarg.h
50176
50177
50178
50179
50180
50181
50182
50183
50184     if test $gl_cv_have_include_next = yes; then
50185       gl_cv_next_stdarg_h='<'stdarg.h'>'
50186     else
50187       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdarg.h>" >&5
50188$as_echo_n "checking absolute name of <stdarg.h>... " >&6; }
50189if ${gl_cv_next_stdarg_h+:} false; then :
50190  $as_echo_n "(cached) " >&6
50191else
50192
50193
50194
50195  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50196/* end confdefs.h.  */
50197#include <stdarg.h>
50198_ACEOF
50199                case "$host_os" in
50200    aix*) gl_absname_cpp="$ac_cpp -C" ;;
50201    *)    gl_absname_cpp="$ac_cpp" ;;
50202  esac
50203
50204  case "$host_os" in
50205    mingw*)
50206                                          gl_dirsep_regex='[/\\]'
50207      ;;
50208    *)
50209      gl_dirsep_regex='\/'
50210      ;;
50211  esac
50212      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
50213  gl_header_literal_regex=`echo 'stdarg.h' \
50214                           | sed -e "$gl_make_literal_regex_sed"`
50215  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
50216      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
50217      s|^/[^/]|//&|
50218      p
50219      q
50220    }'
50221
50222        gl_cv_absolute_stdarg_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
50223  sed -n "$gl_absolute_header_sed"`
50224
50225           gl_header=$gl_cv_absolute_stdarg_h
50226           gl_cv_next_stdarg_h='"'$gl_header'"'
50227
50228
50229fi
50230{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5
50231$as_echo "$gl_cv_next_stdarg_h" >&6; }
50232     fi
50233     NEXT_STDARG_H=$gl_cv_next_stdarg_h
50234
50235     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
50236       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
50237       gl_next_as_first_directive='<'stdarg.h'>'
50238     else
50239       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
50240       gl_next_as_first_directive=$gl_cv_next_stdarg_h
50241     fi
50242     NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive
50243
50244
50245
50246
50247            if test "$gl_cv_next_stdarg_h" = '""'; then
50248        gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
50249        NEXT_STDARG_H="$gl_cv_next_stdarg_h"
50250      fi
50251    else
50252
50253  saved_as_echo_n="$as_echo_n"
50254  as_echo_n=':'
50255  if ${gl_cv_func___va_copy+:} false; then :
50256  $as_echo_n "(cached) " >&6
50257else
50258
50259        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50260/* end confdefs.h.  */
50261#include <stdarg.h>
50262int
50263main ()
50264{
50265
50266#ifndef __va_copy
50267error, bail out
50268#endif
50269
50270  ;
50271  return 0;
50272}
50273_ACEOF
50274if ac_fn_c_try_compile "$LINENO"; then :
50275  gl_cv_func___va_copy=yes
50276else
50277  gl_cv_func___va_copy=no
50278fi
50279rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50280fi
50281
50282  as_echo_n="$saved_as_echo_n"
50283
50284      if test $gl_cv_func___va_copy = yes; then
50285
50286$as_echo "#define va_copy __va_copy" >>confdefs.h
50287
50288      else
50289
50290
50291$as_echo "#define va_copy gl_va_copy" >>confdefs.h
50292
50293      fi
50294    fi
50295  fi
50296
50297   if test -n "$STDARG_H"; then
50298  GL_GENERATE_STDARG_H_TRUE=
50299  GL_GENERATE_STDARG_H_FALSE='#'
50300else
50301  GL_GENERATE_STDARG_H_TRUE='#'
50302  GL_GENERATE_STDARG_H_FALSE=
50303fi
50304
50305
50306
50307
50308
50309
50310  # Define two additional variables used in the Makefile substitution.
50311
50312  if test "$ac_cv_header_stdbool_h" = yes; then
50313    STDBOOL_H=''
50314  else
50315    STDBOOL_H='stdbool.h'
50316  fi
50317
50318   if test -n "$STDBOOL_H"; then
50319  GL_GENERATE_STDBOOL_H_TRUE=
50320  GL_GENERATE_STDBOOL_H_FALSE='#'
50321else
50322  GL_GENERATE_STDBOOL_H_TRUE='#'
50323  GL_GENERATE_STDBOOL_H_FALSE=
50324fi
50325
50326
50327  if test "$ac_cv_type__Bool" = yes; then
50328    HAVE__BOOL=1
50329  else
50330    HAVE__BOOL=0
50331  fi
50332
50333
50334
50335
50336
50337  STDDEF_H=
50338  ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h>
50339
50340"
50341if test "x$ac_cv_type_max_align_t" = xyes; then :
50342
50343else
50344  HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h
50345fi
50346
50347  if test $gt_cv_c_wchar_t = no; then
50348    HAVE_WCHAR_T=0
50349    STDDEF_H=stddef.h
50350  fi
50351  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
50352$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
50353if ${gl_cv_decl_null_works+:} false; then :
50354  $as_echo_n "(cached) " >&6
50355else
50356  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50357/* end confdefs.h.  */
50358#include <stddef.h>
50359      int test[2 * (sizeof NULL == sizeof (void *)) -1];
50360
50361int
50362main ()
50363{
50364
50365  ;
50366  return 0;
50367}
50368_ACEOF
50369if ac_fn_c_try_compile "$LINENO"; then :
50370  gl_cv_decl_null_works=yes
50371else
50372  gl_cv_decl_null_works=no
50373fi
50374rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50375fi
50376{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
50377$as_echo "$gl_cv_decl_null_works" >&6; }
50378  if test $gl_cv_decl_null_works = no; then
50379    REPLACE_NULL=1
50380    STDDEF_H=stddef.h
50381  fi
50382
50383   if test -n "$STDDEF_H"; then
50384  GL_GENERATE_STDDEF_H_TRUE=
50385  GL_GENERATE_STDDEF_H_FALSE='#'
50386else
50387  GL_GENERATE_STDDEF_H_TRUE='#'
50388  GL_GENERATE_STDDEF_H_FALSE=
50389fi
50390
50391  if test -n "$STDDEF_H"; then
50392
50393
50394
50395
50396
50397
50398
50399
50400     if test $gl_cv_have_include_next = yes; then
50401       gl_cv_next_stddef_h='<'stddef.h'>'
50402     else
50403       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
50404$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
50405if ${gl_cv_next_stddef_h+:} false; then :
50406  $as_echo_n "(cached) " >&6
50407else
50408
50409
50410
50411  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50412/* end confdefs.h.  */
50413#include <stddef.h>
50414_ACEOF
50415                case "$host_os" in
50416    aix*) gl_absname_cpp="$ac_cpp -C" ;;
50417    *)    gl_absname_cpp="$ac_cpp" ;;
50418  esac
50419
50420  case "$host_os" in
50421    mingw*)
50422                                          gl_dirsep_regex='[/\\]'
50423      ;;
50424    *)
50425      gl_dirsep_regex='\/'
50426      ;;
50427  esac
50428      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
50429  gl_header_literal_regex=`echo 'stddef.h' \
50430                           | sed -e "$gl_make_literal_regex_sed"`
50431  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
50432      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
50433      s|^/[^/]|//&|
50434      p
50435      q
50436    }'
50437
50438        gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
50439  sed -n "$gl_absolute_header_sed"`
50440
50441           gl_header=$gl_cv_absolute_stddef_h
50442           gl_cv_next_stddef_h='"'$gl_header'"'
50443
50444
50445fi
50446{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
50447$as_echo "$gl_cv_next_stddef_h" >&6; }
50448     fi
50449     NEXT_STDDEF_H=$gl_cv_next_stddef_h
50450
50451     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
50452       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
50453       gl_next_as_first_directive='<'stddef.h'>'
50454     else
50455       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
50456       gl_next_as_first_directive=$gl_cv_next_stddef_h
50457     fi
50458     NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
50459
50460
50461
50462
50463  fi
50464
50465
50466
50467
50468  $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
50469
50470
50471
50472
50473
50474
50475
50476
50477
50478
50479     if test $gl_cv_have_include_next = yes; then
50480       gl_cv_next_stdio_h='<'stdio.h'>'
50481     else
50482       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
50483$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
50484if ${gl_cv_next_stdio_h+:} false; then :
50485  $as_echo_n "(cached) " >&6
50486else
50487
50488
50489
50490  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50491/* end confdefs.h.  */
50492#include <stdio.h>
50493_ACEOF
50494                case "$host_os" in
50495    aix*) gl_absname_cpp="$ac_cpp -C" ;;
50496    *)    gl_absname_cpp="$ac_cpp" ;;
50497  esac
50498
50499  case "$host_os" in
50500    mingw*)
50501                                          gl_dirsep_regex='[/\\]'
50502      ;;
50503    *)
50504      gl_dirsep_regex='\/'
50505      ;;
50506  esac
50507      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
50508  gl_header_literal_regex=`echo 'stdio.h' \
50509                           | sed -e "$gl_make_literal_regex_sed"`
50510  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
50511      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
50512      s|^/[^/]|//&|
50513      p
50514      q
50515    }'
50516
50517        gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
50518  sed -n "$gl_absolute_header_sed"`
50519
50520           gl_header=$gl_cv_absolute_stdio_h
50521           gl_cv_next_stdio_h='"'$gl_header'"'
50522
50523
50524fi
50525{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
50526$as_echo "$gl_cv_next_stdio_h" >&6; }
50527     fi
50528     NEXT_STDIO_H=$gl_cv_next_stdio_h
50529
50530     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
50531       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
50532       gl_next_as_first_directive='<'stdio.h'>'
50533     else
50534       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
50535       gl_next_as_first_directive=$gl_cv_next_stdio_h
50536     fi
50537     NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
50538
50539
50540
50541
50542
50543        { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
50544$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; }
50545if ${gl_cv_func_printf_attribute_flavor+:} false; then :
50546  $as_echo_n "(cached) " >&6
50547else
50548  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50549/* end confdefs.h.  */
50550
50551       #define __STDC_FORMAT_MACROS 1
50552       #include <stdio.h>
50553       #include <inttypes.h>
50554       /* For non-mingw systems, compilation will trivially succeed.
50555          For mingw, compilation will succeed for older mingw (system
50556          printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
50557       #if (defined _WIN32 && ! defined __CYGWIN__) && \
50558         (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
50559       extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
50560       #endif
50561
50562int
50563main ()
50564{
50565
50566  ;
50567  return 0;
50568}
50569_ACEOF
50570if ac_fn_c_try_compile "$LINENO"; then :
50571  gl_cv_func_printf_attribute_flavor=system
50572else
50573  gl_cv_func_printf_attribute_flavor=gnu
50574fi
50575rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50576fi
50577{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
50578$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; }
50579  if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
50580
50581$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
50582
50583  fi
50584
50585      GNULIB_FSCANF=1
50586
50587
50588cat >>confdefs.h <<_ACEOF
50589#define GNULIB_FSCANF 1
50590_ACEOF
50591
50592
50593  GNULIB_SCANF=1
50594
50595
50596cat >>confdefs.h <<_ACEOF
50597#define GNULIB_SCANF 1
50598_ACEOF
50599
50600
50601  GNULIB_FGETC=1
50602  GNULIB_GETC=1
50603  GNULIB_GETCHAR=1
50604  GNULIB_FGETS=1
50605  GNULIB_FREAD=1
50606
50607
50608      GNULIB_FPRINTF=1
50609  GNULIB_PRINTF=1
50610  GNULIB_VFPRINTF=1
50611  GNULIB_VPRINTF=1
50612  GNULIB_FPUTC=1
50613  GNULIB_PUTC=1
50614  GNULIB_PUTCHAR=1
50615  GNULIB_FPUTS=1
50616  GNULIB_PUTS=1
50617  GNULIB_FWRITE=1
50618
50619
50620
50621
50622
50623
50624
50625
50626
50627
50628
50629
50630
50631
50632
50633     if test $gl_cv_have_include_next = yes; then
50634       gl_cv_next_stdlib_h='<'stdlib.h'>'
50635     else
50636       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
50637$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
50638if ${gl_cv_next_stdlib_h+:} false; then :
50639  $as_echo_n "(cached) " >&6
50640else
50641
50642
50643
50644  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50645/* end confdefs.h.  */
50646#include <stdlib.h>
50647_ACEOF
50648                case "$host_os" in
50649    aix*) gl_absname_cpp="$ac_cpp -C" ;;
50650    *)    gl_absname_cpp="$ac_cpp" ;;
50651  esac
50652
50653  case "$host_os" in
50654    mingw*)
50655                                          gl_dirsep_regex='[/\\]'
50656      ;;
50657    *)
50658      gl_dirsep_regex='\/'
50659      ;;
50660  esac
50661      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
50662  gl_header_literal_regex=`echo 'stdlib.h' \
50663                           | sed -e "$gl_make_literal_regex_sed"`
50664  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
50665      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
50666      s|^/[^/]|//&|
50667      p
50668      q
50669    }'
50670
50671        gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
50672  sed -n "$gl_absolute_header_sed"`
50673
50674           gl_header=$gl_cv_absolute_stdlib_h
50675           gl_cv_next_stdlib_h='"'$gl_header'"'
50676
50677
50678fi
50679{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
50680$as_echo "$gl_cv_next_stdlib_h" >&6; }
50681     fi
50682     NEXT_STDLIB_H=$gl_cv_next_stdlib_h
50683
50684     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
50685       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
50686       gl_next_as_first_directive='<'stdlib.h'>'
50687     else
50688       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
50689       gl_next_as_first_directive=$gl_cv_next_stdlib_h
50690     fi
50691     NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
50692
50693
50694
50695
50696
50697
50698
50699
50700
50701
50702
50703
50704
50705  for ac_func in stpcpy
50706do :
50707  ac_fn_c_check_func "$LINENO" "stpcpy" "ac_cv_func_stpcpy"
50708if test "x$ac_cv_func_stpcpy" = xyes; then :
50709  cat >>confdefs.h <<_ACEOF
50710#define HAVE_STPCPY 1
50711_ACEOF
50712
50713fi
50714done
50715
50716  if test $ac_cv_func_stpcpy = no; then
50717    HAVE_STPCPY=0
50718  fi
50719
50720  if test $HAVE_STPCPY = 0; then
50721
50722
50723
50724
50725
50726
50727
50728
50729  gl_LIBOBJS="$gl_LIBOBJS stpcpy.$ac_objext"
50730
50731
50732  :
50733
50734  fi
50735
50736
50737
50738
50739
50740          GNULIB_STPCPY=1
50741
50742
50743
50744
50745
50746$as_echo "#define GNULIB_TEST_STPCPY 1" >>confdefs.h
50747
50748
50749
50750
50751
50752
50753
50754
50755
50756
50757
50758
50759
50760  if test $ac_cv_func_stpncpy = yes; then
50761    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stpncpy" >&5
50762$as_echo_n "checking for working stpncpy... " >&6; }
50763if ${gl_cv_func_stpncpy+:} false; then :
50764  $as_echo_n "(cached) " >&6
50765else
50766
50767      if test "$cross_compiling" = yes; then :
50768  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50769/* end confdefs.h.  */
50770
50771#include <features.h>
50772#ifdef __GNU_LIBRARY__
50773  Thanks for using GNU
50774#endif
50775
50776_ACEOF
50777if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
50778  $EGREP "Thanks for using GNU" >/dev/null 2>&1; then :
50779  gl_cv_func_stpncpy="guessing yes"
50780else
50781  gl_cv_func_stpncpy="guessing no"
50782fi
50783rm -f conftest*
50784
50785
50786else
50787  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50788/* end confdefs.h.  */
50789
50790#include <stdlib.h>
50791#include <string.h> /* for strcpy */
50792/* The stpncpy prototype is missing in <string.h> on AIX 4.  */
50793#if !HAVE_DECL_STPNCPY
50794extern
50795# ifdef __cplusplus
50796"C"
50797# endif
50798char *stpncpy (char *dest, const char *src, size_t n);
50799#endif
50800int main ()
50801{
50802  int result = 0;
50803  const char *src = "Hello";
50804  char dest[10];
50805  /* AIX 4.3.3 and AIX 5.1 stpncpy() returns dest+1 here.  */
50806  {
50807    strcpy (dest, "\377\377\377\377\377\377");
50808    if (stpncpy (dest, src, 2) != dest + 2)
50809      result |= 1;
50810  }
50811  /* AIX 4.3.3 and AIX 5.1 stpncpy() returns dest+4 here.  */
50812  {
50813    strcpy (dest, "\377\377\377\377\377\377");
50814    if (stpncpy (dest, src, 5) != dest + 5)
50815      result |= 2;
50816  }
50817  /* AIX 4.3.3 and AIX 5.1 stpncpy() returns dest+6 here.  */
50818  {
50819    strcpy (dest, "\377\377\377\377\377\377");
50820    if (stpncpy (dest, src, 7) != dest + 5)
50821      result |= 4;
50822  }
50823  return result;
50824}
50825
50826_ACEOF
50827if ac_fn_c_try_run "$LINENO"; then :
50828  gl_cv_func_stpncpy=yes
50829else
50830  gl_cv_func_stpncpy=no
50831fi
50832rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
50833  conftest.$ac_objext conftest.beam conftest.$ac_ext
50834fi
50835
50836
50837fi
50838{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stpncpy" >&5
50839$as_echo "$gl_cv_func_stpncpy" >&6; }
50840    case "$gl_cv_func_stpncpy" in
50841      *yes)
50842
50843$as_echo "#define HAVE_STPNCPY 1" >>confdefs.h
50844
50845        ;;
50846      *)
50847        REPLACE_STPNCPY=1
50848        ;;
50849    esac
50850  else
50851    HAVE_STPNCPY=0
50852  fi
50853
50854  if test $HAVE_STPNCPY = 0 || test $REPLACE_STPNCPY = 1; then
50855
50856
50857
50858
50859
50860
50861
50862
50863  gl_LIBOBJS="$gl_LIBOBJS stpncpy.$ac_objext"
50864
50865
50866  :
50867
50868  fi
50869
50870
50871
50872
50873
50874          GNULIB_STPNCPY=1
50875
50876
50877
50878
50879
50880$as_echo "#define GNULIB_TEST_STPNCPY 1" >>confdefs.h
50881
50882
50883
50884
50885
50886
50887
50888  if test $ac_cv_func_strdup = yes; then
50889    if test $gl_cv_func_malloc_posix != yes; then
50890      REPLACE_STRDUP=1
50891    fi
50892  fi
50893
50894  if test $ac_cv_have_decl_strdup = no; then
50895    HAVE_DECL_STRDUP=0
50896  fi
50897
50898  if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
50899
50900
50901
50902
50903
50904
50905
50906
50907  gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext"
50908
50909    :
50910  fi
50911
50912
50913
50914
50915
50916          GNULIB_STRDUP=1
50917
50918
50919
50920
50921
50922$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
50923
50924
50925
50926
50927
50928
50929
50930
50931
50932
50933  if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
50934    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
50935$as_echo_n "checking for working strerror function... " >&6; }
50936if ${gl_cv_func_working_strerror+:} false; then :
50937  $as_echo_n "(cached) " >&6
50938else
50939  if test "$cross_compiling" = yes; then :
50940  case "$host_os" in
50941                          # Guess yes on glibc systems.
50942           *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
50943                          # If we don't know, assume the worst.
50944           *)             gl_cv_func_working_strerror="guessing no" ;;
50945         esac
50946
50947else
50948  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50949/* end confdefs.h.  */
50950#include <string.h>
50951
50952int
50953main ()
50954{
50955if (!*strerror (-2)) return 1;
50956  ;
50957  return 0;
50958}
50959_ACEOF
50960if ac_fn_c_try_run "$LINENO"; then :
50961  gl_cv_func_working_strerror=yes
50962else
50963  gl_cv_func_working_strerror=no
50964fi
50965rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
50966  conftest.$ac_objext conftest.beam conftest.$ac_ext
50967fi
50968
50969
50970fi
50971{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
50972$as_echo "$gl_cv_func_working_strerror" >&6; }
50973    case "$gl_cv_func_working_strerror" in
50974      *yes) ;;
50975      *)
50976                        REPLACE_STRERROR=1
50977        ;;
50978    esac
50979
50980                  case "$gl_cv_func_strerror_r_works" in
50981        *no) REPLACE_STRERROR=1 ;;
50982      esac
50983
50984  else
50985            REPLACE_STRERROR=1
50986  fi
50987
50988  if test $REPLACE_STRERROR = 1; then
50989
50990
50991
50992
50993
50994
50995
50996
50997  gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
50998
50999  fi
51000
51001
51002cat >>confdefs.h <<_ACEOF
51003#define GNULIB_STRERROR 1
51004_ACEOF
51005
51006
51007
51008
51009
51010
51011
51012          GNULIB_STRERROR=1
51013
51014
51015
51016
51017
51018$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
51019
51020
51021
51022
51023
51024  if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
51025
51026
51027
51028
51029
51030
51031
51032
51033  gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext"
51034
51035
51036
51037
51038
51039  if test $ac_cv_header_sys_socket_h != yes; then
51040                    for ac_header in winsock2.h
51041do :
51042  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
51043if test "x$ac_cv_header_winsock2_h" = xyes; then :
51044  cat >>confdefs.h <<_ACEOF
51045#define HAVE_WINSOCK2_H 1
51046_ACEOF
51047
51048fi
51049
51050done
51051
51052  fi
51053  if test "$ac_cv_header_winsock2_h" = yes; then
51054    HAVE_WINSOCK2_H=1
51055    UNISTD_H_HAVE_WINSOCK2_H=1
51056    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
51057  else
51058    HAVE_WINSOCK2_H=0
51059  fi
51060
51061
51062  fi
51063  if test $gl_cond_libtool = false; then
51064    gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV"
51065    gl_libdeps="$gl_libdeps $LIBICONV"
51066  fi
51067
51068
51069
51070
51071  if test $REPLACE_STRNCAT = 1; then
51072
51073
51074
51075
51076
51077
51078
51079
51080  gl_LIBOBJS="$gl_LIBOBJS strncat.$ac_objext"
51081
51082
51083  :
51084
51085  fi
51086
51087
51088
51089
51090
51091          GNULIB_STRNCAT=1
51092
51093
51094
51095
51096
51097$as_echo "#define GNULIB_TEST_STRNCAT 1" >>confdefs.h
51098
51099
51100
51101
51102
51103
51104
51105
51106
51107  if test $ac_cv_have_decl_strndup = no; then
51108    HAVE_DECL_STRNDUP=0
51109  fi
51110
51111  if test $ac_cv_func_strndup = yes; then
51112    HAVE_STRNDUP=1
51113    # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
51114    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5
51115$as_echo_n "checking for working strndup... " >&6; }
51116if ${gl_cv_func_strndup_works+:} false; then :
51117  $as_echo_n "(cached) " >&6
51118else
51119  if test "$cross_compiling" = yes; then :
51120
51121          case $host_os in
51122            aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";;
51123            *)               gl_cv_func_strndup_works="guessing yes";;
51124          esac
51125
51126else
51127  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51128/* end confdefs.h.  */
51129
51130         #include <string.h>
51131                           #include <stdlib.h>
51132int
51133main ()
51134{
51135
51136#if !HAVE_DECL_STRNDUP
51137  extern
51138  #ifdef __cplusplus
51139  "C"
51140  #endif
51141  char *strndup (const char *, size_t);
51142#endif
51143  int result;
51144  char *s;
51145  s = strndup ("some longer string", 15);
51146  free (s);
51147  s = strndup ("shorter string", 13);
51148  result = s[13] != '\0';
51149  free (s);
51150  return result;
51151  ;
51152  return 0;
51153}
51154_ACEOF
51155if ac_fn_c_try_run "$LINENO"; then :
51156  gl_cv_func_strndup_works=yes
51157else
51158  gl_cv_func_strndup_works=no
51159fi
51160rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
51161  conftest.$ac_objext conftest.beam conftest.$ac_ext
51162fi
51163
51164fi
51165{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup_works" >&5
51166$as_echo "$gl_cv_func_strndup_works" >&6; }
51167    case $gl_cv_func_strndup_works in
51168      *no) REPLACE_STRNDUP=1 ;;
51169    esac
51170  else
51171    HAVE_STRNDUP=0
51172  fi
51173
51174  if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
51175
51176
51177
51178
51179
51180
51181
51182
51183  gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext"
51184
51185  fi
51186
51187
51188
51189
51190
51191          GNULIB_STRNDUP=1
51192
51193
51194
51195
51196
51197$as_echo "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h
51198
51199
51200
51201
51202
51203
51204
51205
51206
51207  if test $ac_cv_have_decl_strnlen = no; then
51208    HAVE_DECL_STRNLEN=0
51209  else
51210
51211         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
51212$as_echo_n "checking for working strnlen... " >&6; }
51213if ${ac_cv_func_strnlen_working+:} false; then :
51214  $as_echo_n "(cached) " >&6
51215else
51216  if test "$cross_compiling" = yes; then :
51217  # Guess no on AIX systems, yes otherwise.
51218		case "$host_os" in
51219		  aix*) ac_cv_func_strnlen_working=no;;
51220		  *)    ac_cv_func_strnlen_working=yes;;
51221		esac
51222else
51223  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51224/* end confdefs.h.  */
51225$ac_includes_default
51226int
51227main ()
51228{
51229
51230#define S "foobar"
51231#define S_LEN (sizeof S - 1)
51232
51233  /* At least one implementation is buggy: that of AIX 4.3 would
51234     give strnlen (S, 1) == 3.  */
51235
51236  int i;
51237  for (i = 0; i < S_LEN + 1; ++i)
51238    {
51239      int expected = i <= S_LEN ? i : S_LEN;
51240      if (strnlen (S, i) != expected)
51241	return 1;
51242    }
51243  return 0;
51244
51245  ;
51246  return 0;
51247}
51248_ACEOF
51249if ac_fn_c_try_run "$LINENO"; then :
51250  ac_cv_func_strnlen_working=yes
51251else
51252  ac_cv_func_strnlen_working=no
51253fi
51254rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
51255  conftest.$ac_objext conftest.beam conftest.$ac_ext
51256fi
51257
51258fi
51259{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5
51260$as_echo "$ac_cv_func_strnlen_working" >&6; }
51261test $ac_cv_func_strnlen_working = no && :
51262
51263
51264    if test $ac_cv_func_strnlen_working = no; then
51265      REPLACE_STRNLEN=1
51266    fi
51267  fi
51268
51269  if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
51270
51271
51272
51273
51274
51275
51276
51277
51278  gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext"
51279
51280    :
51281  fi
51282
51283
51284
51285
51286
51287          GNULIB_STRNLEN=1
51288
51289
51290
51291
51292
51293$as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h
51294
51295
51296
51297
51298
51299
51300
51301
51302
51303  if test $ac_cv_have_decl_strsignal = no; then
51304    HAVE_DECL_STRSIGNAL=0
51305  fi
51306
51307  for ac_func in strsignal
51308do :
51309  ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal"
51310if test "x$ac_cv_func_strsignal" = xyes; then :
51311  cat >>confdefs.h <<_ACEOF
51312#define HAVE_STRSIGNAL 1
51313_ACEOF
51314
51315fi
51316done
51317
51318  if test $ac_cv_func_strsignal = yes; then
51319    HAVE_STRSIGNAL=1
51320            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strsignal always returns a string" >&5
51321$as_echo_n "checking whether strsignal always returns a string... " >&6; }
51322if ${gl_cv_func_working_strsignal+:} false; then :
51323  $as_echo_n "(cached) " >&6
51324else
51325  if test "$cross_compiling" = yes; then :
51326  case "$host_os" in
51327            solaris* | aix*) gl_cv_func_working_strsignal=no;;
51328            *)               gl_cv_func_working_strsignal="guessing yes";;
51329          esac
51330else
51331  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51332/* end confdefs.h.  */
51333#include <string.h>
51334#include <unistd.h> /* NetBSD 5.0 declares it in wrong header. */
51335
51336int
51337main ()
51338{
51339int result = 0;
51340              char *s = strsignal (-1);
51341              if (s == (char *) 0)
51342                result |= 1;
51343              if (s == (char *) -1)
51344                result |= 2;
51345              return result;
51346
51347  ;
51348  return 0;
51349}
51350_ACEOF
51351if ac_fn_c_try_run "$LINENO"; then :
51352  gl_cv_func_working_strsignal=yes
51353else
51354  gl_cv_func_working_strsignal=no
51355fi
51356rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
51357  conftest.$ac_objext conftest.beam conftest.$ac_ext
51358fi
51359
51360fi
51361{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strsignal" >&5
51362$as_echo "$gl_cv_func_working_strsignal" >&6; }
51363    if test "$gl_cv_func_working_strsignal" = no; then
51364      REPLACE_STRSIGNAL=1
51365    fi
51366  else
51367    HAVE_STRSIGNAL=0
51368  fi
51369
51370  if test $HAVE_STRSIGNAL = 0 || test $REPLACE_STRSIGNAL = 1; then
51371
51372
51373
51374
51375
51376
51377
51378
51379  gl_LIBOBJS="$gl_LIBOBJS strsignal.$ac_objext"
51380
51381
51382
51383
51384  ac_fn_c_check_decl "$LINENO" "_sys_siglist" "ac_cv_have_decl__sys_siglist" "#include <signal.h>
51385"
51386if test "x$ac_cv_have_decl__sys_siglist" = xyes; then :
51387  ac_have_decl=1
51388else
51389  ac_have_decl=0
51390fi
51391
51392cat >>confdefs.h <<_ACEOF
51393#define HAVE_DECL__SYS_SIGLIST $ac_have_decl
51394_ACEOF
51395
51396
51397  fi
51398
51399
51400
51401
51402
51403          GNULIB_STRSIGNAL=1
51404
51405
51406
51407
51408
51409$as_echo "#define GNULIB_TEST_STRSIGNAL 1" >>confdefs.h
51410
51411
51412
51413
51414
51415
51416  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
51417    REPLACE_STRSTR=1
51418  else
51419        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
51420$as_echo_n "checking whether strstr works... " >&6; }
51421if ${gl_cv_func_strstr_works_always+:} false; then :
51422  $as_echo_n "(cached) " >&6
51423else
51424  if test "$cross_compiling" = yes; then :
51425                                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51426/* end confdefs.h.  */
51427
51428#ifdef __GNU_LIBRARY__
51429 #include <features.h>
51430 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
51431     || defined __UCLIBC__
51432  Lucky user
51433 #endif
51434#elif defined __CYGWIN__
51435 #include <cygwin/version.h>
51436 #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
51437  Lucky user
51438 #endif
51439#else
51440  Lucky user
51441#endif
51442
51443_ACEOF
51444if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
51445  $EGREP "Lucky user" >/dev/null 2>&1; then :
51446  gl_cv_func_strstr_works_always="guessing yes"
51447else
51448  gl_cv_func_strstr_works_always="guessing no"
51449fi
51450rm -f conftest*
51451
51452
51453else
51454  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51455/* end confdefs.h.  */
51456
51457#include <string.h> /* for strstr */
51458#define P "_EF_BF_BD"
51459#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
51460#define NEEDLE P P P P P
51461
51462int
51463main ()
51464{
51465return !!strstr (HAYSTACK, NEEDLE);
51466
51467  ;
51468  return 0;
51469}
51470_ACEOF
51471if ac_fn_c_try_run "$LINENO"; then :
51472  gl_cv_func_strstr_works_always=yes
51473else
51474  gl_cv_func_strstr_works_always=no
51475fi
51476rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
51477  conftest.$ac_objext conftest.beam conftest.$ac_ext
51478fi
51479
51480
51481fi
51482{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
51483$as_echo "$gl_cv_func_strstr_works_always" >&6; }
51484    case "$gl_cv_func_strstr_works_always" in
51485      *yes) ;;
51486      *)
51487        REPLACE_STRSTR=1
51488        ;;
51489    esac
51490  fi
51491
51492  if test $REPLACE_STRSTR = 1; then
51493
51494
51495
51496
51497
51498
51499
51500
51501  gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
51502
51503  fi
51504
51505
51506
51507
51508
51509          GNULIB_STRSTR=1
51510
51511
51512
51513
51514
51515$as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
51516
51517
51518
51519
51520
51521
51522  if test $HAVE_STRTOD = 1; then
51523    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtod obeys C99" >&5
51524$as_echo_n "checking whether strtod obeys C99... " >&6; }
51525if ${gl_cv_func_strtod_works+:} false; then :
51526  $as_echo_n "(cached) " >&6
51527else
51528  if test "$cross_compiling" = yes; then :
51529                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51530/* end confdefs.h.  */
51531
51532#include <features.h>
51533#ifdef __GNU_LIBRARY__
51534 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \
51535     && !defined __UCLIBC__
51536  Lucky user
51537 #endif
51538#endif
51539
51540_ACEOF
51541if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
51542  $EGREP "Lucky user" >/dev/null 2>&1; then :
51543  gl_cv_func_strtod_works="guessing yes"
51544else
51545  case "$host_os" in
51546                      # Guess yes on native Windows.
51547              mingw*) gl_cv_func_strtod_works="guessing yes" ;;
51548              *)      gl_cv_func_strtod_works="guessing no" ;;
51549            esac
51550
51551fi
51552rm -f conftest*
51553
51554
51555else
51556  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51557/* end confdefs.h.  */
51558
51559#include <stdlib.h>
51560#include <math.h>
51561#include <errno.h>
51562/* Compare two numbers with ==.
51563   This is a separate function because IRIX 6.5 "cc -O" miscompiles an
51564   'x == x' test.  */
51565static int
51566numeric_equal (double x, double y)
51567{
51568  return x == y;
51569}
51570
51571int
51572main ()
51573{
51574
51575  int result = 0;
51576  {
51577    /* In some old versions of Linux (2000 or before), strtod mis-parses
51578       strings with leading '+'.  */
51579    const char *string = " +69";
51580    char *term;
51581    double value = strtod (string, &term);
51582    if (value != 69 || term != (string + 4))
51583      result |= 1;
51584  }
51585  {
51586    /* Under Solaris 2.4, strtod returns the wrong value for the
51587       terminating character under some conditions.  */
51588    const char *string = "NaN";
51589    char *term;
51590    strtod (string, &term);
51591    if (term != string && *(term - 1) == 0)
51592      result |= 2;
51593  }
51594  {
51595    /* Older glibc and Cygwin mis-parse "-0x".  */
51596    const char *string = "-0x";
51597    char *term;
51598    double value = strtod (string, &term);
51599    double zero = 0.0;
51600    if (1.0 / value != -1.0 / zero || term != (string + 2))
51601      result |= 4;
51602  }
51603  {
51604    /* Many platforms do not parse hex floats.  */
51605    const char *string = "0XaP+1";
51606    char *term;
51607    double value = strtod (string, &term);
51608    if (value != 20.0 || term != (string + 6))
51609      result |= 8;
51610  }
51611  {
51612    /* Many platforms do not parse infinities.  HP-UX 11.31 parses inf,
51613       but mistakenly sets errno.  */
51614    const char *string = "inf";
51615    char *term;
51616    double value;
51617    errno = 0;
51618    value = strtod (string, &term);
51619    if (value != HUGE_VAL || term != (string + 3) || errno)
51620      result |= 16;
51621  }
51622  {
51623    /* glibc 2.7 and cygwin 1.5.24 misparse "nan()".  */
51624    const char *string = "nan()";
51625    char *term;
51626    double value = strtod (string, &term);
51627    if (numeric_equal (value, value) || term != (string + 5))
51628      result |= 32;
51629  }
51630  {
51631    /* darwin 10.6.1 misparses "nan(".  */
51632    const char *string = "nan(";
51633    char *term;
51634    double value = strtod (string, &term);
51635    if (numeric_equal (value, value) || term != (string + 3))
51636      result |= 64;
51637  }
51638  return result;
51639
51640  ;
51641  return 0;
51642}
51643_ACEOF
51644if ac_fn_c_try_run "$LINENO"; then :
51645  gl_cv_func_strtod_works=yes
51646else
51647  gl_cv_func_strtod_works=no
51648fi
51649rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
51650  conftest.$ac_objext conftest.beam conftest.$ac_ext
51651fi
51652
51653
51654fi
51655{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtod_works" >&5
51656$as_echo "$gl_cv_func_strtod_works" >&6; }
51657    case "$gl_cv_func_strtod_works" in
51658      *yes) ;;
51659      *)
51660        REPLACE_STRTOD=1
51661        ;;
51662    esac
51663  fi
51664
51665  if test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1; then
51666
51667
51668
51669
51670
51671
51672
51673
51674  gl_LIBOBJS="$gl_LIBOBJS strtod.$ac_objext"
51675
51676
51677
51678  if test $gl_cv_func_ldexp_no_libm = yes; then
51679
51680$as_echo "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h
51681
51682  fi
51683
51684  fi
51685
51686
51687
51688
51689
51690          GNULIB_STRTOD=1
51691
51692
51693
51694
51695
51696$as_echo "#define GNULIB_TEST_STRTOD 1" >>confdefs.h
51697
51698
51699
51700
51701
51702
51703
51704
51705  if test "$ac_cv_have_decl_strtoimax" != yes; then
51706    HAVE_DECL_STRTOIMAX=0
51707  fi
51708
51709  if test "$ac_cv_func_strtoimax" = yes; then
51710    HAVE_STRTOIMAX=1
51711             { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtoimax works" >&5
51712$as_echo_n "checking whether strtoimax works... " >&6; }
51713if ${gl_cv_func_strtoimax+:} false; then :
51714  $as_echo_n "(cached) " >&6
51715else
51716  if test "$cross_compiling" = yes; then :
51717  case "$host_os" in
51718                    # Guess no on AIX 5.
51719            aix5*)  gl_cv_func_strtoimax="guessing no" ;;
51720                    # Guess yes on native Windows.
51721            mingw*) gl_cv_func_strtoimax="guessing yes" ;;
51722                    # Guess yes otherwise.
51723            *)      gl_cv_func_strtoimax="guessing yes" ;;
51724          esac
51725
51726else
51727  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51728/* end confdefs.h.  */
51729
51730#include <errno.h>
51731#include <string.h>
51732#include <inttypes.h>
51733int main ()
51734{
51735  if (sizeof (intmax_t) > sizeof (int))
51736    {
51737      const char *s = "4294967295";
51738      char *p;
51739      intmax_t res;
51740      errno = 0;
51741      res = strtoimax (s, &p, 10);
51742      if (p != s + strlen (s))
51743        return 1;
51744      if (errno != 0)
51745        return 2;
51746      if (res != (intmax_t) 65535 * (intmax_t) 65537)
51747        return 3;
51748    }
51749  else
51750    {
51751      const char *s = "2147483647";
51752      char *p;
51753      intmax_t res;
51754      errno = 0;
51755      res = strtoimax (s, &p, 10);
51756      if (p != s + strlen (s))
51757        return 1;
51758      if (errno != 0)
51759        return 2;
51760      if (res != 2147483647)
51761        return 3;
51762    }
51763  return 0;
51764}
51765
51766_ACEOF
51767if ac_fn_c_try_run "$LINENO"; then :
51768  gl_cv_func_strtoimax=yes
51769else
51770  gl_cv_func_strtoimax=no
51771fi
51772rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
51773  conftest.$ac_objext conftest.beam conftest.$ac_ext
51774fi
51775
51776
51777fi
51778{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtoimax" >&5
51779$as_echo "$gl_cv_func_strtoimax" >&6; }
51780    case "$gl_cv_func_strtoimax" in
51781      *no) REPLACE_STRTOIMAX=1 ;;
51782    esac
51783  else
51784    if test "$ac_cv_have_decl_strtoimax" = yes; then
51785      # HP-UX 11.11 has "#define strtoimax(...) ..." but no function.
51786      REPLACE_STRTOIMAX=1
51787    fi
51788    HAVE_STRTOIMAX=0
51789  fi
51790
51791  if test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
51792
51793
51794
51795
51796
51797
51798
51799
51800  gl_LIBOBJS="$gl_LIBOBJS strtoimax.$ac_objext"
51801
51802
51803  ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default"
51804if test "x$ac_cv_have_decl_strtoll" = xyes; then :
51805  ac_have_decl=1
51806else
51807  ac_have_decl=0
51808fi
51809
51810cat >>confdefs.h <<_ACEOF
51811#define HAVE_DECL_STRTOLL $ac_have_decl
51812_ACEOF
51813
51814
51815
51816  fi
51817
51818
51819
51820
51821
51822          GNULIB_STRTOIMAX=1
51823
51824
51825
51826
51827
51828
51829
51830  if test "$ac_cv_type_long_long_int" = yes; then
51831    for ac_func in strtoll
51832do :
51833  ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll"
51834if test "x$ac_cv_func_strtoll" = xyes; then :
51835  cat >>confdefs.h <<_ACEOF
51836#define HAVE_STRTOLL 1
51837_ACEOF
51838
51839fi
51840done
51841
51842    if test $ac_cv_func_strtoll = no; then
51843      HAVE_STRTOLL=0
51844    fi
51845  fi
51846
51847  if test $HAVE_STRTOLL = 0; then
51848
51849
51850
51851
51852
51853
51854
51855
51856  gl_LIBOBJS="$gl_LIBOBJS strtoll.$ac_objext"
51857
51858
51859  :
51860
51861  fi
51862
51863
51864
51865
51866
51867          GNULIB_STRTOLL=1
51868
51869
51870
51871
51872
51873$as_echo "#define GNULIB_TEST_STRTOLL 1" >>confdefs.h
51874
51875
51876
51877
51878
51879
51880  if test "$ac_cv_type_unsigned_long_long_int" = yes; then
51881    for ac_func in strtoull
51882do :
51883  ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull"
51884if test "x$ac_cv_func_strtoull" = xyes; then :
51885  cat >>confdefs.h <<_ACEOF
51886#define HAVE_STRTOULL 1
51887_ACEOF
51888
51889fi
51890done
51891
51892    if test $ac_cv_func_strtoull = no; then
51893      HAVE_STRTOULL=0
51894    fi
51895  fi
51896
51897  if test $HAVE_STRTOULL = 0; then
51898
51899
51900
51901
51902
51903
51904
51905
51906  gl_LIBOBJS="$gl_LIBOBJS strtoull.$ac_objext"
51907
51908
51909  :
51910
51911  fi
51912
51913
51914
51915
51916
51917          GNULIB_STRTOULL=1
51918
51919
51920
51921
51922
51923$as_echo "#define GNULIB_TEST_STRTOULL 1" >>confdefs.h
51924
51925
51926
51927
51928
51929
51930
51931
51932  if test "$ac_cv_have_decl_strtoumax" = yes; then
51933    if test "$ac_cv_func_strtoumax" != yes; then
51934      # HP-UX 11.11 has "#define strtoimax(...) ..." but no function.
51935      REPLACE_STRTOUMAX=1
51936    fi
51937  else
51938    HAVE_DECL_STRTOUMAX=0
51939  fi
51940
51941  if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then
51942
51943
51944
51945
51946
51947
51948
51949
51950  gl_LIBOBJS="$gl_LIBOBJS strtoumax.$ac_objext"
51951
51952
51953  ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default"
51954if test "x$ac_cv_have_decl_strtoull" = xyes; then :
51955  ac_have_decl=1
51956else
51957  ac_have_decl=0
51958fi
51959
51960cat >>confdefs.h <<_ACEOF
51961#define HAVE_DECL_STRTOULL $ac_have_decl
51962_ACEOF
51963
51964
51965
51966  fi
51967
51968
51969
51970
51971
51972          GNULIB_STRTOUMAX=1
51973
51974
51975
51976
51977
51978
51979
51980        if test $ac_cv_func_symlink = no; then
51981    HAVE_SYMLINK=0
51982  else
51983    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5
51984$as_echo_n "checking whether symlink handles trailing slash correctly... " >&6; }
51985if ${gl_cv_func_symlink_works+:} false; then :
51986  $as_echo_n "(cached) " >&6
51987else
51988  if test "$cross_compiling" = yes; then :
51989  case "$host_os" in
51990                             # Guess yes on Linux systems.
51991            linux-* | linux) gl_cv_func_symlink_works="guessing yes" ;;
51992                             # Guess yes on glibc systems.
51993            *-gnu* | gnu*)   gl_cv_func_symlink_works="guessing yes" ;;
51994                             # If we don't know, assume the worst.
51995            *)               gl_cv_func_symlink_works="guessing no" ;;
51996          esac
51997
51998else
51999  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52000/* end confdefs.h.  */
52001#include <unistd.h>
52002
52003int
52004main ()
52005{
52006int result = 0;
52007             if (!symlink ("a", "conftest.link/"))
52008               result |= 1;
52009             if (symlink ("conftest.f", "conftest.lnk2"))
52010               result |= 2;
52011             else if (!symlink ("a", "conftest.lnk2/"))
52012               result |= 4;
52013             return result;
52014
52015  ;
52016  return 0;
52017}
52018_ACEOF
52019if ac_fn_c_try_run "$LINENO"; then :
52020  gl_cv_func_symlink_works=yes
52021else
52022  gl_cv_func_symlink_works=no
52023fi
52024rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
52025  conftest.$ac_objext conftest.beam conftest.$ac_ext
52026fi
52027
52028      rm -f conftest.f conftest.link conftest.lnk2
52029fi
52030{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5
52031$as_echo "$gl_cv_func_symlink_works" >&6; }
52032    case "$gl_cv_func_symlink_works" in
52033      *yes) ;;
52034      *)
52035        REPLACE_SYMLINK=1
52036        ;;
52037    esac
52038  fi
52039
52040  if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
52041
52042
52043
52044
52045
52046
52047
52048
52049  gl_LIBOBJS="$gl_LIBOBJS symlink.$ac_objext"
52050
52051  fi
52052
52053
52054
52055
52056
52057          GNULIB_SYMLINK=1
52058
52059
52060
52061
52062
52063$as_echo "#define GNULIB_TEST_SYMLINK 1" >>confdefs.h
52064
52065
52066
52067
52068
52069
52070
52071
52072  if test $ac_cv_func_symlinkat = no; then
52073    HAVE_SYMLINKAT=0
52074  else
52075    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symlinkat handles trailing slash correctly" >&5
52076$as_echo_n "checking whether symlinkat handles trailing slash correctly... " >&6; }
52077if ${gl_cv_func_symlinkat_works+:} false; then :
52078  $as_echo_n "(cached) " >&6
52079else
52080  if test "$cross_compiling" = yes; then :
52081  case "$host_os" in
52082                             # Guess yes on Linux systems.
52083            linux-* | linux) gl_cv_func_symlinkat_works="guessing yes" ;;
52084                             # Guess yes on glibc systems.
52085            *-gnu* | gnu*)   gl_cv_func_symlinkat_works="guessing yes" ;;
52086                             # If we don't know, assume the worst.
52087            *)               gl_cv_func_symlinkat_works="guessing no" ;;
52088          esac
52089
52090else
52091  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52092/* end confdefs.h.  */
52093#include <fcntl.h>
52094             #include <unistd.h>
52095
52096int
52097main ()
52098{
52099int result = 0;
52100             if (!symlinkat ("a", AT_FDCWD, "conftest.link/"))
52101               result |= 1;
52102             if (symlinkat ("conftest.f", AT_FDCWD, "conftest.lnk2"))
52103               result |= 2;
52104             else if (!symlinkat ("a", AT_FDCWD, "conftest.lnk2/"))
52105               result |= 4;
52106             return result;
52107
52108  ;
52109  return 0;
52110}
52111_ACEOF
52112if ac_fn_c_try_run "$LINENO"; then :
52113  gl_cv_func_symlinkat_works=yes
52114else
52115  gl_cv_func_symlinkat_works=no
52116fi
52117rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
52118  conftest.$ac_objext conftest.beam conftest.$ac_ext
52119fi
52120
52121      rm -f conftest.f conftest.link conftest.lnk2
52122fi
52123{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlinkat_works" >&5
52124$as_echo "$gl_cv_func_symlinkat_works" >&6; }
52125    case "$gl_cv_func_symlinkat_works" in
52126      *yes) ;;
52127      *)
52128        REPLACE_SYMLINKAT=1
52129        ;;
52130    esac
52131  fi
52132
52133  if test $HAVE_SYMLINKAT = 0 || test $REPLACE_SYMLINKAT = 1; then
52134
52135
52136
52137
52138
52139
52140
52141
52142  gl_LIBOBJS="$gl_LIBOBJS symlinkat.$ac_objext"
52143
52144  fi
52145
52146
52147
52148
52149
52150          GNULIB_SYMLINKAT=1
52151
52152
52153
52154
52155
52156$as_echo "#define GNULIB_TEST_SYMLINKAT 1" >>confdefs.h
52157
52158
52159
52160
52161
52162
52163
52164  if test $ac_cv_header_sys_ioctl_h = yes; then
52165    HAVE_SYS_IOCTL_H=1
52166            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/ioctl.h> declares ioctl" >&5
52167$as_echo_n "checking whether <sys/ioctl.h> declares ioctl... " >&6; }
52168if ${gl_cv_decl_ioctl_in_sys_ioctl_h+:} false; then :
52169  $as_echo_n "(cached) " >&6
52170else
52171         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52172/* end confdefs.h.  */
52173#include <sys/ioctl.h>
52174
52175int
52176main ()
52177{
52178(void) ioctl;
52179  ;
52180  return 0;
52181}
52182_ACEOF
52183if ac_fn_c_try_compile "$LINENO"; then :
52184  gl_cv_decl_ioctl_in_sys_ioctl_h=yes
52185else
52186  gl_cv_decl_ioctl_in_sys_ioctl_h=no
52187fi
52188rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52189
52190fi
52191{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_ioctl_in_sys_ioctl_h" >&5
52192$as_echo "$gl_cv_decl_ioctl_in_sys_ioctl_h" >&6; }
52193  else
52194    HAVE_SYS_IOCTL_H=0
52195  fi
52196
52197
52198
52199
52200
52201
52202
52203
52204
52205
52206     if test $gl_cv_have_include_next = yes; then
52207       gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>'
52208     else
52209       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/ioctl.h>" >&5
52210$as_echo_n "checking absolute name of <sys/ioctl.h>... " >&6; }
52211if ${gl_cv_next_sys_ioctl_h+:} false; then :
52212  $as_echo_n "(cached) " >&6
52213else
52214
52215             if test $ac_cv_header_sys_ioctl_h = yes; then
52216
52217
52218
52219
52220  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52221/* end confdefs.h.  */
52222#include <sys/ioctl.h>
52223_ACEOF
52224                case "$host_os" in
52225    aix*) gl_absname_cpp="$ac_cpp -C" ;;
52226    *)    gl_absname_cpp="$ac_cpp" ;;
52227  esac
52228
52229  case "$host_os" in
52230    mingw*)
52231                                          gl_dirsep_regex='[/\\]'
52232      ;;
52233    *)
52234      gl_dirsep_regex='\/'
52235      ;;
52236  esac
52237      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
52238  gl_header_literal_regex=`echo 'sys/ioctl.h' \
52239                           | sed -e "$gl_make_literal_regex_sed"`
52240  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
52241      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
52242      s|^/[^/]|//&|
52243      p
52244      q
52245    }'
52246
52247        gl_cv_absolute_sys_ioctl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
52248  sed -n "$gl_absolute_header_sed"`
52249
52250           gl_header=$gl_cv_absolute_sys_ioctl_h
52251           gl_cv_next_sys_ioctl_h='"'$gl_header'"'
52252          else
52253               gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>'
52254             fi
52255
52256
52257fi
52258{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_ioctl_h" >&5
52259$as_echo "$gl_cv_next_sys_ioctl_h" >&6; }
52260     fi
52261     NEXT_SYS_IOCTL_H=$gl_cv_next_sys_ioctl_h
52262
52263     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
52264       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
52265       gl_next_as_first_directive='<'sys/ioctl.h'>'
52266     else
52267       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
52268       gl_next_as_first_directive=$gl_cv_next_sys_ioctl_h
52269     fi
52270     NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H=$gl_next_as_first_directive
52271
52272
52273
52274
52275
52276
52277
52278
52279
52280
52281
52282
52283
52284
52285
52286
52287
52288
52289
52290     if test $gl_cv_have_include_next = yes; then
52291       gl_cv_next_sys_resource_h='<'sys/resource.h'>'
52292     else
52293       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/resource.h>" >&5
52294$as_echo_n "checking absolute name of <sys/resource.h>... " >&6; }
52295if ${gl_cv_next_sys_resource_h+:} false; then :
52296  $as_echo_n "(cached) " >&6
52297else
52298
52299             if test $ac_cv_header_sys_resource_h = yes; then
52300
52301
52302
52303
52304  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52305/* end confdefs.h.  */
52306#include <sys/resource.h>
52307_ACEOF
52308                case "$host_os" in
52309    aix*) gl_absname_cpp="$ac_cpp -C" ;;
52310    *)    gl_absname_cpp="$ac_cpp" ;;
52311  esac
52312
52313  case "$host_os" in
52314    mingw*)
52315                                          gl_dirsep_regex='[/\\]'
52316      ;;
52317    *)
52318      gl_dirsep_regex='\/'
52319      ;;
52320  esac
52321      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
52322  gl_header_literal_regex=`echo 'sys/resource.h' \
52323                           | sed -e "$gl_make_literal_regex_sed"`
52324  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
52325      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
52326      s|^/[^/]|//&|
52327      p
52328      q
52329    }'
52330
52331        gl_cv_absolute_sys_resource_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
52332  sed -n "$gl_absolute_header_sed"`
52333
52334           gl_header=$gl_cv_absolute_sys_resource_h
52335           gl_cv_next_sys_resource_h='"'$gl_header'"'
52336          else
52337               gl_cv_next_sys_resource_h='<'sys/resource.h'>'
52338             fi
52339
52340
52341fi
52342{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_resource_h" >&5
52343$as_echo "$gl_cv_next_sys_resource_h" >&6; }
52344     fi
52345     NEXT_SYS_RESOURCE_H=$gl_cv_next_sys_resource_h
52346
52347     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
52348       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
52349       gl_next_as_first_directive='<'sys/resource.h'>'
52350     else
52351       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
52352       gl_next_as_first_directive=$gl_cv_next_sys_resource_h
52353     fi
52354     NEXT_AS_FIRST_DIRECTIVE_SYS_RESOURCE_H=$gl_next_as_first_directive
52355
52356
52357
52358
52359  if test $ac_cv_header_sys_resource_h = yes; then
52360    HAVE_SYS_RESOURCE_H=1
52361  else
52362    HAVE_SYS_RESOURCE_H=0
52363  fi
52364
52365
52366
52367
52368
52369
52370
52371
52372
52373
52374
52375
52376
52377
52378
52379
52380
52381
52382
52383
52384
52385
52386
52387     if test $gl_cv_have_include_next = yes; then
52388       gl_cv_next_sys_stat_h='<'sys/stat.h'>'
52389     else
52390       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
52391$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
52392if ${gl_cv_next_sys_stat_h+:} false; then :
52393  $as_echo_n "(cached) " >&6
52394else
52395
52396             if test $ac_cv_header_sys_stat_h = yes; then
52397
52398
52399
52400
52401  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52402/* end confdefs.h.  */
52403#include <sys/stat.h>
52404_ACEOF
52405                case "$host_os" in
52406    aix*) gl_absname_cpp="$ac_cpp -C" ;;
52407    *)    gl_absname_cpp="$ac_cpp" ;;
52408  esac
52409
52410  case "$host_os" in
52411    mingw*)
52412                                          gl_dirsep_regex='[/\\]'
52413      ;;
52414    *)
52415      gl_dirsep_regex='\/'
52416      ;;
52417  esac
52418      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
52419  gl_header_literal_regex=`echo 'sys/stat.h' \
52420                           | sed -e "$gl_make_literal_regex_sed"`
52421  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
52422      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
52423      s|^/[^/]|//&|
52424      p
52425      q
52426    }'
52427
52428        gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
52429  sed -n "$gl_absolute_header_sed"`
52430
52431           gl_header=$gl_cv_absolute_sys_stat_h
52432           gl_cv_next_sys_stat_h='"'$gl_header'"'
52433          else
52434               gl_cv_next_sys_stat_h='<'sys/stat.h'>'
52435             fi
52436
52437
52438fi
52439{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
52440$as_echo "$gl_cv_next_sys_stat_h" >&6; }
52441     fi
52442     NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
52443
52444     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
52445       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
52446       gl_next_as_first_directive='<'sys/stat.h'>'
52447     else
52448       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
52449       gl_next_as_first_directive=$gl_cv_next_sys_stat_h
52450     fi
52451     NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
52452
52453
52454
52455
52456
52457
52458
52459
52460    WINDOWS_STAT_TIMESPEC=0
52461
52462
52463
52464
52465
52466
52467
52468
52469      ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
52470     #include <sys/stat.h>
52471"
52472if test "x$ac_cv_type_nlink_t" = xyes; then :
52473
52474else
52475
52476$as_echo "#define nlink_t int" >>confdefs.h
52477
52478fi
52479
52480
52481
52482
52483
52484
52485
52486
52487
52488
52489
52490
52491
52492
52493
52494
52495
52496
52497
52498
52499
52500
52501     if test $gl_cv_have_include_next = yes; then
52502       gl_cv_next_sys_uio_h='<'sys/uio.h'>'
52503     else
52504       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
52505$as_echo_n "checking absolute name of <sys/uio.h>... " >&6; }
52506if ${gl_cv_next_sys_uio_h+:} false; then :
52507  $as_echo_n "(cached) " >&6
52508else
52509
52510             if test $ac_cv_header_sys_uio_h = yes; then
52511
52512
52513
52514
52515  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52516/* end confdefs.h.  */
52517#include <sys/uio.h>
52518_ACEOF
52519                case "$host_os" in
52520    aix*) gl_absname_cpp="$ac_cpp -C" ;;
52521    *)    gl_absname_cpp="$ac_cpp" ;;
52522  esac
52523
52524  case "$host_os" in
52525    mingw*)
52526                                          gl_dirsep_regex='[/\\]'
52527      ;;
52528    *)
52529      gl_dirsep_regex='\/'
52530      ;;
52531  esac
52532      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
52533  gl_header_literal_regex=`echo 'sys/uio.h' \
52534                           | sed -e "$gl_make_literal_regex_sed"`
52535  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
52536      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
52537      s|^/[^/]|//&|
52538      p
52539      q
52540    }'
52541
52542        gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
52543  sed -n "$gl_absolute_header_sed"`
52544
52545           gl_header=$gl_cv_absolute_sys_uio_h
52546           gl_cv_next_sys_uio_h='"'$gl_header'"'
52547          else
52548               gl_cv_next_sys_uio_h='<'sys/uio.h'>'
52549             fi
52550
52551
52552fi
52553{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
52554$as_echo "$gl_cv_next_sys_uio_h" >&6; }
52555     fi
52556     NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h
52557
52558     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
52559       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
52560       gl_next_as_first_directive='<'sys/uio.h'>'
52561     else
52562       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
52563       gl_next_as_first_directive=$gl_cv_next_sys_uio_h
52564     fi
52565     NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
52566
52567
52568
52569
52570  if test $ac_cv_header_sys_uio_h = yes; then
52571    HAVE_SYS_UIO_H=1
52572  else
52573    HAVE_SYS_UIO_H=0
52574  fi
52575
52576
52577
52578
52579
52580
52581
52582
52583
52584
52585
52586
52587
52588
52589
52590     if test $gl_cv_have_include_next = yes; then
52591       gl_cv_next_sys_utsname_h='<'sys/utsname.h'>'
52592     else
52593       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/utsname.h>" >&5
52594$as_echo_n "checking absolute name of <sys/utsname.h>... " >&6; }
52595if ${gl_cv_next_sys_utsname_h+:} false; then :
52596  $as_echo_n "(cached) " >&6
52597else
52598
52599             if test $ac_cv_header_sys_utsname_h = yes; then
52600
52601
52602
52603
52604  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52605/* end confdefs.h.  */
52606#include <sys/utsname.h>
52607_ACEOF
52608                case "$host_os" in
52609    aix*) gl_absname_cpp="$ac_cpp -C" ;;
52610    *)    gl_absname_cpp="$ac_cpp" ;;
52611  esac
52612
52613  case "$host_os" in
52614    mingw*)
52615                                          gl_dirsep_regex='[/\\]'
52616      ;;
52617    *)
52618      gl_dirsep_regex='\/'
52619      ;;
52620  esac
52621      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
52622  gl_header_literal_regex=`echo 'sys/utsname.h' \
52623                           | sed -e "$gl_make_literal_regex_sed"`
52624  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
52625      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
52626      s|^/[^/]|//&|
52627      p
52628      q
52629    }'
52630
52631        gl_cv_absolute_sys_utsname_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
52632  sed -n "$gl_absolute_header_sed"`
52633
52634           gl_header=$gl_cv_absolute_sys_utsname_h
52635           gl_cv_next_sys_utsname_h='"'$gl_header'"'
52636          else
52637               gl_cv_next_sys_utsname_h='<'sys/utsname.h'>'
52638             fi
52639
52640
52641fi
52642{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_utsname_h" >&5
52643$as_echo "$gl_cv_next_sys_utsname_h" >&6; }
52644     fi
52645     NEXT_SYS_UTSNAME_H=$gl_cv_next_sys_utsname_h
52646
52647     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
52648       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
52649       gl_next_as_first_directive='<'sys/utsname.h'>'
52650     else
52651       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
52652       gl_next_as_first_directive=$gl_cv_next_sys_utsname_h
52653     fi
52654     NEXT_AS_FIRST_DIRECTIVE_SYS_UTSNAME_H=$gl_next_as_first_directive
52655
52656
52657
52658
52659  if test $ac_cv_header_sys_utsname_h != yes; then
52660    HAVE_SYS_UTSNAME_H=0
52661    HAVE_STRUCT_UTSNAME=0
52662  else
52663    HAVE_SYS_UTSNAME_H=1
52664    ac_fn_c_check_type "$LINENO" "struct utsname" "ac_cv_type_struct_utsname" "
52665/* Minix 3.1.8 has a bug: <stddef.h> must be included before
52666   <sys/utsname.h>.  */
52667#include <stddef.h>
52668#include <sys/utsname.h>
52669
52670"
52671if test "x$ac_cv_type_struct_utsname" = xyes; then :
52672
52673cat >>confdefs.h <<_ACEOF
52674#define HAVE_STRUCT_UTSNAME 1
52675_ACEOF
52676
52677
52678else
52679  HAVE_STRUCT_UTSNAME=0
52680fi
52681
52682  fi
52683
52684
52685
52686
52687
52688
52689
52690
52691
52692
52693
52694
52695
52696
52697
52698
52699
52700     if test $gl_cv_have_include_next = yes; then
52701       gl_cv_next_sys_wait_h='<'sys/wait.h'>'
52702     else
52703       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/wait.h>" >&5
52704$as_echo_n "checking absolute name of <sys/wait.h>... " >&6; }
52705if ${gl_cv_next_sys_wait_h+:} false; then :
52706  $as_echo_n "(cached) " >&6
52707else
52708
52709             if test $ac_cv_header_sys_wait_h = yes; then
52710
52711
52712
52713
52714  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52715/* end confdefs.h.  */
52716#include <sys/wait.h>
52717_ACEOF
52718                case "$host_os" in
52719    aix*) gl_absname_cpp="$ac_cpp -C" ;;
52720    *)    gl_absname_cpp="$ac_cpp" ;;
52721  esac
52722
52723  case "$host_os" in
52724    mingw*)
52725                                          gl_dirsep_regex='[/\\]'
52726      ;;
52727    *)
52728      gl_dirsep_regex='\/'
52729      ;;
52730  esac
52731      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
52732  gl_header_literal_regex=`echo 'sys/wait.h' \
52733                           | sed -e "$gl_make_literal_regex_sed"`
52734  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
52735      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
52736      s|^/[^/]|//&|
52737      p
52738      q
52739    }'
52740
52741        gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
52742  sed -n "$gl_absolute_header_sed"`
52743
52744           gl_header=$gl_cv_absolute_sys_wait_h
52745           gl_cv_next_sys_wait_h='"'$gl_header'"'
52746          else
52747               gl_cv_next_sys_wait_h='<'sys/wait.h'>'
52748             fi
52749
52750
52751fi
52752{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5
52753$as_echo "$gl_cv_next_sys_wait_h" >&6; }
52754     fi
52755     NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h
52756
52757     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
52758       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
52759       gl_next_as_first_directive='<'sys/wait.h'>'
52760     else
52761       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
52762       gl_next_as_first_directive=$gl_cv_next_sys_wait_h
52763     fi
52764     NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive
52765
52766
52767
52768
52769
52770
52771
52772
52773
52774
52775
52776
52777  :
52778
52779
52780
52781
52782
52783
52784
52785
52786
52787
52788
52789
52790
52791
52792     if test $gl_cv_have_include_next = yes; then
52793       gl_cv_next_termios_h='<'termios.h'>'
52794     else
52795       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <termios.h>" >&5
52796$as_echo_n "checking absolute name of <termios.h>... " >&6; }
52797if ${gl_cv_next_termios_h+:} false; then :
52798  $as_echo_n "(cached) " >&6
52799else
52800
52801             if test $ac_cv_header_termios_h = yes; then
52802
52803
52804
52805
52806  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52807/* end confdefs.h.  */
52808#include <termios.h>
52809_ACEOF
52810                case "$host_os" in
52811    aix*) gl_absname_cpp="$ac_cpp -C" ;;
52812    *)    gl_absname_cpp="$ac_cpp" ;;
52813  esac
52814
52815  case "$host_os" in
52816    mingw*)
52817                                          gl_dirsep_regex='[/\\]'
52818      ;;
52819    *)
52820      gl_dirsep_regex='\/'
52821      ;;
52822  esac
52823      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
52824  gl_header_literal_regex=`echo 'termios.h' \
52825                           | sed -e "$gl_make_literal_regex_sed"`
52826  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
52827      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
52828      s|^/[^/]|//&|
52829      p
52830      q
52831    }'
52832
52833        gl_cv_absolute_termios_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
52834  sed -n "$gl_absolute_header_sed"`
52835
52836           gl_header=$gl_cv_absolute_termios_h
52837           gl_cv_next_termios_h='"'$gl_header'"'
52838          else
52839               gl_cv_next_termios_h='<'termios.h'>'
52840             fi
52841
52842
52843fi
52844{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_termios_h" >&5
52845$as_echo "$gl_cv_next_termios_h" >&6; }
52846     fi
52847     NEXT_TERMIOS_H=$gl_cv_next_termios_h
52848
52849     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
52850       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
52851       gl_next_as_first_directive='<'termios.h'>'
52852     else
52853       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
52854       gl_next_as_first_directive=$gl_cv_next_termios_h
52855     fi
52856     NEXT_AS_FIRST_DIRECTIVE_TERMIOS_H=$gl_next_as_first_directive
52857
52858
52859
52860
52861  if test $ac_cv_header_termios_h != yes; then
52862    HAVE_TERMIOS_H=0
52863  fi
52864
52865
52866
52867
52868
52869
52870
52871
52872
52873
52874
52875
52876
52877
52878
52879
52880
52881
52882      ac_fn_c_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "#include <time.h>
52883"
52884if test "x$ac_cv_have_decl_localtime_r" = xyes; then :
52885  ac_have_decl=1
52886else
52887  ac_have_decl=0
52888fi
52889
52890cat >>confdefs.h <<_ACEOF
52891#define HAVE_DECL_LOCALTIME_R $ac_have_decl
52892_ACEOF
52893
52894  if test $ac_cv_have_decl_localtime_r = no; then
52895    HAVE_DECL_LOCALTIME_R=0
52896  fi
52897
52898
52899  if test $ac_cv_func_localtime_r = yes; then
52900    HAVE_LOCALTIME_R=1
52901    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
52902$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
52903if ${gl_cv_time_r_posix+:} false; then :
52904  $as_echo_n "(cached) " >&6
52905else
52906  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52907/* end confdefs.h.  */
52908#include <time.h>
52909int
52910main ()
52911{
52912/* We don't need to append 'restrict's to the argument types,
52913                 even though the POSIX signature has the 'restrict's,
52914                 since C99 says they can't affect type compatibility.  */
52915              struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
52916              if (ptr) return 0;
52917              /* Check the return type is a pointer.
52918                 On HP-UX 10 it is 'int'.  */
52919              *localtime_r (0, 0);
52920  ;
52921  return 0;
52922}
52923
52924_ACEOF
52925if ac_fn_c_try_compile "$LINENO"; then :
52926  gl_cv_time_r_posix=yes
52927else
52928  gl_cv_time_r_posix=no
52929fi
52930rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52931
52932fi
52933{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
52934$as_echo "$gl_cv_time_r_posix" >&6; }
52935    if test $gl_cv_time_r_posix = yes; then
52936      REPLACE_LOCALTIME_R=0
52937    else
52938      REPLACE_LOCALTIME_R=1
52939    fi
52940  else
52941    HAVE_LOCALTIME_R=0
52942  fi
52943
52944  if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
52945
52946
52947
52948
52949
52950
52951
52952
52953  gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext"
52954
52955
52956  :
52957
52958  fi
52959
52960
52961
52962
52963
52964          GNULIB_TIME_R=1
52965
52966
52967
52968
52969
52970$as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h
52971
52972
52973
52974
52975
52976
52977
52978
52979  # Mac OS X 10.6 loops forever with some time_t values.
52980  # See Bug#27706, Bug#27736, and
52981  # https://lists.gnu.org/r/bug-gnulib/2017-07/msg00142.html
52982  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime loops forever near extrema" >&5
52983$as_echo_n "checking whether localtime loops forever near extrema... " >&6; }
52984if ${gl_cv_func_localtime_infloop_bug+:} false; then :
52985  $as_echo_n "(cached) " >&6
52986else
52987  gl_cv_func_localtime_infloop_bug=no
52988     if test "$cross_compiling" = yes; then :
52989  gl_cv_func_localtime_infloop_bug="guessing no"
52990else
52991  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52992/* end confdefs.h.  */
52993#include <stdlib.h>
52994            #include <string.h>
52995            #include <unistd.h>
52996            #include <time.h>
52997
52998int
52999main ()
53000{
53001
53002            time_t t = -67768038400666600;
53003            struct tm *tm;
53004            char *tz = getenv ("TZ");
53005            if (! (tz && strcmp (tz, "QQQ0") == 0))
53006              return 0;
53007            alarm (2);
53008            tm = localtime (&t);
53009            /* Use TM and *TM to suppress over-optimization.  */
53010            return tm && tm->tm_isdst;
53011
53012  ;
53013  return 0;
53014}
53015_ACEOF
53016if ac_fn_c_try_run "$LINENO"; then :
53017  (TZ=QQQ0 ./conftest$EXEEXT) >/dev/null 2>&1 ||
53018           gl_cv_func_localtime_infloop_bug=yes
53019fi
53020rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
53021  conftest.$ac_objext conftest.beam conftest.$ac_ext
53022fi
53023
53024fi
53025{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_infloop_bug" >&5
53026$as_echo "$gl_cv_func_localtime_infloop_bug" >&6; }
53027  if test "$gl_cv_func_localtime_infloop_bug" = yes; then
53028
53029$as_echo "#define HAVE_LOCALTIME_INFLOOP_BUG 1" >>confdefs.h
53030
53031  fi
53032
53033  ac_fn_c_check_type "$LINENO" "timezone_t" "ac_cv_type_timezone_t" "#include <time.h>
53034"
53035if test "x$ac_cv_type_timezone_t" = xyes; then :
53036
53037cat >>confdefs.h <<_ACEOF
53038#define HAVE_TIMEZONE_T 1
53039_ACEOF
53040
53041
53042fi
53043
53044  if test "$ac_cv_type_timezone_t" = yes; then
53045    HAVE_TIMEZONE_T=1
53046  fi
53047
53048  if test $HAVE_TIMEZONE_T = 0; then
53049
53050
53051
53052
53053
53054
53055
53056
53057  gl_LIBOBJS="$gl_LIBOBJS time_rz.$ac_objext"
53058
53059  fi
53060
53061
53062
53063
53064
53065          GNULIB_TIME_RZ=1
53066
53067
53068
53069
53070
53071$as_echo "#define GNULIB_TEST_TIME_RZ 1" >>confdefs.h
53072
53073
53074
53075
53076
53077
53078  REPLACE_TIMEGM=0
53079
53080  if test $ac_cv_func_timegm = yes; then
53081    if test "$gl_cv_func_working_mktime" != yes; then
53082      # Assume that timegm is buggy if mktime is.
53083      REPLACE_TIMEGM=1
53084    fi
53085  else
53086    HAVE_TIMEGM=0
53087  fi
53088
53089  if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then
53090
53091
53092
53093
53094
53095
53096
53097
53098  gl_LIBOBJS="$gl_LIBOBJS timegm.$ac_objext"
53099
53100
53101  :
53102
53103  fi
53104
53105
53106
53107
53108
53109          GNULIB_TIMEGM=1
53110
53111
53112
53113
53114
53115$as_echo "#define GNULIB_TEST_TIMEGM 1" >>confdefs.h
53116
53117
53118
53119
53120
53121
53122
53123
53124
53125  LIB_TIMER_TIME=
53126
53127  gl_saved_libs=$LIBS
53128    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing timer_settime" >&5
53129$as_echo_n "checking for library containing timer_settime... " >&6; }
53130if ${ac_cv_search_timer_settime+:} false; then :
53131  $as_echo_n "(cached) " >&6
53132else
53133  ac_func_search_save_LIBS=$LIBS
53134cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53135/* end confdefs.h.  */
53136
53137/* Override any GCC internal prototype to avoid an error.
53138   Use char because int might match the return type of a GCC
53139   builtin and then its argument prototype would still apply.  */
53140#ifdef __cplusplus
53141extern "C"
53142#endif
53143char timer_settime ();
53144int
53145main ()
53146{
53147return timer_settime ();
53148  ;
53149  return 0;
53150}
53151_ACEOF
53152for ac_lib in '' rt posix4; do
53153  if test -z "$ac_lib"; then
53154    ac_res="none required"
53155  else
53156    ac_res=-l$ac_lib
53157    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
53158  fi
53159  if ac_fn_c_try_link "$LINENO"; then :
53160  ac_cv_search_timer_settime=$ac_res
53161fi
53162rm -f core conftest.err conftest.$ac_objext \
53163    conftest$ac_exeext
53164  if ${ac_cv_search_timer_settime+:} false; then :
53165  break
53166fi
53167done
53168if ${ac_cv_search_timer_settime+:} false; then :
53169
53170else
53171  ac_cv_search_timer_settime=no
53172fi
53173rm conftest.$ac_ext
53174LIBS=$ac_func_search_save_LIBS
53175fi
53176{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_timer_settime" >&5
53177$as_echo "$ac_cv_search_timer_settime" >&6; }
53178ac_res=$ac_cv_search_timer_settime
53179if test "$ac_res" != no; then :
53180  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
53181  test "$ac_cv_search_timer_settime" = "none required" ||
53182                    LIB_TIMER_TIME=$ac_cv_search_timer_settime
53183fi
53184
53185                                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53186/* end confdefs.h.  */
53187#include <features.h>
53188          #ifdef __GNU_LIBRARY__
53189           #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \
53190               && !(__UCLIBC__ && __HAS_NO_THREADS__)
53191            Thread emulation available
53192           #endif
53193          #endif
53194
53195_ACEOF
53196if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
53197  $EGREP "Thread" >/dev/null 2>&1; then :
53198  LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"
53199fi
53200rm -f conftest*
53201
53202    for ac_func in timer_settime
53203do :
53204  ac_fn_c_check_func "$LINENO" "timer_settime" "ac_cv_func_timer_settime"
53205if test "x$ac_cv_func_timer_settime" = xyes; then :
53206  cat >>confdefs.h <<_ACEOF
53207#define HAVE_TIMER_SETTIME 1
53208_ACEOF
53209
53210fi
53211done
53212
53213  LIBS=$gl_saved_libs
53214
53215  :
53216
53217
53218
53219
53220
53221
53222
53223
53224  if test $ac_cv_func_tzset = no; then
53225    HAVE_TZSET=0
53226  fi
53227
53228     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tzset clobbers localtime buffer" >&5
53229$as_echo_n "checking whether tzset clobbers localtime buffer... " >&6; }
53230if ${gl_cv_func_tzset_clobber+:} false; then :
53231  $as_echo_n "(cached) " >&6
53232else
53233  if test "$cross_compiling" = yes; then :
53234  case "$host_os" in
53235                         # Guess all is fine on glibc systems.
53236          *-gnu* | gnu*) gl_cv_func_tzset_clobber="guessing no" ;;
53237                         # Guess no on native Windows.
53238          mingw*)        gl_cv_func_tzset_clobber="guessing no" ;;
53239                         # If we don't know, assume the worst.
53240          *)             gl_cv_func_tzset_clobber="guessing yes" ;;
53241        esac
53242
53243else
53244  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53245/* end confdefs.h.  */
53246
53247#include <time.h>
53248#include <stdlib.h>
53249
53250int
53251main ()
53252{
53253  time_t t1 = 853958121;
53254  struct tm *p, s;
53255  putenv ("TZ=GMT0");
53256  p = localtime (&t1);
53257  s = *p;
53258  putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00");
53259  tzset ();
53260  return (p->tm_year != s.tm_year
53261          || p->tm_mon != s.tm_mon
53262          || p->tm_mday != s.tm_mday
53263          || p->tm_hour != s.tm_hour
53264          || p->tm_min != s.tm_min
53265          || p->tm_sec != s.tm_sec);
53266}
53267
53268_ACEOF
53269if ac_fn_c_try_run "$LINENO"; then :
53270  gl_cv_func_tzset_clobber=no
53271else
53272  gl_cv_func_tzset_clobber=yes
53273fi
53274rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
53275  conftest.$ac_objext conftest.beam conftest.$ac_ext
53276fi
53277
53278
53279fi
53280{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_tzset_clobber" >&5
53281$as_echo "$gl_cv_func_tzset_clobber" >&6; }
53282
53283
53284$as_echo "#define HAVE_RUN_TZSET_TEST 1" >>confdefs.h
53285
53286
53287  REPLACE_TZSET=0
53288  case "$gl_cv_func_tzset_clobber" in
53289    *yes)
53290      REPLACE_TZSET=1
53291
53292$as_echo "#define TZSET_CLOBBERS_LOCALTIME 1" >>confdefs.h
53293
53294
53295
53296
53297  NEED_LOCALTIME_BUFFER=1
53298  REPLACE_GMTIME=1
53299  REPLACE_LOCALTIME=1
53300
53301      ;;
53302  esac
53303  case "$host_os" in
53304    mingw*) REPLACE_TZSET=1 ;;
53305  esac
53306
53307  if test $HAVE_TZSET = 0 || test $REPLACE_TZSET = 1; then
53308
53309
53310
53311
53312
53313
53314
53315
53316  gl_LIBOBJS="$gl_LIBOBJS tzset.$ac_objext"
53317
53318  fi
53319
53320
53321
53322
53323
53324          GNULIB_TZSET=1
53325
53326
53327
53328
53329
53330$as_echo "#define GNULIB_TEST_TZSET 1" >>confdefs.h
53331
53332
53333
53334
53335
53336  for ac_func in uname
53337do :
53338  ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname"
53339if test "x$ac_cv_func_uname" = xyes; then :
53340  cat >>confdefs.h <<_ACEOF
53341#define HAVE_UNAME 1
53342_ACEOF
53343
53344fi
53345done
53346
53347  if test $ac_cv_func_uname = no; then
53348    HAVE_UNAME=0
53349  fi
53350
53351  if test $HAVE_UNAME = 0; then
53352
53353
53354
53355
53356
53357
53358
53359
53360  gl_LIBOBJS="$gl_LIBOBJS uname.$ac_objext"
53361
53362
53363  :
53364
53365  fi
53366
53367
53368
53369
53370
53371          GNULIB_UNAME=1
53372
53373
53374
53375
53376
53377    :
53378
53379
53380
53381
53382
53383
53384
53385
53386
53387
53388
53389
53390
53391     if test $gl_cv_have_include_next = yes; then
53392       gl_cv_next_unistd_h='<'unistd.h'>'
53393     else
53394       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
53395$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
53396if ${gl_cv_next_unistd_h+:} false; then :
53397  $as_echo_n "(cached) " >&6
53398else
53399
53400             if test $ac_cv_header_unistd_h = yes; then
53401
53402
53403
53404
53405  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53406/* end confdefs.h.  */
53407#include <unistd.h>
53408_ACEOF
53409                case "$host_os" in
53410    aix*) gl_absname_cpp="$ac_cpp -C" ;;
53411    *)    gl_absname_cpp="$ac_cpp" ;;
53412  esac
53413
53414  case "$host_os" in
53415    mingw*)
53416                                          gl_dirsep_regex='[/\\]'
53417      ;;
53418    *)
53419      gl_dirsep_regex='\/'
53420      ;;
53421  esac
53422      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
53423  gl_header_literal_regex=`echo 'unistd.h' \
53424                           | sed -e "$gl_make_literal_regex_sed"`
53425  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
53426      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
53427      s|^/[^/]|//&|
53428      p
53429      q
53430    }'
53431
53432        gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
53433  sed -n "$gl_absolute_header_sed"`
53434
53435           gl_header=$gl_cv_absolute_unistd_h
53436           gl_cv_next_unistd_h='"'$gl_header'"'
53437          else
53438               gl_cv_next_unistd_h='<'unistd.h'>'
53439             fi
53440
53441
53442fi
53443{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
53444$as_echo "$gl_cv_next_unistd_h" >&6; }
53445     fi
53446     NEXT_UNISTD_H=$gl_cv_next_unistd_h
53447
53448     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
53449       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
53450       gl_next_as_first_directive='<'unistd.h'>'
53451     else
53452       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
53453       gl_next_as_first_directive=$gl_cv_next_unistd_h
53454     fi
53455     NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
53456
53457
53458
53459
53460  if test $ac_cv_header_unistd_h = yes; then
53461    HAVE_UNISTD_H=1
53462  else
53463    HAVE_UNISTD_H=0
53464  fi
53465
53466
53467
53468
53469
53470
53471
53472
53473
53474
53475
53476
53477
53478      if  { test "$HAVE_LIBUNISTRING" != yes \
53479    || {
53480
53481
53482
53483            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
53484            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
53485                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
53486                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
53487                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4
53488                         }
53489                    }
53490               }
53491
53492
53493
53494
53495       }
53496  }; then
53497    LIBUNISTRING_UNISTR_H='unistr.h'
53498  else
53499    LIBUNISTRING_UNISTR_H=
53500  fi
53501
53502
53503
53504
53505cat >>confdefs.h <<_ACEOF
53506#define GNULIB_UNISTR_U8_MBTOUCR 1
53507_ACEOF
53508
53509
53510
53511
53512       if  { test "$HAVE_LIBUNISTRING" != yes \
53513    || {
53514
53515
53516
53517            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
53518            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
53519                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
53520                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
53521                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0
53522                         }
53523                    }
53524               }
53525
53526
53527
53528
53529       }
53530  }; then
53531  LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE=
53532  LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE='#'
53533else
53534  LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE='#'
53535  LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE=
53536fi
53537
53538
53539
53540
53541cat >>confdefs.h <<_ACEOF
53542#define GNULIB_UNISTR_U8_UCTOMB 1
53543_ACEOF
53544
53545
53546
53547
53548       if  { test "$HAVE_LIBUNISTRING" != yes \
53549    || {
53550
53551
53552
53553            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
53554            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
53555                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
53556                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
53557                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0
53558                         }
53559                    }
53560               }
53561
53562
53563
53564
53565       }
53566  }; then
53567  LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE=
53568  LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE='#'
53569else
53570  LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE='#'
53571  LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE=
53572fi
53573
53574
53575
53576
53577      if  { test "$HAVE_LIBUNISTRING" != yes \
53578    || {
53579
53580
53581
53582            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
53583            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
53584                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
53585                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
53586                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4
53587                         }
53588                    }
53589               }
53590
53591
53592
53593
53594       }
53595  }; then
53596    LIBUNISTRING_UNITYPES_H='unitypes.h'
53597  else
53598    LIBUNISTRING_UNITYPES_H=
53599  fi
53600
53601
53602
53603
53604      if  { test "$HAVE_LIBUNISTRING" != yes \
53605    || {
53606
53607
53608
53609            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
53610            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
53611                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
53612                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
53613                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4
53614                         }
53615                    }
53616               }
53617
53618
53619
53620
53621       }
53622  }; then
53623    LIBUNISTRING_UNIWIDTH_H='uniwidth.h'
53624  else
53625    LIBUNISTRING_UNIWIDTH_H=
53626  fi
53627
53628
53629
53630
53631       if  { test "$HAVE_LIBUNISTRING" != yes \
53632    || {
53633
53634
53635
53636            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
53637            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
53638                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
53639                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
53640                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 8
53641                         }
53642                    }
53643               }
53644
53645
53646
53647
53648       }
53649  }; then
53650  LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE=
53651  LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE='#'
53652else
53653  LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE='#'
53654  LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE=
53655fi
53656
53657
53658
53659
53660
53661
53662
53663    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unlink honors trailing slashes" >&5
53664$as_echo_n "checking whether unlink honors trailing slashes... " >&6; }
53665if ${gl_cv_func_unlink_honors_slashes+:} false; then :
53666  $as_echo_n "(cached) " >&6
53667else
53668  touch conftest.file
53669     # Assume that if we have lstat, we can also check symlinks.
53670     if test $ac_cv_func_lstat = yes; then
53671       ln -s conftest.file conftest.lnk
53672     fi
53673     if test "$cross_compiling" = yes; then :
53674  case "$host_os" in
53675                          # Guess yes on Linux systems.
53676         linux-* | linux) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
53677                          # Guess yes on glibc systems.
53678         *-gnu*)          gl_cv_func_unlink_honors_slashes="guessing yes" ;;
53679                          # Guess no on native Windows.
53680         mingw*)          gl_cv_func_unlink_honors_slashes="guessing no" ;;
53681                          # If we don't know, assume the worst.
53682         *)               gl_cv_func_unlink_honors_slashes="guessing no" ;;
53683       esac
53684
53685else
53686  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53687/* end confdefs.h.  */
53688#if HAVE_UNISTD_H
53689           # include <unistd.h>
53690           #else /* on Windows with MSVC */
53691           # include <io.h>
53692           #endif
53693           #include <errno.h>
53694
53695int
53696main ()
53697{
53698int result = 0;
53699           if (!unlink ("conftest.file/"))
53700             result |= 1;
53701           else if (errno != ENOTDIR)
53702             result |= 2;
53703#if HAVE_LSTAT
53704           if (!unlink ("conftest.lnk/"))
53705             result |= 4;
53706           else if (errno != ENOTDIR)
53707             result |= 8;
53708#endif
53709           return result;
53710
53711  ;
53712  return 0;
53713}
53714_ACEOF
53715if ac_fn_c_try_run "$LINENO"; then :
53716  gl_cv_func_unlink_honors_slashes=yes
53717else
53718  gl_cv_func_unlink_honors_slashes=no
53719fi
53720rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
53721  conftest.$ac_objext conftest.beam conftest.$ac_ext
53722fi
53723
53724     rm -f conftest.file conftest.lnk
53725fi
53726{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_honors_slashes" >&5
53727$as_echo "$gl_cv_func_unlink_honors_slashes" >&6; }
53728  case "$gl_cv_func_unlink_honors_slashes" in
53729    *no)
53730      REPLACE_UNLINK=1
53731      ;;
53732  esac
53733
53734      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unlink of a parent directory fails as it should" >&5
53735$as_echo_n "checking whether unlink of a parent directory fails as it should... " >&6; }
53736if ${gl_cv_func_unlink_parent_fails+:} false; then :
53737  $as_echo_n "(cached) " >&6
53738else
53739  case "$host_os" in
53740       darwin*)
53741                                                      if {
53742              # Use the mktemp program if available. If not available, hide the error
53743              # message.
53744              tmp=`(umask 077 && mktemp -d /tmp/gtXXXXXX) 2>/dev/null` &&
53745              test -n "$tmp" && test -d "$tmp"
53746            } ||
53747            {
53748              # Use a simple mkdir command. It is guaranteed to fail if the directory
53749              # already exists.  $RANDOM is bash specific and expands to empty in shells
53750              # other than bash, ksh and zsh.  Its use does not increase security;
53751              # rather, it minimizes the probability of failure in a very cluttered /tmp
53752              # directory.
53753              tmp=/tmp/gt$$-$RANDOM
53754              (umask 077 && mkdir "$tmp")
53755            }; then
53756           mkdir "$tmp/subdir"
53757           GL_SUBDIR_FOR_UNLINK="$tmp/subdir"
53758           export GL_SUBDIR_FOR_UNLINK
53759           if test "$cross_compiling" = yes; then :
53760  # If we don't know, assume the worst.
53761              gl_cv_func_unlink_parent_fails="guessing no"
53762
53763else
53764  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53765/* end confdefs.h.  */
53766
53767                #include <stdlib.h>
53768                #if HAVE_UNISTD_H
53769                # include <unistd.h>
53770                #else /* on Windows with MSVC */
53771                # include <direct.h>
53772                # include <io.h>
53773                #endif
53774                int main ()
53775                {
53776                  int result = 0;
53777                  if (chdir (getenv ("GL_SUBDIR_FOR_UNLINK")) != 0)
53778                    result |= 1;
53779                  else if (unlink ("..") == 0)
53780                    result |= 2;
53781                  return result;
53782                }
53783
53784_ACEOF
53785if ac_fn_c_try_run "$LINENO"; then :
53786  gl_cv_func_unlink_parent_fails=yes
53787else
53788  gl_cv_func_unlink_parent_fails=no
53789fi
53790rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
53791  conftest.$ac_objext conftest.beam conftest.$ac_ext
53792fi
53793
53794           unset GL_SUBDIR_FOR_UNLINK
53795           rm -rf "$tmp"
53796         else
53797           gl_cv_func_unlink_parent_fails="guessing no"
53798         fi
53799         ;;
53800       *)
53801         gl_cv_func_unlink_parent_fails="guessing yes"
53802         ;;
53803     esac
53804
53805fi
53806{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_parent_fails" >&5
53807$as_echo "$gl_cv_func_unlink_parent_fails" >&6; }
53808  case "$gl_cv_func_unlink_parent_fails" in
53809    *no)
53810      REPLACE_UNLINK=1
53811
53812$as_echo "#define UNLINK_PARENT_BUG 1" >>confdefs.h
53813
53814      ;;
53815  esac
53816
53817  if test $REPLACE_UNLINK = 1; then
53818
53819
53820
53821
53822
53823
53824
53825
53826  gl_LIBOBJS="$gl_LIBOBJS unlink.$ac_objext"
53827
53828  fi
53829
53830
53831
53832
53833
53834          GNULIB_UNLINK=1
53835
53836
53837
53838
53839
53840$as_echo "#define GNULIB_TEST_UNLINK 1" >>confdefs.h
53841
53842
53843
53844    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a running program can be unlinked" >&5
53845$as_echo_n "checking whether a running program can be unlinked... " >&6; }
53846if ${gl_cv_func_unlink_busy_text+:} false; then :
53847  $as_echo_n "(cached) " >&6
53848else
53849
53850      if test "$cross_compiling" = yes; then :
53851  case "$host_os" in
53852                   # Guess no on native Windows.
53853           mingw*) gl_cv_func_unlink_busy_text="guessing no" ;;
53854           *)      gl_cv_func_unlink_busy_text="guessing no" ;;
53855         esac
53856
53857
53858else
53859  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53860/* end confdefs.h.  */
53861$ac_includes_default
53862            int
53863            main (int argc, char **argv)
53864            {
53865              int result = 0;
53866              if (argc == 0)
53867                result |= 1;
53868              else if (unlink (argv[0]) != 0)
53869                result |= 2;
53870              return result;
53871            }
53872_ACEOF
53873if ac_fn_c_try_run "$LINENO"; then :
53874  gl_cv_func_unlink_busy_text=yes
53875else
53876  gl_cv_func_unlink_busy_text=no
53877fi
53878rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
53879  conftest.$ac_objext conftest.beam conftest.$ac_ext
53880fi
53881
53882
53883
53884fi
53885{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_busy_text" >&5
53886$as_echo "$gl_cv_func_unlink_busy_text" >&6; }
53887
53888  case "$gl_cv_func_unlink_busy_text" in
53889    *no) INSTALL=$ac_install_sh ;;
53890  esac
53891
53892
53893
53894
53895
53896
53897
53898  if test $ac_cv_func_unlinkat = no; then
53899    HAVE_UNLINKAT=0
53900  else
53901    case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
53902      *no)
53903        # Solaris 9 has *at functions, but uniformly mishandles trailing
53904        # slash in all of them.
53905        REPLACE_UNLINKAT=1
53906        ;;
53907      *)
53908        # GNU/Hurd has unlinkat, but it has the same bug as unlink.
53909        # Darwin has unlinkat, but it has the same UNLINK_PARENT_BUG.
53910        if test $REPLACE_UNLINK = 1; then
53911          REPLACE_UNLINKAT=1
53912        fi
53913        ;;
53914    esac
53915  fi
53916
53917  if test $HAVE_UNLINKAT = 0 || test $REPLACE_UNLINKAT = 1; then
53918
53919
53920
53921
53922
53923
53924
53925
53926  gl_LIBOBJS="$gl_LIBOBJS unlinkat.$ac_objext"
53927
53928  fi
53929
53930
53931
53932
53933
53934          GNULIB_UNLINKAT=1
53935
53936
53937
53938
53939
53940$as_echo "#define GNULIB_TEST_UNLINKAT 1" >>confdefs.h
53941
53942
53943
53944
53945
53946$as_echo "#define USE_UNLOCKED_IO 1" >>confdefs.h
53947
53948
53949
53950
53951
53952
53953
53954
53955
53956
53957
53958
53959
53960
53961
53962
53963
53964
53965
53966
53967
53968  if test $ac_cv_have_decl_unsetenv = no; then
53969    HAVE_DECL_UNSETENV=0
53970  fi
53971  for ac_func in unsetenv
53972do :
53973  ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
53974if test "x$ac_cv_func_unsetenv" = xyes; then :
53975  cat >>confdefs.h <<_ACEOF
53976#define HAVE_UNSETENV 1
53977_ACEOF
53978
53979fi
53980done
53981
53982  if test $ac_cv_func_unsetenv = no; then
53983    HAVE_UNSETENV=0
53984  else
53985    HAVE_UNSETENV=1
53986        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
53987$as_echo_n "checking for unsetenv() return type... " >&6; }
53988if ${gt_cv_func_unsetenv_ret+:} false; then :
53989  $as_echo_n "(cached) " >&6
53990else
53991  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53992/* end confdefs.h.  */
53993
53994#undef _BSD
53995#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
53996#include <stdlib.h>
53997extern
53998#ifdef __cplusplus
53999"C"
54000#endif
54001int unsetenv (const char *name);
54002
54003int
54004main ()
54005{
54006
54007  ;
54008  return 0;
54009}
54010_ACEOF
54011if ac_fn_c_try_compile "$LINENO"; then :
54012  gt_cv_func_unsetenv_ret='int'
54013else
54014  gt_cv_func_unsetenv_ret='void'
54015fi
54016rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54017fi
54018{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
54019$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
54020    if test $gt_cv_func_unsetenv_ret = 'void'; then
54021
54022$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
54023
54024      REPLACE_UNSETENV=1
54025    fi
54026
54027                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
54028$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
54029if ${gl_cv_func_unsetenv_works+:} false; then :
54030  $as_echo_n "(cached) " >&6
54031else
54032  if test "$cross_compiling" = yes; then :
54033  case "$host_os" in
54034                 # Guess yes on glibc systems.
54035         *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
54036                 # If we don't know, assume the worst.
54037         *)      gl_cv_func_unsetenv_works="guessing no" ;;
54038       esac
54039
54040else
54041  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54042/* end confdefs.h.  */
54043
54044       #include <stdlib.h>
54045       #include <errno.h>
54046       extern char **environ;
54047
54048int
54049main ()
54050{
54051
54052       char entry1[] = "a=1";
54053       char entry2[] = "b=2";
54054       char *env[] = { entry1, entry2, NULL };
54055       if (putenv ((char *) "a=1")) return 1;
54056       if (putenv (entry2)) return 2;
54057       entry2[0] = 'a';
54058       unsetenv ("a");
54059       if (getenv ("a")) return 3;
54060       if (!unsetenv ("") || errno != EINVAL) return 4;
54061       entry2[0] = 'b';
54062       environ = env;
54063       if (!getenv ("a")) return 5;
54064       entry2[0] = 'a';
54065       unsetenv ("a");
54066       if (getenv ("a")) return 6;
54067
54068  ;
54069  return 0;
54070}
54071_ACEOF
54072if ac_fn_c_try_run "$LINENO"; then :
54073  gl_cv_func_unsetenv_works=yes
54074else
54075  gl_cv_func_unsetenv_works=no
54076fi
54077rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
54078  conftest.$ac_objext conftest.beam conftest.$ac_ext
54079fi
54080
54081fi
54082{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
54083$as_echo "$gl_cv_func_unsetenv_works" >&6; }
54084    case "$gl_cv_func_unsetenv_works" in
54085      *yes) ;;
54086      *)
54087        REPLACE_UNSETENV=1
54088        ;;
54089    esac
54090  fi
54091
54092  if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
54093
54094
54095
54096
54097
54098
54099
54100
54101  gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext"
54102
54103
54104
54105
54106
54107  fi
54108
54109
54110
54111
54112
54113          GNULIB_UNSETENV=1
54114
54115
54116
54117
54118
54119$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
54120
54121
54122
54123
54124  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc/uptime" >&5
54125$as_echo_n "checking for /proc/uptime... " >&6; }
54126if ${gl_cv_have_proc_uptime+:} false; then :
54127  $as_echo_n "(cached) " >&6
54128else
54129  gl_cv_have_proc_uptime=no
54130    test -f /proc/uptime \
54131      && test "$cross_compiling" = no \
54132      && cat < /proc/uptime >/dev/null 2>/dev/null \
54133      && gl_cv_have_proc_uptime=yes
54134fi
54135{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_proc_uptime" >&5
54136$as_echo "$gl_cv_have_proc_uptime" >&6; }
54137  if test $gl_cv_have_proc_uptime = yes; then
54138
54139$as_echo "#define HAVE_PROC_UPTIME 1" >>confdefs.h
54140
54141  fi
54142
54143
54144
54145
54146
54147
54148
54149
54150  if test $ac_cv_func_utime = no; then
54151    HAVE_UTIME=0
54152  else
54153    case "$host_os" in
54154      mingw*)
54155                        REPLACE_UTIME=1
54156        ;;
54157    esac
54158  fi
54159
54160  if test $HAVE_UTIME = 0 || test $REPLACE_UTIME = 1; then
54161
54162
54163
54164
54165
54166
54167
54168
54169  gl_LIBOBJS="$gl_LIBOBJS utime.$ac_objext"
54170
54171    :
54172  fi
54173
54174
54175
54176
54177
54178          GNULIB_UTIME=1
54179
54180
54181
54182
54183
54184$as_echo "#define GNULIB_TEST_UTIME 1" >>confdefs.h
54185
54186
54187
54188
54189
54190
54191
54192
54193
54194
54195
54196
54197
54198
54199
54200
54201     if test $gl_cv_have_include_next = yes; then
54202       gl_cv_next_utime_h='<'utime.h'>'
54203     else
54204       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <utime.h>" >&5
54205$as_echo_n "checking absolute name of <utime.h>... " >&6; }
54206if ${gl_cv_next_utime_h+:} false; then :
54207  $as_echo_n "(cached) " >&6
54208else
54209
54210             if test $ac_cv_header_utime_h = yes; then
54211
54212
54213
54214
54215  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54216/* end confdefs.h.  */
54217#include <utime.h>
54218_ACEOF
54219                case "$host_os" in
54220    aix*) gl_absname_cpp="$ac_cpp -C" ;;
54221    *)    gl_absname_cpp="$ac_cpp" ;;
54222  esac
54223
54224  case "$host_os" in
54225    mingw*)
54226                                          gl_dirsep_regex='[/\\]'
54227      ;;
54228    *)
54229      gl_dirsep_regex='\/'
54230      ;;
54231  esac
54232      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
54233  gl_header_literal_regex=`echo 'utime.h' \
54234                           | sed -e "$gl_make_literal_regex_sed"`
54235  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
54236      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
54237      s|^/[^/]|//&|
54238      p
54239      q
54240    }'
54241
54242        gl_cv_absolute_utime_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
54243  sed -n "$gl_absolute_header_sed"`
54244
54245           gl_header=$gl_cv_absolute_utime_h
54246           gl_cv_next_utime_h='"'$gl_header'"'
54247          else
54248               gl_cv_next_utime_h='<'utime.h'>'
54249             fi
54250
54251
54252fi
54253{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_utime_h" >&5
54254$as_echo "$gl_cv_next_utime_h" >&6; }
54255     fi
54256     NEXT_UTIME_H=$gl_cv_next_utime_h
54257
54258     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
54259       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
54260       gl_next_as_first_directive='<'utime.h'>'
54261     else
54262       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
54263       gl_next_as_first_directive=$gl_cv_next_utime_h
54264     fi
54265     NEXT_AS_FIRST_DIRECTIVE_UTIME_H=$gl_next_as_first_directive
54266
54267
54268
54269
54270
54271  if test $ac_cv_header_utime_h = yes; then
54272    HAVE_UTIME_H=1
54273  else
54274    HAVE_UTIME_H=0
54275  fi
54276
54277
54278  UTIME_H=''
54279  if test $ac_cv_header_utime_h != yes; then
54280        UTIME_H=utime.h
54281  else
54282    case "$host_os" in
54283      mingw*)         UTIME_H=utime.h
54284        ;;
54285    esac
54286  fi
54287
54288   if test -n "$UTIME_H"; then
54289  GL_GENERATE_UTIME_H_TRUE=
54290  GL_GENERATE_UTIME_H_FALSE='#'
54291else
54292  GL_GENERATE_UTIME_H_TRUE='#'
54293  GL_GENERATE_UTIME_H_FALSE=
54294fi
54295
54296
54297
54298
54299
54300
54301  :
54302
54303
54304
54305
54306
54307
54308  if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
54309                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether futimesat handles NULL file" >&5
54310$as_echo_n "checking whether futimesat handles NULL file... " >&6; }
54311if ${gl_cv_func_futimesat_works+:} false; then :
54312  $as_echo_n "(cached) " >&6
54313else
54314  touch conftest.file
54315       if test "$cross_compiling" = yes; then :
54316  case "$host_os" in
54317                            # Guess yes on Linux systems.
54318           linux-* | linux) gl_cv_func_futimesat_works="guessing yes" ;;
54319                            # Guess yes on glibc systems.
54320           *-gnu*)          gl_cv_func_futimesat_works="guessing yes" ;;
54321                            # If we don't know, assume the worst.
54322           *)               gl_cv_func_futimesat_works="guessing no" ;;
54323         esac
54324
54325else
54326  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54327/* end confdefs.h.  */
54328
54329#include <stddef.h>
54330#include <sys/times.h>
54331#include <fcntl.h>
54332
54333int
54334main ()
54335{
54336    int fd = open ("conftest.file", O_RDWR);
54337          if (fd < 0) return 1;
54338          if (futimesat (fd, NULL, NULL)) return 2;
54339
54340  ;
54341  return 0;
54342}
54343_ACEOF
54344if ac_fn_c_try_run "$LINENO"; then :
54345  gl_cv_func_futimesat_works=yes
54346else
54347  gl_cv_func_futimesat_works=no
54348fi
54349rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
54350  conftest.$ac_objext conftest.beam conftest.$ac_ext
54351fi
54352
54353      rm -f conftest.file
54354fi
54355{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_futimesat_works" >&5
54356$as_echo "$gl_cv_func_futimesat_works" >&6; }
54357    case "$gl_cv_func_futimesat_works" in
54358      *yes) ;;
54359      *)
54360
54361$as_echo "#define FUTIMESAT_NULL_BUG 1" >>confdefs.h
54362
54363        ;;
54364    esac
54365  fi
54366
54367
54368
54369
54370
54371  if test $ac_cv_func_utimensat = no; then
54372    HAVE_UTIMENSAT=0
54373  else
54374    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether utimensat works" >&5
54375$as_echo_n "checking whether utimensat works... " >&6; }
54376if ${gl_cv_func_utimensat_works+:} false; then :
54377  $as_echo_n "(cached) " >&6
54378else
54379  if test "$cross_compiling" = yes; then :
54380  gl_cv_func_utimensat_works="guessing yes"
54381else
54382  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54383/* end confdefs.h.  */
54384
54385#include <fcntl.h>
54386#include <sys/stat.h>
54387#include <unistd.h>
54388
54389int
54390main ()
54391{
54392int result = 0;
54393              const char *f = "conftest.file";
54394              if (close (creat (f, 0600)))
54395                return 1;
54396              /* Test whether the AT_SYMLINK_NOFOLLOW flag is supported.  */
54397              {
54398                if (utimensat (AT_FDCWD, f, NULL, AT_SYMLINK_NOFOLLOW))
54399                  result |= 2;
54400              }
54401              /* Test whether UTIME_NOW and UTIME_OMIT work.  */
54402              {
54403                struct timespec ts[2];
54404                ts[0].tv_sec = 1;
54405                ts[0].tv_nsec = UTIME_OMIT;
54406                ts[1].tv_sec = 1;
54407                ts[1].tv_nsec = UTIME_NOW;
54408                if (utimensat (AT_FDCWD, f, ts, 0))
54409                  result |= 4;
54410              }
54411              sleep (1);
54412              {
54413                struct stat st;
54414                struct timespec ts[2];
54415                ts[0].tv_sec = 1;
54416                ts[0].tv_nsec = UTIME_NOW;
54417                ts[1].tv_sec = 1;
54418                ts[1].tv_nsec = UTIME_OMIT;
54419                if (utimensat (AT_FDCWD, f, ts, 0))
54420                  result |= 8;
54421                if (stat (f, &st))
54422                  result |= 16;
54423                else if (st.st_ctime < st.st_atime)
54424                  result |= 32;
54425              }
54426              return result;
54427
54428  ;
54429  return 0;
54430}
54431_ACEOF
54432if ac_fn_c_try_run "$LINENO"; then :
54433  gl_cv_func_utimensat_works=yes
54434else
54435  gl_cv_func_utimensat_works=no
54436fi
54437rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
54438  conftest.$ac_objext conftest.beam conftest.$ac_ext
54439fi
54440
54441fi
54442{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_utimensat_works" >&5
54443$as_echo "$gl_cv_func_utimensat_works" >&6; }
54444    if test "$gl_cv_func_utimensat_works" = no; then
54445      REPLACE_UTIMENSAT=1
54446    fi
54447  fi
54448
54449  if test $HAVE_UTIMENSAT = 0 || test $REPLACE_UTIMENSAT = 1; then
54450
54451
54452
54453
54454
54455
54456
54457
54458  gl_LIBOBJS="$gl_LIBOBJS utimensat.$ac_objext"
54459
54460  fi
54461
54462
54463
54464
54465
54466          GNULIB_UTIMENSAT=1
54467
54468
54469
54470
54471
54472$as_echo "#define GNULIB_TEST_UTIMENSAT 1" >>confdefs.h
54473
54474
54475
54476
54477
54478  if test $ac_cv_func_vasnprintf = no; then
54479
54480
54481
54482
54483
54484
54485
54486
54487
54488
54489  gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext"
54490
54491
54492
54493
54494
54495
54496
54497
54498
54499  gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
54500
54501
54502
54503
54504
54505
54506
54507
54508
54509  gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
54510
54511
54512
54513
54514
54515
54516
54517
54518
54519  gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
54520
54521  if test $ac_cv_func_vasnprintf = yes; then
54522
54523$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
54524
54525  fi
54526
54527
54528
54529
54530
54531
54532
54533
54534
54535
54536
54537  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
54538if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
54539
54540else
54541
54542$as_echo "#define ptrdiff_t long" >>confdefs.h
54543
54544
54545fi
54546
54547
54548
54549
54550
54551
54552
54553  fi
54554
54555
54556  for ac_func in vasprintf
54557do :
54558  ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
54559if test "x$ac_cv_func_vasprintf" = xyes; then :
54560  cat >>confdefs.h <<_ACEOF
54561#define HAVE_VASPRINTF 1
54562_ACEOF
54563
54564fi
54565done
54566
54567  if test $ac_cv_func_vasprintf = no; then
54568
54569
54570
54571
54572
54573
54574
54575
54576
54577  gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext"
54578
54579
54580
54581
54582
54583
54584
54585
54586
54587  gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext"
54588
54589
54590  if test $ac_cv_func_vasprintf = yes; then
54591    REPLACE_VASPRINTF=1
54592  else
54593    HAVE_VASPRINTF=0
54594  fi
54595
54596
54597
54598
54599
54600
54601
54602
54603  fi
54604
54605
54606
54607
54608
54609
54610          GNULIB_VASPRINTF=1
54611
54612
54613
54614
54615
54616$as_echo "#define GNULIB_TEST_VASPRINTF 1" >>confdefs.h
54617
54618
54619
54620
54621
54622  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format"
54623
54624
54625
54626  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format"
54627
54628
54629
54630
54631
54632
54633
54634
54635
54636
54637
54638
54639
54640
54641
54642
54643  gl_cv_func_vasprintf_posix=no
54644  for ac_func in vasprintf
54645do :
54646  ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
54647if test "x$ac_cv_func_vasprintf" = xyes; then :
54648  cat >>confdefs.h <<_ACEOF
54649#define HAVE_VASPRINTF 1
54650_ACEOF
54651
54652fi
54653done
54654
54655  case "$gl_cv_func_printf_sizes_c99" in
54656    *yes)
54657      case "$gl_cv_func_printf_long_double" in
54658        *yes)
54659          case "$gl_cv_func_printf_infinite" in
54660            *yes)
54661              case "$gl_cv_func_printf_infinite_long_double" in
54662                *yes)
54663                  case "$gl_cv_func_printf_directive_a" in
54664                    *yes)
54665                      case "$gl_cv_func_printf_directive_f" in
54666                        *yes)
54667                          case "$gl_cv_func_printf_directive_n" in
54668                            *yes)
54669                              case "$gl_cv_func_printf_directive_ls" in
54670                                *yes)
54671                                  case "$gl_cv_func_printf_positions" in
54672                                    *yes)
54673                                      case "$gl_cv_func_printf_flag_grouping" in
54674                                        *yes)
54675                                          case "$gl_cv_func_printf_flag_leftadjust" in
54676                                            *yes)
54677                                              case "$gl_cv_func_printf_flag_zero" in
54678                                                *yes)
54679                                                  case "$gl_cv_func_printf_precision" in
54680                                                    *yes)
54681                                                      case "$gl_cv_func_printf_enomem" in
54682                                                        *yes)
54683                                                          if test $ac_cv_func_vasprintf = yes; then
54684                                                            # vasprintf exists and is
54685                                                            # already POSIX compliant.
54686                                                            gl_cv_func_vasprintf_posix=yes
54687                                                          fi
54688                                                          ;;
54689                                                      esac
54690                                                      ;;
54691                                                  esac
54692                                                  ;;
54693                                              esac
54694                                              ;;
54695                                          esac
54696                                          ;;
54697                                      esac
54698                                      ;;
54699                                  esac
54700                                  ;;
54701                              esac
54702                              ;;
54703                          esac
54704                          ;;
54705                      esac
54706                      ;;
54707                  esac
54708                  ;;
54709              esac
54710              ;;
54711          esac
54712          ;;
54713      esac
54714      ;;
54715  esac
54716  if test $gl_cv_func_vasprintf_posix = no; then
54717
54718
54719
54720  case "$gl_cv_func_printf_infinite" in
54721    *yes)
54722      ;;
54723    *)
54724
54725$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h
54726
54727      ;;
54728  esac
54729
54730
54731
54732
54733  case "$gl_cv_func_printf_long_double" in
54734    *yes)
54735      case "$gl_cv_func_printf_infinite_long_double" in
54736        *yes)
54737          ;;
54738        *)
54739
54740$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h
54741
54742          ;;
54743      esac
54744      ;;
54745  esac
54746
54747
54748
54749  case "$gl_cv_func_printf_directive_a" in
54750    *yes)
54751      ;;
54752    *)
54753
54754$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h
54755
54756      for ac_func in nl_langinfo
54757do :
54758  ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo"
54759if test "x$ac_cv_func_nl_langinfo" = xyes; then :
54760  cat >>confdefs.h <<_ACEOF
54761#define HAVE_NL_LANGINFO 1
54762_ACEOF
54763
54764fi
54765done
54766
54767      ;;
54768  esac
54769
54770
54771
54772  case "$gl_cv_func_printf_directive_f" in
54773    *yes)
54774      ;;
54775    *)
54776
54777$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h
54778
54779      ;;
54780  esac
54781
54782
54783
54784  case "$gl_cv_func_printf_directive_ls" in
54785    *yes)
54786      ;;
54787    *)
54788
54789$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h
54790
54791      ;;
54792  esac
54793
54794
54795
54796  case "$gl_cv_func_printf_flag_grouping" in
54797    *yes)
54798      ;;
54799    *)
54800
54801$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h
54802
54803      ;;
54804  esac
54805
54806
54807
54808  case "$gl_cv_func_printf_flag_leftadjust" in
54809    *yes)
54810      ;;
54811    *)
54812
54813$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h
54814
54815      ;;
54816  esac
54817
54818
54819
54820  case "$gl_cv_func_printf_flag_zero" in
54821    *yes)
54822      ;;
54823    *)
54824
54825$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h
54826
54827      ;;
54828  esac
54829
54830
54831
54832  case "$gl_cv_func_printf_precision" in
54833    *yes)
54834      ;;
54835    *)
54836
54837$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h
54838
54839
54840$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
54841
54842
54843$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
54844
54845      ;;
54846  esac
54847
54848
54849
54850  case "$gl_cv_func_printf_enomem" in
54851    *yes)
54852      ;;
54853    *)
54854
54855$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h
54856
54857
54858$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
54859
54860
54861$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
54862
54863      ;;
54864  esac
54865
54866
54867
54868
54869
54870
54871
54872
54873
54874
54875
54876  gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext"
54877
54878
54879
54880
54881
54882
54883
54884
54885
54886  gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
54887
54888
54889
54890
54891
54892
54893
54894
54895
54896  gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
54897
54898
54899
54900
54901
54902
54903
54904
54905
54906  gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
54907
54908  if test $ac_cv_func_vasnprintf = yes; then
54909
54910$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
54911
54912  fi
54913
54914
54915
54916
54917
54918
54919
54920
54921
54922
54923
54924  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
54925if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
54926
54927else
54928
54929$as_echo "#define ptrdiff_t long" >>confdefs.h
54930
54931
54932fi
54933
54934
54935
54936
54937
54938
54939
54940
54941
54942
54943
54944
54945
54946
54947
54948
54949  gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext"
54950
54951
54952
54953
54954
54955
54956
54957
54958
54959  gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext"
54960
54961
54962  if test $ac_cv_func_vasprintf = yes; then
54963    REPLACE_VASPRINTF=1
54964  else
54965    HAVE_VASPRINTF=0
54966  fi
54967
54968
54969
54970
54971
54972
54973
54974
54975  fi
54976
54977
54978
54979  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=verror:3:c-format"
54980
54981
54982
54983  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=verror_at_line:5:c-format"
54984
54985
54986# Check whether --with-packager was given.
54987if test "${with_packager+set}" = set; then :
54988  withval=$with_packager;       case $withval in
54989        yes|no) ;;
54990        *)
54991cat >>confdefs.h <<_ACEOF
54992#define PACKAGE_PACKAGER "$withval"
54993_ACEOF
54994 ;;
54995      esac
54996
54997fi
54998
54999
55000
55001# Check whether --with-packager-version was given.
55002if test "${with_packager_version+set}" = set; then :
55003  withval=$with_packager_version;       case $withval in
55004        yes|no) ;;
55005        *)
55006cat >>confdefs.h <<_ACEOF
55007#define PACKAGE_PACKAGER_VERSION "$withval"
55008_ACEOF
55009 ;;
55010      esac
55011
55012fi
55013
55014
55015
55016# Check whether --with-packager-bug-reports was given.
55017if test "${with_packager_bug_reports+set}" = set; then :
55018  withval=$with_packager_bug_reports;       case $withval in
55019        yes|no) ;;
55020        *)
55021cat >>confdefs.h <<_ACEOF
55022#define PACKAGE_PACKAGER_BUG_REPORTS "$withval"
55023_ACEOF
55024 ;;
55025      esac
55026
55027fi
55028
55029
55030  if test "X$with_packager" = "X" && \
55031     test "X$with_packager_version$with_packager_bug_reports" != "X"
55032  then
55033    as_fn_error $? "The --with-packager-{bug-reports,version} options require --with-packager" "$LINENO" 5
55034  fi
55035
55036
55037
55038
55039
55040
55041
55042
55043
55044
55045
55046
55047
55048
55049
55050
55051  gl_cv_func_vfprintf_posix=no
55052  case "$gl_cv_func_printf_sizes_c99" in
55053    *yes)
55054      case "$gl_cv_func_printf_long_double" in
55055        *yes)
55056          case "$gl_cv_func_printf_infinite" in
55057            *yes)
55058              case "$gl_cv_func_printf_infinite_long_double" in
55059                *yes)
55060                  case "$gl_cv_func_printf_directive_a" in
55061                    *yes)
55062                      case "$gl_cv_func_printf_directive_f" in
55063                        *yes)
55064                          case "$gl_cv_func_printf_directive_n" in
55065                            *yes)
55066                              case "$gl_cv_func_printf_directive_ls" in
55067                                *yes)
55068                                  case "$gl_cv_func_printf_positions" in
55069                                    *yes)
55070                                      case "$gl_cv_func_printf_flag_grouping" in
55071                                        *yes)
55072                                          case "$gl_cv_func_printf_flag_leftadjust" in
55073                                            *yes)
55074                                              case "$gl_cv_func_printf_flag_zero" in
55075                                                *yes)
55076                                                  case "$gl_cv_func_printf_precision" in
55077                                                    *yes)
55078                                                      case "$gl_cv_func_printf_enomem" in
55079                                                        *yes)
55080                                                          # vfprintf exists and is
55081                                                          # already POSIX compliant.
55082                                                          gl_cv_func_vfprintf_posix=yes
55083                                                          ;;
55084                                                      esac
55085                                                      ;;
55086                                                  esac
55087                                                  ;;
55088                                              esac
55089                                              ;;
55090                                          esac
55091                                          ;;
55092                                      esac
55093                                      ;;
55094                                  esac
55095                                  ;;
55096                              esac
55097                              ;;
55098                          esac
55099                          ;;
55100                      esac
55101                      ;;
55102                  esac
55103                  ;;
55104              esac
55105              ;;
55106          esac
55107          ;;
55108      esac
55109      ;;
55110  esac
55111  if test $gl_cv_func_vfprintf_posix = no; then
55112
55113
55114
55115  case "$gl_cv_func_printf_infinite" in
55116    *yes)
55117      ;;
55118    *)
55119
55120$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h
55121
55122      ;;
55123  esac
55124
55125
55126
55127
55128  case "$gl_cv_func_printf_long_double" in
55129    *yes)
55130      case "$gl_cv_func_printf_infinite_long_double" in
55131        *yes)
55132          ;;
55133        *)
55134
55135$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h
55136
55137          ;;
55138      esac
55139      ;;
55140  esac
55141
55142
55143
55144  case "$gl_cv_func_printf_directive_a" in
55145    *yes)
55146      ;;
55147    *)
55148
55149$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h
55150
55151      for ac_func in nl_langinfo
55152do :
55153  ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo"
55154if test "x$ac_cv_func_nl_langinfo" = xyes; then :
55155  cat >>confdefs.h <<_ACEOF
55156#define HAVE_NL_LANGINFO 1
55157_ACEOF
55158
55159fi
55160done
55161
55162      ;;
55163  esac
55164
55165
55166
55167  case "$gl_cv_func_printf_directive_f" in
55168    *yes)
55169      ;;
55170    *)
55171
55172$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h
55173
55174      ;;
55175  esac
55176
55177
55178
55179  case "$gl_cv_func_printf_directive_ls" in
55180    *yes)
55181      ;;
55182    *)
55183
55184$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h
55185
55186      ;;
55187  esac
55188
55189
55190
55191  case "$gl_cv_func_printf_flag_grouping" in
55192    *yes)
55193      ;;
55194    *)
55195
55196$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h
55197
55198      ;;
55199  esac
55200
55201
55202
55203  case "$gl_cv_func_printf_flag_leftadjust" in
55204    *yes)
55205      ;;
55206    *)
55207
55208$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h
55209
55210      ;;
55211  esac
55212
55213
55214
55215  case "$gl_cv_func_printf_flag_zero" in
55216    *yes)
55217      ;;
55218    *)
55219
55220$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h
55221
55222      ;;
55223  esac
55224
55225
55226
55227  case "$gl_cv_func_printf_precision" in
55228    *yes)
55229      ;;
55230    *)
55231
55232$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h
55233
55234
55235$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
55236
55237
55238$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
55239
55240      ;;
55241  esac
55242
55243
55244
55245  case "$gl_cv_func_printf_enomem" in
55246    *yes)
55247      ;;
55248    *)
55249
55250$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h
55251
55252
55253$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
55254
55255
55256$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
55257
55258      ;;
55259  esac
55260
55261
55262
55263
55264
55265
55266
55267
55268
55269
55270
55271  gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext"
55272
55273
55274
55275
55276
55277
55278
55279
55280
55281  gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
55282
55283
55284
55285
55286
55287
55288
55289
55290
55291  gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
55292
55293
55294
55295
55296
55297
55298
55299
55300
55301  gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
55302
55303  if test $ac_cv_func_vasnprintf = yes; then
55304
55305$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
55306
55307  fi
55308
55309
55310
55311
55312
55313
55314
55315
55316
55317
55318
55319  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
55320if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
55321
55322else
55323
55324$as_echo "#define ptrdiff_t long" >>confdefs.h
55325
55326
55327fi
55328
55329
55330
55331
55332
55333
55334
55335
55336
55337
55338
55339
55340
55341
55342
55343
55344
55345  gl_LIBOBJS="$gl_LIBOBJS vfprintf.$ac_objext"
55346
55347  REPLACE_VFPRINTF=1
55348
55349$as_echo "#define REPLACE_VFPRINTF_POSIX 1" >>confdefs.h
55350
55351  :
55352
55353  fi
55354
55355
55356
55357
55358
55359
55360          GNULIB_VFPRINTF_POSIX=1
55361
55362
55363
55364
55365
55366$as_echo "#define GNULIB_TEST_VFPRINTF_POSIX 1" >>confdefs.h
55367
55368
55369
55370
55371
55372  if test $gl_cv_func_vfprintf_posix = no; then
55373
55374
55375
55376
55377
55378
55379
55380
55381
55382
55383  gl_LIBOBJS="$gl_LIBOBJS vprintf.$ac_objext"
55384
55385  REPLACE_VPRINTF=1
55386
55387$as_echo "#define REPLACE_VPRINTF_POSIX 1" >>confdefs.h
55388
55389  :
55390
55391  fi
55392
55393
55394
55395
55396
55397
55398          GNULIB_VPRINTF_POSIX=1
55399
55400
55401
55402
55403
55404$as_echo "#define GNULIB_TEST_VPRINTF_POSIX 1" >>confdefs.h
55405
55406
55407
55408
55409
55410
55411
55412
55413
55414
55415
55416
55417
55418
55419
55420     if test $gl_cv_have_include_next = yes; then
55421       gl_cv_next_wchar_h='<'wchar.h'>'
55422     else
55423       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
55424$as_echo_n "checking absolute name of <wchar.h>... " >&6; }
55425if ${gl_cv_next_wchar_h+:} false; then :
55426  $as_echo_n "(cached) " >&6
55427else
55428
55429             if test $ac_cv_header_wchar_h = yes; then
55430
55431
55432
55433
55434  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55435/* end confdefs.h.  */
55436#include <wchar.h>
55437_ACEOF
55438                case "$host_os" in
55439    aix*) gl_absname_cpp="$ac_cpp -C" ;;
55440    *)    gl_absname_cpp="$ac_cpp" ;;
55441  esac
55442
55443  case "$host_os" in
55444    mingw*)
55445                                          gl_dirsep_regex='[/\\]'
55446      ;;
55447    *)
55448      gl_dirsep_regex='\/'
55449      ;;
55450  esac
55451      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
55452  gl_header_literal_regex=`echo 'wchar.h' \
55453                           | sed -e "$gl_make_literal_regex_sed"`
55454  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
55455      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
55456      s|^/[^/]|//&|
55457      p
55458      q
55459    }'
55460
55461        gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
55462  sed -n "$gl_absolute_header_sed"`
55463
55464           gl_header=$gl_cv_absolute_wchar_h
55465           gl_cv_next_wchar_h='"'$gl_header'"'
55466          else
55467               gl_cv_next_wchar_h='<'wchar.h'>'
55468             fi
55469
55470
55471fi
55472{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
55473$as_echo "$gl_cv_next_wchar_h" >&6; }
55474     fi
55475     NEXT_WCHAR_H=$gl_cv_next_wchar_h
55476
55477     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
55478       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
55479       gl_next_as_first_directive='<'wchar.h'>'
55480     else
55481       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
55482       gl_next_as_first_directive=$gl_cv_next_wchar_h
55483     fi
55484     NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
55485
55486
55487
55488
55489  if test $ac_cv_header_wchar_h = yes; then
55490    HAVE_WCHAR_H=1
55491  else
55492    HAVE_WCHAR_H=0
55493  fi
55494
55495
55496
55497
55498
55499  if test $gt_cv_c_wint_t = yes; then
55500    HAVE_WINT_T=1
55501  else
55502    HAVE_WINT_T=0
55503  fi
55504
55505
55506
55507
55508
55509
55510
55511
55512cat >>confdefs.h <<_ACEOF
55513#define GNULIB_WCHAR_SINGLE 1
55514_ACEOF
55515
55516
55517
55518
55519
55520
55521
55522
55523
55524
55525
55526
55527  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
55528
55529
55530
55531     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
55532$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
55533if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
55534  $as_echo_n "(cached) " >&6
55535else
55536
55537                  case "$host_os" in
55538                     # Guess no on AIX and OSF/1.
55539        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
55540                     # Guess yes otherwise.
55541        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
55542      esac
55543      if test $LOCALE_JA != none; then
55544        if test "$cross_compiling" = yes; then :
55545  :
55546else
55547  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55548/* end confdefs.h.  */
55549
55550#include <locale.h>
55551#include <string.h>
55552/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
55553   <wchar.h>.
55554   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
55555   included before <wchar.h>.  */
55556#include <stddef.h>
55557#include <stdio.h>
55558#include <time.h>
55559#include <wchar.h>
55560int main ()
55561{
55562  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
55563    {
55564      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
55565      mbstate_t state;
55566      wchar_t wc;
55567
55568      memset (&state, '\0', sizeof (mbstate_t));
55569      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
55570        if (mbsinit (&state))
55571          return 2;
55572    }
55573  return 0;
55574}
55575_ACEOF
55576if ac_fn_c_try_run "$LINENO"; then :
55577  gl_cv_func_mbrtowc_incomplete_state=yes
55578else
55579  gl_cv_func_mbrtowc_incomplete_state=no
55580fi
55581rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
55582  conftest.$ac_objext conftest.beam conftest.$ac_ext
55583fi
55584
55585      fi
55586
55587fi
55588{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
55589$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
55590
55591
55592
55593
55594     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
55595$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
55596if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
55597  $as_echo_n "(cached) " >&6
55598else
55599
55600                  case "$host_os" in
55601                    # Guess no on Solaris 8.
55602        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
55603                    # Guess yes otherwise.
55604        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
55605      esac
55606      if test $LOCALE_ZH_CN != none; then
55607        if test "$cross_compiling" = yes; then :
55608  :
55609else
55610  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55611/* end confdefs.h.  */
55612
55613#include <locale.h>
55614#include <stdlib.h>
55615#include <string.h>
55616/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
55617   <wchar.h>.
55618   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
55619   included before <wchar.h>.  */
55620#include <stddef.h>
55621#include <stdio.h>
55622#include <time.h>
55623#include <wchar.h>
55624int main ()
55625{
55626  /* This fails on Solaris 8:
55627     mbrtowc returns 2, and sets wc to 0x00F0.
55628     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
55629  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
55630    {
55631      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
55632      mbstate_t state;
55633      wchar_t wc;
55634
55635      memset (&state, '\0', sizeof (mbstate_t));
55636      if (mbrtowc (&wc, input + 3, 6, &state) != 4
55637          && mbtowc (&wc, input + 3, 6) == 4)
55638        return 2;
55639    }
55640  return 0;
55641}
55642_ACEOF
55643if ac_fn_c_try_run "$LINENO"; then :
55644  gl_cv_func_mbrtowc_sanitycheck=yes
55645else
55646  gl_cv_func_mbrtowc_sanitycheck=no
55647fi
55648rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
55649  conftest.$ac_objext conftest.beam conftest.$ac_ext
55650fi
55651
55652      fi
55653
55654fi
55655{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
55656$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
55657
55658    REPLACE_MBSTATE_T=0
55659    case "$gl_cv_func_mbrtowc_incomplete_state" in
55660      *yes) ;;
55661      *) REPLACE_MBSTATE_T=1 ;;
55662    esac
55663    case "$gl_cv_func_mbrtowc_sanitycheck" in
55664      *yes) ;;
55665      *) REPLACE_MBSTATE_T=1 ;;
55666    esac
55667  else
55668    REPLACE_MBSTATE_T=1
55669  fi
55670
55671
55672
55673  if test $ac_cv_func_wcrtomb = no; then
55674    HAVE_WCRTOMB=0
55675    ac_fn_c_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" "
55676/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
55677   <wchar.h>.
55678   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
55679   included before <wchar.h>.  */
55680#include <stddef.h>
55681#include <stdio.h>
55682#include <time.h>
55683#include <wchar.h>
55684
55685"
55686if test "x$ac_cv_have_decl_wcrtomb" = xyes; then :
55687  ac_have_decl=1
55688else
55689  ac_have_decl=0
55690fi
55691
55692cat >>confdefs.h <<_ACEOF
55693#define HAVE_DECL_WCRTOMB $ac_have_decl
55694_ACEOF
55695
55696    if test $ac_cv_have_decl_wcrtomb = yes; then
55697                        REPLACE_WCRTOMB=1
55698    fi
55699  else
55700    if test $REPLACE_MBSTATE_T = 1; then
55701      REPLACE_WCRTOMB=1
55702    else
55703
55704
55705
55706
55707
55708             { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5
55709$as_echo_n "checking whether wcrtomb return value is correct... " >&6; }
55710if ${gl_cv_func_wcrtomb_retval+:} false; then :
55711  $as_echo_n "(cached) " >&6
55712else
55713
55714                              case "$host_os" in
55715                                     # Guess no on AIX 4, OSF/1 and Solaris.
55716            aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
55717                                     # Guess yes on native Windows.
55718            mingw*)                  gl_cv_func_wcrtomb_retval="guessing yes" ;;
55719                                     # Guess yes otherwise.
55720            *)                       gl_cv_func_wcrtomb_retval="guessing yes" ;;
55721          esac
55722          if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
55723            if test "$cross_compiling" = yes; then :
55724  :
55725else
55726  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55727/* end confdefs.h.  */
55728
55729#include <locale.h>
55730#include <string.h>
55731/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
55732   <wchar.h>.
55733   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
55734   included before <wchar.h>.  */
55735#include <stddef.h>
55736#include <stdio.h>
55737#include <time.h>
55738#include <wchar.h>
55739int main ()
55740{
55741  int result = 0;
55742  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
55743    {
55744      if (wcrtomb (NULL, 0, NULL) != 1)
55745        result |= 1;
55746    }
55747  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
55748    {
55749      if (wcrtomb (NULL, 0, NULL) != 1)
55750        result |= 2;
55751    }
55752  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
55753    {
55754      if (wcrtomb (NULL, 0, NULL) != 1)
55755        result |= 4;
55756    }
55757  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
55758    {
55759      if (wcrtomb (NULL, 0, NULL) != 1)
55760        result |= 8;
55761    }
55762  return result;
55763}
55764_ACEOF
55765if ac_fn_c_try_run "$LINENO"; then :
55766  gl_cv_func_wcrtomb_retval=yes
55767else
55768  gl_cv_func_wcrtomb_retval=no
55769fi
55770rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
55771  conftest.$ac_objext conftest.beam conftest.$ac_ext
55772fi
55773
55774          fi
55775
55776fi
55777{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5
55778$as_echo "$gl_cv_func_wcrtomb_retval" >&6; }
55779      case "$gl_cv_func_wcrtomb_retval" in
55780        *yes) ;;
55781        *) REPLACE_WCRTOMB=1 ;;
55782      esac
55783    fi
55784  fi
55785
55786  if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
55787
55788
55789
55790
55791
55792
55793
55794
55795  gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext"
55796
55797
55798  :
55799
55800  fi
55801
55802
55803
55804
55805
55806          GNULIB_WCRTOMB=1
55807
55808
55809
55810
55811
55812$as_echo "#define GNULIB_TEST_WCRTOMB 1" >>confdefs.h
55813
55814
55815
55816
55817
55818
55819
55820  if test $ac_cv_func_wcswidth = no; then
55821    HAVE_WCSWIDTH=0
55822  else
55823    if test $REPLACE_WCWIDTH = 1; then
55824                  REPLACE_WCSWIDTH=1
55825    fi
55826  fi
55827
55828  if test $HAVE_WCSWIDTH = 0 || test $REPLACE_WCSWIDTH = 1; then
55829
55830
55831
55832
55833
55834
55835
55836
55837  gl_LIBOBJS="$gl_LIBOBJS wcswidth.$ac_objext"
55838
55839  fi
55840
55841
55842
55843
55844
55845          GNULIB_WCSWIDTH=1
55846
55847
55848
55849
55850
55851$as_echo "#define GNULIB_TEST_WCSWIDTH 1" >>confdefs.h
55852
55853
55854
55855
55856
55857
55858
55859
55860  if test $ac_cv_func_iswcntrl = yes; then
55861    HAVE_ISWCNTRL=1
55862  else
55863    HAVE_ISWCNTRL=0
55864  fi
55865
55866
55867
55868  if test $gt_cv_c_wint_t = yes; then
55869    HAVE_WINT_T=1
55870  else
55871    HAVE_WINT_T=0
55872  fi
55873
55874
55875
55876
55877
55878
55879
55880
55881
55882
55883
55884
55885
55886     if test $gl_cv_have_include_next = yes; then
55887       gl_cv_next_wctype_h='<'wctype.h'>'
55888     else
55889       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
55890$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
55891if ${gl_cv_next_wctype_h+:} false; then :
55892  $as_echo_n "(cached) " >&6
55893else
55894
55895             if test $ac_cv_header_wctype_h = yes; then
55896
55897
55898
55899
55900  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55901/* end confdefs.h.  */
55902#include <wctype.h>
55903_ACEOF
55904                case "$host_os" in
55905    aix*) gl_absname_cpp="$ac_cpp -C" ;;
55906    *)    gl_absname_cpp="$ac_cpp" ;;
55907  esac
55908
55909  case "$host_os" in
55910    mingw*)
55911                                          gl_dirsep_regex='[/\\]'
55912      ;;
55913    *)
55914      gl_dirsep_regex='\/'
55915      ;;
55916  esac
55917      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
55918  gl_header_literal_regex=`echo 'wctype.h' \
55919                           | sed -e "$gl_make_literal_regex_sed"`
55920  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
55921      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
55922      s|^/[^/]|//&|
55923      p
55924      q
55925    }'
55926
55927        gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
55928  sed -n "$gl_absolute_header_sed"`
55929
55930           gl_header=$gl_cv_absolute_wctype_h
55931           gl_cv_next_wctype_h='"'$gl_header'"'
55932          else
55933               gl_cv_next_wctype_h='<'wctype.h'>'
55934             fi
55935
55936
55937fi
55938{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
55939$as_echo "$gl_cv_next_wctype_h" >&6; }
55940     fi
55941     NEXT_WCTYPE_H=$gl_cv_next_wctype_h
55942
55943     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
55944       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
55945       gl_next_as_first_directive='<'wctype.h'>'
55946     else
55947       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
55948       gl_next_as_first_directive=$gl_cv_next_wctype_h
55949     fi
55950     NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
55951
55952
55953
55954
55955  if test $ac_cv_header_wctype_h = yes; then
55956    if test $ac_cv_func_iswcntrl = yes; then
55957                  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
55958$as_echo_n "checking whether iswcntrl works... " >&6; }
55959if ${gl_cv_func_iswcntrl_works+:} false; then :
55960  $as_echo_n "(cached) " >&6
55961else
55962
55963          if test "$cross_compiling" = yes; then :
55964               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55965/* end confdefs.h.  */
55966#include <stdlib.h>
55967                          #if __GNU_LIBRARY__ == 1
55968                          Linux libc5 i18n is broken.
55969                          #endif
55970int
55971main ()
55972{
55973
55974  ;
55975  return 0;
55976}
55977_ACEOF
55978if ac_fn_c_try_compile "$LINENO"; then :
55979  gl_cv_func_iswcntrl_works="guessing yes"
55980else
55981  gl_cv_func_iswcntrl_works="guessing no"
55982fi
55983rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55984
55985else
55986  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55987/* end confdefs.h.  */
55988
55989               /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
55990                  included before <wchar.h>.
55991                  BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
55992                  must be included before <wchar.h>.  */
55993               #include <stddef.h>
55994               #include <stdio.h>
55995               #include <time.h>
55996               #include <wchar.h>
55997               #include <wctype.h>
55998               int main () { return iswprint ('x') == 0; }
55999
56000_ACEOF
56001if ac_fn_c_try_run "$LINENO"; then :
56002  gl_cv_func_iswcntrl_works=yes
56003else
56004  gl_cv_func_iswcntrl_works=no
56005fi
56006rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
56007  conftest.$ac_objext conftest.beam conftest.$ac_ext
56008fi
56009
56010
56011fi
56012{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
56013$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
56014    fi
56015    HAVE_WCTYPE_H=1
56016  else
56017    HAVE_WCTYPE_H=0
56018  fi
56019
56020
56021  case "$gl_cv_func_iswcntrl_works" in
56022    *yes) REPLACE_ISWCNTRL=0 ;;
56023    *)    REPLACE_ISWCNTRL=1 ;;
56024  esac
56025
56026
56027  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
56028        :
56029  fi
56030
56031  if test $REPLACE_ISWCNTRL = 1; then
56032    REPLACE_TOWLOWER=1
56033  else
56034    for ac_func in towlower
56035do :
56036  ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
56037if test "x$ac_cv_func_towlower" = xyes; then :
56038  cat >>confdefs.h <<_ACEOF
56039#define HAVE_TOWLOWER 1
56040_ACEOF
56041
56042fi
56043done
56044
56045    if test $ac_cv_func_towlower = yes; then
56046      REPLACE_TOWLOWER=0
56047    else
56048      ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
56049             included before <wchar.h>.
56050             BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
56051             must be included before <wchar.h>.  */
56052          #include <stddef.h>
56053          #include <stdio.h>
56054          #include <time.h>
56055          #include <wchar.h>
56056          #if HAVE_WCTYPE_H
56057          # include <wctype.h>
56058          #endif
56059
56060"
56061if test "x$ac_cv_have_decl_towlower" = xyes; then :
56062  ac_have_decl=1
56063else
56064  ac_have_decl=0
56065fi
56066
56067cat >>confdefs.h <<_ACEOF
56068#define HAVE_DECL_TOWLOWER $ac_have_decl
56069_ACEOF
56070
56071      if test $ac_cv_have_decl_towlower = yes; then
56072                                REPLACE_TOWLOWER=1
56073      else
56074        REPLACE_TOWLOWER=0
56075      fi
56076    fi
56077  fi
56078
56079
56080  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
56081        :
56082  fi
56083
56084          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
56085$as_echo_n "checking for wctype_t... " >&6; }
56086if ${gl_cv_type_wctype_t+:} false; then :
56087  $as_echo_n "(cached) " >&6
56088else
56089  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56090/* end confdefs.h.  */
56091/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
56092               included before <wchar.h>.
56093               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
56094               must be included before <wchar.h>.  */
56095            #include <stddef.h>
56096            #include <stdio.h>
56097            #include <time.h>
56098            #include <wchar.h>
56099            #if HAVE_WCTYPE_H
56100            # include <wctype.h>
56101            #endif
56102            wctype_t a;
56103
56104int
56105main ()
56106{
56107
56108  ;
56109  return 0;
56110}
56111_ACEOF
56112if ac_fn_c_try_compile "$LINENO"; then :
56113  gl_cv_type_wctype_t=yes
56114else
56115  gl_cv_type_wctype_t=no
56116fi
56117rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56118
56119fi
56120{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
56121$as_echo "$gl_cv_type_wctype_t" >&6; }
56122  if test $gl_cv_type_wctype_t = no; then
56123    HAVE_WCTYPE_T=0
56124  fi
56125
56126      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
56127$as_echo_n "checking for wctrans_t... " >&6; }
56128if ${gl_cv_type_wctrans_t+:} false; then :
56129  $as_echo_n "(cached) " >&6
56130else
56131  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56132/* end confdefs.h.  */
56133/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
56134               included before <wchar.h>.
56135               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
56136               must be included before <wchar.h>.  */
56137            #include <stddef.h>
56138            #include <stdio.h>
56139            #include <time.h>
56140            #include <wchar.h>
56141            #include <wctype.h>
56142            wctrans_t a;
56143
56144int
56145main ()
56146{
56147
56148  ;
56149  return 0;
56150}
56151_ACEOF
56152if ac_fn_c_try_compile "$LINENO"; then :
56153  gl_cv_type_wctrans_t=yes
56154else
56155  gl_cv_type_wctrans_t=no
56156fi
56157rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56158
56159fi
56160{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
56161$as_echo "$gl_cv_type_wctrans_t" >&6; }
56162  if test $gl_cv_type_wctrans_t = no; then
56163    HAVE_WCTRANS_T=0
56164  fi
56165
56166
56167
56168
56169
56170
56171
56172
56173
56174
56175
56176
56177
56178
56179  ac_fn_c_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" "
56180/* AIX 3.2.5 declares wcwidth in <string.h>. */
56181#include <string.h>
56182/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
56183   <wchar.h>.
56184   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
56185   before <wchar.h>.  */
56186#include <stddef.h>
56187#include <stdio.h>
56188#include <time.h>
56189#include <wchar.h>
56190
56191"
56192if test "x$ac_cv_have_decl_wcwidth" = xyes; then :
56193  ac_have_decl=1
56194else
56195  ac_have_decl=0
56196fi
56197
56198cat >>confdefs.h <<_ACEOF
56199#define HAVE_DECL_WCWIDTH $ac_have_decl
56200_ACEOF
56201
56202  if test $ac_cv_have_decl_wcwidth != yes; then
56203    HAVE_DECL_WCWIDTH=0
56204  fi
56205
56206  if test $ac_cv_func_wcwidth != yes; then
56207    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth is a macro" >&5
56208$as_echo_n "checking whether wcwidth is a macro... " >&6; }
56209if ${gl_cv_func_wcwidth_macro+:} false; then :
56210  $as_echo_n "(cached) " >&6
56211else
56212  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56213/* end confdefs.h.  */
56214
56215#include <wchar.h>
56216#ifdef wcwidth
56217 wchar_header_defines_wcwidth
56218#endif
56219_ACEOF
56220if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
56221  $EGREP "wchar_header_defines_wcwidth" >/dev/null 2>&1; then :
56222  gl_cv_func_wcwidth_macro=yes
56223else
56224  gl_cv_func_wcwidth_macro=no
56225fi
56226rm -f conftest*
56227
56228
56229fi
56230{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_macro" >&5
56231$as_echo "$gl_cv_func_wcwidth_macro" >&6; }
56232  fi
56233
56234  if test $ac_cv_func_wcwidth = yes || test $gl_cv_func_wcwidth_macro = yes; then
56235    HAVE_WCWIDTH=1
56236                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5
56237$as_echo_n "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; }
56238if ${gl_cv_func_wcwidth_works+:} false; then :
56239  $as_echo_n "(cached) " >&6
56240else
56241
56242        if test "$cross_compiling" = yes; then :
56243
56244           case "$host_os" in
56245                                        # Guess yes on glibc and AIX 7 systems.
56246             *-gnu* | gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";;
56247             *)                         gl_cv_func_wcwidth_works="guessing no";;
56248           esac
56249
56250else
56251  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56252/* end confdefs.h.  */
56253
56254#include <locale.h>
56255/* AIX 3.2.5 declares wcwidth in <string.h>. */
56256#include <string.h>
56257/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
56258   <wchar.h>.
56259   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
56260   before <wchar.h>.  */
56261#include <stddef.h>
56262#include <stdio.h>
56263#include <time.h>
56264#include <wchar.h>
56265#if !HAVE_DECL_WCWIDTH
56266extern
56267# ifdef __cplusplus
56268"C"
56269# endif
56270int wcwidth (int);
56271#endif
56272int main ()
56273{
56274  int result = 0;
56275  if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL)
56276    {
56277      if (wcwidth (0x0301) > 0)
56278        result |= 1;
56279      if (wcwidth (0x05B0) > 0)
56280        result |= 2;
56281      if (wcwidth (0x200B) > 0)
56282        result |= 4;
56283      if (wcwidth (0xFF1A) == 0)
56284        result |= 8;
56285    }
56286  return result;
56287}
56288_ACEOF
56289if ac_fn_c_try_run "$LINENO"; then :
56290  gl_cv_func_wcwidth_works=yes
56291else
56292  gl_cv_func_wcwidth_works=no
56293fi
56294rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
56295  conftest.$ac_objext conftest.beam conftest.$ac_ext
56296fi
56297
56298
56299fi
56300{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5
56301$as_echo "$gl_cv_func_wcwidth_works" >&6; }
56302    case "$gl_cv_func_wcwidth_works" in
56303      *yes) ;;
56304      *no) REPLACE_WCWIDTH=1 ;;
56305    esac
56306  else
56307    HAVE_WCWIDTH=0
56308  fi
56309
56310  if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then
56311
56312
56313
56314
56315
56316
56317
56318
56319  gl_LIBOBJS="$gl_LIBOBJS wcwidth.$ac_objext"
56320
56321
56322
56323  :
56324
56325  fi
56326
56327
56328
56329
56330
56331          GNULIB_WCWIDTH=1
56332
56333
56334
56335
56336
56337$as_echo "#define GNULIB_TEST_WCWIDTH 1" >>confdefs.h
56338
56339
56340
56341
56342 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
56343$as_echo_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h... " >&6; }
56344if ${gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h+:} false; then :
56345  $as_echo_n "(cached) " >&6
56346else
56347  gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
56348
56349   if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no; then
56350     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56351/* end confdefs.h.  */
56352#include <sys/types.h>
56353#        include <sys/ioctl.h>
56354#        ifdef TIOCGWINSZ
56355           yes
56356#        endif
56357
56358_ACEOF
56359if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
56360  $EGREP "yes" >/dev/null 2>&1; then :
56361  gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
56362fi
56363rm -f conftest*
56364
56365   fi
56366
56367fi
56368{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&5
56369$as_echo "$gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&6; }
56370  if test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
56371
56372$as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h
56373
56374  fi
56375
56376
56377 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of TIOCGWINSZ requires termios.h" >&5
56378$as_echo_n "checking whether use of TIOCGWINSZ requires termios.h... " >&6; }
56379if ${gl_cv_sys_tiocgwinsz_needs_termios_h+:} false; then :
56380  $as_echo_n "(cached) " >&6
56381else
56382  gl_cv_sys_tiocgwinsz_needs_termios_h=no
56383
56384   if test $ac_cv_sys_posix_termios = yes; then
56385     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56386/* end confdefs.h.  */
56387#include <sys/types.h>
56388#      include <termios.h>
56389#      ifdef TIOCGWINSZ
56390         yes
56391#      endif
56392
56393_ACEOF
56394if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
56395  $EGREP "yes" >/dev/null 2>&1; then :
56396  gl_cv_sys_tiocgwinsz_needs_termios_h=yes
56397fi
56398rm -f conftest*
56399
56400   fi
56401
56402fi
56403{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_tiocgwinsz_needs_termios_h" >&5
56404$as_echo "$gl_cv_sys_tiocgwinsz_needs_termios_h" >&6; }
56405
56406
56407
56408   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of struct winsize requires sys/ptem.h" >&5
56409$as_echo_n "checking whether use of struct winsize requires sys/ptem.h... " >&6; }
56410if ${gl_cv_sys_struct_winsize_needs_sys_ptem_h+:} false; then :
56411  $as_echo_n "(cached) " >&6
56412else
56413  gl_cv_sys_struct_winsize_needs_sys_ptem_h=yes
56414      if test $ac_cv_sys_posix_termios = yes; then
56415        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56416/* end confdefs.h.  */
56417#include <termios.h>
56418int
56419main ()
56420{
56421struct winsize x;
56422            if (sizeof x > 0) return 0;
56423  ;
56424  return 0;
56425}
56426_ACEOF
56427if ac_fn_c_try_compile "$LINENO"; then :
56428  gl_cv_sys_struct_winsize_needs_sys_ptem_h=no
56429fi
56430rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56431      fi
56432      if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
56433        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56434/* end confdefs.h.  */
56435#include <sys/ptem.h>
56436int
56437main ()
56438{
56439struct winsize x;
56440            if (sizeof x > 0) return 0;
56441  ;
56442  return 0;
56443}
56444_ACEOF
56445if ac_fn_c_try_compile "$LINENO"; then :
56446
56447else
56448  gl_cv_sys_struct_winsize_needs_sys_ptem_h=no
56449fi
56450rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56451      fi
56452fi
56453{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&5
56454$as_echo "$gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&6; }
56455   if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
56456
56457$as_echo "#define WINSIZE_IN_PTEM 1" >>confdefs.h
56458
56459   fi
56460
56461
56462
56463
56464
56465    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
56466      REPLACE_WRITE=1
56467    fi
56468
56469
56470
56471
56472  if test $REPLACE_WRITE = 1; then
56473
56474
56475
56476
56477
56478
56479
56480
56481  gl_LIBOBJS="$gl_LIBOBJS write.$ac_objext"
56482
56483    :
56484  fi
56485
56486
56487
56488
56489
56490          GNULIB_WRITE=1
56491
56492
56493
56494
56495
56496$as_echo "#define GNULIB_TEST_WRITE 1" >>confdefs.h
56497
56498
56499
56500
56501
56502
56503  :
56504
56505  :
56506
56507
56508
56509cat >>confdefs.h <<_ACEOF
56510#define GNULIB_XGETGROUPS 1
56511_ACEOF
56512
56513
56514
56515  :
56516
56517
56518
56519  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xprintf:1:c-format"
56520
56521
56522
56523  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xvprintf:1:c-format"
56524
56525
56526
56527  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xfprintf:2:c-format"
56528
56529
56530
56531  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xvfprintf:2:c-format"
56532
56533
56534
56535  for ac_header in stdint.h
56536do :
56537  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
56538if test "x$ac_cv_header_stdint_h" = xyes; then :
56539  cat >>confdefs.h <<_ACEOF
56540#define HAVE_STDINT_H 1
56541_ACEOF
56542
56543fi
56544
56545done
56546
56547
56548
56549
56550  :
56551
56552
56553
56554  :
56555
56556
56557  :
56558
56559
56560  :
56561
56562  :
56563
56564
56565  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format"
56566
56567
56568
56569    :
56570
56571  # End of code from modules
56572
56573
56574
56575
56576
56577
56578
56579
56580
56581  gltests_libdeps=
56582  gltests_ltlibdeps=
56583
56584
56585
56586
56587
56588
56589
56590
56591
56592  gl_source_base='gnulib-tests'
56593  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
56594
56595  gl_module_indicator_condition=$gltests_WITNESS
56596
56597
56598  if test "$ac_cv_header_winsock2_h" = yes; then
56599
56600
56601
56602
56603
56604
56605
56606
56607  gltests_LIBOBJS="$gltests_LIBOBJS accept.$ac_objext"
56608
56609  fi
56610
56611
56612
56613
56614
56615    if test "$GNULIB_ACCEPT" != 1; then
56616        if test "$GNULIB_ACCEPT" = 0; then
56617      GNULIB_ACCEPT=$gl_module_indicator_condition
56618    else
56619      GNULIB_ACCEPT="($GNULIB_ACCEPT || $gl_module_indicator_condition)"
56620    fi
56621  fi
56622
56623
56624
56625
56626
56627$as_echo "#define GNULIB_TEST_ACCEPT 1" >>confdefs.h
56628
56629
56630
56631
56632  if test "$ac_cv_header_winsock2_h" = yes; then
56633
56634
56635
56636
56637
56638
56639
56640
56641  gltests_LIBOBJS="$gltests_LIBOBJS bind.$ac_objext"
56642
56643  fi
56644
56645
56646
56647
56648
56649    if test "$GNULIB_BIND" != 1; then
56650        if test "$GNULIB_BIND" = 0; then
56651      GNULIB_BIND=$gl_module_indicator_condition
56652    else
56653      GNULIB_BIND="($GNULIB_BIND || $gl_module_indicator_condition)"
56654    fi
56655  fi
56656
56657
56658
56659
56660
56661$as_echo "#define GNULIB_TEST_BIND 1" >>confdefs.h
56662
56663
56664
56665
56666
56667
56668  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
56669$as_echo_n "checking for a traditional french locale... " >&6; }
56670if ${gt_cv_locale_fr+:} false; then :
56671  $as_echo_n "(cached) " >&6
56672else
56673
56674    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56675/* end confdefs.h.  */
56676
56677#include <locale.h>
56678#include <time.h>
56679#if HAVE_LANGINFO_CODESET
56680# include <langinfo.h>
56681#endif
56682#include <stdlib.h>
56683#include <string.h>
56684struct tm t;
56685char buf[16];
56686int main () {
56687  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
56688     imitates locale dependent behaviour by looking at the environment
56689     variables, and all locales use the UTF-8 encoding.  */
56690#if defined __BEOS__ || defined __HAIKU__
56691  return 1;
56692#else
56693  /* Check whether the given locale name is recognized by the system.  */
56694# if defined _WIN32 && !defined __CYGWIN__
56695  /* On native Windows, setlocale(category, "") looks at the system settings,
56696     not at the environment variables.  Also, when an encoding suffix such
56697     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
56698     category of the locale to "C".  */
56699  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
56700      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
56701    return 1;
56702# else
56703  if (setlocale (LC_ALL, "") == NULL) return 1;
56704# endif
56705  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
56706     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
56707     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
56708     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
56709     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
56710     some unit tests fail.
56711     On MirBSD 10, when an unsupported locale is specified, setlocale()
56712     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
56713# if HAVE_LANGINFO_CODESET
56714  {
56715    const char *cs = nl_langinfo (CODESET);
56716    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
56717        || strcmp (cs, "UTF-8") == 0)
56718      return 1;
56719  }
56720# endif
56721# ifdef __CYGWIN__
56722  /* On Cygwin, avoid locale names without encoding suffix, because the
56723     locale_charset() function relies on the encoding suffix.  Note that
56724     LC_ALL is set on the command line.  */
56725  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
56726# endif
56727  /* Check whether in the abbreviation of the second month, the second
56728     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
56729     one byte long. This excludes the UTF-8 encoding.  */
56730  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
56731  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
56732# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
56733  /* Check whether the decimal separator is a comma.
56734     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
56735     are nl_langinfo(RADIXCHAR) are both ".".  */
56736  if (localeconv () ->decimal_point[0] != ',') return 1;
56737# endif
56738  return 0;
56739#endif
56740}
56741
56742_ACEOF
56743    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
56744  (eval $ac_link) 2>&5
56745  ac_status=$?
56746  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
56747  test $ac_status = 0; } && test -s conftest$ac_exeext; then
56748      case "$host_os" in
56749        # Handle native Windows specially, because there setlocale() interprets
56750        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
56751        # "fr" or "fra" as "French" or "French_France.1252",
56752        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
56753        # "ja" as "Japanese" or "Japanese_Japan.932",
56754        # and similar.
56755        mingw*)
56756          # Test for the native Windows locale name.
56757          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
56758            gt_cv_locale_fr=French_France.1252
56759          else
56760            # None found.
56761            gt_cv_locale_fr=none
56762          fi
56763          ;;
56764        *)
56765          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
56766          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
56767          # configure script would override the LC_ALL setting. Likewise for
56768          # LC_CTYPE, which is also set at the beginning of the configure script.
56769          # Test for the usual locale name.
56770          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
56771            gt_cv_locale_fr=fr_FR
56772          else
56773            # Test for the locale name with explicit encoding suffix.
56774            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
56775              gt_cv_locale_fr=fr_FR.ISO-8859-1
56776            else
56777              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
56778              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
56779                gt_cv_locale_fr=fr_FR.ISO8859-1
56780              else
56781                # Test for the HP-UX locale name.
56782                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
56783                  gt_cv_locale_fr=fr_FR.iso88591
56784                else
56785                  # Test for the Solaris 7 locale name.
56786                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
56787                    gt_cv_locale_fr=fr
56788                  else
56789                    # None found.
56790                    gt_cv_locale_fr=none
56791                  fi
56792                fi
56793              fi
56794            fi
56795          fi
56796          ;;
56797      esac
56798    fi
56799    rm -fr conftest*
56800
56801fi
56802{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
56803$as_echo "$gt_cv_locale_fr" >&6; }
56804  LOCALE_FR=$gt_cv_locale_fr
56805
56806
56807
56808
56809  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
56810$as_echo_n "checking for a french Unicode locale... " >&6; }
56811if ${gt_cv_locale_fr_utf8+:} false; then :
56812  $as_echo_n "(cached) " >&6
56813else
56814
56815    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56816/* end confdefs.h.  */
56817
56818#include <locale.h>
56819#include <time.h>
56820#if HAVE_LANGINFO_CODESET
56821# include <langinfo.h>
56822#endif
56823#include <stdlib.h>
56824#include <string.h>
56825struct tm t;
56826char buf[16];
56827int main () {
56828  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
56829     imitates locale dependent behaviour by looking at the environment
56830     variables, and all locales use the UTF-8 encoding.  */
56831#if !(defined __BEOS__ || defined __HAIKU__)
56832  /* Check whether the given locale name is recognized by the system.  */
56833# if defined _WIN32 && !defined __CYGWIN__
56834  /* On native Windows, setlocale(category, "") looks at the system settings,
56835     not at the environment variables.  Also, when an encoding suffix such
56836     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
56837     category of the locale to "C".  */
56838  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
56839      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
56840    return 1;
56841# else
56842  if (setlocale (LC_ALL, "") == NULL) return 1;
56843# endif
56844  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
56845     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
56846     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
56847     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
56848     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
56849     some unit tests fail.  */
56850# if HAVE_LANGINFO_CODESET
56851  {
56852    const char *cs = nl_langinfo (CODESET);
56853    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
56854      return 1;
56855  }
56856# endif
56857# ifdef __CYGWIN__
56858  /* On Cygwin, avoid locale names without encoding suffix, because the
56859     locale_charset() function relies on the encoding suffix.  Note that
56860     LC_ALL is set on the command line.  */
56861  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
56862# endif
56863  /* Check whether in the abbreviation of the second month, the second
56864     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
56865     two bytes long, with UTF-8 encoding.  */
56866  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
56867  if (strftime (buf, sizeof (buf), "%b", &t) < 4
56868      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
56869    return 1;
56870#endif
56871#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
56872  /* Check whether the decimal separator is a comma.
56873     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
56874     are nl_langinfo(RADIXCHAR) are both ".".  */
56875  if (localeconv () ->decimal_point[0] != ',') return 1;
56876#endif
56877  return 0;
56878}
56879
56880_ACEOF
56881    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
56882  (eval $ac_link) 2>&5
56883  ac_status=$?
56884  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
56885  test $ac_status = 0; } && test -s conftest$ac_exeext; then
56886      case "$host_os" in
56887        # Handle native Windows specially, because there setlocale() interprets
56888        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
56889        # "fr" or "fra" as "French" or "French_France.1252",
56890        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
56891        # "ja" as "Japanese" or "Japanese_Japan.932",
56892        # and similar.
56893        mingw*)
56894          # Test for the hypothetical native Windows locale name.
56895          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
56896            gt_cv_locale_fr_utf8=French_France.65001
56897          else
56898            # None found.
56899            gt_cv_locale_fr_utf8=none
56900          fi
56901          ;;
56902        *)
56903          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
56904          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
56905          # configure script would override the LC_ALL setting. Likewise for
56906          # LC_CTYPE, which is also set at the beginning of the configure script.
56907          # Test for the usual locale name.
56908          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
56909            gt_cv_locale_fr_utf8=fr_FR
56910          else
56911            # Test for the locale name with explicit encoding suffix.
56912            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
56913              gt_cv_locale_fr_utf8=fr_FR.UTF-8
56914            else
56915              # Test for the Solaris 7 locale name.
56916              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
56917                gt_cv_locale_fr_utf8=fr.UTF-8
56918              else
56919                # None found.
56920                gt_cv_locale_fr_utf8=none
56921              fi
56922            fi
56923          fi
56924          ;;
56925      esac
56926    fi
56927    rm -fr conftest*
56928
56929fi
56930{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
56931$as_echo "$gt_cv_locale_fr_utf8" >&6; }
56932  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
56933
56934
56935
56936
56937
56938  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
56939$as_echo_n "checking for a traditional french locale... " >&6; }
56940if ${gt_cv_locale_fr+:} false; then :
56941  $as_echo_n "(cached) " >&6
56942else
56943
56944    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56945/* end confdefs.h.  */
56946
56947#include <locale.h>
56948#include <time.h>
56949#if HAVE_LANGINFO_CODESET
56950# include <langinfo.h>
56951#endif
56952#include <stdlib.h>
56953#include <string.h>
56954struct tm t;
56955char buf[16];
56956int main () {
56957  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
56958     imitates locale dependent behaviour by looking at the environment
56959     variables, and all locales use the UTF-8 encoding.  */
56960#if defined __BEOS__ || defined __HAIKU__
56961  return 1;
56962#else
56963  /* Check whether the given locale name is recognized by the system.  */
56964# if defined _WIN32 && !defined __CYGWIN__
56965  /* On native Windows, setlocale(category, "") looks at the system settings,
56966     not at the environment variables.  Also, when an encoding suffix such
56967     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
56968     category of the locale to "C".  */
56969  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
56970      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
56971    return 1;
56972# else
56973  if (setlocale (LC_ALL, "") == NULL) return 1;
56974# endif
56975  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
56976     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
56977     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
56978     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
56979     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
56980     some unit tests fail.
56981     On MirBSD 10, when an unsupported locale is specified, setlocale()
56982     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
56983# if HAVE_LANGINFO_CODESET
56984  {
56985    const char *cs = nl_langinfo (CODESET);
56986    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
56987        || strcmp (cs, "UTF-8") == 0)
56988      return 1;
56989  }
56990# endif
56991# ifdef __CYGWIN__
56992  /* On Cygwin, avoid locale names without encoding suffix, because the
56993     locale_charset() function relies on the encoding suffix.  Note that
56994     LC_ALL is set on the command line.  */
56995  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
56996# endif
56997  /* Check whether in the abbreviation of the second month, the second
56998     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
56999     one byte long. This excludes the UTF-8 encoding.  */
57000  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
57001  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
57002# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
57003  /* Check whether the decimal separator is a comma.
57004     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
57005     are nl_langinfo(RADIXCHAR) are both ".".  */
57006  if (localeconv () ->decimal_point[0] != ',') return 1;
57007# endif
57008  return 0;
57009#endif
57010}
57011
57012_ACEOF
57013    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
57014  (eval $ac_link) 2>&5
57015  ac_status=$?
57016  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
57017  test $ac_status = 0; } && test -s conftest$ac_exeext; then
57018      case "$host_os" in
57019        # Handle native Windows specially, because there setlocale() interprets
57020        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
57021        # "fr" or "fra" as "French" or "French_France.1252",
57022        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
57023        # "ja" as "Japanese" or "Japanese_Japan.932",
57024        # and similar.
57025        mingw*)
57026          # Test for the native Windows locale name.
57027          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
57028            gt_cv_locale_fr=French_France.1252
57029          else
57030            # None found.
57031            gt_cv_locale_fr=none
57032          fi
57033          ;;
57034        *)
57035          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
57036          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
57037          # configure script would override the LC_ALL setting. Likewise for
57038          # LC_CTYPE, which is also set at the beginning of the configure script.
57039          # Test for the usual locale name.
57040          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
57041            gt_cv_locale_fr=fr_FR
57042          else
57043            # Test for the locale name with explicit encoding suffix.
57044            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
57045              gt_cv_locale_fr=fr_FR.ISO-8859-1
57046            else
57047              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
57048              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
57049                gt_cv_locale_fr=fr_FR.ISO8859-1
57050              else
57051                # Test for the HP-UX locale name.
57052                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
57053                  gt_cv_locale_fr=fr_FR.iso88591
57054                else
57055                  # Test for the Solaris 7 locale name.
57056                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
57057                    gt_cv_locale_fr=fr
57058                  else
57059                    # None found.
57060                    gt_cv_locale_fr=none
57061                  fi
57062                fi
57063              fi
57064            fi
57065          fi
57066          ;;
57067      esac
57068    fi
57069    rm -fr conftest*
57070
57071fi
57072{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
57073$as_echo "$gt_cv_locale_fr" >&6; }
57074  LOCALE_FR=$gt_cv_locale_fr
57075
57076
57077
57078
57079
57080  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5
57081$as_echo_n "checking for a turkish Unicode locale... " >&6; }
57082if ${gt_cv_locale_tr_utf8+:} false; then :
57083  $as_echo_n "(cached) " >&6
57084else
57085
57086    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57087/* end confdefs.h.  */
57088
57089#include <locale.h>
57090#include <time.h>
57091#if HAVE_LANGINFO_CODESET
57092# include <langinfo.h>
57093#endif
57094#include <stdlib.h>
57095#include <string.h>
57096struct tm t;
57097char buf[16];
57098int main () {
57099  /* On BeOS, locales are not implemented in libc.  Rather, libintl
57100     imitates locale dependent behaviour by looking at the environment
57101     variables, and all locales use the UTF-8 encoding.  But BeOS does not
57102     implement the Turkish upper-/lowercase mappings.  Therefore, let this
57103     program return 1 on BeOS.  */
57104  /* Check whether the given locale name is recognized by the system.  */
57105#if defined _WIN32 && !defined __CYGWIN__
57106  /* On native Windows, setlocale(category, "") looks at the system settings,
57107     not at the environment variables.  Also, when an encoding suffix such
57108     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
57109     category of the locale to "C".  */
57110  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
57111      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
57112    return 1;
57113#else
57114  if (setlocale (LC_ALL, "") == NULL) return 1;
57115#endif
57116  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
57117     On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET)
57118     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
57119     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
57120     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
57121     some unit tests fail.  */
57122#if HAVE_LANGINFO_CODESET
57123  {
57124    const char *cs = nl_langinfo (CODESET);
57125    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
57126      return 1;
57127  }
57128#endif
57129#ifdef __CYGWIN__
57130  /* On Cygwin, avoid locale names without encoding suffix, because the
57131     locale_charset() function relies on the encoding suffix.  Note that
57132     LC_ALL is set on the command line.  */
57133  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
57134#endif
57135  /* Check whether in the abbreviation of the eighth month, the second
57136     character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is
57137     two bytes long, with UTF-8 encoding.  */
57138  t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19;
57139  if (strftime (buf, sizeof (buf), "%b", &t) < 4
57140      || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f)
57141    return 1;
57142  /* Check whether the upper-/lowercase mappings are as expected for
57143     Turkish.  */
57144  if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i'
57145      || towupper(0x0131) != 'I' || towlower ('I') != 0x0131)
57146    return 1;
57147  return 0;
57148}
57149
57150_ACEOF
57151    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
57152  (eval $ac_link) 2>&5
57153  ac_status=$?
57154  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
57155  test $ac_status = 0; } && test -s conftest$ac_exeext; then
57156      case "$host_os" in
57157        # Handle native Windows specially, because there setlocale() interprets
57158        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
57159        # "fr" or "fra" as "French" or "French_France.1252",
57160        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
57161        # "ja" as "Japanese" or "Japanese_Japan.932",
57162        # and similar.
57163        mingw*)
57164          # Test for the hypothetical native Windows locale name.
57165          if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
57166            gt_cv_locale_tr_utf8=Turkish_Turkey.65001
57167          else
57168            # None found.
57169            gt_cv_locale_tr_utf8=none
57170          fi
57171          ;;
57172        *)
57173          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
57174          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
57175          # configure script would override the LC_ALL setting. Likewise for
57176          # LC_CTYPE, which is also set at the beginning of the configure script.
57177          # Test for the usual locale name.
57178          if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
57179            gt_cv_locale_tr_utf8=tr_TR
57180          else
57181            # Test for the locale name with explicit encoding suffix.
57182            if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
57183              gt_cv_locale_tr_utf8=tr_TR.UTF-8
57184            else
57185              # Test for the Solaris 7 locale name.
57186              if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
57187                gt_cv_locale_tr_utf8=tr.UTF-8
57188              else
57189                # None found.
57190                gt_cv_locale_tr_utf8=none
57191              fi
57192            fi
57193          fi
57194          ;;
57195      esac
57196    else
57197      gt_cv_locale_tr_utf8=none
57198    fi
57199    rm -fr conftest*
57200
57201fi
57202{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5
57203$as_echo "$gt_cv_locale_tr_utf8" >&6; }
57204  LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8
57205
57206
57207
57208
57209  if test "$ac_cv_header_winsock2_h" = yes; then
57210
57211
57212
57213
57214
57215
57216
57217
57218  gltests_LIBOBJS="$gltests_LIBOBJS connect.$ac_objext"
57219
57220  fi
57221
57222
57223
57224
57225
57226    if test "$GNULIB_CONNECT" != 1; then
57227        if test "$GNULIB_CONNECT" = 0; then
57228      GNULIB_CONNECT=$gl_module_indicator_condition
57229    else
57230      GNULIB_CONNECT="($GNULIB_CONNECT || $gl_module_indicator_condition)"
57231    fi
57232  fi
57233
57234
57235
57236
57237
57238$as_echo "#define GNULIB_TEST_CONNECT 1" >>confdefs.h
57239
57240
57241
57242
57243
57244
57245
57246
57247
57248
57249
57250
57251  if test $ac_cv_func_getrusage = no; then
57252    HAVE_GETRUSAGE=0
57253  fi
57254
57255  if test $HAVE_GETRUSAGE = 0; then
57256
57257
57258
57259
57260
57261
57262
57263
57264  gltests_LIBOBJS="$gltests_LIBOBJS getrusage.$ac_objext"
57265
57266  fi
57267
57268
57269
57270
57271
57272    if test "$GNULIB_GETRUSAGE" != 1; then
57273        if test "$GNULIB_GETRUSAGE" = 0; then
57274      GNULIB_GETRUSAGE=$gl_module_indicator_condition
57275    else
57276      GNULIB_GETRUSAGE="($GNULIB_GETRUSAGE || $gl_module_indicator_condition)"
57277    fi
57278  fi
57279
57280
57281
57282
57283
57284$as_echo "#define GNULIB_TEST_GETRUSAGE 1" >>confdefs.h
57285
57286
57287
57288   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
57289$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
57290if ${ac_cv_c_bigendian+:} false; then :
57291  $as_echo_n "(cached) " >&6
57292else
57293  ac_cv_c_bigendian=unknown
57294    # See if we're dealing with a universal compiler.
57295    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57296/* end confdefs.h.  */
57297#ifndef __APPLE_CC__
57298	       not a universal capable compiler
57299	     #endif
57300	     typedef int dummy;
57301
57302_ACEOF
57303if ac_fn_c_try_compile "$LINENO"; then :
57304
57305	# Check for potential -arch flags.  It is not universal unless
57306	# there are at least two -arch flags with different values.
57307	ac_arch=
57308	ac_prev=
57309	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
57310	 if test -n "$ac_prev"; then
57311	   case $ac_word in
57312	     i?86 | x86_64 | ppc | ppc64)
57313	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
57314		 ac_arch=$ac_word
57315	       else
57316		 ac_cv_c_bigendian=universal
57317		 break
57318	       fi
57319	       ;;
57320	   esac
57321	   ac_prev=
57322	 elif test "x$ac_word" = "x-arch"; then
57323	   ac_prev=arch
57324	 fi
57325       done
57326fi
57327rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57328    if test $ac_cv_c_bigendian = unknown; then
57329      # See if sys/param.h defines the BYTE_ORDER macro.
57330      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57331/* end confdefs.h.  */
57332#include <sys/types.h>
57333	     #include <sys/param.h>
57334
57335int
57336main ()
57337{
57338#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
57339		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
57340		     && LITTLE_ENDIAN)
57341	      bogus endian macros
57342	     #endif
57343
57344  ;
57345  return 0;
57346}
57347_ACEOF
57348if ac_fn_c_try_compile "$LINENO"; then :
57349  # It does; now see whether it defined to BIG_ENDIAN or not.
57350	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57351/* end confdefs.h.  */
57352#include <sys/types.h>
57353		#include <sys/param.h>
57354
57355int
57356main ()
57357{
57358#if BYTE_ORDER != BIG_ENDIAN
57359		 not big endian
57360		#endif
57361
57362  ;
57363  return 0;
57364}
57365_ACEOF
57366if ac_fn_c_try_compile "$LINENO"; then :
57367  ac_cv_c_bigendian=yes
57368else
57369  ac_cv_c_bigendian=no
57370fi
57371rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57372fi
57373rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57374    fi
57375    if test $ac_cv_c_bigendian = unknown; then
57376      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
57377      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57378/* end confdefs.h.  */
57379#include <limits.h>
57380
57381int
57382main ()
57383{
57384#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
57385	      bogus endian macros
57386	     #endif
57387
57388  ;
57389  return 0;
57390}
57391_ACEOF
57392if ac_fn_c_try_compile "$LINENO"; then :
57393  # It does; now see whether it defined to _BIG_ENDIAN or not.
57394	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57395/* end confdefs.h.  */
57396#include <limits.h>
57397
57398int
57399main ()
57400{
57401#ifndef _BIG_ENDIAN
57402		 not big endian
57403		#endif
57404
57405  ;
57406  return 0;
57407}
57408_ACEOF
57409if ac_fn_c_try_compile "$LINENO"; then :
57410  ac_cv_c_bigendian=yes
57411else
57412  ac_cv_c_bigendian=no
57413fi
57414rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57415fi
57416rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57417    fi
57418    if test $ac_cv_c_bigendian = unknown; then
57419      # Compile a test program.
57420      if test "$cross_compiling" = yes; then :
57421  # Try to guess by grepping values from an object file.
57422	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57423/* end confdefs.h.  */
57424short int ascii_mm[] =
57425		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
57426		short int ascii_ii[] =
57427		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
57428		int use_ascii (int i) {
57429		  return ascii_mm[i] + ascii_ii[i];
57430		}
57431		short int ebcdic_ii[] =
57432		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
57433		short int ebcdic_mm[] =
57434		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
57435		int use_ebcdic (int i) {
57436		  return ebcdic_mm[i] + ebcdic_ii[i];
57437		}
57438		extern int foo;
57439
57440int
57441main ()
57442{
57443return use_ascii (foo) == use_ebcdic (foo);
57444  ;
57445  return 0;
57446}
57447_ACEOF
57448if ac_fn_c_try_compile "$LINENO"; then :
57449  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
57450	      ac_cv_c_bigendian=yes
57451	    fi
57452	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
57453	      if test "$ac_cv_c_bigendian" = unknown; then
57454		ac_cv_c_bigendian=no
57455	      else
57456		# finding both strings is unlikely to happen, but who knows?
57457		ac_cv_c_bigendian=unknown
57458	      fi
57459	    fi
57460fi
57461rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57462else
57463  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57464/* end confdefs.h.  */
57465$ac_includes_default
57466int
57467main ()
57468{
57469
57470	     /* Are we little or big endian?  From Harbison&Steele.  */
57471	     union
57472	     {
57473	       long int l;
57474	       char c[sizeof (long int)];
57475	     } u;
57476	     u.l = 1;
57477	     return u.c[sizeof (long int) - 1] == 1;
57478
57479  ;
57480  return 0;
57481}
57482_ACEOF
57483if ac_fn_c_try_run "$LINENO"; then :
57484  ac_cv_c_bigendian=no
57485else
57486  ac_cv_c_bigendian=yes
57487fi
57488rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
57489  conftest.$ac_objext conftest.beam conftest.$ac_ext
57490fi
57491
57492    fi
57493fi
57494{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
57495$as_echo "$ac_cv_c_bigendian" >&6; }
57496 case $ac_cv_c_bigendian in #(
57497   yes)
57498     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
57499;; #(
57500   no)
57501      ;; #(
57502   universal)
57503
57504$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
57505
57506     ;; #(
57507   *)
57508     as_fn_error $? "unknown endianness
57509 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
57510 esac
57511
57512
57513
57514
57515
57516
57517
57518
57519                HAVE_INET_PTON=1
57520  INET_PTON_LIB=
57521
57522
57523
57524
57525  if test $ac_cv_header_sys_socket_h != yes; then
57526                    for ac_header in winsock2.h
57527do :
57528  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
57529if test "x$ac_cv_header_winsock2_h" = xyes; then :
57530  cat >>confdefs.h <<_ACEOF
57531#define HAVE_WINSOCK2_H 1
57532_ACEOF
57533
57534fi
57535
57536done
57537
57538  fi
57539  if test "$ac_cv_header_winsock2_h" = yes; then
57540    HAVE_WINSOCK2_H=1
57541    UNISTD_H_HAVE_WINSOCK2_H=1
57542    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
57543  else
57544    HAVE_WINSOCK2_H=0
57545  fi
57546
57547
57548  if test $HAVE_WINSOCK2_H = 1; then
57549    ac_fn_c_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include <ws2tcpip.h>
57550"
57551if test "x$ac_cv_have_decl_inet_pton" = xyes; then :
57552  ac_have_decl=1
57553else
57554  ac_have_decl=0
57555fi
57556
57557cat >>confdefs.h <<_ACEOF
57558#define HAVE_DECL_INET_PTON $ac_have_decl
57559_ACEOF
57560
57561    if test $ac_cv_have_decl_inet_pton = yes; then
57562                  REPLACE_INET_PTON=1
57563      INET_PTON_LIB="-lws2_32"
57564    else
57565      HAVE_DECL_INET_PTON=0
57566      HAVE_INET_PTON=0
57567    fi
57568  else
57569    gl_save_LIBS=$LIBS
57570    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5
57571$as_echo_n "checking for library containing inet_pton... " >&6; }
57572if ${ac_cv_search_inet_pton+:} false; then :
57573  $as_echo_n "(cached) " >&6
57574else
57575  ac_func_search_save_LIBS=$LIBS
57576cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57577/* end confdefs.h.  */
57578
57579/* Override any GCC internal prototype to avoid an error.
57580   Use char because int might match the return type of a GCC
57581   builtin and then its argument prototype would still apply.  */
57582#ifdef __cplusplus
57583extern "C"
57584#endif
57585char inet_pton ();
57586int
57587main ()
57588{
57589return inet_pton ();
57590  ;
57591  return 0;
57592}
57593_ACEOF
57594for ac_lib in '' nsl resolv network; do
57595  if test -z "$ac_lib"; then
57596    ac_res="none required"
57597  else
57598    ac_res=-l$ac_lib
57599    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
57600  fi
57601  if ac_fn_c_try_link "$LINENO"; then :
57602  ac_cv_search_inet_pton=$ac_res
57603fi
57604rm -f core conftest.err conftest.$ac_objext \
57605    conftest$ac_exeext
57606  if ${ac_cv_search_inet_pton+:} false; then :
57607  break
57608fi
57609done
57610if ${ac_cv_search_inet_pton+:} false; then :
57611
57612else
57613  ac_cv_search_inet_pton=no
57614fi
57615rm conftest.$ac_ext
57616LIBS=$ac_func_search_save_LIBS
57617fi
57618{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5
57619$as_echo "$ac_cv_search_inet_pton" >&6; }
57620ac_res=$ac_cv_search_inet_pton
57621if test "$ac_res" != no; then :
57622  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
57623
57624else
57625  for ac_func in inet_pton
57626do :
57627  ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
57628if test "x$ac_cv_func_inet_pton" = xyes; then :
57629  cat >>confdefs.h <<_ACEOF
57630#define HAVE_INET_PTON 1
57631_ACEOF
57632
57633fi
57634done
57635
57636       if test $ac_cv_func_inet_pton = no; then
57637         HAVE_INET_PTON=0
57638       fi
57639
57640fi
57641
57642    LIBS=$gl_save_LIBS
57643
57644    if test "$ac_cv_search_inet_pton" != "no" \
57645       && test "$ac_cv_search_inet_pton" != "none required"; then
57646      INET_PTON_LIB="$ac_cv_search_inet_pton"
57647    fi
57648
57649
57650    ac_fn_c_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include <arpa/inet.h>
57651        #if HAVE_NETDB_H
57652        # include <netdb.h>
57653        #endif
57654
57655"
57656if test "x$ac_cv_have_decl_inet_pton" = xyes; then :
57657  ac_have_decl=1
57658else
57659  ac_have_decl=0
57660fi
57661
57662cat >>confdefs.h <<_ACEOF
57663#define HAVE_DECL_INET_PTON $ac_have_decl
57664_ACEOF
57665
57666    if test $ac_cv_have_decl_inet_pton = no; then
57667      HAVE_DECL_INET_PTON=0
57668    fi
57669  fi
57670
57671
57672  if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then
57673
57674
57675
57676
57677
57678
57679
57680
57681  gltests_LIBOBJS="$gltests_LIBOBJS inet_pton.$ac_objext"
57682
57683
57684
57685
57686  fi
57687
57688
57689
57690
57691
57692    if test "$GNULIB_INET_PTON" != 1; then
57693        if test "$GNULIB_INET_PTON" = 0; then
57694      GNULIB_INET_PTON=$gl_module_indicator_condition
57695    else
57696      GNULIB_INET_PTON="($GNULIB_INET_PTON || $gl_module_indicator_condition)"
57697    fi
57698  fi
57699
57700
57701
57702
57703   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
57704$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
57705if ${ac_cv_c_bigendian+:} false; then :
57706  $as_echo_n "(cached) " >&6
57707else
57708  ac_cv_c_bigendian=unknown
57709    # See if we're dealing with a universal compiler.
57710    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57711/* end confdefs.h.  */
57712#ifndef __APPLE_CC__
57713	       not a universal capable compiler
57714	     #endif
57715	     typedef int dummy;
57716
57717_ACEOF
57718if ac_fn_c_try_compile "$LINENO"; then :
57719
57720	# Check for potential -arch flags.  It is not universal unless
57721	# there are at least two -arch flags with different values.
57722	ac_arch=
57723	ac_prev=
57724	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
57725	 if test -n "$ac_prev"; then
57726	   case $ac_word in
57727	     i?86 | x86_64 | ppc | ppc64)
57728	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
57729		 ac_arch=$ac_word
57730	       else
57731		 ac_cv_c_bigendian=universal
57732		 break
57733	       fi
57734	       ;;
57735	   esac
57736	   ac_prev=
57737	 elif test "x$ac_word" = "x-arch"; then
57738	   ac_prev=arch
57739	 fi
57740       done
57741fi
57742rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57743    if test $ac_cv_c_bigendian = unknown; then
57744      # See if sys/param.h defines the BYTE_ORDER macro.
57745      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57746/* end confdefs.h.  */
57747#include <sys/types.h>
57748	     #include <sys/param.h>
57749
57750int
57751main ()
57752{
57753#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
57754		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
57755		     && LITTLE_ENDIAN)
57756	      bogus endian macros
57757	     #endif
57758
57759  ;
57760  return 0;
57761}
57762_ACEOF
57763if ac_fn_c_try_compile "$LINENO"; then :
57764  # It does; now see whether it defined to BIG_ENDIAN or not.
57765	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57766/* end confdefs.h.  */
57767#include <sys/types.h>
57768		#include <sys/param.h>
57769
57770int
57771main ()
57772{
57773#if BYTE_ORDER != BIG_ENDIAN
57774		 not big endian
57775		#endif
57776
57777  ;
57778  return 0;
57779}
57780_ACEOF
57781if ac_fn_c_try_compile "$LINENO"; then :
57782  ac_cv_c_bigendian=yes
57783else
57784  ac_cv_c_bigendian=no
57785fi
57786rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57787fi
57788rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57789    fi
57790    if test $ac_cv_c_bigendian = unknown; then
57791      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
57792      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57793/* end confdefs.h.  */
57794#include <limits.h>
57795
57796int
57797main ()
57798{
57799#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
57800	      bogus endian macros
57801	     #endif
57802
57803  ;
57804  return 0;
57805}
57806_ACEOF
57807if ac_fn_c_try_compile "$LINENO"; then :
57808  # It does; now see whether it defined to _BIG_ENDIAN or not.
57809	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57810/* end confdefs.h.  */
57811#include <limits.h>
57812
57813int
57814main ()
57815{
57816#ifndef _BIG_ENDIAN
57817		 not big endian
57818		#endif
57819
57820  ;
57821  return 0;
57822}
57823_ACEOF
57824if ac_fn_c_try_compile "$LINENO"; then :
57825  ac_cv_c_bigendian=yes
57826else
57827  ac_cv_c_bigendian=no
57828fi
57829rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57830fi
57831rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57832    fi
57833    if test $ac_cv_c_bigendian = unknown; then
57834      # Compile a test program.
57835      if test "$cross_compiling" = yes; then :
57836  # Try to guess by grepping values from an object file.
57837	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57838/* end confdefs.h.  */
57839short int ascii_mm[] =
57840		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
57841		short int ascii_ii[] =
57842		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
57843		int use_ascii (int i) {
57844		  return ascii_mm[i] + ascii_ii[i];
57845		}
57846		short int ebcdic_ii[] =
57847		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
57848		short int ebcdic_mm[] =
57849		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
57850		int use_ebcdic (int i) {
57851		  return ebcdic_mm[i] + ebcdic_ii[i];
57852		}
57853		extern int foo;
57854
57855int
57856main ()
57857{
57858return use_ascii (foo) == use_ebcdic (foo);
57859  ;
57860  return 0;
57861}
57862_ACEOF
57863if ac_fn_c_try_compile "$LINENO"; then :
57864  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
57865	      ac_cv_c_bigendian=yes
57866	    fi
57867	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
57868	      if test "$ac_cv_c_bigendian" = unknown; then
57869		ac_cv_c_bigendian=no
57870	      else
57871		# finding both strings is unlikely to happen, but who knows?
57872		ac_cv_c_bigendian=unknown
57873	      fi
57874	    fi
57875fi
57876rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57877else
57878  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57879/* end confdefs.h.  */
57880$ac_includes_default
57881int
57882main ()
57883{
57884
57885	     /* Are we little or big endian?  From Harbison&Steele.  */
57886	     union
57887	     {
57888	       long int l;
57889	       char c[sizeof (long int)];
57890	     } u;
57891	     u.l = 1;
57892	     return u.c[sizeof (long int) - 1] == 1;
57893
57894  ;
57895  return 0;
57896}
57897_ACEOF
57898if ac_fn_c_try_run "$LINENO"; then :
57899  ac_cv_c_bigendian=no
57900else
57901  ac_cv_c_bigendian=yes
57902fi
57903rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
57904  conftest.$ac_objext conftest.beam conftest.$ac_ext
57905fi
57906
57907    fi
57908fi
57909{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
57910$as_echo "$ac_cv_c_bigendian" >&6; }
57911 case $ac_cv_c_bigendian in #(
57912   yes)
57913     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
57914;; #(
57915   no)
57916      ;; #(
57917   universal)
57918
57919$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
57920
57921     ;; #(
57922   *)
57923     as_fn_error $? "unknown endianness
57924 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
57925 esac
57926
57927
57928
57929
57930  HAVE_IOCTL=1
57931  if test "$ac_cv_header_winsock2_h" = yes; then
57932                HAVE_IOCTL=0
57933  else
57934    for ac_func in ioctl
57935do :
57936  ac_fn_c_check_func "$LINENO" "ioctl" "ac_cv_func_ioctl"
57937if test "x$ac_cv_func_ioctl" = xyes; then :
57938  cat >>confdefs.h <<_ACEOF
57939#define HAVE_IOCTL 1
57940_ACEOF
57941
57942fi
57943done
57944
57945                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ioctl with POSIX signature" >&5
57946$as_echo_n "checking for ioctl with POSIX signature... " >&6; }
57947if ${gl_cv_func_ioctl_posix_signature+:} false; then :
57948  $as_echo_n "(cached) " >&6
57949else
57950  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57951/* end confdefs.h.  */
57952#include <sys/ioctl.h>
57953              /* On some platforms, ioctl() is declared in <unistd.h>.  */
57954              #include <unistd.h>
57955
57956int
57957main ()
57958{
57959extern
57960              #ifdef __cplusplus
57961              "C"
57962              #endif
57963              int ioctl (int, int, ...);
57964
57965  ;
57966  return 0;
57967}
57968
57969_ACEOF
57970if ac_fn_c_try_compile "$LINENO"; then :
57971  gl_cv_func_ioctl_posix_signature=yes
57972else
57973  gl_cv_func_ioctl_posix_signature=no
57974fi
57975rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57976
57977fi
57978{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ioctl_posix_signature" >&5
57979$as_echo "$gl_cv_func_ioctl_posix_signature" >&6; }
57980    if test $gl_cv_func_ioctl_posix_signature != yes; then
57981      REPLACE_IOCTL=1
57982    fi
57983  fi
57984
57985  if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then
57986
57987
57988
57989
57990
57991
57992
57993
57994  gltests_LIBOBJS="$gltests_LIBOBJS ioctl.$ac_objext"
57995
57996  fi
57997
57998
57999
58000
58001
58002    if test "$GNULIB_IOCTL" != 1; then
58003        if test "$GNULIB_IOCTL" = 0; then
58004      GNULIB_IOCTL=$gl_module_indicator_condition
58005    else
58006      GNULIB_IOCTL="($GNULIB_IOCTL || $gl_module_indicator_condition)"
58007    fi
58008  fi
58009
58010
58011
58012
58013
58014$as_echo "#define GNULIB_TEST_IOCTL 1" >>confdefs.h
58015
58016
58017
58018
58019  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
58020$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
58021if ${gl_cv_cc_double_expbit0+:} false; then :
58022  $as_echo_n "(cached) " >&6
58023else
58024
58025      if test "$cross_compiling" = yes; then :
58026
58027                                                                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58028/* end confdefs.h.  */
58029
58030#if defined arm || defined __arm || defined __arm__
58031  mixed_endianness
58032#endif
58033
58034_ACEOF
58035if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
58036  $EGREP "mixed_endianness" >/dev/null 2>&1; then :
58037  gl_cv_cc_double_expbit0="unknown"
58038else
58039
58040                                                         :
58041if ${ac_cv_c_bigendian+:} false; then :
58042  $as_echo_n "(cached) " >&6
58043else
58044  ac_cv_c_bigendian=unknown
58045    # See if we're dealing with a universal compiler.
58046    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58047/* end confdefs.h.  */
58048#ifndef __APPLE_CC__
58049	       not a universal capable compiler
58050	     #endif
58051	     typedef int dummy;
58052
58053_ACEOF
58054if ac_fn_c_try_compile "$LINENO"; then :
58055
58056	# Check for potential -arch flags.  It is not universal unless
58057	# there are at least two -arch flags with different values.
58058	ac_arch=
58059	ac_prev=
58060	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
58061	 if test -n "$ac_prev"; then
58062	   case $ac_word in
58063	     i?86 | x86_64 | ppc | ppc64)
58064	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
58065		 ac_arch=$ac_word
58066	       else
58067		 ac_cv_c_bigendian=universal
58068		 break
58069	       fi
58070	       ;;
58071	   esac
58072	   ac_prev=
58073	 elif test "x$ac_word" = "x-arch"; then
58074	   ac_prev=arch
58075	 fi
58076       done
58077fi
58078rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58079    if test $ac_cv_c_bigendian = unknown; then
58080      # See if sys/param.h defines the BYTE_ORDER macro.
58081      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58082/* end confdefs.h.  */
58083#include <sys/types.h>
58084	     #include <sys/param.h>
58085
58086int
58087main ()
58088{
58089#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
58090		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
58091		     && LITTLE_ENDIAN)
58092	      bogus endian macros
58093	     #endif
58094
58095  ;
58096  return 0;
58097}
58098_ACEOF
58099if ac_fn_c_try_compile "$LINENO"; then :
58100  # It does; now see whether it defined to BIG_ENDIAN or not.
58101	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58102/* end confdefs.h.  */
58103#include <sys/types.h>
58104		#include <sys/param.h>
58105
58106int
58107main ()
58108{
58109#if BYTE_ORDER != BIG_ENDIAN
58110		 not big endian
58111		#endif
58112
58113  ;
58114  return 0;
58115}
58116_ACEOF
58117if ac_fn_c_try_compile "$LINENO"; then :
58118  ac_cv_c_bigendian=yes
58119else
58120  ac_cv_c_bigendian=no
58121fi
58122rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58123fi
58124rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58125    fi
58126    if test $ac_cv_c_bigendian = unknown; then
58127      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
58128      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58129/* end confdefs.h.  */
58130#include <limits.h>
58131
58132int
58133main ()
58134{
58135#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
58136	      bogus endian macros
58137	     #endif
58138
58139  ;
58140  return 0;
58141}
58142_ACEOF
58143if ac_fn_c_try_compile "$LINENO"; then :
58144  # It does; now see whether it defined to _BIG_ENDIAN or not.
58145	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58146/* end confdefs.h.  */
58147#include <limits.h>
58148
58149int
58150main ()
58151{
58152#ifndef _BIG_ENDIAN
58153		 not big endian
58154		#endif
58155
58156  ;
58157  return 0;
58158}
58159_ACEOF
58160if ac_fn_c_try_compile "$LINENO"; then :
58161  ac_cv_c_bigendian=yes
58162else
58163  ac_cv_c_bigendian=no
58164fi
58165rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58166fi
58167rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58168    fi
58169    if test $ac_cv_c_bigendian = unknown; then
58170      # Compile a test program.
58171      if test "$cross_compiling" = yes; then :
58172  # Try to guess by grepping values from an object file.
58173	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58174/* end confdefs.h.  */
58175short int ascii_mm[] =
58176		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
58177		short int ascii_ii[] =
58178		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
58179		int use_ascii (int i) {
58180		  return ascii_mm[i] + ascii_ii[i];
58181		}
58182		short int ebcdic_ii[] =
58183		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
58184		short int ebcdic_mm[] =
58185		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
58186		int use_ebcdic (int i) {
58187		  return ebcdic_mm[i] + ebcdic_ii[i];
58188		}
58189		extern int foo;
58190
58191int
58192main ()
58193{
58194return use_ascii (foo) == use_ebcdic (foo);
58195  ;
58196  return 0;
58197}
58198_ACEOF
58199if ac_fn_c_try_compile "$LINENO"; then :
58200  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
58201	      ac_cv_c_bigendian=yes
58202	    fi
58203	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
58204	      if test "$ac_cv_c_bigendian" = unknown; then
58205		ac_cv_c_bigendian=no
58206	      else
58207		# finding both strings is unlikely to happen, but who knows?
58208		ac_cv_c_bigendian=unknown
58209	      fi
58210	    fi
58211fi
58212rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58213else
58214  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58215/* end confdefs.h.  */
58216$ac_includes_default
58217int
58218main ()
58219{
58220
58221	     /* Are we little or big endian?  From Harbison&Steele.  */
58222	     union
58223	     {
58224	       long int l;
58225	       char c[sizeof (long int)];
58226	     } u;
58227	     u.l = 1;
58228	     return u.c[sizeof (long int) - 1] == 1;
58229
58230  ;
58231  return 0;
58232}
58233_ACEOF
58234if ac_fn_c_try_run "$LINENO"; then :
58235  ac_cv_c_bigendian=no
58236else
58237  ac_cv_c_bigendian=yes
58238fi
58239rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
58240  conftest.$ac_objext conftest.beam conftest.$ac_ext
58241fi
58242
58243    fi
58244fi
58245:
58246 case $ac_cv_c_bigendian in #(
58247   yes)
58248     gl_cv_cc_double_expbit0="word 0 bit 20";; #(
58249   no)
58250     gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
58251   universal)
58252
58253$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
58254
58255     ;; #(
58256   *)
58257     gl_cv_cc_double_expbit0="unknown" ;;
58258 esac
58259
58260
58261fi
58262rm -f conftest*
58263
58264
58265else
58266  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58267/* end confdefs.h.  */
58268
58269#include <float.h>
58270#include <stddef.h>
58271#include <stdio.h>
58272#include <string.h>
58273#define NWORDS \
58274  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
58275typedef union { double value; unsigned int word[NWORDS]; } memory_double;
58276static unsigned int ored_words[NWORDS];
58277static unsigned int anded_words[NWORDS];
58278static void add_to_ored_words (double x)
58279{
58280  memory_double m;
58281  size_t i;
58282  /* Clear it first, in case sizeof (double) < sizeof (memory_double).  */
58283  memset (&m, 0, sizeof (memory_double));
58284  m.value = x;
58285  for (i = 0; i < NWORDS; i++)
58286    {
58287      ored_words[i] |= m.word[i];
58288      anded_words[i] &= m.word[i];
58289    }
58290}
58291int main ()
58292{
58293  size_t j;
58294  FILE *fp = fopen ("conftest.out", "w");
58295  if (fp == NULL)
58296    return 1;
58297  for (j = 0; j < NWORDS; j++)
58298    anded_words[j] = ~ (unsigned int) 0;
58299  add_to_ored_words (0.25);
58300  add_to_ored_words (0.5);
58301  add_to_ored_words (1.0);
58302  add_to_ored_words (2.0);
58303  add_to_ored_words (4.0);
58304  /* Remove bits that are common (e.g. if representation of the first mantissa
58305     bit is explicit).  */
58306  for (j = 0; j < NWORDS; j++)
58307    ored_words[j] &= ~anded_words[j];
58308  /* Now find the nonzero word.  */
58309  for (j = 0; j < NWORDS; j++)
58310    if (ored_words[j] != 0)
58311      break;
58312  if (j < NWORDS)
58313    {
58314      size_t i;
58315      for (i = j + 1; i < NWORDS; i++)
58316        if (ored_words[i] != 0)
58317          {
58318            fprintf (fp, "unknown");
58319            return (fclose (fp) != 0);
58320          }
58321      for (i = 0; ; i++)
58322        if ((ored_words[j] >> i) & 1)
58323          {
58324            fprintf (fp, "word %d bit %d", (int) j, (int) i);
58325            return (fclose (fp) != 0);
58326          }
58327    }
58328  fprintf (fp, "unknown");
58329  return (fclose (fp) != 0);
58330}
58331
58332_ACEOF
58333if ac_fn_c_try_run "$LINENO"; then :
58334  gl_cv_cc_double_expbit0=`cat conftest.out`
58335else
58336  gl_cv_cc_double_expbit0="unknown"
58337fi
58338rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
58339  conftest.$ac_objext conftest.beam conftest.$ac_ext
58340fi
58341
58342      rm -f conftest.out
58343
58344fi
58345{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
58346$as_echo "$gl_cv_cc_double_expbit0" >&6; }
58347  case "$gl_cv_cc_double_expbit0" in
58348    word*bit*)
58349      word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
58350      bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
58351
58352cat >>confdefs.h <<_ACEOF
58353#define DBL_EXPBIT0_WORD $word
58354_ACEOF
58355
58356
58357cat >>confdefs.h <<_ACEOF
58358#define DBL_EXPBIT0_BIT $bit
58359_ACEOF
58360
58361      ;;
58362  esac
58363
58364
58365  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
58366$as_echo_n "checking where to find the exponent in a 'float'... " >&6; }
58367if ${gl_cv_cc_float_expbit0+:} false; then :
58368  $as_echo_n "(cached) " >&6
58369else
58370
58371      if test "$cross_compiling" = yes; then :
58372  gl_cv_cc_float_expbit0="word 0 bit 23"
58373else
58374  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58375/* end confdefs.h.  */
58376
58377#include <float.h>
58378#include <stddef.h>
58379#include <stdio.h>
58380#include <string.h>
58381#define NWORDS \
58382  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
58383typedef union { float value; unsigned int word[NWORDS]; } memory_float;
58384static unsigned int ored_words[NWORDS];
58385static unsigned int anded_words[NWORDS];
58386static void add_to_ored_words (float x)
58387{
58388  memory_float m;
58389  size_t i;
58390  /* Clear it first, in case
58391     sizeof (float) < sizeof (memory_float).  */
58392  memset (&m, 0, sizeof (memory_float));
58393  m.value = x;
58394  for (i = 0; i < NWORDS; i++)
58395    {
58396      ored_words[i] |= m.word[i];
58397      anded_words[i] &= m.word[i];
58398    }
58399}
58400int main ()
58401{
58402  size_t j;
58403  FILE *fp = fopen ("conftest.out", "w");
58404  if (fp == NULL)
58405    return 1;
58406  for (j = 0; j < NWORDS; j++)
58407    anded_words[j] = ~ (unsigned int) 0;
58408  add_to_ored_words (0.25f);
58409  add_to_ored_words (0.5f);
58410  add_to_ored_words (1.0f);
58411  add_to_ored_words (2.0f);
58412  add_to_ored_words (4.0f);
58413  /* Remove bits that are common (e.g. if representation of the first mantissa
58414     bit is explicit).  */
58415  for (j = 0; j < NWORDS; j++)
58416    ored_words[j] &= ~anded_words[j];
58417  /* Now find the nonzero word.  */
58418  for (j = 0; j < NWORDS; j++)
58419    if (ored_words[j] != 0)
58420      break;
58421  if (j < NWORDS)
58422    {
58423      size_t i;
58424      for (i = j + 1; i < NWORDS; i++)
58425        if (ored_words[i] != 0)
58426          {
58427            fprintf (fp, "unknown");
58428            return (fclose (fp) != 0);
58429          }
58430      for (i = 0; ; i++)
58431        if ((ored_words[j] >> i) & 1)
58432          {
58433            fprintf (fp, "word %d bit %d", (int) j, (int) i);
58434            return (fclose (fp) != 0);
58435          }
58436    }
58437  fprintf (fp, "unknown");
58438  return (fclose (fp) != 0);
58439}
58440
58441_ACEOF
58442if ac_fn_c_try_run "$LINENO"; then :
58443  gl_cv_cc_float_expbit0=`cat conftest.out`
58444else
58445  gl_cv_cc_float_expbit0="unknown"
58446fi
58447rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
58448  conftest.$ac_objext conftest.beam conftest.$ac_ext
58449fi
58450
58451      rm -f conftest.out
58452
58453fi
58454{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
58455$as_echo "$gl_cv_cc_float_expbit0" >&6; }
58456  case "$gl_cv_cc_float_expbit0" in
58457    word*bit*)
58458      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
58459      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
58460
58461cat >>confdefs.h <<_ACEOF
58462#define FLT_EXPBIT0_WORD $word
58463_ACEOF
58464
58465
58466cat >>confdefs.h <<_ACEOF
58467#define FLT_EXPBIT0_BIT $bit
58468_ACEOF
58469
58470      ;;
58471  esac
58472
58473
58474
58475     { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
58476$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
58477if ${gl_cv_cc_long_double_expbit0+:} false; then :
58478  $as_echo_n "(cached) " >&6
58479else
58480
58481      if test "$cross_compiling" = yes; then :
58482
58483                              gl_cv_cc_long_double_expbit0="unknown"
58484          case "$host_os" in
58485            mingw*) # On native Windows (little-endian), we know the result
58486                    # in two cases: mingw, MSVC.
58487              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58488/* end confdefs.h.  */
58489
58490#ifdef __MINGW32__
58491 Known
58492#endif
58493
58494_ACEOF
58495if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
58496  $EGREP "Known" >/dev/null 2>&1; then :
58497  gl_cv_cc_long_double_expbit0="word 2 bit 0"
58498fi
58499rm -f conftest*
58500
58501              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58502/* end confdefs.h.  */
58503
58504#ifdef _MSC_VER
58505 Known
58506#endif
58507
58508_ACEOF
58509if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
58510  $EGREP "Known" >/dev/null 2>&1; then :
58511  gl_cv_cc_long_double_expbit0="word 1 bit 20"
58512fi
58513rm -f conftest*
58514
58515              ;;
58516          esac
58517
58518else
58519  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58520/* end confdefs.h.  */
58521
58522#include <float.h>
58523#include <stddef.h>
58524#include <stdio.h>
58525#include <string.h>
58526#define NWORDS \
58527  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
58528typedef union { long double value; unsigned int word[NWORDS]; }
58529        memory_long_double;
58530static unsigned int ored_words[NWORDS];
58531static unsigned int anded_words[NWORDS];
58532static void add_to_ored_words (long double x)
58533{
58534  memory_long_double m;
58535  size_t i;
58536  /* Clear it first, in case
58537     sizeof (long double) < sizeof (memory_long_double).  */
58538  memset (&m, 0, sizeof (memory_long_double));
58539  m.value = x;
58540  for (i = 0; i < NWORDS; i++)
58541    {
58542      ored_words[i] |= m.word[i];
58543      anded_words[i] &= m.word[i];
58544    }
58545}
58546int main ()
58547{
58548  size_t j;
58549  FILE *fp = fopen ("conftest.out", "w");
58550  if (fp == NULL)
58551    return 1;
58552  for (j = 0; j < NWORDS; j++)
58553    anded_words[j] = ~ (unsigned int) 0;
58554  add_to_ored_words (0.25L);
58555  add_to_ored_words (0.5L);
58556  add_to_ored_words (1.0L);
58557  add_to_ored_words (2.0L);
58558  add_to_ored_words (4.0L);
58559  /* Remove bits that are common (e.g. if representation of the first mantissa
58560     bit is explicit).  */
58561  for (j = 0; j < NWORDS; j++)
58562    ored_words[j] &= ~anded_words[j];
58563  /* Now find the nonzero word.  */
58564  for (j = 0; j < NWORDS; j++)
58565    if (ored_words[j] != 0)
58566      break;
58567  if (j < NWORDS)
58568    {
58569      size_t i;
58570      for (i = j + 1; i < NWORDS; i++)
58571        if (ored_words[i] != 0)
58572          {
58573            fprintf (fp, "unknown");
58574            return (fclose (fp) != 0);
58575          }
58576      for (i = 0; ; i++)
58577        if ((ored_words[j] >> i) & 1)
58578          {
58579            fprintf (fp, "word %d bit %d", (int) j, (int) i);
58580            return (fclose (fp) != 0);
58581          }
58582    }
58583  fprintf (fp, "unknown");
58584  return (fclose (fp) != 0);
58585}
58586
58587_ACEOF
58588if ac_fn_c_try_run "$LINENO"; then :
58589  gl_cv_cc_long_double_expbit0=`cat conftest.out`
58590else
58591  gl_cv_cc_long_double_expbit0="unknown"
58592fi
58593rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
58594  conftest.$ac_objext conftest.beam conftest.$ac_ext
58595fi
58596
58597      rm -f conftest.out
58598
58599fi
58600{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
58601$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
58602  case "$gl_cv_cc_long_double_expbit0" in
58603    word*bit*)
58604      word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
58605      bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
58606
58607cat >>confdefs.h <<_ACEOF
58608#define LDBL_EXPBIT0_WORD $word
58609_ACEOF
58610
58611
58612cat >>confdefs.h <<_ACEOF
58613#define LDBL_EXPBIT0_BIT $bit
58614_ACEOF
58615
58616      ;;
58617  esac
58618
58619
58620
58621
58622  if test "$ac_cv_header_winsock2_h" = yes; then
58623
58624
58625
58626
58627
58628
58629
58630
58631  gltests_LIBOBJS="$gltests_LIBOBJS listen.$ac_objext"
58632
58633  fi
58634
58635
58636
58637
58638
58639    if test "$GNULIB_LISTEN" != 1; then
58640        if test "$GNULIB_LISTEN" = 0; then
58641      GNULIB_LISTEN=$gl_module_indicator_condition
58642    else
58643      GNULIB_LISTEN="($GNULIB_LISTEN || $gl_module_indicator_condition)"
58644    fi
58645  fi
58646
58647
58648
58649
58650
58651$as_echo "#define GNULIB_TEST_LISTEN 1" >>confdefs.h
58652
58653
58654
58655
58656
58657
58658
58659
58660  for ac_func in setlocale uselocale
58661do :
58662  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
58663ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
58664if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
58665  cat >>confdefs.h <<_ACEOF
58666#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
58667_ACEOF
58668
58669fi
58670done
58671
58672      if test $ac_cv_func_uselocale = yes; then
58673    for ac_func in getlocalename_l
58674do :
58675  ac_fn_c_check_func "$LINENO" "getlocalename_l" "ac_cv_func_getlocalename_l"
58676if test "x$ac_cv_func_getlocalename_l" = xyes; then :
58677  cat >>confdefs.h <<_ACEOF
58678#define HAVE_GETLOCALENAME_L 1
58679_ACEOF
58680
58681fi
58682done
58683
58684  fi
58685
58686
58687
58688
58689
58690
58691  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
58692$as_echo_n "checking for a traditional french locale... " >&6; }
58693if ${gt_cv_locale_fr+:} false; then :
58694  $as_echo_n "(cached) " >&6
58695else
58696
58697    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58698/* end confdefs.h.  */
58699
58700#include <locale.h>
58701#include <time.h>
58702#if HAVE_LANGINFO_CODESET
58703# include <langinfo.h>
58704#endif
58705#include <stdlib.h>
58706#include <string.h>
58707struct tm t;
58708char buf[16];
58709int main () {
58710  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
58711     imitates locale dependent behaviour by looking at the environment
58712     variables, and all locales use the UTF-8 encoding.  */
58713#if defined __BEOS__ || defined __HAIKU__
58714  return 1;
58715#else
58716  /* Check whether the given locale name is recognized by the system.  */
58717# if defined _WIN32 && !defined __CYGWIN__
58718  /* On native Windows, setlocale(category, "") looks at the system settings,
58719     not at the environment variables.  Also, when an encoding suffix such
58720     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
58721     category of the locale to "C".  */
58722  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
58723      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
58724    return 1;
58725# else
58726  if (setlocale (LC_ALL, "") == NULL) return 1;
58727# endif
58728  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
58729     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
58730     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
58731     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
58732     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
58733     some unit tests fail.
58734     On MirBSD 10, when an unsupported locale is specified, setlocale()
58735     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
58736# if HAVE_LANGINFO_CODESET
58737  {
58738    const char *cs = nl_langinfo (CODESET);
58739    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
58740        || strcmp (cs, "UTF-8") == 0)
58741      return 1;
58742  }
58743# endif
58744# ifdef __CYGWIN__
58745  /* On Cygwin, avoid locale names without encoding suffix, because the
58746     locale_charset() function relies on the encoding suffix.  Note that
58747     LC_ALL is set on the command line.  */
58748  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
58749# endif
58750  /* Check whether in the abbreviation of the second month, the second
58751     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
58752     one byte long. This excludes the UTF-8 encoding.  */
58753  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
58754  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
58755# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
58756  /* Check whether the decimal separator is a comma.
58757     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
58758     are nl_langinfo(RADIXCHAR) are both ".".  */
58759  if (localeconv () ->decimal_point[0] != ',') return 1;
58760# endif
58761  return 0;
58762#endif
58763}
58764
58765_ACEOF
58766    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
58767  (eval $ac_link) 2>&5
58768  ac_status=$?
58769  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
58770  test $ac_status = 0; } && test -s conftest$ac_exeext; then
58771      case "$host_os" in
58772        # Handle native Windows specially, because there setlocale() interprets
58773        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
58774        # "fr" or "fra" as "French" or "French_France.1252",
58775        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
58776        # "ja" as "Japanese" or "Japanese_Japan.932",
58777        # and similar.
58778        mingw*)
58779          # Test for the native Windows locale name.
58780          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
58781            gt_cv_locale_fr=French_France.1252
58782          else
58783            # None found.
58784            gt_cv_locale_fr=none
58785          fi
58786          ;;
58787        *)
58788          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
58789          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
58790          # configure script would override the LC_ALL setting. Likewise for
58791          # LC_CTYPE, which is also set at the beginning of the configure script.
58792          # Test for the usual locale name.
58793          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
58794            gt_cv_locale_fr=fr_FR
58795          else
58796            # Test for the locale name with explicit encoding suffix.
58797            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
58798              gt_cv_locale_fr=fr_FR.ISO-8859-1
58799            else
58800              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
58801              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
58802                gt_cv_locale_fr=fr_FR.ISO8859-1
58803              else
58804                # Test for the HP-UX locale name.
58805                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
58806                  gt_cv_locale_fr=fr_FR.iso88591
58807                else
58808                  # Test for the Solaris 7 locale name.
58809                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
58810                    gt_cv_locale_fr=fr
58811                  else
58812                    # None found.
58813                    gt_cv_locale_fr=none
58814                  fi
58815                fi
58816              fi
58817            fi
58818          fi
58819          ;;
58820      esac
58821    fi
58822    rm -fr conftest*
58823
58824fi
58825{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
58826$as_echo "$gt_cv_locale_fr" >&6; }
58827  LOCALE_FR=$gt_cv_locale_fr
58828
58829
58830
58831
58832  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
58833$as_echo_n "checking for a french Unicode locale... " >&6; }
58834if ${gt_cv_locale_fr_utf8+:} false; then :
58835  $as_echo_n "(cached) " >&6
58836else
58837
58838    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58839/* end confdefs.h.  */
58840
58841#include <locale.h>
58842#include <time.h>
58843#if HAVE_LANGINFO_CODESET
58844# include <langinfo.h>
58845#endif
58846#include <stdlib.h>
58847#include <string.h>
58848struct tm t;
58849char buf[16];
58850int main () {
58851  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
58852     imitates locale dependent behaviour by looking at the environment
58853     variables, and all locales use the UTF-8 encoding.  */
58854#if !(defined __BEOS__ || defined __HAIKU__)
58855  /* Check whether the given locale name is recognized by the system.  */
58856# if defined _WIN32 && !defined __CYGWIN__
58857  /* On native Windows, setlocale(category, "") looks at the system settings,
58858     not at the environment variables.  Also, when an encoding suffix such
58859     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
58860     category of the locale to "C".  */
58861  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
58862      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
58863    return 1;
58864# else
58865  if (setlocale (LC_ALL, "") == NULL) return 1;
58866# endif
58867  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
58868     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
58869     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
58870     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
58871     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
58872     some unit tests fail.  */
58873# if HAVE_LANGINFO_CODESET
58874  {
58875    const char *cs = nl_langinfo (CODESET);
58876    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
58877      return 1;
58878  }
58879# endif
58880# ifdef __CYGWIN__
58881  /* On Cygwin, avoid locale names without encoding suffix, because the
58882     locale_charset() function relies on the encoding suffix.  Note that
58883     LC_ALL is set on the command line.  */
58884  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
58885# endif
58886  /* Check whether in the abbreviation of the second month, the second
58887     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
58888     two bytes long, with UTF-8 encoding.  */
58889  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
58890  if (strftime (buf, sizeof (buf), "%b", &t) < 4
58891      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
58892    return 1;
58893#endif
58894#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
58895  /* Check whether the decimal separator is a comma.
58896     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
58897     are nl_langinfo(RADIXCHAR) are both ".".  */
58898  if (localeconv () ->decimal_point[0] != ',') return 1;
58899#endif
58900  return 0;
58901}
58902
58903_ACEOF
58904    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
58905  (eval $ac_link) 2>&5
58906  ac_status=$?
58907  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
58908  test $ac_status = 0; } && test -s conftest$ac_exeext; then
58909      case "$host_os" in
58910        # Handle native Windows specially, because there setlocale() interprets
58911        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
58912        # "fr" or "fra" as "French" or "French_France.1252",
58913        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
58914        # "ja" as "Japanese" or "Japanese_Japan.932",
58915        # and similar.
58916        mingw*)
58917          # Test for the hypothetical native Windows locale name.
58918          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
58919            gt_cv_locale_fr_utf8=French_France.65001
58920          else
58921            # None found.
58922            gt_cv_locale_fr_utf8=none
58923          fi
58924          ;;
58925        *)
58926          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
58927          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
58928          # configure script would override the LC_ALL setting. Likewise for
58929          # LC_CTYPE, which is also set at the beginning of the configure script.
58930          # Test for the usual locale name.
58931          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
58932            gt_cv_locale_fr_utf8=fr_FR
58933          else
58934            # Test for the locale name with explicit encoding suffix.
58935            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
58936              gt_cv_locale_fr_utf8=fr_FR.UTF-8
58937            else
58938              # Test for the Solaris 7 locale name.
58939              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
58940                gt_cv_locale_fr_utf8=fr.UTF-8
58941              else
58942                # None found.
58943                gt_cv_locale_fr_utf8=none
58944              fi
58945            fi
58946          fi
58947          ;;
58948      esac
58949    fi
58950    rm -fr conftest*
58951
58952fi
58953{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
58954$as_echo "$gt_cv_locale_fr_utf8" >&6; }
58955  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
58956
58957
58958
58959
58960
58961  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
58962$as_echo_n "checking for a traditional japanese locale... " >&6; }
58963if ${gt_cv_locale_ja+:} false; then :
58964  $as_echo_n "(cached) " >&6
58965else
58966
58967    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58968/* end confdefs.h.  */
58969
58970#include <locale.h>
58971#include <time.h>
58972#if HAVE_LANGINFO_CODESET
58973# include <langinfo.h>
58974#endif
58975#include <stdlib.h>
58976#include <string.h>
58977struct tm t;
58978char buf[16];
58979int main ()
58980{
58981  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
58982     imitates locale dependent behaviour by looking at the environment
58983     variables, and all locales use the UTF-8 encoding.  */
58984#if defined __BEOS__ || defined __HAIKU__
58985  return 1;
58986#else
58987  /* Check whether the given locale name is recognized by the system.  */
58988# if defined _WIN32 && !defined __CYGWIN__
58989  /* On native Windows, setlocale(category, "") looks at the system settings,
58990     not at the environment variables.  Also, when an encoding suffix such
58991     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
58992     category of the locale to "C".  */
58993  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
58994      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
58995    return 1;
58996# else
58997  if (setlocale (LC_ALL, "") == NULL) return 1;
58998# endif
58999  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
59000     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
59001     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
59002     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
59003     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
59004     some unit tests fail.
59005     On MirBSD 10, when an unsupported locale is specified, setlocale()
59006     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
59007# if HAVE_LANGINFO_CODESET
59008  {
59009    const char *cs = nl_langinfo (CODESET);
59010    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
59011        || strcmp (cs, "UTF-8") == 0)
59012      return 1;
59013  }
59014# endif
59015# ifdef __CYGWIN__
59016  /* On Cygwin, avoid locale names without encoding suffix, because the
59017     locale_charset() function relies on the encoding suffix.  Note that
59018     LC_ALL is set on the command line.  */
59019  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
59020# endif
59021  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
59022     on Cygwin 1.5.x.  */
59023  if (MB_CUR_MAX == 1)
59024    return 1;
59025  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
59026     This excludes the UTF-8 encoding (except on MirBSD).  */
59027  {
59028    const char *p;
59029    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
59030    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
59031    for (p = buf; *p != '\0'; p++)
59032      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
59033        return 1;
59034  }
59035  return 0;
59036#endif
59037}
59038
59039_ACEOF
59040    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
59041  (eval $ac_link) 2>&5
59042  ac_status=$?
59043  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
59044  test $ac_status = 0; } && test -s conftest$ac_exeext; then
59045      case "$host_os" in
59046        # Handle native Windows specially, because there setlocale() interprets
59047        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
59048        # "fr" or "fra" as "French" or "French_France.1252",
59049        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
59050        # "ja" as "Japanese" or "Japanese_Japan.932",
59051        # and similar.
59052        mingw*)
59053          # Note that on native Windows, the Japanese locale is
59054          # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
59055          # cannot use it here.
59056          gt_cv_locale_ja=none
59057          ;;
59058        *)
59059          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
59060          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
59061          # configure script would override the LC_ALL setting. Likewise for
59062          # LC_CTYPE, which is also set at the beginning of the configure script.
59063          # Test for the AIX locale name.
59064          if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59065            gt_cv_locale_ja=ja_JP
59066          else
59067            # Test for the locale name with explicit encoding suffix.
59068            if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59069              gt_cv_locale_ja=ja_JP.EUC-JP
59070            else
59071              # Test for the HP-UX, OSF/1, NetBSD locale name.
59072              if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59073                gt_cv_locale_ja=ja_JP.eucJP
59074              else
59075                # Test for the IRIX, FreeBSD locale name.
59076                if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59077                  gt_cv_locale_ja=ja_JP.EUC
59078                else
59079                  # Test for the Solaris 7 locale name.
59080                  if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59081                    gt_cv_locale_ja=ja
59082                  else
59083                    # Special test for NetBSD 1.6.
59084                    if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
59085                      gt_cv_locale_ja=ja_JP.eucJP
59086                    else
59087                      # None found.
59088                      gt_cv_locale_ja=none
59089                    fi
59090                  fi
59091                fi
59092              fi
59093            fi
59094          fi
59095          ;;
59096      esac
59097    fi
59098    rm -fr conftest*
59099
59100fi
59101{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
59102$as_echo "$gt_cv_locale_ja" >&6; }
59103  LOCALE_JA=$gt_cv_locale_ja
59104
59105
59106
59107
59108
59109  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
59110$as_echo_n "checking for a transitional chinese locale... " >&6; }
59111if ${gt_cv_locale_zh_CN+:} false; then :
59112  $as_echo_n "(cached) " >&6
59113else
59114
59115    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59116/* end confdefs.h.  */
59117
59118#include <locale.h>
59119#include <stdlib.h>
59120#include <time.h>
59121#if HAVE_LANGINFO_CODESET
59122# include <langinfo.h>
59123#endif
59124#include <stdlib.h>
59125#include <string.h>
59126struct tm t;
59127char buf[16];
59128int main ()
59129{
59130  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
59131     imitates locale dependent behaviour by looking at the environment
59132     variables, and all locales use the UTF-8 encoding.  */
59133#if defined __BEOS__ || defined __HAIKU__
59134  return 1;
59135#else
59136  /* Check whether the given locale name is recognized by the system.  */
59137# if defined _WIN32 && !defined __CYGWIN__
59138  /* On native Windows, setlocale(category, "") looks at the system settings,
59139     not at the environment variables.  Also, when an encoding suffix such
59140     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
59141     category of the locale to "C".  */
59142  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
59143      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
59144    return 1;
59145# else
59146  if (setlocale (LC_ALL, "") == NULL) return 1;
59147# endif
59148  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
59149     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
59150     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
59151     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
59152     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
59153     some unit tests fail.
59154     On MirBSD 10, when an unsupported locale is specified, setlocale()
59155     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
59156# if HAVE_LANGINFO_CODESET
59157  {
59158    const char *cs = nl_langinfo (CODESET);
59159    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
59160        || strcmp (cs, "UTF-8") == 0)
59161      return 1;
59162  }
59163# endif
59164# ifdef __CYGWIN__
59165  /* On Cygwin, avoid locale names without encoding suffix, because the
59166     locale_charset() function relies on the encoding suffix.  Note that
59167     LC_ALL is set on the command line.  */
59168  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
59169# endif
59170  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
59171     This excludes the UTF-8 encoding (except on MirBSD).  */
59172  {
59173    const char *p;
59174    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
59175    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
59176    for (p = buf; *p != '\0'; p++)
59177      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
59178        return 1;
59179  }
59180  /* Check whether a typical GB18030 multibyte sequence is recognized as a
59181     single wide character.  This excludes the GB2312 and GBK encodings.  */
59182  if (mblen ("\203\062\332\066", 5) != 4)
59183    return 1;
59184  return 0;
59185#endif
59186}
59187
59188_ACEOF
59189    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
59190  (eval $ac_link) 2>&5
59191  ac_status=$?
59192  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
59193  test $ac_status = 0; } && test -s conftest$ac_exeext; then
59194      case "$host_os" in
59195        # Handle native Windows specially, because there setlocale() interprets
59196        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
59197        # "fr" or "fra" as "French" or "French_France.1252",
59198        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
59199        # "ja" as "Japanese" or "Japanese_Japan.932",
59200        # and similar.
59201        mingw*)
59202          # Test for the hypothetical native Windows locale name.
59203          if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59204            gt_cv_locale_zh_CN=Chinese_China.54936
59205          else
59206            # None found.
59207            gt_cv_locale_zh_CN=none
59208          fi
59209          ;;
59210        solaris2.8)
59211          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
59212          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
59213          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
59214          gt_cv_locale_zh_CN=none
59215          ;;
59216        *)
59217          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
59218          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
59219          # configure script would override the LC_ALL setting. Likewise for
59220          # LC_CTYPE, which is also set at the beginning of the configure script.
59221          # Test for the locale name without encoding suffix.
59222          if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59223            gt_cv_locale_zh_CN=zh_CN
59224          else
59225            # Test for the locale name with explicit encoding suffix.
59226            if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59227              gt_cv_locale_zh_CN=zh_CN.GB18030
59228            else
59229              # None found.
59230              gt_cv_locale_zh_CN=none
59231            fi
59232          fi
59233          ;;
59234      esac
59235    else
59236      # If there was a link error, due to mblen(), the system is so old that
59237      # it certainly doesn't have a chinese locale.
59238      gt_cv_locale_zh_CN=none
59239    fi
59240    rm -fr conftest*
59241
59242fi
59243{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
59244$as_echo "$gt_cv_locale_zh_CN" >&6; }
59245  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
59246
59247
59248
59249
59250
59251  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5
59252$as_echo_n "checking for a turkish Unicode locale... " >&6; }
59253if ${gt_cv_locale_tr_utf8+:} false; then :
59254  $as_echo_n "(cached) " >&6
59255else
59256
59257    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59258/* end confdefs.h.  */
59259
59260#include <locale.h>
59261#include <time.h>
59262#if HAVE_LANGINFO_CODESET
59263# include <langinfo.h>
59264#endif
59265#include <stdlib.h>
59266#include <string.h>
59267struct tm t;
59268char buf[16];
59269int main () {
59270  /* On BeOS, locales are not implemented in libc.  Rather, libintl
59271     imitates locale dependent behaviour by looking at the environment
59272     variables, and all locales use the UTF-8 encoding.  But BeOS does not
59273     implement the Turkish upper-/lowercase mappings.  Therefore, let this
59274     program return 1 on BeOS.  */
59275  /* Check whether the given locale name is recognized by the system.  */
59276#if defined _WIN32 && !defined __CYGWIN__
59277  /* On native Windows, setlocale(category, "") looks at the system settings,
59278     not at the environment variables.  Also, when an encoding suffix such
59279     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
59280     category of the locale to "C".  */
59281  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
59282      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
59283    return 1;
59284#else
59285  if (setlocale (LC_ALL, "") == NULL) return 1;
59286#endif
59287  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
59288     On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET)
59289     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
59290     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
59291     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
59292     some unit tests fail.  */
59293#if HAVE_LANGINFO_CODESET
59294  {
59295    const char *cs = nl_langinfo (CODESET);
59296    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
59297      return 1;
59298  }
59299#endif
59300#ifdef __CYGWIN__
59301  /* On Cygwin, avoid locale names without encoding suffix, because the
59302     locale_charset() function relies on the encoding suffix.  Note that
59303     LC_ALL is set on the command line.  */
59304  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
59305#endif
59306  /* Check whether in the abbreviation of the eighth month, the second
59307     character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is
59308     two bytes long, with UTF-8 encoding.  */
59309  t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19;
59310  if (strftime (buf, sizeof (buf), "%b", &t) < 4
59311      || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f)
59312    return 1;
59313  /* Check whether the upper-/lowercase mappings are as expected for
59314     Turkish.  */
59315  if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i'
59316      || towupper(0x0131) != 'I' || towlower ('I') != 0x0131)
59317    return 1;
59318  return 0;
59319}
59320
59321_ACEOF
59322    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
59323  (eval $ac_link) 2>&5
59324  ac_status=$?
59325  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
59326  test $ac_status = 0; } && test -s conftest$ac_exeext; then
59327      case "$host_os" in
59328        # Handle native Windows specially, because there setlocale() interprets
59329        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
59330        # "fr" or "fra" as "French" or "French_France.1252",
59331        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
59332        # "ja" as "Japanese" or "Japanese_Japan.932",
59333        # and similar.
59334        mingw*)
59335          # Test for the hypothetical native Windows locale name.
59336          if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59337            gt_cv_locale_tr_utf8=Turkish_Turkey.65001
59338          else
59339            # None found.
59340            gt_cv_locale_tr_utf8=none
59341          fi
59342          ;;
59343        *)
59344          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
59345          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
59346          # configure script would override the LC_ALL setting. Likewise for
59347          # LC_CTYPE, which is also set at the beginning of the configure script.
59348          # Test for the usual locale name.
59349          if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59350            gt_cv_locale_tr_utf8=tr_TR
59351          else
59352            # Test for the locale name with explicit encoding suffix.
59353            if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59354              gt_cv_locale_tr_utf8=tr_TR.UTF-8
59355            else
59356              # Test for the Solaris 7 locale name.
59357              if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59358                gt_cv_locale_tr_utf8=tr.UTF-8
59359              else
59360                # None found.
59361                gt_cv_locale_tr_utf8=none
59362              fi
59363            fi
59364          fi
59365          ;;
59366      esac
59367    else
59368      gt_cv_locale_tr_utf8=none
59369    fi
59370    rm -fr conftest*
59371
59372fi
59373{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5
59374$as_echo "$gt_cv_locale_tr_utf8" >&6; }
59375  LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8
59376
59377
59378
59379
59380
59381  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
59382$as_echo_n "checking for a transitional chinese locale... " >&6; }
59383if ${gt_cv_locale_zh_CN+:} false; then :
59384  $as_echo_n "(cached) " >&6
59385else
59386
59387    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59388/* end confdefs.h.  */
59389
59390#include <locale.h>
59391#include <stdlib.h>
59392#include <time.h>
59393#if HAVE_LANGINFO_CODESET
59394# include <langinfo.h>
59395#endif
59396#include <stdlib.h>
59397#include <string.h>
59398struct tm t;
59399char buf[16];
59400int main ()
59401{
59402  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
59403     imitates locale dependent behaviour by looking at the environment
59404     variables, and all locales use the UTF-8 encoding.  */
59405#if defined __BEOS__ || defined __HAIKU__
59406  return 1;
59407#else
59408  /* Check whether the given locale name is recognized by the system.  */
59409# if defined _WIN32 && !defined __CYGWIN__
59410  /* On native Windows, setlocale(category, "") looks at the system settings,
59411     not at the environment variables.  Also, when an encoding suffix such
59412     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
59413     category of the locale to "C".  */
59414  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
59415      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
59416    return 1;
59417# else
59418  if (setlocale (LC_ALL, "") == NULL) return 1;
59419# endif
59420  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
59421     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
59422     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
59423     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
59424     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
59425     some unit tests fail.
59426     On MirBSD 10, when an unsupported locale is specified, setlocale()
59427     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
59428# if HAVE_LANGINFO_CODESET
59429  {
59430    const char *cs = nl_langinfo (CODESET);
59431    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
59432        || strcmp (cs, "UTF-8") == 0)
59433      return 1;
59434  }
59435# endif
59436# ifdef __CYGWIN__
59437  /* On Cygwin, avoid locale names without encoding suffix, because the
59438     locale_charset() function relies on the encoding suffix.  Note that
59439     LC_ALL is set on the command line.  */
59440  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
59441# endif
59442  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
59443     This excludes the UTF-8 encoding (except on MirBSD).  */
59444  {
59445    const char *p;
59446    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
59447    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
59448    for (p = buf; *p != '\0'; p++)
59449      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
59450        return 1;
59451  }
59452  /* Check whether a typical GB18030 multibyte sequence is recognized as a
59453     single wide character.  This excludes the GB2312 and GBK encodings.  */
59454  if (mblen ("\203\062\332\066", 5) != 4)
59455    return 1;
59456  return 0;
59457#endif
59458}
59459
59460_ACEOF
59461    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
59462  (eval $ac_link) 2>&5
59463  ac_status=$?
59464  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
59465  test $ac_status = 0; } && test -s conftest$ac_exeext; then
59466      case "$host_os" in
59467        # Handle native Windows specially, because there setlocale() interprets
59468        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
59469        # "fr" or "fra" as "French" or "French_France.1252",
59470        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
59471        # "ja" as "Japanese" or "Japanese_Japan.932",
59472        # and similar.
59473        mingw*)
59474          # Test for the hypothetical native Windows locale name.
59475          if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59476            gt_cv_locale_zh_CN=Chinese_China.54936
59477          else
59478            # None found.
59479            gt_cv_locale_zh_CN=none
59480          fi
59481          ;;
59482        solaris2.8)
59483          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
59484          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
59485          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
59486          gt_cv_locale_zh_CN=none
59487          ;;
59488        *)
59489          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
59490          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
59491          # configure script would override the LC_ALL setting. Likewise for
59492          # LC_CTYPE, which is also set at the beginning of the configure script.
59493          # Test for the locale name without encoding suffix.
59494          if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59495            gt_cv_locale_zh_CN=zh_CN
59496          else
59497            # Test for the locale name with explicit encoding suffix.
59498            if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59499              gt_cv_locale_zh_CN=zh_CN.GB18030
59500            else
59501              # None found.
59502              gt_cv_locale_zh_CN=none
59503            fi
59504          fi
59505          ;;
59506      esac
59507    else
59508      # If there was a link error, due to mblen(), the system is so old that
59509      # it certainly doesn't have a chinese locale.
59510      gt_cv_locale_zh_CN=none
59511    fi
59512    rm -fr conftest*
59513
59514fi
59515{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
59516$as_echo "$gt_cv_locale_zh_CN" >&6; }
59517  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
59518
59519
59520
59521
59522  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
59523$as_echo_n "checking for a french Unicode locale... " >&6; }
59524if ${gt_cv_locale_fr_utf8+:} false; then :
59525  $as_echo_n "(cached) " >&6
59526else
59527
59528    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59529/* end confdefs.h.  */
59530
59531#include <locale.h>
59532#include <time.h>
59533#if HAVE_LANGINFO_CODESET
59534# include <langinfo.h>
59535#endif
59536#include <stdlib.h>
59537#include <string.h>
59538struct tm t;
59539char buf[16];
59540int main () {
59541  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
59542     imitates locale dependent behaviour by looking at the environment
59543     variables, and all locales use the UTF-8 encoding.  */
59544#if !(defined __BEOS__ || defined __HAIKU__)
59545  /* Check whether the given locale name is recognized by the system.  */
59546# if defined _WIN32 && !defined __CYGWIN__
59547  /* On native Windows, setlocale(category, "") looks at the system settings,
59548     not at the environment variables.  Also, when an encoding suffix such
59549     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
59550     category of the locale to "C".  */
59551  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
59552      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
59553    return 1;
59554# else
59555  if (setlocale (LC_ALL, "") == NULL) return 1;
59556# endif
59557  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
59558     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
59559     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
59560     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
59561     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
59562     some unit tests fail.  */
59563# if HAVE_LANGINFO_CODESET
59564  {
59565    const char *cs = nl_langinfo (CODESET);
59566    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
59567      return 1;
59568  }
59569# endif
59570# ifdef __CYGWIN__
59571  /* On Cygwin, avoid locale names without encoding suffix, because the
59572     locale_charset() function relies on the encoding suffix.  Note that
59573     LC_ALL is set on the command line.  */
59574  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
59575# endif
59576  /* Check whether in the abbreviation of the second month, the second
59577     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
59578     two bytes long, with UTF-8 encoding.  */
59579  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
59580  if (strftime (buf, sizeof (buf), "%b", &t) < 4
59581      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
59582    return 1;
59583#endif
59584#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
59585  /* Check whether the decimal separator is a comma.
59586     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
59587     are nl_langinfo(RADIXCHAR) are both ".".  */
59588  if (localeconv () ->decimal_point[0] != ',') return 1;
59589#endif
59590  return 0;
59591}
59592
59593_ACEOF
59594    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
59595  (eval $ac_link) 2>&5
59596  ac_status=$?
59597  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
59598  test $ac_status = 0; } && test -s conftest$ac_exeext; then
59599      case "$host_os" in
59600        # Handle native Windows specially, because there setlocale() interprets
59601        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
59602        # "fr" or "fra" as "French" or "French_France.1252",
59603        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
59604        # "ja" as "Japanese" or "Japanese_Japan.932",
59605        # and similar.
59606        mingw*)
59607          # Test for the hypothetical native Windows locale name.
59608          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59609            gt_cv_locale_fr_utf8=French_France.65001
59610          else
59611            # None found.
59612            gt_cv_locale_fr_utf8=none
59613          fi
59614          ;;
59615        *)
59616          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
59617          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
59618          # configure script would override the LC_ALL setting. Likewise for
59619          # LC_CTYPE, which is also set at the beginning of the configure script.
59620          # Test for the usual locale name.
59621          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59622            gt_cv_locale_fr_utf8=fr_FR
59623          else
59624            # Test for the locale name with explicit encoding suffix.
59625            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59626              gt_cv_locale_fr_utf8=fr_FR.UTF-8
59627            else
59628              # Test for the Solaris 7 locale name.
59629              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59630                gt_cv_locale_fr_utf8=fr.UTF-8
59631              else
59632                # None found.
59633                gt_cv_locale_fr_utf8=none
59634              fi
59635            fi
59636          fi
59637          ;;
59638      esac
59639    fi
59640    rm -fr conftest*
59641
59642fi
59643{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
59644$as_echo "$gt_cv_locale_fr_utf8" >&6; }
59645  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
59646
59647
59648
59649
59650
59651  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
59652$as_echo_n "checking for a traditional french locale... " >&6; }
59653if ${gt_cv_locale_fr+:} false; then :
59654  $as_echo_n "(cached) " >&6
59655else
59656
59657    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59658/* end confdefs.h.  */
59659
59660#include <locale.h>
59661#include <time.h>
59662#if HAVE_LANGINFO_CODESET
59663# include <langinfo.h>
59664#endif
59665#include <stdlib.h>
59666#include <string.h>
59667struct tm t;
59668char buf[16];
59669int main () {
59670  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
59671     imitates locale dependent behaviour by looking at the environment
59672     variables, and all locales use the UTF-8 encoding.  */
59673#if defined __BEOS__ || defined __HAIKU__
59674  return 1;
59675#else
59676  /* Check whether the given locale name is recognized by the system.  */
59677# if defined _WIN32 && !defined __CYGWIN__
59678  /* On native Windows, setlocale(category, "") looks at the system settings,
59679     not at the environment variables.  Also, when an encoding suffix such
59680     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
59681     category of the locale to "C".  */
59682  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
59683      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
59684    return 1;
59685# else
59686  if (setlocale (LC_ALL, "") == NULL) return 1;
59687# endif
59688  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
59689     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
59690     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
59691     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
59692     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
59693     some unit tests fail.
59694     On MirBSD 10, when an unsupported locale is specified, setlocale()
59695     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
59696# if HAVE_LANGINFO_CODESET
59697  {
59698    const char *cs = nl_langinfo (CODESET);
59699    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
59700        || strcmp (cs, "UTF-8") == 0)
59701      return 1;
59702  }
59703# endif
59704# ifdef __CYGWIN__
59705  /* On Cygwin, avoid locale names without encoding suffix, because the
59706     locale_charset() function relies on the encoding suffix.  Note that
59707     LC_ALL is set on the command line.  */
59708  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
59709# endif
59710  /* Check whether in the abbreviation of the second month, the second
59711     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
59712     one byte long. This excludes the UTF-8 encoding.  */
59713  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
59714  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
59715# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
59716  /* Check whether the decimal separator is a comma.
59717     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
59718     are nl_langinfo(RADIXCHAR) are both ".".  */
59719  if (localeconv () ->decimal_point[0] != ',') return 1;
59720# endif
59721  return 0;
59722#endif
59723}
59724
59725_ACEOF
59726    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
59727  (eval $ac_link) 2>&5
59728  ac_status=$?
59729  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
59730  test $ac_status = 0; } && test -s conftest$ac_exeext; then
59731      case "$host_os" in
59732        # Handle native Windows specially, because there setlocale() interprets
59733        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
59734        # "fr" or "fra" as "French" or "French_France.1252",
59735        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
59736        # "ja" as "Japanese" or "Japanese_Japan.932",
59737        # and similar.
59738        mingw*)
59739          # Test for the native Windows locale name.
59740          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59741            gt_cv_locale_fr=French_France.1252
59742          else
59743            # None found.
59744            gt_cv_locale_fr=none
59745          fi
59746          ;;
59747        *)
59748          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
59749          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
59750          # configure script would override the LC_ALL setting. Likewise for
59751          # LC_CTYPE, which is also set at the beginning of the configure script.
59752          # Test for the usual locale name.
59753          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59754            gt_cv_locale_fr=fr_FR
59755          else
59756            # Test for the locale name with explicit encoding suffix.
59757            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59758              gt_cv_locale_fr=fr_FR.ISO-8859-1
59759            else
59760              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
59761              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59762                gt_cv_locale_fr=fr_FR.ISO8859-1
59763              else
59764                # Test for the HP-UX locale name.
59765                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59766                  gt_cv_locale_fr=fr_FR.iso88591
59767                else
59768                  # Test for the Solaris 7 locale name.
59769                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59770                    gt_cv_locale_fr=fr
59771                  else
59772                    # None found.
59773                    gt_cv_locale_fr=none
59774                  fi
59775                fi
59776              fi
59777            fi
59778          fi
59779          ;;
59780      esac
59781    fi
59782    rm -fr conftest*
59783
59784fi
59785{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
59786$as_echo "$gt_cv_locale_fr" >&6; }
59787  LOCALE_FR=$gt_cv_locale_fr
59788
59789
59790
59791
59792  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
59793$as_echo_n "checking for a french Unicode locale... " >&6; }
59794if ${gt_cv_locale_fr_utf8+:} false; then :
59795  $as_echo_n "(cached) " >&6
59796else
59797
59798    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59799/* end confdefs.h.  */
59800
59801#include <locale.h>
59802#include <time.h>
59803#if HAVE_LANGINFO_CODESET
59804# include <langinfo.h>
59805#endif
59806#include <stdlib.h>
59807#include <string.h>
59808struct tm t;
59809char buf[16];
59810int main () {
59811  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
59812     imitates locale dependent behaviour by looking at the environment
59813     variables, and all locales use the UTF-8 encoding.  */
59814#if !(defined __BEOS__ || defined __HAIKU__)
59815  /* Check whether the given locale name is recognized by the system.  */
59816# if defined _WIN32 && !defined __CYGWIN__
59817  /* On native Windows, setlocale(category, "") looks at the system settings,
59818     not at the environment variables.  Also, when an encoding suffix such
59819     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
59820     category of the locale to "C".  */
59821  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
59822      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
59823    return 1;
59824# else
59825  if (setlocale (LC_ALL, "") == NULL) return 1;
59826# endif
59827  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
59828     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
59829     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
59830     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
59831     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
59832     some unit tests fail.  */
59833# if HAVE_LANGINFO_CODESET
59834  {
59835    const char *cs = nl_langinfo (CODESET);
59836    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
59837      return 1;
59838  }
59839# endif
59840# ifdef __CYGWIN__
59841  /* On Cygwin, avoid locale names without encoding suffix, because the
59842     locale_charset() function relies on the encoding suffix.  Note that
59843     LC_ALL is set on the command line.  */
59844  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
59845# endif
59846  /* Check whether in the abbreviation of the second month, the second
59847     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
59848     two bytes long, with UTF-8 encoding.  */
59849  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
59850  if (strftime (buf, sizeof (buf), "%b", &t) < 4
59851      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
59852    return 1;
59853#endif
59854#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
59855  /* Check whether the decimal separator is a comma.
59856     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
59857     are nl_langinfo(RADIXCHAR) are both ".".  */
59858  if (localeconv () ->decimal_point[0] != ',') return 1;
59859#endif
59860  return 0;
59861}
59862
59863_ACEOF
59864    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
59865  (eval $ac_link) 2>&5
59866  ac_status=$?
59867  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
59868  test $ac_status = 0; } && test -s conftest$ac_exeext; then
59869      case "$host_os" in
59870        # Handle native Windows specially, because there setlocale() interprets
59871        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
59872        # "fr" or "fra" as "French" or "French_France.1252",
59873        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
59874        # "ja" as "Japanese" or "Japanese_Japan.932",
59875        # and similar.
59876        mingw*)
59877          # Test for the hypothetical native Windows locale name.
59878          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59879            gt_cv_locale_fr_utf8=French_France.65001
59880          else
59881            # None found.
59882            gt_cv_locale_fr_utf8=none
59883          fi
59884          ;;
59885        *)
59886          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
59887          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
59888          # configure script would override the LC_ALL setting. Likewise for
59889          # LC_CTYPE, which is also set at the beginning of the configure script.
59890          # Test for the usual locale name.
59891          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59892            gt_cv_locale_fr_utf8=fr_FR
59893          else
59894            # Test for the locale name with explicit encoding suffix.
59895            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59896              gt_cv_locale_fr_utf8=fr_FR.UTF-8
59897            else
59898              # Test for the Solaris 7 locale name.
59899              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
59900                gt_cv_locale_fr_utf8=fr.UTF-8
59901              else
59902                # None found.
59903                gt_cv_locale_fr_utf8=none
59904              fi
59905            fi
59906          fi
59907          ;;
59908      esac
59909    fi
59910    rm -fr conftest*
59911
59912fi
59913{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
59914$as_echo "$gt_cv_locale_fr_utf8" >&6; }
59915  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
59916
59917
59918
59919
59920
59921  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
59922$as_echo_n "checking for a traditional japanese locale... " >&6; }
59923if ${gt_cv_locale_ja+:} false; then :
59924  $as_echo_n "(cached) " >&6
59925else
59926
59927    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59928/* end confdefs.h.  */
59929
59930#include <locale.h>
59931#include <time.h>
59932#if HAVE_LANGINFO_CODESET
59933# include <langinfo.h>
59934#endif
59935#include <stdlib.h>
59936#include <string.h>
59937struct tm t;
59938char buf[16];
59939int main ()
59940{
59941  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
59942     imitates locale dependent behaviour by looking at the environment
59943     variables, and all locales use the UTF-8 encoding.  */
59944#if defined __BEOS__ || defined __HAIKU__
59945  return 1;
59946#else
59947  /* Check whether the given locale name is recognized by the system.  */
59948# if defined _WIN32 && !defined __CYGWIN__
59949  /* On native Windows, setlocale(category, "") looks at the system settings,
59950     not at the environment variables.  Also, when an encoding suffix such
59951     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
59952     category of the locale to "C".  */
59953  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
59954      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
59955    return 1;
59956# else
59957  if (setlocale (LC_ALL, "") == NULL) return 1;
59958# endif
59959  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
59960     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
59961     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
59962     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
59963     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
59964     some unit tests fail.
59965     On MirBSD 10, when an unsupported locale is specified, setlocale()
59966     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
59967# if HAVE_LANGINFO_CODESET
59968  {
59969    const char *cs = nl_langinfo (CODESET);
59970    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
59971        || strcmp (cs, "UTF-8") == 0)
59972      return 1;
59973  }
59974# endif
59975# ifdef __CYGWIN__
59976  /* On Cygwin, avoid locale names without encoding suffix, because the
59977     locale_charset() function relies on the encoding suffix.  Note that
59978     LC_ALL is set on the command line.  */
59979  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
59980# endif
59981  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
59982     on Cygwin 1.5.x.  */
59983  if (MB_CUR_MAX == 1)
59984    return 1;
59985  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
59986     This excludes the UTF-8 encoding (except on MirBSD).  */
59987  {
59988    const char *p;
59989    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
59990    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
59991    for (p = buf; *p != '\0'; p++)
59992      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
59993        return 1;
59994  }
59995  return 0;
59996#endif
59997}
59998
59999_ACEOF
60000    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
60001  (eval $ac_link) 2>&5
60002  ac_status=$?
60003  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
60004  test $ac_status = 0; } && test -s conftest$ac_exeext; then
60005      case "$host_os" in
60006        # Handle native Windows specially, because there setlocale() interprets
60007        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
60008        # "fr" or "fra" as "French" or "French_France.1252",
60009        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
60010        # "ja" as "Japanese" or "Japanese_Japan.932",
60011        # and similar.
60012        mingw*)
60013          # Note that on native Windows, the Japanese locale is
60014          # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
60015          # cannot use it here.
60016          gt_cv_locale_ja=none
60017          ;;
60018        *)
60019          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
60020          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
60021          # configure script would override the LC_ALL setting. Likewise for
60022          # LC_CTYPE, which is also set at the beginning of the configure script.
60023          # Test for the AIX locale name.
60024          if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60025            gt_cv_locale_ja=ja_JP
60026          else
60027            # Test for the locale name with explicit encoding suffix.
60028            if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60029              gt_cv_locale_ja=ja_JP.EUC-JP
60030            else
60031              # Test for the HP-UX, OSF/1, NetBSD locale name.
60032              if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60033                gt_cv_locale_ja=ja_JP.eucJP
60034              else
60035                # Test for the IRIX, FreeBSD locale name.
60036                if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60037                  gt_cv_locale_ja=ja_JP.EUC
60038                else
60039                  # Test for the Solaris 7 locale name.
60040                  if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60041                    gt_cv_locale_ja=ja
60042                  else
60043                    # Special test for NetBSD 1.6.
60044                    if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
60045                      gt_cv_locale_ja=ja_JP.eucJP
60046                    else
60047                      # None found.
60048                      gt_cv_locale_ja=none
60049                    fi
60050                  fi
60051                fi
60052              fi
60053            fi
60054          fi
60055          ;;
60056      esac
60057    fi
60058    rm -fr conftest*
60059
60060fi
60061{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
60062$as_echo "$gt_cv_locale_ja" >&6; }
60063  LOCALE_JA=$gt_cv_locale_ja
60064
60065
60066
60067
60068
60069  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
60070$as_echo_n "checking for a transitional chinese locale... " >&6; }
60071if ${gt_cv_locale_zh_CN+:} false; then :
60072  $as_echo_n "(cached) " >&6
60073else
60074
60075    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60076/* end confdefs.h.  */
60077
60078#include <locale.h>
60079#include <stdlib.h>
60080#include <time.h>
60081#if HAVE_LANGINFO_CODESET
60082# include <langinfo.h>
60083#endif
60084#include <stdlib.h>
60085#include <string.h>
60086struct tm t;
60087char buf[16];
60088int main ()
60089{
60090  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
60091     imitates locale dependent behaviour by looking at the environment
60092     variables, and all locales use the UTF-8 encoding.  */
60093#if defined __BEOS__ || defined __HAIKU__
60094  return 1;
60095#else
60096  /* Check whether the given locale name is recognized by the system.  */
60097# if defined _WIN32 && !defined __CYGWIN__
60098  /* On native Windows, setlocale(category, "") looks at the system settings,
60099     not at the environment variables.  Also, when an encoding suffix such
60100     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
60101     category of the locale to "C".  */
60102  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
60103      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
60104    return 1;
60105# else
60106  if (setlocale (LC_ALL, "") == NULL) return 1;
60107# endif
60108  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
60109     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
60110     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
60111     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
60112     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
60113     some unit tests fail.
60114     On MirBSD 10, when an unsupported locale is specified, setlocale()
60115     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
60116# if HAVE_LANGINFO_CODESET
60117  {
60118    const char *cs = nl_langinfo (CODESET);
60119    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
60120        || strcmp (cs, "UTF-8") == 0)
60121      return 1;
60122  }
60123# endif
60124# ifdef __CYGWIN__
60125  /* On Cygwin, avoid locale names without encoding suffix, because the
60126     locale_charset() function relies on the encoding suffix.  Note that
60127     LC_ALL is set on the command line.  */
60128  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
60129# endif
60130  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
60131     This excludes the UTF-8 encoding (except on MirBSD).  */
60132  {
60133    const char *p;
60134    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
60135    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
60136    for (p = buf; *p != '\0'; p++)
60137      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
60138        return 1;
60139  }
60140  /* Check whether a typical GB18030 multibyte sequence is recognized as a
60141     single wide character.  This excludes the GB2312 and GBK encodings.  */
60142  if (mblen ("\203\062\332\066", 5) != 4)
60143    return 1;
60144  return 0;
60145#endif
60146}
60147
60148_ACEOF
60149    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
60150  (eval $ac_link) 2>&5
60151  ac_status=$?
60152  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
60153  test $ac_status = 0; } && test -s conftest$ac_exeext; then
60154      case "$host_os" in
60155        # Handle native Windows specially, because there setlocale() interprets
60156        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
60157        # "fr" or "fra" as "French" or "French_France.1252",
60158        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
60159        # "ja" as "Japanese" or "Japanese_Japan.932",
60160        # and similar.
60161        mingw*)
60162          # Test for the hypothetical native Windows locale name.
60163          if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60164            gt_cv_locale_zh_CN=Chinese_China.54936
60165          else
60166            # None found.
60167            gt_cv_locale_zh_CN=none
60168          fi
60169          ;;
60170        solaris2.8)
60171          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
60172          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
60173          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
60174          gt_cv_locale_zh_CN=none
60175          ;;
60176        *)
60177          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
60178          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
60179          # configure script would override the LC_ALL setting. Likewise for
60180          # LC_CTYPE, which is also set at the beginning of the configure script.
60181          # Test for the locale name without encoding suffix.
60182          if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60183            gt_cv_locale_zh_CN=zh_CN
60184          else
60185            # Test for the locale name with explicit encoding suffix.
60186            if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60187              gt_cv_locale_zh_CN=zh_CN.GB18030
60188            else
60189              # None found.
60190              gt_cv_locale_zh_CN=none
60191            fi
60192          fi
60193          ;;
60194      esac
60195    else
60196      # If there was a link error, due to mblen(), the system is so old that
60197      # it certainly doesn't have a chinese locale.
60198      gt_cv_locale_zh_CN=none
60199    fi
60200    rm -fr conftest*
60201
60202fi
60203{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
60204$as_echo "$gt_cv_locale_zh_CN" >&6; }
60205  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
60206
60207
60208
60209
60210  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
60211$as_echo_n "checking for a french Unicode locale... " >&6; }
60212if ${gt_cv_locale_fr_utf8+:} false; then :
60213  $as_echo_n "(cached) " >&6
60214else
60215
60216    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60217/* end confdefs.h.  */
60218
60219#include <locale.h>
60220#include <time.h>
60221#if HAVE_LANGINFO_CODESET
60222# include <langinfo.h>
60223#endif
60224#include <stdlib.h>
60225#include <string.h>
60226struct tm t;
60227char buf[16];
60228int main () {
60229  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
60230     imitates locale dependent behaviour by looking at the environment
60231     variables, and all locales use the UTF-8 encoding.  */
60232#if !(defined __BEOS__ || defined __HAIKU__)
60233  /* Check whether the given locale name is recognized by the system.  */
60234# if defined _WIN32 && !defined __CYGWIN__
60235  /* On native Windows, setlocale(category, "") looks at the system settings,
60236     not at the environment variables.  Also, when an encoding suffix such
60237     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
60238     category of the locale to "C".  */
60239  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
60240      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
60241    return 1;
60242# else
60243  if (setlocale (LC_ALL, "") == NULL) return 1;
60244# endif
60245  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
60246     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
60247     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
60248     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
60249     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
60250     some unit tests fail.  */
60251# if HAVE_LANGINFO_CODESET
60252  {
60253    const char *cs = nl_langinfo (CODESET);
60254    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
60255      return 1;
60256  }
60257# endif
60258# ifdef __CYGWIN__
60259  /* On Cygwin, avoid locale names without encoding suffix, because the
60260     locale_charset() function relies on the encoding suffix.  Note that
60261     LC_ALL is set on the command line.  */
60262  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
60263# endif
60264  /* Check whether in the abbreviation of the second month, the second
60265     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
60266     two bytes long, with UTF-8 encoding.  */
60267  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
60268  if (strftime (buf, sizeof (buf), "%b", &t) < 4
60269      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
60270    return 1;
60271#endif
60272#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
60273  /* Check whether the decimal separator is a comma.
60274     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
60275     are nl_langinfo(RADIXCHAR) are both ".".  */
60276  if (localeconv () ->decimal_point[0] != ',') return 1;
60277#endif
60278  return 0;
60279}
60280
60281_ACEOF
60282    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
60283  (eval $ac_link) 2>&5
60284  ac_status=$?
60285  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
60286  test $ac_status = 0; } && test -s conftest$ac_exeext; then
60287      case "$host_os" in
60288        # Handle native Windows specially, because there setlocale() interprets
60289        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
60290        # "fr" or "fra" as "French" or "French_France.1252",
60291        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
60292        # "ja" as "Japanese" or "Japanese_Japan.932",
60293        # and similar.
60294        mingw*)
60295          # Test for the hypothetical native Windows locale name.
60296          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60297            gt_cv_locale_fr_utf8=French_France.65001
60298          else
60299            # None found.
60300            gt_cv_locale_fr_utf8=none
60301          fi
60302          ;;
60303        *)
60304          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
60305          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
60306          # configure script would override the LC_ALL setting. Likewise for
60307          # LC_CTYPE, which is also set at the beginning of the configure script.
60308          # Test for the usual locale name.
60309          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60310            gt_cv_locale_fr_utf8=fr_FR
60311          else
60312            # Test for the locale name with explicit encoding suffix.
60313            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60314              gt_cv_locale_fr_utf8=fr_FR.UTF-8
60315            else
60316              # Test for the Solaris 7 locale name.
60317              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60318                gt_cv_locale_fr_utf8=fr.UTF-8
60319              else
60320                # None found.
60321                gt_cv_locale_fr_utf8=none
60322              fi
60323            fi
60324          fi
60325          ;;
60326      esac
60327    fi
60328    rm -fr conftest*
60329
60330fi
60331{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
60332$as_echo "$gt_cv_locale_fr_utf8" >&6; }
60333  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
60334
60335
60336
60337
60338
60339  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
60340$as_echo_n "checking for a transitional chinese locale... " >&6; }
60341if ${gt_cv_locale_zh_CN+:} false; then :
60342  $as_echo_n "(cached) " >&6
60343else
60344
60345    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60346/* end confdefs.h.  */
60347
60348#include <locale.h>
60349#include <stdlib.h>
60350#include <time.h>
60351#if HAVE_LANGINFO_CODESET
60352# include <langinfo.h>
60353#endif
60354#include <stdlib.h>
60355#include <string.h>
60356struct tm t;
60357char buf[16];
60358int main ()
60359{
60360  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
60361     imitates locale dependent behaviour by looking at the environment
60362     variables, and all locales use the UTF-8 encoding.  */
60363#if defined __BEOS__ || defined __HAIKU__
60364  return 1;
60365#else
60366  /* Check whether the given locale name is recognized by the system.  */
60367# if defined _WIN32 && !defined __CYGWIN__
60368  /* On native Windows, setlocale(category, "") looks at the system settings,
60369     not at the environment variables.  Also, when an encoding suffix such
60370     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
60371     category of the locale to "C".  */
60372  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
60373      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
60374    return 1;
60375# else
60376  if (setlocale (LC_ALL, "") == NULL) return 1;
60377# endif
60378  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
60379     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
60380     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
60381     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
60382     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
60383     some unit tests fail.
60384     On MirBSD 10, when an unsupported locale is specified, setlocale()
60385     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
60386# if HAVE_LANGINFO_CODESET
60387  {
60388    const char *cs = nl_langinfo (CODESET);
60389    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
60390        || strcmp (cs, "UTF-8") == 0)
60391      return 1;
60392  }
60393# endif
60394# ifdef __CYGWIN__
60395  /* On Cygwin, avoid locale names without encoding suffix, because the
60396     locale_charset() function relies on the encoding suffix.  Note that
60397     LC_ALL is set on the command line.  */
60398  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
60399# endif
60400  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
60401     This excludes the UTF-8 encoding (except on MirBSD).  */
60402  {
60403    const char *p;
60404    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
60405    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
60406    for (p = buf; *p != '\0'; p++)
60407      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
60408        return 1;
60409  }
60410  /* Check whether a typical GB18030 multibyte sequence is recognized as a
60411     single wide character.  This excludes the GB2312 and GBK encodings.  */
60412  if (mblen ("\203\062\332\066", 5) != 4)
60413    return 1;
60414  return 0;
60415#endif
60416}
60417
60418_ACEOF
60419    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
60420  (eval $ac_link) 2>&5
60421  ac_status=$?
60422  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
60423  test $ac_status = 0; } && test -s conftest$ac_exeext; then
60424      case "$host_os" in
60425        # Handle native Windows specially, because there setlocale() interprets
60426        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
60427        # "fr" or "fra" as "French" or "French_France.1252",
60428        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
60429        # "ja" as "Japanese" or "Japanese_Japan.932",
60430        # and similar.
60431        mingw*)
60432          # Test for the hypothetical native Windows locale name.
60433          if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60434            gt_cv_locale_zh_CN=Chinese_China.54936
60435          else
60436            # None found.
60437            gt_cv_locale_zh_CN=none
60438          fi
60439          ;;
60440        solaris2.8)
60441          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
60442          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
60443          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
60444          gt_cv_locale_zh_CN=none
60445          ;;
60446        *)
60447          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
60448          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
60449          # configure script would override the LC_ALL setting. Likewise for
60450          # LC_CTYPE, which is also set at the beginning of the configure script.
60451          # Test for the locale name without encoding suffix.
60452          if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60453            gt_cv_locale_zh_CN=zh_CN
60454          else
60455            # Test for the locale name with explicit encoding suffix.
60456            if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60457              gt_cv_locale_zh_CN=zh_CN.GB18030
60458            else
60459              # None found.
60460              gt_cv_locale_zh_CN=none
60461            fi
60462          fi
60463          ;;
60464      esac
60465    else
60466      # If there was a link error, due to mblen(), the system is so old that
60467      # it certainly doesn't have a chinese locale.
60468      gt_cv_locale_zh_CN=none
60469    fi
60470    rm -fr conftest*
60471
60472fi
60473{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
60474$as_echo "$gt_cv_locale_zh_CN" >&6; }
60475  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
60476
60477
60478
60479
60480
60481  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
60482  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
60483  # irrelevant for anonymous mappings.
60484  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
60485if test "x$ac_cv_func_mmap" = xyes; then :
60486  gl_have_mmap=yes
60487else
60488  gl_have_mmap=no
60489fi
60490
60491
60492  # Try to allow MAP_ANONYMOUS.
60493  gl_have_mmap_anonymous=no
60494  if test $gl_have_mmap = yes; then
60495    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
60496$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
60497    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60498/* end confdefs.h.  */
60499
60500#include <sys/mman.h>
60501#ifdef MAP_ANONYMOUS
60502    I cannot identify this map
60503#endif
60504
60505_ACEOF
60506if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
60507  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
60508  gl_have_mmap_anonymous=yes
60509fi
60510rm -f conftest*
60511
60512    if test $gl_have_mmap_anonymous != yes; then
60513      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60514/* end confdefs.h.  */
60515
60516#include <sys/mman.h>
60517#ifdef MAP_ANON
60518    I cannot identify this map
60519#endif
60520
60521_ACEOF
60522if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
60523  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
60524
60525$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
60526
60527         gl_have_mmap_anonymous=yes
60528fi
60529rm -f conftest*
60530
60531    fi
60532    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
60533$as_echo "$gl_have_mmap_anonymous" >&6; }
60534    if test $gl_have_mmap_anonymous = yes; then
60535
60536$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
60537
60538    fi
60539  fi
60540
60541
60542
60543
60544
60545
60546  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
60547  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
60548  # irrelevant for anonymous mappings.
60549  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
60550if test "x$ac_cv_func_mmap" = xyes; then :
60551  gl_have_mmap=yes
60552else
60553  gl_have_mmap=no
60554fi
60555
60556
60557  # Try to allow MAP_ANONYMOUS.
60558  gl_have_mmap_anonymous=no
60559  if test $gl_have_mmap = yes; then
60560    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
60561$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
60562    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60563/* end confdefs.h.  */
60564
60565#include <sys/mman.h>
60566#ifdef MAP_ANONYMOUS
60567    I cannot identify this map
60568#endif
60569
60570_ACEOF
60571if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
60572  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
60573  gl_have_mmap_anonymous=yes
60574fi
60575rm -f conftest*
60576
60577    if test $gl_have_mmap_anonymous != yes; then
60578      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60579/* end confdefs.h.  */
60580
60581#include <sys/mman.h>
60582#ifdef MAP_ANON
60583    I cannot identify this map
60584#endif
60585
60586_ACEOF
60587if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
60588  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
60589
60590$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
60591
60592         gl_have_mmap_anonymous=yes
60593fi
60594rm -f conftest*
60595
60596    fi
60597    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
60598$as_echo "$gl_have_mmap_anonymous" >&6; }
60599    if test $gl_have_mmap_anonymous = yes; then
60600
60601$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
60602
60603    fi
60604  fi
60605
60606
60607
60608
60609
60610
60611  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
60612  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
60613  # irrelevant for anonymous mappings.
60614  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
60615if test "x$ac_cv_func_mmap" = xyes; then :
60616  gl_have_mmap=yes
60617else
60618  gl_have_mmap=no
60619fi
60620
60621
60622  # Try to allow MAP_ANONYMOUS.
60623  gl_have_mmap_anonymous=no
60624  if test $gl_have_mmap = yes; then
60625    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
60626$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
60627    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60628/* end confdefs.h.  */
60629
60630#include <sys/mman.h>
60631#ifdef MAP_ANONYMOUS
60632    I cannot identify this map
60633#endif
60634
60635_ACEOF
60636if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
60637  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
60638  gl_have_mmap_anonymous=yes
60639fi
60640rm -f conftest*
60641
60642    if test $gl_have_mmap_anonymous != yes; then
60643      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60644/* end confdefs.h.  */
60645
60646#include <sys/mman.h>
60647#ifdef MAP_ANON
60648    I cannot identify this map
60649#endif
60650
60651_ACEOF
60652if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
60653  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
60654
60655$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
60656
60657         gl_have_mmap_anonymous=yes
60658fi
60659rm -f conftest*
60660
60661    fi
60662    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
60663$as_echo "$gl_have_mmap_anonymous" >&6; }
60664    if test $gl_have_mmap_anonymous = yes; then
60665
60666$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
60667
60668    fi
60669  fi
60670
60671
60672
60673
60674
60675
60676  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
60677  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
60678  # irrelevant for anonymous mappings.
60679  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
60680if test "x$ac_cv_func_mmap" = xyes; then :
60681  gl_have_mmap=yes
60682else
60683  gl_have_mmap=no
60684fi
60685
60686
60687  # Try to allow MAP_ANONYMOUS.
60688  gl_have_mmap_anonymous=no
60689  if test $gl_have_mmap = yes; then
60690    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
60691$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
60692    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60693/* end confdefs.h.  */
60694
60695#include <sys/mman.h>
60696#ifdef MAP_ANONYMOUS
60697    I cannot identify this map
60698#endif
60699
60700_ACEOF
60701if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
60702  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
60703  gl_have_mmap_anonymous=yes
60704fi
60705rm -f conftest*
60706
60707    if test $gl_have_mmap_anonymous != yes; then
60708      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60709/* end confdefs.h.  */
60710
60711#include <sys/mman.h>
60712#ifdef MAP_ANON
60713    I cannot identify this map
60714#endif
60715
60716_ACEOF
60717if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
60718  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
60719
60720$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
60721
60722         gl_have_mmap_anonymous=yes
60723fi
60724rm -f conftest*
60725
60726    fi
60727    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
60728$as_echo "$gl_have_mmap_anonymous" >&6; }
60729    if test $gl_have_mmap_anonymous = yes; then
60730
60731$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
60732
60733    fi
60734  fi
60735
60736
60737
60738
60739
60740
60741
60742  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
60743$as_echo_n "checking for a traditional french locale... " >&6; }
60744if ${gt_cv_locale_fr+:} false; then :
60745  $as_echo_n "(cached) " >&6
60746else
60747
60748    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60749/* end confdefs.h.  */
60750
60751#include <locale.h>
60752#include <time.h>
60753#if HAVE_LANGINFO_CODESET
60754# include <langinfo.h>
60755#endif
60756#include <stdlib.h>
60757#include <string.h>
60758struct tm t;
60759char buf[16];
60760int main () {
60761  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
60762     imitates locale dependent behaviour by looking at the environment
60763     variables, and all locales use the UTF-8 encoding.  */
60764#if defined __BEOS__ || defined __HAIKU__
60765  return 1;
60766#else
60767  /* Check whether the given locale name is recognized by the system.  */
60768# if defined _WIN32 && !defined __CYGWIN__
60769  /* On native Windows, setlocale(category, "") looks at the system settings,
60770     not at the environment variables.  Also, when an encoding suffix such
60771     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
60772     category of the locale to "C".  */
60773  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
60774      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
60775    return 1;
60776# else
60777  if (setlocale (LC_ALL, "") == NULL) return 1;
60778# endif
60779  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
60780     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
60781     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
60782     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
60783     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
60784     some unit tests fail.
60785     On MirBSD 10, when an unsupported locale is specified, setlocale()
60786     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
60787# if HAVE_LANGINFO_CODESET
60788  {
60789    const char *cs = nl_langinfo (CODESET);
60790    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
60791        || strcmp (cs, "UTF-8") == 0)
60792      return 1;
60793  }
60794# endif
60795# ifdef __CYGWIN__
60796  /* On Cygwin, avoid locale names without encoding suffix, because the
60797     locale_charset() function relies on the encoding suffix.  Note that
60798     LC_ALL is set on the command line.  */
60799  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
60800# endif
60801  /* Check whether in the abbreviation of the second month, the second
60802     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
60803     one byte long. This excludes the UTF-8 encoding.  */
60804  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
60805  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
60806# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
60807  /* Check whether the decimal separator is a comma.
60808     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
60809     are nl_langinfo(RADIXCHAR) are both ".".  */
60810  if (localeconv () ->decimal_point[0] != ',') return 1;
60811# endif
60812  return 0;
60813#endif
60814}
60815
60816_ACEOF
60817    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
60818  (eval $ac_link) 2>&5
60819  ac_status=$?
60820  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
60821  test $ac_status = 0; } && test -s conftest$ac_exeext; then
60822      case "$host_os" in
60823        # Handle native Windows specially, because there setlocale() interprets
60824        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
60825        # "fr" or "fra" as "French" or "French_France.1252",
60826        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
60827        # "ja" as "Japanese" or "Japanese_Japan.932",
60828        # and similar.
60829        mingw*)
60830          # Test for the native Windows locale name.
60831          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60832            gt_cv_locale_fr=French_France.1252
60833          else
60834            # None found.
60835            gt_cv_locale_fr=none
60836          fi
60837          ;;
60838        *)
60839          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
60840          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
60841          # configure script would override the LC_ALL setting. Likewise for
60842          # LC_CTYPE, which is also set at the beginning of the configure script.
60843          # Test for the usual locale name.
60844          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60845            gt_cv_locale_fr=fr_FR
60846          else
60847            # Test for the locale name with explicit encoding suffix.
60848            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60849              gt_cv_locale_fr=fr_FR.ISO-8859-1
60850            else
60851              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
60852              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60853                gt_cv_locale_fr=fr_FR.ISO8859-1
60854              else
60855                # Test for the HP-UX locale name.
60856                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60857                  gt_cv_locale_fr=fr_FR.iso88591
60858                else
60859                  # Test for the Solaris 7 locale name.
60860                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60861                    gt_cv_locale_fr=fr
60862                  else
60863                    # None found.
60864                    gt_cv_locale_fr=none
60865                  fi
60866                fi
60867              fi
60868            fi
60869          fi
60870          ;;
60871      esac
60872    fi
60873    rm -fr conftest*
60874
60875fi
60876{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
60877$as_echo "$gt_cv_locale_fr" >&6; }
60878  LOCALE_FR=$gt_cv_locale_fr
60879
60880
60881
60882
60883  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
60884$as_echo_n "checking for a french Unicode locale... " >&6; }
60885if ${gt_cv_locale_fr_utf8+:} false; then :
60886  $as_echo_n "(cached) " >&6
60887else
60888
60889    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60890/* end confdefs.h.  */
60891
60892#include <locale.h>
60893#include <time.h>
60894#if HAVE_LANGINFO_CODESET
60895# include <langinfo.h>
60896#endif
60897#include <stdlib.h>
60898#include <string.h>
60899struct tm t;
60900char buf[16];
60901int main () {
60902  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
60903     imitates locale dependent behaviour by looking at the environment
60904     variables, and all locales use the UTF-8 encoding.  */
60905#if !(defined __BEOS__ || defined __HAIKU__)
60906  /* Check whether the given locale name is recognized by the system.  */
60907# if defined _WIN32 && !defined __CYGWIN__
60908  /* On native Windows, setlocale(category, "") looks at the system settings,
60909     not at the environment variables.  Also, when an encoding suffix such
60910     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
60911     category of the locale to "C".  */
60912  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
60913      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
60914    return 1;
60915# else
60916  if (setlocale (LC_ALL, "") == NULL) return 1;
60917# endif
60918  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
60919     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
60920     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
60921     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
60922     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
60923     some unit tests fail.  */
60924# if HAVE_LANGINFO_CODESET
60925  {
60926    const char *cs = nl_langinfo (CODESET);
60927    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
60928      return 1;
60929  }
60930# endif
60931# ifdef __CYGWIN__
60932  /* On Cygwin, avoid locale names without encoding suffix, because the
60933     locale_charset() function relies on the encoding suffix.  Note that
60934     LC_ALL is set on the command line.  */
60935  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
60936# endif
60937  /* Check whether in the abbreviation of the second month, the second
60938     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
60939     two bytes long, with UTF-8 encoding.  */
60940  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
60941  if (strftime (buf, sizeof (buf), "%b", &t) < 4
60942      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
60943    return 1;
60944#endif
60945#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
60946  /* Check whether the decimal separator is a comma.
60947     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
60948     are nl_langinfo(RADIXCHAR) are both ".".  */
60949  if (localeconv () ->decimal_point[0] != ',') return 1;
60950#endif
60951  return 0;
60952}
60953
60954_ACEOF
60955    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
60956  (eval $ac_link) 2>&5
60957  ac_status=$?
60958  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
60959  test $ac_status = 0; } && test -s conftest$ac_exeext; then
60960      case "$host_os" in
60961        # Handle native Windows specially, because there setlocale() interprets
60962        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
60963        # "fr" or "fra" as "French" or "French_France.1252",
60964        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
60965        # "ja" as "Japanese" or "Japanese_Japan.932",
60966        # and similar.
60967        mingw*)
60968          # Test for the hypothetical native Windows locale name.
60969          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60970            gt_cv_locale_fr_utf8=French_France.65001
60971          else
60972            # None found.
60973            gt_cv_locale_fr_utf8=none
60974          fi
60975          ;;
60976        *)
60977          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
60978          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
60979          # configure script would override the LC_ALL setting. Likewise for
60980          # LC_CTYPE, which is also set at the beginning of the configure script.
60981          # Test for the usual locale name.
60982          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60983            gt_cv_locale_fr_utf8=fr_FR
60984          else
60985            # Test for the locale name with explicit encoding suffix.
60986            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60987              gt_cv_locale_fr_utf8=fr_FR.UTF-8
60988            else
60989              # Test for the Solaris 7 locale name.
60990              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
60991                gt_cv_locale_fr_utf8=fr.UTF-8
60992              else
60993                # None found.
60994                gt_cv_locale_fr_utf8=none
60995              fi
60996            fi
60997          fi
60998          ;;
60999      esac
61000    fi
61001    rm -fr conftest*
61002
61003fi
61004{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
61005$as_echo "$gt_cv_locale_fr_utf8" >&6; }
61006  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
61007
61008
61009
61010
61011
61012
61013
61014             if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then
61015            REPLACE_PERROR=1
61016  fi
61017  case ${gl_cv_func_strerror_r_works-unset} in
61018    unset|*yes)
61019      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether perror matches strerror" >&5
61020$as_echo_n "checking whether perror matches strerror... " >&6; }
61021if ${gl_cv_func_perror_works+:} false; then :
61022  $as_echo_n "(cached) " >&6
61023else
61024  if test "$cross_compiling" = yes; then :
61025  case "$host_os" in
61026                      # Guess yes on native Windows.
61027              mingw*) gl_cv_func_perror_works="guessing yes" ;;
61028                      # Otherwise guess no.
61029              *)      gl_cv_func_perror_works="guessing no" ;;
61030            esac
61031
61032else
61033  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61034/* end confdefs.h.  */
61035#include <errno.h>
61036                #include <stdio.h>
61037                #include <stdlib.h>
61038                #include <string.h>
61039
61040int
61041main ()
61042{
61043char *str = strerror (-1);
61044                if (!getenv("CONFTEST_OUTPUT")) return 0;
61045                if (!str) str = "";
61046                puts (str);
61047                errno = -1;
61048                perror ("");
61049                return 0;
61050
61051  ;
61052  return 0;
61053}
61054_ACEOF
61055if ac_fn_c_try_run "$LINENO"; then :
61056  if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \
61057               && cmp conftest.txt1 conftest.txt2 >/dev/null; then
61058              gl_cv_func_perror_works=yes
61059            else
61060              gl_cv_func_perror_works=no
61061            fi
61062            rm -rf conftest.txt1 conftest.txt2
61063else
61064  gl_cv_func_perror_works=no
61065fi
61066rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
61067  conftest.$ac_objext conftest.beam conftest.$ac_ext
61068fi
61069
61070
61071fi
61072{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5
61073$as_echo "$gl_cv_func_perror_works" >&6; }
61074      case "$gl_cv_func_perror_works" in
61075        *yes) ;;
61076        *) REPLACE_PERROR=1 ;;
61077      esac
61078      ;;
61079    *)
61080                  REPLACE_PERROR=1
61081      ;;
61082  esac
61083
61084  if test $REPLACE_PERROR = 1; then
61085
61086
61087
61088
61089
61090
61091
61092
61093  gltests_LIBOBJS="$gltests_LIBOBJS perror.$ac_objext"
61094
61095  fi
61096
61097
61098
61099
61100
61101    if test "$GNULIB_PERROR" != 1; then
61102        if test "$GNULIB_PERROR" = 0; then
61103      GNULIB_PERROR=$gl_module_indicator_condition
61104    else
61105      GNULIB_PERROR="($GNULIB_PERROR || $gl_module_indicator_condition)"
61106    fi
61107  fi
61108
61109
61110
61111
61112
61113$as_echo "#define GNULIB_TEST_PERROR 1" >>confdefs.h
61114
61115
61116
61117
61118
61119
61120
61121  LIB_PTHREAD_SIGMASK=
61122
61123
61124
61125
61126    if test "$gl_threads_api" = posix; then
61127      if test $ac_cv_func_pthread_sigmask = yes; then
61128                :
61129      else
61130        if test -n "$LIBMULTITHREAD"; then
61131          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_sigmask in $LIBMULTITHREAD" >&5
61132$as_echo_n "checking for pthread_sigmask in $LIBMULTITHREAD... " >&6; }
61133if ${gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD+:} false; then :
61134  $as_echo_n "(cached) " >&6
61135else
61136  gl_save_LIBS="$LIBS"
61137             LIBS="$LIBS $LIBMULTITHREAD"
61138             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61139/* end confdefs.h.  */
61140#include <pthread.h>
61141                    #include <signal.h>
61142
61143int
61144main ()
61145{
61146return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);
61147  ;
61148  return 0;
61149}
61150
61151_ACEOF
61152if ac_fn_c_try_link "$LINENO"; then :
61153  gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes
61154else
61155  gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no
61156fi
61157rm -f core conftest.err conftest.$ac_objext \
61158    conftest$ac_exeext conftest.$ac_ext
61159             LIBS="$gl_save_LIBS"
61160
61161fi
61162{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD" >&5
61163$as_echo "$gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD" >&6; }
61164          if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
61165            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask is only a macro" >&5
61166$as_echo_n "checking whether pthread_sigmask is only a macro... " >&6; }
61167if ${gl_cv_func_pthread_sigmask_is_macro+:} false; then :
61168  $as_echo_n "(cached) " >&6
61169else
61170  gl_save_LIBS="$LIBS"
61171               LIBS="$LIBS $LIBMULTITHREAD"
61172               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61173/* end confdefs.h.  */
61174#include <pthread.h>
61175                      #include <signal.h>
61176                      #undef pthread_sigmask
61177
61178int
61179main ()
61180{
61181return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);
61182  ;
61183  return 0;
61184}
61185
61186_ACEOF
61187if ac_fn_c_try_link "$LINENO"; then :
61188  gl_cv_func_pthread_sigmask_is_macro=no
61189else
61190  gl_cv_func_pthread_sigmask_is_macro=yes
61191fi
61192rm -f core conftest.err conftest.$ac_objext \
61193    conftest$ac_exeext conftest.$ac_ext
61194               LIBS="$gl_save_LIBS"
61195
61196fi
61197{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_is_macro" >&5
61198$as_echo "$gl_cv_func_pthread_sigmask_is_macro" >&6; }
61199            if test $gl_cv_func_pthread_sigmask_is_macro = yes; then
61200                                          REPLACE_PTHREAD_SIGMASK=1
61201              gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no
61202            fi
61203          fi
61204          if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
61205                        LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
61206          else
61207                        HAVE_PTHREAD_SIGMASK=0
61208          fi
61209        else
61210                    HAVE_PTHREAD_SIGMASK=0
61211        fi
61212      fi
61213    else
61214                                          if test $ac_cv_func_pthread_sigmask = yes; then
61215        REPLACE_PTHREAD_SIGMASK=1
61216      else
61217        HAVE_PTHREAD_SIGMASK=0
61218      fi
61219    fi
61220
61221
61222
61223
61224    if test $HAVE_PTHREAD_SIGMASK = 1; then
61225
61226
61227                if test -z "$LIB_PTHREAD_SIGMASK"; then
61228      case " $LIBS " in
61229        *' -pthread '*) ;;
61230        *' -lpthread '*) ;;
61231        *)
61232          { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask works without -lpthread" >&5
61233$as_echo_n "checking whether pthread_sigmask works without -lpthread... " >&6; }
61234if ${gl_cv_func_pthread_sigmask_in_libc_works+:} false; then :
61235  $as_echo_n "(cached) " >&6
61236else
61237
61238              if test "$cross_compiling" = yes; then :
61239
61240                                  case "$host_os" in
61241                   freebsd* | hpux* | solaris | solaris2.[2-9]*)
61242                     gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
61243                   *)
61244                     gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
61245                 esac
61246
61247else
61248  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61249/* end confdefs.h.  */
61250
61251                   #include <pthread.h>
61252                   #include <signal.h>
61253                   #include <stddef.h>
61254                   int main ()
61255                   {
61256                     sigset_t set;
61257                     sigemptyset (&set);
61258                     return pthread_sigmask (1729, &set, NULL) != 0;
61259                   }
61260_ACEOF
61261if ac_fn_c_try_run "$LINENO"; then :
61262  gl_cv_func_pthread_sigmask_in_libc_works=no
61263else
61264  gl_cv_func_pthread_sigmask_in_libc_works=yes
61265fi
61266rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
61267  conftest.$ac_objext conftest.beam conftest.$ac_ext
61268fi
61269
61270
61271fi
61272{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_in_libc_works" >&5
61273$as_echo "$gl_cv_func_pthread_sigmask_in_libc_works" >&6; }
61274          case "$gl_cv_func_pthread_sigmask_in_libc_works" in
61275            *no)
61276              REPLACE_PTHREAD_SIGMASK=1
61277
61278$as_echo "#define PTHREAD_SIGMASK_INEFFECTIVE 1" >>confdefs.h
61279
61280              ;;
61281          esac;;
61282      esac
61283    fi
61284
61285            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask returns error numbers" >&5
61286$as_echo_n "checking whether pthread_sigmask returns error numbers... " >&6; }
61287if ${gl_cv_func_pthread_sigmask_return_works+:} false; then :
61288  $as_echo_n "(cached) " >&6
61289else
61290
61291        gl_save_LIBS="$LIBS"
61292        LIBS="$LIBS $LIB_PTHREAD_SIGMASK"
61293        if test "$cross_compiling" = yes; then :
61294  case "$host_os" in
61295             cygwin*)
61296               gl_cv_func_pthread_sigmask_return_works="guessing no";;
61297             *)
61298               gl_cv_func_pthread_sigmask_return_works="guessing yes";;
61299           esac
61300
61301else
61302  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61303/* end confdefs.h.  */
61304
61305#include <pthread.h>
61306#include <signal.h>
61307#include <stddef.h>
61308int main ()
61309{
61310  sigset_t set;
61311  sigemptyset (&set);
61312  if (pthread_sigmask (1729, &set, NULL) == -1)
61313    return 1;
61314  return 0;
61315}
61316_ACEOF
61317if ac_fn_c_try_run "$LINENO"; then :
61318  gl_cv_func_pthread_sigmask_return_works=yes
61319else
61320  gl_cv_func_pthread_sigmask_return_works=no
61321fi
61322rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
61323  conftest.$ac_objext conftest.beam conftest.$ac_ext
61324fi
61325
61326        LIBS="$gl_save_LIBS"
61327
61328fi
61329{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_return_works" >&5
61330$as_echo "$gl_cv_func_pthread_sigmask_return_works" >&6; }
61331    case "$gl_cv_func_pthread_sigmask_return_works" in
61332      *no)
61333        REPLACE_PTHREAD_SIGMASK=1
61334
61335$as_echo "#define PTHREAD_SIGMASK_FAILS_WITH_ERRNO 1" >>confdefs.h
61336
61337        ;;
61338    esac
61339
61340                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask unblocks signals correctly" >&5
61341$as_echo_n "checking whether pthread_sigmask unblocks signals correctly... " >&6; }
61342if ${gl_cv_func_pthread_sigmask_unblock_works+:} false; then :
61343  $as_echo_n "(cached) " >&6
61344else
61345
61346        case "$host_os" in
61347          irix*)
61348            gl_cv_func_pthread_sigmask_unblock_works="guessing no";;
61349          *)
61350            gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
61351        esac
61352                                         gl_save_LIBS=$LIBS
61353           LIBS="$LIBS $LIBMULTITHREAD"
61354        if test "$cross_compiling" = yes; then :
61355  :
61356else
61357  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61358/* end confdefs.h.  */
61359
61360#include <pthread.h>
61361#include <signal.h>
61362#include <stdio.h>
61363#include <stdlib.h>
61364#include <unistd.h>
61365static volatile int sigint_occurred;
61366static void
61367sigint_handler (int sig)
61368{
61369  sigint_occurred++;
61370}
61371int main ()
61372{
61373  sigset_t set;
61374  int pid = getpid ();
61375  char command[80];
61376  signal (SIGINT, sigint_handler);
61377  sigemptyset (&set);
61378  sigaddset (&set, SIGINT);
61379  if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
61380    return 1;
61381  sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
61382  if (!(system (command) == 0))
61383    return 2;
61384  sleep (2);
61385  if (!(sigint_occurred == 0))
61386    return 3;
61387  if (!(pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0))
61388    return 4;
61389  if (!(sigint_occurred == 1)) /* This fails on IRIX.  */
61390    return 5;
61391  return 0;
61392}
61393_ACEOF
61394if ac_fn_c_try_run "$LINENO"; then :
61395  :
61396else
61397  gl_cv_func_pthread_sigmask_unblock_works=no
61398fi
61399rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
61400  conftest.$ac_objext conftest.beam conftest.$ac_ext
61401fi
61402
61403        LIBS=$gl_save_LIBS
61404
61405fi
61406{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_unblock_works" >&5
61407$as_echo "$gl_cv_func_pthread_sigmask_unblock_works" >&6; }
61408    case "$gl_cv_func_pthread_sigmask_unblock_works" in
61409      *no)
61410        REPLACE_PTHREAD_SIGMASK=1
61411
61412$as_echo "#define PTHREAD_SIGMASK_UNBLOCK_BUG 1" >>confdefs.h
61413
61414        ;;
61415    esac
61416  fi
61417
61418  if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
61419
61420
61421
61422
61423
61424
61425
61426
61427  gltests_LIBOBJS="$gltests_LIBOBJS pthread_sigmask.$ac_objext"
61428
61429
61430  if test $HAVE_PTHREAD_SIGMASK = 1; then
61431
61432$as_echo "#define HAVE_PTHREAD_SIGMASK 1" >>confdefs.h
61433
61434  fi
61435
61436  fi
61437
61438
61439
61440
61441
61442    if test "$GNULIB_PTHREAD_SIGMASK" != 1; then
61443        if test "$GNULIB_PTHREAD_SIGMASK" = 0; then
61444      GNULIB_PTHREAD_SIGMASK=$gl_module_indicator_condition
61445    else
61446      GNULIB_PTHREAD_SIGMASK="($GNULIB_PTHREAD_SIGMASK || $gl_module_indicator_condition)"
61447    fi
61448  fi
61449
61450
61451
61452
61453
61454$as_echo "#define GNULIB_TEST_PTHREAD_SIGMASK 1" >>confdefs.h
61455
61456
61457
61458
61459
61460
61461  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
61462  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
61463  # irrelevant for anonymous mappings.
61464  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
61465if test "x$ac_cv_func_mmap" = xyes; then :
61466  gl_have_mmap=yes
61467else
61468  gl_have_mmap=no
61469fi
61470
61471
61472  # Try to allow MAP_ANONYMOUS.
61473  gl_have_mmap_anonymous=no
61474  if test $gl_have_mmap = yes; then
61475    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
61476$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
61477    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61478/* end confdefs.h.  */
61479
61480#include <sys/mman.h>
61481#ifdef MAP_ANONYMOUS
61482    I cannot identify this map
61483#endif
61484
61485_ACEOF
61486if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
61487  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
61488  gl_have_mmap_anonymous=yes
61489fi
61490rm -f conftest*
61491
61492    if test $gl_have_mmap_anonymous != yes; then
61493      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61494/* end confdefs.h.  */
61495
61496#include <sys/mman.h>
61497#ifdef MAP_ANON
61498    I cannot identify this map
61499#endif
61500
61501_ACEOF
61502if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
61503  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
61504
61505$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
61506
61507         gl_have_mmap_anonymous=yes
61508fi
61509rm -f conftest*
61510
61511    fi
61512    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
61513$as_echo "$gl_have_mmap_anonymous" >&6; }
61514    if test $gl_have_mmap_anonymous = yes; then
61515
61516$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
61517
61518    fi
61519  fi
61520
61521
61522
61523
61524
61525
61526
61527  case "$host_os" in
61528            mingw*) REPLACE_SETLOCALE=1 ;;
61529            cygwin*)
61530      case `uname -r` in
61531        1.5.*) REPLACE_SETLOCALE=1 ;;
61532      esac
61533      ;;
61534  esac
61535
61536  if test $REPLACE_SETLOCALE = 1; then
61537
61538
61539
61540
61541
61542
61543
61544
61545  gltests_LIBOBJS="$gltests_LIBOBJS setlocale.$ac_objext"
61546
61547
61548  :
61549
61550  fi
61551
61552
61553
61554
61555
61556    if test "$GNULIB_SETLOCALE" != 1; then
61557        if test "$GNULIB_SETLOCALE" = 0; then
61558      GNULIB_SETLOCALE=$gl_module_indicator_condition
61559    else
61560      GNULIB_SETLOCALE="($GNULIB_SETLOCALE || $gl_module_indicator_condition)"
61561    fi
61562  fi
61563
61564
61565
61566
61567
61568$as_echo "#define GNULIB_TEST_SETLOCALE 1" >>confdefs.h
61569
61570
61571
61572
61573
61574
61575  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
61576$as_echo_n "checking for a traditional french locale... " >&6; }
61577if ${gt_cv_locale_fr+:} false; then :
61578  $as_echo_n "(cached) " >&6
61579else
61580
61581    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61582/* end confdefs.h.  */
61583
61584#include <locale.h>
61585#include <time.h>
61586#if HAVE_LANGINFO_CODESET
61587# include <langinfo.h>
61588#endif
61589#include <stdlib.h>
61590#include <string.h>
61591struct tm t;
61592char buf[16];
61593int main () {
61594  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
61595     imitates locale dependent behaviour by looking at the environment
61596     variables, and all locales use the UTF-8 encoding.  */
61597#if defined __BEOS__ || defined __HAIKU__
61598  return 1;
61599#else
61600  /* Check whether the given locale name is recognized by the system.  */
61601# if defined _WIN32 && !defined __CYGWIN__
61602  /* On native Windows, setlocale(category, "") looks at the system settings,
61603     not at the environment variables.  Also, when an encoding suffix such
61604     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
61605     category of the locale to "C".  */
61606  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
61607      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
61608    return 1;
61609# else
61610  if (setlocale (LC_ALL, "") == NULL) return 1;
61611# endif
61612  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
61613     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
61614     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
61615     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
61616     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
61617     some unit tests fail.
61618     On MirBSD 10, when an unsupported locale is specified, setlocale()
61619     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
61620# if HAVE_LANGINFO_CODESET
61621  {
61622    const char *cs = nl_langinfo (CODESET);
61623    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
61624        || strcmp (cs, "UTF-8") == 0)
61625      return 1;
61626  }
61627# endif
61628# ifdef __CYGWIN__
61629  /* On Cygwin, avoid locale names without encoding suffix, because the
61630     locale_charset() function relies on the encoding suffix.  Note that
61631     LC_ALL is set on the command line.  */
61632  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
61633# endif
61634  /* Check whether in the abbreviation of the second month, the second
61635     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
61636     one byte long. This excludes the UTF-8 encoding.  */
61637  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
61638  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
61639# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
61640  /* Check whether the decimal separator is a comma.
61641     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
61642     are nl_langinfo(RADIXCHAR) are both ".".  */
61643  if (localeconv () ->decimal_point[0] != ',') return 1;
61644# endif
61645  return 0;
61646#endif
61647}
61648
61649_ACEOF
61650    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
61651  (eval $ac_link) 2>&5
61652  ac_status=$?
61653  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
61654  test $ac_status = 0; } && test -s conftest$ac_exeext; then
61655      case "$host_os" in
61656        # Handle native Windows specially, because there setlocale() interprets
61657        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
61658        # "fr" or "fra" as "French" or "French_France.1252",
61659        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
61660        # "ja" as "Japanese" or "Japanese_Japan.932",
61661        # and similar.
61662        mingw*)
61663          # Test for the native Windows locale name.
61664          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61665            gt_cv_locale_fr=French_France.1252
61666          else
61667            # None found.
61668            gt_cv_locale_fr=none
61669          fi
61670          ;;
61671        *)
61672          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
61673          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
61674          # configure script would override the LC_ALL setting. Likewise for
61675          # LC_CTYPE, which is also set at the beginning of the configure script.
61676          # Test for the usual locale name.
61677          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61678            gt_cv_locale_fr=fr_FR
61679          else
61680            # Test for the locale name with explicit encoding suffix.
61681            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61682              gt_cv_locale_fr=fr_FR.ISO-8859-1
61683            else
61684              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
61685              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61686                gt_cv_locale_fr=fr_FR.ISO8859-1
61687              else
61688                # Test for the HP-UX locale name.
61689                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61690                  gt_cv_locale_fr=fr_FR.iso88591
61691                else
61692                  # Test for the Solaris 7 locale name.
61693                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61694                    gt_cv_locale_fr=fr
61695                  else
61696                    # None found.
61697                    gt_cv_locale_fr=none
61698                  fi
61699                fi
61700              fi
61701            fi
61702          fi
61703          ;;
61704      esac
61705    fi
61706    rm -fr conftest*
61707
61708fi
61709{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
61710$as_echo "$gt_cv_locale_fr" >&6; }
61711  LOCALE_FR=$gt_cv_locale_fr
61712
61713
61714
61715
61716  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
61717$as_echo_n "checking for a french Unicode locale... " >&6; }
61718if ${gt_cv_locale_fr_utf8+:} false; then :
61719  $as_echo_n "(cached) " >&6
61720else
61721
61722    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61723/* end confdefs.h.  */
61724
61725#include <locale.h>
61726#include <time.h>
61727#if HAVE_LANGINFO_CODESET
61728# include <langinfo.h>
61729#endif
61730#include <stdlib.h>
61731#include <string.h>
61732struct tm t;
61733char buf[16];
61734int main () {
61735  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
61736     imitates locale dependent behaviour by looking at the environment
61737     variables, and all locales use the UTF-8 encoding.  */
61738#if !(defined __BEOS__ || defined __HAIKU__)
61739  /* Check whether the given locale name is recognized by the system.  */
61740# if defined _WIN32 && !defined __CYGWIN__
61741  /* On native Windows, setlocale(category, "") looks at the system settings,
61742     not at the environment variables.  Also, when an encoding suffix such
61743     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
61744     category of the locale to "C".  */
61745  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
61746      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
61747    return 1;
61748# else
61749  if (setlocale (LC_ALL, "") == NULL) return 1;
61750# endif
61751  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
61752     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
61753     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
61754     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
61755     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
61756     some unit tests fail.  */
61757# if HAVE_LANGINFO_CODESET
61758  {
61759    const char *cs = nl_langinfo (CODESET);
61760    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
61761      return 1;
61762  }
61763# endif
61764# ifdef __CYGWIN__
61765  /* On Cygwin, avoid locale names without encoding suffix, because the
61766     locale_charset() function relies on the encoding suffix.  Note that
61767     LC_ALL is set on the command line.  */
61768  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
61769# endif
61770  /* Check whether in the abbreviation of the second month, the second
61771     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
61772     two bytes long, with UTF-8 encoding.  */
61773  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
61774  if (strftime (buf, sizeof (buf), "%b", &t) < 4
61775      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
61776    return 1;
61777#endif
61778#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
61779  /* Check whether the decimal separator is a comma.
61780     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
61781     are nl_langinfo(RADIXCHAR) are both ".".  */
61782  if (localeconv () ->decimal_point[0] != ',') return 1;
61783#endif
61784  return 0;
61785}
61786
61787_ACEOF
61788    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
61789  (eval $ac_link) 2>&5
61790  ac_status=$?
61791  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
61792  test $ac_status = 0; } && test -s conftest$ac_exeext; then
61793      case "$host_os" in
61794        # Handle native Windows specially, because there setlocale() interprets
61795        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
61796        # "fr" or "fra" as "French" or "French_France.1252",
61797        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
61798        # "ja" as "Japanese" or "Japanese_Japan.932",
61799        # and similar.
61800        mingw*)
61801          # Test for the hypothetical native Windows locale name.
61802          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61803            gt_cv_locale_fr_utf8=French_France.65001
61804          else
61805            # None found.
61806            gt_cv_locale_fr_utf8=none
61807          fi
61808          ;;
61809        *)
61810          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
61811          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
61812          # configure script would override the LC_ALL setting. Likewise for
61813          # LC_CTYPE, which is also set at the beginning of the configure script.
61814          # Test for the usual locale name.
61815          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61816            gt_cv_locale_fr_utf8=fr_FR
61817          else
61818            # Test for the locale name with explicit encoding suffix.
61819            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61820              gt_cv_locale_fr_utf8=fr_FR.UTF-8
61821            else
61822              # Test for the Solaris 7 locale name.
61823              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61824                gt_cv_locale_fr_utf8=fr.UTF-8
61825              else
61826                # None found.
61827                gt_cv_locale_fr_utf8=none
61828              fi
61829            fi
61830          fi
61831          ;;
61832      esac
61833    fi
61834    rm -fr conftest*
61835
61836fi
61837{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
61838$as_echo "$gt_cv_locale_fr_utf8" >&6; }
61839  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
61840
61841
61842
61843
61844
61845  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
61846$as_echo_n "checking for a traditional japanese locale... " >&6; }
61847if ${gt_cv_locale_ja+:} false; then :
61848  $as_echo_n "(cached) " >&6
61849else
61850
61851    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61852/* end confdefs.h.  */
61853
61854#include <locale.h>
61855#include <time.h>
61856#if HAVE_LANGINFO_CODESET
61857# include <langinfo.h>
61858#endif
61859#include <stdlib.h>
61860#include <string.h>
61861struct tm t;
61862char buf[16];
61863int main ()
61864{
61865  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
61866     imitates locale dependent behaviour by looking at the environment
61867     variables, and all locales use the UTF-8 encoding.  */
61868#if defined __BEOS__ || defined __HAIKU__
61869  return 1;
61870#else
61871  /* Check whether the given locale name is recognized by the system.  */
61872# if defined _WIN32 && !defined __CYGWIN__
61873  /* On native Windows, setlocale(category, "") looks at the system settings,
61874     not at the environment variables.  Also, when an encoding suffix such
61875     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
61876     category of the locale to "C".  */
61877  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
61878      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
61879    return 1;
61880# else
61881  if (setlocale (LC_ALL, "") == NULL) return 1;
61882# endif
61883  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
61884     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
61885     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
61886     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
61887     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
61888     some unit tests fail.
61889     On MirBSD 10, when an unsupported locale is specified, setlocale()
61890     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
61891# if HAVE_LANGINFO_CODESET
61892  {
61893    const char *cs = nl_langinfo (CODESET);
61894    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
61895        || strcmp (cs, "UTF-8") == 0)
61896      return 1;
61897  }
61898# endif
61899# ifdef __CYGWIN__
61900  /* On Cygwin, avoid locale names without encoding suffix, because the
61901     locale_charset() function relies on the encoding suffix.  Note that
61902     LC_ALL is set on the command line.  */
61903  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
61904# endif
61905  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
61906     on Cygwin 1.5.x.  */
61907  if (MB_CUR_MAX == 1)
61908    return 1;
61909  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
61910     This excludes the UTF-8 encoding (except on MirBSD).  */
61911  {
61912    const char *p;
61913    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
61914    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
61915    for (p = buf; *p != '\0'; p++)
61916      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
61917        return 1;
61918  }
61919  return 0;
61920#endif
61921}
61922
61923_ACEOF
61924    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
61925  (eval $ac_link) 2>&5
61926  ac_status=$?
61927  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
61928  test $ac_status = 0; } && test -s conftest$ac_exeext; then
61929      case "$host_os" in
61930        # Handle native Windows specially, because there setlocale() interprets
61931        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
61932        # "fr" or "fra" as "French" or "French_France.1252",
61933        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
61934        # "ja" as "Japanese" or "Japanese_Japan.932",
61935        # and similar.
61936        mingw*)
61937          # Note that on native Windows, the Japanese locale is
61938          # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
61939          # cannot use it here.
61940          gt_cv_locale_ja=none
61941          ;;
61942        *)
61943          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
61944          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
61945          # configure script would override the LC_ALL setting. Likewise for
61946          # LC_CTYPE, which is also set at the beginning of the configure script.
61947          # Test for the AIX locale name.
61948          if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61949            gt_cv_locale_ja=ja_JP
61950          else
61951            # Test for the locale name with explicit encoding suffix.
61952            if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61953              gt_cv_locale_ja=ja_JP.EUC-JP
61954            else
61955              # Test for the HP-UX, OSF/1, NetBSD locale name.
61956              if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61957                gt_cv_locale_ja=ja_JP.eucJP
61958              else
61959                # Test for the IRIX, FreeBSD locale name.
61960                if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61961                  gt_cv_locale_ja=ja_JP.EUC
61962                else
61963                  # Test for the Solaris 7 locale name.
61964                  if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
61965                    gt_cv_locale_ja=ja
61966                  else
61967                    # Special test for NetBSD 1.6.
61968                    if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
61969                      gt_cv_locale_ja=ja_JP.eucJP
61970                    else
61971                      # None found.
61972                      gt_cv_locale_ja=none
61973                    fi
61974                  fi
61975                fi
61976              fi
61977            fi
61978          fi
61979          ;;
61980      esac
61981    fi
61982    rm -fr conftest*
61983
61984fi
61985{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
61986$as_echo "$gt_cv_locale_ja" >&6; }
61987  LOCALE_JA=$gt_cv_locale_ja
61988
61989
61990
61991
61992
61993  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
61994$as_echo_n "checking for a transitional chinese locale... " >&6; }
61995if ${gt_cv_locale_zh_CN+:} false; then :
61996  $as_echo_n "(cached) " >&6
61997else
61998
61999    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62000/* end confdefs.h.  */
62001
62002#include <locale.h>
62003#include <stdlib.h>
62004#include <time.h>
62005#if HAVE_LANGINFO_CODESET
62006# include <langinfo.h>
62007#endif
62008#include <stdlib.h>
62009#include <string.h>
62010struct tm t;
62011char buf[16];
62012int main ()
62013{
62014  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
62015     imitates locale dependent behaviour by looking at the environment
62016     variables, and all locales use the UTF-8 encoding.  */
62017#if defined __BEOS__ || defined __HAIKU__
62018  return 1;
62019#else
62020  /* Check whether the given locale name is recognized by the system.  */
62021# if defined _WIN32 && !defined __CYGWIN__
62022  /* On native Windows, setlocale(category, "") looks at the system settings,
62023     not at the environment variables.  Also, when an encoding suffix such
62024     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
62025     category of the locale to "C".  */
62026  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
62027      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
62028    return 1;
62029# else
62030  if (setlocale (LC_ALL, "") == NULL) return 1;
62031# endif
62032  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
62033     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
62034     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
62035     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
62036     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
62037     some unit tests fail.
62038     On MirBSD 10, when an unsupported locale is specified, setlocale()
62039     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
62040# if HAVE_LANGINFO_CODESET
62041  {
62042    const char *cs = nl_langinfo (CODESET);
62043    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
62044        || strcmp (cs, "UTF-8") == 0)
62045      return 1;
62046  }
62047# endif
62048# ifdef __CYGWIN__
62049  /* On Cygwin, avoid locale names without encoding suffix, because the
62050     locale_charset() function relies on the encoding suffix.  Note that
62051     LC_ALL is set on the command line.  */
62052  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
62053# endif
62054  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
62055     This excludes the UTF-8 encoding (except on MirBSD).  */
62056  {
62057    const char *p;
62058    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
62059    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
62060    for (p = buf; *p != '\0'; p++)
62061      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
62062        return 1;
62063  }
62064  /* Check whether a typical GB18030 multibyte sequence is recognized as a
62065     single wide character.  This excludes the GB2312 and GBK encodings.  */
62066  if (mblen ("\203\062\332\066", 5) != 4)
62067    return 1;
62068  return 0;
62069#endif
62070}
62071
62072_ACEOF
62073    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
62074  (eval $ac_link) 2>&5
62075  ac_status=$?
62076  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
62077  test $ac_status = 0; } && test -s conftest$ac_exeext; then
62078      case "$host_os" in
62079        # Handle native Windows specially, because there setlocale() interprets
62080        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
62081        # "fr" or "fra" as "French" or "French_France.1252",
62082        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
62083        # "ja" as "Japanese" or "Japanese_Japan.932",
62084        # and similar.
62085        mingw*)
62086          # Test for the hypothetical native Windows locale name.
62087          if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62088            gt_cv_locale_zh_CN=Chinese_China.54936
62089          else
62090            # None found.
62091            gt_cv_locale_zh_CN=none
62092          fi
62093          ;;
62094        solaris2.8)
62095          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
62096          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
62097          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
62098          gt_cv_locale_zh_CN=none
62099          ;;
62100        *)
62101          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
62102          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
62103          # configure script would override the LC_ALL setting. Likewise for
62104          # LC_CTYPE, which is also set at the beginning of the configure script.
62105          # Test for the locale name without encoding suffix.
62106          if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62107            gt_cv_locale_zh_CN=zh_CN
62108          else
62109            # Test for the locale name with explicit encoding suffix.
62110            if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62111              gt_cv_locale_zh_CN=zh_CN.GB18030
62112            else
62113              # None found.
62114              gt_cv_locale_zh_CN=none
62115            fi
62116          fi
62117          ;;
62118      esac
62119    else
62120      # If there was a link error, due to mblen(), the system is so old that
62121      # it certainly doesn't have a chinese locale.
62122      gt_cv_locale_zh_CN=none
62123    fi
62124    rm -fr conftest*
62125
62126fi
62127{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
62128$as_echo "$gt_cv_locale_zh_CN" >&6; }
62129  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
62130
62131
62132
62133  if test "$ac_cv_header_winsock2_h" = yes; then
62134
62135
62136
62137
62138
62139
62140
62141
62142  gltests_LIBOBJS="$gltests_LIBOBJS setsockopt.$ac_objext"
62143
62144  fi
62145
62146
62147
62148
62149
62150    if test "$GNULIB_SETSOCKOPT" != 1; then
62151        if test "$GNULIB_SETSOCKOPT" = 0; then
62152      GNULIB_SETSOCKOPT=$gl_module_indicator_condition
62153    else
62154      GNULIB_SETSOCKOPT="($GNULIB_SETSOCKOPT || $gl_module_indicator_condition)"
62155    fi
62156  fi
62157
62158
62159
62160
62161
62162$as_echo "#define GNULIB_TEST_SETSOCKOPT 1" >>confdefs.h
62163
62164
62165
62166
62167
62168
62169
62170
62171               ac_fn_c_check_decl "$LINENO" "sleep" "ac_cv_have_decl_sleep" "#include <unistd.h>
62172"
62173if test "x$ac_cv_have_decl_sleep" = xyes; then :
62174  ac_have_decl=1
62175else
62176  ac_have_decl=0
62177fi
62178
62179cat >>confdefs.h <<_ACEOF
62180#define HAVE_DECL_SLEEP $ac_have_decl
62181_ACEOF
62182
62183
62184  if test $ac_cv_have_decl_sleep != yes; then
62185    HAVE_SLEEP=0
62186  else
62187        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working sleep" >&5
62188$as_echo_n "checking for working sleep... " >&6; }
62189if ${gl_cv_func_sleep_works+:} false; then :
62190  $as_echo_n "(cached) " >&6
62191else
62192  if test "$cross_compiling" = yes; then :
62193  case "$host_os" in
62194                        # Guess yes on glibc systems.
62195         *-gnu* | gnu*) gl_cv_func_sleep_works="guessing yes" ;;
62196                        # Guess no on native Windows.
62197         mingw*)        gl_cv_func_sleep_works="guessing no" ;;
62198                        # If we don't know, assume the worst.
62199         *)             gl_cv_func_sleep_works="guessing no" ;;
62200       esac
62201
62202else
62203  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62204/* end confdefs.h.  */
62205
62206#include <errno.h>
62207#include <unistd.h>
62208#include <signal.h>
62209static void
62210handle_alarm (int sig)
62211{
62212  if (sig != SIGALRM)
62213    _exit (2);
62214}
62215
62216int
62217main ()
62218{
62219
62220    /* Failure to compile this test due to missing alarm is okay,
62221       since all such platforms (mingw) also lack sleep.  */
62222    unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days.  */
62223    unsigned int remaining;
62224    signal (SIGALRM, handle_alarm);
62225    alarm (1);
62226    remaining = sleep (pentecost);
62227    if (remaining > pentecost)
62228      return 3;
62229    if (remaining <= pentecost - 10)
62230      return 4;
62231    return 0;
62232
62233  ;
62234  return 0;
62235}
62236_ACEOF
62237if ac_fn_c_try_run "$LINENO"; then :
62238  gl_cv_func_sleep_works=yes
62239else
62240  gl_cv_func_sleep_works=no
62241fi
62242rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
62243  conftest.$ac_objext conftest.beam conftest.$ac_ext
62244fi
62245
62246fi
62247{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_sleep_works" >&5
62248$as_echo "$gl_cv_func_sleep_works" >&6; }
62249    case "$gl_cv_func_sleep_works" in
62250      *yes) ;;
62251      *)
62252        REPLACE_SLEEP=1
62253        ;;
62254    esac
62255  fi
62256
62257  if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then
62258
62259
62260
62261
62262
62263
62264
62265
62266  gltests_LIBOBJS="$gltests_LIBOBJS sleep.$ac_objext"
62267
62268  fi
62269
62270
62271
62272
62273
62274    if test "$GNULIB_SLEEP" != 1; then
62275        if test "$GNULIB_SLEEP" = 0; then
62276      GNULIB_SLEEP=$gl_module_indicator_condition
62277    else
62278      GNULIB_SLEEP="($GNULIB_SLEEP || $gl_module_indicator_condition)"
62279    fi
62280  fi
62281
62282
62283
62284
62285
62286$as_echo "#define GNULIB_TEST_SLEEP 1" >>confdefs.h
62287
62288
62289
62290
62291
62292  if test "$ac_cv_header_winsock2_h" = yes; then
62293
62294
62295
62296
62297
62298
62299
62300
62301  gltests_LIBOBJS="$gltests_LIBOBJS socket.$ac_objext"
62302
62303  fi
62304  # When this module is used, sockets may actually occur as file descriptors,
62305  # hence it is worth warning if the modules 'close' and 'ioctl' are not used.
62306
62307
62308
62309  if test "$ac_cv_header_winsock2_h" = yes; then
62310    UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
62311    SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
62312  fi
62313
62314
62315
62316
62317
62318    if test "$GNULIB_SOCKET" != 1; then
62319        if test "$GNULIB_SOCKET" = 0; then
62320      GNULIB_SOCKET=$gl_module_indicator_condition
62321    else
62322      GNULIB_SOCKET="($GNULIB_SOCKET || $gl_module_indicator_condition)"
62323    fi
62324  fi
62325
62326
62327
62328
62329
62330$as_echo "#define GNULIB_TEST_SOCKET 1" >>confdefs.h
62331
62332
62333
62334
62335
62336
62337
62338
62339
62340
62341
62342
62343  if test $ac_cv_have_decl_strerror_r = no; then
62344    HAVE_DECL_STRERROR_R=0
62345  fi
62346
62347  if test $ac_cv_func_strerror_r = yes; then
62348    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
62349      if test $gl_cv_func_strerror_r_posix_signature = yes; then
62350        case "$gl_cv_func_strerror_r_works" in
62351                    *no) REPLACE_STRERROR_R=1 ;;
62352        esac
62353      else
62354                REPLACE_STRERROR_R=1
62355      fi
62356    else
62357                  REPLACE_STRERROR_R=1
62358    fi
62359  fi
62360
62361  if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
62362
62363
62364
62365
62366
62367
62368
62369
62370  gltests_LIBOBJS="$gltests_LIBOBJS strerror_r.$ac_objext"
62371
62372
62373
62374
62375
62376
62377  fi
62378
62379
62380
62381
62382
62383    if test "$GNULIB_STRERROR_R" != 1; then
62384        if test "$GNULIB_STRERROR_R" = 0; then
62385      GNULIB_STRERROR_R=$gl_module_indicator_condition
62386    else
62387      GNULIB_STRERROR_R="($GNULIB_STRERROR_R || $gl_module_indicator_condition)"
62388    fi
62389  fi
62390
62391
62392
62393
62394
62395$as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
62396
62397
62398
62399
62400
62401cat >>confdefs.h <<_ACEOF
62402#define GNULIB_STRERROR_R_POSIX $gl_module_indicator_condition
62403_ACEOF
62404
62405
62406
62407
62408
62409  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
62410  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
62411  # irrelevant for anonymous mappings.
62412  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
62413if test "x$ac_cv_func_mmap" = xyes; then :
62414  gl_have_mmap=yes
62415else
62416  gl_have_mmap=no
62417fi
62418
62419
62420  # Try to allow MAP_ANONYMOUS.
62421  gl_have_mmap_anonymous=no
62422  if test $gl_have_mmap = yes; then
62423    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
62424$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
62425    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62426/* end confdefs.h.  */
62427
62428#include <sys/mman.h>
62429#ifdef MAP_ANONYMOUS
62430    I cannot identify this map
62431#endif
62432
62433_ACEOF
62434if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
62435  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
62436  gl_have_mmap_anonymous=yes
62437fi
62438rm -f conftest*
62439
62440    if test $gl_have_mmap_anonymous != yes; then
62441      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62442/* end confdefs.h.  */
62443
62444#include <sys/mman.h>
62445#ifdef MAP_ANON
62446    I cannot identify this map
62447#endif
62448
62449_ACEOF
62450if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
62451  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
62452
62453$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
62454
62455         gl_have_mmap_anonymous=yes
62456fi
62457rm -f conftest*
62458
62459    fi
62460    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
62461$as_echo "$gl_have_mmap_anonymous" >&6; }
62462    if test $gl_have_mmap_anonymous = yes; then
62463
62464$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
62465
62466    fi
62467  fi
62468
62469
62470
62471
62472
62473
62474  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
62475  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
62476  # irrelevant for anonymous mappings.
62477  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
62478if test "x$ac_cv_func_mmap" = xyes; then :
62479  gl_have_mmap=yes
62480else
62481  gl_have_mmap=no
62482fi
62483
62484
62485  # Try to allow MAP_ANONYMOUS.
62486  gl_have_mmap_anonymous=no
62487  if test $gl_have_mmap = yes; then
62488    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
62489$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
62490    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62491/* end confdefs.h.  */
62492
62493#include <sys/mman.h>
62494#ifdef MAP_ANONYMOUS
62495    I cannot identify this map
62496#endif
62497
62498_ACEOF
62499if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
62500  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
62501  gl_have_mmap_anonymous=yes
62502fi
62503rm -f conftest*
62504
62505    if test $gl_have_mmap_anonymous != yes; then
62506      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62507/* end confdefs.h.  */
62508
62509#include <sys/mman.h>
62510#ifdef MAP_ANON
62511    I cannot identify this map
62512#endif
62513
62514_ACEOF
62515if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
62516  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
62517
62518$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
62519
62520         gl_have_mmap_anonymous=yes
62521fi
62522rm -f conftest*
62523
62524    fi
62525    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
62526$as_echo "$gl_have_mmap_anonymous" >&6; }
62527    if test $gl_have_mmap_anonymous = yes; then
62528
62529$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
62530
62531    fi
62532  fi
62533
62534
62535
62536
62537
62538
62539
62540  if test $gl_threads_api = posix; then
62541    gl_save_LIBS="$LIBS"
62542    LIBS="$LIBS $LIBMULTITHREAD"
62543    for ac_func in pthread_atfork
62544do :
62545  ac_fn_c_check_func "$LINENO" "pthread_atfork" "ac_cv_func_pthread_atfork"
62546if test "x$ac_cv_func_pthread_atfork" = xyes; then :
62547  cat >>confdefs.h <<_ACEOF
62548#define HAVE_PTHREAD_ATFORK 1
62549_ACEOF
62550
62551fi
62552done
62553
62554    LIBS="$gl_save_LIBS"
62555  fi
62556
62557
62558
62559
62560
62561  # The Hurd, the Linux kernel, the FreeBSD kernel version 2.2 and later,
62562  # Cygwin, and mingw never let anyone (even root) unlink directories.
62563  # If anyone knows of another system for which unlink can never
62564  # remove a directory, please report it to <bug-coreutils@gnu.org>.
62565  # Unfortunately this is difficult to test for, since it requires root access
62566  # and might create garbage in the file system,
62567  # so the code below simply relies on the kernel name and version number.
62568  case $host_os in
62569  gnu[0-9]* | \
62570  linux-* | linux | \
62571  freebsd2.2* | freebsd[3-9]* | freebsd[1-9][0-9]* | \
62572  cygwin | \
62573  mingw*)
62574
62575$as_echo "#define UNLINK_CANNOT_UNLINK_DIR 1" >>confdefs.h
62576;;
62577  esac
62578
62579  abs_aux_dir=`cd "$ac_aux_dir"; pwd`
62580
62581
62582
62583
62584
62585  ac_fn_c_check_type "$LINENO" "useconds_t" "ac_cv_type_useconds_t" "$ac_includes_default"
62586if test "x$ac_cv_type_useconds_t" = xyes; then :
62587
62588else
62589
62590$as_echo "#define useconds_t unsigned int" >>confdefs.h
62591
62592fi
62593
62594  if test $ac_cv_func_usleep = no; then
62595    HAVE_USLEEP=0
62596  else
62597            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether usleep allows large arguments" >&5
62598$as_echo_n "checking whether usleep allows large arguments... " >&6; }
62599if ${gl_cv_func_usleep_works+:} false; then :
62600  $as_echo_n "(cached) " >&6
62601else
62602  if test "$cross_compiling" = yes; then :
62603  case "$host_os" in
62604                          # Guess yes on glibc systems.
62605           *-gnu* | gnu*) gl_cv_func_usleep_works="guessing yes" ;;
62606                          # Guess no on native Windows.
62607           mingw*)        gl_cv_func_usleep_works="guessing no" ;;
62608                          # If we don't know, assume the worst.
62609           *)             gl_cv_func_usleep_works="guessing no" ;;
62610         esac
62611
62612else
62613  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62614/* end confdefs.h.  */
62615
62616#include <unistd.h>
62617
62618int
62619main ()
62620{
62621return !!usleep (1000000);
62622  ;
62623  return 0;
62624}
62625_ACEOF
62626if ac_fn_c_try_run "$LINENO"; then :
62627  gl_cv_func_usleep_works=yes
62628else
62629  gl_cv_func_usleep_works=no
62630fi
62631rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
62632  conftest.$ac_objext conftest.beam conftest.$ac_ext
62633fi
62634
62635fi
62636{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_usleep_works" >&5
62637$as_echo "$gl_cv_func_usleep_works" >&6; }
62638    case "$gl_cv_func_usleep_works" in
62639      *yes) ;;
62640      *)
62641        REPLACE_USLEEP=1
62642        ;;
62643    esac
62644  fi
62645
62646  if test $HAVE_USLEEP = 0 || test $REPLACE_USLEEP = 1; then
62647
62648
62649
62650
62651
62652
62653
62654
62655  gltests_LIBOBJS="$gltests_LIBOBJS usleep.$ac_objext"
62656
62657  fi
62658
62659
62660
62661
62662
62663    if test "$GNULIB_USLEEP" != 1; then
62664        if test "$GNULIB_USLEEP" = 0; then
62665      GNULIB_USLEEP=$gl_module_indicator_condition
62666    else
62667      GNULIB_USLEEP="($GNULIB_USLEEP || $gl_module_indicator_condition)"
62668    fi
62669  fi
62670
62671
62672
62673
62674
62675$as_echo "#define GNULIB_TEST_USLEEP 1" >>confdefs.h
62676
62677
62678
62679
62680  abs_aux_dir=`cd "$ac_aux_dir"; pwd`
62681
62682
62683
62684
62685  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
62686$as_echo_n "checking for a traditional french locale... " >&6; }
62687if ${gt_cv_locale_fr+:} false; then :
62688  $as_echo_n "(cached) " >&6
62689else
62690
62691    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62692/* end confdefs.h.  */
62693
62694#include <locale.h>
62695#include <time.h>
62696#if HAVE_LANGINFO_CODESET
62697# include <langinfo.h>
62698#endif
62699#include <stdlib.h>
62700#include <string.h>
62701struct tm t;
62702char buf[16];
62703int main () {
62704  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
62705     imitates locale dependent behaviour by looking at the environment
62706     variables, and all locales use the UTF-8 encoding.  */
62707#if defined __BEOS__ || defined __HAIKU__
62708  return 1;
62709#else
62710  /* Check whether the given locale name is recognized by the system.  */
62711# if defined _WIN32 && !defined __CYGWIN__
62712  /* On native Windows, setlocale(category, "") looks at the system settings,
62713     not at the environment variables.  Also, when an encoding suffix such
62714     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
62715     category of the locale to "C".  */
62716  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
62717      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
62718    return 1;
62719# else
62720  if (setlocale (LC_ALL, "") == NULL) return 1;
62721# endif
62722  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
62723     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
62724     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
62725     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
62726     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
62727     some unit tests fail.
62728     On MirBSD 10, when an unsupported locale is specified, setlocale()
62729     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
62730# if HAVE_LANGINFO_CODESET
62731  {
62732    const char *cs = nl_langinfo (CODESET);
62733    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
62734        || strcmp (cs, "UTF-8") == 0)
62735      return 1;
62736  }
62737# endif
62738# ifdef __CYGWIN__
62739  /* On Cygwin, avoid locale names without encoding suffix, because the
62740     locale_charset() function relies on the encoding suffix.  Note that
62741     LC_ALL is set on the command line.  */
62742  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
62743# endif
62744  /* Check whether in the abbreviation of the second month, the second
62745     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
62746     one byte long. This excludes the UTF-8 encoding.  */
62747  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
62748  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
62749# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
62750  /* Check whether the decimal separator is a comma.
62751     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
62752     are nl_langinfo(RADIXCHAR) are both ".".  */
62753  if (localeconv () ->decimal_point[0] != ',') return 1;
62754# endif
62755  return 0;
62756#endif
62757}
62758
62759_ACEOF
62760    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
62761  (eval $ac_link) 2>&5
62762  ac_status=$?
62763  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
62764  test $ac_status = 0; } && test -s conftest$ac_exeext; then
62765      case "$host_os" in
62766        # Handle native Windows specially, because there setlocale() interprets
62767        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
62768        # "fr" or "fra" as "French" or "French_France.1252",
62769        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
62770        # "ja" as "Japanese" or "Japanese_Japan.932",
62771        # and similar.
62772        mingw*)
62773          # Test for the native Windows locale name.
62774          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62775            gt_cv_locale_fr=French_France.1252
62776          else
62777            # None found.
62778            gt_cv_locale_fr=none
62779          fi
62780          ;;
62781        *)
62782          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
62783          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
62784          # configure script would override the LC_ALL setting. Likewise for
62785          # LC_CTYPE, which is also set at the beginning of the configure script.
62786          # Test for the usual locale name.
62787          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62788            gt_cv_locale_fr=fr_FR
62789          else
62790            # Test for the locale name with explicit encoding suffix.
62791            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62792              gt_cv_locale_fr=fr_FR.ISO-8859-1
62793            else
62794              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
62795              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62796                gt_cv_locale_fr=fr_FR.ISO8859-1
62797              else
62798                # Test for the HP-UX locale name.
62799                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62800                  gt_cv_locale_fr=fr_FR.iso88591
62801                else
62802                  # Test for the Solaris 7 locale name.
62803                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62804                    gt_cv_locale_fr=fr
62805                  else
62806                    # None found.
62807                    gt_cv_locale_fr=none
62808                  fi
62809                fi
62810              fi
62811            fi
62812          fi
62813          ;;
62814      esac
62815    fi
62816    rm -fr conftest*
62817
62818fi
62819{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
62820$as_echo "$gt_cv_locale_fr" >&6; }
62821  LOCALE_FR=$gt_cv_locale_fr
62822
62823
62824
62825
62826  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
62827$as_echo_n "checking for a french Unicode locale... " >&6; }
62828if ${gt_cv_locale_fr_utf8+:} false; then :
62829  $as_echo_n "(cached) " >&6
62830else
62831
62832    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62833/* end confdefs.h.  */
62834
62835#include <locale.h>
62836#include <time.h>
62837#if HAVE_LANGINFO_CODESET
62838# include <langinfo.h>
62839#endif
62840#include <stdlib.h>
62841#include <string.h>
62842struct tm t;
62843char buf[16];
62844int main () {
62845  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
62846     imitates locale dependent behaviour by looking at the environment
62847     variables, and all locales use the UTF-8 encoding.  */
62848#if !(defined __BEOS__ || defined __HAIKU__)
62849  /* Check whether the given locale name is recognized by the system.  */
62850# if defined _WIN32 && !defined __CYGWIN__
62851  /* On native Windows, setlocale(category, "") looks at the system settings,
62852     not at the environment variables.  Also, when an encoding suffix such
62853     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
62854     category of the locale to "C".  */
62855  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
62856      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
62857    return 1;
62858# else
62859  if (setlocale (LC_ALL, "") == NULL) return 1;
62860# endif
62861  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
62862     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
62863     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
62864     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
62865     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
62866     some unit tests fail.  */
62867# if HAVE_LANGINFO_CODESET
62868  {
62869    const char *cs = nl_langinfo (CODESET);
62870    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
62871      return 1;
62872  }
62873# endif
62874# ifdef __CYGWIN__
62875  /* On Cygwin, avoid locale names without encoding suffix, because the
62876     locale_charset() function relies on the encoding suffix.  Note that
62877     LC_ALL is set on the command line.  */
62878  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
62879# endif
62880  /* Check whether in the abbreviation of the second month, the second
62881     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
62882     two bytes long, with UTF-8 encoding.  */
62883  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
62884  if (strftime (buf, sizeof (buf), "%b", &t) < 4
62885      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
62886    return 1;
62887#endif
62888#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
62889  /* Check whether the decimal separator is a comma.
62890     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
62891     are nl_langinfo(RADIXCHAR) are both ".".  */
62892  if (localeconv () ->decimal_point[0] != ',') return 1;
62893#endif
62894  return 0;
62895}
62896
62897_ACEOF
62898    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
62899  (eval $ac_link) 2>&5
62900  ac_status=$?
62901  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
62902  test $ac_status = 0; } && test -s conftest$ac_exeext; then
62903      case "$host_os" in
62904        # Handle native Windows specially, because there setlocale() interprets
62905        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
62906        # "fr" or "fra" as "French" or "French_France.1252",
62907        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
62908        # "ja" as "Japanese" or "Japanese_Japan.932",
62909        # and similar.
62910        mingw*)
62911          # Test for the hypothetical native Windows locale name.
62912          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62913            gt_cv_locale_fr_utf8=French_France.65001
62914          else
62915            # None found.
62916            gt_cv_locale_fr_utf8=none
62917          fi
62918          ;;
62919        *)
62920          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
62921          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
62922          # configure script would override the LC_ALL setting. Likewise for
62923          # LC_CTYPE, which is also set at the beginning of the configure script.
62924          # Test for the usual locale name.
62925          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62926            gt_cv_locale_fr_utf8=fr_FR
62927          else
62928            # Test for the locale name with explicit encoding suffix.
62929            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62930              gt_cv_locale_fr_utf8=fr_FR.UTF-8
62931            else
62932              # Test for the Solaris 7 locale name.
62933              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
62934                gt_cv_locale_fr_utf8=fr.UTF-8
62935              else
62936                # None found.
62937                gt_cv_locale_fr_utf8=none
62938              fi
62939            fi
62940          fi
62941          ;;
62942      esac
62943    fi
62944    rm -fr conftest*
62945
62946fi
62947{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
62948$as_echo "$gt_cv_locale_fr_utf8" >&6; }
62949  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
62950
62951
62952
62953
62954
62955  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
62956$as_echo_n "checking for a traditional japanese locale... " >&6; }
62957if ${gt_cv_locale_ja+:} false; then :
62958  $as_echo_n "(cached) " >&6
62959else
62960
62961    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62962/* end confdefs.h.  */
62963
62964#include <locale.h>
62965#include <time.h>
62966#if HAVE_LANGINFO_CODESET
62967# include <langinfo.h>
62968#endif
62969#include <stdlib.h>
62970#include <string.h>
62971struct tm t;
62972char buf[16];
62973int main ()
62974{
62975  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
62976     imitates locale dependent behaviour by looking at the environment
62977     variables, and all locales use the UTF-8 encoding.  */
62978#if defined __BEOS__ || defined __HAIKU__
62979  return 1;
62980#else
62981  /* Check whether the given locale name is recognized by the system.  */
62982# if defined _WIN32 && !defined __CYGWIN__
62983  /* On native Windows, setlocale(category, "") looks at the system settings,
62984     not at the environment variables.  Also, when an encoding suffix such
62985     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
62986     category of the locale to "C".  */
62987  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
62988      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
62989    return 1;
62990# else
62991  if (setlocale (LC_ALL, "") == NULL) return 1;
62992# endif
62993  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
62994     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
62995     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
62996     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
62997     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
62998     some unit tests fail.
62999     On MirBSD 10, when an unsupported locale is specified, setlocale()
63000     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
63001# if HAVE_LANGINFO_CODESET
63002  {
63003    const char *cs = nl_langinfo (CODESET);
63004    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
63005        || strcmp (cs, "UTF-8") == 0)
63006      return 1;
63007  }
63008# endif
63009# ifdef __CYGWIN__
63010  /* On Cygwin, avoid locale names without encoding suffix, because the
63011     locale_charset() function relies on the encoding suffix.  Note that
63012     LC_ALL is set on the command line.  */
63013  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
63014# endif
63015  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
63016     on Cygwin 1.5.x.  */
63017  if (MB_CUR_MAX == 1)
63018    return 1;
63019  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
63020     This excludes the UTF-8 encoding (except on MirBSD).  */
63021  {
63022    const char *p;
63023    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
63024    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
63025    for (p = buf; *p != '\0'; p++)
63026      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
63027        return 1;
63028  }
63029  return 0;
63030#endif
63031}
63032
63033_ACEOF
63034    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
63035  (eval $ac_link) 2>&5
63036  ac_status=$?
63037  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
63038  test $ac_status = 0; } && test -s conftest$ac_exeext; then
63039      case "$host_os" in
63040        # Handle native Windows specially, because there setlocale() interprets
63041        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
63042        # "fr" or "fra" as "French" or "French_France.1252",
63043        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
63044        # "ja" as "Japanese" or "Japanese_Japan.932",
63045        # and similar.
63046        mingw*)
63047          # Note that on native Windows, the Japanese locale is
63048          # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
63049          # cannot use it here.
63050          gt_cv_locale_ja=none
63051          ;;
63052        *)
63053          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
63054          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
63055          # configure script would override the LC_ALL setting. Likewise for
63056          # LC_CTYPE, which is also set at the beginning of the configure script.
63057          # Test for the AIX locale name.
63058          if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
63059            gt_cv_locale_ja=ja_JP
63060          else
63061            # Test for the locale name with explicit encoding suffix.
63062            if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
63063              gt_cv_locale_ja=ja_JP.EUC-JP
63064            else
63065              # Test for the HP-UX, OSF/1, NetBSD locale name.
63066              if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
63067                gt_cv_locale_ja=ja_JP.eucJP
63068              else
63069                # Test for the IRIX, FreeBSD locale name.
63070                if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
63071                  gt_cv_locale_ja=ja_JP.EUC
63072                else
63073                  # Test for the Solaris 7 locale name.
63074                  if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
63075                    gt_cv_locale_ja=ja
63076                  else
63077                    # Special test for NetBSD 1.6.
63078                    if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
63079                      gt_cv_locale_ja=ja_JP.eucJP
63080                    else
63081                      # None found.
63082                      gt_cv_locale_ja=none
63083                    fi
63084                  fi
63085                fi
63086              fi
63087            fi
63088          fi
63089          ;;
63090      esac
63091    fi
63092    rm -fr conftest*
63093
63094fi
63095{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
63096$as_echo "$gt_cv_locale_ja" >&6; }
63097  LOCALE_JA=$gt_cv_locale_ja
63098
63099
63100
63101
63102
63103  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
63104$as_echo_n "checking for a transitional chinese locale... " >&6; }
63105if ${gt_cv_locale_zh_CN+:} false; then :
63106  $as_echo_n "(cached) " >&6
63107else
63108
63109    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63110/* end confdefs.h.  */
63111
63112#include <locale.h>
63113#include <stdlib.h>
63114#include <time.h>
63115#if HAVE_LANGINFO_CODESET
63116# include <langinfo.h>
63117#endif
63118#include <stdlib.h>
63119#include <string.h>
63120struct tm t;
63121char buf[16];
63122int main ()
63123{
63124  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
63125     imitates locale dependent behaviour by looking at the environment
63126     variables, and all locales use the UTF-8 encoding.  */
63127#if defined __BEOS__ || defined __HAIKU__
63128  return 1;
63129#else
63130  /* Check whether the given locale name is recognized by the system.  */
63131# if defined _WIN32 && !defined __CYGWIN__
63132  /* On native Windows, setlocale(category, "") looks at the system settings,
63133     not at the environment variables.  Also, when an encoding suffix such
63134     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
63135     category of the locale to "C".  */
63136  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
63137      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
63138    return 1;
63139# else
63140  if (setlocale (LC_ALL, "") == NULL) return 1;
63141# endif
63142  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
63143     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
63144     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
63145     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
63146     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
63147     some unit tests fail.
63148     On MirBSD 10, when an unsupported locale is specified, setlocale()
63149     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
63150# if HAVE_LANGINFO_CODESET
63151  {
63152    const char *cs = nl_langinfo (CODESET);
63153    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
63154        || strcmp (cs, "UTF-8") == 0)
63155      return 1;
63156  }
63157# endif
63158# ifdef __CYGWIN__
63159  /* On Cygwin, avoid locale names without encoding suffix, because the
63160     locale_charset() function relies on the encoding suffix.  Note that
63161     LC_ALL is set on the command line.  */
63162  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
63163# endif
63164  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
63165     This excludes the UTF-8 encoding (except on MirBSD).  */
63166  {
63167    const char *p;
63168    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
63169    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
63170    for (p = buf; *p != '\0'; p++)
63171      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
63172        return 1;
63173  }
63174  /* Check whether a typical GB18030 multibyte sequence is recognized as a
63175     single wide character.  This excludes the GB2312 and GBK encodings.  */
63176  if (mblen ("\203\062\332\066", 5) != 4)
63177    return 1;
63178  return 0;
63179#endif
63180}
63181
63182_ACEOF
63183    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
63184  (eval $ac_link) 2>&5
63185  ac_status=$?
63186  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
63187  test $ac_status = 0; } && test -s conftest$ac_exeext; then
63188      case "$host_os" in
63189        # Handle native Windows specially, because there setlocale() interprets
63190        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
63191        # "fr" or "fra" as "French" or "French_France.1252",
63192        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
63193        # "ja" as "Japanese" or "Japanese_Japan.932",
63194        # and similar.
63195        mingw*)
63196          # Test for the hypothetical native Windows locale name.
63197          if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
63198            gt_cv_locale_zh_CN=Chinese_China.54936
63199          else
63200            # None found.
63201            gt_cv_locale_zh_CN=none
63202          fi
63203          ;;
63204        solaris2.8)
63205          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
63206          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
63207          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
63208          gt_cv_locale_zh_CN=none
63209          ;;
63210        *)
63211          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
63212          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
63213          # configure script would override the LC_ALL setting. Likewise for
63214          # LC_CTYPE, which is also set at the beginning of the configure script.
63215          # Test for the locale name without encoding suffix.
63216          if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
63217            gt_cv_locale_zh_CN=zh_CN
63218          else
63219            # Test for the locale name with explicit encoding suffix.
63220            if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
63221              gt_cv_locale_zh_CN=zh_CN.GB18030
63222            else
63223              # None found.
63224              gt_cv_locale_zh_CN=none
63225            fi
63226          fi
63227          ;;
63228      esac
63229    else
63230      # If there was a link error, due to mblen(), the system is so old that
63231      # it certainly doesn't have a chinese locale.
63232      gt_cv_locale_zh_CN=none
63233    fi
63234    rm -fr conftest*
63235
63236fi
63237{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
63238$as_echo "$gt_cv_locale_zh_CN" >&6; }
63239  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
63240
63241
63242
63243
63244
63245
63246  if test $ac_cv_func_wctob = no; then
63247    HAVE_WCTOB=0
63248    HAVE_DECL_WCTOB=0
63249  else
63250    HAVE_WCTOB=1
63251
63252
63253
63254         { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5
63255$as_echo_n "checking whether wctob works... " >&6; }
63256if ${gl_cv_func_wctob_works+:} false; then :
63257  $as_echo_n "(cached) " >&6
63258else
63259
63260                        case "$host_os" in
63261            # Guess no on Solaris <= 9 and Cygwin.
63262          solaris2.[1-9] | solaris2.[1-9].* | cygwin*)
63263            gl_cv_func_wctob_works="guessing no" ;;
63264            # Guess no on native Windows.
63265          mingw*)
63266            gl_cv_func_wctob_works="guessing no" ;;
63267            # Guess yes otherwise.
63268          *) gl_cv_func_wctob_works="guessing yes" ;;
63269        esac
63270        case "$host_os" in
63271          cygwin*)
63272            if test "$cross_compiling" = yes; then :
63273  :
63274else
63275  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63276/* end confdefs.h.  */
63277
63278#include <locale.h>
63279/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
63280   <wchar.h>.
63281   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
63282   included before <wchar.h>.  */
63283#include <stddef.h>
63284#include <stdio.h>
63285#include <time.h>
63286#include <wchar.h>
63287
63288register long global __asm__ ("%ebx");
63289
63290int main ()
63291{
63292  setlocale (LC_ALL, "en_US.UTF-8");
63293
63294  global = 0x12345678;
63295  if (wctob (0x00FC) != -1)
63296    return 1;
63297  if (global != 0x12345678)
63298    return 2;
63299  return 0;
63300}
63301_ACEOF
63302if ac_fn_c_try_run "$LINENO"; then :
63303  :
63304else
63305  gl_cv_func_wctob_works=no
63306fi
63307rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
63308  conftest.$ac_objext conftest.beam conftest.$ac_ext
63309fi
63310
63311            ;;
63312        esac
63313        if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then
63314          if test "$cross_compiling" = yes; then :
63315  :
63316else
63317  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63318/* end confdefs.h.  */
63319
63320#include <locale.h>
63321#include <string.h>
63322/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
63323   <wchar.h>.
63324   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
63325   included before <wchar.h>.  */
63326#include <stddef.h>
63327#include <stdio.h>
63328#include <time.h>
63329#include <wchar.h>
63330int main ()
63331{
63332  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
63333    {
63334      wchar_t wc;
63335
63336      if (mbtowc (&wc, "\374", 1) == 1)
63337        if (wctob (wc) != (unsigned char) '\374')
63338          return 1;
63339    }
63340  return 0;
63341}
63342_ACEOF
63343if ac_fn_c_try_run "$LINENO"; then :
63344  gl_cv_func_wctob_works=yes
63345else
63346  gl_cv_func_wctob_works=no
63347fi
63348rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
63349  conftest.$ac_objext conftest.beam conftest.$ac_ext
63350fi
63351
63352        fi
63353
63354fi
63355{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5
63356$as_echo "$gl_cv_func_wctob_works" >&6; }
63357    case "$gl_cv_func_wctob_works" in
63358      *yes) ;;
63359      *) REPLACE_WCTOB=1 ;;
63360    esac
63361    if test $REPLACE_WCTOB = 0; then
63362
63363            ac_fn_c_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" "
63364/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
63365   <wchar.h>.
63366   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
63367   before <wchar.h>.  */
63368#include <stddef.h>
63369#include <stdio.h>
63370#include <time.h>
63371#include <wchar.h>
63372
63373"
63374if test "x$ac_cv_have_decl_wctob" = xyes; then :
63375  ac_have_decl=1
63376else
63377  ac_have_decl=0
63378fi
63379
63380cat >>confdefs.h <<_ACEOF
63381#define HAVE_DECL_WCTOB $ac_have_decl
63382_ACEOF
63383
63384      if test $ac_cv_have_decl_wctob != yes; then
63385        HAVE_DECL_WCTOB=0
63386      fi
63387    fi
63388  fi
63389
63390  if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then
63391
63392
63393
63394
63395
63396
63397
63398
63399  gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext"
63400
63401
63402  :
63403
63404  fi
63405
63406
63407
63408
63409
63410    if test "$GNULIB_WCTOB" != 1; then
63411        if test "$GNULIB_WCTOB" = 0; then
63412      GNULIB_WCTOB=$gl_module_indicator_condition
63413    else
63414      GNULIB_WCTOB="($GNULIB_WCTOB || $gl_module_indicator_condition)"
63415    fi
63416  fi
63417
63418
63419
63420
63421
63422$as_echo "#define GNULIB_TEST_WCTOB 1" >>confdefs.h
63423
63424
63425
63426
63427
63428
63429  if false; then
63430    REPLACE_WCTOMB=1
63431  fi
63432
63433  if test $REPLACE_WCTOMB = 1; then
63434
63435
63436
63437
63438
63439
63440
63441
63442  gltests_LIBOBJS="$gltests_LIBOBJS wctomb.$ac_objext"
63443
63444
63445  :
63446
63447  fi
63448
63449
63450
63451
63452
63453    if test "$GNULIB_WCTOMB" != 1; then
63454        if test "$GNULIB_WCTOMB" = 0; then
63455      GNULIB_WCTOMB=$gl_module_indicator_condition
63456    else
63457      GNULIB_WCTOMB="($GNULIB_WCTOMB || $gl_module_indicator_condition)"
63458    fi
63459  fi
63460
63461
63462
63463
63464
63465$as_echo "#define GNULIB_TEST_WCTOMB 1" >>confdefs.h
63466
63467
63468
63469
63470
63471    YIELD_LIB=
63472  if test $gl_threads_api = posix; then
63473        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
63474$as_echo_n "checking for sched_yield in -lrt... " >&6; }
63475if ${ac_cv_lib_rt_sched_yield+:} false; then :
63476  $as_echo_n "(cached) " >&6
63477else
63478  ac_check_lib_save_LIBS=$LIBS
63479LIBS="-lrt  $LIBS"
63480cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63481/* end confdefs.h.  */
63482
63483/* Override any GCC internal prototype to avoid an error.
63484   Use char because int might match the return type of a GCC
63485   builtin and then its argument prototype would still apply.  */
63486#ifdef __cplusplus
63487extern "C"
63488#endif
63489char sched_yield ();
63490int
63491main ()
63492{
63493return sched_yield ();
63494  ;
63495  return 0;
63496}
63497_ACEOF
63498if ac_fn_c_try_link "$LINENO"; then :
63499  ac_cv_lib_rt_sched_yield=yes
63500else
63501  ac_cv_lib_rt_sched_yield=no
63502fi
63503rm -f core conftest.err conftest.$ac_objext \
63504    conftest$ac_exeext conftest.$ac_ext
63505LIBS=$ac_check_lib_save_LIBS
63506fi
63507{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
63508$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
63509if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
63510  YIELD_LIB=-lrt
63511else
63512         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
63513$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
63514if ${ac_cv_lib_posix4_sched_yield+:} false; then :
63515  $as_echo_n "(cached) " >&6
63516else
63517  ac_check_lib_save_LIBS=$LIBS
63518LIBS="-lposix4  $LIBS"
63519cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63520/* end confdefs.h.  */
63521
63522/* Override any GCC internal prototype to avoid an error.
63523   Use char because int might match the return type of a GCC
63524   builtin and then its argument prototype would still apply.  */
63525#ifdef __cplusplus
63526extern "C"
63527#endif
63528char sched_yield ();
63529int
63530main ()
63531{
63532return sched_yield ();
63533  ;
63534  return 0;
63535}
63536_ACEOF
63537if ac_fn_c_try_link "$LINENO"; then :
63538  ac_cv_lib_posix4_sched_yield=yes
63539else
63540  ac_cv_lib_posix4_sched_yield=no
63541fi
63542rm -f core conftest.err conftest.$ac_objext \
63543    conftest$ac_exeext conftest.$ac_ext
63544LIBS=$ac_check_lib_save_LIBS
63545fi
63546{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
63547$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
63548if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
63549  YIELD_LIB=-lposix4
63550fi
63551
63552fi
63553
63554  fi
63555
63556
63557
63558
63559
63560
63561
63562
63563
63564
63565
63566
63567  LIBCOREUTILS_LIBDEPS="$gl_libdeps"
63568
63569  LIBCOREUTILS_LTLIBDEPS="$gl_ltlibdeps"
63570
63571  LIBTESTS_LIBDEPS="$gltests_libdeps"
63572
63573
63574{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
63575$as_echo_n "checking for library containing strerror... " >&6; }
63576if ${ac_cv_search_strerror+:} false; then :
63577  $as_echo_n "(cached) " >&6
63578else
63579  ac_func_search_save_LIBS=$LIBS
63580cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63581/* end confdefs.h.  */
63582
63583/* Override any GCC internal prototype to avoid an error.
63584   Use char because int might match the return type of a GCC
63585   builtin and then its argument prototype would still apply.  */
63586#ifdef __cplusplus
63587extern "C"
63588#endif
63589char strerror ();
63590int
63591main ()
63592{
63593return strerror ();
63594  ;
63595  return 0;
63596}
63597_ACEOF
63598for ac_lib in '' cposix; do
63599  if test -z "$ac_lib"; then
63600    ac_res="none required"
63601  else
63602    ac_res=-l$ac_lib
63603    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
63604  fi
63605  if ac_fn_c_try_link "$LINENO"; then :
63606  ac_cv_search_strerror=$ac_res
63607fi
63608rm -f core conftest.err conftest.$ac_objext \
63609    conftest$ac_exeext
63610  if ${ac_cv_search_strerror+:} false; then :
63611  break
63612fi
63613done
63614if ${ac_cv_search_strerror+:} false; then :
63615
63616else
63617  ac_cv_search_strerror=no
63618fi
63619rm conftest.$ac_ext
63620LIBS=$ac_func_search_save_LIBS
63621fi
63622{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
63623$as_echo "$ac_cv_search_strerror" >&6; }
63624ac_res=$ac_cv_search_strerror
63625if test "$ac_res" != no; then :
63626  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
63627
63628fi
63629
63630{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
63631$as_echo_n "checking for working volatile... " >&6; }
63632if ${ac_cv_c_volatile+:} false; then :
63633  $as_echo_n "(cached) " >&6
63634else
63635  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63636/* end confdefs.h.  */
63637
63638int
63639main ()
63640{
63641
63642volatile int x;
63643int * volatile y = (int *) 0;
63644return !x && !y;
63645  ;
63646  return 0;
63647}
63648_ACEOF
63649if ac_fn_c_try_compile "$LINENO"; then :
63650  ac_cv_c_volatile=yes
63651else
63652  ac_cv_c_volatile=no
63653fi
63654rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63655fi
63656{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5
63657$as_echo "$ac_cv_c_volatile" >&6; }
63658if test $ac_cv_c_volatile = no; then
63659
63660$as_echo "#define volatile /**/" >>confdefs.h
63661
63662fi
63663
63664
63665
63666
63667
63668
63669
63670
63671
63672
63673
63674
63675
63676
63677
63678
63679
63680
63681
63682  for ac_header in sys/sysctl.h
63683do :
63684  ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default
63685     #if HAVE_SYS_PARAM_H
63686       #include <sys/param.h>
63687      #endif
63688"
63689if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
63690  cat >>confdefs.h <<_ACEOF
63691#define HAVE_SYS_SYSCTL_H 1
63692_ACEOF
63693
63694fi
63695
63696done
63697
63698
63699{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
63700$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
63701if ${ac_cv_header_time+:} false; then :
63702  $as_echo_n "(cached) " >&6
63703else
63704  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63705/* end confdefs.h.  */
63706#include <sys/types.h>
63707#include <sys/time.h>
63708#include <time.h>
63709
63710int
63711main ()
63712{
63713if ((struct tm *) 0)
63714return 0;
63715  ;
63716  return 0;
63717}
63718_ACEOF
63719if ac_fn_c_try_compile "$LINENO"; then :
63720  ac_cv_header_time=yes
63721else
63722  ac_cv_header_time=no
63723fi
63724rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63725fi
63726{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
63727$as_echo "$ac_cv_header_time" >&6; }
63728if test $ac_cv_header_time = yes; then
63729
63730$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
63731
63732fi
63733
63734
63735
63736ac_fn_c_check_decl "$LINENO" "geteuid" "ac_cv_have_decl_geteuid" "$ac_includes_default"
63737if test "x$ac_cv_have_decl_geteuid" = xyes; then :
63738  ac_have_decl=1
63739else
63740  ac_have_decl=0
63741fi
63742
63743cat >>confdefs.h <<_ACEOF
63744#define HAVE_DECL_GETEUID $ac_have_decl
63745_ACEOF
63746
63747ac_fn_c_check_decl "$LINENO" "getuid" "ac_cv_have_decl_getuid" "$ac_includes_default"
63748if test "x$ac_cv_have_decl_getuid" = xyes; then :
63749  ac_have_decl=1
63750else
63751  ac_have_decl=0
63752fi
63753
63754cat >>confdefs.h <<_ACEOF
63755#define HAVE_DECL_GETUID $ac_have_decl
63756_ACEOF
63757
63758
63759
63760
63761
63762  headers='
63763#include <sys/types.h>
63764
63765#include <unistd.h>
63766
63767#if HAVE_GRP_H
63768# include <grp.h>
63769#endif
63770
63771#if HAVE_PWD_H
63772# include <pwd.h>
63773#endif
63774'
63775  ac_fn_c_check_decl "$LINENO" "getgrgid" "ac_cv_have_decl_getgrgid" "$headers
63776"
63777if test "x$ac_cv_have_decl_getgrgid" = xyes; then :
63778  ac_have_decl=1
63779else
63780  ac_have_decl=0
63781fi
63782
63783cat >>confdefs.h <<_ACEOF
63784#define HAVE_DECL_GETGRGID $ac_have_decl
63785_ACEOF
63786ac_fn_c_check_decl "$LINENO" "getpwuid" "ac_cv_have_decl_getpwuid" "$headers
63787"
63788if test "x$ac_cv_have_decl_getpwuid" = xyes; then :
63789  ac_have_decl=1
63790else
63791  ac_have_decl=0
63792fi
63793
63794cat >>confdefs.h <<_ACEOF
63795#define HAVE_DECL_GETPWUID $ac_have_decl
63796_ACEOF
63797ac_fn_c_check_decl "$LINENO" "ttyname" "ac_cv_have_decl_ttyname" "$headers
63798"
63799if test "x$ac_cv_have_decl_ttyname" = xyes; then :
63800  ac_have_decl=1
63801else
63802  ac_have_decl=0
63803fi
63804
63805cat >>confdefs.h <<_ACEOF
63806#define HAVE_DECL_TTYNAME $ac_have_decl
63807_ACEOF
63808
63809
63810
63811
63812
63813
63814
63815
63816  ac_fn_c_check_decl "$LINENO" "setregid" "ac_cv_have_decl_setregid" "$ac_includes_default"
63817if test "x$ac_cv_have_decl_setregid" = xyes; then :
63818  ac_have_decl=1
63819else
63820  ac_have_decl=0
63821fi
63822
63823cat >>confdefs.h <<_ACEOF
63824#define HAVE_DECL_SETREGID $ac_have_decl
63825_ACEOF
63826
63827
63828$as_echo "#define PREFER_NONREENTRANT_EUIDACCESS 1" >>confdefs.h
63829
63830
63831
63832  # Check whether --enable-xattr was given.
63833if test "${enable_xattr+set}" = set; then :
63834  enableval=$enable_xattr; use_xattr=$enableval
63835else
63836  use_xattr=yes
63837fi
63838
63839
63840  LIB_XATTR=
63841
63842
63843  if test "$use_xattr" = "yes"; then
63844    for ac_header in attr/error_context.h attr/libattr.h
63845do :
63846  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
63847ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
63848if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
63849  cat >>confdefs.h <<_ACEOF
63850#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
63851_ACEOF
63852
63853fi
63854
63855done
63856
63857    use_xattr=no
63858    if test $ac_cv_header_attr_libattr_h = yes \
63859        && test $ac_cv_header_attr_error_context_h = yes; then
63860      xattr_saved_LIBS=$LIBS
63861      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing attr_copy_file" >&5
63862$as_echo_n "checking for library containing attr_copy_file... " >&6; }
63863if ${ac_cv_search_attr_copy_file+:} false; then :
63864  $as_echo_n "(cached) " >&6
63865else
63866  ac_func_search_save_LIBS=$LIBS
63867cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63868/* end confdefs.h.  */
63869
63870/* Override any GCC internal prototype to avoid an error.
63871   Use char because int might match the return type of a GCC
63872   builtin and then its argument prototype would still apply.  */
63873#ifdef __cplusplus
63874extern "C"
63875#endif
63876char attr_copy_file ();
63877int
63878main ()
63879{
63880return attr_copy_file ();
63881  ;
63882  return 0;
63883}
63884_ACEOF
63885for ac_lib in '' attr; do
63886  if test -z "$ac_lib"; then
63887    ac_res="none required"
63888  else
63889    ac_res=-l$ac_lib
63890    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
63891  fi
63892  if ac_fn_c_try_link "$LINENO"; then :
63893  ac_cv_search_attr_copy_file=$ac_res
63894fi
63895rm -f core conftest.err conftest.$ac_objext \
63896    conftest$ac_exeext
63897  if ${ac_cv_search_attr_copy_file+:} false; then :
63898  break
63899fi
63900done
63901if ${ac_cv_search_attr_copy_file+:} false; then :
63902
63903else
63904  ac_cv_search_attr_copy_file=no
63905fi
63906rm conftest.$ac_ext
63907LIBS=$ac_func_search_save_LIBS
63908fi
63909{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_attr_copy_file" >&5
63910$as_echo "$ac_cv_search_attr_copy_file" >&6; }
63911ac_res=$ac_cv_search_attr_copy_file
63912if test "$ac_res" != no; then :
63913  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
63914  test "$ac_cv_search_attr_copy_file" = "none required" ||
63915                        LIB_XATTR=$ac_cv_search_attr_copy_file
63916fi
63917
63918      for ac_func in attr_copy_file
63919do :
63920  ac_fn_c_check_func "$LINENO" "attr_copy_file" "ac_cv_func_attr_copy_file"
63921if test "x$ac_cv_func_attr_copy_file" = xyes; then :
63922  cat >>confdefs.h <<_ACEOF
63923#define HAVE_ATTR_COPY_FILE 1
63924_ACEOF
63925
63926fi
63927done
63928
63929      LIBS=$xattr_saved_LIBS
63930      if test $ac_cv_func_attr_copy_file = yes; then
63931        use_xattr=yes
63932      fi
63933    fi
63934    if test $use_xattr = no; then
63935      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libattr development library was not found or not usable." >&5
63936$as_echo "$as_me: WARNING: libattr development library was not found or not usable." >&2;}
63937      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GNU coreutils will be built without xattr support." >&5
63938$as_echo "$as_me: WARNING: GNU coreutils will be built without xattr support." >&2;}
63939    fi
63940  fi
63941
63942cat >>confdefs.h <<_ACEOF
63943#define USE_XATTR `test $use_xattr != yes; echo $?`
63944_ACEOF
63945
63946
63947
63948  # gnulib settings.
63949
63950
63951  # We don't use c-stack.c.
63952  # AC_REQUIRE([gl_C_STACK])
63953
63954  # Invoke macros of modules that may migrate into gnulib.
63955  # There's no need to list gnulib modules here, since gnulib-tool
63956  # handles that; see ../bootstrap.conf.
63957
63958
63959
63960
63961
63962
63963
63964
63965
63966
63967
63968
63969
63970
63971
63972
63973
63974
63975
63976
63977
63978
63979
63980
63981
63982
63983
63984
63985
63986
63987
63988
63989
63990
63991
63992
63993
63994
63995
63996
63997
63998
63999HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"}
64000
64001
64002
64003
64004
64005
64006
64007
64008
64009
64010
64011  ac_fn_c_check_member "$LINENO" "struct stat" "st_author" "ac_cv_member_struct_stat_st_author" "$ac_includes_default
64012#include <sys/stat.h>
64013
64014"
64015if test "x$ac_cv_member_struct_stat_st_author" = xyes; then :
64016
64017cat >>confdefs.h <<_ACEOF
64018#define HAVE_STRUCT_STAT_ST_AUTHOR 1
64019_ACEOF
64020
64021
64022fi
64023
64024
64025
64026
64027
64028
64029
64030
64031
64032
64033  ac_fn_c_check_type "$LINENO" "ino_t" "ac_cv_type_ino_t" "$ac_includes_default"
64034if test "x$ac_cv_type_ino_t" = xyes; then :
64035
64036else
64037
64038cat >>confdefs.h <<_ACEOF
64039#define ino_t unsigned long int
64040_ACEOF
64041
64042fi
64043
64044
64045      ac_fn_c_check_type "$LINENO" "major_t" "ac_cv_type_major_t" "$ac_includes_default"
64046if test "x$ac_cv_type_major_t" = xyes; then :
64047
64048else
64049
64050cat >>confdefs.h <<_ACEOF
64051#define major_t unsigned int
64052_ACEOF
64053
64054fi
64055
64056  ac_fn_c_check_type "$LINENO" "minor_t" "ac_cv_type_minor_t" "$ac_includes_default"
64057if test "x$ac_cv_type_minor_t" = xyes; then :
64058
64059else
64060
64061cat >>confdefs.h <<_ACEOF
64062#define minor_t unsigned int
64063_ACEOF
64064
64065fi
64066
64067
64068
64069
64070
64071
64072
64073
64074
64075
64076
64077  # By default, argmatch should fail calling usage (EXIT_FAILURE).
64078
64079$as_echo "#define ARGMATCH_DIE usage (EXIT_FAILURE)" >>confdefs.h
64080
64081
64082$as_echo "#define ARGMATCH_DIE_DECL void usage (int _e)" >>confdefs.h
64083
64084
64085  # used by shred
64086
64087
64088  coreutils_saved_libs=$LIBS
64089    LIBS="$LIBS $LIB_SELINUX"
64090    # Used by selinux.c.
64091    for ac_func in mode_to_security_class
64092do :
64093  ac_fn_c_check_func "$LINENO" "mode_to_security_class" "ac_cv_func_mode_to_security_class"
64094if test "x$ac_cv_func_mode_to_security_class" = xyes; then :
64095  cat >>confdefs.h <<_ACEOF
64096#define HAVE_MODE_TO_SECURITY_CLASS 1
64097_ACEOF
64098
64099fi
64100done
64101
64102    # Used by install.c.
64103    for ac_func in matchpathcon_init_prefix
64104do :
64105  ac_fn_c_check_func "$LINENO" "matchpathcon_init_prefix" "ac_cv_func_matchpathcon_init_prefix"
64106if test "x$ac_cv_func_matchpathcon_init_prefix" = xyes; then :
64107  cat >>confdefs.h <<_ACEOF
64108#define HAVE_MATCHPATHCON_INIT_PREFIX 1
64109_ACEOF
64110
64111else
64112
64113      if test "$with_selinux" != no; then
64114        case "$ac_cv_search_setfilecon:$ac_cv_header_selinux_selinux_h" in
64115          no:*) # SELinux disabled
64116            ;;
64117          *:no) # SELinux disabled
64118            ;;
64119          *)
64120          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SELinux enabled, but matchpathcon_init_prefix not found" >&5
64121$as_echo "$as_me: WARNING: SELinux enabled, but matchpathcon_init_prefix not found" >&2;}
64122          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The install utility may run slowly" >&5
64123$as_echo "$as_me: WARNING: The install utility may run slowly" >&2;}
64124        esac
64125      fi
64126
64127fi
64128done
64129
64130  LIBS=$coreutils_saved_libs
64131
64132  # Used by sort.c.
64133
64134  # Used by timeout.c
64135
64136
64137  # Used by tail.c.
64138  for ac_func in inotify_init
64139do :
64140  ac_fn_c_check_func "$LINENO" "inotify_init" "ac_cv_func_inotify_init"
64141if test "x$ac_cv_func_inotify_init" = xyes; then :
64142  cat >>confdefs.h <<_ACEOF
64143#define HAVE_INOTIFY_INIT 1
64144_ACEOF
64145
64146$as_echo "#define HAVE_INOTIFY 1" >>confdefs.h
64147
64148fi
64149done
64150
64151
64152
64153
64154  # These checks are for Interix, to avoid its getgr* functions, in favor
64155  # of these replacements.  The replacement functions are much more efficient
64156  # because they do not query the domain controller for user information
64157  # when it is not needed.
64158
64159
64160
64161
64162
64163
64164
64165      test $ac_cv_header_sys_param_h = yes &&
64166  test $ac_cv_header_sys_mount_h = yes &&
64167  for ac_header in nfs/vfs.h
64168do :
64169  ac_fn_c_check_header_mongrel "$LINENO" "nfs/vfs.h" "ac_cv_header_nfs_vfs_h" "$ac_includes_default"
64170if test "x$ac_cv_header_nfs_vfs_h" = xyes; then :
64171  cat >>confdefs.h <<_ACEOF
64172#define HAVE_NFS_VFS_H 1
64173_ACEOF
64174 for ac_header in nfs/nfs_client.h
64175do :
64176  ac_fn_c_check_header_mongrel "$LINENO" "nfs/nfs_client.h" "ac_cv_header_nfs_nfs_client_h" "$ac_includes_default"
64177if test "x$ac_cv_header_nfs_nfs_client_h" = xyes; then :
64178  cat >>confdefs.h <<_ACEOF
64179#define HAVE_NFS_NFS_CLIENT_H 1
64180_ACEOF
64181
64182fi
64183
64184done
64185
64186fi
64187
64188done
64189
64190
64191  statvfs_includes="\
64192$ac_includes_default
64193#include <sys/statvfs.h>
64194"
64195  statfs_includes="\
64196$ac_includes_default
64197#if HAVE_SYS_VFS_H
64198# include <sys/vfs.h>
64199#elif HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
64200# include <sys/param.h>
64201# include <sys/mount.h>
64202# if HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
64203#  include <netinet/in.h>
64204#  include <nfs/nfs_clnt.h>
64205#  include <nfs/vfs.h>
64206# endif
64207#elif HAVE_OS_H
64208# include <fs_info.h>
64209#endif
64210"
64211      if case "$fu_cv_sys_stat_statvfs$fu_cv_sys_stat_statvfs64" in
64212       *yes*) ;; *) false;; esac &&
64213     { ac_fn_c_check_member "$LINENO" "struct statvfs" "f_basetype" "ac_cv_member_struct_statvfs_f_basetype" "$statvfs_includes
64214"
64215if test "x$ac_cv_member_struct_statvfs_f_basetype" = xyes; then :
64216
64217cat >>confdefs.h <<_ACEOF
64218#define HAVE_STRUCT_STATVFS_F_BASETYPE 1
64219_ACEOF
64220
64221
64222fi
64223
64224       test $ac_cv_member_struct_statvfs_f_basetype = yes ||
64225       { ac_fn_c_check_member "$LINENO" "struct statvfs" "f_fstypename" "ac_cv_member_struct_statvfs_f_fstypename" "$statvfs_includes
64226"
64227if test "x$ac_cv_member_struct_statvfs_f_fstypename" = xyes; then :
64228
64229cat >>confdefs.h <<_ACEOF
64230#define HAVE_STRUCT_STATVFS_F_FSTYPENAME 1
64231_ACEOF
64232
64233
64234fi
64235
64236         test $ac_cv_member_struct_statvfs_f_fstypename = yes ||
64237         { test $ac_cv_member_struct_statfs_f_fstypename != yes &&
64238           { ac_fn_c_check_member "$LINENO" "struct statvfs" "f_type" "ac_cv_member_struct_statvfs_f_type" "$statvfs_includes
64239"
64240if test "x$ac_cv_member_struct_statvfs_f_type" = xyes; then :
64241
64242cat >>confdefs.h <<_ACEOF
64243#define HAVE_STRUCT_STATVFS_F_TYPE 1
64244_ACEOF
64245
64246
64247fi
64248
64249             test $ac_cv_member_struct_statvfs_f_type = yes; }; }; }; }
64250  then
64251    ac_fn_c_check_member "$LINENO" "struct statvfs" "f_namemax" "ac_cv_member_struct_statvfs_f_namemax" "$statvfs_includes
64252"
64253if test "x$ac_cv_member_struct_statvfs_f_namemax" = xyes; then :
64254
64255cat >>confdefs.h <<_ACEOF
64256#define HAVE_STRUCT_STATVFS_F_NAMEMAX 1
64257_ACEOF
64258
64259
64260fi
64261
64262    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64263/* end confdefs.h.  */
64264$statvfs_includes
64265int
64266main ()
64267{
64268static statvfs s;
64269          return (s.s_fsid ^ 0) == 0;
64270  ;
64271  return 0;
64272}
64273_ACEOF
64274if ac_fn_c_try_compile "$LINENO"; then :
64275
64276$as_echo "#define STRUCT_STATVFS_F_FSID_IS_INTEGER 1" >>confdefs.h
64277
64278fi
64279rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64280  else
64281    ac_fn_c_check_member "$LINENO" "struct statfs" "f_namelen" "ac_cv_member_struct_statfs_f_namelen" "$statfs_includes
64282"
64283if test "x$ac_cv_member_struct_statfs_f_namelen" = xyes; then :
64284
64285cat >>confdefs.h <<_ACEOF
64286#define HAVE_STRUCT_STATFS_F_NAMELEN 1
64287_ACEOF
64288
64289
64290fi
64291ac_fn_c_check_member "$LINENO" "struct statfs" "f_namemax" "ac_cv_member_struct_statfs_f_namemax" "$statfs_includes
64292"
64293if test "x$ac_cv_member_struct_statfs_f_namemax" = xyes; then :
64294
64295cat >>confdefs.h <<_ACEOF
64296#define HAVE_STRUCT_STATFS_F_NAMEMAX 1
64297_ACEOF
64298
64299
64300fi
64301ac_fn_c_check_member "$LINENO" "struct statfs" "f_type" "ac_cv_member_struct_statfs_f_type" "$statfs_includes
64302"
64303if test "x$ac_cv_member_struct_statfs_f_type" = xyes; then :
64304
64305cat >>confdefs.h <<_ACEOF
64306#define HAVE_STRUCT_STATFS_F_TYPE 1
64307_ACEOF
64308
64309
64310fi
64311ac_fn_c_check_member "$LINENO" "struct statfs" "f_frsize" "ac_cv_member_struct_statfs_f_frsize" "$statfs_includes
64312"
64313if test "x$ac_cv_member_struct_statfs_f_frsize" = xyes; then :
64314
64315cat >>confdefs.h <<_ACEOF
64316#define HAVE_STRUCT_STATFS_F_FRSIZE 1
64317_ACEOF
64318
64319
64320fi
64321
64322    if test $ac_cv_header_OS_h != yes; then
64323      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64324/* end confdefs.h.  */
64325$statfs_includes
64326int
64327main ()
64328{
64329static statfs s;
64330            return (s.s_fsid ^ 0) == 0;
64331  ;
64332  return 0;
64333}
64334_ACEOF
64335if ac_fn_c_try_compile "$LINENO"; then :
64336
64337$as_echo "#define STRUCT_STATFS_F_FSID_IS_INTEGER 1" >>confdefs.h
64338
64339fi
64340rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64341    fi
64342  fi
64343
64344
64345  # for dd.c and shred.c
64346  #
64347  # Use fdatasync only if declared.  On MacOS X 10.7, fdatasync exists but
64348  # is not declared, and is ineffective.
64349  LIB_FDATASYNC=
64350
64351
64352  if test $ac_cv_have_decl_fdatasync = yes; then
64353    coreutils_saved_libs=$LIBS
64354    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5
64355$as_echo_n "checking for library containing fdatasync... " >&6; }
64356if ${ac_cv_search_fdatasync+:} false; then :
64357  $as_echo_n "(cached) " >&6
64358else
64359  ac_func_search_save_LIBS=$LIBS
64360cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64361/* end confdefs.h.  */
64362
64363/* Override any GCC internal prototype to avoid an error.
64364   Use char because int might match the return type of a GCC
64365   builtin and then its argument prototype would still apply.  */
64366#ifdef __cplusplus
64367extern "C"
64368#endif
64369char fdatasync ();
64370int
64371main ()
64372{
64373return fdatasync ();
64374  ;
64375  return 0;
64376}
64377_ACEOF
64378for ac_lib in '' rt posix4; do
64379  if test -z "$ac_lib"; then
64380    ac_res="none required"
64381  else
64382    ac_res=-l$ac_lib
64383    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
64384  fi
64385  if ac_fn_c_try_link "$LINENO"; then :
64386  ac_cv_search_fdatasync=$ac_res
64387fi
64388rm -f core conftest.err conftest.$ac_objext \
64389    conftest$ac_exeext
64390  if ${ac_cv_search_fdatasync+:} false; then :
64391  break
64392fi
64393done
64394if ${ac_cv_search_fdatasync+:} false; then :
64395
64396else
64397  ac_cv_search_fdatasync=no
64398fi
64399rm conftest.$ac_ext
64400LIBS=$ac_func_search_save_LIBS
64401fi
64402{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fdatasync" >&5
64403$as_echo "$ac_cv_search_fdatasync" >&6; }
64404ac_res=$ac_cv_search_fdatasync
64405if test "$ac_res" != no; then :
64406  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
64407  test "$ac_cv_search_fdatasync" = "none required" ||
64408                    LIB_FDATASYNC=$ac_cv_search_fdatasync
64409fi
64410
64411    for ac_func in fdatasync
64412do :
64413  ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync"
64414if test "x$ac_cv_func_fdatasync" = xyes; then :
64415  cat >>confdefs.h <<_ACEOF
64416#define HAVE_FDATASYNC 1
64417_ACEOF
64418
64419fi
64420done
64421
64422    LIBS=$coreutils_saved_libs
64423  fi
64424
64425  # Check whether libcap is usable -- for ls --color support
64426  LIB_CAP=
64427  # Check whether --enable-libcap was given.
64428if test "${enable_libcap+set}" = set; then :
64429  enableval=$enable_libcap;
64430fi
64431
64432  if test "X$enable_libcap" != "Xno"; then
64433    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cap_get_file in -lcap" >&5
64434$as_echo_n "checking for cap_get_file in -lcap... " >&6; }
64435if ${ac_cv_lib_cap_cap_get_file+:} false; then :
64436  $as_echo_n "(cached) " >&6
64437else
64438  ac_check_lib_save_LIBS=$LIBS
64439LIBS="-lcap  $LIBS"
64440cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64441/* end confdefs.h.  */
64442
64443/* Override any GCC internal prototype to avoid an error.
64444   Use char because int might match the return type of a GCC
64445   builtin and then its argument prototype would still apply.  */
64446#ifdef __cplusplus
64447extern "C"
64448#endif
64449char cap_get_file ();
64450int
64451main ()
64452{
64453return cap_get_file ();
64454  ;
64455  return 0;
64456}
64457_ACEOF
64458if ac_fn_c_try_link "$LINENO"; then :
64459  ac_cv_lib_cap_cap_get_file=yes
64460else
64461  ac_cv_lib_cap_cap_get_file=no
64462fi
64463rm -f core conftest.err conftest.$ac_objext \
64464    conftest$ac_exeext conftest.$ac_ext
64465LIBS=$ac_check_lib_save_LIBS
64466fi
64467{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_get_file" >&5
64468$as_echo "$ac_cv_lib_cap_cap_get_file" >&6; }
64469if test "x$ac_cv_lib_cap_cap_get_file" = xyes; then :
64470  ac_fn_c_check_header_mongrel "$LINENO" "sys/capability.h" "ac_cv_header_sys_capability_h" "$ac_includes_default"
64471if test "x$ac_cv_header_sys_capability_h" = xyes; then :
64472  LIB_CAP=-lcap
64473
64474$as_echo "#define HAVE_CAP 1" >>confdefs.h
64475
64476
64477fi
64478
64479
64480fi
64481
64482    if test "X$LIB_CAP" = "X"; then
64483      if test "X$enable_libcap" = "Xyes"; then
64484        as_fn_error $? "libcap library was not found or not usable" "$LINENO" 5
64485      else
64486        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcap library was not found or not usable." >&5
64487$as_echo "$as_me: WARNING: libcap library was not found or not usable." >&2;}
64488        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GNU coreutils will be built without capability support." >&5
64489$as_echo "$as_me: WARNING: GNU coreutils will be built without capability support." >&2;}
64490      fi
64491    fi
64492  else
64493    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcap support disabled by user" >&5
64494$as_echo "$as_me: WARNING: libcap support disabled by user" >&2;}
64495  fi
64496
64497
64498  # See if linking 'seq' requires -lm.
64499  # It does on nearly every system.  The single exception (so far) is
64500  # BeOS which has all the math functions in the normal runtime library
64501  # and doesn't have a separate math library.
64502
64503
64504  ac_seq_body='
64505     static double x, y;
64506     x = floor (x);
64507     x = rint (x);
64508     x = modf (x, &y);'
64509  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64510/* end confdefs.h.  */
64511#include <math.h>
64512int
64513main ()
64514{
64515$ac_seq_body
64516  ;
64517  return 0;
64518}
64519_ACEOF
64520if ac_fn_c_try_link "$LINENO"; then :
64521
64522else
64523  ac_seq_save_LIBS="$LIBS"
64524     LIBS="$LIBS -lm"
64525     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64526/* end confdefs.h.  */
64527#include <math.h>
64528int
64529main ()
64530{
64531$ac_seq_body
64532  ;
64533  return 0;
64534}
64535_ACEOF
64536if ac_fn_c_try_link "$LINENO"; then :
64537  SEQ_LIBM=-lm
64538fi
64539rm -f core conftest.err conftest.$ac_objext \
64540    conftest$ac_exeext conftest.$ac_ext
64541     LIBS="$ac_seq_save_LIBS"
64542
64543fi
64544rm -f core conftest.err conftest.$ac_objext \
64545    conftest$ac_exeext conftest.$ac_ext
64546
64547
64548  # See is fpsetprec() required to use extended double precision
64549  # This is needed on 32 bit FreeBSD to give accurate conversion of:
64550  # `numfmt 9223372036854775808`
64551  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64552/* end confdefs.h.  */
64553#include <ieeefp.h>
64554int
64555main ()
64556{
64557#ifdef __i386__
64558      fpsetprec(FP_PE);
64559     #else
64560     # error not required on 64 bit
64561     #endif
64562
64563  ;
64564  return 0;
64565}
64566_ACEOF
64567if ac_fn_c_try_link "$LINENO"; then :
64568  ac_have_fpsetprec=yes
64569else
64570  ac_have_fpsetprec=no
64571fi
64572rm -f core conftest.err conftest.$ac_objext \
64573    conftest$ac_exeext conftest.$ac_ext
64574  if test "$ac_have_fpsetprec" = "yes" ; then
64575
64576$as_echo "#define HAVE_FPSETPREC 1" >>confdefs.h
64577
64578  fi
64579
64580
64581
64582  # Accept configure options: --with-tty-group[=GROUP], --without-tty-group
64583  # You can determine the group of a TTY via 'stat --format %G /dev/tty'
64584  # Omitting this option is equivalent to using --without-tty-group.
64585
64586# Check whether --with-tty-group was given.
64587if test "${with_tty_group+set}" = set; then :
64588  withval=$with_tty_group; tty_group_name=$withval
64589else
64590  tty_group_name=no
64591fi
64592
64593
64594  if test "x$tty_group_name" != xno; then
64595    if test "x$tty_group_name" = xyes; then
64596      tty_group_name=tty
64597    fi
64598    { $as_echo "$as_me:${as_lineno-$LINENO}: TTY group used by system set to \"$tty_group_name\"" >&5
64599$as_echo "$as_me: TTY group used by system set to \"$tty_group_name\"" >&6;}
64600
64601cat >>confdefs.h <<_ACEOF
64602#define TTY_GROUP_NAME "$tty_group_name"
64603_ACEOF
64604
64605  fi
64606
64607
64608# The test suite needs to know if we have a working perl.
64609# FIXME: this is suboptimal.  Ideally, we would be able to call gl_PERL
64610# with an ACTION-IF-NOT-FOUND argument ...
64611cu_have_perl=yes
64612case $PERL in *"/missing "*) cu_have_perl=no;; esac
64613 if test $cu_have_perl = yes; then
64614  HAVE_PERL_TRUE=
64615  HAVE_PERL_FALSE='#'
64616else
64617  HAVE_PERL_TRUE='#'
64618  HAVE_PERL_FALSE=
64619fi
64620
64621
64622# gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])
64623# ------------------------------------------------
64624# If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND.
64625# Otherwise, run RUN-IF-NOT-FOUND.
64626
64627
64628# Check whether --enable-gcc-warnings was given.
64629if test "${enable_gcc_warnings+set}" = set; then :
64630  enableval=$enable_gcc_warnings; case $enableval in
64631     yes|no) ;;
64632     *)      as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;;
64633   esac
64634   gl_gcc_warnings=$enableval
64635else
64636
64637   # GCC provides fine-grained control over diagnostics which
64638   # is used in gnulib for example to suppress warnings from
64639   # certain sections of code.  So if this is available and
64640   # we're running from a git repo, then auto enable the warnings.
64641   gl_gcc_warnings=no
64642   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64643/* end confdefs.h.  */
64644
64645#if (4) < __GNUC__ || ((4) == __GNUC__ && (6) <= __GNUC_MINOR__)
64646/* ok */
64647#else
64648# error "your version of gcc is older than 4.6"
64649#endif
64650
64651int
64652main ()
64653{
64654
64655  ;
64656  return 0;
64657},
64658
64659_ACEOF
64660if ac_fn_c_try_cpp "$LINENO"; then :
64661  test -d "$srcdir"/.git \
64662                          && ! test -f "$srcdir"/.tarball-version \
64663                          && gl_gcc_warnings=yes
64664fi
64665rm -f conftest.err conftest.i conftest.$ac_ext
64666
64667
64668
64669fi
64670
64671
64672if test "$gl_gcc_warnings" = yes; then
64673
64674  ac_ext=c
64675ac_cpp='$CPP $CPPFLAGS'
64676ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
64677ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
64678ac_compiler_gnu=$ac_cv_c_compiler_gnu
64679
64680
64681{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5
64682$as_echo_n "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; }
64683if ${gl_cv_warn_c__Werror__Wunknown_warning_option+:} false; then :
64684  $as_echo_n "(cached) " >&6
64685else
64686
64687  gl_save_compiler_FLAGS="$CFLAGS"
64688  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option"
64689  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64690/* end confdefs.h.  */
64691
64692int
64693main ()
64694{
64695
64696  ;
64697  return 0;
64698}
64699_ACEOF
64700if ac_fn_c_try_link "$LINENO"; then :
64701  gl_cv_warn_c__Werror__Wunknown_warning_option=yes
64702else
64703  gl_cv_warn_c__Werror__Wunknown_warning_option=no
64704fi
64705rm -f core conftest.err conftest.$ac_objext \
64706    conftest$ac_exeext conftest.$ac_ext
64707  CFLAGS="$gl_save_compiler_FLAGS"
64708
64709fi
64710{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5
64711$as_echo "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; }
64712if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes; then :
64713  gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'
64714else
64715  gl_unknown_warnings_are_errors=
64716fi
64717
64718  ac_ext=c
64719ac_cpp='$CPP $CPPFLAGS'
64720ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
64721ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
64722ac_compiler_gnu=$ac_cv_c_compiler_gnu
64723
64724
64725
64726
64727{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5
64728$as_echo_n "checking whether C compiler handles -Werror... " >&6; }
64729if ${gl_cv_warn_c__Werror+:} false; then :
64730  $as_echo_n "(cached) " >&6
64731else
64732
64733  gl_save_compiler_FLAGS="$CFLAGS"
64734  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror"
64735  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64736/* end confdefs.h.  */
64737
64738int
64739main ()
64740{
64741
64742  ;
64743  return 0;
64744}
64745_ACEOF
64746if ac_fn_c_try_link "$LINENO"; then :
64747  gl_cv_warn_c__Werror=yes
64748else
64749  gl_cv_warn_c__Werror=no
64750fi
64751rm -f core conftest.err conftest.$ac_objext \
64752    conftest$ac_exeext conftest.$ac_ext
64753  CFLAGS="$gl_save_compiler_FLAGS"
64754
64755fi
64756{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5
64757$as_echo "$gl_cv_warn_c__Werror" >&6; }
64758if test "x$gl_cv_warn_c__Werror" = xyes; then :
64759  as_fn_append WERROR_CFLAGS " -Werror"
64760fi
64761
64762
64763
64764
64765  nw=
64766  # This, $nw, is the list of warnings we disable.
64767  nw="$nw -Wdeclaration-after-statement" # too useful to forbid
64768  nw="$nw -Waggregate-return"       # anachronistic
64769  nw="$nw -Wlong-long"              # C90 is anachronistic (lib/gethrxtime.h)
64770  nw="$nw -Wc++-compat"             # We don't care about C++ compilers
64771  nw="$nw -Wundef"                  # Warns on '#if GNULIB_FOO' etc in gnulib
64772  nw="$nw -Wtraditional"            # Warns on #elif which we use often
64773  nw="$nw -Wcast-qual"              # Too many warnings for now
64774  nw="$nw -Wconversion"             # Too many warnings for now
64775  nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
64776  nw="$nw -Wsign-conversion"        # Too many warnings for now
64777  nw="$nw -Wtraditional-conversion" # Too many warnings for now
64778  nw="$nw -Wunreachable-code"       # Too many warnings for now
64779  nw="$nw -Wpadded"                 # Our structs are not padded
64780  nw="$nw -Wredundant-decls"        # openat.h declares e.g., mkdirat
64781  nw="$nw -Wlogical-op"             # Too many warnings until GCC 4.8.0
64782  nw="$nw -Wformat-nonliteral"      # who.c and pinky.c strftime uses
64783  nw="$nw -Wvla"                    # warnings in gettext.h
64784  nw="$nw -Wnested-externs"         # use of XARGMATCH/verify_function__
64785  nw="$nw -Wswitch-enum"            # Too many warnings for now
64786  nw="$nw -Wswitch-default"         # Too many warnings for now
64787  nw="$nw -Wstack-protector"        # not worth working around
64788  nw="$nw -Wtype-limits"            # False alarms for portable code
64789  nw="$nw -Wformat-overflow=2"      # False alarms due to GCC bug 80776
64790  nw="$nw -Wformat-truncation=2"    # False alarm in ls.c, probably related
64791  # things I might fix soon:
64792  nw="$nw -Wfloat-equal"            # sort.c, seq.c
64793  nw="$nw -Wmissing-format-attribute" # copy.c
64794  nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c
64795  nw="$nw -Winline"                 # system.h's readdir_ignoring_dot_and_dotdot
64796  nw="$nw -Wsuggest-attribute=format" # warns about copy.c and factor.c
64797
64798  # Using -Wstrict-overflow is a pain, but the alternative is worse.
64799  # For an example, see the code that provoked this report:
64800  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33498
64801  # Code like that still infloops with gcc-4.6.0 and -O2.  Scary indeed.
64802
64803
64804  ac_ext=c
64805ac_cpp='$CPP $CPPFLAGS'
64806ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
64807ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
64808ac_compiler_gnu=$ac_cv_c_compiler_gnu
64809
64810
64811
64812  if test -n "$GCC"; then
64813
64814            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5
64815$as_echo_n "checking whether -Wno-missing-field-initializers is supported... " >&6; }
64816    if ${gl_cv_cc_nomfi_supported+:} false; then :
64817  $as_echo_n "(cached) " >&6
64818else
64819
64820      gl_save_CFLAGS="$CFLAGS"
64821      CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
64822      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64823/* end confdefs.h.  */
64824
64825int
64826main ()
64827{
64828
64829  ;
64830  return 0;
64831}
64832_ACEOF
64833if ac_fn_c_try_compile "$LINENO"; then :
64834  gl_cv_cc_nomfi_supported=yes
64835else
64836  gl_cv_cc_nomfi_supported=no
64837fi
64838rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64839      CFLAGS="$gl_save_CFLAGS"
64840fi
64841
64842    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5
64843$as_echo "$gl_cv_cc_nomfi_supported" >&6; }
64844
64845    if test "$gl_cv_cc_nomfi_supported" = yes; then
64846                  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5
64847$as_echo_n "checking whether -Wno-missing-field-initializers is needed... " >&6; }
64848      if ${gl_cv_cc_nomfi_needed+:} false; then :
64849  $as_echo_n "(cached) " >&6
64850else
64851
64852        gl_save_CFLAGS="$CFLAGS"
64853        CFLAGS="$CFLAGS -W -Werror"
64854        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64855/* end confdefs.h.  */
64856int f (void)
64857               {
64858                 typedef struct { int a; int b; } s_t;
64859                 s_t s1 = { 0, };
64860                 return s1.b;
64861               }
64862
64863int
64864main ()
64865{
64866
64867  ;
64868  return 0;
64869}
64870_ACEOF
64871if ac_fn_c_try_compile "$LINENO"; then :
64872  gl_cv_cc_nomfi_needed=no
64873else
64874  gl_cv_cc_nomfi_needed=yes
64875fi
64876rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64877        CFLAGS="$gl_save_CFLAGS"
64878
64879fi
64880
64881      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5
64882$as_echo "$gl_cv_cc_nomfi_needed" >&6; }
64883    fi
64884
64885                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5
64886$as_echo_n "checking whether -Wuninitialized is supported... " >&6; }
64887    if ${gl_cv_cc_uninitialized_supported+:} false; then :
64888  $as_echo_n "(cached) " >&6
64889else
64890
64891      gl_save_CFLAGS="$CFLAGS"
64892      CFLAGS="$CFLAGS -Werror -Wuninitialized"
64893      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64894/* end confdefs.h.  */
64895
64896int
64897main ()
64898{
64899
64900  ;
64901  return 0;
64902}
64903_ACEOF
64904if ac_fn_c_try_compile "$LINENO"; then :
64905  gl_cv_cc_uninitialized_supported=yes
64906else
64907  gl_cv_cc_uninitialized_supported=no
64908fi
64909rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64910      CFLAGS="$gl_save_CFLAGS"
64911fi
64912
64913    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5
64914$as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
64915
64916  fi
64917
64918  # List all gcc warning categories.
64919  # To compare this list to your installed GCC's, run this Bash command:
64920  #
64921  # comm -3 \
64922  #  <((sed -n 's/^  *\(-[^ 0-9][^ ]*\) .*/\1/p' manywarnings.m4; \
64923  #     awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec) | sort) \
64924  #  <(LC_ALL=C gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort)
64925
64926  gl_manywarn_set=
64927  for gl_manywarn_item in -fno-common \
64928    -W \
64929    -Waddress \
64930    -Waggressive-loop-optimizations \
64931    -Wall \
64932    -Wattribute-alias \
64933    -Wattributes \
64934    -Wbad-function-cast \
64935    -Wbool-compare \
64936    -Wbool-operation \
64937    -Wbuiltin-declaration-mismatch \
64938    -Wbuiltin-macro-redefined \
64939    -Wcast-align \
64940    -Wcast-align=strict \
64941    -Wcast-function-type \
64942    -Wchar-subscripts \
64943    -Wclobbered \
64944    -Wcomment \
64945    -Wcomments \
64946    -Wcoverage-mismatch \
64947    -Wcpp \
64948    -Wdangling-else \
64949    -Wdate-time \
64950    -Wdeprecated \
64951    -Wdeprecated-declarations \
64952    -Wdesignated-init \
64953    -Wdisabled-optimization \
64954    -Wdiscarded-array-qualifiers \
64955    -Wdiscarded-qualifiers \
64956    -Wdiv-by-zero \
64957    -Wdouble-promotion \
64958    -Wduplicated-branches \
64959    -Wduplicated-cond \
64960    -Wduplicate-decl-specifier \
64961    -Wempty-body \
64962    -Wendif-labels \
64963    -Wenum-compare \
64964    -Wexpansion-to-defined \
64965    -Wextra \
64966    -Wformat-contains-nul \
64967    -Wformat-extra-args \
64968    -Wformat-nonliteral \
64969    -Wformat-security \
64970    -Wformat-signedness \
64971    -Wformat-y2k \
64972    -Wformat-zero-length \
64973    -Wframe-address \
64974    -Wfree-nonheap-object \
64975    -Whsa \
64976    -Wif-not-aligned \
64977    -Wignored-attributes \
64978    -Wignored-qualifiers \
64979    -Wimplicit \
64980    -Wimplicit-function-declaration \
64981    -Wimplicit-int \
64982    -Wincompatible-pointer-types \
64983    -Winit-self \
64984    -Winline \
64985    -Wint-conversion \
64986    -Wint-in-bool-context \
64987    -Wint-to-pointer-cast \
64988    -Winvalid-memory-model \
64989    -Winvalid-pch \
64990    -Wlogical-not-parentheses \
64991    -Wlogical-op \
64992    -Wmain \
64993    -Wmaybe-uninitialized \
64994    -Wmemset-elt-size \
64995    -Wmemset-transposed-args \
64996    -Wmisleading-indentation \
64997    -Wmissing-attributes \
64998    -Wmissing-braces \
64999    -Wmissing-declarations \
65000    -Wmissing-field-initializers \
65001    -Wmissing-include-dirs \
65002    -Wmissing-parameter-type \
65003    -Wmissing-prototypes \
65004    -Wmultichar \
65005    -Wmultistatement-macros \
65006    -Wnarrowing \
65007    -Wnested-externs \
65008    -Wnonnull \
65009    -Wnonnull-compare \
65010    -Wnull-dereference \
65011    -Wodr \
65012    -Wold-style-declaration \
65013    -Wold-style-definition \
65014    -Wopenmp-simd \
65015    -Woverflow \
65016    -Woverlength-strings \
65017    -Woverride-init \
65018    -Wpacked \
65019    -Wpacked-bitfield-compat \
65020    -Wpacked-not-aligned \
65021    -Wparentheses \
65022    -Wpointer-arith \
65023    -Wpointer-compare \
65024    -Wpointer-sign \
65025    -Wpointer-to-int-cast \
65026    -Wpragmas \
65027    -Wpsabi \
65028    -Wrestrict \
65029    -Wreturn-local-addr \
65030    -Wreturn-type \
65031    -Wscalar-storage-order \
65032    -Wsequence-point \
65033    -Wshadow \
65034    -Wshift-count-negative \
65035    -Wshift-count-overflow \
65036    -Wshift-negative-value \
65037    -Wsizeof-array-argument \
65038    -Wsizeof-pointer-div \
65039    -Wsizeof-pointer-memaccess \
65040    -Wstack-protector \
65041    -Wstrict-aliasing \
65042    -Wstrict-overflow \
65043    -Wstrict-prototypes \
65044    -Wstringop-truncation \
65045    -Wsuggest-attribute=cold \
65046    -Wsuggest-attribute=const \
65047    -Wsuggest-attribute=format \
65048    -Wsuggest-attribute=malloc \
65049    -Wsuggest-attribute=noreturn \
65050    -Wsuggest-attribute=pure \
65051    -Wsuggest-final-methods \
65052    -Wsuggest-final-types \
65053    -Wswitch \
65054    -Wswitch-bool \
65055    -Wswitch-default \
65056    -Wswitch-unreachable \
65057    -Wsync-nand \
65058    -Wsystem-headers \
65059    -Wtautological-compare \
65060    -Wtrampolines \
65061    -Wtrigraphs \
65062    -Wtype-limits \
65063    -Wuninitialized \
65064    -Wunknown-pragmas \
65065    -Wunsafe-loop-optimizations \
65066    -Wunused \
65067    -Wunused-but-set-parameter \
65068    -Wunused-but-set-variable \
65069    -Wunused-function \
65070    -Wunused-label \
65071    -Wunused-local-typedefs \
65072    -Wunused-macros \
65073    -Wunused-parameter \
65074    -Wunused-result \
65075    -Wunused-value \
65076    -Wunused-variable \
65077    -Wvarargs \
65078    -Wvariadic-macros \
65079    -Wvector-operation-performance \
65080    -Wvla \
65081    -Wvolatile-register-var \
65082    -Wwrite-strings \
65083    \
65084    ; do
65085    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
65086  done
65087
65088  # gcc --help=warnings outputs an unusual form for these options; list
65089  # them here so that the above 'comm' command doesn't report a false match.
65090  # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal.
65091  # Also, AC_COMPUTE_INT requires it to fit in a long; it is 2**63 on
65092  # the only platforms where it does not fit in a long, so make that
65093  # a special case.
65094  { $as_echo "$as_me:${as_lineno-$LINENO}: checking max safe object size" >&5
65095$as_echo_n "checking max safe object size... " >&6; }
65096  if ac_fn_c_compute_int "$LINENO" "LONG_MAX < (PTRDIFF_MAX < (size_t) -1 ? PTRDIFF_MAX : (size_t) -1)
65097     ? -1
65098     : PTRDIFF_MAX < (size_t) -1 ? (long) PTRDIFF_MAX : (long) (size_t) -1" "gl_alloc_max"        "#include <limits.h>
65099      #include <stddef.h>
65100      #include <stdint.h>
65101    "; then :
65102
65103else
65104  gl_alloc_max=2147483647
65105fi
65106
65107  case $gl_alloc_max in
65108    -1) gl_alloc_max=9223372036854775807;;
65109  esac
65110  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_alloc_max" >&5
65111$as_echo "$gl_alloc_max" >&6; }
65112  gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$gl_alloc_max"
65113  gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
65114  gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2"
65115  gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2"
65116  gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5"
65117  gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
65118  gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2"
65119  gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2"
65120  gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2"
65121  gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031"
65122
65123  # These are needed for older GCC versions.
65124  if test -n "$GCC"; then
65125    case `($CC --version) 2>/dev/null` in
65126      'gcc (GCC) '[0-3].* | \
65127      'gcc (GCC) '4.[0-7].*)
65128        gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option"
65129        gl_manywarn_set="$gl_manywarn_set -funit-at-a-time"
65130          ;;
65131    esac
65132  fi
65133
65134  # Disable specific options as needed.
65135  if test "$gl_cv_cc_nomfi_needed" = yes; then
65136    gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
65137  fi
65138
65139  if test "$gl_cv_cc_uninitialized_supported" = no; then
65140    gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized"
65141  fi
65142
65143  ws=$gl_manywarn_set
65144
65145  ac_ext=c
65146ac_cpp='$CPP $CPPFLAGS'
65147ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
65148ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
65149ac_compiler_gnu=$ac_cv_c_compiler_gnu
65150
65151
65152
65153  gl_warn_set=
65154  set x $ws; shift
65155  for gl_warn_item
65156  do
65157    case " $nw " in
65158      *" $gl_warn_item "*)
65159        ;;
65160      *)
65161        gl_warn_set="$gl_warn_set $gl_warn_item"
65162        ;;
65163    esac
65164  done
65165  ws=$gl_warn_set
65166
65167  for w in $ws; do
65168
65169
65170as_gl_Warn=`$as_echo "gl_cv_warn_c_$w" | $as_tr_sh`
65171gl_positive="$w"
65172case $gl_positive in
65173  -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
65174esac
65175{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5
65176$as_echo_n "checking whether C compiler handles $w... " >&6; }
65177if eval \${$as_gl_Warn+:} false; then :
65178  $as_echo_n "(cached) " >&6
65179else
65180
65181  gl_save_compiler_FLAGS="$CFLAGS"
65182  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive"
65183  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65184/* end confdefs.h.  */
65185
65186int
65187main ()
65188{
65189
65190  ;
65191  return 0;
65192}
65193_ACEOF
65194if ac_fn_c_try_link "$LINENO"; then :
65195  eval "$as_gl_Warn=yes"
65196else
65197  eval "$as_gl_Warn=no"
65198fi
65199rm -f core conftest.err conftest.$ac_objext \
65200    conftest$ac_exeext conftest.$ac_ext
65201  CFLAGS="$gl_save_compiler_FLAGS"
65202
65203fi
65204eval ac_res=\$$as_gl_Warn
65205	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
65206$as_echo "$ac_res" >&6; }
65207if eval test \"x\$"$as_gl_Warn"\" = x"yes"; then :
65208  as_fn_append WARN_CFLAGS " $w"
65209fi
65210
65211
65212  done
65213
65214
65215{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-sign-compare" >&5
65216$as_echo_n "checking whether C compiler handles -Wno-sign-compare... " >&6; }
65217if ${gl_cv_warn_c__Wno_sign_compare+:} false; then :
65218  $as_echo_n "(cached) " >&6
65219else
65220
65221  gl_save_compiler_FLAGS="$CFLAGS"
65222  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare"
65223  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65224/* end confdefs.h.  */
65225
65226int
65227main ()
65228{
65229
65230  ;
65231  return 0;
65232}
65233_ACEOF
65234if ac_fn_c_try_link "$LINENO"; then :
65235  gl_cv_warn_c__Wno_sign_compare=yes
65236else
65237  gl_cv_warn_c__Wno_sign_compare=no
65238fi
65239rm -f core conftest.err conftest.$ac_objext \
65240    conftest$ac_exeext conftest.$ac_ext
65241  CFLAGS="$gl_save_compiler_FLAGS"
65242
65243fi
65244{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_sign_compare" >&5
65245$as_echo "$gl_cv_warn_c__Wno_sign_compare" >&6; }
65246if test "x$gl_cv_warn_c__Wno_sign_compare" = xyes; then :
65247  as_fn_append WARN_CFLAGS " -Wno-sign-compare"
65248fi
65249
65250     # Too many warnings for now
65251
65252
65253{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-type-limits" >&5
65254$as_echo_n "checking whether C compiler handles -Wno-type-limits... " >&6; }
65255if ${gl_cv_warn_c__Wno_type_limits+:} false; then :
65256  $as_echo_n "(cached) " >&6
65257else
65258
65259  gl_save_compiler_FLAGS="$CFLAGS"
65260  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wtype-limits"
65261  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65262/* end confdefs.h.  */
65263
65264int
65265main ()
65266{
65267
65268  ;
65269  return 0;
65270}
65271_ACEOF
65272if ac_fn_c_try_link "$LINENO"; then :
65273  gl_cv_warn_c__Wno_type_limits=yes
65274else
65275  gl_cv_warn_c__Wno_type_limits=no
65276fi
65277rm -f core conftest.err conftest.$ac_objext \
65278    conftest$ac_exeext conftest.$ac_ext
65279  CFLAGS="$gl_save_compiler_FLAGS"
65280
65281fi
65282{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_type_limits" >&5
65283$as_echo "$gl_cv_warn_c__Wno_type_limits" >&6; }
65284if test "x$gl_cv_warn_c__Wno_type_limits" = xyes; then :
65285  as_fn_append WARN_CFLAGS " -Wno-type-limits"
65286fi
65287
65288      # False alarms for portable code
65289
65290
65291{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-parameter" >&5
65292$as_echo_n "checking whether C compiler handles -Wno-unused-parameter... " >&6; }
65293if ${gl_cv_warn_c__Wno_unused_parameter+:} false; then :
65294  $as_echo_n "(cached) " >&6
65295else
65296
65297  gl_save_compiler_FLAGS="$CFLAGS"
65298  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wunused-parameter"
65299  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65300/* end confdefs.h.  */
65301
65302int
65303main ()
65304{
65305
65306  ;
65307  return 0;
65308}
65309_ACEOF
65310if ac_fn_c_try_link "$LINENO"; then :
65311  gl_cv_warn_c__Wno_unused_parameter=yes
65312else
65313  gl_cv_warn_c__Wno_unused_parameter=no
65314fi
65315rm -f core conftest.err conftest.$ac_objext \
65316    conftest$ac_exeext conftest.$ac_ext
65317  CFLAGS="$gl_save_compiler_FLAGS"
65318
65319fi
65320{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_parameter" >&5
65321$as_echo "$gl_cv_warn_c__Wno_unused_parameter" >&6; }
65322if test "x$gl_cv_warn_c__Wno_unused_parameter" = xyes; then :
65323  as_fn_append WARN_CFLAGS " -Wno-unused-parameter"
65324fi
65325
65326 # Too many warnings for now
65327
65328
65329{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5
65330$as_echo_n "checking whether C compiler handles -Wno-format-nonliteral... " >&6; }
65331if ${gl_cv_warn_c__Wno_format_nonliteral+:} false; then :
65332  $as_echo_n "(cached) " >&6
65333else
65334
65335  gl_save_compiler_FLAGS="$CFLAGS"
65336  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral"
65337  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65338/* end confdefs.h.  */
65339
65340int
65341main ()
65342{
65343
65344  ;
65345  return 0;
65346}
65347_ACEOF
65348if ac_fn_c_try_link "$LINENO"; then :
65349  gl_cv_warn_c__Wno_format_nonliteral=yes
65350else
65351  gl_cv_warn_c__Wno_format_nonliteral=no
65352fi
65353rm -f core conftest.err conftest.$ac_objext \
65354    conftest$ac_exeext conftest.$ac_ext
65355  CFLAGS="$gl_save_compiler_FLAGS"
65356
65357fi
65358{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5
65359$as_echo "$gl_cv_warn_c__Wno_format_nonliteral" >&6; }
65360if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes; then :
65361  as_fn_append WARN_CFLAGS " -Wno-format-nonliteral"
65362fi
65363
65364
65365
65366  # Enable this warning only with gcc-4.8 and newer.  Before that
65367  # bounds checking as done in truncate.c was incorrectly flagged.
65368  # See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43772
65369  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65370/* end confdefs.h.  */
65371
65372#if (4) < __GNUC__ || ((4) == __GNUC__ && (8) <= __GNUC_MINOR__)
65373/* ok */
65374#else
65375# error "your version of gcc is older than 4.8"
65376#endif
65377
65378int
65379main ()
65380{
65381
65382  ;
65383  return 0;
65384},
65385
65386_ACEOF
65387if ac_fn_c_try_cpp "$LINENO"; then :
65388
65389
65390{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wlogical-op" >&5
65391$as_echo_n "checking whether C compiler handles -Wlogical-op... " >&6; }
65392if ${gl_cv_warn_c__Wlogical_op+:} false; then :
65393  $as_echo_n "(cached) " >&6
65394else
65395
65396  gl_save_compiler_FLAGS="$CFLAGS"
65397  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op"
65398  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65399/* end confdefs.h.  */
65400
65401int
65402main ()
65403{
65404
65405  ;
65406  return 0;
65407}
65408_ACEOF
65409if ac_fn_c_try_link "$LINENO"; then :
65410  gl_cv_warn_c__Wlogical_op=yes
65411else
65412  gl_cv_warn_c__Wlogical_op=no
65413fi
65414rm -f core conftest.err conftest.$ac_objext \
65415    conftest$ac_exeext conftest.$ac_ext
65416  CFLAGS="$gl_save_compiler_FLAGS"
65417
65418fi
65419{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wlogical_op" >&5
65420$as_echo "$gl_cv_warn_c__Wlogical_op" >&6; }
65421if test "x$gl_cv_warn_c__Wlogical_op" = xyes; then :
65422  as_fn_append WARN_CFLAGS " -Wlogical-op"
65423fi
65424
65425
65426fi
65427rm -f conftest.err conftest.i conftest.$ac_ext
65428
65429
65430
65431  # clang is unduly picky about some things.
65432  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
65433$as_echo_n "checking whether the compiler is clang... " >&6; }
65434if ${utils_cv_clang+:} false; then :
65435  $as_echo_n "(cached) " >&6
65436else
65437  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65438/* end confdefs.h.  */
65439
65440            #ifndef __clang__
65441              #error "not clang"
65442            #endif
65443
65444int
65445main ()
65446{
65447
65448  ;
65449  return 0;
65450}
65451_ACEOF
65452if ac_fn_c_try_compile "$LINENO"; then :
65453  utils_cv_clang=yes
65454else
65455  utils_cv_clang=no
65456fi
65457rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
65458fi
65459{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $utils_cv_clang" >&5
65460$as_echo "$utils_cv_clang" >&6; }
65461  if test $utils_cv_clang = yes; then
65462
65463
65464{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-extra-args" >&5
65465$as_echo_n "checking whether C compiler handles -Wno-format-extra-args... " >&6; }
65466if ${gl_cv_warn_c__Wno_format_extra_args+:} false; then :
65467  $as_echo_n "(cached) " >&6
65468else
65469
65470  gl_save_compiler_FLAGS="$CFLAGS"
65471  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-extra-args"
65472  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65473/* end confdefs.h.  */
65474
65475int
65476main ()
65477{
65478
65479  ;
65480  return 0;
65481}
65482_ACEOF
65483if ac_fn_c_try_link "$LINENO"; then :
65484  gl_cv_warn_c__Wno_format_extra_args=yes
65485else
65486  gl_cv_warn_c__Wno_format_extra_args=no
65487fi
65488rm -f core conftest.err conftest.$ac_objext \
65489    conftest$ac_exeext conftest.$ac_ext
65490  CFLAGS="$gl_save_compiler_FLAGS"
65491
65492fi
65493{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_extra_args" >&5
65494$as_echo "$gl_cv_warn_c__Wno_format_extra_args" >&6; }
65495if test "x$gl_cv_warn_c__Wno_format_extra_args" = xyes; then :
65496  as_fn_append WARN_CFLAGS " -Wno-format-extra-args"
65497fi
65498
65499
65500
65501
65502{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-tautological-constant-out-of-range-compare" >&5
65503$as_echo_n "checking whether C compiler handles -Wno-tautological-constant-out-of-range-compare... " >&6; }
65504if ${gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare+:} false; then :
65505  $as_echo_n "(cached) " >&6
65506else
65507
65508  gl_save_compiler_FLAGS="$CFLAGS"
65509  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wtautological-constant-out-of-range-compare"
65510  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65511/* end confdefs.h.  */
65512
65513int
65514main ()
65515{
65516
65517  ;
65518  return 0;
65519}
65520_ACEOF
65521if ac_fn_c_try_link "$LINENO"; then :
65522  gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare=yes
65523else
65524  gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare=no
65525fi
65526rm -f core conftest.err conftest.$ac_objext \
65527    conftest$ac_exeext conftest.$ac_ext
65528  CFLAGS="$gl_save_compiler_FLAGS"
65529
65530fi
65531{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare" >&5
65532$as_echo "$gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare" >&6; }
65533if test "x$gl_cv_warn_c__Wno_tautological_constant_out_of_range_compare" = xyes; then :
65534  as_fn_append WARN_CFLAGS " -Wno-tautological-constant-out-of-range-compare"
65535fi
65536
65537
65538  fi
65539
65540
65541
65542{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fdiagnostics-show-option" >&5
65543$as_echo_n "checking whether C compiler handles -fdiagnostics-show-option... " >&6; }
65544if ${gl_cv_warn_c__fdiagnostics_show_option+:} false; then :
65545  $as_echo_n "(cached) " >&6
65546else
65547
65548  gl_save_compiler_FLAGS="$CFLAGS"
65549  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -fdiagnostics-show-option"
65550  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65551/* end confdefs.h.  */
65552
65553int
65554main ()
65555{
65556
65557  ;
65558  return 0;
65559}
65560_ACEOF
65561if ac_fn_c_try_link "$LINENO"; then :
65562  gl_cv_warn_c__fdiagnostics_show_option=yes
65563else
65564  gl_cv_warn_c__fdiagnostics_show_option=no
65565fi
65566rm -f core conftest.err conftest.$ac_objext \
65567    conftest$ac_exeext conftest.$ac_ext
65568  CFLAGS="$gl_save_compiler_FLAGS"
65569
65570fi
65571{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fdiagnostics_show_option" >&5
65572$as_echo "$gl_cv_warn_c__fdiagnostics_show_option" >&6; }
65573if test "x$gl_cv_warn_c__fdiagnostics_show_option" = xyes; then :
65574  as_fn_append WARN_CFLAGS " -fdiagnostics-show-option"
65575fi
65576
65577
65578
65579
65580{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -funit-at-a-time" >&5
65581$as_echo_n "checking whether C compiler handles -funit-at-a-time... " >&6; }
65582if ${gl_cv_warn_c__funit_at_a_time+:} false; then :
65583  $as_echo_n "(cached) " >&6
65584else
65585
65586  gl_save_compiler_FLAGS="$CFLAGS"
65587  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -funit-at-a-time"
65588  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65589/* end confdefs.h.  */
65590
65591int
65592main ()
65593{
65594
65595  ;
65596  return 0;
65597}
65598_ACEOF
65599if ac_fn_c_try_link "$LINENO"; then :
65600  gl_cv_warn_c__funit_at_a_time=yes
65601else
65602  gl_cv_warn_c__funit_at_a_time=no
65603fi
65604rm -f core conftest.err conftest.$ac_objext \
65605    conftest$ac_exeext conftest.$ac_ext
65606  CFLAGS="$gl_save_compiler_FLAGS"
65607
65608fi
65609{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__funit_at_a_time" >&5
65610$as_echo "$gl_cv_warn_c__funit_at_a_time" >&6; }
65611if test "x$gl_cv_warn_c__funit_at_a_time" = xyes; then :
65612  as_fn_append WARN_CFLAGS " -funit-at-a-time"
65613fi
65614
65615
65616
65617
65618
65619
65620$as_echo "#define lint 1" >>confdefs.h
65621
65622
65623
65624$as_echo "#define GNULIB_PORTCHECK 1" >>confdefs.h
65625
65626
65627  # We use a slightly smaller set of warning options for lib/.
65628  # Remove the following and save the result in GNULIB_WARN_CFLAGS.
65629  nw=
65630  nw="$nw -Wduplicated-branches"    # Too many false alarms
65631  nw="$nw -Wformat-truncation=2"
65632  nw="$nw -Wstrict-overflow"
65633  nw="$nw -Wuninitialized"
65634  nw="$nw -Wunused-macros"
65635  nw="$nw -Wmissing-prototypes"
65636  nw="$nw -Wold-style-definition"
65637  # FIXME: it may be easy to remove this, since it affects only one file:
65638  # the snprintf call at ftoastr.c:132.
65639  nw="$nw -Wdouble-promotion"
65640
65641  gl_warn_set=
65642  set x $WARN_CFLAGS; shift
65643  for gl_warn_item
65644  do
65645    case " $nw " in
65646      *" $gl_warn_item "*)
65647        ;;
65648      *)
65649        gl_warn_set="$gl_warn_set $gl_warn_item"
65650        ;;
65651    esac
65652  done
65653  GNULIB_WARN_CFLAGS=$gl_warn_set
65654
65655
65656
65657  # For gnulib-tests, the set is slightly smaller still.
65658  nw=
65659  nw="$nw -Wstrict-prototypes"
65660  # It's not worth being this picky about test programs.
65661  nw="$nw -Wsuggest-attribute=const"
65662  nw="$nw -Wsuggest-attribute=pure"
65663
65664  gl_warn_set=
65665  set x $GNULIB_WARN_CFLAGS; shift
65666  for gl_warn_item
65667  do
65668    case " $nw " in
65669      *" $gl_warn_item "*)
65670        ;;
65671      *)
65672        gl_warn_set="$gl_warn_set $gl_warn_item"
65673        ;;
65674    esac
65675  done
65676  GNULIB_TEST_WARN_CFLAGS=$gl_warn_set
65677
65678
65679fi
65680
65681# Check whether --enable-single-binary was given.
65682if test "${enable_single_binary+set}" = set; then :
65683  enableval=$enable_single_binary; gl_single_binary=no ;
65684   case $enableval in
65685     yes) gl_single_binary=shebangs ;;
65686     no|shebangs|symlinks) gl_single_binary=$enableval ;;
65687     *)      as_fn_error $? "bad value $enableval for single-binary option.
65688                           Options are: symlinks, shebangs, no." "$LINENO" 5 ;;
65689   esac
65690else
65691  gl_single_binary=no
65692
65693fi
65694
65695# Check whether --enable-single-binary-exceptions was given.
65696if test "${enable_single_binary_exceptions+set}" = set; then :
65697  enableval=$enable_single_binary_exceptions; gl_single_binary_exceptions=$enableval
65698else
65699  gl_single_binary_exceptions=
65700
65701fi
65702
65703if test "$gl_single_binary" = 'symlinks'; then
65704  if ! test "`echo ls | sed \"$program_transform_name\"`" = 'ls'; then
65705    as_fn_error $? "program name transformations are not currently supported
65706                  with --enable-single-binary=symlinks." "$LINENO" 5
65707  fi
65708fi
65709 if test "$gl_single_binary" != no; then
65710  SINGLE_BINARY_TRUE=
65711  SINGLE_BINARY_FALSE='#'
65712else
65713  SINGLE_BINARY_TRUE='#'
65714  SINGLE_BINARY_FALSE=
65715fi
65716
65717
65718for ac_header in vfork.h
65719do :
65720  ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
65721if test "x$ac_cv_header_vfork_h" = xyes; then :
65722  cat >>confdefs.h <<_ACEOF
65723#define HAVE_VFORK_H 1
65724_ACEOF
65725
65726fi
65727
65728done
65729
65730for ac_func in fork vfork
65731do :
65732  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
65733ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
65734if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
65735  cat >>confdefs.h <<_ACEOF
65736#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
65737_ACEOF
65738
65739fi
65740done
65741
65742if test "x$ac_cv_func_fork" = xyes; then
65743  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
65744$as_echo_n "checking for working fork... " >&6; }
65745if ${ac_cv_func_fork_works+:} false; then :
65746  $as_echo_n "(cached) " >&6
65747else
65748  if test "$cross_compiling" = yes; then :
65749  ac_cv_func_fork_works=cross
65750else
65751  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65752/* end confdefs.h.  */
65753$ac_includes_default
65754int
65755main ()
65756{
65757
65758	  /* By Ruediger Kuhlmann. */
65759	  return fork () < 0;
65760
65761  ;
65762  return 0;
65763}
65764_ACEOF
65765if ac_fn_c_try_run "$LINENO"; then :
65766  ac_cv_func_fork_works=yes
65767else
65768  ac_cv_func_fork_works=no
65769fi
65770rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
65771  conftest.$ac_objext conftest.beam conftest.$ac_ext
65772fi
65773
65774fi
65775{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
65776$as_echo "$ac_cv_func_fork_works" >&6; }
65777
65778else
65779  ac_cv_func_fork_works=$ac_cv_func_fork
65780fi
65781if test "x$ac_cv_func_fork_works" = xcross; then
65782  case $host in
65783    *-*-amigaos* | *-*-msdosdjgpp*)
65784      # Override, as these systems have only a dummy fork() stub
65785      ac_cv_func_fork_works=no
65786      ;;
65787    *)
65788      ac_cv_func_fork_works=yes
65789      ;;
65790  esac
65791  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
65792$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
65793fi
65794ac_cv_func_vfork_works=$ac_cv_func_vfork
65795if test "x$ac_cv_func_vfork" = xyes; then
65796  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
65797$as_echo_n "checking for working vfork... " >&6; }
65798if ${ac_cv_func_vfork_works+:} false; then :
65799  $as_echo_n "(cached) " >&6
65800else
65801  if test "$cross_compiling" = yes; then :
65802  ac_cv_func_vfork_works=cross
65803else
65804  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65805/* end confdefs.h.  */
65806/* Thanks to Paul Eggert for this test.  */
65807$ac_includes_default
65808#include <sys/wait.h>
65809#ifdef HAVE_VFORK_H
65810# include <vfork.h>
65811#endif
65812/* On some sparc systems, changes by the child to local and incoming
65813   argument registers are propagated back to the parent.  The compiler
65814   is told about this with #include <vfork.h>, but some compilers
65815   (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
65816   static variable whose address is put into a register that is
65817   clobbered by the vfork.  */
65818static void
65819#ifdef __cplusplus
65820sparc_address_test (int arg)
65821# else
65822sparc_address_test (arg) int arg;
65823#endif
65824{
65825  static pid_t child;
65826  if (!child) {
65827    child = vfork ();
65828    if (child < 0) {
65829      perror ("vfork");
65830      _exit(2);
65831    }
65832    if (!child) {
65833      arg = getpid();
65834      write(-1, "", 0);
65835      _exit (arg);
65836    }
65837  }
65838}
65839
65840int
65841main ()
65842{
65843  pid_t parent = getpid ();
65844  pid_t child;
65845
65846  sparc_address_test (0);
65847
65848  child = vfork ();
65849
65850  if (child == 0) {
65851    /* Here is another test for sparc vfork register problems.  This
65852       test uses lots of local variables, at least as many local
65853       variables as main has allocated so far including compiler
65854       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
65855       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
65856       reuse the register of parent for one of the local variables,
65857       since it will think that parent can't possibly be used any more
65858       in this routine.  Assigning to the local variable will thus
65859       munge parent in the parent process.  */
65860    pid_t
65861      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
65862      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
65863    /* Convince the compiler that p..p7 are live; otherwise, it might
65864       use the same hardware register for all 8 local variables.  */
65865    if (p != p1 || p != p2 || p != p3 || p != p4
65866	|| p != p5 || p != p6 || p != p7)
65867      _exit(1);
65868
65869    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
65870       from child file descriptors.  If the child closes a descriptor
65871       before it execs or exits, this munges the parent's descriptor
65872       as well.  Test for this by closing stdout in the child.  */
65873    _exit(close(fileno(stdout)) != 0);
65874  } else {
65875    int status;
65876    struct stat st;
65877
65878    while (wait(&status) != child)
65879      ;
65880    return (
65881	 /* Was there some problem with vforking?  */
65882	 child < 0
65883
65884	 /* Did the child fail?  (This shouldn't happen.)  */
65885	 || status
65886
65887	 /* Did the vfork/compiler bug occur?  */
65888	 || parent != getpid()
65889
65890	 /* Did the file descriptor bug occur?  */
65891	 || fstat(fileno(stdout), &st) != 0
65892	 );
65893  }
65894}
65895_ACEOF
65896if ac_fn_c_try_run "$LINENO"; then :
65897  ac_cv_func_vfork_works=yes
65898else
65899  ac_cv_func_vfork_works=no
65900fi
65901rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
65902  conftest.$ac_objext conftest.beam conftest.$ac_ext
65903fi
65904
65905fi
65906{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
65907$as_echo "$ac_cv_func_vfork_works" >&6; }
65908
65909fi;
65910if test "x$ac_cv_func_fork_works" = xcross; then
65911  ac_cv_func_vfork_works=$ac_cv_func_vfork
65912  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
65913$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
65914fi
65915
65916if test "x$ac_cv_func_vfork_works" = xyes; then
65917
65918$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
65919
65920else
65921
65922$as_echo "#define vfork fork" >>confdefs.h
65923
65924fi
65925if test "x$ac_cv_func_fork_works" = xyes; then
65926
65927$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
65928
65929fi
65930
65931
65932optional_bin_progs=
65933for ac_func in chroot
65934do :
65935  ac_fn_c_check_func "$LINENO" "chroot" "ac_cv_func_chroot"
65936if test "x$ac_cv_func_chroot" = xyes; then :
65937  cat >>confdefs.h <<_ACEOF
65938#define HAVE_CHROOT 1
65939_ACEOF
65940 {
65941  if test -z "$optional_bin_progs"; then
65942    optional_bin_progs=chroot
65943  else
65944    optional_bin_progs="$optional_bin_progs chroot"
65945  fi
65946}
65947fi
65948done
65949
65950for ac_func in gethostid
65951do :
65952  ac_fn_c_check_func "$LINENO" "gethostid" "ac_cv_func_gethostid"
65953if test "x$ac_cv_func_gethostid" = xyes; then :
65954  cat >>confdefs.h <<_ACEOF
65955#define HAVE_GETHOSTID 1
65956_ACEOF
65957 {
65958  if test -z "$optional_bin_progs"; then
65959    optional_bin_progs=hostid
65960  else
65961    optional_bin_progs="$optional_bin_progs hostid"
65962  fi
65963}
65964fi
65965done
65966
65967for ac_func in sigsuspend
65968do :
65969  ac_fn_c_check_func "$LINENO" "sigsuspend" "ac_cv_func_sigsuspend"
65970if test "x$ac_cv_func_sigsuspend" = xyes; then :
65971  cat >>confdefs.h <<_ACEOF
65972#define HAVE_SIGSUSPEND 1
65973_ACEOF
65974 {
65975  if test -z "$optional_bin_progs"; then
65976    optional_bin_progs=timeout
65977  else
65978    optional_bin_progs="$optional_bin_progs timeout"
65979  fi
65980}
65981fi
65982done
65983
65984
65985
65986
65987   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of struct winsize requires sys/ptem.h" >&5
65988$as_echo_n "checking whether use of struct winsize requires sys/ptem.h... " >&6; }
65989if ${gl_cv_sys_struct_winsize_needs_sys_ptem_h+:} false; then :
65990  $as_echo_n "(cached) " >&6
65991else
65992  gl_cv_sys_struct_winsize_needs_sys_ptem_h=yes
65993      if test $ac_cv_sys_posix_termios = yes; then
65994        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65995/* end confdefs.h.  */
65996#include <termios.h>
65997int
65998main ()
65999{
66000struct winsize x;
66001            if (sizeof x > 0) return 0;
66002  ;
66003  return 0;
66004}
66005_ACEOF
66006if ac_fn_c_try_compile "$LINENO"; then :
66007  gl_cv_sys_struct_winsize_needs_sys_ptem_h=no
66008fi
66009rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
66010      fi
66011      if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
66012        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66013/* end confdefs.h.  */
66014#include <sys/ptem.h>
66015int
66016main ()
66017{
66018struct winsize x;
66019            if (sizeof x > 0) return 0;
66020  ;
66021  return 0;
66022}
66023_ACEOF
66024if ac_fn_c_try_compile "$LINENO"; then :
66025
66026else
66027  gl_cv_sys_struct_winsize_needs_sys_ptem_h=no
66028fi
66029rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
66030      fi
66031fi
66032{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&5
66033$as_echo "$gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&6; }
66034   if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
66035
66036$as_echo "#define WINSIZE_IN_PTEM 1" >>confdefs.h
66037
66038   fi
66039
66040
66041{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime caches TZ" >&5
66042$as_echo_n "checking whether localtime caches TZ... " >&6; }
66043if ${utils_cv_localtime_cache+:} false; then :
66044  $as_echo_n "(cached) " >&6
66045else
66046  if test x$ac_cv_func_tzset = xyes; then
66047if test "$cross_compiling" = yes; then :
66048  # If we have tzset, assume the worst when cross-compiling.
66049utils_cv_localtime_cache=yes
66050else
66051  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66052/* end confdefs.h.  */
66053#include <time.h>
66054#if STDC_HEADERS
66055# include <stdlib.h>
66056#endif
66057extern char **environ;
66058void unset_TZ (void)
66059{
66060  char **from, **to;
66061  for (to = from = environ; (*to = *from); from++)
66062    if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
66063      to++;
66064}
66065int main()
66066{
66067  time_t now = time ((time_t *) 0);
66068  int hour_GMT0, hour_unset;
66069  if (putenv ("TZ=GMT0") != 0)
66070    return 1;
66071  hour_GMT0 = localtime (&now)->tm_hour;
66072  unset_TZ ();
66073  hour_unset = localtime (&now)->tm_hour;
66074  if (putenv ("TZ=PST8") != 0)
66075    return 1;
66076  if (localtime (&now)->tm_hour == hour_GMT0)
66077    return 1;
66078  unset_TZ ();
66079  if (localtime (&now)->tm_hour != hour_unset)
66080    return 1;
66081  return 0;
66082}
66083_ACEOF
66084if ac_fn_c_try_run "$LINENO"; then :
66085  utils_cv_localtime_cache=no
66086else
66087  utils_cv_localtime_cache=yes
66088fi
66089rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
66090  conftest.$ac_objext conftest.beam conftest.$ac_ext
66091fi
66092
66093else
66094        # If we lack tzset, report that localtime does not cache TZ,
66095        # since we can't invalidate the cache if we don't have tzset.
66096        utils_cv_localtime_cache=no
66097fi
66098fi
66099{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $utils_cv_localtime_cache" >&5
66100$as_echo "$utils_cv_localtime_cache" >&6; }
66101if test $utils_cv_localtime_cache = yes; then
66102
66103$as_echo "#define LOCALTIME_CACHE 1" >>confdefs.h
66104
66105fi
66106
66107# Assume that if getattrat exists, it's compatible with Solaris 11.
66108for ac_func in getattrat
66109do :
66110  ac_fn_c_check_func "$LINENO" "getattrat" "ac_cv_func_getattrat"
66111if test "x$ac_cv_func_getattrat" = xyes; then :
66112  cat >>confdefs.h <<_ACEOF
66113#define HAVE_GETATTRAT 1
66114_ACEOF
66115
66116fi
66117done
66118
66119if test $ac_cv_func_getattrat = yes; then
66120  LIB_NVPAIR=-lnvpair
66121
66122fi
66123
66124# SCO-ODT-3.0 is reported to need -los to link programs using initgroups
66125for ac_func in initgroups
66126do :
66127  ac_fn_c_check_func "$LINENO" "initgroups" "ac_cv_func_initgroups"
66128if test "x$ac_cv_func_initgroups" = xyes; then :
66129  cat >>confdefs.h <<_ACEOF
66130#define HAVE_INITGROUPS 1
66131_ACEOF
66132
66133fi
66134done
66135
66136if test $ac_cv_func_initgroups = no; then
66137  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initgroups in -los" >&5
66138$as_echo_n "checking for initgroups in -los... " >&6; }
66139if ${ac_cv_lib_os_initgroups+:} false; then :
66140  $as_echo_n "(cached) " >&6
66141else
66142  ac_check_lib_save_LIBS=$LIBS
66143LIBS="-los  $LIBS"
66144cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66145/* end confdefs.h.  */
66146
66147/* Override any GCC internal prototype to avoid an error.
66148   Use char because int might match the return type of a GCC
66149   builtin and then its argument prototype would still apply.  */
66150#ifdef __cplusplus
66151extern "C"
66152#endif
66153char initgroups ();
66154int
66155main ()
66156{
66157return initgroups ();
66158  ;
66159  return 0;
66160}
66161_ACEOF
66162if ac_fn_c_try_link "$LINENO"; then :
66163  ac_cv_lib_os_initgroups=yes
66164else
66165  ac_cv_lib_os_initgroups=no
66166fi
66167rm -f core conftest.err conftest.$ac_objext \
66168    conftest$ac_exeext conftest.$ac_ext
66169LIBS=$ac_check_lib_save_LIBS
66170fi
66171{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_os_initgroups" >&5
66172$as_echo "$ac_cv_lib_os_initgroups" >&6; }
66173if test "x$ac_cv_lib_os_initgroups" = xyes; then :
66174  cat >>confdefs.h <<_ACEOF
66175#define HAVE_LIBOS 1
66176_ACEOF
66177
66178  LIBS="-los $LIBS"
66179
66180fi
66181
66182fi
66183
66184for ac_func in syslog
66185do :
66186  ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
66187if test "x$ac_cv_func_syslog" = xyes; then :
66188  cat >>confdefs.h <<_ACEOF
66189#define HAVE_SYSLOG 1
66190_ACEOF
66191
66192fi
66193done
66194
66195if test $ac_cv_func_syslog = no; then
66196  # syslog is not in the default libraries.  See if it's in some other.
66197  for lib in bsd socket inet; do
66198    as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_syslog" | $as_tr_sh`
66199{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for syslog in -l$lib" >&5
66200$as_echo_n "checking for syslog in -l$lib... " >&6; }
66201if eval \${$as_ac_Lib+:} false; then :
66202  $as_echo_n "(cached) " >&6
66203else
66204  ac_check_lib_save_LIBS=$LIBS
66205LIBS="-l$lib  $LIBS"
66206cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66207/* end confdefs.h.  */
66208
66209/* Override any GCC internal prototype to avoid an error.
66210   Use char because int might match the return type of a GCC
66211   builtin and then its argument prototype would still apply.  */
66212#ifdef __cplusplus
66213extern "C"
66214#endif
66215char syslog ();
66216int
66217main ()
66218{
66219return syslog ();
66220  ;
66221  return 0;
66222}
66223_ACEOF
66224if ac_fn_c_try_link "$LINENO"; then :
66225  eval "$as_ac_Lib=yes"
66226else
66227  eval "$as_ac_Lib=no"
66228fi
66229rm -f core conftest.err conftest.$ac_objext \
66230    conftest$ac_exeext conftest.$ac_ext
66231LIBS=$ac_check_lib_save_LIBS
66232fi
66233eval ac_res=\$$as_ac_Lib
66234	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
66235$as_echo "$ac_res" >&6; }
66236if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
66237
66238$as_echo "#define HAVE_SYSLOG 1" >>confdefs.h
66239
66240      LIBS="$LIBS -l$lib"; break
66241fi
66242
66243  done
66244fi
66245
66246{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 3-argument setpriority function" >&5
66247$as_echo_n "checking for 3-argument setpriority function... " >&6; }
66248if ${utils_cv_func_setpriority+:} false; then :
66249  $as_echo_n "(cached) " >&6
66250else
66251  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66252/* end confdefs.h.  */
66253#include <sys/time.h>
66254         #include <sys/resource.h>
66255
66256int
66257main ()
66258{
66259setpriority (0, 0, 0);
66260  ;
66261  return 0;
66262}
66263_ACEOF
66264if ac_fn_c_try_link "$LINENO"; then :
66265  utils_cv_func_setpriority=yes
66266else
66267  utils_cv_func_setpriority=no
66268fi
66269rm -f core conftest.err conftest.$ac_objext \
66270    conftest$ac_exeext conftest.$ac_ext
66271fi
66272{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $utils_cv_func_setpriority" >&5
66273$as_echo "$utils_cv_func_setpriority" >&6; }
66274if test $utils_cv_func_setpriority = no; then
66275  for ac_func in nice
66276do :
66277  ac_fn_c_check_func "$LINENO" "nice" "ac_cv_func_nice"
66278if test "x$ac_cv_func_nice" = xyes; then :
66279  cat >>confdefs.h <<_ACEOF
66280#define HAVE_NICE 1
66281_ACEOF
66282
66283fi
66284done
66285
66286fi
66287case $utils_cv_func_setpriority,$ac_cv_func_nice in
66288*yes*)
66289  {
66290  if test -z "$optional_bin_progs"; then
66291    optional_bin_progs=nice
66292  else
66293    optional_bin_progs="$optional_bin_progs nice"
66294  fi
66295}
66296esac
66297
66298
66299
66300
66301  if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
66302    {
66303  if test -z "$optional_bin_progs"; then
66304    optional_bin_progs=who
66305  else
66306    optional_bin_progs="$optional_bin_progs who"
66307  fi
66308}
66309    {
66310  if test -z "$optional_bin_progs"; then
66311    optional_bin_progs=users
66312  else
66313    optional_bin_progs="$optional_bin_progs users"
66314  fi
66315}
66316    {
66317  if test -z "$optional_bin_progs"; then
66318    optional_bin_progs=pinky
66319  else
66320    optional_bin_progs="$optional_bin_progs pinky"
66321  fi
66322}
66323  fi
66324
66325
66326{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ut_host in struct utmp" >&5
66327$as_echo_n "checking ut_host in struct utmp... " >&6; }
66328if ${su_cv_func_ut_host_in_utmp+:} false; then :
66329  $as_echo_n "(cached) " >&6
66330else
66331  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66332/* end confdefs.h.  */
66333#include <sys/types.h>
66334                                   #include <utmp.h>
66335                                   struct utmp ut;
66336                                   int s = sizeof ut.ut_host;
66337int
66338main ()
66339{
66340
66341  ;
66342  return 0;
66343}
66344_ACEOF
66345if ac_fn_c_try_link "$LINENO"; then :
66346  su_cv_func_ut_host_in_utmp=yes
66347else
66348  su_cv_func_ut_host_in_utmp=no
66349fi
66350rm -f core conftest.err conftest.$ac_objext \
66351    conftest$ac_exeext conftest.$ac_ext
66352fi
66353
66354{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $su_cv_func_ut_host_in_utmp" >&5
66355$as_echo "$su_cv_func_ut_host_in_utmp" >&6; }
66356if test $su_cv_func_ut_host_in_utmp = yes; then
66357  have_ut_host=1
66358
66359$as_echo "#define HAVE_UT_HOST 1" >>confdefs.h
66360
66361fi
66362
66363if test -z "$have_ut_host"; then
66364  { $as_echo "$as_me:${as_lineno-$LINENO}: checking ut_host in struct utmpx" >&5
66365$as_echo_n "checking ut_host in struct utmpx... " >&6; }
66366  if ${su_cv_func_ut_host_in_utmpx+:} false; then :
66367  $as_echo_n "(cached) " >&6
66368else
66369  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66370/* end confdefs.h.  */
66371#include <sys/types.h>
66372                                     #include <utmpx.h>
66373                                     struct utmpx ut;
66374                                     int s = sizeof ut.ut_host;
66375int
66376main ()
66377{
66378
66379  ;
66380  return 0;
66381}
66382_ACEOF
66383if ac_fn_c_try_link "$LINENO"; then :
66384  su_cv_func_ut_host_in_utmpx=yes
66385else
66386  su_cv_func_ut_host_in_utmpx=no
66387fi
66388rm -f core conftest.err conftest.$ac_objext \
66389    conftest$ac_exeext conftest.$ac_ext
66390fi
66391
66392  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $su_cv_func_ut_host_in_utmpx" >&5
66393$as_echo "$su_cv_func_ut_host_in_utmpx" >&6; }
66394  if test $su_cv_func_ut_host_in_utmpx = yes; then
66395
66396$as_echo "#define HAVE_UTMPX_H 1" >>confdefs.h
66397
66398
66399$as_echo "#define HAVE_UT_HOST 1" >>confdefs.h
66400
66401  fi
66402fi
66403
66404
66405  for ac_func in sysctl
66406do :
66407  ac_fn_c_check_func "$LINENO" "sysctl" "ac_cv_func_sysctl"
66408if test "x$ac_cv_func_sysctl" = xyes; then :
66409  cat >>confdefs.h <<_ACEOF
66410#define HAVE_SYSCTL 1
66411_ACEOF
66412
66413fi
66414done
66415
66416
66417  for ac_header in sys/sysctl.h
66418do :
66419  ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default
66420     #if HAVE_SYS_PARAM_H
66421       #include <sys/param.h>
66422      #endif
66423"
66424if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
66425  cat >>confdefs.h <<_ACEOF
66426#define HAVE_SYS_SYSCTL_H 1
66427_ACEOF
66428
66429fi
66430
66431done
66432
66433
66434  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can get the system boot time" >&5
66435$as_echo_n "checking whether we can get the system boot time... " >&6; }
66436if ${gnulib_cv_have_boot_time+:} false; then :
66437  $as_echo_n "(cached) " >&6
66438else
66439
66440      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66441/* end confdefs.h.  */
66442$ac_includes_default
66443#if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
66444# if HAVE_SYS_PARAM_H
66445#  include <sys/param.h> /* needed for OpenBSD 3.0 */
66446# endif
66447# include <sys/sysctl.h>
66448#endif
66449#if HAVE_UTMPX_H
66450# include <utmpx.h>
66451#elif HAVE_UTMP_H
66452# include <utmp.h>
66453#endif
66454#if HAVE_OS_H
66455# include <OS.h>
66456#endif
66457
66458int
66459main ()
66460{
66461
66462#if (defined BOOT_TIME                              \
66463     || (defined CTL_KERN && defined KERN_BOOTTIME) \
66464     || HAVE_OS_H)
66465/* your system *does* have the infrastructure to determine boot time */
66466#else
66467please_tell_us_how_to_determine_boot_time_on_your_system
66468#endif
66469
66470  ;
66471  return 0;
66472}
66473_ACEOF
66474if ac_fn_c_try_compile "$LINENO"; then :
66475  gnulib_cv_have_boot_time=yes
66476else
66477  gnulib_cv_have_boot_time=no
66478fi
66479rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
66480
66481fi
66482{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnulib_cv_have_boot_time" >&5
66483$as_echo "$gnulib_cv_have_boot_time" >&6; }
66484  if test $gnulib_cv_have_boot_time = yes; then :
66485  {
66486  if test -z "$optional_bin_progs"; then
66487    optional_bin_progs=uptime
66488  else
66489    optional_bin_progs="$optional_bin_progs uptime"
66490  fi
66491}
66492fi
66493
66494
66495{ $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX termios" >&5
66496$as_echo_n "checking POSIX termios... " >&6; }
66497if ${ac_cv_sys_posix_termios+:} false; then :
66498  $as_echo_n "(cached) " >&6
66499else
66500  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66501/* end confdefs.h.  */
66502#include <sys/types.h>
66503#include <unistd.h>
66504#include <termios.h>
66505
66506int
66507main ()
66508{
66509/* SunOS 4.0.3 has termios.h but not the library calls.  */
66510   tcgetattr(0, 0);
66511  ;
66512  return 0;
66513}
66514_ACEOF
66515if ac_fn_c_try_link "$LINENO"; then :
66516  ac_cv_sys_posix_termios=yes
66517else
66518  ac_cv_sys_posix_termios=no
66519fi
66520rm -f core conftest.err conftest.$ac_objext \
66521    conftest$ac_exeext conftest.$ac_ext
66522fi
66523{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_posix_termios" >&5
66524$as_echo "$ac_cv_sys_posix_termios" >&6; }
66525
66526
66527 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
66528$as_echo_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h... " >&6; }
66529if ${gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h+:} false; then :
66530  $as_echo_n "(cached) " >&6
66531else
66532  gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
66533
66534   if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no; then
66535     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66536/* end confdefs.h.  */
66537#include <sys/types.h>
66538#        include <sys/ioctl.h>
66539#        ifdef TIOCGWINSZ
66540           yes
66541#        endif
66542
66543_ACEOF
66544if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
66545  $EGREP "yes" >/dev/null 2>&1; then :
66546  gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
66547fi
66548rm -f conftest*
66549
66550   fi
66551
66552fi
66553{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&5
66554$as_echo "$gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&6; }
66555  if test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
66556
66557$as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h
66558
66559  fi
66560
66561
66562if test $ac_cv_sys_posix_termios = yes; then
66563  {
66564  if test -z "$optional_bin_progs"; then
66565    optional_bin_progs=stty
66566  else
66567    optional_bin_progs="$optional_bin_progs stty"
66568  fi
66569}
66570
66571  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termios.h needs _XOPEN_SOURCE" >&5
66572$as_echo_n "checking whether termios.h needs _XOPEN_SOURCE... " >&6; }
66573  if ${su_cv_sys_termios_needs_xopen_source+:} false; then :
66574  $as_echo_n "(cached) " >&6
66575else
66576  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66577/* end confdefs.h.  */
66578#include <termios.h>
66579#ifdef IUCLC
66580yes
66581#endif
66582_ACEOF
66583if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
66584  $EGREP "yes" >/dev/null 2>&1; then :
66585  su_cv_sys_termios_needs_xopen_source=no
66586else
66587  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66588/* end confdefs.h.  */
66589#define _XOPEN_SOURCE
66590#include <termios.h>
66591#ifdef IUCLC
66592yes
66593#endif
66594_ACEOF
66595if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
66596  $EGREP "yes" >/dev/null 2>&1; then :
66597  su_cv_sys_termios_needs_xopen_source=yes
66598else
66599  su_cv_sys_termios_needs_xopen_source=no
66600fi
66601rm -f conftest*
66602
66603fi
66604rm -f conftest*
66605
66606fi
66607
66608  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $su_cv_sys_termios_needs_xopen_source" >&5
66609$as_echo "$su_cv_sys_termios_needs_xopen_source" >&6; }
66610  test $su_cv_sys_termios_needs_xopen_source = yes &&
66611
66612$as_echo "#define TERMIOS_NEEDS_XOPEN_SOURCE 1" >>confdefs.h
66613
66614
66615  { $as_echo "$as_me:${as_lineno-$LINENO}: checking c_line in struct termios" >&5
66616$as_echo_n "checking c_line in struct termios... " >&6; }
66617  if ${su_cv_sys_c_line_in_termios+:} false; then :
66618  $as_echo_n "(cached) " >&6
66619else
66620  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66621/* end confdefs.h.  */
66622#if TERMIOS_NEEDS_XOPEN_SOURCE
66623                                      #define _XOPEN_SOURCE
66624                                     #endif
66625                                     #include <sys/types.h>
66626                                     #include <termios.h>
66627                                     struct termios t;
66628                                     int s = sizeof t.c_line;
66629int
66630main ()
66631{
66632
66633  ;
66634  return 0;
66635}
66636_ACEOF
66637if ac_fn_c_try_link "$LINENO"; then :
66638  su_cv_sys_c_line_in_termios=yes
66639else
66640  su_cv_sys_c_line_in_termios=no
66641fi
66642rm -f core conftest.err conftest.$ac_objext \
66643    conftest$ac_exeext conftest.$ac_ext
66644fi
66645
66646  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $su_cv_sys_c_line_in_termios" >&5
66647$as_echo "$su_cv_sys_c_line_in_termios" >&6; }
66648  test $su_cv_sys_c_line_in_termios = yes \
66649    &&
66650$as_echo "#define HAVE_C_LINE 1" >>confdefs.h
66651
66652fi
66653
66654# FIXME: note that this macro appears above, too.
66655# I'm leaving it here for now.  This whole thing needs to be modernized...
66656
66657
66658   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of struct winsize requires sys/ptem.h" >&5
66659$as_echo_n "checking whether use of struct winsize requires sys/ptem.h... " >&6; }
66660if ${gl_cv_sys_struct_winsize_needs_sys_ptem_h+:} false; then :
66661  $as_echo_n "(cached) " >&6
66662else
66663  gl_cv_sys_struct_winsize_needs_sys_ptem_h=yes
66664      if test $ac_cv_sys_posix_termios = yes; then
66665        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66666/* end confdefs.h.  */
66667#include <termios.h>
66668int
66669main ()
66670{
66671struct winsize x;
66672            if (sizeof x > 0) return 0;
66673  ;
66674  return 0;
66675}
66676_ACEOF
66677if ac_fn_c_try_compile "$LINENO"; then :
66678  gl_cv_sys_struct_winsize_needs_sys_ptem_h=no
66679fi
66680rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
66681      fi
66682      if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
66683        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66684/* end confdefs.h.  */
66685#include <sys/ptem.h>
66686int
66687main ()
66688{
66689struct winsize x;
66690            if (sizeof x > 0) return 0;
66691  ;
66692  return 0;
66693}
66694_ACEOF
66695if ac_fn_c_try_compile "$LINENO"; then :
66696
66697else
66698  gl_cv_sys_struct_winsize_needs_sys_ptem_h=no
66699fi
66700rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
66701      fi
66702fi
66703{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&5
66704$as_echo "$gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&6; }
66705   if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
66706
66707$as_echo "#define WINSIZE_IN_PTEM 1" >>confdefs.h
66708
66709   fi
66710
66711
66712
66713 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of TIOCGWINSZ requires termios.h" >&5
66714$as_echo_n "checking whether use of TIOCGWINSZ requires termios.h... " >&6; }
66715if ${gl_cv_sys_tiocgwinsz_needs_termios_h+:} false; then :
66716  $as_echo_n "(cached) " >&6
66717else
66718  gl_cv_sys_tiocgwinsz_needs_termios_h=no
66719
66720   if test $ac_cv_sys_posix_termios = yes; then
66721     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66722/* end confdefs.h.  */
66723#include <sys/types.h>
66724#      include <termios.h>
66725#      ifdef TIOCGWINSZ
66726         yes
66727#      endif
66728
66729_ACEOF
66730if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
66731  $EGREP "yes" >/dev/null 2>&1; then :
66732  gl_cv_sys_tiocgwinsz_needs_termios_h=yes
66733fi
66734rm -f conftest*
66735
66736   fi
66737
66738fi
66739{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_tiocgwinsz_needs_termios_h" >&5
66740$as_echo "$gl_cv_sys_tiocgwinsz_needs_termios_h" >&6; }
66741
66742
66743if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \
66744   test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then
66745  { $as_echo "$as_me:${as_lineno-$LINENO}: checking TIOCGWINSZ in sys/pty.h" >&5
66746$as_echo_n "checking TIOCGWINSZ in sys/pty.h... " >&6; }
66747  if ${su_cv_sys_tiocgwinsz_in_sys_pty_h+:} false; then :
66748  $as_echo_n "(cached) " >&6
66749else
66750  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66751/* end confdefs.h.  */
66752#include <sys/types.h>
66753#ifdef WINSIZE_IN_PTEM
66754# include <sys/stream.h>
66755# include <sys/ptem.h>
66756#endif
66757#include <sys/ioctl.h>
66758#include <sys/tty.h>
66759#include <sys/pty.h>
66760int
66761main ()
66762{
66763int x = TIOCGWINSZ;
66764  ;
66765  return 0;
66766}
66767_ACEOF
66768if ac_fn_c_try_link "$LINENO"; then :
66769  su_cv_sys_tiocgwinsz_in_sys_pty_h=yes
66770else
66771  su_cv_sys_tiocgwinsz_in_sys_pty_h=no
66772fi
66773rm -f core conftest.err conftest.$ac_objext \
66774    conftest$ac_exeext conftest.$ac_ext
66775fi
66776
66777  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $su_cv_sys_tiocgwinsz_in_sys_pty_h" >&5
66778$as_echo "$su_cv_sys_tiocgwinsz_in_sys_pty_h" >&6; }
66779
66780  test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \
66781      &&
66782$as_echo "#define GWINSZ_IN_SYS_PTY 1" >>confdefs.h
66783
66784fi
66785
66786# For src/kill.c.
66787ac_fn_c_check_decl "$LINENO" "strsignal" "ac_cv_have_decl_strsignal" "$ac_includes_default
66788#include <signal.h>
66789"
66790if test "x$ac_cv_have_decl_strsignal" = xyes; then :
66791  ac_have_decl=1
66792else
66793  ac_have_decl=0
66794fi
66795
66796cat >>confdefs.h <<_ACEOF
66797#define HAVE_DECL_STRSIGNAL $ac_have_decl
66798_ACEOF
66799ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "$ac_includes_default
66800#include <signal.h>
66801"
66802if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
66803  ac_have_decl=1
66804else
66805  ac_have_decl=0
66806fi
66807
66808cat >>confdefs.h <<_ACEOF
66809#define HAVE_DECL_SYS_SIGLIST $ac_have_decl
66810_ACEOF
66811ac_fn_c_check_decl "$LINENO" "_sys_siglist" "ac_cv_have_decl__sys_siglist" "$ac_includes_default
66812#include <signal.h>
66813"
66814if test "x$ac_cv_have_decl__sys_siglist" = xyes; then :
66815  ac_have_decl=1
66816else
66817  ac_have_decl=0
66818fi
66819
66820cat >>confdefs.h <<_ACEOF
66821#define HAVE_DECL__SYS_SIGLIST $ac_have_decl
66822_ACEOF
66823ac_fn_c_check_decl "$LINENO" "__sys_siglist" "ac_cv_have_decl___sys_siglist" "$ac_includes_default
66824#include <signal.h>
66825"
66826if test "x$ac_cv_have_decl___sys_siglist" = xyes; then :
66827  ac_have_decl=1
66828else
66829  ac_have_decl=0
66830fi
66831
66832cat >>confdefs.h <<_ACEOF
66833#define HAVE_DECL___SYS_SIGLIST $ac_have_decl
66834_ACEOF
66835
66836
66837
66838
66839
66840  LIB_GMP=
66841
66842
66843
66844# Check whether --with-gmp was given.
66845if test "${with_gmp+set}" = set; then :
66846  withval=$with_gmp; cu_use_gmp=$withval
66847else
66848  cu_use_gmp=auto
66849fi
66850
66851
66852  if test $cu_use_gmp != no; then
66853            HAVE_GMP=0
66854
66855    if test $ac_cv_header_gmp_h = yes; then
66856      cu_saved_libs=$LIBS
66857      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing __gmpz_init" >&5
66858$as_echo_n "checking for library containing __gmpz_init... " >&6; }
66859if ${ac_cv_search___gmpz_init+:} false; then :
66860  $as_echo_n "(cached) " >&6
66861else
66862  ac_func_search_save_LIBS=$LIBS
66863cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66864/* end confdefs.h.  */
66865
66866/* Override any GCC internal prototype to avoid an error.
66867   Use char because int might match the return type of a GCC
66868   builtin and then its argument prototype would still apply.  */
66869#ifdef __cplusplus
66870extern "C"
66871#endif
66872char __gmpz_init ();
66873int
66874main ()
66875{
66876return __gmpz_init ();
66877  ;
66878  return 0;
66879}
66880_ACEOF
66881for ac_lib in '' gmp; do
66882  if test -z "$ac_lib"; then
66883    ac_res="none required"
66884  else
66885    ac_res=-l$ac_lib
66886    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
66887  fi
66888  if ac_fn_c_try_link "$LINENO"; then :
66889  ac_cv_search___gmpz_init=$ac_res
66890fi
66891rm -f core conftest.err conftest.$ac_objext \
66892    conftest$ac_exeext
66893  if ${ac_cv_search___gmpz_init+:} false; then :
66894  break
66895fi
66896done
66897if ${ac_cv_search___gmpz_init+:} false; then :
66898
66899else
66900  ac_cv_search___gmpz_init=no
66901fi
66902rm conftest.$ac_ext
66903LIBS=$ac_func_search_save_LIBS
66904fi
66905{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search___gmpz_init" >&5
66906$as_echo "$ac_cv_search___gmpz_init" >&6; }
66907ac_res=$ac_cv_search___gmpz_init
66908if test "$ac_res" != no; then :
66909  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
66910  test "$ac_cv_search___gmpz_init" = "none required" ||
66911           LIB_GMP=$ac_cv_search___gmpz_init
66912
66913$as_echo "#define HAVE_GMP 1" >>confdefs.h
66914
66915         HAVE_GMP=1
66916         # This only available in GMP >= 5
66917         ac_fn_c_check_decl "$LINENO" "mpz_inits" "ac_cv_have_decl_mpz_inits" "#include <gmp.h>
66918"
66919if test "x$ac_cv_have_decl_mpz_inits" = xyes; then :
66920  ac_have_decl=1
66921else
66922  ac_have_decl=0
66923fi
66924
66925cat >>confdefs.h <<_ACEOF
66926#define HAVE_DECL_MPZ_INITS $ac_have_decl
66927_ACEOF
66928
66929
66930fi
66931
66932      LIBS=$cu_saved_libs
66933    fi
66934    if test $HAVE_GMP != 1; then
66935     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libgmp development library was not found or not usable." >&5
66936$as_echo "$as_me: WARNING: libgmp development library was not found or not usable." >&2;}
66937     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GNU coreutils will be built without GMP support." >&5
66938$as_echo "$as_me: WARNING: GNU coreutils will be built without GMP support." >&2;}
66939    fi
66940  fi
66941
66942
66943# Build df only if there's a point to it.
66944if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
66945  {
66946  if test -z "$optional_bin_progs"; then
66947    optional_bin_progs=df
66948  else
66949    optional_bin_progs="$optional_bin_progs df"
66950  fi
66951}
66952fi
66953
66954# Build stdbuf only if supported
66955ac_save_CFLAGS=$CFLAGS
66956ac_save_LDFLAGS=$LDFLAGS
66957# Detect warnings about ignored "constructor" attributes.
66958
66959
66960{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5
66961$as_echo_n "checking whether C compiler handles -Werror... " >&6; }
66962if ${gl_cv_warn_c__Werror+:} false; then :
66963  $as_echo_n "(cached) " >&6
66964else
66965
66966  gl_save_compiler_FLAGS="$CFLAGS"
66967  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror"
66968  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66969/* end confdefs.h.  */
66970
66971int
66972main ()
66973{
66974
66975  ;
66976  return 0;
66977}
66978_ACEOF
66979if ac_fn_c_try_link "$LINENO"; then :
66980  gl_cv_warn_c__Werror=yes
66981else
66982  gl_cv_warn_c__Werror=no
66983fi
66984rm -f core conftest.err conftest.$ac_objext \
66985    conftest$ac_exeext conftest.$ac_ext
66986  CFLAGS="$gl_save_compiler_FLAGS"
66987
66988fi
66989{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5
66990$as_echo "$gl_cv_warn_c__Werror" >&6; }
66991if test "x$gl_cv_warn_c__Werror" = xyes; then :
66992  as_fn_append CFLAGS " -Werror"
66993fi
66994
66995
66996
66997
66998{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -errwarn" >&5
66999$as_echo_n "checking whether C compiler handles -errwarn... " >&6; }
67000if ${gl_cv_warn_c__errwarn+:} false; then :
67001  $as_echo_n "(cached) " >&6
67002else
67003
67004  gl_save_compiler_FLAGS="$CFLAGS"
67005  as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -errwarn"
67006  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
67007/* end confdefs.h.  */
67008
67009int
67010main ()
67011{
67012
67013  ;
67014  return 0;
67015}
67016_ACEOF
67017if ac_fn_c_try_link "$LINENO"; then :
67018  gl_cv_warn_c__errwarn=yes
67019else
67020  gl_cv_warn_c__errwarn=no
67021fi
67022rm -f core conftest.err conftest.$ac_objext \
67023    conftest$ac_exeext conftest.$ac_ext
67024  CFLAGS="$gl_save_compiler_FLAGS"
67025
67026fi
67027{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__errwarn" >&5
67028$as_echo "$gl_cv_warn_c__errwarn" >&6; }
67029if test "x$gl_cv_warn_c__errwarn" = xyes; then :
67030  as_fn_append CFLAGS " -errwarn"
67031fi
67032
67033
67034# Put this message here, after gl_WARN_ADD's chatter.
67035{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system supports stdbuf" >&5
67036$as_echo_n "checking whether this system supports stdbuf... " >&6; }
67037CFLAGS="-fPIC $CFLAGS"
67038LDFLAGS="-shared $LDFLAGS"
67039stdbuf_supported=no
67040# Note we only LINK here rather than RUN to support cross compilation
67041cat confdefs.h - <<_ACEOF >conftest.$ac_ext
67042/* end confdefs.h.  */
67043
67044    static int stdbuf = 0;
67045
67046    void __attribute__ ((constructor))
67047    stdbuf_init (void)
67048    {
67049      stdbuf = 1;
67050    }
67051int
67052main ()
67053{
67054
67055    if (stdbuf != 1)
67056      return 1;
67057  ;
67058  return 0;
67059}
67060
67061_ACEOF
67062if ac_fn_c_try_link "$LINENO"; then :
67063  stdbuf_supported=yes
67064fi
67065rm -f core conftest.err conftest.$ac_objext \
67066    conftest$ac_exeext conftest.$ac_ext
67067{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $stdbuf_supported" >&5
67068$as_echo "$stdbuf_supported" >&6; }
67069if test "$stdbuf_supported" = "yes" && test -z "$EXEEXT"; then
67070  {
67071  if test -z "$optional_bin_progs"; then
67072    optional_bin_progs=stdbuf
67073  else
67074    optional_bin_progs="$optional_bin_progs stdbuf"
67075  fi
67076}
67077fi
67078CFLAGS=$ac_save_CFLAGS
67079LDFLAGS=$ac_save_LDFLAGS
67080
67081# Detect when using xlc to determine whether to use -qinclude=
67082{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the system supports xlc include" >&5
67083$as_echo_n "checking whether the system supports xlc include... " >&6; }
67084if ${utils_cv_xlc+:} false; then :
67085  $as_echo_n "(cached) " >&6
67086else
67087  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
67088/* end confdefs.h.  */
67089
67090          #ifndef __xlc__
67091            #error "not xlc"
67092          #endif
67093
67094int
67095main ()
67096{
67097
67098  ;
67099  return 0;
67100}
67101_ACEOF
67102if ac_fn_c_try_compile "$LINENO"; then :
67103  utils_cv_xlc=yes
67104else
67105  utils_cv_xlc=no
67106fi
67107rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
67108fi
67109{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $utils_cv_xlc" >&5
67110$as_echo "$utils_cv_xlc" >&6; }
67111 if test "$utils_cv_xlc" = yes; then
67112  USE_XLC_INCLUDE_TRUE=
67113  USE_XLC_INCLUDE_FALSE='#'
67114else
67115  USE_XLC_INCLUDE_TRUE='#'
67116  USE_XLC_INCLUDE_FALSE=
67117fi
67118
67119
67120############################################################################
67121
67122{
67123  if test -z "$optional_bin_progs"; then
67124    optional_bin_progs=[
67125  else
67126    optional_bin_progs="$optional_bin_progs ["
67127  fi
67128}
67129{
67130  if test -z "$optional_bin_progs"; then
67131    optional_bin_progs=b2sum
67132  else
67133    optional_bin_progs="$optional_bin_progs b2sum"
67134  fi
67135}
67136{
67137  if test -z "$optional_bin_progs"; then
67138    optional_bin_progs=base64
67139  else
67140    optional_bin_progs="$optional_bin_progs base64"
67141  fi
67142}
67143{
67144  if test -z "$optional_bin_progs"; then
67145    optional_bin_progs=base32
67146  else
67147    optional_bin_progs="$optional_bin_progs base32"
67148  fi
67149}
67150{
67151  if test -z "$optional_bin_progs"; then
67152    optional_bin_progs=basename
67153  else
67154    optional_bin_progs="$optional_bin_progs basename"
67155  fi
67156}
67157{
67158  if test -z "$optional_bin_progs"; then
67159    optional_bin_progs=cat
67160  else
67161    optional_bin_progs="$optional_bin_progs cat"
67162  fi
67163}
67164{
67165  if test -z "$optional_bin_progs"; then
67166    optional_bin_progs=chcon
67167  else
67168    optional_bin_progs="$optional_bin_progs chcon"
67169  fi
67170}
67171{
67172  if test -z "$optional_bin_progs"; then
67173    optional_bin_progs=chgrp
67174  else
67175    optional_bin_progs="$optional_bin_progs chgrp"
67176  fi
67177}
67178{
67179  if test -z "$optional_bin_progs"; then
67180    optional_bin_progs=chmod
67181  else
67182    optional_bin_progs="$optional_bin_progs chmod"
67183  fi
67184}
67185{
67186  if test -z "$optional_bin_progs"; then
67187    optional_bin_progs=chown
67188  else
67189    optional_bin_progs="$optional_bin_progs chown"
67190  fi
67191}
67192{
67193  if test -z "$optional_bin_progs"; then
67194    optional_bin_progs=cksum
67195  else
67196    optional_bin_progs="$optional_bin_progs cksum"
67197  fi
67198}
67199{
67200  if test -z "$optional_bin_progs"; then
67201    optional_bin_progs=comm
67202  else
67203    optional_bin_progs="$optional_bin_progs comm"
67204  fi
67205}
67206{
67207  if test -z "$optional_bin_progs"; then
67208    optional_bin_progs=cp
67209  else
67210    optional_bin_progs="$optional_bin_progs cp"
67211  fi
67212}
67213{
67214  if test -z "$optional_bin_progs"; then
67215    optional_bin_progs=csplit
67216  else
67217    optional_bin_progs="$optional_bin_progs csplit"
67218  fi
67219}
67220{
67221  if test -z "$optional_bin_progs"; then
67222    optional_bin_progs=cut
67223  else
67224    optional_bin_progs="$optional_bin_progs cut"
67225  fi
67226}
67227{
67228  if test -z "$optional_bin_progs"; then
67229    optional_bin_progs=date
67230  else
67231    optional_bin_progs="$optional_bin_progs date"
67232  fi
67233}
67234{
67235  if test -z "$optional_bin_progs"; then
67236    optional_bin_progs=dd
67237  else
67238    optional_bin_progs="$optional_bin_progs dd"
67239  fi
67240}
67241{
67242  if test -z "$optional_bin_progs"; then
67243    optional_bin_progs=dir
67244  else
67245    optional_bin_progs="$optional_bin_progs dir"
67246  fi
67247}
67248{
67249  if test -z "$optional_bin_progs"; then
67250    optional_bin_progs=dircolors
67251  else
67252    optional_bin_progs="$optional_bin_progs dircolors"
67253  fi
67254}
67255{
67256  if test -z "$optional_bin_progs"; then
67257    optional_bin_progs=dirname
67258  else
67259    optional_bin_progs="$optional_bin_progs dirname"
67260  fi
67261}
67262{
67263  if test -z "$optional_bin_progs"; then
67264    optional_bin_progs=du
67265  else
67266    optional_bin_progs="$optional_bin_progs du"
67267  fi
67268}
67269{
67270  if test -z "$optional_bin_progs"; then
67271    optional_bin_progs=echo
67272  else
67273    optional_bin_progs="$optional_bin_progs echo"
67274  fi
67275}
67276{
67277  if test -z "$optional_bin_progs"; then
67278    optional_bin_progs=env
67279  else
67280    optional_bin_progs="$optional_bin_progs env"
67281  fi
67282}
67283{
67284  if test -z "$optional_bin_progs"; then
67285    optional_bin_progs=expand
67286  else
67287    optional_bin_progs="$optional_bin_progs expand"
67288  fi
67289}
67290{
67291  if test -z "$optional_bin_progs"; then
67292    optional_bin_progs=expr
67293  else
67294    optional_bin_progs="$optional_bin_progs expr"
67295  fi
67296}
67297{
67298  if test -z "$optional_bin_progs"; then
67299    optional_bin_progs=factor
67300  else
67301    optional_bin_progs="$optional_bin_progs factor"
67302  fi
67303}
67304{
67305  if test -z "$optional_bin_progs"; then
67306    optional_bin_progs=false
67307  else
67308    optional_bin_progs="$optional_bin_progs false"
67309  fi
67310}
67311{
67312  if test -z "$optional_bin_progs"; then
67313    optional_bin_progs=fmt
67314  else
67315    optional_bin_progs="$optional_bin_progs fmt"
67316  fi
67317}
67318{
67319  if test -z "$optional_bin_progs"; then
67320    optional_bin_progs=fold
67321  else
67322    optional_bin_progs="$optional_bin_progs fold"
67323  fi
67324}
67325{
67326  if test -z "$optional_bin_progs"; then
67327    optional_bin_progs=ginstall
67328  else
67329    optional_bin_progs="$optional_bin_progs ginstall"
67330  fi
67331}
67332{
67333  if test -z "$optional_bin_progs"; then
67334    optional_bin_progs=groups
67335  else
67336    optional_bin_progs="$optional_bin_progs groups"
67337  fi
67338}
67339{
67340  if test -z "$optional_bin_progs"; then
67341    optional_bin_progs=head
67342  else
67343    optional_bin_progs="$optional_bin_progs head"
67344  fi
67345}
67346{
67347  if test -z "$optional_bin_progs"; then
67348    optional_bin_progs=id
67349  else
67350    optional_bin_progs="$optional_bin_progs id"
67351  fi
67352}
67353{
67354  if test -z "$optional_bin_progs"; then
67355    optional_bin_progs=join
67356  else
67357    optional_bin_progs="$optional_bin_progs join"
67358  fi
67359}
67360{
67361  if test -z "$optional_bin_progs"; then
67362    optional_bin_progs=kill
67363  else
67364    optional_bin_progs="$optional_bin_progs kill"
67365  fi
67366}
67367{
67368  if test -z "$optional_bin_progs"; then
67369    optional_bin_progs=link
67370  else
67371    optional_bin_progs="$optional_bin_progs link"
67372  fi
67373}
67374{
67375  if test -z "$optional_bin_progs"; then
67376    optional_bin_progs=ln
67377  else
67378    optional_bin_progs="$optional_bin_progs ln"
67379  fi
67380}
67381{
67382  if test -z "$optional_bin_progs"; then
67383    optional_bin_progs=logname
67384  else
67385    optional_bin_progs="$optional_bin_progs logname"
67386  fi
67387}
67388{
67389  if test -z "$optional_bin_progs"; then
67390    optional_bin_progs=ls
67391  else
67392    optional_bin_progs="$optional_bin_progs ls"
67393  fi
67394}
67395{
67396  if test -z "$optional_bin_progs"; then
67397    optional_bin_progs=md5sum
67398  else
67399    optional_bin_progs="$optional_bin_progs md5sum"
67400  fi
67401}
67402{
67403  if test -z "$optional_bin_progs"; then
67404    optional_bin_progs=mkdir
67405  else
67406    optional_bin_progs="$optional_bin_progs mkdir"
67407  fi
67408}
67409{
67410  if test -z "$optional_bin_progs"; then
67411    optional_bin_progs=mkfifo
67412  else
67413    optional_bin_progs="$optional_bin_progs mkfifo"
67414  fi
67415}
67416{
67417  if test -z "$optional_bin_progs"; then
67418    optional_bin_progs=mknod
67419  else
67420    optional_bin_progs="$optional_bin_progs mknod"
67421  fi
67422}
67423{
67424  if test -z "$optional_bin_progs"; then
67425    optional_bin_progs=mktemp
67426  else
67427    optional_bin_progs="$optional_bin_progs mktemp"
67428  fi
67429}
67430{
67431  if test -z "$optional_bin_progs"; then
67432    optional_bin_progs=mv
67433  else
67434    optional_bin_progs="$optional_bin_progs mv"
67435  fi
67436}
67437{
67438  if test -z "$optional_bin_progs"; then
67439    optional_bin_progs=nl
67440  else
67441    optional_bin_progs="$optional_bin_progs nl"
67442  fi
67443}
67444{
67445  if test -z "$optional_bin_progs"; then
67446    optional_bin_progs=nproc
67447  else
67448    optional_bin_progs="$optional_bin_progs nproc"
67449  fi
67450}
67451{
67452  if test -z "$optional_bin_progs"; then
67453    optional_bin_progs=nohup
67454  else
67455    optional_bin_progs="$optional_bin_progs nohup"
67456  fi
67457}
67458{
67459  if test -z "$optional_bin_progs"; then
67460    optional_bin_progs=numfmt
67461  else
67462    optional_bin_progs="$optional_bin_progs numfmt"
67463  fi
67464}
67465{
67466  if test -z "$optional_bin_progs"; then
67467    optional_bin_progs=od
67468  else
67469    optional_bin_progs="$optional_bin_progs od"
67470  fi
67471}
67472{
67473  if test -z "$optional_bin_progs"; then
67474    optional_bin_progs=paste
67475  else
67476    optional_bin_progs="$optional_bin_progs paste"
67477  fi
67478}
67479{
67480  if test -z "$optional_bin_progs"; then
67481    optional_bin_progs=pathchk
67482  else
67483    optional_bin_progs="$optional_bin_progs pathchk"
67484  fi
67485}
67486{
67487  if test -z "$optional_bin_progs"; then
67488    optional_bin_progs=pr
67489  else
67490    optional_bin_progs="$optional_bin_progs pr"
67491  fi
67492}
67493{
67494  if test -z "$optional_bin_progs"; then
67495    optional_bin_progs=printenv
67496  else
67497    optional_bin_progs="$optional_bin_progs printenv"
67498  fi
67499}
67500{
67501  if test -z "$optional_bin_progs"; then
67502    optional_bin_progs=printf
67503  else
67504    optional_bin_progs="$optional_bin_progs printf"
67505  fi
67506}
67507{
67508  if test -z "$optional_bin_progs"; then
67509    optional_bin_progs=ptx
67510  else
67511    optional_bin_progs="$optional_bin_progs ptx"
67512  fi
67513}
67514{
67515  if test -z "$optional_bin_progs"; then
67516    optional_bin_progs=pwd
67517  else
67518    optional_bin_progs="$optional_bin_progs pwd"
67519  fi
67520}
67521{
67522  if test -z "$optional_bin_progs"; then
67523    optional_bin_progs=readlink
67524  else
67525    optional_bin_progs="$optional_bin_progs readlink"
67526  fi
67527}
67528{
67529  if test -z "$optional_bin_progs"; then
67530    optional_bin_progs=realpath
67531  else
67532    optional_bin_progs="$optional_bin_progs realpath"
67533  fi
67534}
67535{
67536  if test -z "$optional_bin_progs"; then
67537    optional_bin_progs=rm
67538  else
67539    optional_bin_progs="$optional_bin_progs rm"
67540  fi
67541}
67542{
67543  if test -z "$optional_bin_progs"; then
67544    optional_bin_progs=rmdir
67545  else
67546    optional_bin_progs="$optional_bin_progs rmdir"
67547  fi
67548}
67549{
67550  if test -z "$optional_bin_progs"; then
67551    optional_bin_progs=runcon
67552  else
67553    optional_bin_progs="$optional_bin_progs runcon"
67554  fi
67555}
67556{
67557  if test -z "$optional_bin_progs"; then
67558    optional_bin_progs=seq
67559  else
67560    optional_bin_progs="$optional_bin_progs seq"
67561  fi
67562}
67563{
67564  if test -z "$optional_bin_progs"; then
67565    optional_bin_progs=sha1sum
67566  else
67567    optional_bin_progs="$optional_bin_progs sha1sum"
67568  fi
67569}
67570{
67571  if test -z "$optional_bin_progs"; then
67572    optional_bin_progs=sha224sum
67573  else
67574    optional_bin_progs="$optional_bin_progs sha224sum"
67575  fi
67576}
67577{
67578  if test -z "$optional_bin_progs"; then
67579    optional_bin_progs=sha256sum
67580  else
67581    optional_bin_progs="$optional_bin_progs sha256sum"
67582  fi
67583}
67584{
67585  if test -z "$optional_bin_progs"; then
67586    optional_bin_progs=sha384sum
67587  else
67588    optional_bin_progs="$optional_bin_progs sha384sum"
67589  fi
67590}
67591{
67592  if test -z "$optional_bin_progs"; then
67593    optional_bin_progs=sha512sum
67594  else
67595    optional_bin_progs="$optional_bin_progs sha512sum"
67596  fi
67597}
67598{
67599  if test -z "$optional_bin_progs"; then
67600    optional_bin_progs=shred
67601  else
67602    optional_bin_progs="$optional_bin_progs shred"
67603  fi
67604}
67605{
67606  if test -z "$optional_bin_progs"; then
67607    optional_bin_progs=shuf
67608  else
67609    optional_bin_progs="$optional_bin_progs shuf"
67610  fi
67611}
67612{
67613  if test -z "$optional_bin_progs"; then
67614    optional_bin_progs=sleep
67615  else
67616    optional_bin_progs="$optional_bin_progs sleep"
67617  fi
67618}
67619{
67620  if test -z "$optional_bin_progs"; then
67621    optional_bin_progs=sort
67622  else
67623    optional_bin_progs="$optional_bin_progs sort"
67624  fi
67625}
67626{
67627  if test -z "$optional_bin_progs"; then
67628    optional_bin_progs=split
67629  else
67630    optional_bin_progs="$optional_bin_progs split"
67631  fi
67632}
67633{
67634  if test -z "$optional_bin_progs"; then
67635    optional_bin_progs=stat
67636  else
67637    optional_bin_progs="$optional_bin_progs stat"
67638  fi
67639}
67640{
67641  if test -z "$optional_bin_progs"; then
67642    optional_bin_progs=sum
67643  else
67644    optional_bin_progs="$optional_bin_progs sum"
67645  fi
67646}
67647{
67648  if test -z "$optional_bin_progs"; then
67649    optional_bin_progs=sync
67650  else
67651    optional_bin_progs="$optional_bin_progs sync"
67652  fi
67653}
67654{
67655  if test -z "$optional_bin_progs"; then
67656    optional_bin_progs=tac
67657  else
67658    optional_bin_progs="$optional_bin_progs tac"
67659  fi
67660}
67661{
67662  if test -z "$optional_bin_progs"; then
67663    optional_bin_progs=tail
67664  else
67665    optional_bin_progs="$optional_bin_progs tail"
67666  fi
67667}
67668{
67669  if test -z "$optional_bin_progs"; then
67670    optional_bin_progs=tee
67671  else
67672    optional_bin_progs="$optional_bin_progs tee"
67673  fi
67674}
67675{
67676  if test -z "$optional_bin_progs"; then
67677    optional_bin_progs=test
67678  else
67679    optional_bin_progs="$optional_bin_progs test"
67680  fi
67681}
67682{
67683  if test -z "$optional_bin_progs"; then
67684    optional_bin_progs=touch
67685  else
67686    optional_bin_progs="$optional_bin_progs touch"
67687  fi
67688}
67689{
67690  if test -z "$optional_bin_progs"; then
67691    optional_bin_progs=tr
67692  else
67693    optional_bin_progs="$optional_bin_progs tr"
67694  fi
67695}
67696{
67697  if test -z "$optional_bin_progs"; then
67698    optional_bin_progs=true
67699  else
67700    optional_bin_progs="$optional_bin_progs true"
67701  fi
67702}
67703{
67704  if test -z "$optional_bin_progs"; then
67705    optional_bin_progs=truncate
67706  else
67707    optional_bin_progs="$optional_bin_progs truncate"
67708  fi
67709}
67710{
67711  if test -z "$optional_bin_progs"; then
67712    optional_bin_progs=tsort
67713  else
67714    optional_bin_progs="$optional_bin_progs tsort"
67715  fi
67716}
67717{
67718  if test -z "$optional_bin_progs"; then
67719    optional_bin_progs=tty
67720  else
67721    optional_bin_progs="$optional_bin_progs tty"
67722  fi
67723}
67724{
67725  if test -z "$optional_bin_progs"; then
67726    optional_bin_progs=uname
67727  else
67728    optional_bin_progs="$optional_bin_progs uname"
67729  fi
67730}
67731{
67732  if test -z "$optional_bin_progs"; then
67733    optional_bin_progs=unexpand
67734  else
67735    optional_bin_progs="$optional_bin_progs unexpand"
67736  fi
67737}
67738{
67739  if test -z "$optional_bin_progs"; then
67740    optional_bin_progs=uniq
67741  else
67742    optional_bin_progs="$optional_bin_progs uniq"
67743  fi
67744}
67745{
67746  if test -z "$optional_bin_progs"; then
67747    optional_bin_progs=unlink
67748  else
67749    optional_bin_progs="$optional_bin_progs unlink"
67750  fi
67751}
67752{
67753  if test -z "$optional_bin_progs"; then
67754    optional_bin_progs=vdir
67755  else
67756    optional_bin_progs="$optional_bin_progs vdir"
67757  fi
67758}
67759{
67760  if test -z "$optional_bin_progs"; then
67761    optional_bin_progs=wc
67762  else
67763    optional_bin_progs="$optional_bin_progs wc"
67764  fi
67765}
67766{
67767  if test -z "$optional_bin_progs"; then
67768    optional_bin_progs=whoami
67769  else
67770    optional_bin_progs="$optional_bin_progs whoami"
67771  fi
67772}
67773{
67774  if test -z "$optional_bin_progs"; then
67775    optional_bin_progs=yes
67776  else
67777    optional_bin_progs="$optional_bin_progs yes"
67778  fi
67779}
67780no_install_progs_default='arch coreutils hostname'
67781# Given the name of a variable containing a space-separated
67782# list of install-by-default programs and the actual list of
67783# do-not-install-by-default programs, modify the former variable
67784# to reflect any "do-install" and "don't-install" requests.
67785# That is, add any program specified via --enable-install-program,
67786# and remove any program specified via --enable-no-install-program.
67787# Note how the second argument below is a literal, with ","
67788# separators.  That is required due to the way the macro works,
67789# and since the corresponding ./configure option argument is
67790# comma-separated on input.
67791{
67792  gl_no_install_progs_default=`echo 'arch,coreutils,hostname'|sed 's/,/ /g'`
67793  # Check whether --enable-install-program was given.
67794if test "${enable_install_program+set}" = set; then :
67795  enableval=$enable_install_program; gl_do_install_prog=$enableval
67796else
67797  gl_do_install_prog=
67798
67799fi
67800
67801
67802  # If you want to refrain from installing programs A and B,
67803  # use --enable-no-install-program=A,B
67804  # Check whether --enable-no-install-program was given.
67805if test "${enable_no_install_program+set}" = set; then :
67806  enableval=$enable_no_install_program; gl_no_install_prog=$enableval
67807else
67808  gl_no_install_prog=
67809
67810fi
67811
67812
67813  # Convert to space separated lists.
67814  gl_do_install_prog=`echo "$gl_do_install_prog"|tr -s , ' '`
67815  gl_no_install_prog=`echo "$gl_no_install_prog"|tr -s , ' '`
67816
67817  # For each not-to-be-installed program name, ensure that it's a
67818  # valid name, remove it from the list of programs to build/install,
67819  # as well as from the list of man pages to install.
67820  for gl_i in $gl_no_install_prog; do
67821
67822    # Fail upon a request to install and not-install the same program.
67823    case " $gl_do_install_prog " in
67824      *" $gl_i "*) as_fn_error $? "'$gl_i' is both included and excluded" "$LINENO" 5 ;;
67825    esac
67826
67827    gl_msg=
67828    # Warn about a request not to install a program that is not being
67829    # built (which may be because the systems lacks a required interface).
67830    case " $optional_bin_progs " in
67831      *" $gl_i "*) {
67832  optional_bin_progs=`for gl_rem_i in $optional_bin_progs; do
67833        test "$gl_rem_i" = "$gl_i" || echo "$gl_rem_i"
67834      done | tr '\012' ' ' | sed 's/ $//'; echo`
67835} ;;
67836      *) gl_msg="'$gl_i' is already not being installed" ;;
67837    esac
67838
67839    if test "$gl_msg" = ''; then
67840      # Warn about a request not to install a program that is
67841      # already on the default-no-install list.
67842      case " $gl_no_install_progs_default " in
67843        *" $gl_i "*) gl_msg="by default, '$gl_i' is not installed" ;;
67844      esac
67845    fi
67846
67847    test "$gl_msg" != '' && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $gl_msg" >&5
67848$as_echo "$as_me: WARNING: $gl_msg" >&2;}
67849  done
67850
67851  for gl_i in $gl_do_install_prog; do
67852    case " $gl_no_install_progs_default " in
67853      *" $gl_i "*) {
67854  if test -z "$optional_bin_progs"; then
67855    optional_bin_progs=$gl_i
67856  else
67857    optional_bin_progs="$optional_bin_progs $gl_i"
67858  fi
67859} ;;
67860      *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$gl_i' is not an optionally-installable program" >&5
67861$as_echo "$as_me: WARNING: '$gl_i' is not an optionally-installable program" >&2;} ;;
67862    esac
67863  done
67864}
67865
67866
67867# Now that we know which programs will actually be built, determine
67868# which optional helper progs should be compiled.
67869# Note it adding to pkglibexec_PROGRAMS, $(transform) in src/local.mk
67870# may need to be updated accordingly.
67871case " $optional_bin_progs " in
67872  *' stdbuf '*) pkglibexec_PROGRAMS='src/libstdbuf.so';;
67873  *) pkglibexec_PROGRAMS='';;
67874esac
67875
67876man1_MANS=`
67877  for p in $optional_bin_progs; do
67878    # Change "ginstall.1" to "install.1".
67879    test $p = ginstall && p=install
67880    # Ignore the "[" program, since writing a portable make rule to
67881    # generate its manpage is not practical.
67882            test x$p = x'[' && continue
67883    echo "man/$p.1"
67884  done`
67885
67886# Not installed by "make install", but must be built when creating
67887# a distribution tarball.
67888EXTRA_MANS=`for p in $no_install_progs_default $gl_no_install_prog; do
67889              echo man/$p.1
67890            done`
67891
67892# Replace all the programs by the single binary and symlinks if specified.
67893single_binary_progs=
67894single_binary_libs=
67895single_binary_deps=
67896single_binary_install_type=
67897if test "$gl_single_binary" != no; then
67898  man1_MANS="$man1_MANS man/coreutils.1"
67899  # Convert the list to a space separated list
67900  gl_single_binary_exceptions=`echo $gl_single_binary_exceptions | tr ',' ' '`
67901
67902  single_binary_progs=`echo $optional_bin_progs`
67903  optional_bin_progs="coreutils"
67904  for prog in $gl_single_binary_exceptions; do
67905    # Fail if requested to exclude a program than was not part of coreutils.
67906    case " $single_binary_progs " in
67907      *" $prog "*)
67908        {
67909  single_binary_progs=`for gl_rem_i in $single_binary_progs; do
67910        test "$gl_rem_i" = "$prog" || echo "$gl_rem_i"
67911      done | tr '\012' ' ' | sed 's/ $//'; echo`
67912} ;
67913        {
67914  if test -z "$optional_bin_progs"; then
67915    optional_bin_progs=$prog
67916  else
67917    optional_bin_progs="$optional_bin_progs $prog"
67918  fi
67919} ;;
67920      *) as_fn_error $? "'$prog' is not being compiled." "$LINENO" 5 ;;
67921    esac
67922  done
67923
67924  # single_binary_libs holds the list of libs required by the selected
67925  # programs, such as for example -lrt.
67926  single_binary_libs=`
67927    for p in $single_binary_progs; do
67928      # Convert '[' to '_'
67929      test x"$p" = x'[' && p='_'
67930      printf '$(src_libsinglebin_%s_a_ldadd) ' "$p"
67931    done`
67932  # single_binary_deps holds the list of libsinglebin_*.a files that have the
67933  # compiled code of each selected program in a "library" format.
67934  single_binary_deps=`
67935    for p in $single_binary_progs; do
67936      # Convert '[' to '_'
67937      test x"$p" = x'[' && p='_'
67938      printf 'src/libsinglebin_%s.a ' "$p"
67939    done`
67940  single_binary_install_type="$gl_single_binary"
67941fi
67942single_binary_progs=$single_binary_progs
67943
67944single_binary_libs=$single_binary_libs
67945
67946single_binary_deps=$single_binary_deps
67947
67948single_binary_install_type=$single_binary_install_type
67949
67950
67951
67952# The programs built and installed by "make && make install".
67953# Since this is AC_SUBST'd, Automake won't be able to perform rewrite
67954# with $(EXEEXT) appending on it, so we have to do it ourselves -- in
67955# this case, only for $(bin_PROGRAMS).
67956bin_PROGRAMS=`
67957  for p in $optional_bin_progs; do echo src/"$p"'$(EXEEXT)'; done`
67958
67959# Normalize whitespace.
67960man1_MANS=`echo $man1_MANS`
67961EXTRA_MANS=`echo $EXTRA_MANS`
67962bin_PROGRAMS=`echo $bin_PROGRAMS`
67963pkglibexec_PROGS=`echo $pkglibexec_PROGRAMS`
67964
67965
67966
67967
67968
67969
67970built_programs=$optional_bin_progs
67971
67972
67973 if test "$cross_compiling" = yes; then
67974  CROSS_COMPILING_TRUE=
67975  CROSS_COMPILING_FALSE='#'
67976else
67977  CROSS_COMPILING_TRUE='#'
67978  CROSS_COMPILING_FALSE=
67979fi
67980
67981
67982############################################################################
67983
67984# As long as "grep 'PRI[diouxX]' po/*.pot" reports matches in
67985# translatable strings, we must use need-formatstring-macros here.
67986
67987  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
67988$as_echo_n "checking whether NLS is requested... " >&6; }
67989    # Check whether --enable-nls was given.
67990if test "${enable_nls+set}" = set; then :
67991  enableval=$enable_nls; USE_NLS=$enableval
67992else
67993  USE_NLS=yes
67994fi
67995
67996  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
67997$as_echo "$USE_NLS" >&6; }
67998
67999
68000
68001
68002      GETTEXT_MACRO_VERSION=0.19
68003
68004
68005
68006
68007# Prepare PATH_SEPARATOR.
68008# The user is always right.
68009if test "${PATH_SEPARATOR+set}" != set; then
68010  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
68011  # contains only /bin. Note that ksh looks also at the FPATH variable,
68012  # so we have to set that as well for the test.
68013  PATH_SEPARATOR=:
68014  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
68015    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
68016           || PATH_SEPARATOR=';'
68017       }
68018fi
68019
68020# Find out how to test for executable files. Don't use a zero-byte file,
68021# as systems may use methods other than mode bits to determine executability.
68022cat >conf$$.file <<_ASEOF
68023#! /bin/sh
68024exit 0
68025_ASEOF
68026chmod +x conf$$.file
68027if test -x conf$$.file >/dev/null 2>&1; then
68028  ac_executable_p="test -x"
68029else
68030  ac_executable_p="test -f"
68031fi
68032rm -f conf$$.file
68033
68034# Extract the first word of "msgfmt", so it can be a program name with args.
68035set dummy msgfmt; ac_word=$2
68036{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
68037$as_echo_n "checking for $ac_word... " >&6; }
68038if ${ac_cv_path_MSGFMT+:} false; then :
68039  $as_echo_n "(cached) " >&6
68040else
68041  case "$MSGFMT" in
68042  [\\/]* | ?:[\\/]*)
68043    ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
68044    ;;
68045  *)
68046    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
68047    for ac_dir in $PATH; do
68048      IFS="$ac_save_IFS"
68049      test -z "$ac_dir" && ac_dir=.
68050      for ac_exec_ext in '' $ac_executable_extensions; do
68051        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
68052          echo "$as_me: trying $ac_dir/$ac_word..." >&5
68053          if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 &&
68054     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
68055            ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
68056            break 2
68057          fi
68058        fi
68059      done
68060    done
68061    IFS="$ac_save_IFS"
68062  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
68063    ;;
68064esac
68065fi
68066MSGFMT="$ac_cv_path_MSGFMT"
68067if test "$MSGFMT" != ":"; then
68068  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
68069$as_echo "$MSGFMT" >&6; }
68070else
68071  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
68072$as_echo "no" >&6; }
68073fi
68074
68075  # Extract the first word of "gmsgfmt", so it can be a program name with args.
68076set dummy gmsgfmt; ac_word=$2
68077{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
68078$as_echo_n "checking for $ac_word... " >&6; }
68079if ${ac_cv_path_GMSGFMT+:} false; then :
68080  $as_echo_n "(cached) " >&6
68081else
68082  case $GMSGFMT in
68083  [\\/]* | ?:[\\/]*)
68084  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
68085  ;;
68086  *)
68087  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
68088for as_dir in $PATH
68089do
68090  IFS=$as_save_IFS
68091  test -z "$as_dir" && as_dir=.
68092    for ac_exec_ext in '' $ac_executable_extensions; do
68093  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
68094    ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
68095    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
68096    break 2
68097  fi
68098done
68099  done
68100IFS=$as_save_IFS
68101
68102  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
68103  ;;
68104esac
68105fi
68106GMSGFMT=$ac_cv_path_GMSGFMT
68107if test -n "$GMSGFMT"; then
68108  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
68109$as_echo "$GMSGFMT" >&6; }
68110else
68111  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
68112$as_echo "no" >&6; }
68113fi
68114
68115
68116
68117    case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
68118    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
68119    *) MSGFMT_015=$MSGFMT ;;
68120  esac
68121
68122  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
68123    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
68124    *) GMSGFMT_015=$GMSGFMT ;;
68125  esac
68126
68127
68128
68129# Prepare PATH_SEPARATOR.
68130# The user is always right.
68131if test "${PATH_SEPARATOR+set}" != set; then
68132  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
68133  # contains only /bin. Note that ksh looks also at the FPATH variable,
68134  # so we have to set that as well for the test.
68135  PATH_SEPARATOR=:
68136  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
68137    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
68138           || PATH_SEPARATOR=';'
68139       }
68140fi
68141
68142# Find out how to test for executable files. Don't use a zero-byte file,
68143# as systems may use methods other than mode bits to determine executability.
68144cat >conf$$.file <<_ASEOF
68145#! /bin/sh
68146exit 0
68147_ASEOF
68148chmod +x conf$$.file
68149if test -x conf$$.file >/dev/null 2>&1; then
68150  ac_executable_p="test -x"
68151else
68152  ac_executable_p="test -f"
68153fi
68154rm -f conf$$.file
68155
68156# Extract the first word of "xgettext", so it can be a program name with args.
68157set dummy xgettext; ac_word=$2
68158{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
68159$as_echo_n "checking for $ac_word... " >&6; }
68160if ${ac_cv_path_XGETTEXT+:} false; then :
68161  $as_echo_n "(cached) " >&6
68162else
68163  case "$XGETTEXT" in
68164  [\\/]* | ?:[\\/]*)
68165    ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
68166    ;;
68167  *)
68168    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
68169    for ac_dir in $PATH; do
68170      IFS="$ac_save_IFS"
68171      test -z "$ac_dir" && ac_dir=.
68172      for ac_exec_ext in '' $ac_executable_extensions; do
68173        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
68174          echo "$as_me: trying $ac_dir/$ac_word..." >&5
68175          if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 &&
68176     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
68177            ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext"
68178            break 2
68179          fi
68180        fi
68181      done
68182    done
68183    IFS="$ac_save_IFS"
68184  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
68185    ;;
68186esac
68187fi
68188XGETTEXT="$ac_cv_path_XGETTEXT"
68189if test "$XGETTEXT" != ":"; then
68190  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
68191$as_echo "$XGETTEXT" >&6; }
68192else
68193  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
68194$as_echo "no" >&6; }
68195fi
68196
68197    rm -f messages.po
68198
68199    case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
68200    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
68201    *) XGETTEXT_015=$XGETTEXT ;;
68202  esac
68203
68204
68205
68206# Prepare PATH_SEPARATOR.
68207# The user is always right.
68208if test "${PATH_SEPARATOR+set}" != set; then
68209  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
68210  # contains only /bin. Note that ksh looks also at the FPATH variable,
68211  # so we have to set that as well for the test.
68212  PATH_SEPARATOR=:
68213  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
68214    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
68215           || PATH_SEPARATOR=';'
68216       }
68217fi
68218
68219# Find out how to test for executable files. Don't use a zero-byte file,
68220# as systems may use methods other than mode bits to determine executability.
68221cat >conf$$.file <<_ASEOF
68222#! /bin/sh
68223exit 0
68224_ASEOF
68225chmod +x conf$$.file
68226if test -x conf$$.file >/dev/null 2>&1; then
68227  ac_executable_p="test -x"
68228else
68229  ac_executable_p="test -f"
68230fi
68231rm -f conf$$.file
68232
68233# Extract the first word of "msgmerge", so it can be a program name with args.
68234set dummy msgmerge; ac_word=$2
68235{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
68236$as_echo_n "checking for $ac_word... " >&6; }
68237if ${ac_cv_path_MSGMERGE+:} false; then :
68238  $as_echo_n "(cached) " >&6
68239else
68240  case "$MSGMERGE" in
68241  [\\/]* | ?:[\\/]*)
68242    ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
68243    ;;
68244  *)
68245    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
68246    for ac_dir in $PATH; do
68247      IFS="$ac_save_IFS"
68248      test -z "$ac_dir" && ac_dir=.
68249      for ac_exec_ext in '' $ac_executable_extensions; do
68250        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
68251          echo "$as_me: trying $ac_dir/$ac_word..." >&5
68252          if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then
68253            ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
68254            break 2
68255          fi
68256        fi
68257      done
68258    done
68259    IFS="$ac_save_IFS"
68260  test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
68261    ;;
68262esac
68263fi
68264MSGMERGE="$ac_cv_path_MSGMERGE"
68265if test "$MSGMERGE" != ":"; then
68266  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
68267$as_echo "$MSGMERGE" >&6; }
68268else
68269  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
68270$as_echo "no" >&6; }
68271fi
68272
68273
68274        test -n "$localedir" || localedir='${datadir}/locale'
68275
68276
68277    test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
68278
68279
68280  ac_config_commands="$ac_config_commands po-directories"
68281
68282
68283
68284
68285
68286
68287
68288
68289
68290
68291
68292
68293
68294
68295
68296
68297
68298
68299
68300
68301
68302
68303
68304
68305
68306
68307    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
68308$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; }
68309if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then :
68310  $as_echo_n "(cached) " >&6
68311else
68312  gt_save_LIBS="$LIBS"
68313     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
68314     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
68315/* end confdefs.h.  */
68316#include <CoreFoundation/CFPreferences.h>
68317int
68318main ()
68319{
68320CFPreferencesCopyAppValue(NULL, NULL)
68321  ;
68322  return 0;
68323}
68324_ACEOF
68325if ac_fn_c_try_link "$LINENO"; then :
68326  gt_cv_func_CFPreferencesCopyAppValue=yes
68327else
68328  gt_cv_func_CFPreferencesCopyAppValue=no
68329fi
68330rm -f core conftest.err conftest.$ac_objext \
68331    conftest$ac_exeext conftest.$ac_ext
68332     LIBS="$gt_save_LIBS"
68333fi
68334{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
68335$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
68336  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
68337
68338$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
68339
68340  fi
68341    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5
68342$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; }
68343if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then :
68344  $as_echo_n "(cached) " >&6
68345else
68346  gt_save_LIBS="$LIBS"
68347     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
68348     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
68349/* end confdefs.h.  */
68350#include <CoreFoundation/CFLocale.h>
68351int
68352main ()
68353{
68354CFLocaleCopyCurrent();
68355  ;
68356  return 0;
68357}
68358_ACEOF
68359if ac_fn_c_try_link "$LINENO"; then :
68360  gt_cv_func_CFLocaleCopyCurrent=yes
68361else
68362  gt_cv_func_CFLocaleCopyCurrent=no
68363fi
68364rm -f core conftest.err conftest.$ac_objext \
68365    conftest$ac_exeext conftest.$ac_ext
68366     LIBS="$gt_save_LIBS"
68367fi
68368{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5
68369$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; }
68370  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
68371
68372$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
68373
68374  fi
68375  INTL_MACOSX_LIBS=
68376  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
68377    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
68378  fi
68379
68380
68381
68382
68383
68384
68385  LIBINTL=
68386  LTLIBINTL=
68387  POSUB=
68388
68389    case " $gt_needs " in
68390    *" need-formatstring-macros "*) gt_api_version=3 ;;
68391    *" need-ngettext "*) gt_api_version=2 ;;
68392    *) gt_api_version=1 ;;
68393  esac
68394  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
68395  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
68396
68397    if test "$USE_NLS" = "yes"; then
68398    gt_use_preinstalled_gnugettext=no
68399
68400
68401        if test $gt_api_version -ge 3; then
68402          gt_revision_test_code='
68403#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
68404#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
68405#endif
68406typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
68407'
68408        else
68409          gt_revision_test_code=
68410        fi
68411        if test $gt_api_version -ge 2; then
68412          gt_expression_test_code=' + * ngettext ("", "", 0)'
68413        else
68414          gt_expression_test_code=
68415        fi
68416
68417        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5
68418$as_echo_n "checking for GNU gettext in libc... " >&6; }
68419if eval \${$gt_func_gnugettext_libc+:} false; then :
68420  $as_echo_n "(cached) " >&6
68421else
68422  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
68423/* end confdefs.h.  */
68424
68425#include <libintl.h>
68426$gt_revision_test_code
68427extern int _nl_msg_cat_cntr;
68428extern int *_nl_domain_bindings;
68429
68430int
68431main ()
68432{
68433
68434bindtextdomain ("", "");
68435return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
68436
68437  ;
68438  return 0;
68439}
68440_ACEOF
68441if ac_fn_c_try_link "$LINENO"; then :
68442  eval "$gt_func_gnugettext_libc=yes"
68443else
68444  eval "$gt_func_gnugettext_libc=no"
68445fi
68446rm -f core conftest.err conftest.$ac_objext \
68447    conftest$ac_exeext conftest.$ac_ext
68448fi
68449eval ac_res=\$$gt_func_gnugettext_libc
68450	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
68451$as_echo "$ac_res" >&6; }
68452
68453        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
68454
68455
68456
68457
68458
68459          am_save_CPPFLAGS="$CPPFLAGS"
68460
68461  for element in $INCICONV; do
68462    haveit=
68463    for x in $CPPFLAGS; do
68464
68465  acl_save_prefix="$prefix"
68466  prefix="$acl_final_prefix"
68467  acl_save_exec_prefix="$exec_prefix"
68468  exec_prefix="$acl_final_exec_prefix"
68469  eval x=\"$x\"
68470  exec_prefix="$acl_save_exec_prefix"
68471  prefix="$acl_save_prefix"
68472
68473      if test "X$x" = "X$element"; then
68474        haveit=yes
68475        break
68476      fi
68477    done
68478    if test -z "$haveit"; then
68479      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
68480    fi
68481  done
68482
68483
68484  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
68485$as_echo_n "checking for iconv... " >&6; }
68486if ${am_cv_func_iconv+:} false; then :
68487  $as_echo_n "(cached) " >&6
68488else
68489
68490    am_cv_func_iconv="no, consider installing GNU libiconv"
68491    am_cv_lib_iconv=no
68492    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
68493/* end confdefs.h.  */
68494
68495#include <stdlib.h>
68496#include <iconv.h>
68497
68498int
68499main ()
68500{
68501iconv_t cd = iconv_open("","");
68502           iconv(cd,NULL,NULL,NULL,NULL);
68503           iconv_close(cd);
68504  ;
68505  return 0;
68506}
68507_ACEOF
68508if ac_fn_c_try_link "$LINENO"; then :
68509  am_cv_func_iconv=yes
68510fi
68511rm -f core conftest.err conftest.$ac_objext \
68512    conftest$ac_exeext conftest.$ac_ext
68513    if test "$am_cv_func_iconv" != yes; then
68514      am_save_LIBS="$LIBS"
68515      LIBS="$LIBS $LIBICONV"
68516      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
68517/* end confdefs.h.  */
68518
68519#include <stdlib.h>
68520#include <iconv.h>
68521
68522int
68523main ()
68524{
68525iconv_t cd = iconv_open("","");
68526             iconv(cd,NULL,NULL,NULL,NULL);
68527             iconv_close(cd);
68528  ;
68529  return 0;
68530}
68531_ACEOF
68532if ac_fn_c_try_link "$LINENO"; then :
68533  am_cv_lib_iconv=yes
68534        am_cv_func_iconv=yes
68535fi
68536rm -f core conftest.err conftest.$ac_objext \
68537    conftest$ac_exeext conftest.$ac_ext
68538      LIBS="$am_save_LIBS"
68539    fi
68540
68541fi
68542{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
68543$as_echo "$am_cv_func_iconv" >&6; }
68544  if test "$am_cv_func_iconv" = yes; then
68545    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
68546$as_echo_n "checking for working iconv... " >&6; }
68547if ${am_cv_func_iconv_works+:} false; then :
68548  $as_echo_n "(cached) " >&6
68549else
68550
68551                  am_save_LIBS="$LIBS"
68552      if test $am_cv_lib_iconv = yes; then
68553        LIBS="$LIBS $LIBICONV"
68554      fi
68555      am_cv_func_iconv_works=no
68556      for ac_iconv_const in '' 'const'; do
68557        if test "$cross_compiling" = yes; then :
68558  case "$host_os" in
68559             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
68560             *)            am_cv_func_iconv_works="guessing yes" ;;
68561           esac
68562else
68563  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
68564/* end confdefs.h.  */
68565
68566#include <iconv.h>
68567#include <string.h>
68568
68569#ifndef ICONV_CONST
68570# define ICONV_CONST $ac_iconv_const
68571#endif
68572
68573int
68574main ()
68575{
68576int result = 0;
68577  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
68578     returns.  */
68579  {
68580    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
68581    if (cd_utf8_to_88591 != (iconv_t)(-1))
68582      {
68583        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
68584        char buf[10];
68585        ICONV_CONST char *inptr = input;
68586        size_t inbytesleft = strlen (input);
68587        char *outptr = buf;
68588        size_t outbytesleft = sizeof (buf);
68589        size_t res = iconv (cd_utf8_to_88591,
68590                            &inptr, &inbytesleft,
68591                            &outptr, &outbytesleft);
68592        if (res == 0)
68593          result |= 1;
68594        iconv_close (cd_utf8_to_88591);
68595      }
68596  }
68597  /* Test against Solaris 10 bug: Failures are not distinguishable from
68598     successful returns.  */
68599  {
68600    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
68601    if (cd_ascii_to_88591 != (iconv_t)(-1))
68602      {
68603        static ICONV_CONST char input[] = "\263";
68604        char buf[10];
68605        ICONV_CONST char *inptr = input;
68606        size_t inbytesleft = strlen (input);
68607        char *outptr = buf;
68608        size_t outbytesleft = sizeof (buf);
68609        size_t res = iconv (cd_ascii_to_88591,
68610                            &inptr, &inbytesleft,
68611                            &outptr, &outbytesleft);
68612        if (res == 0)
68613          result |= 2;
68614        iconv_close (cd_ascii_to_88591);
68615      }
68616  }
68617  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
68618  {
68619    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
68620    if (cd_88591_to_utf8 != (iconv_t)(-1))
68621      {
68622        static ICONV_CONST char input[] = "\304";
68623        static char buf[2] = { (char)0xDE, (char)0xAD };
68624        ICONV_CONST char *inptr = input;
68625        size_t inbytesleft = 1;
68626        char *outptr = buf;
68627        size_t outbytesleft = 1;
68628        size_t res = iconv (cd_88591_to_utf8,
68629                            &inptr, &inbytesleft,
68630                            &outptr, &outbytesleft);
68631        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
68632          result |= 4;
68633        iconv_close (cd_88591_to_utf8);
68634      }
68635  }
68636#if 0 /* This bug could be worked around by the caller.  */
68637  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
68638  {
68639    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
68640    if (cd_88591_to_utf8 != (iconv_t)(-1))
68641      {
68642        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
68643        char buf[50];
68644        ICONV_CONST char *inptr = input;
68645        size_t inbytesleft = strlen (input);
68646        char *outptr = buf;
68647        size_t outbytesleft = sizeof (buf);
68648        size_t res = iconv (cd_88591_to_utf8,
68649                            &inptr, &inbytesleft,
68650                            &outptr, &outbytesleft);
68651        if ((int)res > 0)
68652          result |= 8;
68653        iconv_close (cd_88591_to_utf8);
68654      }
68655  }
68656#endif
68657  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
68658     provided.  */
68659  {
68660    /* Try standardized names.  */
68661    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
68662    /* Try IRIX, OSF/1 names.  */
68663    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
68664    /* Try AIX names.  */
68665    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
68666    /* Try HP-UX names.  */
68667    iconv_t cd4 = iconv_open ("utf8", "eucJP");
68668    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
68669        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
68670      result |= 16;
68671    if (cd1 != (iconv_t)(-1))
68672      iconv_close (cd1);
68673    if (cd2 != (iconv_t)(-1))
68674      iconv_close (cd2);
68675    if (cd3 != (iconv_t)(-1))
68676      iconv_close (cd3);
68677    if (cd4 != (iconv_t)(-1))
68678      iconv_close (cd4);
68679  }
68680  return result;
68681
68682  ;
68683  return 0;
68684}
68685_ACEOF
68686if ac_fn_c_try_run "$LINENO"; then :
68687  am_cv_func_iconv_works=yes
68688fi
68689rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
68690  conftest.$ac_objext conftest.beam conftest.$ac_ext
68691fi
68692
68693        test "$am_cv_func_iconv_works" = no || break
68694      done
68695      LIBS="$am_save_LIBS"
68696
68697fi
68698{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
68699$as_echo "$am_cv_func_iconv_works" >&6; }
68700    case "$am_cv_func_iconv_works" in
68701      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
68702      *)   am_func_iconv=yes ;;
68703    esac
68704  else
68705    am_func_iconv=no am_cv_lib_iconv=no
68706  fi
68707  if test "$am_func_iconv" = yes; then
68708
68709$as_echo "#define HAVE_ICONV 1" >>confdefs.h
68710
68711  fi
68712  if test "$am_cv_lib_iconv" = yes; then
68713    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
68714$as_echo_n "checking how to link with libiconv... " >&6; }
68715    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
68716$as_echo "$LIBICONV" >&6; }
68717  else
68718            CPPFLAGS="$am_save_CPPFLAGS"
68719    LIBICONV=
68720    LTLIBICONV=
68721  fi
68722
68723
68724
68725
68726
68727
68728
68729
68730
68731
68732
68733    use_additional=yes
68734
68735  acl_save_prefix="$prefix"
68736  prefix="$acl_final_prefix"
68737  acl_save_exec_prefix="$exec_prefix"
68738  exec_prefix="$acl_final_exec_prefix"
68739
68740    eval additional_includedir=\"$includedir\"
68741    eval additional_libdir=\"$libdir\"
68742
68743  exec_prefix="$acl_save_exec_prefix"
68744  prefix="$acl_save_prefix"
68745
68746
68747# Check whether --with-libintl-prefix was given.
68748if test "${with_libintl_prefix+set}" = set; then :
68749  withval=$with_libintl_prefix;
68750    if test "X$withval" = "Xno"; then
68751      use_additional=no
68752    else
68753      if test "X$withval" = "X"; then
68754
68755  acl_save_prefix="$prefix"
68756  prefix="$acl_final_prefix"
68757  acl_save_exec_prefix="$exec_prefix"
68758  exec_prefix="$acl_final_exec_prefix"
68759
68760          eval additional_includedir=\"$includedir\"
68761          eval additional_libdir=\"$libdir\"
68762
68763  exec_prefix="$acl_save_exec_prefix"
68764  prefix="$acl_save_prefix"
68765
68766      else
68767        additional_includedir="$withval/include"
68768        additional_libdir="$withval/$acl_libdirstem"
68769        if test "$acl_libdirstem2" != "$acl_libdirstem" \
68770           && test ! -d "$withval/$acl_libdirstem"; then
68771          additional_libdir="$withval/$acl_libdirstem2"
68772        fi
68773      fi
68774    fi
68775
68776fi
68777
68778      LIBINTL=
68779  LTLIBINTL=
68780  INCINTL=
68781  LIBINTL_PREFIX=
68782      HAVE_LIBINTL=
68783  rpathdirs=
68784  ltrpathdirs=
68785  names_already_handled=
68786  names_next_round='intl '
68787  while test -n "$names_next_round"; do
68788    names_this_round="$names_next_round"
68789    names_next_round=
68790    for name in $names_this_round; do
68791      already_handled=
68792      for n in $names_already_handled; do
68793        if test "$n" = "$name"; then
68794          already_handled=yes
68795          break
68796        fi
68797      done
68798      if test -z "$already_handled"; then
68799        names_already_handled="$names_already_handled $name"
68800                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
68801        eval value=\"\$HAVE_LIB$uppername\"
68802        if test -n "$value"; then
68803          if test "$value" = yes; then
68804            eval value=\"\$LIB$uppername\"
68805            test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value"
68806            eval value=\"\$LTLIB$uppername\"
68807            test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value"
68808          else
68809                                    :
68810          fi
68811        else
68812                              found_dir=
68813          found_la=
68814          found_so=
68815          found_a=
68816          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
68817          if test -n "$acl_shlibext"; then
68818            shrext=".$acl_shlibext"             # typically: shrext=.so
68819          else
68820            shrext=
68821          fi
68822          if test $use_additional = yes; then
68823            dir="$additional_libdir"
68824                                    if test -n "$acl_shlibext"; then
68825              if test -f "$dir/$libname$shrext"; then
68826                found_dir="$dir"
68827                found_so="$dir/$libname$shrext"
68828              else
68829                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
68830                  ver=`(cd "$dir" && \
68831                        for f in "$libname$shrext".*; do echo "$f"; done \
68832                        | sed -e "s,^$libname$shrext\\\\.,," \
68833                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
68834                        | sed 1q ) 2>/dev/null`
68835                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
68836                    found_dir="$dir"
68837                    found_so="$dir/$libname$shrext.$ver"
68838                  fi
68839                else
68840                  eval library_names=\"$acl_library_names_spec\"
68841                  for f in $library_names; do
68842                    if test -f "$dir/$f"; then
68843                      found_dir="$dir"
68844                      found_so="$dir/$f"
68845                      break
68846                    fi
68847                  done
68848                fi
68849              fi
68850            fi
68851                        if test "X$found_dir" = "X"; then
68852              if test -f "$dir/$libname.$acl_libext"; then
68853                found_dir="$dir"
68854                found_a="$dir/$libname.$acl_libext"
68855              fi
68856            fi
68857            if test "X$found_dir" != "X"; then
68858              if test -f "$dir/$libname.la"; then
68859                found_la="$dir/$libname.la"
68860              fi
68861            fi
68862          fi
68863          if test "X$found_dir" = "X"; then
68864            for x in $LDFLAGS $LTLIBINTL; do
68865
68866  acl_save_prefix="$prefix"
68867  prefix="$acl_final_prefix"
68868  acl_save_exec_prefix="$exec_prefix"
68869  exec_prefix="$acl_final_exec_prefix"
68870  eval x=\"$x\"
68871  exec_prefix="$acl_save_exec_prefix"
68872  prefix="$acl_save_prefix"
68873
68874              case "$x" in
68875                -L*)
68876                  dir=`echo "X$x" | sed -e 's/^X-L//'`
68877                                    if test -n "$acl_shlibext"; then
68878                    if test -f "$dir/$libname$shrext"; then
68879                      found_dir="$dir"
68880                      found_so="$dir/$libname$shrext"
68881                    else
68882                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
68883                        ver=`(cd "$dir" && \
68884                              for f in "$libname$shrext".*; do echo "$f"; done \
68885                              | sed -e "s,^$libname$shrext\\\\.,," \
68886                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
68887                              | sed 1q ) 2>/dev/null`
68888                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
68889                          found_dir="$dir"
68890                          found_so="$dir/$libname$shrext.$ver"
68891                        fi
68892                      else
68893                        eval library_names=\"$acl_library_names_spec\"
68894                        for f in $library_names; do
68895                          if test -f "$dir/$f"; then
68896                            found_dir="$dir"
68897                            found_so="$dir/$f"
68898                            break
68899                          fi
68900                        done
68901                      fi
68902                    fi
68903                  fi
68904                                    if test "X$found_dir" = "X"; then
68905                    if test -f "$dir/$libname.$acl_libext"; then
68906                      found_dir="$dir"
68907                      found_a="$dir/$libname.$acl_libext"
68908                    fi
68909                  fi
68910                  if test "X$found_dir" != "X"; then
68911                    if test -f "$dir/$libname.la"; then
68912                      found_la="$dir/$libname.la"
68913                    fi
68914                  fi
68915                  ;;
68916              esac
68917              if test "X$found_dir" != "X"; then
68918                break
68919              fi
68920            done
68921          fi
68922          if test "X$found_dir" != "X"; then
68923                        LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
68924            if test "X$found_so" != "X"; then
68925                                                        if test "$enable_rpath" = no \
68926                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
68927                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
68928                                LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
68929              else
68930                                                                                haveit=
68931                for x in $ltrpathdirs; do
68932                  if test "X$x" = "X$found_dir"; then
68933                    haveit=yes
68934                    break
68935                  fi
68936                done
68937                if test -z "$haveit"; then
68938                  ltrpathdirs="$ltrpathdirs $found_dir"
68939                fi
68940                                if test "$acl_hardcode_direct" = yes; then
68941                                                      LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
68942                else
68943                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
68944                                                            LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
68945                                                            haveit=
68946                    for x in $rpathdirs; do
68947                      if test "X$x" = "X$found_dir"; then
68948                        haveit=yes
68949                        break
68950                      fi
68951                    done
68952                    if test -z "$haveit"; then
68953                      rpathdirs="$rpathdirs $found_dir"
68954                    fi
68955                  else
68956                                                                                haveit=
68957                    for x in $LDFLAGS $LIBINTL; do
68958
68959  acl_save_prefix="$prefix"
68960  prefix="$acl_final_prefix"
68961  acl_save_exec_prefix="$exec_prefix"
68962  exec_prefix="$acl_final_exec_prefix"
68963  eval x=\"$x\"
68964  exec_prefix="$acl_save_exec_prefix"
68965  prefix="$acl_save_prefix"
68966
68967                      if test "X$x" = "X-L$found_dir"; then
68968                        haveit=yes
68969                        break
68970                      fi
68971                    done
68972                    if test -z "$haveit"; then
68973                      LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir"
68974                    fi
68975                    if test "$acl_hardcode_minus_L" != no; then
68976                                                                                        LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
68977                    else
68978                                                                                                                                                                                LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
68979                    fi
68980                  fi
68981                fi
68982              fi
68983            else
68984              if test "X$found_a" != "X"; then
68985                                LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a"
68986              else
68987                                                LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name"
68988              fi
68989            fi
68990                        additional_includedir=
68991            case "$found_dir" in
68992              */$acl_libdirstem | */$acl_libdirstem/)
68993                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
68994                if test "$name" = 'intl'; then
68995                  LIBINTL_PREFIX="$basedir"
68996                fi
68997                additional_includedir="$basedir/include"
68998                ;;
68999              */$acl_libdirstem2 | */$acl_libdirstem2/)
69000                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
69001                if test "$name" = 'intl'; then
69002                  LIBINTL_PREFIX="$basedir"
69003                fi
69004                additional_includedir="$basedir/include"
69005                ;;
69006            esac
69007            if test "X$additional_includedir" != "X"; then
69008                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
69009                haveit=
69010                if test "X$additional_includedir" = "X/usr/local/include"; then
69011                  if test -n "$GCC"; then
69012                    case $host_os in
69013                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
69014                    esac
69015                  fi
69016                fi
69017                if test -z "$haveit"; then
69018                  for x in $CPPFLAGS $INCINTL; do
69019
69020  acl_save_prefix="$prefix"
69021  prefix="$acl_final_prefix"
69022  acl_save_exec_prefix="$exec_prefix"
69023  exec_prefix="$acl_final_exec_prefix"
69024  eval x=\"$x\"
69025  exec_prefix="$acl_save_exec_prefix"
69026  prefix="$acl_save_prefix"
69027
69028                    if test "X$x" = "X-I$additional_includedir"; then
69029                      haveit=yes
69030                      break
69031                    fi
69032                  done
69033                  if test -z "$haveit"; then
69034                    if test -d "$additional_includedir"; then
69035                                            INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir"
69036                    fi
69037                  fi
69038                fi
69039              fi
69040            fi
69041                        if test -n "$found_la"; then
69042                                                        save_libdir="$libdir"
69043              case "$found_la" in
69044                */* | *\\*) . "$found_la" ;;
69045                *) . "./$found_la" ;;
69046              esac
69047              libdir="$save_libdir"
69048                            for dep in $dependency_libs; do
69049                case "$dep" in
69050                  -L*)
69051                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
69052                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
69053                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
69054                      haveit=
69055                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
69056                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
69057                        if test -n "$GCC"; then
69058                          case $host_os in
69059                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
69060                          esac
69061                        fi
69062                      fi
69063                      if test -z "$haveit"; then
69064                        haveit=
69065                        for x in $LDFLAGS $LIBINTL; do
69066
69067  acl_save_prefix="$prefix"
69068  prefix="$acl_final_prefix"
69069  acl_save_exec_prefix="$exec_prefix"
69070  exec_prefix="$acl_final_exec_prefix"
69071  eval x=\"$x\"
69072  exec_prefix="$acl_save_exec_prefix"
69073  prefix="$acl_save_prefix"
69074
69075                          if test "X$x" = "X-L$additional_libdir"; then
69076                            haveit=yes
69077                            break
69078                          fi
69079                        done
69080                        if test -z "$haveit"; then
69081                          if test -d "$additional_libdir"; then
69082                                                        LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir"
69083                          fi
69084                        fi
69085                        haveit=
69086                        for x in $LDFLAGS $LTLIBINTL; do
69087
69088  acl_save_prefix="$prefix"
69089  prefix="$acl_final_prefix"
69090  acl_save_exec_prefix="$exec_prefix"
69091  exec_prefix="$acl_final_exec_prefix"
69092  eval x=\"$x\"
69093  exec_prefix="$acl_save_exec_prefix"
69094  prefix="$acl_save_prefix"
69095
69096                          if test "X$x" = "X-L$additional_libdir"; then
69097                            haveit=yes
69098                            break
69099                          fi
69100                        done
69101                        if test -z "$haveit"; then
69102                          if test -d "$additional_libdir"; then
69103                                                        LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir"
69104                          fi
69105                        fi
69106                      fi
69107                    fi
69108                    ;;
69109                  -R*)
69110                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
69111                    if test "$enable_rpath" != no; then
69112                                                                  haveit=
69113                      for x in $rpathdirs; do
69114                        if test "X$x" = "X$dir"; then
69115                          haveit=yes
69116                          break
69117                        fi
69118                      done
69119                      if test -z "$haveit"; then
69120                        rpathdirs="$rpathdirs $dir"
69121                      fi
69122                                                                  haveit=
69123                      for x in $ltrpathdirs; do
69124                        if test "X$x" = "X$dir"; then
69125                          haveit=yes
69126                          break
69127                        fi
69128                      done
69129                      if test -z "$haveit"; then
69130                        ltrpathdirs="$ltrpathdirs $dir"
69131                      fi
69132                    fi
69133                    ;;
69134                  -l*)
69135                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
69136                    ;;
69137                  *.la)
69138                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
69139                    ;;
69140                  *)
69141                                        LIBINTL="${LIBINTL}${LIBINTL:+ }$dep"
69142                    LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep"
69143                    ;;
69144                esac
69145              done
69146            fi
69147          else
69148                                                            LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
69149            LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name"
69150          fi
69151        fi
69152      fi
69153    done
69154  done
69155  if test "X$rpathdirs" != "X"; then
69156    if test -n "$acl_hardcode_libdir_separator"; then
69157                        alldirs=
69158      for found_dir in $rpathdirs; do
69159        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
69160      done
69161            acl_save_libdir="$libdir"
69162      libdir="$alldirs"
69163      eval flag=\"$acl_hardcode_libdir_flag_spec\"
69164      libdir="$acl_save_libdir"
69165      LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
69166    else
69167            for found_dir in $rpathdirs; do
69168        acl_save_libdir="$libdir"
69169        libdir="$found_dir"
69170        eval flag=\"$acl_hardcode_libdir_flag_spec\"
69171        libdir="$acl_save_libdir"
69172        LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
69173      done
69174    fi
69175  fi
69176  if test "X$ltrpathdirs" != "X"; then
69177            for found_dir in $ltrpathdirs; do
69178      LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir"
69179    done
69180  fi
69181
69182
69183
69184
69185
69186
69187          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5
69188$as_echo_n "checking for GNU gettext in libintl... " >&6; }
69189if eval \${$gt_func_gnugettext_libintl+:} false; then :
69190  $as_echo_n "(cached) " >&6
69191else
69192  gt_save_CPPFLAGS="$CPPFLAGS"
69193            CPPFLAGS="$CPPFLAGS $INCINTL"
69194            gt_save_LIBS="$LIBS"
69195            LIBS="$LIBS $LIBINTL"
69196                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
69197/* end confdefs.h.  */
69198
69199#include <libintl.h>
69200$gt_revision_test_code
69201extern int _nl_msg_cat_cntr;
69202extern
69203#ifdef __cplusplus
69204"C"
69205#endif
69206const char *_nl_expand_alias (const char *);
69207
69208int
69209main ()
69210{
69211
69212bindtextdomain ("", "");
69213return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
69214
69215  ;
69216  return 0;
69217}
69218_ACEOF
69219if ac_fn_c_try_link "$LINENO"; then :
69220  eval "$gt_func_gnugettext_libintl=yes"
69221else
69222  eval "$gt_func_gnugettext_libintl=no"
69223fi
69224rm -f core conftest.err conftest.$ac_objext \
69225    conftest$ac_exeext conftest.$ac_ext
69226                        if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
69227              LIBS="$LIBS $LIBICONV"
69228              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
69229/* end confdefs.h.  */
69230
69231#include <libintl.h>
69232$gt_revision_test_code
69233extern int _nl_msg_cat_cntr;
69234extern
69235#ifdef __cplusplus
69236"C"
69237#endif
69238const char *_nl_expand_alias (const char *);
69239
69240int
69241main ()
69242{
69243
69244bindtextdomain ("", "");
69245return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
69246
69247  ;
69248  return 0;
69249}
69250_ACEOF
69251if ac_fn_c_try_link "$LINENO"; then :
69252  LIBINTL="$LIBINTL $LIBICONV"
69253                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
69254                 eval "$gt_func_gnugettext_libintl=yes"
69255
69256fi
69257rm -f core conftest.err conftest.$ac_objext \
69258    conftest$ac_exeext conftest.$ac_ext
69259            fi
69260            CPPFLAGS="$gt_save_CPPFLAGS"
69261            LIBS="$gt_save_LIBS"
69262fi
69263eval ac_res=\$$gt_func_gnugettext_libintl
69264	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
69265$as_echo "$ac_res" >&6; }
69266        fi
69267
69268                                        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
69269           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
69270                && test "$PACKAGE" != gettext-runtime \
69271                && test "$PACKAGE" != gettext-tools; }; then
69272          gt_use_preinstalled_gnugettext=yes
69273        else
69274                    LIBINTL=
69275          LTLIBINTL=
69276          INCINTL=
69277        fi
69278
69279
69280
69281    if test -n "$INTL_MACOSX_LIBS"; then
69282      if test "$gt_use_preinstalled_gnugettext" = "yes" \
69283         || test "$nls_cv_use_gnu_gettext" = "yes"; then
69284                LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
69285        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
69286      fi
69287    fi
69288
69289    if test "$gt_use_preinstalled_gnugettext" = "yes" \
69290       || test "$nls_cv_use_gnu_gettext" = "yes"; then
69291
69292$as_echo "#define ENABLE_NLS 1" >>confdefs.h
69293
69294    else
69295      USE_NLS=no
69296    fi
69297  fi
69298
69299  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5
69300$as_echo_n "checking whether to use NLS... " >&6; }
69301  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
69302$as_echo "$USE_NLS" >&6; }
69303  if test "$USE_NLS" = "yes"; then
69304    { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5
69305$as_echo_n "checking where the gettext function comes from... " >&6; }
69306    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
69307      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
69308        gt_source="external libintl"
69309      else
69310        gt_source="libc"
69311      fi
69312    else
69313      gt_source="included intl directory"
69314    fi
69315    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5
69316$as_echo "$gt_source" >&6; }
69317  fi
69318
69319  if test "$USE_NLS" = "yes"; then
69320
69321    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
69322      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
69323        { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5
69324$as_echo_n "checking how to link with libintl... " >&6; }
69325        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5
69326$as_echo "$LIBINTL" >&6; }
69327
69328  for element in $INCINTL; do
69329    haveit=
69330    for x in $CPPFLAGS; do
69331
69332  acl_save_prefix="$prefix"
69333  prefix="$acl_final_prefix"
69334  acl_save_exec_prefix="$exec_prefix"
69335  exec_prefix="$acl_final_exec_prefix"
69336  eval x=\"$x\"
69337  exec_prefix="$acl_save_exec_prefix"
69338  prefix="$acl_save_prefix"
69339
69340      if test "X$x" = "X$element"; then
69341        haveit=yes
69342        break
69343      fi
69344    done
69345    if test -z "$haveit"; then
69346      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
69347    fi
69348  done
69349
69350      fi
69351
69352
69353$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
69354
69355
69356$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h
69357
69358    fi
69359
69360        POSUB=po
69361  fi
69362
69363
69364
69365    INTLLIBS="$LIBINTL"
69366
69367
69368
69369
69370
69371
69372
69373
69374# For a test of uniq: it uses the $LOCALE_FR envvar.
69375
69376
69377
69378  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
69379$as_echo_n "checking for a traditional french locale... " >&6; }
69380if ${gt_cv_locale_fr+:} false; then :
69381  $as_echo_n "(cached) " >&6
69382else
69383
69384    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
69385/* end confdefs.h.  */
69386
69387#include <locale.h>
69388#include <time.h>
69389#if HAVE_LANGINFO_CODESET
69390# include <langinfo.h>
69391#endif
69392#include <stdlib.h>
69393#include <string.h>
69394struct tm t;
69395char buf[16];
69396int main () {
69397  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
69398     imitates locale dependent behaviour by looking at the environment
69399     variables, and all locales use the UTF-8 encoding.  */
69400#if defined __BEOS__ || defined __HAIKU__
69401  return 1;
69402#else
69403  /* Check whether the given locale name is recognized by the system.  */
69404# if defined _WIN32 && !defined __CYGWIN__
69405  /* On native Windows, setlocale(category, "") looks at the system settings,
69406     not at the environment variables.  Also, when an encoding suffix such
69407     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
69408     category of the locale to "C".  */
69409  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
69410      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
69411    return 1;
69412# else
69413  if (setlocale (LC_ALL, "") == NULL) return 1;
69414# endif
69415  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
69416     On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
69417     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
69418     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
69419     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
69420     some unit tests fail.
69421     On MirBSD 10, when an unsupported locale is specified, setlocale()
69422     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
69423# if HAVE_LANGINFO_CODESET
69424  {
69425    const char *cs = nl_langinfo (CODESET);
69426    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
69427        || strcmp (cs, "UTF-8") == 0)
69428      return 1;
69429  }
69430# endif
69431# ifdef __CYGWIN__
69432  /* On Cygwin, avoid locale names without encoding suffix, because the
69433     locale_charset() function relies on the encoding suffix.  Note that
69434     LC_ALL is set on the command line.  */
69435  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
69436# endif
69437  /* Check whether in the abbreviation of the second month, the second
69438     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
69439     one byte long. This excludes the UTF-8 encoding.  */
69440  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
69441  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
69442# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
69443  /* Check whether the decimal separator is a comma.
69444     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
69445     are nl_langinfo(RADIXCHAR) are both ".".  */
69446  if (localeconv () ->decimal_point[0] != ',') return 1;
69447# endif
69448  return 0;
69449#endif
69450}
69451
69452_ACEOF
69453    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
69454  (eval $ac_link) 2>&5
69455  ac_status=$?
69456  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
69457  test $ac_status = 0; } && test -s conftest$ac_exeext; then
69458      case "$host_os" in
69459        # Handle native Windows specially, because there setlocale() interprets
69460        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
69461        # "fr" or "fra" as "French" or "French_France.1252",
69462        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
69463        # "ja" as "Japanese" or "Japanese_Japan.932",
69464        # and similar.
69465        mingw*)
69466          # Test for the native Windows locale name.
69467          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
69468            gt_cv_locale_fr=French_France.1252
69469          else
69470            # None found.
69471            gt_cv_locale_fr=none
69472          fi
69473          ;;
69474        *)
69475          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
69476          # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
69477          # configure script would override the LC_ALL setting. Likewise for
69478          # LC_CTYPE, which is also set at the beginning of the configure script.
69479          # Test for the usual locale name.
69480          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
69481            gt_cv_locale_fr=fr_FR
69482          else
69483            # Test for the locale name with explicit encoding suffix.
69484            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
69485              gt_cv_locale_fr=fr_FR.ISO-8859-1
69486            else
69487              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
69488              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
69489                gt_cv_locale_fr=fr_FR.ISO8859-1
69490              else
69491                # Test for the HP-UX locale name.
69492                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
69493                  gt_cv_locale_fr=fr_FR.iso88591
69494                else
69495                  # Test for the Solaris 7 locale name.
69496                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
69497                    gt_cv_locale_fr=fr
69498                  else
69499                    # None found.
69500                    gt_cv_locale_fr=none
69501                  fi
69502                fi
69503              fi
69504            fi
69505          fi
69506          ;;
69507      esac
69508    fi
69509    rm -fr conftest*
69510
69511fi
69512{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
69513$as_echo "$gt_cv_locale_fr" >&6; }
69514  LOCALE_FR=$gt_cv_locale_fr
69515
69516
69517
69518ac_config_files="$ac_config_files Makefile po/Makefile.in gnulib-tests/Makefile"
69519
69520cat >confcache <<\_ACEOF
69521# This file is a shell script that caches the results of configure
69522# tests run on this system so they can be shared between configure
69523# scripts and configure runs, see configure's option --config-cache.
69524# It is not useful on other systems.  If it contains results you don't
69525# want to keep, you may remove or edit it.
69526#
69527# config.status only pays attention to the cache file if you give it
69528# the --recheck option to rerun configure.
69529#
69530# `ac_cv_env_foo' variables (set or unset) will be overridden when
69531# loading this file, other *unset* `ac_cv_foo' will be assigned the
69532# following values.
69533
69534_ACEOF
69535
69536# The following way of writing the cache mishandles newlines in values,
69537# but we know of no workaround that is simple, portable, and efficient.
69538# So, we kill variables containing newlines.
69539# Ultrix sh set writes to stderr and can't be redirected directly,
69540# and sets the high bit in the cache file unless we assign to the vars.
69541(
69542  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
69543    eval ac_val=\$$ac_var
69544    case $ac_val in #(
69545    *${as_nl}*)
69546      case $ac_var in #(
69547      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
69548$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
69549      esac
69550      case $ac_var in #(
69551      _ | IFS | as_nl) ;; #(
69552      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
69553      *) { eval $ac_var=; unset $ac_var;} ;;
69554      esac ;;
69555    esac
69556  done
69557
69558  (set) 2>&1 |
69559    case $as_nl`(ac_space=' '; set) 2>&1` in #(
69560    *${as_nl}ac_space=\ *)
69561      # `set' does not quote correctly, so add quotes: double-quote
69562      # substitution turns \\\\ into \\, and sed turns \\ into \.
69563      sed -n \
69564	"s/'/'\\\\''/g;
69565	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
69566      ;; #(
69567    *)
69568      # `set' quotes correctly as required by POSIX, so do not add quotes.
69569      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
69570      ;;
69571    esac |
69572    sort
69573) |
69574  sed '
69575     /^ac_cv_env_/b end
69576     t clear
69577     :clear
69578     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
69579     t end
69580     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
69581     :end' >>confcache
69582if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
69583  if test -w "$cache_file"; then
69584    if test "x$cache_file" != "x/dev/null"; then
69585      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
69586$as_echo "$as_me: updating cache $cache_file" >&6;}
69587      if test ! -f "$cache_file" || test -h "$cache_file"; then
69588	cat confcache >"$cache_file"
69589      else
69590        case $cache_file in #(
69591        */* | ?:*)
69592	  mv -f confcache "$cache_file"$$ &&
69593	  mv -f "$cache_file"$$ "$cache_file" ;; #(
69594        *)
69595	  mv -f confcache "$cache_file" ;;
69596	esac
69597      fi
69598    fi
69599  else
69600    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
69601$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
69602  fi
69603fi
69604rm -f confcache
69605
69606test "x$prefix" = xNONE && prefix=$ac_default_prefix
69607# Let make expand exec_prefix.
69608test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
69609
69610DEFS=-DHAVE_CONFIG_H
69611
69612ac_libobjs=
69613ac_ltlibobjs=
69614U=
69615for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
69616  # 1. Remove the extension, and $U if already installed.
69617  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
69618  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
69619  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
69620  #    will be set to the directory where LIBOBJS objects are built.
69621  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
69622  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
69623done
69624LIBOBJS=$ac_libobjs
69625
69626LTLIBOBJS=$ac_ltlibobjs
69627
69628
69629{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
69630$as_echo_n "checking that generated files are newer than configure... " >&6; }
69631   if test -n "$am_sleep_pid"; then
69632     # Hide warnings about reused PIDs.
69633     wait $am_sleep_pid 2>/dev/null
69634   fi
69635   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
69636$as_echo "done" >&6; }
69637 if test -n "$EXEEXT"; then
69638  am__EXEEXT_TRUE=
69639  am__EXEEXT_FALSE='#'
69640else
69641  am__EXEEXT_TRUE='#'
69642  am__EXEEXT_FALSE=
69643fi
69644
69645if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
69646  as_fn_error $? "conditional \"AMDEP\" was never defined.
69647Usually this means the macro was only invoked conditionally." "$LINENO" 5
69648fi
69649if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
69650  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
69651Usually this means the macro was only invoked conditionally." "$LINENO" 5
69652fi
69653if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
69654  as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
69655Usually this means the macro was only invoked conditionally." "$LINENO" 5
69656fi
69657if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
69658  as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
69659Usually this means the macro was only invoked conditionally." "$LINENO" 5
69660fi
69661if test -z "${GL_GENERATE_BYTESWAP_H_TRUE}" && test -z "${GL_GENERATE_BYTESWAP_H_FALSE}"; then
69662  as_fn_error $? "conditional \"GL_GENERATE_BYTESWAP_H\" was never defined.
69663Usually this means the macro was only invoked conditionally." "$LINENO" 5
69664fi
69665test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS=
69666
69667if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
69668  as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
69669Usually this means the macro was only invoked conditionally." "$LINENO" 5
69670fi
69671if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
69672  as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
69673Usually this means the macro was only invoked conditionally." "$LINENO" 5
69674fi
69675if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
69676  as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
69677Usually this means the macro was only invoked conditionally." "$LINENO" 5
69678fi
69679if test -z "${GNU_MAKE_TRUE}" && test -z "${GNU_MAKE_FALSE}"; then
69680  as_fn_error $? "conditional \"GNU_MAKE\" was never defined.
69681Usually this means the macro was only invoked conditionally." "$LINENO" 5
69682fi
69683if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then
69684  as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined.
69685Usually this means the macro was only invoked conditionally." "$LINENO" 5
69686fi
69687if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then
69688  as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined.
69689Usually this means the macro was only invoked conditionally." "$LINENO" 5
69690fi
69691if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then
69692  as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined.
69693Usually this means the macro was only invoked conditionally." "$LINENO" 5
69694fi
69695if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
69696  as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
69697Usually this means the macro was only invoked conditionally." "$LINENO" 5
69698fi
69699if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
69700  as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
69701Usually this means the macro was only invoked conditionally." "$LINENO" 5
69702fi
69703if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
69704  as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
69705Usually this means the macro was only invoked conditionally." "$LINENO" 5
69706fi
69707
69708if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
69709  as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
69710Usually this means the macro was only invoked conditionally." "$LINENO" 5
69711fi
69712CONFIG_INCLUDE=lib/config.h
69713
69714if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
69715  as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined.
69716Usually this means the macro was only invoked conditionally." "$LINENO" 5
69717fi
69718
69719
69720
69721  # Tell AC_LIBSOURCES where to find source files like alloca.c.
69722
69723
69724  # This hack originated in bison.  It is required when using non-recursive
69725  # automake rules to build from gnulib-provided lib/ sources.  Hence, LIB_DIR
69726  # is usually simply "lib".  Those rules use the list of names like "fchdir.o"
69727  # and "strstr.o" in gl_LIBOBJS.  With non-recursive make, we must prefix each
69728  # such file name with the "lib/" prefix.  See also build-aux/prefix-gnulib-mk.
69729  gl_LIBOBJS=`echo "$gl_LIBOBJS" | sed -e 's, , lib/,g'`
69730
69731  # Listing the names of the variables to prefix is error-prone.
69732  # Rather, adjust each AC_SUBST'd variable whose name ends in '_H'
69733  # and whose value ends in '.h'.
69734  for ac_var in $ac_subst_vars
69735  do
69736    eval "ac_val=\$$ac_var"
69737    case $ac_var:$ac_val in
69738      *_H:*.h) eval "$ac_var=lib/\$$ac_var";;
69739    esac
69740  done
69741
69742
69743if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
69744  as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
69745Usually this means the macro was only invoked conditionally." "$LINENO" 5
69746fi
69747if test -z "${GL_GENERATE_PTHREAD_H_TRUE}" && test -z "${GL_GENERATE_PTHREAD_H_FALSE}"; then
69748  as_fn_error $? "conditional \"GL_GENERATE_PTHREAD_H\" was never defined.
69749Usually this means the macro was only invoked conditionally." "$LINENO" 5
69750fi
69751if test -z "${GL_GENERATE_SCHED_H_TRUE}" && test -z "${GL_GENERATE_SCHED_H_FALSE}"; then
69752  as_fn_error $? "conditional \"GL_GENERATE_SCHED_H\" was never defined.
69753Usually this means the macro was only invoked conditionally." "$LINENO" 5
69754fi
69755if test -z "${GL_GENERATE_SELINUX_CONTEXT_H_TRUE}" && test -z "${GL_GENERATE_SELINUX_CONTEXT_H_FALSE}"; then
69756  as_fn_error $? "conditional \"GL_GENERATE_SELINUX_CONTEXT_H\" was never defined.
69757Usually this means the macro was only invoked conditionally." "$LINENO" 5
69758fi
69759if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
69760  as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
69761Usually this means the macro was only invoked conditionally." "$LINENO" 5
69762fi
69763if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then
69764  as_fn_error $? "conditional \"GL_GENERATE_STDARG_H\" was never defined.
69765Usually this means the macro was only invoked conditionally." "$LINENO" 5
69766fi
69767if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
69768  as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
69769Usually this means the macro was only invoked conditionally." "$LINENO" 5
69770fi
69771if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
69772  as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
69773Usually this means the macro was only invoked conditionally." "$LINENO" 5
69774fi
69775if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE}"; then
69776  as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR\" was never defined.
69777Usually this means the macro was only invoked conditionally." "$LINENO" 5
69778fi
69779if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE}"; then
69780  as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB\" was never defined.
69781Usually this means the macro was only invoked conditionally." "$LINENO" 5
69782fi
69783if test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE}"; then
69784  as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH\" was never defined.
69785Usually this means the macro was only invoked conditionally." "$LINENO" 5
69786fi
69787if test -z "${GL_GENERATE_UTIME_H_TRUE}" && test -z "${GL_GENERATE_UTIME_H_FALSE}"; then
69788  as_fn_error $? "conditional \"GL_GENERATE_UTIME_H\" was never defined.
69789Usually this means the macro was only invoked conditionally." "$LINENO" 5
69790fi
69791
69792    gl_libobjs=
69793    gl_ltlibobjs=
69794    if test -n "$gl_LIBOBJS"; then
69795      # Remove the extension.
69796      sed_drop_objext='s/\.o$//;s/\.obj$//'
69797      for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
69798        gl_libobjs="$gl_libobjs $i.$ac_objext"
69799        gl_ltlibobjs="$gl_ltlibobjs $i.lo"
69800      done
69801    fi
69802    gl_LIBOBJS=$gl_libobjs
69803
69804    gl_LTLIBOBJS=$gl_ltlibobjs
69805
69806
69807
69808
69809
69810
69811    gltests_libobjs=
69812    gltests_ltlibobjs=
69813    if test -n "$gltests_LIBOBJS"; then
69814      # Remove the extension.
69815      sed_drop_objext='s/\.o$//;s/\.obj$//'
69816      for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
69817        gltests_libobjs="$gltests_libobjs $i.$ac_objext"
69818        gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
69819      done
69820    fi
69821    gltests_LIBOBJS=$gltests_libobjs
69822
69823    gltests_LTLIBOBJS=$gltests_ltlibobjs
69824
69825
69826if test -z "${HAVE_PERL_TRUE}" && test -z "${HAVE_PERL_FALSE}"; then
69827  as_fn_error $? "conditional \"HAVE_PERL\" was never defined.
69828Usually this means the macro was only invoked conditionally." "$LINENO" 5
69829fi
69830if test -z "${SINGLE_BINARY_TRUE}" && test -z "${SINGLE_BINARY_FALSE}"; then
69831  as_fn_error $? "conditional \"SINGLE_BINARY\" was never defined.
69832Usually this means the macro was only invoked conditionally." "$LINENO" 5
69833fi
69834if test -z "${USE_XLC_INCLUDE_TRUE}" && test -z "${USE_XLC_INCLUDE_FALSE}"; then
69835  as_fn_error $? "conditional \"USE_XLC_INCLUDE\" was never defined.
69836Usually this means the macro was only invoked conditionally." "$LINENO" 5
69837fi
69838if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then
69839  as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined.
69840Usually this means the macro was only invoked conditionally." "$LINENO" 5
69841fi
69842
69843: "${CONFIG_STATUS=./config.status}"
69844ac_write_fail=0
69845ac_clean_files_save=$ac_clean_files
69846ac_clean_files="$ac_clean_files $CONFIG_STATUS"
69847{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
69848$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
69849as_write_fail=0
69850cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
69851#! $SHELL
69852# Generated by $as_me.
69853# Run this file to recreate the current configuration.
69854# Compiler output produced by configure, useful for debugging
69855# configure, is in config.log if it exists.
69856
69857debug=false
69858ac_cs_recheck=false
69859ac_cs_silent=false
69860
69861SHELL=\${CONFIG_SHELL-$SHELL}
69862export SHELL
69863_ASEOF
69864cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
69865## -------------------- ##
69866## M4sh Initialization. ##
69867## -------------------- ##
69868
69869# Be more Bourne compatible
69870DUALCASE=1; export DUALCASE # for MKS sh
69871if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
69872  emulate sh
69873  NULLCMD=:
69874  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
69875  # is contrary to our usage.  Disable this feature.
69876  alias -g '${1+"$@"}'='"$@"'
69877  setopt NO_GLOB_SUBST
69878else
69879  case `(set -o) 2>/dev/null` in #(
69880  *posix*) :
69881    set -o posix ;; #(
69882  *) :
69883     ;;
69884esac
69885fi
69886
69887
69888as_nl='
69889'
69890export as_nl
69891# Printing a long string crashes Solaris 7 /usr/bin/printf.
69892as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
69893as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
69894as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
69895# Prefer a ksh shell builtin over an external printf program on Solaris,
69896# but without wasting forks for bash or zsh.
69897if test -z "$BASH_VERSION$ZSH_VERSION" \
69898    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
69899  as_echo='print -r --'
69900  as_echo_n='print -rn --'
69901elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
69902  as_echo='printf %s\n'
69903  as_echo_n='printf %s'
69904else
69905  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
69906    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
69907    as_echo_n='/usr/ucb/echo -n'
69908  else
69909    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
69910    as_echo_n_body='eval
69911      arg=$1;
69912      case $arg in #(
69913      *"$as_nl"*)
69914	expr "X$arg" : "X\\(.*\\)$as_nl";
69915	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
69916      esac;
69917      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
69918    '
69919    export as_echo_n_body
69920    as_echo_n='sh -c $as_echo_n_body as_echo'
69921  fi
69922  export as_echo_body
69923  as_echo='sh -c $as_echo_body as_echo'
69924fi
69925
69926# The user is always right.
69927if test "${PATH_SEPARATOR+set}" != set; then
69928  PATH_SEPARATOR=:
69929  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
69930    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
69931      PATH_SEPARATOR=';'
69932  }
69933fi
69934
69935
69936# IFS
69937# We need space, tab and new line, in precisely that order.  Quoting is
69938# there to prevent editors from complaining about space-tab.
69939# (If _AS_PATH_WALK were called with IFS unset, it would disable word
69940# splitting by setting IFS to empty value.)
69941IFS=" ""	$as_nl"
69942
69943# Find who we are.  Look in the path if we contain no directory separator.
69944as_myself=
69945case $0 in #((
69946  *[\\/]* ) as_myself=$0 ;;
69947  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
69948for as_dir in $PATH
69949do
69950  IFS=$as_save_IFS
69951  test -z "$as_dir" && as_dir=.
69952    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
69953  done
69954IFS=$as_save_IFS
69955
69956     ;;
69957esac
69958# We did not find ourselves, most probably we were run as `sh COMMAND'
69959# in which case we are not to be found in the path.
69960if test "x$as_myself" = x; then
69961  as_myself=$0
69962fi
69963if test ! -f "$as_myself"; then
69964  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
69965  exit 1
69966fi
69967
69968# Unset variables that we do not need and which cause bugs (e.g. in
69969# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
69970# suppresses any "Segmentation fault" message there.  '((' could
69971# trigger a bug in pdksh 5.2.14.
69972for as_var in BASH_ENV ENV MAIL MAILPATH
69973do eval test x\${$as_var+set} = xset \
69974  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
69975done
69976PS1='$ '
69977PS2='> '
69978PS4='+ '
69979
69980# NLS nuisances.
69981LC_ALL=C
69982export LC_ALL
69983LANGUAGE=C
69984export LANGUAGE
69985
69986# CDPATH.
69987(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
69988
69989
69990# as_fn_error STATUS ERROR [LINENO LOG_FD]
69991# ----------------------------------------
69992# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
69993# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
69994# script with STATUS, using 1 if that was 0.
69995as_fn_error ()
69996{
69997  as_status=$1; test $as_status -eq 0 && as_status=1
69998  if test "$4"; then
69999    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
70000    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
70001  fi
70002  $as_echo "$as_me: error: $2" >&2
70003  as_fn_exit $as_status
70004} # as_fn_error
70005
70006
70007# as_fn_set_status STATUS
70008# -----------------------
70009# Set $? to STATUS, without forking.
70010as_fn_set_status ()
70011{
70012  return $1
70013} # as_fn_set_status
70014
70015# as_fn_exit STATUS
70016# -----------------
70017# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
70018as_fn_exit ()
70019{
70020  set +e
70021  as_fn_set_status $1
70022  exit $1
70023} # as_fn_exit
70024
70025# as_fn_unset VAR
70026# ---------------
70027# Portably unset VAR.
70028as_fn_unset ()
70029{
70030  { eval $1=; unset $1;}
70031}
70032as_unset=as_fn_unset
70033# as_fn_append VAR VALUE
70034# ----------------------
70035# Append the text in VALUE to the end of the definition contained in VAR. Take
70036# advantage of any shell optimizations that allow amortized linear growth over
70037# repeated appends, instead of the typical quadratic growth present in naive
70038# implementations.
70039if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
70040  eval 'as_fn_append ()
70041  {
70042    eval $1+=\$2
70043  }'
70044else
70045  as_fn_append ()
70046  {
70047    eval $1=\$$1\$2
70048  }
70049fi # as_fn_append
70050
70051# as_fn_arith ARG...
70052# ------------------
70053# Perform arithmetic evaluation on the ARGs, and store the result in the
70054# global $as_val. Take advantage of shells that can avoid forks. The arguments
70055# must be portable across $(()) and expr.
70056if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
70057  eval 'as_fn_arith ()
70058  {
70059    as_val=$(( $* ))
70060  }'
70061else
70062  as_fn_arith ()
70063  {
70064    as_val=`expr "$@" || test $? -eq 1`
70065  }
70066fi # as_fn_arith
70067
70068
70069if expr a : '\(a\)' >/dev/null 2>&1 &&
70070   test "X`expr 00001 : '.*\(...\)'`" = X001; then
70071  as_expr=expr
70072else
70073  as_expr=false
70074fi
70075
70076if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
70077  as_basename=basename
70078else
70079  as_basename=false
70080fi
70081
70082if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
70083  as_dirname=dirname
70084else
70085  as_dirname=false
70086fi
70087
70088as_me=`$as_basename -- "$0" ||
70089$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
70090	 X"$0" : 'X\(//\)$' \| \
70091	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
70092$as_echo X/"$0" |
70093    sed '/^.*\/\([^/][^/]*\)\/*$/{
70094	    s//\1/
70095	    q
70096	  }
70097	  /^X\/\(\/\/\)$/{
70098	    s//\1/
70099	    q
70100	  }
70101	  /^X\/\(\/\).*/{
70102	    s//\1/
70103	    q
70104	  }
70105	  s/.*/./; q'`
70106
70107# Avoid depending upon Character Ranges.
70108as_cr_letters='abcdefghijklmnopqrstuvwxyz'
70109as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
70110as_cr_Letters=$as_cr_letters$as_cr_LETTERS
70111as_cr_digits='0123456789'
70112as_cr_alnum=$as_cr_Letters$as_cr_digits
70113
70114ECHO_C= ECHO_N= ECHO_T=
70115case `echo -n x` in #(((((
70116-n*)
70117  case `echo 'xy\c'` in
70118  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
70119  xy)  ECHO_C='\c';;
70120  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
70121       ECHO_T='	';;
70122  esac;;
70123*)
70124  ECHO_N='-n';;
70125esac
70126
70127rm -f conf$$ conf$$.exe conf$$.file
70128if test -d conf$$.dir; then
70129  rm -f conf$$.dir/conf$$.file
70130else
70131  rm -f conf$$.dir
70132  mkdir conf$$.dir 2>/dev/null
70133fi
70134if (echo >conf$$.file) 2>/dev/null; then
70135  if ln -s conf$$.file conf$$ 2>/dev/null; then
70136    as_ln_s='ln -s'
70137    # ... but there are two gotchas:
70138    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
70139    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
70140    # In both cases, we have to default to `cp -pR'.
70141    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
70142      as_ln_s='cp -pR'
70143  elif ln conf$$.file conf$$ 2>/dev/null; then
70144    as_ln_s=ln
70145  else
70146    as_ln_s='cp -pR'
70147  fi
70148else
70149  as_ln_s='cp -pR'
70150fi
70151rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
70152rmdir conf$$.dir 2>/dev/null
70153
70154
70155# as_fn_mkdir_p
70156# -------------
70157# Create "$as_dir" as a directory, including parents if necessary.
70158as_fn_mkdir_p ()
70159{
70160
70161  case $as_dir in #(
70162  -*) as_dir=./$as_dir;;
70163  esac
70164  test -d "$as_dir" || eval $as_mkdir_p || {
70165    as_dirs=
70166    while :; do
70167      case $as_dir in #(
70168      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
70169      *) as_qdir=$as_dir;;
70170      esac
70171      as_dirs="'$as_qdir' $as_dirs"
70172      as_dir=`$as_dirname -- "$as_dir" ||
70173$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
70174	 X"$as_dir" : 'X\(//\)[^/]' \| \
70175	 X"$as_dir" : 'X\(//\)$' \| \
70176	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
70177$as_echo X"$as_dir" |
70178    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
70179	    s//\1/
70180	    q
70181	  }
70182	  /^X\(\/\/\)[^/].*/{
70183	    s//\1/
70184	    q
70185	  }
70186	  /^X\(\/\/\)$/{
70187	    s//\1/
70188	    q
70189	  }
70190	  /^X\(\/\).*/{
70191	    s//\1/
70192	    q
70193	  }
70194	  s/.*/./; q'`
70195      test -d "$as_dir" && break
70196    done
70197    test -z "$as_dirs" || eval "mkdir $as_dirs"
70198  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
70199
70200
70201} # as_fn_mkdir_p
70202if mkdir -p . 2>/dev/null; then
70203  as_mkdir_p='mkdir -p "$as_dir"'
70204else
70205  test -d ./-p && rmdir ./-p
70206  as_mkdir_p=false
70207fi
70208
70209
70210# as_fn_executable_p FILE
70211# -----------------------
70212# Test if FILE is an executable regular file.
70213as_fn_executable_p ()
70214{
70215  test -f "$1" && test -x "$1"
70216} # as_fn_executable_p
70217as_test_x='test -x'
70218as_executable_p=as_fn_executable_p
70219
70220# Sed expression to map a string onto a valid CPP name.
70221as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
70222
70223# Sed expression to map a string onto a valid variable name.
70224as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
70225
70226
70227exec 6>&1
70228## ----------------------------------- ##
70229## Main body of $CONFIG_STATUS script. ##
70230## ----------------------------------- ##
70231_ASEOF
70232test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
70233
70234cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
70235# Save the log message, to keep $0 and so on meaningful, and to
70236# report actual input values of CONFIG_FILES etc. instead of their
70237# values after options handling.
70238ac_log="
70239This file was extended by GNU coreutils $as_me 8.30, which was
70240generated by GNU Autoconf 2.69.  Invocation command line was
70241
70242  CONFIG_FILES    = $CONFIG_FILES
70243  CONFIG_HEADERS  = $CONFIG_HEADERS
70244  CONFIG_LINKS    = $CONFIG_LINKS
70245  CONFIG_COMMANDS = $CONFIG_COMMANDS
70246  $ $0 $@
70247
70248on `(hostname || uname -n) 2>/dev/null | sed 1q`
70249"
70250
70251_ACEOF
70252
70253case $ac_config_files in *"
70254"*) set x $ac_config_files; shift; ac_config_files=$*;;
70255esac
70256
70257case $ac_config_headers in *"
70258"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
70259esac
70260
70261
70262cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
70263# Files that config.status was made for.
70264config_files="$ac_config_files"
70265config_headers="$ac_config_headers"
70266config_links="$ac_config_links"
70267config_commands="$ac_config_commands"
70268
70269_ACEOF
70270
70271cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
70272ac_cs_usage="\
70273\`$as_me' instantiates files and other configuration actions
70274from templates according to the current configuration.  Unless the files
70275and actions are specified as TAGs, all are instantiated by default.
70276
70277Usage: $0 [OPTION]... [TAG]...
70278
70279  -h, --help       print this help, then exit
70280  -V, --version    print version number and configuration settings, then exit
70281      --config     print configuration, then exit
70282  -q, --quiet, --silent
70283                   do not print progress messages
70284  -d, --debug      don't remove temporary files
70285      --recheck    update $as_me by reconfiguring in the same conditions
70286      --file=FILE[:TEMPLATE]
70287                   instantiate the configuration file FILE
70288      --header=FILE[:TEMPLATE]
70289                   instantiate the configuration header FILE
70290
70291Configuration files:
70292$config_files
70293
70294Configuration headers:
70295$config_headers
70296
70297Configuration links:
70298$config_links
70299
70300Configuration commands:
70301$config_commands
70302
70303Report bugs to <bug-coreutils@gnu.org>.
70304GNU coreutils home page: <https://www.gnu.org/software/coreutils/>.
70305General help using GNU software: <http://www.gnu.org/gethelp/>."
70306
70307_ACEOF
70308cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
70309ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
70310ac_cs_version="\\
70311GNU coreutils config.status 8.30
70312configured by $0, generated by GNU Autoconf 2.69,
70313  with options \\"\$ac_cs_config\\"
70314
70315Copyright (C) 2012 Free Software Foundation, Inc.
70316This config.status script is free software; the Free Software Foundation
70317gives unlimited permission to copy, distribute and modify it."
70318
70319ac_pwd='$ac_pwd'
70320srcdir='$srcdir'
70321INSTALL='$INSTALL'
70322MKDIR_P='$MKDIR_P'
70323AWK='$AWK'
70324test -n "\$AWK" || AWK=awk
70325_ACEOF
70326
70327cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
70328# The default lists apply if the user does not specify any file.
70329ac_need_defaults=:
70330while test $# != 0
70331do
70332  case $1 in
70333  --*=?*)
70334    ac_option=`expr "X$1" : 'X\([^=]*\)='`
70335    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
70336    ac_shift=:
70337    ;;
70338  --*=)
70339    ac_option=`expr "X$1" : 'X\([^=]*\)='`
70340    ac_optarg=
70341    ac_shift=:
70342    ;;
70343  *)
70344    ac_option=$1
70345    ac_optarg=$2
70346    ac_shift=shift
70347    ;;
70348  esac
70349
70350  case $ac_option in
70351  # Handling of the options.
70352  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
70353    ac_cs_recheck=: ;;
70354  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
70355    $as_echo "$ac_cs_version"; exit ;;
70356  --config | --confi | --conf | --con | --co | --c )
70357    $as_echo "$ac_cs_config"; exit ;;
70358  --debug | --debu | --deb | --de | --d | -d )
70359    debug=: ;;
70360  --file | --fil | --fi | --f )
70361    $ac_shift
70362    case $ac_optarg in
70363    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
70364    '') as_fn_error $? "missing file argument" ;;
70365    esac
70366    as_fn_append CONFIG_FILES " '$ac_optarg'"
70367    ac_need_defaults=false;;
70368  --header | --heade | --head | --hea )
70369    $ac_shift
70370    case $ac_optarg in
70371    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
70372    esac
70373    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
70374    ac_need_defaults=false;;
70375  --he | --h)
70376    # Conflict between --help and --header
70377    as_fn_error $? "ambiguous option: \`$1'
70378Try \`$0 --help' for more information.";;
70379  --help | --hel | -h )
70380    $as_echo "$ac_cs_usage"; exit ;;
70381  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
70382  | -silent | --silent | --silen | --sile | --sil | --si | --s)
70383    ac_cs_silent=: ;;
70384
70385  # This is an error.
70386  -*) as_fn_error $? "unrecognized option: \`$1'
70387Try \`$0 --help' for more information." ;;
70388
70389  *) as_fn_append ac_config_targets " $1"
70390     ac_need_defaults=false ;;
70391
70392  esac
70393  shift
70394done
70395
70396ac_configure_extra_args=
70397
70398if $ac_cs_silent; then
70399  exec 6>/dev/null
70400  ac_configure_extra_args="$ac_configure_extra_args --silent"
70401fi
70402
70403_ACEOF
70404cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
70405if \$ac_cs_recheck; then
70406  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
70407  shift
70408  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
70409  CONFIG_SHELL='$SHELL'
70410  export CONFIG_SHELL
70411  exec "\$@"
70412fi
70413
70414_ACEOF
70415cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
70416exec 5>>config.log
70417{
70418  echo
70419  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
70420## Running $as_me. ##
70421_ASBOX
70422  $as_echo "$ac_log"
70423} >&5
70424
70425_ACEOF
70426cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
70427#
70428# INIT-COMMANDS
70429#
70430AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
70431GNUmakefile=$GNUmakefile
70432# Capture the value of obsolete ALL_LINGUAS because we need it to compute
70433    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
70434    # from automake < 1.5.
70435    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
70436    # Capture the value of LINGUAS because we need it to compute CATALOGS.
70437    LINGUAS="${LINGUAS-%UNSET%}"
70438
70439
70440_ACEOF
70441
70442cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
70443
70444# Handling of arguments.
70445for ac_config_target in $ac_config_targets
70446do
70447  case $ac_config_target in
70448    "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h:lib/config.hin" ;;
70449    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
70450    "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;;
70451    "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
70452    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
70453    "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
70454    "gnulib-tests/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib-tests/Makefile" ;;
70455
70456  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
70457  esac
70458done
70459
70460
70461# If the user did not use the arguments to specify the items to instantiate,
70462# then the envvar interface is used.  Set only those that are not.
70463# We use the long form for the default assignment because of an extremely
70464# bizarre bug on SunOS 4.1.3.
70465if $ac_need_defaults; then
70466  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
70467  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
70468  test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
70469  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
70470fi
70471
70472# Have a temporary directory for convenience.  Make it in the build tree
70473# simply because there is no reason against having it here, and in addition,
70474# creating and moving files from /tmp can sometimes cause problems.
70475# Hook for its removal unless debugging.
70476# Note that there is a small window in which the directory will not be cleaned:
70477# after its creation but before its name has been assigned to `$tmp'.
70478$debug ||
70479{
70480  tmp= ac_tmp=
70481  trap 'exit_status=$?
70482  : "${ac_tmp:=$tmp}"
70483  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
70484' 0
70485  trap 'as_fn_exit 1' 1 2 13 15
70486}
70487# Create a (secure) tmp directory for tmp files.
70488
70489{
70490  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
70491  test -d "$tmp"
70492}  ||
70493{
70494  tmp=./conf$$-$RANDOM
70495  (umask 077 && mkdir "$tmp")
70496} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
70497ac_tmp=$tmp
70498
70499# Set up the scripts for CONFIG_FILES section.
70500# No need to generate them if there are no CONFIG_FILES.
70501# This happens for instance with `./config.status config.h'.
70502if test -n "$CONFIG_FILES"; then
70503
70504
70505ac_cr=`echo X | tr X '\015'`
70506# On cygwin, bash can eat \r inside `` if the user requested igncr.
70507# But we know of no other shell where ac_cr would be empty at this
70508# point, so we can use a bashism as a fallback.
70509if test "x$ac_cr" = x; then
70510  eval ac_cr=\$\'\\r\'
70511fi
70512ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
70513if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
70514  ac_cs_awk_cr='\\r'
70515else
70516  ac_cs_awk_cr=$ac_cr
70517fi
70518
70519echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
70520_ACEOF
70521
70522
70523{
70524  echo "cat >conf$$subs.awk <<_ACEOF" &&
70525  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
70526  echo "_ACEOF"
70527} >conf$$subs.sh ||
70528  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
70529ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
70530ac_delim='%!_!# '
70531for ac_last_try in false false false false false :; do
70532  . ./conf$$subs.sh ||
70533    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
70534
70535  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
70536  if test $ac_delim_n = $ac_delim_num; then
70537    break
70538  elif $ac_last_try; then
70539    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
70540  else
70541    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
70542  fi
70543done
70544rm -f conf$$subs.sh
70545
70546cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
70547cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
70548_ACEOF
70549sed -n '
70550h
70551s/^/S["/; s/!.*/"]=/
70552p
70553g
70554s/^[^!]*!//
70555:repl
70556t repl
70557s/'"$ac_delim"'$//
70558t delim
70559:nl
70560h
70561s/\(.\{148\}\)..*/\1/
70562t more1
70563s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
70564p
70565n
70566b repl
70567:more1
70568s/["\\]/\\&/g; s/^/"/; s/$/"\\/
70569p
70570g
70571s/.\{148\}//
70572t nl
70573:delim
70574h
70575s/\(.\{148\}\)..*/\1/
70576t more2
70577s/["\\]/\\&/g; s/^/"/; s/$/"/
70578p
70579b
70580:more2
70581s/["\\]/\\&/g; s/^/"/; s/$/"\\/
70582p
70583g
70584s/.\{148\}//
70585t delim
70586' <conf$$subs.awk | sed '
70587/^[^""]/{
70588  N
70589  s/\n//
70590}
70591' >>$CONFIG_STATUS || ac_write_fail=1
70592rm -f conf$$subs.awk
70593cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
70594_ACAWK
70595cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
70596  for (key in S) S_is_set[key] = 1
70597  FS = ""
70598
70599}
70600{
70601  line = $ 0
70602  nfields = split(line, field, "@")
70603  substed = 0
70604  len = length(field[1])
70605  for (i = 2; i < nfields; i++) {
70606    key = field[i]
70607    keylen = length(key)
70608    if (S_is_set[key]) {
70609      value = S[key]
70610      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
70611      len += length(value) + length(field[++i])
70612      substed = 1
70613    } else
70614      len += 1 + keylen
70615  }
70616
70617  print line
70618}
70619
70620_ACAWK
70621_ACEOF
70622cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
70623if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
70624  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
70625else
70626  cat
70627fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
70628  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
70629_ACEOF
70630
70631# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
70632# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
70633# trailing colons and then remove the whole line if VPATH becomes empty
70634# (actually we leave an empty line to preserve line numbers).
70635if test "x$srcdir" = x.; then
70636  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
70637h
70638s///
70639s/^/:/
70640s/[	 ]*$/:/
70641s/:\$(srcdir):/:/g
70642s/:\${srcdir}:/:/g
70643s/:@srcdir@:/:/g
70644s/^:*//
70645s/:*$//
70646x
70647s/\(=[	 ]*\).*/\1/
70648G
70649s/\n//
70650s/^[^=]*=[	 ]*$//
70651}'
70652fi
70653
70654cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
70655fi # test -n "$CONFIG_FILES"
70656
70657# Set up the scripts for CONFIG_HEADERS section.
70658# No need to generate them if there are no CONFIG_HEADERS.
70659# This happens for instance with `./config.status Makefile'.
70660if test -n "$CONFIG_HEADERS"; then
70661cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
70662BEGIN {
70663_ACEOF
70664
70665# Transform confdefs.h into an awk script `defines.awk', embedded as
70666# here-document in config.status, that substitutes the proper values into
70667# config.h.in to produce config.h.
70668
70669# Create a delimiter string that does not exist in confdefs.h, to ease
70670# handling of long lines.
70671ac_delim='%!_!# '
70672for ac_last_try in false false :; do
70673  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
70674  if test -z "$ac_tt"; then
70675    break
70676  elif $ac_last_try; then
70677    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
70678  else
70679    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
70680  fi
70681done
70682
70683# For the awk script, D is an array of macro values keyed by name,
70684# likewise P contains macro parameters if any.  Preserve backslash
70685# newline sequences.
70686
70687ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
70688sed -n '
70689s/.\{148\}/&'"$ac_delim"'/g
70690t rset
70691:rset
70692s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
70693t def
70694d
70695:def
70696s/\\$//
70697t bsnl
70698s/["\\]/\\&/g
70699s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
70700D["\1"]=" \3"/p
70701s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
70702d
70703:bsnl
70704s/["\\]/\\&/g
70705s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
70706D["\1"]=" \3\\\\\\n"\\/p
70707t cont
70708s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
70709t cont
70710d
70711:cont
70712n
70713s/.\{148\}/&'"$ac_delim"'/g
70714t clear
70715:clear
70716s/\\$//
70717t bsnlc
70718s/["\\]/\\&/g; s/^/"/; s/$/"/p
70719d
70720:bsnlc
70721s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
70722b cont
70723' <confdefs.h | sed '
70724s/'"$ac_delim"'/"\\\
70725"/g' >>$CONFIG_STATUS || ac_write_fail=1
70726
70727cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
70728  for (key in D) D_is_set[key] = 1
70729  FS = ""
70730}
70731/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
70732  line = \$ 0
70733  split(line, arg, " ")
70734  if (arg[1] == "#") {
70735    defundef = arg[2]
70736    mac1 = arg[3]
70737  } else {
70738    defundef = substr(arg[1], 2)
70739    mac1 = arg[2]
70740  }
70741  split(mac1, mac2, "(") #)
70742  macro = mac2[1]
70743  prefix = substr(line, 1, index(line, defundef) - 1)
70744  if (D_is_set[macro]) {
70745    # Preserve the white space surrounding the "#".
70746    print prefix "define", macro P[macro] D[macro]
70747    next
70748  } else {
70749    # Replace #undef with comments.  This is necessary, for example,
70750    # in the case of _POSIX_SOURCE, which is predefined and required
70751    # on some systems where configure will not decide to define it.
70752    if (defundef == "undef") {
70753      print "/*", prefix defundef, macro, "*/"
70754      next
70755    }
70756  }
70757}
70758{ print }
70759_ACAWK
70760_ACEOF
70761cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
70762  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
70763fi # test -n "$CONFIG_HEADERS"
70764
70765
70766eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
70767shift
70768for ac_tag
70769do
70770  case $ac_tag in
70771  :[FHLC]) ac_mode=$ac_tag; continue;;
70772  esac
70773  case $ac_mode$ac_tag in
70774  :[FHL]*:*);;
70775  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
70776  :[FH]-) ac_tag=-:-;;
70777  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
70778  esac
70779  ac_save_IFS=$IFS
70780  IFS=:
70781  set x $ac_tag
70782  IFS=$ac_save_IFS
70783  shift
70784  ac_file=$1
70785  shift
70786
70787  case $ac_mode in
70788  :L) ac_source=$1;;
70789  :[FH])
70790    ac_file_inputs=
70791    for ac_f
70792    do
70793      case $ac_f in
70794      -) ac_f="$ac_tmp/stdin";;
70795      *) # Look for the file first in the build tree, then in the source tree
70796	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
70797	 # because $ac_f cannot contain `:'.
70798	 test -f "$ac_f" ||
70799	   case $ac_f in
70800	   [\\/$]*) false;;
70801	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
70802	   esac ||
70803	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
70804      esac
70805      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
70806      as_fn_append ac_file_inputs " '$ac_f'"
70807    done
70808
70809    # Let's still pretend it is `configure' which instantiates (i.e., don't
70810    # use $as_me), people would be surprised to read:
70811    #    /* config.h.  Generated by config.status.  */
70812    configure_input='Generated from '`
70813	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
70814	`' by configure.'
70815    if test x"$ac_file" != x-; then
70816      configure_input="$ac_file.  $configure_input"
70817      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
70818$as_echo "$as_me: creating $ac_file" >&6;}
70819    fi
70820    # Neutralize special characters interpreted by sed in replacement strings.
70821    case $configure_input in #(
70822    *\&* | *\|* | *\\* )
70823       ac_sed_conf_input=`$as_echo "$configure_input" |
70824       sed 's/[\\\\&|]/\\\\&/g'`;; #(
70825    *) ac_sed_conf_input=$configure_input;;
70826    esac
70827
70828    case $ac_tag in
70829    *:-:* | *:-) cat >"$ac_tmp/stdin" \
70830      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
70831    esac
70832    ;;
70833  esac
70834
70835  ac_dir=`$as_dirname -- "$ac_file" ||
70836$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
70837	 X"$ac_file" : 'X\(//\)[^/]' \| \
70838	 X"$ac_file" : 'X\(//\)$' \| \
70839	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
70840$as_echo X"$ac_file" |
70841    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
70842	    s//\1/
70843	    q
70844	  }
70845	  /^X\(\/\/\)[^/].*/{
70846	    s//\1/
70847	    q
70848	  }
70849	  /^X\(\/\/\)$/{
70850	    s//\1/
70851	    q
70852	  }
70853	  /^X\(\/\).*/{
70854	    s//\1/
70855	    q
70856	  }
70857	  s/.*/./; q'`
70858  as_dir="$ac_dir"; as_fn_mkdir_p
70859  ac_builddir=.
70860
70861case "$ac_dir" in
70862.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
70863*)
70864  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
70865  # A ".." for each directory in $ac_dir_suffix.
70866  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
70867  case $ac_top_builddir_sub in
70868  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
70869  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
70870  esac ;;
70871esac
70872ac_abs_top_builddir=$ac_pwd
70873ac_abs_builddir=$ac_pwd$ac_dir_suffix
70874# for backward compatibility:
70875ac_top_builddir=$ac_top_build_prefix
70876
70877case $srcdir in
70878  .)  # We are building in place.
70879    ac_srcdir=.
70880    ac_top_srcdir=$ac_top_builddir_sub
70881    ac_abs_top_srcdir=$ac_pwd ;;
70882  [\\/]* | ?:[\\/]* )  # Absolute name.
70883    ac_srcdir=$srcdir$ac_dir_suffix;
70884    ac_top_srcdir=$srcdir
70885    ac_abs_top_srcdir=$srcdir ;;
70886  *) # Relative name.
70887    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
70888    ac_top_srcdir=$ac_top_build_prefix$srcdir
70889    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
70890esac
70891ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
70892
70893
70894  case $ac_mode in
70895  :F)
70896  #
70897  # CONFIG_FILE
70898  #
70899
70900  case $INSTALL in
70901  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
70902  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
70903  esac
70904  ac_MKDIR_P=$MKDIR_P
70905  case $MKDIR_P in
70906  [\\/$]* | ?:[\\/]* ) ;;
70907  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
70908  esac
70909_ACEOF
70910
70911cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
70912# If the template does not know about datarootdir, expand it.
70913# FIXME: This hack should be removed a few years after 2.60.
70914ac_datarootdir_hack=; ac_datarootdir_seen=
70915ac_sed_dataroot='
70916/datarootdir/ {
70917  p
70918  q
70919}
70920/@datadir@/p
70921/@docdir@/p
70922/@infodir@/p
70923/@localedir@/p
70924/@mandir@/p'
70925case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
70926*datarootdir*) ac_datarootdir_seen=yes;;
70927*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
70928  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
70929$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
70930_ACEOF
70931cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
70932  ac_datarootdir_hack='
70933  s&@datadir@&$datadir&g
70934  s&@docdir@&$docdir&g
70935  s&@infodir@&$infodir&g
70936  s&@localedir@&$localedir&g
70937  s&@mandir@&$mandir&g
70938  s&\\\${datarootdir}&$datarootdir&g' ;;
70939esac
70940_ACEOF
70941
70942# Neutralize VPATH when `$srcdir' = `.'.
70943# Shell code in configure.ac might set extrasub.
70944# FIXME: do we really want to maintain this feature?
70945cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
70946ac_sed_extra="$ac_vpsub
70947$extrasub
70948_ACEOF
70949cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
70950:t
70951/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
70952s|@configure_input@|$ac_sed_conf_input|;t t
70953s&@top_builddir@&$ac_top_builddir_sub&;t t
70954s&@top_build_prefix@&$ac_top_build_prefix&;t t
70955s&@srcdir@&$ac_srcdir&;t t
70956s&@abs_srcdir@&$ac_abs_srcdir&;t t
70957s&@top_srcdir@&$ac_top_srcdir&;t t
70958s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
70959s&@builddir@&$ac_builddir&;t t
70960s&@abs_builddir@&$ac_abs_builddir&;t t
70961s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
70962s&@INSTALL@&$ac_INSTALL&;t t
70963s&@MKDIR_P@&$ac_MKDIR_P&;t t
70964$ac_datarootdir_hack
70965"
70966eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
70967  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
70968
70969test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
70970  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
70971  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
70972      "$ac_tmp/out"`; test -z "$ac_out"; } &&
70973  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
70974which seems to be undefined.  Please make sure it is defined" >&5
70975$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
70976which seems to be undefined.  Please make sure it is defined" >&2;}
70977
70978  rm -f "$ac_tmp/stdin"
70979  case $ac_file in
70980  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
70981  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
70982  esac \
70983  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
70984 ;;
70985  :H)
70986  #
70987  # CONFIG_HEADER
70988  #
70989  if test x"$ac_file" != x-; then
70990    {
70991      $as_echo "/* $configure_input  */" \
70992      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
70993    } >"$ac_tmp/config.h" \
70994      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
70995    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
70996      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
70997$as_echo "$as_me: $ac_file is unchanged" >&6;}
70998    else
70999      rm -f "$ac_file"
71000      mv "$ac_tmp/config.h" "$ac_file" \
71001	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
71002    fi
71003  else
71004    $as_echo "/* $configure_input  */" \
71005      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
71006      || as_fn_error $? "could not create -" "$LINENO" 5
71007  fi
71008# Compute "$ac_file"'s index in $config_headers.
71009_am_arg="$ac_file"
71010_am_stamp_count=1
71011for _am_header in $config_headers :; do
71012  case $_am_header in
71013    $_am_arg | $_am_arg:* )
71014      break ;;
71015    * )
71016      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
71017  esac
71018done
71019echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
71020$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
71021	 X"$_am_arg" : 'X\(//\)[^/]' \| \
71022	 X"$_am_arg" : 'X\(//\)$' \| \
71023	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
71024$as_echo X"$_am_arg" |
71025    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
71026	    s//\1/
71027	    q
71028	  }
71029	  /^X\(\/\/\)[^/].*/{
71030	    s//\1/
71031	    q
71032	  }
71033	  /^X\(\/\/\)$/{
71034	    s//\1/
71035	    q
71036	  }
71037	  /^X\(\/\).*/{
71038	    s//\1/
71039	    q
71040	  }
71041	  s/.*/./; q'`/stamp-h$_am_stamp_count
71042 ;;
71043  :L)
71044  #
71045  # CONFIG_LINK
71046  #
71047
71048  if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
71049    :
71050  else
71051    # Prefer the file from the source tree if names are identical.
71052    if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
71053      ac_source=$srcdir/$ac_source
71054    fi
71055
71056    { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
71057$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
71058
71059    if test ! -r "$ac_source"; then
71060      as_fn_error $? "$ac_source: file not found" "$LINENO" 5
71061    fi
71062    rm -f "$ac_file"
71063
71064    # Try a relative symlink, then a hard link, then a copy.
71065    case $ac_source in
71066    [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
71067	*) ac_rel_source=$ac_top_build_prefix$ac_source ;;
71068    esac
71069    ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
71070      ln "$ac_source" "$ac_file" 2>/dev/null ||
71071      cp -p "$ac_source" "$ac_file" ||
71072      as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
71073  fi
71074 ;;
71075  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
71076$as_echo "$as_me: executing $ac_file commands" >&6;}
71077 ;;
71078  esac
71079
71080
71081  case $ac_file$ac_mode in
71082    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
71083  # Older Autoconf quotes --file arguments for eval, but not when files
71084  # are listed without --file.  Let's play safe and only enable the eval
71085  # if we detect the quoting.
71086  case $CONFIG_FILES in
71087  *\'*) eval set x "$CONFIG_FILES" ;;
71088  *)   set x $CONFIG_FILES ;;
71089  esac
71090  shift
71091  for mf
71092  do
71093    # Strip MF so we end up with the name of the file.
71094    mf=`echo "$mf" | sed -e 's/:.*$//'`
71095    # Check whether this is an Automake generated Makefile or not.
71096    # We used to match only the files named 'Makefile.in', but
71097    # some people rename them; so instead we look at the file content.
71098    # Grep'ing the first line is not enough: some people post-process
71099    # each Makefile.in and add a new line on top of each file to say so.
71100    # Grep'ing the whole file is not good either: AIX grep has a line
71101    # limit of 2048, but all sed's we know have understand at least 4000.
71102    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
71103      dirpart=`$as_dirname -- "$mf" ||
71104$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
71105	 X"$mf" : 'X\(//\)[^/]' \| \
71106	 X"$mf" : 'X\(//\)$' \| \
71107	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
71108$as_echo X"$mf" |
71109    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
71110	    s//\1/
71111	    q
71112	  }
71113	  /^X\(\/\/\)[^/].*/{
71114	    s//\1/
71115	    q
71116	  }
71117	  /^X\(\/\/\)$/{
71118	    s//\1/
71119	    q
71120	  }
71121	  /^X\(\/\).*/{
71122	    s//\1/
71123	    q
71124	  }
71125	  s/.*/./; q'`
71126    else
71127      continue
71128    fi
71129    # Extract the definition of DEPDIR, am__include, and am__quote
71130    # from the Makefile without running 'make'.
71131    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
71132    test -z "$DEPDIR" && continue
71133    am__include=`sed -n 's/^am__include = //p' < "$mf"`
71134    test -z "$am__include" && continue
71135    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
71136    # Find all dependency output files, they are included files with
71137    # $(DEPDIR) in their names.  We invoke sed twice because it is the
71138    # simplest approach to changing $(DEPDIR) to its actual value in the
71139    # expansion.
71140    for file in `sed -n "
71141      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
71142	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
71143      # Make sure the directory exists.
71144      test -f "$dirpart/$file" && continue
71145      fdir=`$as_dirname -- "$file" ||
71146$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
71147	 X"$file" : 'X\(//\)[^/]' \| \
71148	 X"$file" : 'X\(//\)$' \| \
71149	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
71150$as_echo X"$file" |
71151    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
71152	    s//\1/
71153	    q
71154	  }
71155	  /^X\(\/\/\)[^/].*/{
71156	    s//\1/
71157	    q
71158	  }
71159	  /^X\(\/\/\)$/{
71160	    s//\1/
71161	    q
71162	  }
71163	  /^X\(\/\).*/{
71164	    s//\1/
71165	    q
71166	  }
71167	  s/.*/./; q'`
71168      as_dir=$dirpart/$fdir; as_fn_mkdir_p
71169      # echo "creating $dirpart/$file"
71170      echo '# dummy' > "$dirpart/$file"
71171    done
71172  done
71173}
71174 ;;
71175    "po-directories":C)
71176    for ac_file in $CONFIG_FILES; do
71177      # Support "outfile[:infile[:infile...]]"
71178      case "$ac_file" in
71179        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
71180      esac
71181      # PO directories have a Makefile.in generated from Makefile.in.in.
71182      case "$ac_file" in */Makefile.in)
71183        # Adjust a relative srcdir.
71184        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
71185        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
71186        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
71187        # In autoconf-2.13 it is called $ac_given_srcdir.
71188        # In autoconf-2.50 it is called $srcdir.
71189        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
71190        case "$ac_given_srcdir" in
71191          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
71192          /*) top_srcdir="$ac_given_srcdir" ;;
71193          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
71194        esac
71195        # Treat a directory as a PO directory if and only if it has a
71196        # POTFILES.in file. This allows packages to have multiple PO
71197        # directories under different names or in different locations.
71198        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
71199          rm -f "$ac_dir/POTFILES"
71200          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
71201          gt_tab=`printf '\t'`
71202          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
71203          POMAKEFILEDEPS="POTFILES.in"
71204          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
71205          # on $ac_dir but don't depend on user-specified configuration
71206          # parameters.
71207          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
71208            # The LINGUAS file contains the set of available languages.
71209            if test -n "$OBSOLETE_ALL_LINGUAS"; then
71210              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
71211            fi
71212            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
71213            # Hide the ALL_LINGUAS assignment from automake < 1.5.
71214            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
71215            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
71216          else
71217            # The set of available languages was given in configure.in.
71218            # Hide the ALL_LINGUAS assignment from automake < 1.5.
71219            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
71220          fi
71221          # Compute POFILES
71222          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
71223          # Compute UPDATEPOFILES
71224          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
71225          # Compute DUMMYPOFILES
71226          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
71227          # Compute GMOFILES
71228          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
71229          case "$ac_given_srcdir" in
71230            .) srcdirpre= ;;
71231            *) srcdirpre='$(srcdir)/' ;;
71232          esac
71233          POFILES=
71234          UPDATEPOFILES=
71235          DUMMYPOFILES=
71236          GMOFILES=
71237          for lang in $ALL_LINGUAS; do
71238            POFILES="$POFILES $srcdirpre$lang.po"
71239            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
71240            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
71241            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
71242          done
71243          # CATALOGS depends on both $ac_dir and the user's LINGUAS
71244          # environment variable.
71245          INST_LINGUAS=
71246          if test -n "$ALL_LINGUAS"; then
71247            for presentlang in $ALL_LINGUAS; do
71248              useit=no
71249              if test "%UNSET%" != "$LINGUAS"; then
71250                desiredlanguages="$LINGUAS"
71251              else
71252                desiredlanguages="$ALL_LINGUAS"
71253              fi
71254              for desiredlang in $desiredlanguages; do
71255                # Use the presentlang catalog if desiredlang is
71256                #   a. equal to presentlang, or
71257                #   b. a variant of presentlang (because in this case,
71258                #      presentlang can be used as a fallback for messages
71259                #      which are not translated in the desiredlang catalog).
71260                case "$desiredlang" in
71261                  "$presentlang"*) useit=yes;;
71262                esac
71263              done
71264              if test $useit = yes; then
71265                INST_LINGUAS="$INST_LINGUAS $presentlang"
71266              fi
71267            done
71268          fi
71269          CATALOGS=
71270          if test -n "$INST_LINGUAS"; then
71271            for lang in $INST_LINGUAS; do
71272              CATALOGS="$CATALOGS $lang.gmo"
71273            done
71274          fi
71275          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
71276          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
71277          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
71278            if test -f "$f"; then
71279              case "$f" in
71280                *.orig | *.bak | *~) ;;
71281                *) cat "$f" >> "$ac_dir/Makefile" ;;
71282              esac
71283            fi
71284          done
71285        fi
71286        ;;
71287      esac
71288    done ;;
71289
71290  esac
71291done # for ac_tag
71292
71293
71294as_fn_exit 0
71295_ACEOF
71296ac_clean_files=$ac_clean_files_save
71297
71298test $ac_write_fail = 0 ||
71299  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
71300
71301
71302# configure is writing to config.log, and then calls config.status.
71303# config.status does its own redirection, appending to config.log.
71304# Unfortunately, on DOS this fails, as config.log is still kept open
71305# by configure, so config.status won't be able to write to it; its
71306# output is simply discarded.  So we exec the FD to /dev/null,
71307# effectively closing config.log, so it can be properly (re)opened and
71308# appended to by config.status.  When coming back to configure, we
71309# need to make the FD available again.
71310if test "$no_create" != yes; then
71311  ac_cs_success=:
71312  ac_config_status_args=
71313  test "$silent" = yes &&
71314    ac_config_status_args="$ac_config_status_args --quiet"
71315  exec 5>/dev/null
71316  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
71317  exec 5>>config.log
71318  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
71319  # would make configure fail if this is the last instruction.
71320  $ac_cs_success || as_fn_exit 1
71321fi
71322if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
71323  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
71324$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
71325fi
71326
71327