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