import gdb-19990504 snapshot
[platform/upstream/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
619 ac_aux_dir=
620 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
621   if test -f $ac_dir/install-sh; then
622     ac_aux_dir=$ac_dir
623     ac_install_sh="$ac_aux_dir/install-sh -c"
624     break
625   elif test -f $ac_dir/install.sh; then
626     ac_aux_dir=$ac_dir
627     ac_install_sh="$ac_aux_dir/install.sh -c"
628     break
629   fi
630 done
631 if test -z "$ac_aux_dir"; then
632   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
633 fi
634 ac_config_guess=$ac_aux_dir/config.guess
635 ac_config_sub=$ac_aux_dir/config.sub
636 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
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         LOCAL_CFLAGS="$LOCAL_CFLAGS -I${srcdir}/../libtermcap"
1035         unset cross_cache
1036         ;;
1037     *)  echo "configure: cross-compiling for a non-cygwin target is not supported" >&2
1038         ;;
1039     esac
1040 fi
1041  
1042 if test "x$cross_compiling" = "xyes"; then
1043   CROSS_COMPILING_FLAG=-DCROSS_COMPILING
1044 else
1045   CROSS_COMPILING_FLAG=
1046 fi
1047
1048  
1049 if test -z "$CC_FOR_BUILD"; then
1050     if test "x$cross_compiling" = "xno"; then
1051         CC_FOR_BUILD='$(CC)'
1052     else
1053         CC_FOR_BUILD=gcc
1054     fi
1055 fi
1056
1057  
1058
1059
1060
1061 # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
1062 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
1063
1064 if test $ac_cv_prog_gcc = yes; then
1065     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
1066 echo "configure:1067: checking whether ${CC-cc} needs -traditional" >&5
1067 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
1068   echo $ac_n "(cached) $ac_c" 1>&6
1069 else
1070     ac_pattern="Autoconf.*'x'"
1071   cat > conftest.$ac_ext <<EOF
1072 #line 1073 "configure"
1073 #include "confdefs.h"
1074 #include <sgtty.h>
1075 Autoconf TIOCGETP
1076 EOF
1077 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1078   egrep "$ac_pattern" >/dev/null 2>&1; then
1079   rm -rf conftest*
1080   ac_cv_prog_gcc_traditional=yes
1081 else
1082   rm -rf conftest*
1083   ac_cv_prog_gcc_traditional=no
1084 fi
1085 rm -f conftest*
1086
1087
1088   if test $ac_cv_prog_gcc_traditional = no; then
1089     cat > conftest.$ac_ext <<EOF
1090 #line 1091 "configure"
1091 #include "confdefs.h"
1092 #include <termio.h>
1093 Autoconf TCGETA
1094 EOF
1095 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1096   egrep "$ac_pattern" >/dev/null 2>&1; then
1097   rm -rf conftest*
1098   ac_cv_prog_gcc_traditional=yes
1099 fi
1100 rm -f conftest*
1101
1102   fi
1103 fi
1104
1105 echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
1106   if test $ac_cv_prog_gcc_traditional = yes; then
1107     CC="$CC -traditional"
1108   fi
1109 fi
1110
1111 # Find a good install program.  We prefer a C program (faster),
1112 # so one script is as good as another.  But avoid the broken or
1113 # incompatible versions:
1114 # SysV /etc/install, /usr/sbin/install
1115 # SunOS /usr/etc/install
1116 # IRIX /sbin/install
1117 # AIX /bin/install
1118 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1119 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1120 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1121 # ./install, which can be erroneously created by make from ./install.sh.
1122 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1123 echo "configure:1124: checking for a BSD compatible install" >&5
1124 if test -z "$INSTALL"; then
1125 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1126   echo $ac_n "(cached) $ac_c" 1>&6
1127 else
1128     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1129   for ac_dir in $PATH; do
1130     # Account for people who put trailing slashes in PATH elements.
1131     case "$ac_dir/" in
1132     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1133     *)
1134       # OSF1 and SCO ODT 3.0 have their own names for install.
1135       # Don't use installbsd from OSF since it installs stuff as root
1136       # by default.
1137       for ac_prog in ginstall scoinst install; do
1138         if test -f $ac_dir/$ac_prog; then
1139           if test $ac_prog = install &&
1140             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1141             # AIX install.  It has an incompatible calling convention.
1142             :
1143           else
1144             ac_cv_path_install="$ac_dir/$ac_prog -c"
1145             break 2
1146           fi
1147         fi
1148       done
1149       ;;
1150     esac
1151   done
1152   IFS="$ac_save_IFS"
1153
1154 fi
1155   if test "${ac_cv_path_install+set}" = set; then
1156     INSTALL="$ac_cv_path_install"
1157   else
1158     # As a last resort, use the slow shell script.  We don't cache a
1159     # path for INSTALL within a source directory, because that will
1160     # break other packages using the cache if that directory is
1161     # removed, or if the path is relative.
1162     INSTALL="$ac_install_sh"
1163   fi
1164 fi
1165 echo "$ac_t""$INSTALL" 1>&6
1166
1167 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1168 # It thinks the first close brace ends the variable substitution.
1169 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1170
1171 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1172
1173 # Extract the first word of "ranlib", so it can be a program name with args.
1174 set dummy ranlib; ac_word=$2
1175 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1176 echo "configure:1177: checking for $ac_word" >&5
1177 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1178   echo $ac_n "(cached) $ac_c" 1>&6
1179 else
1180   if test -n "$RANLIB"; then
1181   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1182 else
1183   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1184   for ac_dir in $PATH; do
1185     test -z "$ac_dir" && ac_dir=.
1186     if test -f $ac_dir/$ac_word; then
1187       ac_cv_prog_RANLIB="ranlib"
1188       break
1189     fi
1190   done
1191   IFS="$ac_save_ifs"
1192   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1193 fi
1194 fi
1195 RANLIB="$ac_cv_prog_RANLIB"
1196 if test -n "$RANLIB"; then
1197   echo "$ac_t""$RANLIB" 1>&6
1198 else
1199   echo "$ac_t""no" 1>&6
1200 fi
1201
1202
1203 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
1204 echo "configure:1205: checking return type of signal handlers" >&5
1205 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
1206   echo $ac_n "(cached) $ac_c" 1>&6
1207 else
1208   cat > conftest.$ac_ext <<EOF
1209 #line 1210 "configure"
1210 #include "confdefs.h"
1211 #include <sys/types.h>
1212 #include <signal.h>
1213 #ifdef signal
1214 #undef signal
1215 #endif
1216 #ifdef __cplusplus
1217 extern "C" void (*signal (int, void (*)(int)))(int);
1218 #else
1219 void (*signal ()) ();
1220 #endif
1221
1222 int main() {
1223 int i;
1224 ; return 0; }
1225 EOF
1226 if { (eval echo configure:1227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1227   rm -rf conftest*
1228   ac_cv_type_signal=void
1229 else
1230   echo "configure: failed program was:" >&5
1231   cat conftest.$ac_ext >&5
1232   rm -rf conftest*
1233   ac_cv_type_signal=int
1234 fi
1235 rm -f conftest*
1236 fi
1237
1238 echo "$ac_t""$ac_cv_type_signal" 1>&6
1239 cat >> confdefs.h <<EOF
1240 #define RETSIGTYPE $ac_cv_type_signal
1241 EOF
1242
1243
1244
1245 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
1246 echo "configure:1247: checking whether stat file-mode macros are broken" >&5
1247 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
1248   echo $ac_n "(cached) $ac_c" 1>&6
1249 else
1250   cat > conftest.$ac_ext <<EOF
1251 #line 1252 "configure"
1252 #include "confdefs.h"
1253 #include <sys/types.h>
1254 #include <sys/stat.h>
1255
1256 #if defined(S_ISBLK) && defined(S_IFDIR)
1257 # if S_ISBLK (S_IFDIR)
1258 You lose.
1259 # endif
1260 #endif
1261
1262 #if defined(S_ISBLK) && defined(S_IFCHR)
1263 # if S_ISBLK (S_IFCHR)
1264 You lose.
1265 # endif
1266 #endif
1267
1268 #if defined(S_ISLNK) && defined(S_IFREG)
1269 # if S_ISLNK (S_IFREG)
1270 You lose.
1271 # endif
1272 #endif
1273
1274 #if defined(S_ISSOCK) && defined(S_IFREG)
1275 # if S_ISSOCK (S_IFREG)
1276 You lose.
1277 # endif
1278 #endif
1279
1280 EOF
1281 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1282   egrep "You lose" >/dev/null 2>&1; then
1283   rm -rf conftest*
1284   ac_cv_header_stat_broken=yes
1285 else
1286   rm -rf conftest*
1287   ac_cv_header_stat_broken=no
1288 fi
1289 rm -f conftest*
1290
1291 fi
1292
1293 echo "$ac_t""$ac_cv_header_stat_broken" 1>&6
1294 if test $ac_cv_header_stat_broken = yes; then
1295   cat >> confdefs.h <<\EOF
1296 #define STAT_MACROS_BROKEN 1
1297 EOF
1298
1299 fi
1300
1301 ac_header_dirent=no
1302 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
1303 do
1304 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1305 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
1306 echo "configure:1307: checking for $ac_hdr that defines DIR" >&5
1307 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
1308   echo $ac_n "(cached) $ac_c" 1>&6
1309 else
1310   cat > conftest.$ac_ext <<EOF
1311 #line 1312 "configure"
1312 #include "confdefs.h"
1313 #include <sys/types.h>
1314 #include <$ac_hdr>
1315 int main() {
1316 DIR *dirp = 0;
1317 ; return 0; }
1318 EOF
1319 if { (eval echo configure:1320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1320   rm -rf conftest*
1321   eval "ac_cv_header_dirent_$ac_safe=yes"
1322 else
1323   echo "configure: failed program was:" >&5
1324   cat conftest.$ac_ext >&5
1325   rm -rf conftest*
1326   eval "ac_cv_header_dirent_$ac_safe=no"
1327 fi
1328 rm -f conftest*
1329 fi
1330 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
1331   echo "$ac_t""yes" 1>&6
1332     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1333   cat >> confdefs.h <<EOF
1334 #define $ac_tr_hdr 1
1335 EOF
1336  ac_header_dirent=$ac_hdr; break
1337 else
1338   echo "$ac_t""no" 1>&6
1339 fi
1340 done
1341 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
1342 if test $ac_header_dirent = dirent.h; then
1343 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
1344 echo "configure:1345: checking for opendir in -ldir" >&5
1345 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
1346 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1347   echo $ac_n "(cached) $ac_c" 1>&6
1348 else
1349   ac_save_LIBS="$LIBS"
1350 LIBS="-ldir  $LIBS"
1351 cat > conftest.$ac_ext <<EOF
1352 #line 1353 "configure"
1353 #include "confdefs.h"
1354 /* Override any gcc2 internal prototype to avoid an error.  */
1355 /* We use char because int might match the return type of a gcc2
1356     builtin and then its argument prototype would still apply.  */
1357 char opendir();
1358
1359 int main() {
1360 opendir()
1361 ; return 0; }
1362 EOF
1363 if { (eval echo configure:1364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1364   rm -rf conftest*
1365   eval "ac_cv_lib_$ac_lib_var=yes"
1366 else
1367   echo "configure: failed program was:" >&5
1368   cat conftest.$ac_ext >&5
1369   rm -rf conftest*
1370   eval "ac_cv_lib_$ac_lib_var=no"
1371 fi
1372 rm -f conftest*
1373 LIBS="$ac_save_LIBS"
1374
1375 fi
1376 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1377   echo "$ac_t""yes" 1>&6
1378   LIBS="$LIBS -ldir"
1379 else
1380   echo "$ac_t""no" 1>&6
1381 fi
1382
1383 else
1384 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
1385 echo "configure:1386: checking for opendir in -lx" >&5
1386 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
1387 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1388   echo $ac_n "(cached) $ac_c" 1>&6
1389 else
1390   ac_save_LIBS="$LIBS"
1391 LIBS="-lx  $LIBS"
1392 cat > conftest.$ac_ext <<EOF
1393 #line 1394 "configure"
1394 #include "confdefs.h"
1395 /* Override any gcc2 internal prototype to avoid an error.  */
1396 /* We use char because int might match the return type of a gcc2
1397     builtin and then its argument prototype would still apply.  */
1398 char opendir();
1399
1400 int main() {
1401 opendir()
1402 ; return 0; }
1403 EOF
1404 if { (eval echo configure:1405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1405   rm -rf conftest*
1406   eval "ac_cv_lib_$ac_lib_var=yes"
1407 else
1408   echo "configure: failed program was:" >&5
1409   cat conftest.$ac_ext >&5
1410   rm -rf conftest*
1411   eval "ac_cv_lib_$ac_lib_var=no"
1412 fi
1413 rm -f conftest*
1414 LIBS="$ac_save_LIBS"
1415
1416 fi
1417 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1418   echo "$ac_t""yes" 1>&6
1419   LIBS="$LIBS -lx"
1420 else
1421   echo "$ac_t""no" 1>&6
1422 fi
1423
1424 fi
1425
1426
1427 for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat
1428 do
1429 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1430 echo "configure:1431: checking for $ac_func" >&5
1431 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1432   echo $ac_n "(cached) $ac_c" 1>&6
1433 else
1434   cat > conftest.$ac_ext <<EOF
1435 #line 1436 "configure"
1436 #include "confdefs.h"
1437 /* System header to define __stub macros and hopefully few prototypes,
1438     which can conflict with char $ac_func(); below.  */
1439 #include <assert.h>
1440 /* Override any gcc2 internal prototype to avoid an error.  */
1441 /* We use char because int might match the return type of a gcc2
1442     builtin and then its argument prototype would still apply.  */
1443 char $ac_func();
1444
1445 int main() {
1446
1447 /* The GNU C library defines this for functions which it implements
1448     to always fail with ENOSYS.  Some functions are actually named
1449     something starting with __ and the normal name is an alias.  */
1450 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1451 choke me
1452 #else
1453 $ac_func();
1454 #endif
1455
1456 ; return 0; }
1457 EOF
1458 if { (eval echo configure:1459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1459   rm -rf conftest*
1460   eval "ac_cv_func_$ac_func=yes"
1461 else
1462   echo "configure: failed program was:" >&5
1463   cat conftest.$ac_ext >&5
1464   rm -rf conftest*
1465   eval "ac_cv_func_$ac_func=no"
1466 fi
1467 rm -f conftest*
1468 fi
1469
1470 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1471   echo "$ac_t""yes" 1>&6
1472     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1473   cat >> confdefs.h <<EOF
1474 #define $ac_tr_func 1
1475 EOF
1476  
1477 else
1478   echo "$ac_t""no" 1>&6
1479 fi
1480 done
1481
1482
1483 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
1484 echo "configure:1485: checking for working strcoll" >&5
1485 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
1486   echo $ac_n "(cached) $ac_c" 1>&6
1487 else
1488   if test "$cross_compiling" = yes; then
1489   ac_cv_func_strcoll_works=no
1490 else
1491   cat > conftest.$ac_ext <<EOF
1492 #line 1493 "configure"
1493 #include "confdefs.h"
1494 #include <string.h>
1495 main ()
1496 {
1497   exit (strcoll ("abc", "def") >= 0 ||
1498         strcoll ("ABC", "DEF") >= 0 ||
1499         strcoll ("123", "456") >= 0);
1500 }
1501 EOF
1502 if { (eval echo configure:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1503 then
1504   ac_cv_func_strcoll_works=yes
1505 else
1506   echo "configure: failed program was:" >&5
1507   cat conftest.$ac_ext >&5
1508   rm -fr conftest*
1509   ac_cv_func_strcoll_works=no
1510 fi
1511 rm -fr conftest*
1512 fi
1513
1514 fi
1515
1516 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
1517 if test $ac_cv_func_strcoll_works = yes; then
1518   cat >> confdefs.h <<\EOF
1519 #define HAVE_STRCOLL 1
1520 EOF
1521
1522 fi
1523
1524
1525 for ac_hdr in unistd.h stdlib.h varargs.h stdarg.h string.h \
1526                 sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
1527                 termcap.h termios.h termio.h sys/file.h locale.h
1528 do
1529 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1530 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1531 echo "configure:1532: checking for $ac_hdr" >&5
1532 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1533   echo $ac_n "(cached) $ac_c" 1>&6
1534 else
1535   cat > conftest.$ac_ext <<EOF
1536 #line 1537 "configure"
1537 #include "confdefs.h"
1538 #include <$ac_hdr>
1539 EOF
1540 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1541 { (eval echo configure:1542: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1542 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1543 if test -z "$ac_err"; then
1544   rm -rf conftest*
1545   eval "ac_cv_header_$ac_safe=yes"
1546 else
1547   echo "$ac_err" >&5
1548   echo "configure: failed program was:" >&5
1549   cat conftest.$ac_ext >&5
1550   rm -rf conftest*
1551   eval "ac_cv_header_$ac_safe=no"
1552 fi
1553 rm -f conftest*
1554 fi
1555 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1556   echo "$ac_t""yes" 1>&6
1557     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1558   cat >> confdefs.h <<EOF
1559 #define $ac_tr_hdr 1
1560 EOF
1561  
1562 else
1563   echo "$ac_t""no" 1>&6
1564 fi
1565 done
1566
1567
1568
1569 echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6
1570 echo "configure:1571: checking for type of signal functions" >&5
1571 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then
1572   echo $ac_n "(cached) $ac_c" 1>&6
1573 else
1574   
1575   cat > conftest.$ac_ext <<EOF
1576 #line 1577 "configure"
1577 #include "confdefs.h"
1578 #include <signal.h>
1579 int main() {
1580
1581     sigset_t ss;
1582     struct sigaction sa;
1583     sigemptyset(&ss); sigsuspend(&ss);
1584     sigaction(SIGINT, &sa, (struct sigaction *) 0);
1585     sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
1586   
1587 ; return 0; }
1588 EOF
1589 if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1590   rm -rf conftest*
1591   bash_cv_signal_vintage=posix
1592 else
1593   echo "configure: failed program was:" >&5
1594   cat conftest.$ac_ext >&5
1595   rm -rf conftest*
1596   
1597     cat > conftest.$ac_ext <<EOF
1598 #line 1599 "configure"
1599 #include "confdefs.h"
1600 #include <signal.h>
1601 int main() {
1602
1603         int mask = sigmask(SIGINT);
1604         sigsetmask(mask); sigblock(mask); sigpause(mask);
1605     
1606 ; return 0; }
1607 EOF
1608 if { (eval echo configure:1609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1609   rm -rf conftest*
1610   bash_cv_signal_vintage=4.2bsd
1611 else
1612   echo "configure: failed program was:" >&5
1613   cat conftest.$ac_ext >&5
1614   rm -rf conftest*
1615   
1616       cat > conftest.$ac_ext <<EOF
1617 #line 1618 "configure"
1618 #include "confdefs.h"
1619
1620         #include <signal.h>
1621         RETSIGTYPE foo() { }
1622 int main() {
1623
1624                 int mask = sigmask(SIGINT);
1625                 sigset(SIGINT, foo); sigrelse(SIGINT);
1626                 sighold(SIGINT); sigpause(SIGINT);
1627         
1628 ; return 0; }
1629 EOF
1630 if { (eval echo configure:1631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1631   rm -rf conftest*
1632   bash_cv_signal_vintage=svr3
1633 else
1634   echo "configure: failed program was:" >&5
1635   cat conftest.$ac_ext >&5
1636   rm -rf conftest*
1637   bash_cv_signal_vintage=v7
1638     
1639 fi
1640 rm -f conftest*
1641   
1642 fi
1643 rm -f conftest*
1644
1645 fi
1646 rm -f conftest*
1647
1648 fi
1649
1650 echo "$ac_t""$bash_cv_signal_vintage" 1>&6
1651 if test "$bash_cv_signal_vintage" = posix; then
1652 cat >> confdefs.h <<\EOF
1653 #define HAVE_POSIX_SIGNALS 1
1654 EOF
1655
1656 elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
1657 cat >> confdefs.h <<\EOF
1658 #define HAVE_BSD_SIGNALS 1
1659 EOF
1660
1661 elif test "$bash_cv_signal_vintage" = svr3; then
1662 cat >> confdefs.h <<\EOF
1663 #define HAVE_USG_SIGHOLD 1
1664 EOF
1665
1666 fi
1667
1668
1669
1670 echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6
1671 echo "configure:1672: checking if signal handlers must be reinstalled when invoked" >&5
1672 if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then
1673   echo $ac_n "(cached) $ac_c" 1>&6
1674 else
1675   if test "$cross_compiling" = yes; then
1676   { echo "configure: error: cannot check signal handling if cross compiling -- defaulting to no" 1>&2; exit 1; }
1677     bash_cv_must_reinstall_sighandlers=no
1678
1679 else
1680   cat > conftest.$ac_ext <<EOF
1681 #line 1682 "configure"
1682 #include "confdefs.h"
1683
1684 #include <signal.h>
1685 #ifdef HAVE_UNISTD_H
1686 #include <unistd.h>
1687 #endif
1688
1689 typedef RETSIGTYPE sigfunc();
1690
1691 int nsigint;
1692
1693 #ifdef HAVE_POSIX_SIGNALS
1694 sigfunc *
1695 set_signal_handler(sig, handler)
1696      int sig;
1697      sigfunc *handler;
1698 {
1699   struct sigaction act, oact;
1700   act.sa_handler = handler;
1701   act.sa_flags = 0;
1702   sigemptyset (&act.sa_mask);
1703   sigemptyset (&oact.sa_mask);
1704   sigaction (sig, &act, &oact);
1705   return (oact.sa_handler);
1706 }
1707 #else
1708 #define set_signal_handler(s, h) signal(s, h)
1709 #endif
1710
1711 RETSIGTYPE
1712 sigint(s)
1713 int s;
1714 {
1715   nsigint++;
1716 }
1717
1718 main()
1719 {
1720         nsigint = 0;
1721         set_signal_handler(SIGINT, sigint);
1722         kill((int)getpid(), SIGINT);
1723         kill((int)getpid(), SIGINT);
1724         exit(nsigint != 2);
1725 }
1726
1727 EOF
1728 if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1729 then
1730   bash_cv_must_reinstall_sighandlers=no
1731 else
1732   echo "configure: failed program was:" >&5
1733   cat conftest.$ac_ext >&5
1734   rm -fr conftest*
1735   bash_cv_must_reinstall_sighandlers=yes
1736 fi
1737 rm -fr conftest*
1738 fi
1739
1740 fi
1741
1742 echo "$ac_t""$bash_cv_must_reinstall_sighandlers" 1>&6
1743 if test $bash_cv_must_reinstall_sighandlers = yes; then
1744 cat >> confdefs.h <<\EOF
1745 #define MUST_REINSTALL_SIGHANDLERS 1
1746 EOF
1747
1748 fi
1749
1750
1751
1752 echo $ac_n "checking for presence of POSIX-style sigsetjmp/siglongjmp""... $ac_c" 1>&6
1753 echo "configure:1754: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
1754 if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then
1755   echo $ac_n "(cached) $ac_c" 1>&6
1756 else
1757   if test "$cross_compiling" = yes; then
1758   { echo "configure: error: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" 1>&2; exit 1; }
1759      bash_cv_func_sigsetjmp=missing
1760
1761 else
1762   cat > conftest.$ac_ext <<EOF
1763 #line 1764 "configure"
1764 #include "confdefs.h"
1765
1766 #ifdef HAVE_UNISTD_H
1767 #include <unistd.h>
1768 #endif
1769 #include <sys/types.h>
1770 #include <signal.h>
1771 #include <setjmp.h>
1772
1773 main()
1774 {
1775 #if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
1776 exit (1);
1777 #else
1778
1779 int code;
1780 sigset_t set, oset;
1781 sigjmp_buf xx;
1782
1783 /* get the mask */
1784 sigemptyset(&set);
1785 sigemptyset(&oset);
1786 sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set);
1787 sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset);
1788
1789 /* save it */
1790 code = sigsetjmp(xx, 1);
1791 if (code)
1792   exit(0);      /* could get sigmask and compare to oset here. */
1793
1794 /* change it */
1795 sigaddset(&set, SIGINT);
1796 sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
1797
1798 /* and siglongjmp */
1799 siglongjmp(xx, 10);
1800 exit(1);
1801 #endif
1802 }
1803 EOF
1804 if { (eval echo configure:1805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1805 then
1806   bash_cv_func_sigsetjmp=present
1807 else
1808   echo "configure: failed program was:" >&5
1809   cat conftest.$ac_ext >&5
1810   rm -fr conftest*
1811   bash_cv_func_sigsetjmp=missing
1812 fi
1813 rm -fr conftest*
1814 fi
1815
1816 fi
1817
1818 echo "$ac_t""$bash_cv_func_sigsetjmp" 1>&6
1819 if test $bash_cv_func_sigsetjmp = present; then
1820 cat >> confdefs.h <<\EOF
1821 #define HAVE_POSIX_SIGSETJMP 1
1822 EOF
1823
1824 fi
1825
1826 echo $ac_n "checking for lstat""... $ac_c" 1>&6
1827 echo "configure:1828: checking for lstat" >&5
1828 if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then
1829   echo $ac_n "(cached) $ac_c" 1>&6
1830 else
1831   cat > conftest.$ac_ext <<EOF
1832 #line 1833 "configure"
1833 #include "confdefs.h"
1834
1835 #include <sys/types.h>
1836 #include <sys/stat.h>
1837
1838 int main() {
1839  lstat(".",(struct stat *)0); 
1840 ; return 0; }
1841 EOF
1842 if { (eval echo configure:1843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1843   rm -rf conftest*
1844   bash_cv_func_lstat=yes
1845 else
1846   echo "configure: failed program was:" >&5
1847   cat conftest.$ac_ext >&5
1848   rm -rf conftest*
1849   bash_cv_func_lstat=no
1850 fi
1851 rm -f conftest*
1852 fi
1853
1854 echo "$ac_t""$bash_cv_func_lstat" 1>&6
1855 if test $bash_cv_func_lstat = yes; then
1856   cat >> confdefs.h <<\EOF
1857 #define HAVE_LSTAT 1
1858 EOF
1859
1860 fi
1861
1862 echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6
1863 echo "configure:1864: checking whether programs are able to redeclare getpw functions" >&5
1864 if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then
1865   echo $ac_n "(cached) $ac_c" 1>&6
1866 else
1867   cat > conftest.$ac_ext <<EOF
1868 #line 1869 "configure"
1869 #include "confdefs.h"
1870 #include <sys/types.h>
1871 #include <pwd.h>
1872 extern struct passwd *getpwent();
1873 extern struct passwd *getpwuid();
1874 extern struct passwd *getpwnam();
1875 int main() {
1876 struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");
1877 ; return 0; }
1878 EOF
1879 if { (eval echo configure:1880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1880   rm -rf conftest*
1881   bash_cv_can_redecl_getpw=yes
1882 else
1883   echo "configure: failed program was:" >&5
1884   cat conftest.$ac_ext >&5
1885   rm -rf conftest*
1886   bash_cv_can_redecl_getpw=no
1887 fi
1888 rm -f conftest*
1889 fi
1890
1891 echo "$ac_t""$bash_cv_can_redecl_getpw" 1>&6
1892 if test $bash_cv_can_redecl_getpw = no; then
1893 cat >> confdefs.h <<\EOF
1894 #define HAVE_GETPW_DECLS 1
1895 EOF
1896
1897 fi
1898
1899
1900 echo $ac_n "checking whether or not strcoll and strcmp differ""... $ac_c" 1>&6
1901 echo "configure:1902: checking whether or not strcoll and strcmp differ" >&5
1902 if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then
1903   echo $ac_n "(cached) $ac_c" 1>&6
1904 else
1905   if test "$cross_compiling" = yes; then
1906   { echo "configure: error: cannot check strcoll if cross compiling -- defaulting to no" 1>&2; exit 1; }
1907     bash_cv_func_strcoll_broken=no
1908
1909 else
1910   cat > conftest.$ac_ext <<EOF
1911 #line 1912 "configure"
1912 #include "confdefs.h"
1913
1914 #include <stdio.h>
1915 #if defined (HAVE_LOCALE_H)
1916 #include <locale.h>
1917 #endif
1918
1919 main(c, v)
1920 int     c;
1921 char    *v[];
1922 {
1923         int     r1, r2;
1924         char    *deflocale, *defcoll;
1925
1926 #ifdef HAVE_SETLOCALE
1927         deflocale = setlocale(LC_ALL, "");
1928         defcoll = setlocale(LC_COLLATE, "");
1929 #endif
1930
1931 #ifdef HAVE_STRCOLL
1932         /* These two values are taken from tests/glob-test. */
1933         r1 = strcoll("abd", "aXd");
1934 #else
1935         r1 = 0;
1936 #endif
1937         r2 = strcmp("abd", "aXd");
1938
1939         /* These two should both be greater than 0.  It is permissible for
1940            a system to return different values, as long as the sign is the
1941            same. */
1942
1943         /* Exit with 1 (failure) if these two values are both > 0, since
1944            this tests whether strcoll(3) is broken with respect to strcmp(3)
1945            in the default locale. */
1946         exit (r1 > 0 && r2 > 0);
1947 }
1948
1949 EOF
1950 if { (eval echo configure:1951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1951 then
1952   bash_cv_func_strcoll_broken=yes
1953 else
1954   echo "configure: failed program was:" >&5
1955   cat conftest.$ac_ext >&5
1956   rm -fr conftest*
1957   bash_cv_func_strcoll_broken=no
1958 fi
1959 rm -fr conftest*
1960 fi
1961
1962 fi
1963
1964 echo "$ac_t""$bash_cv_func_strcoll_broken" 1>&6
1965 if test $bash_cv_func_strcoll_broken = yes; then
1966 cat >> confdefs.h <<\EOF
1967 #define STRCOLL_BROKEN 1
1968 EOF
1969
1970 fi
1971
1972
1973 echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6
1974 echo "configure:1975: checking whether signal handlers are of type void" >&5
1975 if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then
1976   echo $ac_n "(cached) $ac_c" 1>&6
1977 else
1978   cat > conftest.$ac_ext <<EOF
1979 #line 1980 "configure"
1980 #include "confdefs.h"
1981 #include <sys/types.h>
1982 #include <signal.h>
1983 #ifdef signal
1984 #undef signal
1985 #endif
1986 #ifdef __cplusplus
1987 extern "C"
1988 #endif
1989 void (*signal ()) ();
1990 int main() {
1991 int i;
1992 ; return 0; }
1993 EOF
1994 if { (eval echo configure:1995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1995   rm -rf conftest*
1996   bash_cv_void_sighandler=yes
1997 else
1998   echo "configure: failed program was:" >&5
1999   cat conftest.$ac_ext >&5
2000   rm -rf conftest*
2001   bash_cv_void_sighandler=no
2002 fi
2003 rm -f conftest*
2004 fi
2005 echo "$ac_t""$bash_cv_void_sighandler" 1>&6
2006 if test $bash_cv_void_sighandler = yes; then
2007 cat >> confdefs.h <<\EOF
2008 #define VOID_SIGHANDLER 1
2009 EOF
2010
2011 fi
2012
2013 echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6
2014 echo "configure:2015: checking for TIOCGWINSZ in sys/ioctl.h" >&5
2015 if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then
2016   echo $ac_n "(cached) $ac_c" 1>&6
2017 else
2018   cat > conftest.$ac_ext <<EOF
2019 #line 2020 "configure"
2020 #include "confdefs.h"
2021 #include <sys/types.h>
2022 #include <sys/ioctl.h>
2023 int main() {
2024 int x = TIOCGWINSZ;
2025 ; return 0; }
2026 EOF
2027 if { (eval echo configure:2028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2028   rm -rf conftest*
2029   bash_cv_tiocgwinsz_in_ioctl=yes
2030 else
2031   echo "configure: failed program was:" >&5
2032   cat conftest.$ac_ext >&5
2033   rm -rf conftest*
2034   bash_cv_tiocgwinsz_in_ioctl=no
2035 fi
2036 rm -f conftest*
2037 fi
2038
2039 echo "$ac_t""$bash_cv_tiocgwinsz_in_ioctl" 1>&6
2040 if test $bash_cv_tiocgwinsz_in_ioctl = yes; then   
2041 cat >> confdefs.h <<\EOF
2042 #define GWINSZ_IN_SYS_IOCTL 1
2043 EOF
2044
2045 fi
2046
2047 echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6
2048 echo "configure:2049: checking for TIOCSTAT in sys/ioctl.h" >&5
2049 if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then
2050   echo $ac_n "(cached) $ac_c" 1>&6
2051 else
2052   cat > conftest.$ac_ext <<EOF
2053 #line 2054 "configure"
2054 #include "confdefs.h"
2055 #include <sys/types.h>
2056 #include <sys/ioctl.h>
2057 int main() {
2058 int x = TIOCSTAT;
2059 ; return 0; }
2060 EOF
2061 if { (eval echo configure:2062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2062   rm -rf conftest*
2063   bash_cv_tiocstat_in_ioctl=yes
2064 else
2065   echo "configure: failed program was:" >&5
2066   cat conftest.$ac_ext >&5
2067   rm -rf conftest*
2068   bash_cv_tiocstat_in_ioctl=no
2069 fi
2070 rm -f conftest*
2071 fi
2072
2073 echo "$ac_t""$bash_cv_tiocstat_in_ioctl" 1>&6
2074 if test $bash_cv_tiocstat_in_ioctl = yes; then   
2075 cat >> confdefs.h <<\EOF
2076 #define TIOCSTAT_IN_SYS_IOCTL 1
2077 EOF
2078
2079 fi
2080
2081 echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6
2082 echo "configure:2083: checking for FIONREAD in sys/ioctl.h" >&5
2083 if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then
2084   echo $ac_n "(cached) $ac_c" 1>&6
2085 else
2086   cat > conftest.$ac_ext <<EOF
2087 #line 2088 "configure"
2088 #include "confdefs.h"
2089 #include <sys/types.h>
2090 #include <sys/ioctl.h>
2091 int main() {
2092 int x = FIONREAD;
2093 ; return 0; }
2094 EOF
2095 if { (eval echo configure:2096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2096   rm -rf conftest*
2097   bash_cv_fionread_in_ioctl=yes
2098 else
2099   echo "configure: failed program was:" >&5
2100   cat conftest.$ac_ext >&5
2101   rm -rf conftest*
2102   bash_cv_fionread_in_ioctl=no
2103 fi
2104 rm -f conftest*
2105 fi
2106
2107 echo "$ac_t""$bash_cv_fionread_in_ioctl" 1>&6
2108 if test $bash_cv_fionread_in_ioctl = yes; then   
2109 cat >> confdefs.h <<\EOF
2110 #define FIONREAD_IN_SYS_IOCTL 1
2111 EOF
2112
2113 fi
2114
2115 echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6
2116 echo "configure:2117: checking for speed_t in sys/types.h" >&5
2117 if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then
2118   echo $ac_n "(cached) $ac_c" 1>&6
2119 else
2120   cat > conftest.$ac_ext <<EOF
2121 #line 2122 "configure"
2122 #include "confdefs.h"
2123 #include <sys/types.h>
2124 int main() {
2125 speed_t x;
2126 ; return 0; }
2127 EOF
2128 if { (eval echo configure:2129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2129   rm -rf conftest*
2130   bash_cv_speed_t_in_sys_types=yes
2131 else
2132   echo "configure: failed program was:" >&5
2133   cat conftest.$ac_ext >&5
2134   rm -rf conftest*
2135   bash_cv_speed_t_in_sys_types=no
2136 fi
2137 rm -f conftest*
2138 fi
2139
2140 echo "$ac_t""$bash_cv_speed_t_in_sys_types" 1>&6
2141 if test $bash_cv_speed_t_in_sys_types = yes; then   
2142 cat >> confdefs.h <<\EOF
2143 #define SPEED_T_IN_SYS_TYPES 1
2144 EOF
2145
2146 fi
2147
2148 echo $ac_n "checking for struct winsize in sys/ioctl.h and termios.h""... $ac_c" 1>&6
2149 echo "configure:2150: checking for struct winsize in sys/ioctl.h and termios.h" >&5
2150 if eval "test \"`echo '$''{'bash_cv_struct_winsize_header'+set}'`\" = set"; then
2151   echo $ac_n "(cached) $ac_c" 1>&6
2152 else
2153   cat > conftest.$ac_ext <<EOF
2154 #line 2155 "configure"
2155 #include "confdefs.h"
2156 #include <sys/types.h>
2157 #include <sys/ioctl.h>
2158 int main() {
2159 struct winsize x;
2160 ; return 0; }
2161 EOF
2162 if { (eval echo configure:2163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2163   rm -rf conftest*
2164   bash_cv_struct_winsize_header=ioctl_h
2165 else
2166   echo "configure: failed program was:" >&5
2167   cat conftest.$ac_ext >&5
2168   rm -rf conftest*
2169   cat > conftest.$ac_ext <<EOF
2170 #line 2171 "configure"
2171 #include "confdefs.h"
2172 #include <sys/types.h>
2173 #include <termios.h>
2174 int main() {
2175 struct winsize x;
2176 ; return 0; }
2177 EOF
2178 if { (eval echo configure:2179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2179   rm -rf conftest*
2180   bash_cv_struct_winsize_header=termios_h
2181 else
2182   echo "configure: failed program was:" >&5
2183   cat conftest.$ac_ext >&5
2184   rm -rf conftest*
2185   bash_cv_struct_winsize_header=other
2186 fi
2187 rm -f conftest*
2188
2189 fi
2190 rm -f conftest*
2191 fi
2192
2193 if test $bash_cv_struct_winsize_header = ioctl_h; then
2194   echo "$ac_t""sys/ioctl.h" 1>&6
2195   cat >> confdefs.h <<\EOF
2196 #define STRUCT_WINSIZE_IN_SYS_IOCTL 1
2197 EOF
2198
2199 elif test $bash_cv_struct_winsize_header = termios_h; then
2200   echo "$ac_t""termios.h" 1>&6
2201   cat >> confdefs.h <<\EOF
2202 #define STRUCT_WINSIZE_IN_TERMIOS 1
2203 EOF
2204
2205 else
2206   echo "$ac_t""not found" 1>&6
2207 fi
2208
2209
2210 echo $ac_n "checking if struct dirent has a d_ino member""... $ac_c" 1>&6
2211 echo "configure:2212: checking if struct dirent has a d_ino member" >&5
2212 if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then
2213   echo $ac_n "(cached) $ac_c" 1>&6
2214 else
2215   cat > conftest.$ac_ext <<EOF
2216 #line 2217 "configure"
2217 #include "confdefs.h"
2218
2219 #include <stdio.h>
2220 #include <sys/types.h>
2221 #ifdef HAVE_UNISTD_H
2222 # include <unistd.h>
2223 #endif /* HAVE_UNISTD_H */
2224 #if defined(HAVE_DIRENT_H)
2225 # include <dirent.h>
2226 #else
2227 # define dirent direct
2228 # ifdef HAVE_SYS_NDIR_H
2229 #  include <sys/ndir.h>
2230 # endif /* SYSNDIR */
2231 # ifdef HAVE_SYS_DIR_H
2232 #  include <sys/dir.h>
2233 # endif /* SYSDIR */
2234 # ifdef HAVE_NDIR_H
2235 #  include <ndir.h>
2236 # endif
2237 #endif /* HAVE_DIRENT_H */
2238
2239 int main() {
2240
2241 struct dirent d; int z; z = d.d_ino;
2242
2243 ; return 0; }
2244 EOF
2245 if { (eval echo configure:2246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2246   rm -rf conftest*
2247   bash_cv_dirent_has_dino=yes
2248 else
2249   echo "configure: failed program was:" >&5
2250   cat conftest.$ac_ext >&5
2251   rm -rf conftest*
2252   bash_cv_dirent_has_dino=no
2253 fi
2254 rm -f conftest*
2255 fi
2256
2257 echo "$ac_t""$bash_cv_dirent_has_dino" 1>&6
2258 if test $bash_cv_dirent_has_dino = yes; then
2259 cat >> confdefs.h <<\EOF
2260 #define STRUCT_DIRENT_HAS_D_INO 1
2261 EOF
2262
2263 fi
2264
2265
2266 echo $ac_n "checking if struct dirent has a d_fileno member""... $ac_c" 1>&6
2267 echo "configure:2268: checking if struct dirent has a d_fileno member" >&5
2268 if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then
2269   echo $ac_n "(cached) $ac_c" 1>&6
2270 else
2271   cat > conftest.$ac_ext <<EOF
2272 #line 2273 "configure"
2273 #include "confdefs.h"
2274
2275 #include <stdio.h>
2276 #include <sys/types.h>
2277 #ifdef HAVE_UNISTD_H
2278 # include <unistd.h>
2279 #endif /* HAVE_UNISTD_H */
2280 #if defined(HAVE_DIRENT_H)
2281 # include <dirent.h>
2282 #else
2283 # define dirent direct
2284 # ifdef HAVE_SYS_NDIR_H
2285 #  include <sys/ndir.h>
2286 # endif /* SYSNDIR */
2287 # ifdef HAVE_SYS_DIR_H
2288 #  include <sys/dir.h>
2289 # endif /* SYSDIR */
2290 # ifdef HAVE_NDIR_H
2291 #  include <ndir.h>
2292 # endif
2293 #endif /* HAVE_DIRENT_H */
2294
2295 int main() {
2296
2297 struct dirent d; int z; z = d.d_fileno;
2298
2299 ; return 0; }
2300 EOF
2301 if { (eval echo configure:2302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2302   rm -rf conftest*
2303   bash_cv_dirent_has_d_fileno=yes
2304 else
2305   echo "configure: failed program was:" >&5
2306   cat conftest.$ac_ext >&5
2307   rm -rf conftest*
2308   bash_cv_dirent_has_d_fileno=no
2309 fi
2310 rm -f conftest*
2311 fi
2312
2313 echo "$ac_t""$bash_cv_dirent_has_d_fileno" 1>&6
2314 if test $bash_cv_dirent_has_d_fileno = yes; then
2315 cat >> confdefs.h <<\EOF
2316 #define STRUCT_DIRENT_HAS_D_FILENO 1
2317 EOF
2318
2319 fi
2320
2321
2322 case "$host_os" in
2323 aix*)   prefer_curses=yes ;;
2324 esac
2325
2326 if test "X$bash_cv_termcap_lib" = "X"; then
2327 _bash_needmsg=yes
2328 else
2329 echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
2330 echo "configure:2331: checking which library has the termcap functions" >&5
2331 _bash_needmsg=
2332 fi
2333 if eval "test \"`echo '$''{'bash_cv_termcap_lib'+set}'`\" = set"; then
2334   echo $ac_n "(cached) $ac_c" 1>&6
2335 else
2336   echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
2337 echo "configure:2338: checking for tgetent in -ltermcap" >&5
2338 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
2339 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2340   echo $ac_n "(cached) $ac_c" 1>&6
2341 else
2342   ac_save_LIBS="$LIBS"
2343 LIBS="-ltermcap  $LIBS"
2344 cat > conftest.$ac_ext <<EOF
2345 #line 2346 "configure"
2346 #include "confdefs.h"
2347 /* Override any gcc2 internal prototype to avoid an error.  */
2348 /* We use char because int might match the return type of a gcc2
2349     builtin and then its argument prototype would still apply.  */
2350 char tgetent();
2351
2352 int main() {
2353 tgetent()
2354 ; return 0; }
2355 EOF
2356 if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2357   rm -rf conftest*
2358   eval "ac_cv_lib_$ac_lib_var=yes"
2359 else
2360   echo "configure: failed program was:" >&5
2361   cat conftest.$ac_ext >&5
2362   rm -rf conftest*
2363   eval "ac_cv_lib_$ac_lib_var=no"
2364 fi
2365 rm -f conftest*
2366 LIBS="$ac_save_LIBS"
2367
2368 fi
2369 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2370   echo "$ac_t""yes" 1>&6
2371   bash_cv_termcap_lib=libtermcap
2372 else
2373   echo "$ac_t""no" 1>&6
2374 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
2375 echo "configure:2376: checking for tgetent in -lcurses" >&5
2376 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
2377 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2378   echo $ac_n "(cached) $ac_c" 1>&6
2379 else
2380   ac_save_LIBS="$LIBS"
2381 LIBS="-lcurses  $LIBS"
2382 cat > conftest.$ac_ext <<EOF
2383 #line 2384 "configure"
2384 #include "confdefs.h"
2385 /* Override any gcc2 internal prototype to avoid an error.  */
2386 /* We use char because int might match the return type of a gcc2
2387     builtin and then its argument prototype would still apply.  */
2388 char tgetent();
2389
2390 int main() {
2391 tgetent()
2392 ; return 0; }
2393 EOF
2394 if { (eval echo configure:2395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2395   rm -rf conftest*
2396   eval "ac_cv_lib_$ac_lib_var=yes"
2397 else
2398   echo "configure: failed program was:" >&5
2399   cat conftest.$ac_ext >&5
2400   rm -rf conftest*
2401   eval "ac_cv_lib_$ac_lib_var=no"
2402 fi
2403 rm -f conftest*
2404 LIBS="$ac_save_LIBS"
2405
2406 fi
2407 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2408   echo "$ac_t""yes" 1>&6
2409   bash_cv_termcap_lib=libcurses
2410 else
2411   echo "$ac_t""no" 1>&6
2412 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
2413 echo "configure:2414: checking for tgetent in -lncurses" >&5
2414 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
2415 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2416   echo $ac_n "(cached) $ac_c" 1>&6
2417 else
2418   ac_save_LIBS="$LIBS"
2419 LIBS="-lncurses  $LIBS"
2420 cat > conftest.$ac_ext <<EOF
2421 #line 2422 "configure"
2422 #include "confdefs.h"
2423 /* Override any gcc2 internal prototype to avoid an error.  */
2424 /* We use char because int might match the return type of a gcc2
2425     builtin and then its argument prototype would still apply.  */
2426 char tgetent();
2427
2428 int main() {
2429 tgetent()
2430 ; return 0; }
2431 EOF
2432 if { (eval echo configure:2433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2433   rm -rf conftest*
2434   eval "ac_cv_lib_$ac_lib_var=yes"
2435 else
2436   echo "configure: failed program was:" >&5
2437   cat conftest.$ac_ext >&5
2438   rm -rf conftest*
2439   eval "ac_cv_lib_$ac_lib_var=no"
2440 fi
2441 rm -f conftest*
2442 LIBS="$ac_save_LIBS"
2443
2444 fi
2445 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2446   echo "$ac_t""yes" 1>&6
2447   bash_cv_termcap_lib=libncurses
2448 else
2449   echo "$ac_t""no" 1>&6
2450 bash_cv_termcap_lib=gnutermcap
2451 fi
2452
2453 fi
2454
2455 fi
2456
2457 fi
2458
2459 if test "X$_bash_needmsg" = "Xyes"; then
2460 echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
2461 echo "configure:2462: checking which library has the termcap functions" >&5
2462 fi
2463 echo "$ac_t""using $bash_cv_termcap_lib" 1>&6
2464 if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
2465 LDFLAGS="$LDFLAGS -L./lib/termcap"
2466 TERMCAP_LIB="./lib/termcap/libtermcap.a"
2467 TERMCAP_DEP="./lib/termcap/libtermcap.a"
2468 elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
2469 TERMCAP_LIB=-ltermcap
2470 TERMCAP_DEP=
2471 elif test $bash_cv_termcap_lib = libncurses; then
2472 TERMCAP_LIB=-lncurses
2473 TERMCAP_DEP=
2474 else
2475 TERMCAP_LIB=-lcurses
2476 TERMCAP_DEP=
2477 fi
2478
2479 if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
2480         TERMCAP_LIB=-ltermcap   #default
2481 fi
2482
2483 case "$host_cpu" in
2484 *cray*) LOCAL_CFLAGS=-DCRAY ;;
2485 esac
2486
2487 case "$host_os" in
2488 isc*)   LOCAL_CFLAGS=-Disc386 ;;
2489 esac
2490
2491 BUILD_DIR=`pwd`
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506 trap '' 1 2 15
2507 cat > confcache <<\EOF
2508 # This file is a shell script that caches the results of configure
2509 # tests run on this system so they can be shared between configure
2510 # scripts and configure runs.  It is not useful on other systems.
2511 # If it contains results you don't want to keep, you may remove or edit it.
2512 #
2513 # By default, configure uses ./config.cache as the cache file,
2514 # creating it if it does not exist already.  You can give configure
2515 # the --cache-file=FILE option to use a different cache file; that is
2516 # what configure does when it calls configure scripts in
2517 # subdirectories, so they share the cache.
2518 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2519 # config.status only pays attention to the cache file if you give it the
2520 # --recheck option to rerun configure.
2521 #
2522 EOF
2523 # The following way of writing the cache mishandles newlines in values,
2524 # but we know of no workaround that is simple, portable, and efficient.
2525 # So, don't put newlines in cache variables' values.
2526 # Ultrix sh set writes to stderr and can't be redirected directly,
2527 # and sets the high bit in the cache file unless we assign to the vars.
2528 (set) 2>&1 |
2529   case `(ac_space=' '; set) 2>&1 | grep ac_space` in
2530   *ac_space=\ *)
2531     # `set' does not quote correctly, so add quotes (double-quote substitution
2532     # turns \\\\ into \\, and sed turns \\ into \).
2533     sed -n \
2534       -e "s/'/'\\\\''/g" \
2535       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2536     ;;
2537   *)
2538     # `set' quotes correctly as required by POSIX, so do not add quotes.
2539     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2540     ;;
2541   esac >> confcache
2542 if cmp -s $cache_file confcache; then
2543   :
2544 else
2545   if test -w $cache_file; then
2546     echo "updating cache $cache_file"
2547     cat confcache > $cache_file
2548   else
2549     echo "not updating unwritable cache $cache_file"
2550   fi
2551 fi
2552 rm -f confcache
2553
2554 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2555
2556 test "x$prefix" = xNONE && prefix=$ac_default_prefix
2557 # Let make expand exec_prefix.
2558 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2559
2560 # Any assignment to VPATH causes Sun make to only execute
2561 # the first set of double-colon rules, so remove it if not needed.
2562 # If there is a colon in the path, we need to keep it.
2563 if test "x$srcdir" = x.; then
2564   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
2565 fi
2566
2567 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2568
2569 DEFS=-DHAVE_CONFIG_H
2570
2571 # Without the "./", some shells look in PATH for config.status.
2572 : ${CONFIG_STATUS=./config.status}
2573
2574 echo creating $CONFIG_STATUS
2575 rm -f $CONFIG_STATUS
2576 cat > $CONFIG_STATUS <<EOF
2577 #! /bin/sh
2578 # Generated automatically by configure.
2579 # Run this file to recreate the current configuration.
2580 # This directory was configured as follows,
2581 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2582 #
2583 # $0 $ac_configure_args
2584 #
2585 # Compiler output produced by configure, useful for debugging
2586 # configure, is in ./config.log if it exists.
2587
2588 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2589 for ac_option
2590 do
2591   case "\$ac_option" in
2592   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2593     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2594     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2595   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2596     echo "$CONFIG_STATUS generated by autoconf version 2.12.2"
2597     exit 0 ;;
2598   -help | --help | --hel | --he | --h)
2599     echo "\$ac_cs_usage"; exit 0 ;;
2600   *) echo "\$ac_cs_usage"; exit 1 ;;
2601   esac
2602 done
2603
2604 ac_given_srcdir=$srcdir
2605 ac_given_INSTALL="$INSTALL"
2606
2607 trap 'rm -fr `echo "Makefile doc/Makefile examples/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2608 EOF
2609 cat >> $CONFIG_STATUS <<EOF
2610
2611 # Protect against being on the right side of a sed subst in config.status.
2612 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2613  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2614 $ac_vpsub
2615 $extrasub
2616 s%@SHELL@%$SHELL%g
2617 s%@CFLAGS@%$CFLAGS%g
2618 s%@CPPFLAGS@%$CPPFLAGS%g
2619 s%@CXXFLAGS@%$CXXFLAGS%g
2620 s%@DEFS@%$DEFS%g
2621 s%@LDFLAGS@%$LDFLAGS%g
2622 s%@LIBS@%$LIBS%g
2623 s%@exec_prefix@%$exec_prefix%g
2624 s%@prefix@%$prefix%g
2625 s%@program_transform_name@%$program_transform_name%g
2626 s%@bindir@%$bindir%g
2627 s%@sbindir@%$sbindir%g
2628 s%@libexecdir@%$libexecdir%g
2629 s%@datadir@%$datadir%g
2630 s%@sysconfdir@%$sysconfdir%g
2631 s%@sharedstatedir@%$sharedstatedir%g
2632 s%@localstatedir@%$localstatedir%g
2633 s%@libdir@%$libdir%g
2634 s%@includedir@%$includedir%g
2635 s%@oldincludedir@%$oldincludedir%g
2636 s%@infodir@%$infodir%g
2637 s%@mandir@%$mandir%g
2638 s%@host@%$host%g
2639 s%@host_alias@%$host_alias%g
2640 s%@host_cpu@%$host_cpu%g
2641 s%@host_vendor@%$host_vendor%g
2642 s%@host_os@%$host_os%g
2643 s%@CC@%$CC%g
2644 s%@CPP@%$CPP%g
2645 s%@CROSS_COMPILING_FLAG@%$CROSS_COMPILING_FLAG%g
2646 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
2647 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2648 s%@INSTALL_DATA@%$INSTALL_DATA%g
2649 s%@RANLIB@%$RANLIB%g
2650 s%@BUILD_DIR@%$BUILD_DIR%g
2651 s%@LOCAL_CFLAGS@%$LOCAL_CFLAGS%g
2652 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
2653 s%@LOCAL_DEFS@%$LOCAL_DEFS%g
2654 s%@LIBVERSION@%$LIBVERSION%g
2655 s%@TERMCAP_LIB@%$TERMCAP_LIB%g
2656
2657 CEOF
2658 EOF
2659
2660 cat >> $CONFIG_STATUS <<\EOF
2661
2662 # Split the substitutions into bite-sized pieces for seds with
2663 # small command number limits, like on Digital OSF/1 and HP-UX.
2664 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2665 ac_file=1 # Number of current file.
2666 ac_beg=1 # First line for current file.
2667 ac_end=$ac_max_sed_cmds # Line after last line for current file.
2668 ac_more_lines=:
2669 ac_sed_cmds=""
2670 while $ac_more_lines; do
2671   if test $ac_beg -gt 1; then
2672     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2673   else
2674     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2675   fi
2676   if test ! -s conftest.s$ac_file; then
2677     ac_more_lines=false
2678     rm -f conftest.s$ac_file
2679   else
2680     if test -z "$ac_sed_cmds"; then
2681       ac_sed_cmds="sed -f conftest.s$ac_file"
2682     else
2683       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2684     fi
2685     ac_file=`expr $ac_file + 1`
2686     ac_beg=$ac_end
2687     ac_end=`expr $ac_end + $ac_max_sed_cmds`
2688   fi
2689 done
2690 if test -z "$ac_sed_cmds"; then
2691   ac_sed_cmds=cat
2692 fi
2693 EOF
2694
2695 cat >> $CONFIG_STATUS <<EOF
2696
2697 CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile examples/Makefile"}
2698 EOF
2699 cat >> $CONFIG_STATUS <<\EOF
2700 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2701   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2702   case "$ac_file" in
2703   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2704        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2705   *) ac_file_in="${ac_file}.in" ;;
2706   esac
2707
2708   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2709
2710   # Remove last slash and all that follows it.  Not all systems have dirname.
2711   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2712   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2713     # The file is in a subdirectory.
2714     test ! -d "$ac_dir" && mkdir "$ac_dir"
2715     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2716     # A "../" for each directory in $ac_dir_suffix.
2717     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2718   else
2719     ac_dir_suffix= ac_dots=
2720   fi
2721
2722   case "$ac_given_srcdir" in
2723   .)  srcdir=.
2724       if test -z "$ac_dots"; then top_srcdir=.
2725       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2726   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2727   *) # Relative path.
2728     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2729     top_srcdir="$ac_dots$ac_given_srcdir" ;;
2730   esac
2731
2732   case "$ac_given_INSTALL" in
2733   [/$]*) INSTALL="$ac_given_INSTALL" ;;
2734   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2735   esac
2736
2737   echo creating "$ac_file"
2738   rm -f "$ac_file"
2739   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2740   case "$ac_file" in
2741   *Makefile*) ac_comsub="1i\\
2742 # $configure_input" ;;
2743   *) ac_comsub= ;;
2744   esac
2745
2746   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2747   sed -e "$ac_comsub
2748 s%@configure_input@%$configure_input%g
2749 s%@srcdir@%$srcdir%g
2750 s%@top_srcdir@%$top_srcdir%g
2751 s%@INSTALL@%$INSTALL%g
2752 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2753 fi; done
2754 rm -f conftest.s*
2755
2756 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2757 # NAME is the cpp macro being defined and VALUE is the value it is being given.
2758 #
2759 # ac_d sets the value in "#define NAME VALUE" lines.
2760 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
2761 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
2762 ac_dC='\3'
2763 ac_dD='%g'
2764 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2765 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2766 ac_uB='\([      ]\)%\1#\2define\3'
2767 ac_uC=' '
2768 ac_uD='\4%g'
2769 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2770 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2771 ac_eB='$%\1#\2define\3'
2772 ac_eC=' '
2773 ac_eD='%g'
2774
2775 if test "${CONFIG_HEADERS+set}" != set; then
2776 EOF
2777 cat >> $CONFIG_STATUS <<EOF
2778   CONFIG_HEADERS="config.h"
2779 EOF
2780 cat >> $CONFIG_STATUS <<\EOF
2781 fi
2782 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2783   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2784   case "$ac_file" in
2785   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2786        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2787   *) ac_file_in="${ac_file}.in" ;;
2788   esac
2789
2790   echo creating $ac_file
2791
2792   rm -f conftest.frag conftest.in conftest.out
2793   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2794   cat $ac_file_inputs > conftest.in
2795
2796 EOF
2797
2798 # Transform confdefs.h into a sed script conftest.vals that substitutes
2799 # the proper values into config.h.in to produce config.h.  And first:
2800 # Protect against being on the right side of a sed subst in config.status.
2801 # Protect against being in an unquoted here document in config.status.
2802 rm -f conftest.vals
2803 cat > conftest.hdr <<\EOF
2804 s/[\\&%]/\\&/g
2805 s%[\\$`]%\\&%g
2806 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2807 s%ac_d%ac_u%gp
2808 s%ac_u%ac_e%gp
2809 EOF
2810 sed -n -f conftest.hdr confdefs.h > conftest.vals
2811 rm -f conftest.hdr
2812
2813 # This sed command replaces #undef with comments.  This is necessary, for
2814 # example, in the case of _POSIX_SOURCE, which is predefined and required
2815 # on some systems where configure will not decide to define it.
2816 cat >> conftest.vals <<\EOF
2817 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2818 EOF
2819
2820 # Break up conftest.vals because some shells have a limit on
2821 # the size of here documents, and old seds have small limits too.
2822
2823 rm -f conftest.tail
2824 while :
2825 do
2826   ac_lines=`grep -c . conftest.vals`
2827   # grep -c gives empty output for an empty file on some AIX systems.
2828   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2829   # Write a limited-size here document to conftest.frag.
2830   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2831   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2832   echo 'CEOF
2833   sed -f conftest.frag conftest.in > conftest.out
2834   rm -f conftest.in
2835   mv conftest.out conftest.in
2836 ' >> $CONFIG_STATUS
2837   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2838   rm -f conftest.vals
2839   mv conftest.tail conftest.vals
2840 done
2841 rm -f conftest.vals
2842
2843 cat >> $CONFIG_STATUS <<\EOF
2844   rm -f conftest.frag conftest.h
2845   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
2846   cat conftest.in >> conftest.h
2847   rm -f conftest.in
2848   if cmp -s $ac_file conftest.h 2>/dev/null; then
2849     echo "$ac_file is unchanged"
2850     rm -f conftest.h
2851   else
2852     # Remove last slash and all that follows it.  Not all systems have dirname.
2853       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2854       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2855       # The file is in a subdirectory.
2856       test ! -d "$ac_dir" && mkdir "$ac_dir"
2857     fi
2858     rm -f $ac_file
2859     mv conftest.h $ac_file
2860   fi
2861 fi; done
2862
2863 EOF
2864 cat >> $CONFIG_STATUS <<EOF
2865
2866 EOF
2867 cat >> $CONFIG_STATUS <<\EOF
2868
2869 # Makefile uses this timestamp file to record whether config.h is up to date.
2870 echo > stamp-h
2871
2872 exit 0
2873 EOF
2874 chmod +x $CONFIG_STATUS
2875 rm -fr confdefs* $ac_clean_files
2876 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2877