* cross-build/cygwin.cache: Add a couple more known settings.
[external/binutils.git] / readline / configure
1 #! /bin/sh
2
3 # From configure.in for Readline 2.2, version 2.07, from autoconf version 2.12.2
4 LIBVERSION=2.2
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91 # Guess values for system-dependent variables and create Makefiles.
92 # Generated automatically using autoconf version 2.12.2 
93 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
94 #
95 # This configure script is free software; the Free Software Foundation
96 # gives unlimited permission to copy, distribute and modify it.
97
98 # Defaults:
99 ac_help=
100 ac_default_prefix=/usr/local
101 # Any additions from configure.in:
102 ac_help="$ac_help
103 --with-curses               use the curses library instead of the termcap library"
104
105 # Initialize some variables set by options.
106 # The variables have the same names as the options, with
107 # dashes changed to underlines.
108 build=NONE
109 cache_file=./config.cache
110 exec_prefix=NONE
111 host=NONE
112 no_create=
113 nonopt=NONE
114 no_recursion=
115 prefix=NONE
116 program_prefix=NONE
117 program_suffix=NONE
118 program_transform_name=s,x,x,
119 silent=
120 site=
121 srcdir=
122 target=NONE
123 verbose=
124 x_includes=NONE
125 x_libraries=NONE
126 bindir='${exec_prefix}/bin'
127 sbindir='${exec_prefix}/sbin'
128 libexecdir='${exec_prefix}/libexec'
129 datadir='${prefix}/share'
130 sysconfdir='${prefix}/etc'
131 sharedstatedir='${prefix}/com'
132 localstatedir='${prefix}/var'
133 libdir='${exec_prefix}/lib'
134 includedir='${prefix}/include'
135 oldincludedir='/usr/include'
136 infodir='${prefix}/info'
137 mandir='${prefix}/man'
138
139 # Initialize some other variables.
140 subdirs=
141 MFLAGS= MAKEFLAGS=
142 SHELL=${CONFIG_SHELL-/bin/sh}
143 # Maximum number of lines to put in a shell here document.
144 ac_max_here_lines=12
145
146 ac_prev=
147 for ac_option
148 do
149
150   # If the previous option needs an argument, assign it.
151   if test -n "$ac_prev"; then
152     eval "$ac_prev=\$ac_option"
153     ac_prev=
154     continue
155   fi
156
157   case "$ac_option" in
158   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
159   *) ac_optarg= ;;
160   esac
161
162   # Accept the important Cygnus configure options, so we can diagnose typos.
163
164   case "$ac_option" in
165
166   -bindir | --bindir | --bindi | --bind | --bin | --bi)
167     ac_prev=bindir ;;
168   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
169     bindir="$ac_optarg" ;;
170
171   -build | --build | --buil | --bui | --bu)
172     ac_prev=build ;;
173   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
174     build="$ac_optarg" ;;
175
176   -cache-file | --cache-file | --cache-fil | --cache-fi \
177   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
178     ac_prev=cache_file ;;
179   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
180   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
181     cache_file="$ac_optarg" ;;
182
183   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
184     ac_prev=datadir ;;
185   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
186   | --da=*)
187     datadir="$ac_optarg" ;;
188
189   -disable-* | --disable-*)
190     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
191     # Reject names that are not valid shell variable names.
192     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
193       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
194     fi
195     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
196     eval "enable_${ac_feature}=no" ;;
197
198   -enable-* | --enable-*)
199     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
200     # Reject names that are not valid shell variable names.
201     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
202       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
203     fi
204     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
205     case "$ac_option" in
206       *=*) ;;
207       *) ac_optarg=yes ;;
208     esac
209     eval "enable_${ac_feature}='$ac_optarg'" ;;
210
211   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
212   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
213   | --exec | --exe | --ex)
214     ac_prev=exec_prefix ;;
215   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
216   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
217   | --exec=* | --exe=* | --ex=*)
218     exec_prefix="$ac_optarg" ;;
219
220   -gas | --gas | --ga | --g)
221     # Obsolete; use --with-gas.
222     with_gas=yes ;;
223
224   -help | --help | --hel | --he)
225     # Omit some internal or obsolete options to make the list less imposing.
226     # This message is too long to be a string in the A/UX 3.1 sh.
227     cat << EOF
228 Usage: configure [options] [host]
229 Options: [defaults in brackets after descriptions]
230 Configuration:
231   --cache-file=FILE       cache test results in FILE
232   --help                  print this message
233   --no-create             do not create output files
234   --quiet, --silent       do not print \`checking...' messages
235   --version               print the version of autoconf that created configure
236 Directory and file names:
237   --prefix=PREFIX         install architecture-independent files in PREFIX
238                           [$ac_default_prefix]
239   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
240                           [same as prefix]
241   --bindir=DIR            user executables in DIR [EPREFIX/bin]
242   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
243   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
244   --datadir=DIR           read-only architecture-independent data in DIR
245                           [PREFIX/share]
246   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
247   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
248                           [PREFIX/com]
249   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
250   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
251   --includedir=DIR        C header files in DIR [PREFIX/include]
252   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
253   --infodir=DIR           info documentation in DIR [PREFIX/info]
254   --mandir=DIR            man documentation in DIR [PREFIX/man]
255   --srcdir=DIR            find the sources in DIR [configure dir or ..]
256   --program-prefix=PREFIX prepend PREFIX to installed program names
257   --program-suffix=SUFFIX append SUFFIX to installed program names
258   --program-transform-name=PROGRAM
259                           run sed PROGRAM on installed program names
260 EOF
261     cat << EOF
262 Host type:
263   --build=BUILD           configure for building on BUILD [BUILD=HOST]
264   --host=HOST             configure for HOST [guessed]
265   --target=TARGET         configure for TARGET [TARGET=HOST]
266 Features and packages:
267   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
268   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
269   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
270   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
271   --x-includes=DIR        X include files are in DIR
272   --x-libraries=DIR       X library files are in DIR
273 EOF
274     if test -n "$ac_help"; then
275       echo "--enable and --with options recognized:$ac_help"
276     fi
277     exit 0 ;;
278
279   -host | --host | --hos | --ho)
280     ac_prev=host ;;
281   -host=* | --host=* | --hos=* | --ho=*)
282     host="$ac_optarg" ;;
283
284   -includedir | --includedir | --includedi | --included | --include \
285   | --includ | --inclu | --incl | --inc)
286     ac_prev=includedir ;;
287   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
288   | --includ=* | --inclu=* | --incl=* | --inc=*)
289     includedir="$ac_optarg" ;;
290
291   -infodir | --infodir | --infodi | --infod | --info | --inf)
292     ac_prev=infodir ;;
293   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
294     infodir="$ac_optarg" ;;
295
296   -libdir | --libdir | --libdi | --libd)
297     ac_prev=libdir ;;
298   -libdir=* | --libdir=* | --libdi=* | --libd=*)
299     libdir="$ac_optarg" ;;
300
301   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
302   | --libexe | --libex | --libe)
303     ac_prev=libexecdir ;;
304   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
305   | --libexe=* | --libex=* | --libe=*)
306     libexecdir="$ac_optarg" ;;
307
308   -localstatedir | --localstatedir | --localstatedi | --localstated \
309   | --localstate | --localstat | --localsta | --localst \
310   | --locals | --local | --loca | --loc | --lo)
311     ac_prev=localstatedir ;;
312   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
313   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
314   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
315     localstatedir="$ac_optarg" ;;
316
317   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
318     ac_prev=mandir ;;
319   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
320     mandir="$ac_optarg" ;;
321
322   -nfp | --nfp | --nf)
323     # Obsolete; use --without-fp.
324     with_fp=no ;;
325
326   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
327   | --no-cr | --no-c)
328     no_create=yes ;;
329
330   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
331   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
332     no_recursion=yes ;;
333
334   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
335   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
336   | --oldin | --oldi | --old | --ol | --o)
337     ac_prev=oldincludedir ;;
338   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
339   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
340   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
341     oldincludedir="$ac_optarg" ;;
342
343   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
344     ac_prev=prefix ;;
345   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
346     prefix="$ac_optarg" ;;
347
348   -program-prefix | --program-prefix | --program-prefi | --program-pref \
349   | --program-pre | --program-pr | --program-p)
350     ac_prev=program_prefix ;;
351   -program-prefix=* | --program-prefix=* | --program-prefi=* \
352   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
353     program_prefix="$ac_optarg" ;;
354
355   -program-suffix | --program-suffix | --program-suffi | --program-suff \
356   | --program-suf | --program-su | --program-s)
357     ac_prev=program_suffix ;;
358   -program-suffix=* | --program-suffix=* | --program-suffi=* \
359   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
360     program_suffix="$ac_optarg" ;;
361
362   -program-transform-name | --program-transform-name \
363   | --program-transform-nam | --program-transform-na \
364   | --program-transform-n | --program-transform- \
365   | --program-transform | --program-transfor \
366   | --program-transfo | --program-transf \
367   | --program-trans | --program-tran \
368   | --progr-tra | --program-tr | --program-t)
369     ac_prev=program_transform_name ;;
370   -program-transform-name=* | --program-transform-name=* \
371   | --program-transform-nam=* | --program-transform-na=* \
372   | --program-transform-n=* | --program-transform-=* \
373   | --program-transform=* | --program-transfor=* \
374   | --program-transfo=* | --program-transf=* \
375   | --program-trans=* | --program-tran=* \
376   | --progr-tra=* | --program-tr=* | --program-t=*)
377     program_transform_name="$ac_optarg" ;;
378
379   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
380   | -silent | --silent | --silen | --sile | --sil)
381     silent=yes ;;
382
383   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
384     ac_prev=sbindir ;;
385   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
386   | --sbi=* | --sb=*)
387     sbindir="$ac_optarg" ;;
388
389   -sharedstatedir | --sharedstatedir | --sharedstatedi \
390   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
391   | --sharedst | --shareds | --shared | --share | --shar \
392   | --sha | --sh)
393     ac_prev=sharedstatedir ;;
394   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
395   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
396   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
397   | --sha=* | --sh=*)
398     sharedstatedir="$ac_optarg" ;;
399
400   -site | --site | --sit)
401     ac_prev=site ;;
402   -site=* | --site=* | --sit=*)
403     site="$ac_optarg" ;;
404
405   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
406     ac_prev=srcdir ;;
407   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
408     srcdir="$ac_optarg" ;;
409
410   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
411   | --syscon | --sysco | --sysc | --sys | --sy)
412     ac_prev=sysconfdir ;;
413   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
414   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
415     sysconfdir="$ac_optarg" ;;
416
417   -target | --target | --targe | --targ | --tar | --ta | --t)
418     ac_prev=target ;;
419   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
420     target="$ac_optarg" ;;
421
422   -v | -verbose | --verbose | --verbos | --verbo | --verb)
423     verbose=yes ;;
424
425   -version | --version | --versio | --versi | --vers)
426     echo "configure generated by autoconf version 2.12.2"
427     exit 0 ;;
428
429   -with-* | --with-*)
430     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
431     # Reject names that are not valid shell variable names.
432     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
433       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
434     fi
435     ac_package=`echo $ac_package| sed 's/-/_/g'`
436     case "$ac_option" in
437       *=*) ;;
438       *) ac_optarg=yes ;;
439     esac
440     eval "with_${ac_package}='$ac_optarg'" ;;
441
442   -without-* | --without-*)
443     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
444     # Reject names that are not valid shell variable names.
445     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
446       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
447     fi
448     ac_package=`echo $ac_package| sed 's/-/_/g'`
449     eval "with_${ac_package}=no" ;;
450
451   --x)
452     # Obsolete; use --with-x.
453     with_x=yes ;;
454
455   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
456   | --x-incl | --x-inc | --x-in | --x-i)
457     ac_prev=x_includes ;;
458   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
459   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
460     x_includes="$ac_optarg" ;;
461
462   -x-libraries | --x-libraries | --x-librarie | --x-librari \
463   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
464     ac_prev=x_libraries ;;
465   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
466   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
467     x_libraries="$ac_optarg" ;;
468
469   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
470     ;;
471
472   *)
473     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
474       echo "configure: warning: $ac_option: invalid host type" 1>&2
475     fi
476     if test "x$nonopt" != xNONE; then
477       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
478     fi
479     nonopt="$ac_option"
480     ;;
481
482   esac
483 done
484
485 if test -n "$ac_prev"; then
486   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
487 fi
488
489 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
490
491 # File descriptor usage:
492 # 0 standard input
493 # 1 file creation
494 # 2 errors and warnings
495 # 3 some systems may open it to /dev/tty
496 # 4 used on the Kubota Titan
497 # 6 checking for... messages and results
498 # 5 compiler messages saved in config.log
499 if test "$silent" = yes; then
500   exec 6>/dev/null
501 else
502   exec 6>&1
503 fi
504 exec 5>./config.log
505
506 echo "\
507 This file contains any messages produced by compilers while
508 running configure, to aid debugging if configure makes a mistake.
509 " 1>&5
510
511 # Strip out --no-create and --no-recursion so they do not pile up.
512 # Also quote any args containing shell metacharacters.
513 ac_configure_args=
514 for ac_arg
515 do
516   case "$ac_arg" in
517   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
518   | --no-cr | --no-c) ;;
519   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
520   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
521   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
522   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
523   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
524   esac
525 done
526
527 # NLS nuisances.
528 # Only set these to C if already set.  These must not be set unconditionally
529 # because not all systems understand e.g. LANG=C (notably SCO).
530 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
531 # Non-C LC_CTYPE values break the ctype check.
532 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
533 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
534 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
535 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
536
537 # confdefs.h avoids OS command line length limits that DEFS can exceed.
538 rm -rf conftest* confdefs.h
539 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
540 echo > confdefs.h
541
542 # A filename unique to this package, relative to the directory that
543 # configure is in, which we can look for to find out if srcdir is correct.
544 ac_unique_file=readline.h
545
546 # Find the source files, if location was not specified.
547 if test -z "$srcdir"; then
548   ac_srcdir_defaulted=yes
549   # Try the directory containing this script, then its parent.
550   ac_prog=$0
551   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
552   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
553   srcdir=$ac_confdir
554   if test ! -r $srcdir/$ac_unique_file; then
555     srcdir=..
556   fi
557 else
558   ac_srcdir_defaulted=no
559 fi
560 if test ! -r $srcdir/$ac_unique_file; then
561   if test "$ac_srcdir_defaulted" = yes; then
562     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
563   else
564     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
565   fi
566 fi
567 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
568
569 # Prefer explicitly selected file to automatically selected ones.
570 if test -z "$CONFIG_SITE"; then
571   if test "x$prefix" != xNONE; then
572     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
573   else
574     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
575   fi
576 fi
577 for ac_site_file in $CONFIG_SITE; do
578   if test -r "$ac_site_file"; then
579     echo "loading site script $ac_site_file"
580     . "$ac_site_file"
581   fi
582 done
583
584 if test -r "$cache_file"; then
585   echo "loading cache $cache_file"
586   . $cache_file
587 else
588   echo "creating cache $cache_file"
589   > $cache_file
590 fi
591
592 ac_ext=c
593 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
594 ac_cpp='$CPP $CPPFLAGS'
595 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
596 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
597 cross_compiling=$ac_cv_prog_cc_cross
598
599 ac_exeext=
600 ac_objext=o
601 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
602   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
603   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
604     ac_n= ac_c='
605 ' ac_t='        '
606   else
607     ac_n=-n ac_c= ac_t=
608   fi
609 else
610   ac_n= ac_c='\c' ac_t=
611 fi
612
613
614
615
616
617
618 ac_aux_dir=
619 for ac_dir in ./support $srcdir/./support; do
620   if test -f $ac_dir/install-sh; then
621     ac_aux_dir=$ac_dir
622     ac_install_sh="$ac_aux_dir/install-sh -c"
623     break
624   elif test -f $ac_dir/install.sh; then
625     ac_aux_dir=$ac_dir
626     ac_install_sh="$ac_aux_dir/install.sh -c"
627     break
628   fi
629 done
630 if test -z "$ac_aux_dir"; then
631   { echo "configure: error: can not find install-sh or install.sh in ./support $srcdir/./support" 1>&2; exit 1; }
632 fi
633 ac_config_guess=$ac_aux_dir/config.guess
634 ac_config_sub=$ac_aux_dir/config.sub
635 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
636
637
638
639 # Make sure we can run config.sub.
640 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
641 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
642 fi
643
644 echo $ac_n "checking host system type""... $ac_c" 1>&6
645 echo "configure:646: checking host system type" >&5
646
647 host_alias=$host
648 case "$host_alias" in
649 NONE)
650   case $nonopt in
651   NONE)
652     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
653     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
654     fi ;;
655   *) host_alias=$nonopt ;;
656   esac ;;
657 esac
658
659 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
660 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
661 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
662 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
663 echo "$ac_t""$host" 1>&6
664
665
666 opt_curses=no
667 opt_shared=no
668
669 # Check whether --with-curses or --without-curses was given.
670 if test "${with_curses+set}" = set; then
671   withval="$with_curses"
672   opt_curses=$withval
673 fi
674
675
676 if test "$opt_curses" = "yes"; then
677         prefer_curses=yes
678 fi
679
680 # We want these before the checks, so the checks can modify their values.
681 test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
682
683 # Extract the first word of "gcc", so it can be a program name with args.
684 set dummy gcc; ac_word=$2
685 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
686 echo "configure:687: checking for $ac_word" >&5
687 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
688   echo $ac_n "(cached) $ac_c" 1>&6
689 else
690   if test -n "$CC"; then
691   ac_cv_prog_CC="$CC" # Let the user override the test.
692 else
693   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
694   for ac_dir in $PATH; do
695     test -z "$ac_dir" && ac_dir=.
696     if test -f $ac_dir/$ac_word; then
697       ac_cv_prog_CC="gcc"
698       break
699     fi
700   done
701   IFS="$ac_save_ifs"
702 fi
703 fi
704 CC="$ac_cv_prog_CC"
705 if test -n "$CC"; then
706   echo "$ac_t""$CC" 1>&6
707 else
708   echo "$ac_t""no" 1>&6
709 fi
710
711 if test -z "$CC"; then
712   # Extract the first word of "cc", so it can be a program name with args.
713 set dummy cc; ac_word=$2
714 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
715 echo "configure:716: checking for $ac_word" >&5
716 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
717   echo $ac_n "(cached) $ac_c" 1>&6
718 else
719   if test -n "$CC"; then
720   ac_cv_prog_CC="$CC" # Let the user override the test.
721 else
722   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
723   ac_prog_rejected=no
724   for ac_dir in $PATH; do
725     test -z "$ac_dir" && ac_dir=.
726     if test -f $ac_dir/$ac_word; then
727       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
728         ac_prog_rejected=yes
729         continue
730       fi
731       ac_cv_prog_CC="cc"
732       break
733     fi
734   done
735   IFS="$ac_save_ifs"
736 if test $ac_prog_rejected = yes; then
737   # We found a bogon in the path, so make sure we never use it.
738   set dummy $ac_cv_prog_CC
739   shift
740   if test $# -gt 0; then
741     # We chose a different compiler from the bogus one.
742     # However, it has the same basename, so the bogon will be chosen
743     # first if we set CC to just the basename; use the full file name.
744     shift
745     set dummy "$ac_dir/$ac_word" "$@"
746     shift
747     ac_cv_prog_CC="$@"
748   fi
749 fi
750 fi
751 fi
752 CC="$ac_cv_prog_CC"
753 if test -n "$CC"; then
754   echo "$ac_t""$CC" 1>&6
755 else
756   echo "$ac_t""no" 1>&6
757 fi
758
759   if test -z "$CC"; then
760     case "`uname -s`" in
761     *win32* | *WIN32*)
762       # Extract the first word of "cl", so it can be a program name with args.
763 set dummy cl; ac_word=$2
764 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
765 echo "configure:766: checking for $ac_word" >&5
766 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
767   echo $ac_n "(cached) $ac_c" 1>&6
768 else
769   if test -n "$CC"; then
770   ac_cv_prog_CC="$CC" # Let the user override the test.
771 else
772   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
773   for ac_dir in $PATH; do
774     test -z "$ac_dir" && ac_dir=.
775     if test -f $ac_dir/$ac_word; then
776       ac_cv_prog_CC="cl"
777       break
778     fi
779   done
780   IFS="$ac_save_ifs"
781 fi
782 fi
783 CC="$ac_cv_prog_CC"
784 if test -n "$CC"; then
785   echo "$ac_t""$CC" 1>&6
786 else
787   echo "$ac_t""no" 1>&6
788 fi
789  ;;
790     esac
791   fi
792   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
793 fi
794
795 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
796 echo "configure:797: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
797
798 ac_ext=c
799 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
800 ac_cpp='$CPP $CPPFLAGS'
801 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
802 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
803 cross_compiling=$ac_cv_prog_cc_cross
804
805 cat > conftest.$ac_ext <<EOF
806 #line 807 "configure"
807 #include "confdefs.h"
808 main(){return(0);}
809 EOF
810 if { (eval echo configure:811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
811   ac_cv_prog_cc_works=yes
812   # If we can't run a trivial program, we are probably using a cross compiler.
813   if (./conftest; exit) 2>/dev/null; then
814     ac_cv_prog_cc_cross=no
815   else
816     ac_cv_prog_cc_cross=yes
817   fi
818 else
819   echo "configure: failed program was:" >&5
820   cat conftest.$ac_ext >&5
821   ac_cv_prog_cc_works=no
822 fi
823 rm -fr conftest*
824
825 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
826 if test $ac_cv_prog_cc_works = no; then
827   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
828 fi
829 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
830 echo "configure:831: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
831 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
832 cross_compiling=$ac_cv_prog_cc_cross
833
834 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
835 echo "configure:836: checking whether we are using GNU C" >&5
836 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
837   echo $ac_n "(cached) $ac_c" 1>&6
838 else
839   cat > conftest.c <<EOF
840 #ifdef __GNUC__
841   yes;
842 #endif
843 EOF
844 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
845   ac_cv_prog_gcc=yes
846 else
847   ac_cv_prog_gcc=no
848 fi
849 fi
850
851 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
852
853 if test $ac_cv_prog_gcc = yes; then
854   GCC=yes
855 else
856   GCC=
857 fi
858
859 ac_test_CFLAGS="${CFLAGS+set}"
860 ac_save_CFLAGS="$CFLAGS"
861 CFLAGS=
862 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
863 echo "configure:864: checking whether ${CC-cc} accepts -g" >&5
864 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
865   echo $ac_n "(cached) $ac_c" 1>&6
866 else
867   echo 'void f(){}' > conftest.c
868 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
869   ac_cv_prog_cc_g=yes
870 else
871   ac_cv_prog_cc_g=no
872 fi
873 rm -f conftest*
874
875 fi
876
877 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
878 if test "$ac_test_CFLAGS" = set; then
879   CFLAGS="$ac_save_CFLAGS"
880 elif test $ac_cv_prog_cc_g = yes; then
881   if test "$GCC" = yes; then
882     CFLAGS="-g -O2"
883   else
884     CFLAGS="-g"
885   fi
886 else
887   if test "$GCC" = yes; then
888     CFLAGS="-O2"
889   else
890     CFLAGS=
891   fi
892 fi
893
894 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
895 echo "configure:896: checking how to run the C preprocessor" >&5
896 # On Suns, sometimes $CPP names a directory.
897 if test -n "$CPP" && test -d "$CPP"; then
898   CPP=
899 fi
900 if test -z "$CPP"; then
901 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
902   echo $ac_n "(cached) $ac_c" 1>&6
903 else
904     # This must be in double quotes, not single quotes, because CPP may get
905   # substituted into the Makefile and "${CC-cc}" will confuse make.
906   CPP="${CC-cc} -E"
907   # On the NeXT, cc -E runs the code through the compiler's parser,
908   # not just through cpp.
909   cat > conftest.$ac_ext <<EOF
910 #line 911 "configure"
911 #include "confdefs.h"
912 #include <assert.h>
913 Syntax Error
914 EOF
915 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
916 { (eval echo configure:917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
917 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
918 if test -z "$ac_err"; then
919   :
920 else
921   echo "$ac_err" >&5
922   echo "configure: failed program was:" >&5
923   cat conftest.$ac_ext >&5
924   rm -rf conftest*
925   CPP="${CC-cc} -E -traditional-cpp"
926   cat > conftest.$ac_ext <<EOF
927 #line 928 "configure"
928 #include "confdefs.h"
929 #include <assert.h>
930 Syntax Error
931 EOF
932 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
933 { (eval echo configure:934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
934 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
935 if test -z "$ac_err"; then
936   :
937 else
938   echo "$ac_err" >&5
939   echo "configure: failed program was:" >&5
940   cat conftest.$ac_ext >&5
941   rm -rf conftest*
942   CPP="${CC-cc} -nologo -E"
943   cat > conftest.$ac_ext <<EOF
944 #line 945 "configure"
945 #include "confdefs.h"
946 #include <assert.h>
947 Syntax Error
948 EOF
949 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
950 { (eval echo configure:951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
951 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
952 if test -z "$ac_err"; then
953   :
954 else
955   echo "$ac_err" >&5
956   echo "configure: failed program was:" >&5
957   cat conftest.$ac_ext >&5
958   rm -rf conftest*
959   CPP=/lib/cpp
960 fi
961 rm -f conftest*
962 fi
963 rm -f conftest*
964 fi
965 rm -f conftest*
966   ac_cv_prog_CPP="$CPP"
967 fi
968   CPP="$ac_cv_prog_CPP"
969 else
970   ac_cv_prog_CPP="$CPP"
971 fi
972 echo "$ac_t""$CPP" 1>&6
973
974 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
975 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
976 echo "configure:977: checking for minix/config.h" >&5
977 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
978   echo $ac_n "(cached) $ac_c" 1>&6
979 else
980   cat > conftest.$ac_ext <<EOF
981 #line 982 "configure"
982 #include "confdefs.h"
983 #include <minix/config.h>
984 EOF
985 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
986 { (eval echo configure:987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
987 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
988 if test -z "$ac_err"; then
989   rm -rf conftest*
990   eval "ac_cv_header_$ac_safe=yes"
991 else
992   echo "$ac_err" >&5
993   echo "configure: failed program was:" >&5
994   cat conftest.$ac_ext >&5
995   rm -rf conftest*
996   eval "ac_cv_header_$ac_safe=no"
997 fi
998 rm -f conftest*
999 fi
1000 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1001   echo "$ac_t""yes" 1>&6
1002   MINIX=yes
1003 else
1004   echo "$ac_t""no" 1>&6
1005 MINIX=
1006 fi
1007
1008 if test "$MINIX" = yes; then
1009   cat >> confdefs.h <<\EOF
1010 #define _POSIX_SOURCE 1
1011 EOF
1012
1013   cat >> confdefs.h <<\EOF
1014 #define _POSIX_1_SOURCE 2
1015 EOF
1016
1017   cat >> confdefs.h <<\EOF
1018 #define _MINIX 1
1019 EOF
1020
1021 fi
1022
1023
1024
1025  
1026 if test "x$cross_compiling" = "xyes"; then
1027     case "${host}" in
1028     *-cygwin*)
1029         cross_cache=${srcdir}/cross-build/cygwin.cache
1030         if test -r "${cross_cache}"; then
1031             echo "loading cross-build cache file ${cross_cache}"
1032             . ${cross_cache}
1033         fi
1034         unset cross_cache
1035         ;;
1036     *)  echo "configure: cross-compiling for a non-cygwin target is not supported" >&2
1037         ;;
1038     esac
1039 fi
1040  
1041 if test "x$cross_compiling" = "xyes"; then
1042   CROSS_COMPILING_FLAG=-DCROSS_COMPILING
1043 else
1044   CROSS_COMPILING_FLAG=
1045 fi
1046
1047  
1048 if test -z "$CC_FOR_BUILD"; then
1049     if test "x$cross_compiling" = "xno"; then
1050         CC_FOR_BUILD='$(CC)'
1051     else
1052         CC_FOR_BUILD=gcc
1053     fi
1054 fi
1055
1056  
1057
1058
1059
1060 # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
1061 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
1062
1063 if test $ac_cv_prog_gcc = yes; then
1064     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
1065 echo "configure:1066: checking whether ${CC-cc} needs -traditional" >&5
1066 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
1067   echo $ac_n "(cached) $ac_c" 1>&6
1068 else
1069     ac_pattern="Autoconf.*'x'"
1070   cat > conftest.$ac_ext <<EOF
1071 #line 1072 "configure"
1072 #include "confdefs.h"
1073 #include <sgtty.h>
1074 Autoconf TIOCGETP
1075 EOF
1076 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1077   egrep "$ac_pattern" >/dev/null 2>&1; then
1078   rm -rf conftest*
1079   ac_cv_prog_gcc_traditional=yes
1080 else
1081   rm -rf conftest*
1082   ac_cv_prog_gcc_traditional=no
1083 fi
1084 rm -f conftest*
1085
1086
1087   if test $ac_cv_prog_gcc_traditional = no; then
1088     cat > conftest.$ac_ext <<EOF
1089 #line 1090 "configure"
1090 #include "confdefs.h"
1091 #include <termio.h>
1092 Autoconf TCGETA
1093 EOF
1094 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1095   egrep "$ac_pattern" >/dev/null 2>&1; then
1096   rm -rf conftest*
1097   ac_cv_prog_gcc_traditional=yes
1098 fi
1099 rm -f conftest*
1100
1101   fi
1102 fi
1103
1104 echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
1105   if test $ac_cv_prog_gcc_traditional = yes; then
1106     CC="$CC -traditional"
1107   fi
1108 fi
1109
1110 # Find a good install program.  We prefer a C program (faster),
1111 # so one script is as good as another.  But avoid the broken or
1112 # incompatible versions:
1113 # SysV /etc/install, /usr/sbin/install
1114 # SunOS /usr/etc/install
1115 # IRIX /sbin/install
1116 # AIX /bin/install
1117 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1118 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1119 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1120 # ./install, which can be erroneously created by make from ./install.sh.
1121 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1122 echo "configure:1123: checking for a BSD compatible install" >&5
1123 if test -z "$INSTALL"; then
1124 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1125   echo $ac_n "(cached) $ac_c" 1>&6
1126 else
1127     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1128   for ac_dir in $PATH; do
1129     # Account for people who put trailing slashes in PATH elements.
1130     case "$ac_dir/" in
1131     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1132     *)
1133       # OSF1 and SCO ODT 3.0 have their own names for install.
1134       # Don't use installbsd from OSF since it installs stuff as root
1135       # by default.
1136       for ac_prog in ginstall scoinst install; do
1137         if test -f $ac_dir/$ac_prog; then
1138           if test $ac_prog = install &&
1139             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1140             # AIX install.  It has an incompatible calling convention.
1141             :
1142           else
1143             ac_cv_path_install="$ac_dir/$ac_prog -c"
1144             break 2
1145           fi
1146         fi
1147       done
1148       ;;
1149     esac
1150   done
1151   IFS="$ac_save_IFS"
1152
1153 fi
1154   if test "${ac_cv_path_install+set}" = set; then
1155     INSTALL="$ac_cv_path_install"
1156   else
1157     # As a last resort, use the slow shell script.  We don't cache a
1158     # path for INSTALL within a source directory, because that will
1159     # break other packages using the cache if that directory is
1160     # removed, or if the path is relative.
1161     INSTALL="$ac_install_sh"
1162   fi
1163 fi
1164 echo "$ac_t""$INSTALL" 1>&6
1165
1166 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1167 # It thinks the first close brace ends the variable substitution.
1168 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1169
1170 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1171
1172 # Extract the first word of "ranlib", so it can be a program name with args.
1173 set dummy ranlib; ac_word=$2
1174 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1175 echo "configure:1176: checking for $ac_word" >&5
1176 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1177   echo $ac_n "(cached) $ac_c" 1>&6
1178 else
1179   if test -n "$RANLIB"; then
1180   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1181 else
1182   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1183   for ac_dir in $PATH; do
1184     test -z "$ac_dir" && ac_dir=.
1185     if test -f $ac_dir/$ac_word; then
1186       ac_cv_prog_RANLIB="ranlib"
1187       break
1188     fi
1189   done
1190   IFS="$ac_save_ifs"
1191   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1192 fi
1193 fi
1194 RANLIB="$ac_cv_prog_RANLIB"
1195 if test -n "$RANLIB"; then
1196   echo "$ac_t""$RANLIB" 1>&6
1197 else
1198   echo "$ac_t""no" 1>&6
1199 fi
1200
1201
1202 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
1203 echo "configure:1204: checking return type of signal handlers" >&5
1204 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
1205   echo $ac_n "(cached) $ac_c" 1>&6
1206 else
1207   cat > conftest.$ac_ext <<EOF
1208 #line 1209 "configure"
1209 #include "confdefs.h"
1210 #include <sys/types.h>
1211 #include <signal.h>
1212 #ifdef signal
1213 #undef signal
1214 #endif
1215 #ifdef __cplusplus
1216 extern "C" void (*signal (int, void (*)(int)))(int);
1217 #else
1218 void (*signal ()) ();
1219 #endif
1220
1221 int main() {
1222 int i;
1223 ; return 0; }
1224 EOF
1225 if { (eval echo configure:1226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1226   rm -rf conftest*
1227   ac_cv_type_signal=void
1228 else
1229   echo "configure: failed program was:" >&5
1230   cat conftest.$ac_ext >&5
1231   rm -rf conftest*
1232   ac_cv_type_signal=int
1233 fi
1234 rm -f conftest*
1235 fi
1236
1237 echo "$ac_t""$ac_cv_type_signal" 1>&6
1238 cat >> confdefs.h <<EOF
1239 #define RETSIGTYPE $ac_cv_type_signal
1240 EOF
1241
1242
1243
1244 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
1245 echo "configure:1246: checking whether stat file-mode macros are broken" >&5
1246 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
1247   echo $ac_n "(cached) $ac_c" 1>&6
1248 else
1249   cat > conftest.$ac_ext <<EOF
1250 #line 1251 "configure"
1251 #include "confdefs.h"
1252 #include <sys/types.h>
1253 #include <sys/stat.h>
1254
1255 #if defined(S_ISBLK) && defined(S_IFDIR)
1256 # if S_ISBLK (S_IFDIR)
1257 You lose.
1258 # endif
1259 #endif
1260
1261 #if defined(S_ISBLK) && defined(S_IFCHR)
1262 # if S_ISBLK (S_IFCHR)
1263 You lose.
1264 # endif
1265 #endif
1266
1267 #if defined(S_ISLNK) && defined(S_IFREG)
1268 # if S_ISLNK (S_IFREG)
1269 You lose.
1270 # endif
1271 #endif
1272
1273 #if defined(S_ISSOCK) && defined(S_IFREG)
1274 # if S_ISSOCK (S_IFREG)
1275 You lose.
1276 # endif
1277 #endif
1278
1279 EOF
1280 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1281   egrep "You lose" >/dev/null 2>&1; then
1282   rm -rf conftest*
1283   ac_cv_header_stat_broken=yes
1284 else
1285   rm -rf conftest*
1286   ac_cv_header_stat_broken=no
1287 fi
1288 rm -f conftest*
1289
1290 fi
1291
1292 echo "$ac_t""$ac_cv_header_stat_broken" 1>&6
1293 if test $ac_cv_header_stat_broken = yes; then
1294   cat >> confdefs.h <<\EOF
1295 #define STAT_MACROS_BROKEN 1
1296 EOF
1297
1298 fi
1299
1300 ac_header_dirent=no
1301 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
1302 do
1303 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1304 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
1305 echo "configure:1306: checking for $ac_hdr that defines DIR" >&5
1306 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
1307   echo $ac_n "(cached) $ac_c" 1>&6
1308 else
1309   cat > conftest.$ac_ext <<EOF
1310 #line 1311 "configure"
1311 #include "confdefs.h"
1312 #include <sys/types.h>
1313 #include <$ac_hdr>
1314 int main() {
1315 DIR *dirp = 0;
1316 ; return 0; }
1317 EOF
1318 if { (eval echo configure:1319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1319   rm -rf conftest*
1320   eval "ac_cv_header_dirent_$ac_safe=yes"
1321 else
1322   echo "configure: failed program was:" >&5
1323   cat conftest.$ac_ext >&5
1324   rm -rf conftest*
1325   eval "ac_cv_header_dirent_$ac_safe=no"
1326 fi
1327 rm -f conftest*
1328 fi
1329 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
1330   echo "$ac_t""yes" 1>&6
1331     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1332   cat >> confdefs.h <<EOF
1333 #define $ac_tr_hdr 1
1334 EOF
1335  ac_header_dirent=$ac_hdr; break
1336 else
1337   echo "$ac_t""no" 1>&6
1338 fi
1339 done
1340 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
1341 if test $ac_header_dirent = dirent.h; then
1342 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
1343 echo "configure:1344: checking for opendir in -ldir" >&5
1344 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
1345 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1346   echo $ac_n "(cached) $ac_c" 1>&6
1347 else
1348   ac_save_LIBS="$LIBS"
1349 LIBS="-ldir  $LIBS"
1350 cat > conftest.$ac_ext <<EOF
1351 #line 1352 "configure"
1352 #include "confdefs.h"
1353 /* Override any gcc2 internal prototype to avoid an error.  */
1354 /* We use char because int might match the return type of a gcc2
1355     builtin and then its argument prototype would still apply.  */
1356 char opendir();
1357
1358 int main() {
1359 opendir()
1360 ; return 0; }
1361 EOF
1362 if { (eval echo configure:1363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1363   rm -rf conftest*
1364   eval "ac_cv_lib_$ac_lib_var=yes"
1365 else
1366   echo "configure: failed program was:" >&5
1367   cat conftest.$ac_ext >&5
1368   rm -rf conftest*
1369   eval "ac_cv_lib_$ac_lib_var=no"
1370 fi
1371 rm -f conftest*
1372 LIBS="$ac_save_LIBS"
1373
1374 fi
1375 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1376   echo "$ac_t""yes" 1>&6
1377   LIBS="$LIBS -ldir"
1378 else
1379   echo "$ac_t""no" 1>&6
1380 fi
1381
1382 else
1383 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
1384 echo "configure:1385: checking for opendir in -lx" >&5
1385 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
1386 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1387   echo $ac_n "(cached) $ac_c" 1>&6
1388 else
1389   ac_save_LIBS="$LIBS"
1390 LIBS="-lx  $LIBS"
1391 cat > conftest.$ac_ext <<EOF
1392 #line 1393 "configure"
1393 #include "confdefs.h"
1394 /* Override any gcc2 internal prototype to avoid an error.  */
1395 /* We use char because int might match the return type of a gcc2
1396     builtin and then its argument prototype would still apply.  */
1397 char opendir();
1398
1399 int main() {
1400 opendir()
1401 ; return 0; }
1402 EOF
1403 if { (eval echo configure:1404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1404   rm -rf conftest*
1405   eval "ac_cv_lib_$ac_lib_var=yes"
1406 else
1407   echo "configure: failed program was:" >&5
1408   cat conftest.$ac_ext >&5
1409   rm -rf conftest*
1410   eval "ac_cv_lib_$ac_lib_var=no"
1411 fi
1412 rm -f conftest*
1413 LIBS="$ac_save_LIBS"
1414
1415 fi
1416 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1417   echo "$ac_t""yes" 1>&6
1418   LIBS="$LIBS -lx"
1419 else
1420   echo "$ac_t""no" 1>&6
1421 fi
1422
1423 fi
1424
1425
1426 for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat
1427 do
1428 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1429 echo "configure:1430: checking for $ac_func" >&5
1430 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1431   echo $ac_n "(cached) $ac_c" 1>&6
1432 else
1433   cat > conftest.$ac_ext <<EOF
1434 #line 1435 "configure"
1435 #include "confdefs.h"
1436 /* System header to define __stub macros and hopefully few prototypes,
1437     which can conflict with char $ac_func(); below.  */
1438 #include <assert.h>
1439 /* Override any gcc2 internal prototype to avoid an error.  */
1440 /* We use char because int might match the return type of a gcc2
1441     builtin and then its argument prototype would still apply.  */
1442 char $ac_func();
1443
1444 int main() {
1445
1446 /* The GNU C library defines this for functions which it implements
1447     to always fail with ENOSYS.  Some functions are actually named
1448     something starting with __ and the normal name is an alias.  */
1449 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1450 choke me
1451 #else
1452 $ac_func();
1453 #endif
1454
1455 ; return 0; }
1456 EOF
1457 if { (eval echo configure:1458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1458   rm -rf conftest*
1459   eval "ac_cv_func_$ac_func=yes"
1460 else
1461   echo "configure: failed program was:" >&5
1462   cat conftest.$ac_ext >&5
1463   rm -rf conftest*
1464   eval "ac_cv_func_$ac_func=no"
1465 fi
1466 rm -f conftest*
1467 fi
1468
1469 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1470   echo "$ac_t""yes" 1>&6
1471     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1472   cat >> confdefs.h <<EOF
1473 #define $ac_tr_func 1
1474 EOF
1475  
1476 else
1477   echo "$ac_t""no" 1>&6
1478 fi
1479 done
1480
1481
1482 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
1483 echo "configure:1484: checking for working strcoll" >&5
1484 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
1485   echo $ac_n "(cached) $ac_c" 1>&6
1486 else
1487   if test "$cross_compiling" = yes; then
1488   ac_cv_func_strcoll_works=no
1489 else
1490   cat > conftest.$ac_ext <<EOF
1491 #line 1492 "configure"
1492 #include "confdefs.h"
1493 #include <string.h>
1494 main ()
1495 {
1496   exit (strcoll ("abc", "def") >= 0 ||
1497         strcoll ("ABC", "DEF") >= 0 ||
1498         strcoll ("123", "456") >= 0);
1499 }
1500 EOF
1501 if { (eval echo configure:1502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1502 then
1503   ac_cv_func_strcoll_works=yes
1504 else
1505   echo "configure: failed program was:" >&5
1506   cat conftest.$ac_ext >&5
1507   rm -fr conftest*
1508   ac_cv_func_strcoll_works=no
1509 fi
1510 rm -fr conftest*
1511 fi
1512
1513 fi
1514
1515 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
1516 if test $ac_cv_func_strcoll_works = yes; then
1517   cat >> confdefs.h <<\EOF
1518 #define HAVE_STRCOLL 1
1519 EOF
1520
1521 fi
1522
1523
1524 for ac_hdr in unistd.h stdlib.h varargs.h stdarg.h string.h \
1525                 sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
1526                 termcap.h termios.h termio.h sys/file.h locale.h
1527 do
1528 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1529 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1530 echo "configure:1531: checking for $ac_hdr" >&5
1531 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1532   echo $ac_n "(cached) $ac_c" 1>&6
1533 else
1534   cat > conftest.$ac_ext <<EOF
1535 #line 1536 "configure"
1536 #include "confdefs.h"
1537 #include <$ac_hdr>
1538 EOF
1539 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1540 { (eval echo configure:1541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1541 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1542 if test -z "$ac_err"; then
1543   rm -rf conftest*
1544   eval "ac_cv_header_$ac_safe=yes"
1545 else
1546   echo "$ac_err" >&5
1547   echo "configure: failed program was:" >&5
1548   cat conftest.$ac_ext >&5
1549   rm -rf conftest*
1550   eval "ac_cv_header_$ac_safe=no"
1551 fi
1552 rm -f conftest*
1553 fi
1554 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1555   echo "$ac_t""yes" 1>&6
1556     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1557   cat >> confdefs.h <<EOF
1558 #define $ac_tr_hdr 1
1559 EOF
1560  
1561 else
1562   echo "$ac_t""no" 1>&6
1563 fi
1564 done
1565
1566
1567
1568 echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6
1569 echo "configure:1570: checking for type of signal functions" >&5
1570 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then
1571   echo $ac_n "(cached) $ac_c" 1>&6
1572 else
1573   
1574   cat > conftest.$ac_ext <<EOF
1575 #line 1576 "configure"
1576 #include "confdefs.h"
1577 #include <signal.h>
1578 int main() {
1579
1580     sigset_t ss;
1581     struct sigaction sa;
1582     sigemptyset(&ss); sigsuspend(&ss);
1583     sigaction(SIGINT, &sa, (struct sigaction *) 0);
1584     sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
1585   
1586 ; return 0; }
1587 EOF
1588 if { (eval echo configure:1589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1589   rm -rf conftest*
1590   bash_cv_signal_vintage=posix
1591 else
1592   echo "configure: failed program was:" >&5
1593   cat conftest.$ac_ext >&5
1594   rm -rf conftest*
1595   
1596     cat > conftest.$ac_ext <<EOF
1597 #line 1598 "configure"
1598 #include "confdefs.h"
1599 #include <signal.h>
1600 int main() {
1601
1602         int mask = sigmask(SIGINT);
1603         sigsetmask(mask); sigblock(mask); sigpause(mask);
1604     
1605 ; return 0; }
1606 EOF
1607 if { (eval echo configure:1608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1608   rm -rf conftest*
1609   bash_cv_signal_vintage=4.2bsd
1610 else
1611   echo "configure: failed program was:" >&5
1612   cat conftest.$ac_ext >&5
1613   rm -rf conftest*
1614   
1615       cat > conftest.$ac_ext <<EOF
1616 #line 1617 "configure"
1617 #include "confdefs.h"
1618
1619         #include <signal.h>
1620         RETSIGTYPE foo() { }
1621 int main() {
1622
1623                 int mask = sigmask(SIGINT);
1624                 sigset(SIGINT, foo); sigrelse(SIGINT);
1625                 sighold(SIGINT); sigpause(SIGINT);
1626         
1627 ; return 0; }
1628 EOF
1629 if { (eval echo configure:1630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1630   rm -rf conftest*
1631   bash_cv_signal_vintage=svr3
1632 else
1633   echo "configure: failed program was:" >&5
1634   cat conftest.$ac_ext >&5
1635   rm -rf conftest*
1636   bash_cv_signal_vintage=v7
1637     
1638 fi
1639 rm -f conftest*
1640   
1641 fi
1642 rm -f conftest*
1643
1644 fi
1645 rm -f conftest*
1646
1647 fi
1648
1649 echo "$ac_t""$bash_cv_signal_vintage" 1>&6
1650 if test "$bash_cv_signal_vintage" = posix; then
1651 cat >> confdefs.h <<\EOF
1652 #define HAVE_POSIX_SIGNALS 1
1653 EOF
1654
1655 elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
1656 cat >> confdefs.h <<\EOF
1657 #define HAVE_BSD_SIGNALS 1
1658 EOF
1659
1660 elif test "$bash_cv_signal_vintage" = svr3; then
1661 cat >> confdefs.h <<\EOF
1662 #define HAVE_USG_SIGHOLD 1
1663 EOF
1664
1665 fi
1666
1667
1668
1669 echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6
1670 echo "configure:1671: checking if signal handlers must be reinstalled when invoked" >&5
1671 if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then
1672   echo $ac_n "(cached) $ac_c" 1>&6
1673 else
1674   if test "$cross_compiling" = yes; then
1675   { echo "configure: error: cannot check signal handling if cross compiling -- defaulting to no" 1>&2; exit 1; }
1676     bash_cv_must_reinstall_sighandlers=no
1677
1678 else
1679   cat > conftest.$ac_ext <<EOF
1680 #line 1681 "configure"
1681 #include "confdefs.h"
1682
1683 #include <signal.h>
1684 #ifdef HAVE_UNISTD_H
1685 #include <unistd.h>
1686 #endif
1687
1688 typedef RETSIGTYPE sigfunc();
1689
1690 int nsigint;
1691
1692 #ifdef HAVE_POSIX_SIGNALS
1693 sigfunc *
1694 set_signal_handler(sig, handler)
1695      int sig;
1696      sigfunc *handler;
1697 {
1698   struct sigaction act, oact;
1699   act.sa_handler = handler;
1700   act.sa_flags = 0;
1701   sigemptyset (&act.sa_mask);
1702   sigemptyset (&oact.sa_mask);
1703   sigaction (sig, &act, &oact);
1704   return (oact.sa_handler);
1705 }
1706 #else
1707 #define set_signal_handler(s, h) signal(s, h)
1708 #endif
1709
1710 RETSIGTYPE
1711 sigint(s)
1712 int s;
1713 {
1714   nsigint++;
1715 }
1716
1717 main()
1718 {
1719         nsigint = 0;
1720         set_signal_handler(SIGINT, sigint);
1721         kill((int)getpid(), SIGINT);
1722         kill((int)getpid(), SIGINT);
1723         exit(nsigint != 2);
1724 }
1725
1726 EOF
1727 if { (eval echo configure:1728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1728 then
1729   bash_cv_must_reinstall_sighandlers=no
1730 else
1731   echo "configure: failed program was:" >&5
1732   cat conftest.$ac_ext >&5
1733   rm -fr conftest*
1734   bash_cv_must_reinstall_sighandlers=yes
1735 fi
1736 rm -fr conftest*
1737 fi
1738
1739 fi
1740
1741 echo "$ac_t""$bash_cv_must_reinstall_sighandlers" 1>&6
1742 if test $bash_cv_must_reinstall_sighandlers = yes; then
1743 cat >> confdefs.h <<\EOF
1744 #define MUST_REINSTALL_SIGHANDLERS 1
1745 EOF
1746
1747 fi
1748
1749
1750
1751 echo $ac_n "checking for presence of POSIX-style sigsetjmp/siglongjmp""... $ac_c" 1>&6
1752 echo "configure:1753: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
1753 if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then
1754   echo $ac_n "(cached) $ac_c" 1>&6
1755 else
1756   if test "$cross_compiling" = yes; then
1757   { echo "configure: error: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" 1>&2; exit 1; }
1758      bash_cv_func_sigsetjmp=missing
1759
1760 else
1761   cat > conftest.$ac_ext <<EOF
1762 #line 1763 "configure"
1763 #include "confdefs.h"
1764
1765 #ifdef HAVE_UNISTD_H
1766 #include <unistd.h>
1767 #endif
1768 #include <sys/types.h>
1769 #include <signal.h>
1770 #include <setjmp.h>
1771
1772 main()
1773 {
1774 #if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
1775 exit (1);
1776 #else
1777
1778 int code;
1779 sigset_t set, oset;
1780 sigjmp_buf xx;
1781
1782 /* get the mask */
1783 sigemptyset(&set);
1784 sigemptyset(&oset);
1785 sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set);
1786 sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset);
1787
1788 /* save it */
1789 code = sigsetjmp(xx, 1);
1790 if (code)
1791   exit(0);      /* could get sigmask and compare to oset here. */
1792
1793 /* change it */
1794 sigaddset(&set, SIGINT);
1795 sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
1796
1797 /* and siglongjmp */
1798 siglongjmp(xx, 10);
1799 exit(1);
1800 #endif
1801 }
1802 EOF
1803 if { (eval echo configure:1804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1804 then
1805   bash_cv_func_sigsetjmp=present
1806 else
1807   echo "configure: failed program was:" >&5
1808   cat conftest.$ac_ext >&5
1809   rm -fr conftest*
1810   bash_cv_func_sigsetjmp=missing
1811 fi
1812 rm -fr conftest*
1813 fi
1814
1815 fi
1816
1817 echo "$ac_t""$bash_cv_func_sigsetjmp" 1>&6
1818 if test $bash_cv_func_sigsetjmp = present; then
1819 cat >> confdefs.h <<\EOF
1820 #define HAVE_POSIX_SIGSETJMP 1
1821 EOF
1822
1823 fi
1824
1825 echo $ac_n "checking for lstat""... $ac_c" 1>&6
1826 echo "configure:1827: checking for lstat" >&5
1827 if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then
1828   echo $ac_n "(cached) $ac_c" 1>&6
1829 else
1830   cat > conftest.$ac_ext <<EOF
1831 #line 1832 "configure"
1832 #include "confdefs.h"
1833
1834 #include <sys/types.h>
1835 #include <sys/stat.h>
1836
1837 int main() {
1838  lstat(".",(struct stat *)0); 
1839 ; return 0; }
1840 EOF
1841 if { (eval echo configure:1842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1842   rm -rf conftest*
1843   bash_cv_func_lstat=yes
1844 else
1845   echo "configure: failed program was:" >&5
1846   cat conftest.$ac_ext >&5
1847   rm -rf conftest*
1848   bash_cv_func_lstat=no
1849 fi
1850 rm -f conftest*
1851 fi
1852
1853 echo "$ac_t""$bash_cv_func_lstat" 1>&6
1854 if test $bash_cv_func_lstat = yes; then
1855   cat >> confdefs.h <<\EOF
1856 #define HAVE_LSTAT 1
1857 EOF
1858
1859 fi
1860
1861 echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6
1862 echo "configure:1863: checking whether programs are able to redeclare getpw functions" >&5
1863 if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then
1864   echo $ac_n "(cached) $ac_c" 1>&6
1865 else
1866   cat > conftest.$ac_ext <<EOF
1867 #line 1868 "configure"
1868 #include "confdefs.h"
1869 #include <sys/types.h>
1870 #include <pwd.h>
1871 extern struct passwd *getpwent();
1872 extern struct passwd *getpwuid();
1873 extern struct passwd *getpwnam();
1874 int main() {
1875 struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");
1876 ; return 0; }
1877 EOF
1878 if { (eval echo configure:1879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1879   rm -rf conftest*
1880   bash_cv_can_redecl_getpw=yes
1881 else
1882   echo "configure: failed program was:" >&5
1883   cat conftest.$ac_ext >&5
1884   rm -rf conftest*
1885   bash_cv_can_redecl_getpw=no
1886 fi
1887 rm -f conftest*
1888 fi
1889
1890 echo "$ac_t""$bash_cv_can_redecl_getpw" 1>&6
1891 if test $bash_cv_can_redecl_getpw = no; then
1892 cat >> confdefs.h <<\EOF
1893 #define HAVE_GETPW_DECLS 1
1894 EOF
1895
1896 fi
1897
1898
1899 echo $ac_n "checking whether or not strcoll and strcmp differ""... $ac_c" 1>&6
1900 echo "configure:1901: checking whether or not strcoll and strcmp differ" >&5
1901 if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then
1902   echo $ac_n "(cached) $ac_c" 1>&6
1903 else
1904   if test "$cross_compiling" = yes; then
1905   { echo "configure: error: cannot check strcoll if cross compiling -- defaulting to no" 1>&2; exit 1; }
1906     bash_cv_func_strcoll_broken=no
1907
1908 else
1909   cat > conftest.$ac_ext <<EOF
1910 #line 1911 "configure"
1911 #include "confdefs.h"
1912
1913 #include <stdio.h>
1914 #if defined (HAVE_LOCALE_H)
1915 #include <locale.h>
1916 #endif
1917
1918 main(c, v)
1919 int     c;
1920 char    *v[];
1921 {
1922         int     r1, r2;
1923         char    *deflocale, *defcoll;
1924
1925 #ifdef HAVE_SETLOCALE
1926         deflocale = setlocale(LC_ALL, "");
1927         defcoll = setlocale(LC_COLLATE, "");
1928 #endif
1929
1930 #ifdef HAVE_STRCOLL
1931         /* These two values are taken from tests/glob-test. */
1932         r1 = strcoll("abd", "aXd");
1933 #else
1934         r1 = 0;
1935 #endif
1936         r2 = strcmp("abd", "aXd");
1937
1938         /* These two should both be greater than 0.  It is permissible for
1939            a system to return different values, as long as the sign is the
1940            same. */
1941
1942         /* Exit with 1 (failure) if these two values are both > 0, since
1943            this tests whether strcoll(3) is broken with respect to strcmp(3)
1944            in the default locale. */
1945         exit (r1 > 0 && r2 > 0);
1946 }
1947
1948 EOF
1949 if { (eval echo configure:1950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1950 then
1951   bash_cv_func_strcoll_broken=yes
1952 else
1953   echo "configure: failed program was:" >&5
1954   cat conftest.$ac_ext >&5
1955   rm -fr conftest*
1956   bash_cv_func_strcoll_broken=no
1957 fi
1958 rm -fr conftest*
1959 fi
1960
1961 fi
1962
1963 echo "$ac_t""$bash_cv_func_strcoll_broken" 1>&6
1964 if test $bash_cv_func_strcoll_broken = yes; then
1965 cat >> confdefs.h <<\EOF
1966 #define STRCOLL_BROKEN 1
1967 EOF
1968
1969 fi
1970
1971
1972 echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6
1973 echo "configure:1974: checking whether signal handlers are of type void" >&5
1974 if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then
1975   echo $ac_n "(cached) $ac_c" 1>&6
1976 else
1977   cat > conftest.$ac_ext <<EOF
1978 #line 1979 "configure"
1979 #include "confdefs.h"
1980 #include <sys/types.h>
1981 #include <signal.h>
1982 #ifdef signal
1983 #undef signal
1984 #endif
1985 #ifdef __cplusplus
1986 extern "C"
1987 #endif
1988 void (*signal ()) ();
1989 int main() {
1990 int i;
1991 ; return 0; }
1992 EOF
1993 if { (eval echo configure:1994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1994   rm -rf conftest*
1995   bash_cv_void_sighandler=yes
1996 else
1997   echo "configure: failed program was:" >&5
1998   cat conftest.$ac_ext >&5
1999   rm -rf conftest*
2000   bash_cv_void_sighandler=no
2001 fi
2002 rm -f conftest*
2003 fi
2004 echo "$ac_t""$bash_cv_void_sighandler" 1>&6
2005 if test $bash_cv_void_sighandler = yes; then
2006 cat >> confdefs.h <<\EOF
2007 #define VOID_SIGHANDLER 1
2008 EOF
2009
2010 fi
2011
2012 echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6
2013 echo "configure:2014: checking for TIOCGWINSZ in sys/ioctl.h" >&5
2014 if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then
2015   echo $ac_n "(cached) $ac_c" 1>&6
2016 else
2017   cat > conftest.$ac_ext <<EOF
2018 #line 2019 "configure"
2019 #include "confdefs.h"
2020 #include <sys/types.h>
2021 #include <sys/ioctl.h>
2022 int main() {
2023 int x = TIOCGWINSZ;
2024 ; return 0; }
2025 EOF
2026 if { (eval echo configure:2027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2027   rm -rf conftest*
2028   bash_cv_tiocgwinsz_in_ioctl=yes
2029 else
2030   echo "configure: failed program was:" >&5
2031   cat conftest.$ac_ext >&5
2032   rm -rf conftest*
2033   bash_cv_tiocgwinsz_in_ioctl=no
2034 fi
2035 rm -f conftest*
2036 fi
2037
2038 echo "$ac_t""$bash_cv_tiocgwinsz_in_ioctl" 1>&6
2039 if test $bash_cv_tiocgwinsz_in_ioctl = yes; then   
2040 cat >> confdefs.h <<\EOF
2041 #define GWINSZ_IN_SYS_IOCTL 1
2042 EOF
2043
2044 fi
2045
2046 echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6
2047 echo "configure:2048: checking for TIOCSTAT in sys/ioctl.h" >&5
2048 if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then
2049   echo $ac_n "(cached) $ac_c" 1>&6
2050 else
2051   cat > conftest.$ac_ext <<EOF
2052 #line 2053 "configure"
2053 #include "confdefs.h"
2054 #include <sys/types.h>
2055 #include <sys/ioctl.h>
2056 int main() {
2057 int x = TIOCSTAT;
2058 ; return 0; }
2059 EOF
2060 if { (eval echo configure:2061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2061   rm -rf conftest*
2062   bash_cv_tiocstat_in_ioctl=yes
2063 else
2064   echo "configure: failed program was:" >&5
2065   cat conftest.$ac_ext >&5
2066   rm -rf conftest*
2067   bash_cv_tiocstat_in_ioctl=no
2068 fi
2069 rm -f conftest*
2070 fi
2071
2072 echo "$ac_t""$bash_cv_tiocstat_in_ioctl" 1>&6
2073 if test $bash_cv_tiocstat_in_ioctl = yes; then   
2074 cat >> confdefs.h <<\EOF
2075 #define TIOCSTAT_IN_SYS_IOCTL 1
2076 EOF
2077
2078 fi
2079
2080 echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6
2081 echo "configure:2082: checking for FIONREAD in sys/ioctl.h" >&5
2082 if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then
2083   echo $ac_n "(cached) $ac_c" 1>&6
2084 else
2085   cat > conftest.$ac_ext <<EOF
2086 #line 2087 "configure"
2087 #include "confdefs.h"
2088 #include <sys/types.h>
2089 #include <sys/ioctl.h>
2090 int main() {
2091 int x = FIONREAD;
2092 ; return 0; }
2093 EOF
2094 if { (eval echo configure:2095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2095   rm -rf conftest*
2096   bash_cv_fionread_in_ioctl=yes
2097 else
2098   echo "configure: failed program was:" >&5
2099   cat conftest.$ac_ext >&5
2100   rm -rf conftest*
2101   bash_cv_fionread_in_ioctl=no
2102 fi
2103 rm -f conftest*
2104 fi
2105
2106 echo "$ac_t""$bash_cv_fionread_in_ioctl" 1>&6
2107 if test $bash_cv_fionread_in_ioctl = yes; then   
2108 cat >> confdefs.h <<\EOF
2109 #define FIONREAD_IN_SYS_IOCTL 1
2110 EOF
2111
2112 fi
2113
2114 echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6
2115 echo "configure:2116: checking for speed_t in sys/types.h" >&5
2116 if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then
2117   echo $ac_n "(cached) $ac_c" 1>&6
2118 else
2119   cat > conftest.$ac_ext <<EOF
2120 #line 2121 "configure"
2121 #include "confdefs.h"
2122 #include <sys/types.h>
2123 int main() {
2124 speed_t x;
2125 ; return 0; }
2126 EOF
2127 if { (eval echo configure:2128: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2128   rm -rf conftest*
2129   bash_cv_speed_t_in_sys_types=yes
2130 else
2131   echo "configure: failed program was:" >&5
2132   cat conftest.$ac_ext >&5
2133   rm -rf conftest*
2134   bash_cv_speed_t_in_sys_types=no
2135 fi
2136 rm -f conftest*
2137 fi
2138
2139 echo "$ac_t""$bash_cv_speed_t_in_sys_types" 1>&6
2140 if test $bash_cv_speed_t_in_sys_types = yes; then   
2141 cat >> confdefs.h <<\EOF
2142 #define SPEED_T_IN_SYS_TYPES 1
2143 EOF
2144
2145 fi
2146
2147 echo $ac_n "checking for struct winsize in sys/ioctl.h and termios.h""... $ac_c" 1>&6
2148 echo "configure:2149: checking for struct winsize in sys/ioctl.h and termios.h" >&5
2149 if eval "test \"`echo '$''{'bash_cv_struct_winsize_header'+set}'`\" = set"; then
2150   echo $ac_n "(cached) $ac_c" 1>&6
2151 else
2152   cat > conftest.$ac_ext <<EOF
2153 #line 2154 "configure"
2154 #include "confdefs.h"
2155 #include <sys/types.h>
2156 #include <sys/ioctl.h>
2157 int main() {
2158 struct winsize x;
2159 ; return 0; }
2160 EOF
2161 if { (eval echo configure:2162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2162   rm -rf conftest*
2163   bash_cv_struct_winsize_header=ioctl_h
2164 else
2165   echo "configure: failed program was:" >&5
2166   cat conftest.$ac_ext >&5
2167   rm -rf conftest*
2168   cat > conftest.$ac_ext <<EOF
2169 #line 2170 "configure"
2170 #include "confdefs.h"
2171 #include <sys/types.h>
2172 #include <termios.h>
2173 int main() {
2174 struct winsize x;
2175 ; return 0; }
2176 EOF
2177 if { (eval echo configure:2178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2178   rm -rf conftest*
2179   bash_cv_struct_winsize_header=termios_h
2180 else
2181   echo "configure: failed program was:" >&5
2182   cat conftest.$ac_ext >&5
2183   rm -rf conftest*
2184   bash_cv_struct_winsize_header=other
2185 fi
2186 rm -f conftest*
2187
2188 fi
2189 rm -f conftest*
2190 fi
2191
2192 if test $bash_cv_struct_winsize_header = ioctl_h; then
2193   echo "$ac_t""sys/ioctl.h" 1>&6
2194   cat >> confdefs.h <<\EOF
2195 #define STRUCT_WINSIZE_IN_SYS_IOCTL 1
2196 EOF
2197
2198 elif test $bash_cv_struct_winsize_header = termios_h; then
2199   echo "$ac_t""termios.h" 1>&6
2200   cat >> confdefs.h <<\EOF
2201 #define STRUCT_WINSIZE_IN_TERMIOS 1
2202 EOF
2203
2204 else
2205   echo "$ac_t""not found" 1>&6
2206 fi
2207
2208
2209 echo $ac_n "checking if struct dirent has a d_ino member""... $ac_c" 1>&6
2210 echo "configure:2211: checking if struct dirent has a d_ino member" >&5
2211 if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then
2212   echo $ac_n "(cached) $ac_c" 1>&6
2213 else
2214   cat > conftest.$ac_ext <<EOF
2215 #line 2216 "configure"
2216 #include "confdefs.h"
2217
2218 #include <stdio.h>
2219 #include <sys/types.h>
2220 #ifdef HAVE_UNISTD_H
2221 # include <unistd.h>
2222 #endif /* HAVE_UNISTD_H */
2223 #if defined(HAVE_DIRENT_H)
2224 # include <dirent.h>
2225 #else
2226 # define dirent direct
2227 # ifdef HAVE_SYS_NDIR_H
2228 #  include <sys/ndir.h>
2229 # endif /* SYSNDIR */
2230 # ifdef HAVE_SYS_DIR_H
2231 #  include <sys/dir.h>
2232 # endif /* SYSDIR */
2233 # ifdef HAVE_NDIR_H
2234 #  include <ndir.h>
2235 # endif
2236 #endif /* HAVE_DIRENT_H */
2237
2238 int main() {
2239
2240 struct dirent d; int z; z = d.d_ino;
2241
2242 ; return 0; }
2243 EOF
2244 if { (eval echo configure:2245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2245   rm -rf conftest*
2246   bash_cv_dirent_has_dino=yes
2247 else
2248   echo "configure: failed program was:" >&5
2249   cat conftest.$ac_ext >&5
2250   rm -rf conftest*
2251   bash_cv_dirent_has_dino=no
2252 fi
2253 rm -f conftest*
2254 fi
2255
2256 echo "$ac_t""$bash_cv_dirent_has_dino" 1>&6
2257 if test $bash_cv_dirent_has_dino = yes; then
2258 cat >> confdefs.h <<\EOF
2259 #define STRUCT_DIRENT_HAS_D_INO 1
2260 EOF
2261
2262 fi
2263
2264
2265 echo $ac_n "checking if struct dirent has a d_fileno member""... $ac_c" 1>&6
2266 echo "configure:2267: checking if struct dirent has a d_fileno member" >&5
2267 if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then
2268   echo $ac_n "(cached) $ac_c" 1>&6
2269 else
2270   cat > conftest.$ac_ext <<EOF
2271 #line 2272 "configure"
2272 #include "confdefs.h"
2273
2274 #include <stdio.h>
2275 #include <sys/types.h>
2276 #ifdef HAVE_UNISTD_H
2277 # include <unistd.h>
2278 #endif /* HAVE_UNISTD_H */
2279 #if defined(HAVE_DIRENT_H)
2280 # include <dirent.h>
2281 #else
2282 # define dirent direct
2283 # ifdef HAVE_SYS_NDIR_H
2284 #  include <sys/ndir.h>
2285 # endif /* SYSNDIR */
2286 # ifdef HAVE_SYS_DIR_H
2287 #  include <sys/dir.h>
2288 # endif /* SYSDIR */
2289 # ifdef HAVE_NDIR_H
2290 #  include <ndir.h>
2291 # endif
2292 #endif /* HAVE_DIRENT_H */
2293
2294 int main() {
2295
2296 struct dirent d; int z; z = d.d_fileno;
2297
2298 ; return 0; }
2299 EOF
2300 if { (eval echo configure:2301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2301   rm -rf conftest*
2302   bash_cv_dirent_has_d_fileno=yes
2303 else
2304   echo "configure: failed program was:" >&5
2305   cat conftest.$ac_ext >&5
2306   rm -rf conftest*
2307   bash_cv_dirent_has_d_fileno=no
2308 fi
2309 rm -f conftest*
2310 fi
2311
2312 echo "$ac_t""$bash_cv_dirent_has_d_fileno" 1>&6
2313 if test $bash_cv_dirent_has_d_fileno = yes; then
2314 cat >> confdefs.h <<\EOF
2315 #define STRUCT_DIRENT_HAS_D_FILENO 1
2316 EOF
2317
2318 fi
2319
2320
2321 case "$host_os" in
2322 aix*)   prefer_curses=yes ;;
2323 esac
2324
2325 if test "X$bash_cv_termcap_lib" = "X"; then
2326 _bash_needmsg=yes
2327 else
2328 echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
2329 echo "configure:2330: checking which library has the termcap functions" >&5
2330 _bash_needmsg=
2331 fi
2332 if eval "test \"`echo '$''{'bash_cv_termcap_lib'+set}'`\" = set"; then
2333   echo $ac_n "(cached) $ac_c" 1>&6
2334 else
2335   echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
2336 echo "configure:2337: checking for tgetent in -ltermcap" >&5
2337 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
2338 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2339   echo $ac_n "(cached) $ac_c" 1>&6
2340 else
2341   ac_save_LIBS="$LIBS"
2342 LIBS="-ltermcap  $LIBS"
2343 cat > conftest.$ac_ext <<EOF
2344 #line 2345 "configure"
2345 #include "confdefs.h"
2346 /* Override any gcc2 internal prototype to avoid an error.  */
2347 /* We use char because int might match the return type of a gcc2
2348     builtin and then its argument prototype would still apply.  */
2349 char tgetent();
2350
2351 int main() {
2352 tgetent()
2353 ; return 0; }
2354 EOF
2355 if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2356   rm -rf conftest*
2357   eval "ac_cv_lib_$ac_lib_var=yes"
2358 else
2359   echo "configure: failed program was:" >&5
2360   cat conftest.$ac_ext >&5
2361   rm -rf conftest*
2362   eval "ac_cv_lib_$ac_lib_var=no"
2363 fi
2364 rm -f conftest*
2365 LIBS="$ac_save_LIBS"
2366
2367 fi
2368 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2369   echo "$ac_t""yes" 1>&6
2370   bash_cv_termcap_lib=libtermcap
2371 else
2372   echo "$ac_t""no" 1>&6
2373 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
2374 echo "configure:2375: checking for tgetent in -lcurses" >&5
2375 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
2376 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2377   echo $ac_n "(cached) $ac_c" 1>&6
2378 else
2379   ac_save_LIBS="$LIBS"
2380 LIBS="-lcurses  $LIBS"
2381 cat > conftest.$ac_ext <<EOF
2382 #line 2383 "configure"
2383 #include "confdefs.h"
2384 /* Override any gcc2 internal prototype to avoid an error.  */
2385 /* We use char because int might match the return type of a gcc2
2386     builtin and then its argument prototype would still apply.  */
2387 char tgetent();
2388
2389 int main() {
2390 tgetent()
2391 ; return 0; }
2392 EOF
2393 if { (eval echo configure:2394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2394   rm -rf conftest*
2395   eval "ac_cv_lib_$ac_lib_var=yes"
2396 else
2397   echo "configure: failed program was:" >&5
2398   cat conftest.$ac_ext >&5
2399   rm -rf conftest*
2400   eval "ac_cv_lib_$ac_lib_var=no"
2401 fi
2402 rm -f conftest*
2403 LIBS="$ac_save_LIBS"
2404
2405 fi
2406 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2407   echo "$ac_t""yes" 1>&6
2408   bash_cv_termcap_lib=libcurses
2409 else
2410   echo "$ac_t""no" 1>&6
2411 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
2412 echo "configure:2413: checking for tgetent in -lncurses" >&5
2413 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
2414 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2415   echo $ac_n "(cached) $ac_c" 1>&6
2416 else
2417   ac_save_LIBS="$LIBS"
2418 LIBS="-lncurses  $LIBS"
2419 cat > conftest.$ac_ext <<EOF
2420 #line 2421 "configure"
2421 #include "confdefs.h"
2422 /* Override any gcc2 internal prototype to avoid an error.  */
2423 /* We use char because int might match the return type of a gcc2
2424     builtin and then its argument prototype would still apply.  */
2425 char tgetent();
2426
2427 int main() {
2428 tgetent()
2429 ; return 0; }
2430 EOF
2431 if { (eval echo configure:2432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2432   rm -rf conftest*
2433   eval "ac_cv_lib_$ac_lib_var=yes"
2434 else
2435   echo "configure: failed program was:" >&5
2436   cat conftest.$ac_ext >&5
2437   rm -rf conftest*
2438   eval "ac_cv_lib_$ac_lib_var=no"
2439 fi
2440 rm -f conftest*
2441 LIBS="$ac_save_LIBS"
2442
2443 fi
2444 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2445   echo "$ac_t""yes" 1>&6
2446   bash_cv_termcap_lib=libncurses
2447 else
2448   echo "$ac_t""no" 1>&6
2449 bash_cv_termcap_lib=gnutermcap
2450 fi
2451
2452 fi
2453
2454 fi
2455
2456 fi
2457
2458 if test "X$_bash_needmsg" = "Xyes"; then
2459 echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
2460 echo "configure:2461: checking which library has the termcap functions" >&5
2461 fi
2462 echo "$ac_t""using $bash_cv_termcap_lib" 1>&6
2463 if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
2464 LDFLAGS="$LDFLAGS -L./lib/termcap"
2465 TERMCAP_LIB="./lib/termcap/libtermcap.a"
2466 TERMCAP_DEP="./lib/termcap/libtermcap.a"
2467 elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
2468 TERMCAP_LIB=-ltermcap
2469 TERMCAP_DEP=
2470 elif test $bash_cv_termcap_lib = libncurses; then
2471 TERMCAP_LIB=-lncurses
2472 TERMCAP_DEP=
2473 else
2474 TERMCAP_LIB=-lcurses
2475 TERMCAP_DEP=
2476 fi
2477
2478 if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
2479         TERMCAP_LIB=-ltermcap   #default
2480 fi
2481
2482 case "$host_cpu" in
2483 *cray*) LOCAL_CFLAGS=-DCRAY ;;
2484 esac
2485
2486 case "$host_os" in
2487 isc*)   LOCAL_CFLAGS=-Disc386 ;;
2488 esac
2489
2490 BUILD_DIR=`pwd`
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505 trap '' 1 2 15
2506 cat > confcache <<\EOF
2507 # This file is a shell script that caches the results of configure
2508 # tests run on this system so they can be shared between configure
2509 # scripts and configure runs.  It is not useful on other systems.
2510 # If it contains results you don't want to keep, you may remove or edit it.
2511 #
2512 # By default, configure uses ./config.cache as the cache file,
2513 # creating it if it does not exist already.  You can give configure
2514 # the --cache-file=FILE option to use a different cache file; that is
2515 # what configure does when it calls configure scripts in
2516 # subdirectories, so they share the cache.
2517 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2518 # config.status only pays attention to the cache file if you give it the
2519 # --recheck option to rerun configure.
2520 #
2521 EOF
2522 # The following way of writing the cache mishandles newlines in values,
2523 # but we know of no workaround that is simple, portable, and efficient.
2524 # So, don't put newlines in cache variables' values.
2525 # Ultrix sh set writes to stderr and can't be redirected directly,
2526 # and sets the high bit in the cache file unless we assign to the vars.
2527 (set) 2>&1 |
2528   case `(ac_space=' '; set) 2>&1 | grep ac_space` in
2529   *ac_space=\ *)
2530     # `set' does not quote correctly, so add quotes (double-quote substitution
2531     # turns \\\\ into \\, and sed turns \\ into \).
2532     sed -n \
2533       -e "s/'/'\\\\''/g" \
2534       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2535     ;;
2536   *)
2537     # `set' quotes correctly as required by POSIX, so do not add quotes.
2538     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2539     ;;
2540   esac >> confcache
2541 if cmp -s $cache_file confcache; then
2542   :
2543 else
2544   if test -w $cache_file; then
2545     echo "updating cache $cache_file"
2546     cat confcache > $cache_file
2547   else
2548     echo "not updating unwritable cache $cache_file"
2549   fi
2550 fi
2551 rm -f confcache
2552
2553 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2554
2555 test "x$prefix" = xNONE && prefix=$ac_default_prefix
2556 # Let make expand exec_prefix.
2557 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2558
2559 # Any assignment to VPATH causes Sun make to only execute
2560 # the first set of double-colon rules, so remove it if not needed.
2561 # If there is a colon in the path, we need to keep it.
2562 if test "x$srcdir" = x.; then
2563   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
2564 fi
2565
2566 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2567
2568 DEFS=-DHAVE_CONFIG_H
2569
2570 # Without the "./", some shells look in PATH for config.status.
2571 : ${CONFIG_STATUS=./config.status}
2572
2573 echo creating $CONFIG_STATUS
2574 rm -f $CONFIG_STATUS
2575 cat > $CONFIG_STATUS <<EOF
2576 #! /bin/sh
2577 # Generated automatically by configure.
2578 # Run this file to recreate the current configuration.
2579 # This directory was configured as follows,
2580 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2581 #
2582 # $0 $ac_configure_args
2583 #
2584 # Compiler output produced by configure, useful for debugging
2585 # configure, is in ./config.log if it exists.
2586
2587 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2588 for ac_option
2589 do
2590   case "\$ac_option" in
2591   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2592     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2593     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2594   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2595     echo "$CONFIG_STATUS generated by autoconf version 2.12.2"
2596     exit 0 ;;
2597   -help | --help | --hel | --he | --h)
2598     echo "\$ac_cs_usage"; exit 0 ;;
2599   *) echo "\$ac_cs_usage"; exit 1 ;;
2600   esac
2601 done
2602
2603 ac_given_srcdir=$srcdir
2604 ac_given_INSTALL="$INSTALL"
2605
2606 trap 'rm -fr `echo "Makefile doc/Makefile examples/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2607 EOF
2608 cat >> $CONFIG_STATUS <<EOF
2609
2610 # Protect against being on the right side of a sed subst in config.status.
2611 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2612  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2613 $ac_vpsub
2614 $extrasub
2615 s%@SHELL@%$SHELL%g
2616 s%@CFLAGS@%$CFLAGS%g
2617 s%@CPPFLAGS@%$CPPFLAGS%g
2618 s%@CXXFLAGS@%$CXXFLAGS%g
2619 s%@DEFS@%$DEFS%g
2620 s%@LDFLAGS@%$LDFLAGS%g
2621 s%@LIBS@%$LIBS%g
2622 s%@exec_prefix@%$exec_prefix%g
2623 s%@prefix@%$prefix%g
2624 s%@program_transform_name@%$program_transform_name%g
2625 s%@bindir@%$bindir%g
2626 s%@sbindir@%$sbindir%g
2627 s%@libexecdir@%$libexecdir%g
2628 s%@datadir@%$datadir%g
2629 s%@sysconfdir@%$sysconfdir%g
2630 s%@sharedstatedir@%$sharedstatedir%g
2631 s%@localstatedir@%$localstatedir%g
2632 s%@libdir@%$libdir%g
2633 s%@includedir@%$includedir%g
2634 s%@oldincludedir@%$oldincludedir%g
2635 s%@infodir@%$infodir%g
2636 s%@mandir@%$mandir%g
2637 s%@host@%$host%g
2638 s%@host_alias@%$host_alias%g
2639 s%@host_cpu@%$host_cpu%g
2640 s%@host_vendor@%$host_vendor%g
2641 s%@host_os@%$host_os%g
2642 s%@CC@%$CC%g
2643 s%@CPP@%$CPP%g
2644 s%@CROSS_COMPILING_FLAG@%$CROSS_COMPILING_FLAG%g
2645 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
2646 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2647 s%@INSTALL_DATA@%$INSTALL_DATA%g
2648 s%@RANLIB@%$RANLIB%g
2649 s%@BUILD_DIR@%$BUILD_DIR%g
2650 s%@LOCAL_CFLAGS@%$LOCAL_CFLAGS%g
2651 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
2652 s%@LOCAL_DEFS@%$LOCAL_DEFS%g
2653 s%@LIBVERSION@%$LIBVERSION%g
2654 s%@TERMCAP_LIB@%$TERMCAP_LIB%g
2655
2656 CEOF
2657 EOF
2658
2659 cat >> $CONFIG_STATUS <<\EOF
2660
2661 # Split the substitutions into bite-sized pieces for seds with
2662 # small command number limits, like on Digital OSF/1 and HP-UX.
2663 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2664 ac_file=1 # Number of current file.
2665 ac_beg=1 # First line for current file.
2666 ac_end=$ac_max_sed_cmds # Line after last line for current file.
2667 ac_more_lines=:
2668 ac_sed_cmds=""
2669 while $ac_more_lines; do
2670   if test $ac_beg -gt 1; then
2671     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2672   else
2673     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2674   fi
2675   if test ! -s conftest.s$ac_file; then
2676     ac_more_lines=false
2677     rm -f conftest.s$ac_file
2678   else
2679     if test -z "$ac_sed_cmds"; then
2680       ac_sed_cmds="sed -f conftest.s$ac_file"
2681     else
2682       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2683     fi
2684     ac_file=`expr $ac_file + 1`
2685     ac_beg=$ac_end
2686     ac_end=`expr $ac_end + $ac_max_sed_cmds`
2687   fi
2688 done
2689 if test -z "$ac_sed_cmds"; then
2690   ac_sed_cmds=cat
2691 fi
2692 EOF
2693
2694 cat >> $CONFIG_STATUS <<EOF
2695
2696 CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile examples/Makefile"}
2697 EOF
2698 cat >> $CONFIG_STATUS <<\EOF
2699 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2700   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2701   case "$ac_file" in
2702   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2703        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2704   *) ac_file_in="${ac_file}.in" ;;
2705   esac
2706
2707   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2708
2709   # Remove last slash and all that follows it.  Not all systems have dirname.
2710   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2711   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2712     # The file is in a subdirectory.
2713     test ! -d "$ac_dir" && mkdir "$ac_dir"
2714     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2715     # A "../" for each directory in $ac_dir_suffix.
2716     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2717   else
2718     ac_dir_suffix= ac_dots=
2719   fi
2720
2721   case "$ac_given_srcdir" in
2722   .)  srcdir=.
2723       if test -z "$ac_dots"; then top_srcdir=.
2724       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2725   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2726   *) # Relative path.
2727     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2728     top_srcdir="$ac_dots$ac_given_srcdir" ;;
2729   esac
2730
2731   case "$ac_given_INSTALL" in
2732   [/$]*) INSTALL="$ac_given_INSTALL" ;;
2733   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2734   esac
2735
2736   echo creating "$ac_file"
2737   rm -f "$ac_file"
2738   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2739   case "$ac_file" in
2740   *Makefile*) ac_comsub="1i\\
2741 # $configure_input" ;;
2742   *) ac_comsub= ;;
2743   esac
2744
2745   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2746   sed -e "$ac_comsub
2747 s%@configure_input@%$configure_input%g
2748 s%@srcdir@%$srcdir%g
2749 s%@top_srcdir@%$top_srcdir%g
2750 s%@INSTALL@%$INSTALL%g
2751 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2752 fi; done
2753 rm -f conftest.s*
2754
2755 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2756 # NAME is the cpp macro being defined and VALUE is the value it is being given.
2757 #
2758 # ac_d sets the value in "#define NAME VALUE" lines.
2759 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
2760 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
2761 ac_dC='\3'
2762 ac_dD='%g'
2763 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2764 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2765 ac_uB='\([      ]\)%\1#\2define\3'
2766 ac_uC=' '
2767 ac_uD='\4%g'
2768 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2769 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2770 ac_eB='$%\1#\2define\3'
2771 ac_eC=' '
2772 ac_eD='%g'
2773
2774 if test "${CONFIG_HEADERS+set}" != set; then
2775 EOF
2776 cat >> $CONFIG_STATUS <<EOF
2777   CONFIG_HEADERS="config.h"
2778 EOF
2779 cat >> $CONFIG_STATUS <<\EOF
2780 fi
2781 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2782   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2783   case "$ac_file" in
2784   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2785        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2786   *) ac_file_in="${ac_file}.in" ;;
2787   esac
2788
2789   echo creating $ac_file
2790
2791   rm -f conftest.frag conftest.in conftest.out
2792   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2793   cat $ac_file_inputs > conftest.in
2794
2795 EOF
2796
2797 # Transform confdefs.h into a sed script conftest.vals that substitutes
2798 # the proper values into config.h.in to produce config.h.  And first:
2799 # Protect against being on the right side of a sed subst in config.status.
2800 # Protect against being in an unquoted here document in config.status.
2801 rm -f conftest.vals
2802 cat > conftest.hdr <<\EOF
2803 s/[\\&%]/\\&/g
2804 s%[\\$`]%\\&%g
2805 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2806 s%ac_d%ac_u%gp
2807 s%ac_u%ac_e%gp
2808 EOF
2809 sed -n -f conftest.hdr confdefs.h > conftest.vals
2810 rm -f conftest.hdr
2811
2812 # This sed command replaces #undef with comments.  This is necessary, for
2813 # example, in the case of _POSIX_SOURCE, which is predefined and required
2814 # on some systems where configure will not decide to define it.
2815 cat >> conftest.vals <<\EOF
2816 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2817 EOF
2818
2819 # Break up conftest.vals because some shells have a limit on
2820 # the size of here documents, and old seds have small limits too.
2821
2822 rm -f conftest.tail
2823 while :
2824 do
2825   ac_lines=`grep -c . conftest.vals`
2826   # grep -c gives empty output for an empty file on some AIX systems.
2827   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2828   # Write a limited-size here document to conftest.frag.
2829   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2830   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2831   echo 'CEOF
2832   sed -f conftest.frag conftest.in > conftest.out
2833   rm -f conftest.in
2834   mv conftest.out conftest.in
2835 ' >> $CONFIG_STATUS
2836   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2837   rm -f conftest.vals
2838   mv conftest.tail conftest.vals
2839 done
2840 rm -f conftest.vals
2841
2842 cat >> $CONFIG_STATUS <<\EOF
2843   rm -f conftest.frag conftest.h
2844   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
2845   cat conftest.in >> conftest.h
2846   rm -f conftest.in
2847   if cmp -s $ac_file conftest.h 2>/dev/null; then
2848     echo "$ac_file is unchanged"
2849     rm -f conftest.h
2850   else
2851     # Remove last slash and all that follows it.  Not all systems have dirname.
2852       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2853       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2854       # The file is in a subdirectory.
2855       test ! -d "$ac_dir" && mkdir "$ac_dir"
2856     fi
2857     rm -f $ac_file
2858     mv conftest.h $ac_file
2859   fi
2860 fi; done
2861
2862 EOF
2863 cat >> $CONFIG_STATUS <<EOF
2864
2865 EOF
2866 cat >> $CONFIG_STATUS <<\EOF
2867
2868 # Makefile uses this timestamp file to record whether config.h is up to date.
2869 echo > stamp-h
2870
2871 exit 0
2872 EOF
2873 chmod +x $CONFIG_STATUS
2874 rm -fr confdefs* $ac_clean_files
2875 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2876