OSDN Git Service

* thread-db.c (get_thread_signals): Doc fix.
[pf3gnuchains/pf3gnuchains3x.git] / expect / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help
15   --with-tclconfig           directory containing tcl configuration (tclConfig.sh)"
16 ac_help="$ac_help
17   --with-tkconfig           directory containing tk configuration (tkConfig.sh)"
18 ac_help="$ac_help
19   --with-tclinclude       directory where tcl private headers are"
20 ac_help="$ac_help
21   --enable-shared     build libexpect as a shared library"
22 ac_help="$ac_help
23   --with-x               whether or not to use X (default yes)"
24 ac_help="$ac_help
25   --with-tkinclude       directory where tk private headers are"
26 ac_help="$ac_help
27   --disable-load     disallow dynamic loading"
28 ac_help="$ac_help
29   --enable-gcc        allow use of gcc if available"
30
31 # Initialize some variables set by options.
32 # The variables have the same names as the options, with
33 # dashes changed to underlines.
34 build=NONE
35 cache_file=./config.cache
36 exec_prefix=NONE
37 host=NONE
38 no_create=
39 nonopt=NONE
40 no_recursion=
41 prefix=NONE
42 program_prefix=NONE
43 program_suffix=NONE
44 program_transform_name=s,x,x,
45 silent=
46 site=
47 srcdir=
48 target=NONE
49 verbose=
50 x_includes=NONE
51 x_libraries=NONE
52 bindir='${exec_prefix}/bin'
53 sbindir='${exec_prefix}/sbin'
54 libexecdir='${exec_prefix}/libexec'
55 datadir='${prefix}/share'
56 sysconfdir='${prefix}/etc'
57 sharedstatedir='${prefix}/com'
58 localstatedir='${prefix}/var'
59 libdir='${exec_prefix}/lib'
60 includedir='${prefix}/include'
61 oldincludedir='/usr/include'
62 infodir='${prefix}/info'
63 mandir='${prefix}/man'
64
65 # Initialize some other variables.
66 subdirs=
67 MFLAGS= MAKEFLAGS=
68 SHELL=${CONFIG_SHELL-/bin/sh}
69 # Maximum number of lines to put in a shell here document.
70 ac_max_here_lines=12
71
72 ac_prev=
73 for ac_option
74 do
75
76   # If the previous option needs an argument, assign it.
77   if test -n "$ac_prev"; then
78     eval "$ac_prev=\$ac_option"
79     ac_prev=
80     continue
81   fi
82
83   case "$ac_option" in
84   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
85   *) ac_optarg= ;;
86   esac
87
88   # Accept the important Cygnus configure options, so we can diagnose typos.
89
90   case "$ac_option" in
91
92   -bindir | --bindir | --bindi | --bind | --bin | --bi)
93     ac_prev=bindir ;;
94   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
95     bindir="$ac_optarg" ;;
96
97   -build | --build | --buil | --bui | --bu)
98     ac_prev=build ;;
99   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
100     build="$ac_optarg" ;;
101
102   -cache-file | --cache-file | --cache-fil | --cache-fi \
103   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
104     ac_prev=cache_file ;;
105   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
106   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
107     cache_file="$ac_optarg" ;;
108
109   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
110     ac_prev=datadir ;;
111   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
112   | --da=*)
113     datadir="$ac_optarg" ;;
114
115   -disable-* | --disable-*)
116     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
117     # Reject names that are not valid shell variable names.
118     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
119       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
120     fi
121     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
122     eval "enable_${ac_feature}=no" ;;
123
124   -enable-* | --enable-*)
125     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
126     # Reject names that are not valid shell variable names.
127     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
128       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
129     fi
130     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
131     case "$ac_option" in
132       *=*) ;;
133       *) ac_optarg=yes ;;
134     esac
135     eval "enable_${ac_feature}='$ac_optarg'" ;;
136
137   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
138   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
139   | --exec | --exe | --ex)
140     ac_prev=exec_prefix ;;
141   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
142   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
143   | --exec=* | --exe=* | --ex=*)
144     exec_prefix="$ac_optarg" ;;
145
146   -gas | --gas | --ga | --g)
147     # Obsolete; use --with-gas.
148     with_gas=yes ;;
149
150   -help | --help | --hel | --he)
151     # Omit some internal or obsolete options to make the list less imposing.
152     # This message is too long to be a string in the A/UX 3.1 sh.
153     cat << EOF
154 Usage: configure [options] [host]
155 Options: [defaults in brackets after descriptions]
156 Configuration:
157   --cache-file=FILE       cache test results in FILE
158   --help                  print this message
159   --no-create             do not create output files
160   --quiet, --silent       do not print \`checking...' messages
161   --version               print the version of autoconf that created configure
162 Directory and file names:
163   --prefix=PREFIX         install architecture-independent files in PREFIX
164                           [$ac_default_prefix]
165   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
166                           [same as prefix]
167   --bindir=DIR            user executables in DIR [EPREFIX/bin]
168   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
169   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
170   --datadir=DIR           read-only architecture-independent data in DIR
171                           [PREFIX/share]
172   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
173   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
174                           [PREFIX/com]
175   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
176   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
177   --includedir=DIR        C header files in DIR [PREFIX/include]
178   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
179   --infodir=DIR           info documentation in DIR [PREFIX/info]
180   --mandir=DIR            man documentation in DIR [PREFIX/man]
181   --srcdir=DIR            find the sources in DIR [configure dir or ..]
182   --program-prefix=PREFIX prepend PREFIX to installed program names
183   --program-suffix=SUFFIX append SUFFIX to installed program names
184   --program-transform-name=PROGRAM
185                           run sed PROGRAM on installed program names
186 EOF
187     cat << EOF
188 Host type:
189   --build=BUILD           configure for building on BUILD [BUILD=HOST]
190   --host=HOST             configure for HOST [guessed]
191   --target=TARGET         configure for TARGET [TARGET=HOST]
192 Features and packages:
193   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
194   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
195   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
196   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
197   --x-includes=DIR        X include files are in DIR
198   --x-libraries=DIR       X library files are in DIR
199 EOF
200     if test -n "$ac_help"; then
201       echo "--enable and --with options recognized:$ac_help"
202     fi
203     exit 0 ;;
204
205   -host | --host | --hos | --ho)
206     ac_prev=host ;;
207   -host=* | --host=* | --hos=* | --ho=*)
208     host="$ac_optarg" ;;
209
210   -includedir | --includedir | --includedi | --included | --include \
211   | --includ | --inclu | --incl | --inc)
212     ac_prev=includedir ;;
213   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
214   | --includ=* | --inclu=* | --incl=* | --inc=*)
215     includedir="$ac_optarg" ;;
216
217   -infodir | --infodir | --infodi | --infod | --info | --inf)
218     ac_prev=infodir ;;
219   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
220     infodir="$ac_optarg" ;;
221
222   -libdir | --libdir | --libdi | --libd)
223     ac_prev=libdir ;;
224   -libdir=* | --libdir=* | --libdi=* | --libd=*)
225     libdir="$ac_optarg" ;;
226
227   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
228   | --libexe | --libex | --libe)
229     ac_prev=libexecdir ;;
230   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
231   | --libexe=* | --libex=* | --libe=*)
232     libexecdir="$ac_optarg" ;;
233
234   -localstatedir | --localstatedir | --localstatedi | --localstated \
235   | --localstate | --localstat | --localsta | --localst \
236   | --locals | --local | --loca | --loc | --lo)
237     ac_prev=localstatedir ;;
238   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
239   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
240   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
241     localstatedir="$ac_optarg" ;;
242
243   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
244     ac_prev=mandir ;;
245   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
246     mandir="$ac_optarg" ;;
247
248   -nfp | --nfp | --nf)
249     # Obsolete; use --without-fp.
250     with_fp=no ;;
251
252   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
253   | --no-cr | --no-c)
254     no_create=yes ;;
255
256   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
257   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
258     no_recursion=yes ;;
259
260   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
261   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
262   | --oldin | --oldi | --old | --ol | --o)
263     ac_prev=oldincludedir ;;
264   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
265   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
266   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
267     oldincludedir="$ac_optarg" ;;
268
269   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
270     ac_prev=prefix ;;
271   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
272     prefix="$ac_optarg" ;;
273
274   -program-prefix | --program-prefix | --program-prefi | --program-pref \
275   | --program-pre | --program-pr | --program-p)
276     ac_prev=program_prefix ;;
277   -program-prefix=* | --program-prefix=* | --program-prefi=* \
278   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
279     program_prefix="$ac_optarg" ;;
280
281   -program-suffix | --program-suffix | --program-suffi | --program-suff \
282   | --program-suf | --program-su | --program-s)
283     ac_prev=program_suffix ;;
284   -program-suffix=* | --program-suffix=* | --program-suffi=* \
285   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
286     program_suffix="$ac_optarg" ;;
287
288   -program-transform-name | --program-transform-name \
289   | --program-transform-nam | --program-transform-na \
290   | --program-transform-n | --program-transform- \
291   | --program-transform | --program-transfor \
292   | --program-transfo | --program-transf \
293   | --program-trans | --program-tran \
294   | --progr-tra | --program-tr | --program-t)
295     ac_prev=program_transform_name ;;
296   -program-transform-name=* | --program-transform-name=* \
297   | --program-transform-nam=* | --program-transform-na=* \
298   | --program-transform-n=* | --program-transform-=* \
299   | --program-transform=* | --program-transfor=* \
300   | --program-transfo=* | --program-transf=* \
301   | --program-trans=* | --program-tran=* \
302   | --progr-tra=* | --program-tr=* | --program-t=*)
303     program_transform_name="$ac_optarg" ;;
304
305   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
306   | -silent | --silent | --silen | --sile | --sil)
307     silent=yes ;;
308
309   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
310     ac_prev=sbindir ;;
311   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
312   | --sbi=* | --sb=*)
313     sbindir="$ac_optarg" ;;
314
315   -sharedstatedir | --sharedstatedir | --sharedstatedi \
316   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
317   | --sharedst | --shareds | --shared | --share | --shar \
318   | --sha | --sh)
319     ac_prev=sharedstatedir ;;
320   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
321   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
322   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
323   | --sha=* | --sh=*)
324     sharedstatedir="$ac_optarg" ;;
325
326   -site | --site | --sit)
327     ac_prev=site ;;
328   -site=* | --site=* | --sit=*)
329     site="$ac_optarg" ;;
330
331   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
332     ac_prev=srcdir ;;
333   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
334     srcdir="$ac_optarg" ;;
335
336   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
337   | --syscon | --sysco | --sysc | --sys | --sy)
338     ac_prev=sysconfdir ;;
339   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
340   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
341     sysconfdir="$ac_optarg" ;;
342
343   -target | --target | --targe | --targ | --tar | --ta | --t)
344     ac_prev=target ;;
345   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
346     target="$ac_optarg" ;;
347
348   -v | -verbose | --verbose | --verbos | --verbo | --verb)
349     verbose=yes ;;
350
351   -version | --version | --versio | --versi | --vers)
352     echo "configure generated by autoconf version 2.13"
353     exit 0 ;;
354
355   -with-* | --with-*)
356     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
357     # Reject names that are not valid shell variable names.
358     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
359       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
360     fi
361     ac_package=`echo $ac_package| sed 's/-/_/g'`
362     case "$ac_option" in
363       *=*) ;;
364       *) ac_optarg=yes ;;
365     esac
366     eval "with_${ac_package}='$ac_optarg'" ;;
367
368   -without-* | --without-*)
369     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
370     # Reject names that are not valid shell variable names.
371     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
372       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
373     fi
374     ac_package=`echo $ac_package| sed 's/-/_/g'`
375     eval "with_${ac_package}=no" ;;
376
377   --x)
378     # Obsolete; use --with-x.
379     with_x=yes ;;
380
381   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
382   | --x-incl | --x-inc | --x-in | --x-i)
383     ac_prev=x_includes ;;
384   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
385   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
386     x_includes="$ac_optarg" ;;
387
388   -x-libraries | --x-libraries | --x-librarie | --x-librari \
389   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
390     ac_prev=x_libraries ;;
391   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
392   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
393     x_libraries="$ac_optarg" ;;
394
395   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
396     ;;
397
398   *)
399     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
400       echo "configure: warning: $ac_option: invalid host type" 1>&2
401     fi
402     if test "x$nonopt" != xNONE; then
403       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
404     fi
405     nonopt="$ac_option"
406     ;;
407
408   esac
409 done
410
411 if test -n "$ac_prev"; then
412   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
413 fi
414
415 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
416
417 # File descriptor usage:
418 # 0 standard input
419 # 1 file creation
420 # 2 errors and warnings
421 # 3 some systems may open it to /dev/tty
422 # 4 used on the Kubota Titan
423 # 6 checking for... messages and results
424 # 5 compiler messages saved in config.log
425 if test "$silent" = yes; then
426   exec 6>/dev/null
427 else
428   exec 6>&1
429 fi
430 exec 5>./config.log
431
432 echo "\
433 This file contains any messages produced by compilers while
434 running configure, to aid debugging if configure makes a mistake.
435 " 1>&5
436
437 # Strip out --no-create and --no-recursion so they do not pile up.
438 # Also quote any args containing shell metacharacters.
439 ac_configure_args=
440 for ac_arg
441 do
442   case "$ac_arg" in
443   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
444   | --no-cr | --no-c) ;;
445   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
446   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
447   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
448   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
449   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
450   esac
451 done
452
453 # NLS nuisances.
454 # Only set these to C if already set.  These must not be set unconditionally
455 # because not all systems understand e.g. LANG=C (notably SCO).
456 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
457 # Non-C LC_CTYPE values break the ctype check.
458 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
459 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
460 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
461 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
462
463 # confdefs.h avoids OS command line length limits that DEFS can exceed.
464 rm -rf conftest* confdefs.h
465 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
466 echo > confdefs.h
467
468 # A filename unique to this package, relative to the directory that
469 # configure is in, which we can look for to find out if srcdir is correct.
470 ac_unique_file=expect.h
471
472 # Find the source files, if location was not specified.
473 if test -z "$srcdir"; then
474   ac_srcdir_defaulted=yes
475   # Try the directory containing this script, then its parent.
476   ac_prog=$0
477   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
478   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
479   srcdir=$ac_confdir
480   if test ! -r $srcdir/$ac_unique_file; then
481     srcdir=..
482   fi
483 else
484   ac_srcdir_defaulted=no
485 fi
486 if test ! -r $srcdir/$ac_unique_file; then
487   if test "$ac_srcdir_defaulted" = yes; then
488     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
489   else
490     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
491   fi
492 fi
493 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
494
495 # Prefer explicitly selected file to automatically selected ones.
496 if test -z "$CONFIG_SITE"; then
497   if test "x$prefix" != xNONE; then
498     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
499   else
500     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
501   fi
502 fi
503 for ac_site_file in $CONFIG_SITE; do
504   if test -r "$ac_site_file"; then
505     echo "loading site script $ac_site_file"
506     . "$ac_site_file"
507   fi
508 done
509
510
511 ac_ext=c
512 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
513 ac_cpp='$CPP $CPPFLAGS'
514 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
515 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
516 cross_compiling=$ac_cv_prog_cc_cross
517
518 ac_exeext=
519 ac_objext=o
520 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
521   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
522   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
523     ac_n= ac_c='
524 ' ac_t='        '
525   else
526     ac_n=-n ac_c= ac_t=
527   fi
528 else
529   ac_n= ac_c='\c' ac_t=
530 fi
531
532
533
534 ac_aux_dir=
535 for ac_dir in $srcdir/.. $srcdir/$srcdir/..; do
536   if test -f $ac_dir/install-sh; then
537     ac_aux_dir=$ac_dir
538     ac_install_sh="$ac_aux_dir/install-sh -c"
539     break
540   elif test -f $ac_dir/install.sh; then
541     ac_aux_dir=$ac_dir
542     ac_install_sh="$ac_aux_dir/install.sh -c"
543     break
544   fi
545 done
546 if test -z "$ac_aux_dir"; then
547   { echo "configure: error: can not find install-sh or install.sh in $srcdir/.. $srcdir/$srcdir/.." 1>&2; exit 1; }
548 fi
549 ac_config_guess=$ac_aux_dir/config.guess
550 ac_config_sub=$ac_aux_dir/config.sub
551 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
552
553
554 # note when updating version numbers here, also update pkgIndex.in (see
555 # comments in Makefile)
556 EXP_MAJOR_VERSION=5
557 EXP_MINOR_VERSION=26
558 EXP_MICRO_VERSION=0
559 EXP_VERSION=$EXP_MAJOR_VERSION.$EXP_MINOR_VERSION
560 EXP_VERSION_NODOTS=$EXP_MAJOR_VERSION$EXP_MINOR_VERSION
561 EXP_VERSION_FULL=$EXP_VERSION.$EXP_MICRO_VERSION
562
563 # Tcl's handling of shared_lib_suffix requires this symbol exist
564 VERSION=$EXP_MAJOR_VERSION.$EXP_MINOR_VERSION
565
566 # Too many people send me configure output without identifying the version.
567 # This forced identification should reduce my pain significantly.
568 echo "configuring Expect $EXP_MAJOR_VERSION.$EXP_MINOR_VERSION.$EXP_MICRO_VERSION"
569
570
571 # Do some error checking and defaulting for the host and target type.
572 # The inputs are:
573 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
574 #
575 # The rules are:
576 # 1. You are not allowed to specify --host, --target, and nonopt at the
577 #    same time.
578 # 2. Host defaults to nonopt.
579 # 3. If nonopt is not specified, then host defaults to the current host,
580 #    as determined by config.guess.
581 # 4. Target and build default to nonopt.
582 # 5. If nonopt is not specified, then target and build default to host.
583
584 # The aliases save the names the user supplied, while $host etc.
585 # will get canonicalized.
586 case $host---$target---$nonopt in
587 NONE---*---* | *---NONE---* | *---*---NONE) ;;
588 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
589 esac
590
591
592 # Make sure we can run config.sub.
593 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
594 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
595 fi
596
597 echo $ac_n "checking host system type""... $ac_c" 1>&6
598 echo "configure:599: checking host system type" >&5
599
600 host_alias=$host
601 case "$host_alias" in
602 NONE)
603   case $nonopt in
604   NONE)
605     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
606     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
607     fi ;;
608   *) host_alias=$nonopt ;;
609   esac ;;
610 esac
611
612 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
613 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
614 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
615 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
616 echo "$ac_t""$host" 1>&6
617
618 echo $ac_n "checking target system type""... $ac_c" 1>&6
619 echo "configure:620: checking target system type" >&5
620
621 target_alias=$target
622 case "$target_alias" in
623 NONE)
624   case $nonopt in
625   NONE) target_alias=$host_alias ;;
626   *) target_alias=$nonopt ;;
627   esac ;;
628 esac
629
630 target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
631 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
632 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
633 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
634 echo "$ac_t""$target" 1>&6
635
636 echo $ac_n "checking build system type""... $ac_c" 1>&6
637 echo "configure:638: checking build system type" >&5
638
639 build_alias=$build
640 case "$build_alias" in
641 NONE)
642   case $nonopt in
643   NONE) build_alias=$host_alias ;;
644   *) build_alias=$nonopt ;;
645   esac ;;
646 esac
647
648 build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
649 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
650 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
651 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
652 echo "$ac_t""$build" 1>&6
653
654 test "$host_alias" != "$target_alias" &&
655   test "$program_prefix$program_suffix$program_transform_name" = \
656     NONENONEs,x,x, &&
657   program_prefix=${target_alias}-
658
659
660
661
662 # /bin/sh on some systems is too deficient (in particular, Ultrix 4.3
663 # sh lacks unset and we *need* that), but all these systems come with
664 # alternatives, so take user's choice or whatever we're using here and
665 # allow it to be seen by Make.
666 echo $ac_n "checking shell to use within Make""... $ac_c" 1>&6
667 echo "configure:668: checking shell to use within Make" >&5
668 EXP_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
669 echo "$ac_t""$CONFIG_SHELL" 1>&6
670
671 # If `configure' is invoked (in)directly via `make', ensure that it
672 # encounters no `make' conflicts.
673 #
674 unset MFLAGS MAKEFLAGS
675 MFLAGS=""
676 MAKEFLAGS=""
677
678
679 #
680 # Ok, lets find the tcl configuration
681 # First, look for one uninstalled.  
682 # the alternative search directory is invoked by --with-tclconfig
683 #
684
685 if test x"${no_tcl}" = x ; then
686   # we reset no_tcl in case something fails here
687   no_tcl=true
688   # Check whether --with-tclconfig or --without-tclconfig was given.
689 if test "${with_tclconfig+set}" = set; then
690   withval="$with_tclconfig"
691   with_tclconfig=${withval}
692 fi
693
694   echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
695 echo "configure:696: checking for Tcl configuration" >&5
696   if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
697   echo $ac_n "(cached) $ac_c" 1>&6
698 else
699   
700
701   # First check to see if --with-tclconfig was specified.
702   if test x"${with_tclconfig}" != x ; then
703     if test -f "${with_tclconfig}/tclConfig.sh" ; then
704       ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
705     else
706       { echo "configure: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" 1>&2; exit 1; }
707     fi
708   fi
709
710   # then check for a private Tcl installation
711
712   if test x"${ac_cv_c_tclconfig}" = x ; then
713     for i in \
714                 ../tcl \
715                 `ls -dr ../tcl[7-9].[0-9] 2>/dev/null` \
716                 ../../tcl \
717                 `ls -dr ../../tcl[7-9].[0-9] 2>/dev/null` \
718                 ../../../tcl \
719                 `ls -dr ../../../tcl[7-9].[0-9] 2>/dev/null` ; do
720       if test -f "$i/unix/tclConfig.sh" ; then
721         ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
722         break
723       fi
724       if test -f "$i/win/tclConfig.sh" ; then
725         ac_cv_c_tclconfig=`(cd $i/win; pwd)`
726         break
727       fi
728     done
729   fi
730
731   # check in a few common install locations
732   if test x"${ac_cv_c_tclconfig}" = x ; then
733     for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
734       if test -f "$i/tclConfig.sh" ; then
735         ac_cv_c_tclconfig=`(cd $i; pwd)`
736         break
737       fi
738     done
739   fi
740   # check in a few other private locations
741
742   if test x"${ac_cv_c_tclconfig}" = x ; then
743     for i in \
744                 ${srcdir}/../tcl \
745                 `ls -dr ${srcdir}/../tcl[7-9].[0-9] 2>/dev/null` ; do
746       if test -f "$i/unix/tclConfig.sh" ; then
747         ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
748         break
749       fi
750     done
751   fi
752
753   
754 fi
755
756   if test x"${ac_cv_c_tclconfig}" = x ; then
757     TCLCONFIG="# no Tcl configs found"
758     echo "configure: warning: Can't find Tcl configuration definitions" 1>&2
759   else
760     no_tcl=
761     TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh
762     echo "$ac_t""found $TCLCONFIG" 1>&6
763   fi
764 fi
765
766
767     . $TCLCONFIG
768
769     
770
771
772
773
774     
775
776 # Tcl defines TCL_SHLIB_SUFFIX but TCL_SHARED_LIB_SUFFIX then looks for it
777 # as just SHLIB_SUFFIX.  How bizarre.
778     SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
779     
780
781     
782
783
784
785     
786     
787
788     
789
790
791 CC=$TCL_CC
792 EXP_AND_TCL_LIBS=$TCL_LIBS
793
794 #
795 # Ok, lets find the tk configuration
796 # First, look for one uninstalled.  
797 # the alternative search directory is invoked by --with-tkconfig
798 #
799
800 if test x"${no_tk}" = x ; then
801   # we reset no_tk in case something fails here
802   no_tk=true
803   # Check whether --with-tkconfig or --without-tkconfig was given.
804 if test "${with_tkconfig+set}" = set; then
805   withval="$with_tkconfig"
806   with_tkconfig=${withval}
807 fi
808
809   echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
810 echo "configure:811: checking for Tk configuration" >&5
811   if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
812   echo $ac_n "(cached) $ac_c" 1>&6
813 else
814   
815
816   # First check to see if --with-tkconfig was specified.
817   if test x"${with_tkconfig}" != x ; then
818     if test -f "${with_tkconfig}/tkConfig.sh" ; then
819       ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
820     else
821       { echo "configure: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" 1>&2; exit 1; }
822     fi
823   fi
824
825   # then check for a private Tk library
826
827   if test x"${ac_cv_c_tkconfig}" = x ; then
828     for i in \
829                 ../tk \
830                 `ls -dr ../tk[4-9].[0-9] 2>/dev/null` \
831                 ../../tk \
832                 `ls -dr ../../tk[4-9].[0-9] 2>/dev/null` \
833                 ../../../tk \
834                 `ls -dr ../../../tk[4-9].[0-9] 2>/dev/null` ; do
835       if test -f "$i/unix/tkConfig.sh" ; then
836         ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
837         break
838       fi
839       if test -f "$i/win/tkConfig.sh" ; then
840         ac_cv_c_tkconfig=`(cd $i/win; pwd)`
841         break
842       fi
843     done
844   fi
845
846   # check in a few common install locations
847   if test x"${ac_cv_c_tkconfig}" = x ; then
848     for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
849       if test -f "$i/tkConfig.sh" ; then
850         ac_cv_c_tkconfig=`(cd $i; pwd)`
851         break
852       fi
853     done
854   fi
855   # check in a few other private locations
856
857   if test x"${ac_cv_c_tkconfig}" = x ; then
858     for i in \
859                 ${srcdir}/../tk \
860                 `ls -dr ${srcdir}/../tk[4-9].[0-9] 2>/dev/null` ; do
861       if test -f "$i/unix/tkConfig.sh" ; then
862         ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
863         break
864       fi
865     done
866   fi
867
868   
869 fi
870
871   if test x"${ac_cv_c_tkconfig}" = x ; then
872     TKCONFIG="# no Tk configs found"
873     echo "configure: warning: Can't find Tk configuration definitions" 1>&2
874   else
875     no_tk=
876     TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
877     echo "$ac_t""found $TKCONFIG" 1>&6
878   fi
879 fi
880
881
882
883     if test -f "$TKCONFIG" ; then
884       . $TKCONFIG
885     fi
886
887     
888     
889
890     
891
892
893     
894     
895     
896     
897
898 EXP_AND_TK_LIBS=$TK_LIBS
899
900 # CYGNUS LOCAL dj/cygwin
901
902 # Make sure we can run config.sub.
903 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
904 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
905 fi
906
907 echo $ac_n "checking host system type""... $ac_c" 1>&6
908 echo "configure:909: checking host system type" >&5
909
910 host_alias=$host
911 case "$host_alias" in
912 NONE)
913   case $nonopt in
914   NONE)
915     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
916     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
917     fi ;;
918   *) host_alias=$nonopt ;;
919   esac ;;
920 esac
921
922 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
923 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
924 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
925 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
926 echo "$ac_t""$host" 1>&6
927
928 EXP_CFLAGS=""
929 # If we built a cygwin-specific tcl, use it here.
930 case "${host}" in
931 *-*-cygwin*)
932   if test -d $srcdir/../tcl/cygwin/.
933   then
934     TCL_BUILD_LIB_SPEC="../tcl/cygwin/libtcl_cygwin.a"
935     # Use the same static lib for installed_expect
936     TCL_LIB_SPEC="../tcl/cygwin/libtcl_cygwin.a"
937     EXP_CYGWIN_ALTTCL='-DCYGWIN_ALTTCL'
938   fi
939   touch ac$$.c
940   if ${CC} -c -mno-win32 ac$$.c >/dev/null 2>&1; then
941       case "$EXP_CFLAGS" in
942           *-mno-win32*) ;;
943           *) EXP_CFLAGS="-mno-win32 $EXP_CFLAGS" ;;
944       esac
945   fi
946   rm -f ac$$.o ac$$.c
947   ;;
948 esac
949
950 # An explanation is in order for the strange things going on with the
951 # various LIBS.  There are three separate definitions for LIBS.  The
952 # reason is that some systems require shared libraries include
953 # references to their dependent libraries, i.e., any additional
954 # libraries that must be linked to.  And some systems get upset if the
955 # references are repeated on the link line.  So therefore, we create
956 # one for Expect and Tk (EXP_AND_TK_LIBS), one for Expect and Tcl
957 # (EXP_AND_TCL_LIBS), and finally, one for building Expect's own
958 # shared library.  Tcl's tclConfig.sh insists that any shared libs
959 # that it "helps" build must pass the libraries as LIBS (see comment
960 # near end of this configure file).  I would do but since we're close
961 # to hitting config's max symbols, we take one short cut and pack the
962 # LIBS into EXP_SHLIB_LD_LIBS (which is basically what Tcl wants to do
963 # for us).  The point, however, is that there's no separate LIBS or
964 # EXP_LIBS symbol passed out of configure.  One additional point for
965 # confusion is that LIBS is what configure uses to do all library
966 # tests, so we have to swap definitions of LIBS peridically.  When we
967 # are swapping out the one for Expect's shared library, we save it in
968 # EXP_LIBS.  Sigh.
969
970 OLD_CFLAGS=$CFLAGS
971 # Extract the first word of "gcc", so it can be a program name with args.
972 set dummy gcc; ac_word=$2
973 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
974 echo "configure:975: checking for $ac_word" >&5
975 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
976   echo $ac_n "(cached) $ac_c" 1>&6
977 else
978   if test -n "$CC"; then
979   ac_cv_prog_CC="$CC" # Let the user override the test.
980 else
981   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
982   ac_dummy="$PATH"
983   for ac_dir in $ac_dummy; do
984     test -z "$ac_dir" && ac_dir=.
985     if test -f $ac_dir/$ac_word; then
986       ac_cv_prog_CC="gcc"
987       break
988     fi
989   done
990   IFS="$ac_save_ifs"
991 fi
992 fi
993 CC="$ac_cv_prog_CC"
994 if test -n "$CC"; then
995   echo "$ac_t""$CC" 1>&6
996 else
997   echo "$ac_t""no" 1>&6
998 fi
999
1000 if test -z "$CC"; then
1001   # Extract the first word of "cc", so it can be a program name with args.
1002 set dummy cc; ac_word=$2
1003 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1004 echo "configure:1005: checking for $ac_word" >&5
1005 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1006   echo $ac_n "(cached) $ac_c" 1>&6
1007 else
1008   if test -n "$CC"; then
1009   ac_cv_prog_CC="$CC" # Let the user override the test.
1010 else
1011   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1012   ac_prog_rejected=no
1013   ac_dummy="$PATH"
1014   for ac_dir in $ac_dummy; do
1015     test -z "$ac_dir" && ac_dir=.
1016     if test -f $ac_dir/$ac_word; then
1017       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1018         ac_prog_rejected=yes
1019         continue
1020       fi
1021       ac_cv_prog_CC="cc"
1022       break
1023     fi
1024   done
1025   IFS="$ac_save_ifs"
1026 if test $ac_prog_rejected = yes; then
1027   # We found a bogon in the path, so make sure we never use it.
1028   set dummy $ac_cv_prog_CC
1029   shift
1030   if test $# -gt 0; then
1031     # We chose a different compiler from the bogus one.
1032     # However, it has the same basename, so the bogon will be chosen
1033     # first if we set CC to just the basename; use the full file name.
1034     shift
1035     set dummy "$ac_dir/$ac_word" "$@"
1036     shift
1037     ac_cv_prog_CC="$@"
1038   fi
1039 fi
1040 fi
1041 fi
1042 CC="$ac_cv_prog_CC"
1043 if test -n "$CC"; then
1044   echo "$ac_t""$CC" 1>&6
1045 else
1046   echo "$ac_t""no" 1>&6
1047 fi
1048
1049   if test -z "$CC"; then
1050     case "`uname -s`" in
1051     *win32* | *WIN32*)
1052       # Extract the first word of "cl", so it can be a program name with args.
1053 set dummy cl; ac_word=$2
1054 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1055 echo "configure:1056: checking for $ac_word" >&5
1056 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1057   echo $ac_n "(cached) $ac_c" 1>&6
1058 else
1059   if test -n "$CC"; then
1060   ac_cv_prog_CC="$CC" # Let the user override the test.
1061 else
1062   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1063   ac_dummy="$PATH"
1064   for ac_dir in $ac_dummy; do
1065     test -z "$ac_dir" && ac_dir=.
1066     if test -f $ac_dir/$ac_word; then
1067       ac_cv_prog_CC="cl"
1068       break
1069     fi
1070   done
1071   IFS="$ac_save_ifs"
1072 fi
1073 fi
1074 CC="$ac_cv_prog_CC"
1075 if test -n "$CC"; then
1076   echo "$ac_t""$CC" 1>&6
1077 else
1078   echo "$ac_t""no" 1>&6
1079 fi
1080  ;;
1081     esac
1082   fi
1083   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1084 fi
1085
1086 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1087 echo "configure:1088: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1088
1089 ac_ext=c
1090 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1091 ac_cpp='$CPP $CPPFLAGS'
1092 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1093 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1094 cross_compiling=$ac_cv_prog_cc_cross
1095
1096 cat > conftest.$ac_ext << EOF
1097
1098 #line 1099 "configure"
1099 #include "confdefs.h"
1100
1101 main(){return(0);}
1102 EOF
1103 if { (eval echo configure:1104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1104   ac_cv_prog_cc_works=yes
1105   # If we can't run a trivial program, we are probably using a cross compiler.
1106   if (./conftest; exit) 2>/dev/null; then
1107     ac_cv_prog_cc_cross=no
1108   else
1109     ac_cv_prog_cc_cross=yes
1110   fi
1111 else
1112   echo "configure: failed program was:" >&5
1113   cat conftest.$ac_ext >&5
1114   ac_cv_prog_cc_works=no
1115 fi
1116 rm -fr conftest*
1117 ac_ext=c
1118 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1119 ac_cpp='$CPP $CPPFLAGS'
1120 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1121 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1122 cross_compiling=$ac_cv_prog_cc_cross
1123
1124 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1125 if test $ac_cv_prog_cc_works = no; then
1126   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1127 fi
1128 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1129 echo "configure:1130: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1130 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1131 cross_compiling=$ac_cv_prog_cc_cross
1132
1133 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1134 echo "configure:1135: checking whether we are using GNU C" >&5
1135 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1136   echo $ac_n "(cached) $ac_c" 1>&6
1137 else
1138   cat > conftest.c <<EOF
1139 #ifdef __GNUC__
1140   yes;
1141 #endif
1142 EOF
1143 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1144   ac_cv_prog_gcc=yes
1145 else
1146   ac_cv_prog_gcc=no
1147 fi
1148 fi
1149
1150 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1151
1152 if test $ac_cv_prog_gcc = yes; then
1153   GCC=yes
1154 else
1155   GCC=
1156 fi
1157
1158 ac_test_CFLAGS="${CFLAGS+set}"
1159 ac_save_CFLAGS="$CFLAGS"
1160 CFLAGS=
1161 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1162 echo "configure:1163: checking whether ${CC-cc} accepts -g" >&5
1163 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1164   echo $ac_n "(cached) $ac_c" 1>&6
1165 else
1166   echo 'void f(){}' > conftest.c
1167 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1168   ac_cv_prog_cc_g=yes
1169 else
1170   ac_cv_prog_cc_g=no
1171 fi
1172 rm -f conftest*
1173
1174 fi
1175
1176 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1177 if test "$ac_test_CFLAGS" = set; then
1178   CFLAGS="$ac_save_CFLAGS"
1179 elif test $ac_cv_prog_cc_g = yes; then
1180   if test "$GCC" = yes; then
1181     CFLAGS="-g -O2"
1182   else
1183     CFLAGS="-g"
1184   fi
1185 else
1186   if test "$GCC" = yes; then
1187     CFLAGS="-O2"
1188   else
1189     CFLAGS=
1190   fi
1191 fi
1192
1193 CFLAGS=$OLD_CFLAGS
1194
1195 # If we cannot compile and link a trivial program, we can't expect anything to work
1196 echo $ac_n "checking whether the compiler ($CC) actually works""... $ac_c" 1>&6
1197 echo "configure:1198: checking whether the compiler ($CC) actually works" >&5
1198 cat > conftest.$ac_ext <<EOF
1199 #line 1200 "configure"
1200 #include "confdefs.h"
1201
1202 int main() {
1203 /* don't need anything here */
1204 ; return 0; }
1205 EOF
1206 if { (eval echo configure:1207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1207   rm -rf conftest*
1208   c_compiles=yes
1209 else
1210   echo "configure: failed program was:" >&5
1211   cat conftest.$ac_ext >&5
1212   rm -rf conftest*
1213   c_compiles=no
1214 fi
1215 rm -f conftest*
1216
1217 cat > conftest.$ac_ext <<EOF
1218 #line 1219 "configure"
1219 #include "confdefs.h"
1220
1221 int main() {
1222 /* don't need anything here */
1223 ; return 0; }
1224 EOF
1225 if { (eval echo configure:1226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1226   rm -rf conftest*
1227   c_links=yes
1228 else
1229   echo "configure: failed program was:" >&5
1230   cat conftest.$ac_ext >&5
1231   rm -rf conftest*
1232   c_links=no
1233 fi
1234 rm -f conftest*
1235
1236 if test x"${c_compiles}" = x"no" ; then
1237   { echo "configure: error: the native compiler is broken and won't compile." 1>&2; exit 1; }
1238 fi
1239
1240 if test x"${c_links}" = x"no" ; then
1241   { echo "configure: error: the native compiler is broken and won't link." 1>&2; exit 1; }
1242 fi
1243 echo "$ac_t""yes" 1>&6
1244
1245
1246 # this'll use a BSD compatible install or our included install-sh
1247 # Find a good install program.  We prefer a C program (faster),
1248 # so one script is as good as another.  But avoid the broken or
1249 # incompatible versions:
1250 # SysV /etc/install, /usr/sbin/install
1251 # SunOS /usr/etc/install
1252 # IRIX /sbin/install
1253 # AIX /bin/install
1254 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1255 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1256 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1257 # ./install, which can be erroneously created by make from ./install.sh.
1258 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1259 echo "configure:1260: checking for a BSD compatible install" >&5
1260 if test -z "$INSTALL"; then
1261 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1262   echo $ac_n "(cached) $ac_c" 1>&6
1263 else
1264     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1265   for ac_dir in $PATH; do
1266     # Account for people who put trailing slashes in PATH elements.
1267     case "$ac_dir/" in
1268     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1269     *)
1270       # OSF1 and SCO ODT 3.0 have their own names for install.
1271       # Don't use installbsd from OSF since it installs stuff as root
1272       # by default.
1273       for ac_prog in ginstall scoinst install; do
1274         if test -f $ac_dir/$ac_prog; then
1275           if test $ac_prog = install &&
1276             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1277             # AIX install.  It has an incompatible calling convention.
1278             :
1279           else
1280             ac_cv_path_install="$ac_dir/$ac_prog -c"
1281             break 2
1282           fi
1283         fi
1284       done
1285       ;;
1286     esac
1287   done
1288   IFS="$ac_save_IFS"
1289
1290 fi
1291   if test "${ac_cv_path_install+set}" = set; then
1292     INSTALL="$ac_cv_path_install"
1293   else
1294     # As a last resort, use the slow shell script.  We don't cache a
1295     # path for INSTALL within a source directory, because that will
1296     # break other packages using the cache if that directory is
1297     # removed, or if the path is relative.
1298     INSTALL="$ac_install_sh"
1299   fi
1300 fi
1301 echo "$ac_t""$INSTALL" 1>&6
1302
1303 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1304 # It thinks the first close brace ends the variable substitution.
1305 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1306
1307 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1308
1309 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1310
1311
1312 # Tcl sets TCL_RANLIB appropriately for shared library if --enable-shared
1313 # Extract the first word of "ranlib", so it can be a program name with args.
1314 set dummy ranlib; ac_word=$2
1315 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1316 echo "configure:1317: checking for $ac_word" >&5
1317 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1318   echo $ac_n "(cached) $ac_c" 1>&6
1319 else
1320   if test -n "$RANLIB"; then
1321   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1322 else
1323   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1324   ac_dummy="$PATH"
1325   for ac_dir in $ac_dummy; do
1326     test -z "$ac_dir" && ac_dir=.
1327     if test -f $ac_dir/$ac_word; then
1328       ac_cv_prog_RANLIB="ranlib"
1329       break
1330     fi
1331   done
1332   IFS="$ac_save_ifs"
1333   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1334 fi
1335 fi
1336 RANLIB="$ac_cv_prog_RANLIB"
1337 if test -n "$RANLIB"; then
1338   echo "$ac_t""$RANLIB" 1>&6
1339 else
1340   echo "$ac_t""no" 1>&6
1341 fi
1342
1343 UNSHARED_RANLIB=$RANLIB
1344
1345 # these are the other subdirectories we need to configure
1346 subdirs="testsuite"
1347
1348
1349 # This is for LynxOS, which needs a flag to force true POSIX when
1350 # building.  The flag varies depending how old the compiler is.
1351 # -X is for the old "cc" and "gcc" (based on 1.42)
1352 # -mposix is for the new gcc (at least 2.5.8)
1353 # This modifies the value of $CC to have the POSIX flag added
1354 # so it'll configure correctly
1355 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1356 echo "configure:1357: checking how to run the C preprocessor" >&5
1357 # On Suns, sometimes $CPP names a directory.
1358 if test -n "$CPP" && test -d "$CPP"; then
1359   CPP=
1360 fi
1361 if test -z "$CPP"; then
1362 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1363   echo $ac_n "(cached) $ac_c" 1>&6
1364 else
1365     # This must be in double quotes, not single quotes, because CPP may get
1366   # substituted into the Makefile and "${CC-cc}" will confuse make.
1367   CPP="${CC-cc} -E"
1368   # On the NeXT, cc -E runs the code through the compiler's parser,
1369   # not just through cpp.
1370   cat > conftest.$ac_ext <<EOF
1371 #line 1372 "configure"
1372 #include "confdefs.h"
1373 #include <assert.h>
1374 Syntax Error
1375 EOF
1376 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1377 { (eval echo configure:1378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1378 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1379 if test -z "$ac_err"; then
1380   :
1381 else
1382   echo "$ac_err" >&5
1383   echo "configure: failed program was:" >&5
1384   cat conftest.$ac_ext >&5
1385   rm -rf conftest*
1386   CPP="${CC-cc} -E -traditional-cpp"
1387   cat > conftest.$ac_ext <<EOF
1388 #line 1389 "configure"
1389 #include "confdefs.h"
1390 #include <assert.h>
1391 Syntax Error
1392 EOF
1393 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1394 { (eval echo configure:1395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1395 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1396 if test -z "$ac_err"; then
1397   :
1398 else
1399   echo "$ac_err" >&5
1400   echo "configure: failed program was:" >&5
1401   cat conftest.$ac_ext >&5
1402   rm -rf conftest*
1403   CPP="${CC-cc} -nologo -E"
1404   cat > conftest.$ac_ext <<EOF
1405 #line 1406 "configure"
1406 #include "confdefs.h"
1407 #include <assert.h>
1408 Syntax Error
1409 EOF
1410 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1411 { (eval echo configure:1412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1412 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1413 if test -z "$ac_err"; then
1414   :
1415 else
1416   echo "$ac_err" >&5
1417   echo "configure: failed program was:" >&5
1418   cat conftest.$ac_ext >&5
1419   rm -rf conftest*
1420   CPP=/lib/cpp
1421 fi
1422 rm -f conftest*
1423 fi
1424 rm -f conftest*
1425 fi
1426 rm -f conftest*
1427   ac_cv_prog_CPP="$CPP"
1428 fi
1429   CPP="$ac_cv_prog_CPP"
1430 else
1431   ac_cv_prog_CPP="$CPP"
1432 fi
1433 echo "$ac_t""$CPP" 1>&6
1434
1435
1436 echo $ac_n "checking if running LynxOS""... $ac_c" 1>&6
1437 echo "configure:1438: checking if running LynxOS" >&5
1438 if eval "test \"`echo '$''{'ac_cv_os_lynx'+set}'`\" = set"; then
1439   echo $ac_n "(cached) $ac_c" 1>&6
1440 else
1441   cat > conftest.$ac_ext <<EOF
1442 #line 1443 "configure"
1443 #include "confdefs.h"
1444 /*
1445  * The old Lynx "cc" only defines "Lynx", but the newer one uses "__Lynx__"
1446  */
1447 #if defined(__Lynx__) || defined(Lynx)
1448 yes
1449 #endif
1450
1451 EOF
1452 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1453   egrep "yes" >/dev/null 2>&1; then
1454   rm -rf conftest*
1455   ac_cv_os_lynx=yes
1456 else
1457   rm -rf conftest*
1458   ac_cv_os_lynx=no
1459 fi
1460 rm -f conftest*
1461
1462 fi
1463
1464 #
1465 if test "$ac_cv_os_lynx" = "yes" ; then
1466   echo "$ac_t""yes" 1>&6
1467   cat >> confdefs.h <<\EOF
1468 #define LYNX 1
1469 EOF
1470
1471   echo $ac_n "checking whether -mposix or -X is available""... $ac_c" 1>&6
1472 echo "configure:1473: checking whether -mposix or -X is available" >&5
1473   if eval "test \"`echo '$''{'ac_cv_c_posix_flag'+set}'`\" = set"; then
1474   echo $ac_n "(cached) $ac_c" 1>&6
1475 else
1476   cat > conftest.$ac_ext <<EOF
1477 #line 1478 "configure"
1478 #include "confdefs.h"
1479
1480 int main() {
1481
1482   /*
1483    * This flag varies depending on how old the compiler is.
1484    * -X is for the old "cc" and "gcc" (based on 1.42).
1485    * -mposix is for the new gcc (at least 2.5.8).
1486    */
1487   #if defined(__GNUC__) && __GNUC__ >= 2
1488   choke me
1489   #endif
1490   
1491 ; return 0; }
1492 EOF
1493 if { (eval echo configure:1494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1494   rm -rf conftest*
1495   ac_cv_c_posix_flag=" -mposix"
1496 else
1497   echo "configure: failed program was:" >&5
1498   cat conftest.$ac_ext >&5
1499   rm -rf conftest*
1500   ac_cv_c_posix_flag=" -X"
1501 fi
1502 rm -f conftest*
1503 fi
1504
1505   CC="$CC $ac_cv_c_posix_flag"
1506   echo "$ac_t""$ac_cv_c_posix_flag" 1>&6
1507   else
1508   echo "$ac_t""no" 1>&6
1509 fi
1510
1511
1512 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1513 echo "configure:1514: checking for ANSI C header files" >&5
1514 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1515   echo $ac_n "(cached) $ac_c" 1>&6
1516 else
1517   cat > conftest.$ac_ext <<EOF
1518 #line 1519 "configure"
1519 #include "confdefs.h"
1520 #include <stdlib.h>
1521 #include <stdarg.h>
1522 #include <string.h>
1523 #include <float.h>
1524 EOF
1525 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1526 { (eval echo configure:1527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1527 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1528 if test -z "$ac_err"; then
1529   rm -rf conftest*
1530   ac_cv_header_stdc=yes
1531 else
1532   echo "$ac_err" >&5
1533   echo "configure: failed program was:" >&5
1534   cat conftest.$ac_ext >&5
1535   rm -rf conftest*
1536   ac_cv_header_stdc=no
1537 fi
1538 rm -f conftest*
1539
1540 if test $ac_cv_header_stdc = yes; then
1541   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1542 cat > conftest.$ac_ext <<EOF
1543 #line 1544 "configure"
1544 #include "confdefs.h"
1545 #include <string.h>
1546 EOF
1547 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1548   egrep "memchr" >/dev/null 2>&1; then
1549   :
1550 else
1551   rm -rf conftest*
1552   ac_cv_header_stdc=no
1553 fi
1554 rm -f conftest*
1555
1556 fi
1557
1558 if test $ac_cv_header_stdc = yes; then
1559   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1560 cat > conftest.$ac_ext <<EOF
1561 #line 1562 "configure"
1562 #include "confdefs.h"
1563 #include <stdlib.h>
1564 EOF
1565 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1566   egrep "free" >/dev/null 2>&1; then
1567   :
1568 else
1569   rm -rf conftest*
1570   ac_cv_header_stdc=no
1571 fi
1572 rm -f conftest*
1573
1574 fi
1575
1576 if test $ac_cv_header_stdc = yes; then
1577   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1578 if test "$cross_compiling" = yes; then
1579   :
1580 else
1581   cat > conftest.$ac_ext <<EOF
1582 #line 1583 "configure"
1583 #include "confdefs.h"
1584 #include <ctype.h>
1585 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1586 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1587 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1588 int main () { int i; for (i = 0; i < 256; i++)
1589 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1590 exit (0); }
1591
1592 EOF
1593 if { (eval echo configure:1594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1594 then
1595   :
1596 else
1597   echo "configure: failed program was:" >&5
1598   cat conftest.$ac_ext >&5
1599   rm -fr conftest*
1600   ac_cv_header_stdc=no
1601 fi
1602 rm -fr conftest*
1603 fi
1604
1605 fi
1606 fi
1607
1608 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1609 if test $ac_cv_header_stdc = yes; then
1610   cat >> confdefs.h <<\EOF
1611 #define STDC_HEADERS 1
1612 EOF
1613
1614 fi
1615
1616 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
1617 echo "configure:1618: checking for pid_t" >&5
1618 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1619   echo $ac_n "(cached) $ac_c" 1>&6
1620 else
1621   cat > conftest.$ac_ext <<EOF
1622 #line 1623 "configure"
1623 #include "confdefs.h"
1624 #include <sys/types.h>
1625 #if STDC_HEADERS
1626 #include <stdlib.h>
1627 #include <stddef.h>
1628 #endif
1629 EOF
1630 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1631   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1632   rm -rf conftest*
1633   ac_cv_type_pid_t=yes
1634 else
1635   rm -rf conftest*
1636   ac_cv_type_pid_t=no
1637 fi
1638 rm -f conftest*
1639
1640 fi
1641 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
1642 if test $ac_cv_type_pid_t = no; then
1643   cat >> confdefs.h <<\EOF
1644 #define pid_t int
1645 EOF
1646
1647 fi
1648
1649 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
1650 echo "configure:1651: checking return type of signal handlers" >&5
1651 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
1652   echo $ac_n "(cached) $ac_c" 1>&6
1653 else
1654   cat > conftest.$ac_ext <<EOF
1655 #line 1656 "configure"
1656 #include "confdefs.h"
1657 #include <sys/types.h>
1658 #include <signal.h>
1659 #ifdef signal
1660 #undef signal
1661 #endif
1662 #ifdef __cplusplus
1663 extern "C" void (*signal (int, void (*)(int)))(int);
1664 #else
1665 void (*signal ()) ();
1666 #endif
1667
1668 int main() {
1669 int i;
1670 ; return 0; }
1671 EOF
1672 if { (eval echo configure:1673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1673   rm -rf conftest*
1674   ac_cv_type_signal=void
1675 else
1676   echo "configure: failed program was:" >&5
1677   cat conftest.$ac_ext >&5
1678   rm -rf conftest*
1679   ac_cv_type_signal=int
1680 fi
1681 rm -f conftest*
1682 fi
1683
1684 echo "$ac_t""$ac_cv_type_signal" 1>&6
1685 cat >> confdefs.h <<EOF
1686 #define RETSIGTYPE $ac_cv_type_signal
1687 EOF
1688
1689
1690 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1691 echo "configure:1692: checking whether time.h and sys/time.h may both be included" >&5
1692 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1693   echo $ac_n "(cached) $ac_c" 1>&6
1694 else
1695   cat > conftest.$ac_ext <<EOF
1696 #line 1697 "configure"
1697 #include "confdefs.h"
1698 #include <sys/types.h>
1699 #include <sys/time.h>
1700 #include <time.h>
1701 int main() {
1702 struct tm *tp;
1703 ; return 0; }
1704 EOF
1705 if { (eval echo configure:1706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1706   rm -rf conftest*
1707   ac_cv_header_time=yes
1708 else
1709   echo "configure: failed program was:" >&5
1710   cat conftest.$ac_ext >&5
1711   rm -rf conftest*
1712   ac_cv_header_time=no
1713 fi
1714 rm -f conftest*
1715 fi
1716
1717 echo "$ac_t""$ac_cv_header_time" 1>&6
1718 if test $ac_cv_header_time = yes; then
1719   cat >> confdefs.h <<\EOF
1720 #define TIME_WITH_SYS_TIME 1
1721 EOF
1722
1723 fi
1724
1725 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1726 echo "configure:1727: checking for sys/wait.h that is POSIX.1 compatible" >&5
1727 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1728   echo $ac_n "(cached) $ac_c" 1>&6
1729 else
1730   cat > conftest.$ac_ext <<EOF
1731 #line 1732 "configure"
1732 #include "confdefs.h"
1733 #include <sys/types.h>
1734 #include <sys/wait.h>
1735 #ifndef WEXITSTATUS
1736 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1737 #endif
1738 #ifndef WIFEXITED
1739 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1740 #endif
1741 int main() {
1742 int s;
1743 wait (&s);
1744 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1745 ; return 0; }
1746 EOF
1747 if { (eval echo configure:1748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1748   rm -rf conftest*
1749   ac_cv_header_sys_wait_h=yes
1750 else
1751   echo "configure: failed program was:" >&5
1752   cat conftest.$ac_ext >&5
1753   rm -rf conftest*
1754   ac_cv_header_sys_wait_h=no
1755 fi
1756 rm -f conftest*
1757 fi
1758
1759 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1760 if test $ac_cv_header_sys_wait_h = yes; then
1761   cat >> confdefs.h <<\EOF
1762 #define HAVE_SYS_WAIT_H 1
1763 EOF
1764
1765 fi
1766
1767
1768 # Use -g on all systems but Linux where it upsets the dynamic X libraries.
1769 EXP_CFLAGS="$EXP_CFLAGS $EXP_CYGWIN_ALTTCL"
1770
1771 echo $ac_n "checking if running Mach""... $ac_c" 1>&6
1772 echo "configure:1773: checking if running Mach" >&5
1773 mach=0
1774 case "${host}" in
1775   # Both Next and pure Mach behave identically with respect
1776   # to a few things, so just lump them together as "mach"
1777   *-*-mach*)            mach=1 ;;
1778   *-*-next*)            mach=1 ; next=1 ;;
1779 esac
1780
1781 if test $mach -eq 1 ; then
1782   echo "$ac_t""yes" 1>&6
1783 else
1784   echo "$ac_t""no" 1>&6
1785 fi
1786
1787 echo $ac_n "checking if running MachTen""... $ac_c" 1>&6
1788 echo "configure:1789: checking if running MachTen" >&5
1789 # yet another Mach clone
1790 if test -r /MachTen -a "$cross_compiling" != "yes" ; then
1791   echo "$ac_t""yes" 1>&6
1792   mach=1
1793 else
1794   echo "$ac_t""no" 1>&6
1795 fi
1796
1797 echo $ac_n "checking if on Pyramid""... $ac_c" 1>&6
1798 echo "configure:1799: checking if on Pyramid" >&5
1799 if test -r /bin/pyr -a "$cross_compiling" != "yes" ; then
1800   echo "$ac_t""yes" 1>&6
1801   pyr=1
1802 else
1803   echo "$ac_t""no" 1>&6
1804   pyr=0
1805 fi
1806
1807 echo $ac_n "checking if on Apollo""... $ac_c" 1>&6
1808 echo "configure:1809: checking if on Apollo" >&5
1809 if test -r /usr/apollo/bin -a "$cross_compiling" != "yes" ; then
1810   echo "$ac_t""yes" 1>&6
1811   apollo=1
1812 else
1813   echo "$ac_t""no" 1>&6
1814   apollo=0
1815 fi
1816
1817 echo $ac_n "checking if on Interactive""... $ac_c" 1>&6
1818 echo "configure:1819: checking if on Interactive" >&5
1819 if test "x`(uname -s) 2>/dev/null`" = xIUNIX; then
1820   echo "$ac_t""yes" 1>&6
1821   iunix=1
1822 else
1823   echo "$ac_t""no" 1>&6
1824   iunix=0
1825 fi
1826
1827 echo $ac_n "checking if stty reads stdout""... $ac_c" 1>&6
1828 echo "configure:1829: checking if stty reads stdout" >&5
1829
1830 # On some systems stty can't be run in the background (svr4) or get it
1831 # wrong because they fail to complain (next, mach), so don't attempt
1832 # the test on some systems.
1833
1834 stty_reads_stdout=""
1835 case "${host}" in
1836   *-*-solaris*)         stty_reads_stdout=0 ;;
1837   *-*-irix*)            stty_reads_stdout=0 ;;
1838   *-*-sco3.2v[45]*)     stty_reads_stdout=1 ;;
1839   i[3456]86-*-sysv4.2MP)        stty_reads_stdout=0 ;;
1840   i[3456]86-*-linux*)   stty_reads_stdout=0 ;;
1841   # Not sure about old convex but 5.2 definitely reads from stdout
1842   c[12]-*-*)            stty_reads_stdout=1 ;;
1843   *-*-aix[34]*) stty_reads_stdout=0 ;;
1844   *-*-hpux9*)           stty_reads_stdout=0 ;;
1845   *-*-hpux10*)          stty_reads_stdout=0 ;;
1846   *-*-hpux11*)          stty_reads_stdout=0 ;;
1847   *-*-osf[234]*)        stty_reads_stdout=0 ;;
1848   *-*-ultrix4.4)        stty_reads_stdout=0 ;;
1849   *-*-dgux*)            stty_reads_stdout=0 ;;
1850   *-*-cygwin*)          stty_reads_stdout=0 ;;
1851 esac
1852
1853 if test $mach -eq 1 ; then
1854   stty_reads_stdout=1
1855 fi
1856 if test $apollo -eq 1 ; then
1857   stty_reads_stdout=1
1858 fi
1859 if test $pyr -eq 1 ; then
1860   stty_reads_stdout=1
1861 fi
1862
1863 # if we still don't know, test
1864 if test x"${stty_reads_stdout}" = x"" ; then
1865   /bin/stty > /dev/null 2> /dev/null
1866   if test $? -ne 0 ; then
1867     stty_reads_stdout=1
1868   else
1869     stty_reads_stdout=0
1870   fi
1871 fi
1872
1873 if test ${stty_reads_stdout} -eq 1 ; then
1874   echo "$ac_t""yes" 1>&6
1875   cat >> confdefs.h <<\EOF
1876 #define STTY_READS_STDOUT 1
1877 EOF
1878
1879 else
1880   echo "$ac_t""no" 1>&6
1881 fi
1882
1883 # Solaris 2.4 and later requires __EXTENSIONS__ in order to see all sorts
1884 # of traditional but nonstandard stuff in header files.
1885 echo $ac_n "checking if running Solaris""... $ac_c" 1>&6
1886 echo "configure:1887: checking if running Solaris" >&5
1887 solaris=0
1888 case "${host}" in
1889   *-*-solaris*)         solaris=1;;
1890 esac
1891
1892 if test $solaris -eq 1 ; then
1893   echo "$ac_t""yes" 1>&6
1894   cat >> confdefs.h <<\EOF
1895 #define SOLARIS 1
1896 EOF
1897
1898 else
1899   echo "$ac_t""no" 1>&6
1900 fi
1901
1902
1903 # On a few systems, libm.a is the same as libc.a
1904 # Don't bother to test against Tcl and Tk libs, they always include -lm
1905 echo $ac_n "checking for sin""... $ac_c" 1>&6
1906 echo "configure:1907: checking for sin" >&5
1907 if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then
1908   echo $ac_n "(cached) $ac_c" 1>&6
1909 else
1910   cat > conftest.$ac_ext <<EOF
1911 #line 1912 "configure"
1912 #include "confdefs.h"
1913 /* System header to define __stub macros and hopefully few prototypes,
1914     which can conflict with char sin(); below.  */
1915 #include <assert.h>
1916 /* Override any gcc2 internal prototype to avoid an error.  */
1917 /* We use char because int might match the return type of a gcc2
1918     builtin and then its argument prototype would still apply.  */
1919 char sin();
1920
1921 int main() {
1922
1923 /* The GNU C library defines this for functions which it implements
1924     to always fail with ENOSYS.  Some functions are actually named
1925     something starting with __ and the normal name is an alias.  */
1926 #if defined (__stub_sin) || defined (__stub___sin)
1927 choke me
1928 #else
1929 sin();
1930 #endif
1931
1932 ; return 0; }
1933 EOF
1934 if { (eval echo configure:1935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1935   rm -rf conftest*
1936   eval "ac_cv_func_sin=yes"
1937 else
1938   echo "configure: failed program was:" >&5
1939   cat conftest.$ac_ext >&5
1940   rm -rf conftest*
1941   eval "ac_cv_func_sin=no"
1942 fi
1943 rm -f conftest*
1944 fi
1945
1946 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
1947   echo "$ac_t""yes" 1>&6
1948   :
1949 else
1950   echo "$ac_t""no" 1>&6
1951 LIBS="${LIBS} -lm" 
1952 fi
1953
1954
1955 # On Interactive UNIX, -Xp must be added to LIBS in order to find strftime.
1956 # This test should really be done by Tcl.  So just check Tcl's definition.
1957 # If defective, add to all three LIBS.  (It's not actually necessary for
1958 # EXP_LIBS since -Xp will just be ignored the way that EXP_LIBS is used in
1959 # the Makefile, but we include it for consistency.)
1960 if test $iunix -eq 1 ; then
1961   EXP_LIBS=$LIBS
1962   LIBS=$EXP_AND_TCL_LIBS
1963   echo $ac_n "checking for strftime""... $ac_c" 1>&6
1964 echo "configure:1965: checking for strftime" >&5
1965 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
1966   echo $ac_n "(cached) $ac_c" 1>&6
1967 else
1968   cat > conftest.$ac_ext <<EOF
1969 #line 1970 "configure"
1970 #include "confdefs.h"
1971 /* System header to define __stub macros and hopefully few prototypes,
1972     which can conflict with char strftime(); below.  */
1973 #include <assert.h>
1974 /* Override any gcc2 internal prototype to avoid an error.  */
1975 /* We use char because int might match the return type of a gcc2
1976     builtin and then its argument prototype would still apply.  */
1977 char strftime();
1978
1979 int main() {
1980
1981 /* The GNU C library defines this for functions which it implements
1982     to always fail with ENOSYS.  Some functions are actually named
1983     something starting with __ and the normal name is an alias.  */
1984 #if defined (__stub_strftime) || defined (__stub___strftime)
1985 choke me
1986 #else
1987 strftime();
1988 #endif
1989
1990 ; return 0; }
1991 EOF
1992 if { (eval echo configure:1993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1993   rm -rf conftest*
1994   eval "ac_cv_func_strftime=yes"
1995 else
1996   echo "configure: failed program was:" >&5
1997   cat conftest.$ac_ext >&5
1998   rm -rf conftest*
1999   eval "ac_cv_func_strftime=no"
2000 fi
2001 rm -f conftest*
2002 fi
2003
2004 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
2005   echo "$ac_t""yes" 1>&6
2006   :
2007 else
2008   echo "$ac_t""no" 1>&6
2009
2010         EXP_LIBS="${LIBS} -Xp" 
2011         EXP_AND_TCL_LIBS="${LIBS} -Xp" 
2012         EXP_AND_TK_LIBS="${LIBS} -Xp" 
2013         
2014 fi
2015
2016   LIBS=EXP_LIBS
2017 fi
2018
2019 #
2020 # Ok, lets find the tcl source trees so we can use the headers
2021 #
2022
2023 #
2024 # Ok, lets find the tcl source trees so we can use the headers
2025 # Warning: transition of version 9 to 10 will break this algorithm
2026 # because 10 sorts before 9. We also look for just tcl. We have to
2027 # be careful that we don't match stuff like tclX by accident.
2028 # the alternative search directory is involked by --with-tclinclude
2029 #
2030 no_tcl=true
2031 echo $ac_n "checking for Tcl private headers""... $ac_c" 1>&6
2032 echo "configure:2033: checking for Tcl private headers" >&5
2033 # Check whether --with-tclinclude or --without-tclinclude was given.
2034 if test "${with_tclinclude+set}" = set; then
2035   withval="$with_tclinclude"
2036   with_tclinclude=${withval}
2037 fi
2038
2039 if eval "test \"`echo '$''{'ac_cv_c_tclh'+set}'`\" = set"; then
2040   echo $ac_n "(cached) $ac_c" 1>&6
2041 else
2042   
2043 # first check to see if --with-tclinclude was specified
2044 if test x"${with_tclinclude}" != x ; then
2045   if test -f ${with_tclinclude}/tclInt.h ; then
2046     ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
2047   elif test -f ${with_tclinclude}/generic/tclInt.h ; then
2048     ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; pwd)`
2049   else
2050     { echo "configure: error: ${with_tclinclude} directory doesn't contain private headers" 1>&2; exit 1; }
2051   fi
2052 fi
2053
2054 # next check if it came with Tcl configuration file
2055 if test x"${ac_cv_c_tclconfig}" != x ; then
2056   if test -f $ac_cv_c_tclconfig/../generic/tclInt.h ; then
2057     ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/../generic; pwd)`
2058   fi
2059 fi
2060
2061 # next check in private source directory
2062 #
2063 # since ls returns lowest version numbers first, reverse its output
2064
2065 if test x"${ac_cv_c_tclh}" = x ; then
2066   for i in \
2067                 ${srcdir}/../tcl \
2068                 `ls -dr ${srcdir}/../tcl[7-9].[0-9] 2>/dev/null` \
2069                 ${srcdir}/../../tcl \
2070                 `ls -dr ${srcdir}/../../tcl[7-9].[0-9] 2>/dev/null` \
2071                 ${srcdir}/../../../tcl \
2072                 `ls -dr ${srcdir}/../../../tcl[7-9].[0-9] 2>/dev/null ` ; do
2073     if test -f $i/generic/tclInt.h ; then
2074       ac_cv_c_tclh=`(cd $i/generic; pwd)`
2075       break
2076     fi
2077   done
2078 fi
2079
2080 # finally check in a few common install locations
2081 #
2082 # since ls returns lowest version numbers first, reverse its output
2083
2084 if test x"${ac_cv_c_tclh}" = x ; then
2085   for i in \
2086                 `ls -dr /usr/local/src/tcl[7-9].[0-9] 2>/dev/null` \
2087                 `ls -dr /usr/local/lib/tcl[7-9].[0-9] 2>/dev/null` \
2088                 /usr/local/src/tcl \
2089                 /usr/local/lib/tcl \
2090                 ${prefix}/include ; do
2091     if test -f $i/generic/tclInt.h ; then
2092       ac_cv_c_tclh=`(cd $i/generic; pwd)`
2093       break
2094     fi
2095   done
2096 fi
2097
2098 # see if one is installed
2099 if test x"${ac_cv_c_tclh}" = x ; then
2100    ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
2101 echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
2102 echo "configure:2103: checking for tclInt.h" >&5
2103 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2104   echo $ac_n "(cached) $ac_c" 1>&6
2105 else
2106   cat > conftest.$ac_ext <<EOF
2107 #line 2108 "configure"
2108 #include "confdefs.h"
2109 #include <tclInt.h>
2110 EOF
2111 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2112 { (eval echo configure:2113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2113 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2114 if test -z "$ac_err"; then
2115   rm -rf conftest*
2116   eval "ac_cv_header_$ac_safe=yes"
2117 else
2118   echo "$ac_err" >&5
2119   echo "configure: failed program was:" >&5
2120   cat conftest.$ac_ext >&5
2121   rm -rf conftest*
2122   eval "ac_cv_header_$ac_safe=no"
2123 fi
2124 rm -f conftest*
2125 fi
2126 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2127   echo "$ac_t""yes" 1>&6
2128   ac_cv_c_tclh=installed
2129 else
2130   echo "$ac_t""no" 1>&6
2131 ac_cv_c_tclh=""
2132 fi
2133
2134 fi
2135
2136 fi
2137
2138 if test x"${ac_cv_c_tclh}" = x ; then
2139   TCLHDIR="# no Tcl private headers found"
2140   TCLHDIRDASHI="# no Tcl private headers found"
2141   { echo "configure: error: Can't find Tcl private headers" 1>&2; exit 1; }
2142 fi
2143 if test x"${ac_cv_c_tclh}" != x ; then
2144   no_tcl=""
2145   if test x"${ac_cv_c_tclh}" = x"installed" ; then
2146     echo "$ac_t""is installed" 1>&6
2147     TCLHDIR=""
2148     TCLHDIRDASHI=""
2149     TCL_LIBRARY=""
2150   else
2151     echo "$ac_t""found in ${ac_cv_c_tclh}" 1>&6
2152     # this hack is cause the TCLHDIR won't print if there is a "-I" in it.
2153     TCLHDIR="${ac_cv_c_tclh}"
2154     TCLHDIRDASHI="-I${ac_cv_c_tclh}"
2155     TCL_LIBRARY=`echo $TCLHDIR | sed -e 's/generic//'`library
2156   fi
2157 fi
2158
2159
2160
2161
2162
2163 if test x"$no_tcl" = x"true" ; then
2164     echo "      ERROR: Can't find Tcl headers or library."
2165     echo "      See README for information on how to obtain Tcl."
2166     echo "      If Tcl is installed, see INSTALL on how to tell"
2167     echo "      configure where Tcl is installed."
2168     exit 1
2169 fi
2170
2171 echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
2172 echo "configure:2173: checking for Itcl private headers. srcdir=${srcdir}" >&5
2173 if test x"${ac_cv_c_itclh}" = x ; then
2174   for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ; do
2175     if test -f $i/itcl/generic/itcl.h ; then
2176       ac_cv_c_itclh=`(cd $i/itcl/generic; pwd)`
2177       break
2178     fi
2179   done
2180 fi
2181 if test x"${ac_cv_c_itclh}" = x ; then
2182   ITCLHDIR="# no Itcl private headers found"
2183   ITCLLIB="# no Itcl private headers found"
2184   echo "configure: warning: Can't find Itcl private headers" 1>&2
2185   no_itcl=true
2186 else
2187   ITCLHDIR="-I${ac_cv_c_itclh}"
2188 # should always be here
2189   ITCLLIB="../itcl/src/libitcl.a"
2190 fi
2191
2192
2193
2194
2195
2196 # have to whether we're generating shared libs before configuring debugger
2197 echo $ac_n "checking if generating shared or nonshared library""... $ac_c" 1>&6
2198 echo "configure:2199: checking if generating shared or nonshared library" >&5
2199 # Check whether --enable-shared or --disable-shared was given.
2200 if test "${enable_shared+set}" = set; then
2201   enableval="$enable_shared"
2202   enable_shared=$enableval
2203 else
2204   enable_shared=no
2205 fi
2206
2207 if test "$enable_shared" = "yes" && test "x${TCL_SHLIB_SUFFIX}" != "x" ; then
2208   echo "$ac_t""both shared and unshared" 1>&6
2209 else
2210   echo "$ac_t""unshared" 1>&6
2211 fi
2212
2213 # Now that we've found the Tcl sources, configure the debugger
2214 # this is a little tricky because it has its own configure script
2215 # which produces a Makefile and cf file.  We only want the cf file,
2216 # so switch to a temporary directory and run the debugger's configure.
2217 # Then save the cf file and delete the rest.
2218 #
2219 # Incidentally, the debugger can't depend on Expect's cf file, because
2220 # the debugger is designed to be independent of Expect.
2221
2222
2223 test -n "$verbose" && echo "configuring Tcl debugger"
2224 tmpdir=./Dbg$$
2225 mkdir ${tmpdir}
2226
2227 if test "${enable_shared}" = "yes"; then
2228   dbg_config_flags='--enable-shared'
2229 else
2230   dbg_config_flags='--disable-shared'
2231 fi
2232 # (cd;pwd) in next several commands converts relative dirs to absolute.
2233 # This is required because the debugger src is at a different level in
2234 # the filesystem than Expect src (where we are presently), thereby
2235 # making the relative pathnames incorrect.
2236 if test "x$with_tclconfig" != "x" ; then
2237   dbg_config_flags="$dbg_config_flags --with-tclconfig=`(cd ${with_tclconfig}; pwd)`"
2238 fi
2239 if test "x$with_tcllibdir" != "x" ; then
2240   dbg_config_flags="$dbg_config_flags --with-tcllibdir=`(cd ${with_tcllibdir}; pwd)`"
2241 fi
2242 if test "x$with_tcllib" != "x" ; then
2243   dbg_config_flags="$dbg_config_flags --with-tcllib=`(cd ${with_tcllib}; pwd)`"
2244 fi
2245 if test "x$with_tclinclude" != "x" ; then
2246   dbg_config_flags="$dbg_config_flags --with-tclinclude=`(cd ${with_tclinclude}; pwd)`"
2247 fi
2248 case "$cache_file" in
2249  /*)
2250     dbg_config_flags="$dbg_config_flags --cache-file=$cache_file"
2251     ;;
2252  *)
2253     dbg_config_flags="$dbg_config_flags --cache-file=../$cache_file"
2254     ;;
2255 esac
2256
2257 cp ${srcdir}/Dbgconfigure ${srcdir}/Dbg.h ${srcdir}/Dbg_cf.h.in ${srcdir}/install-sh ${tmpdir}
2258 cp $srcdir/DbgMkfl.in ${tmpdir}/Makefile.in
2259   (cd $tmpdir; ${CONFIG_SHELL-/bin/sh} Dbgconfigure --with-tclinclude=`echo ${TCLHDIR} | sed -e 's/-I//'` $dbg_config_flags)
2260 cp ${tmpdir}/Dbg_cf.h .
2261 rm -rf $tmpdir
2262 test -n "$verbose" && echo "configured Tcl debugger"
2263
2264 # some people would complain if this explanation wasn't provided...
2265
2266 echo "Begin tests for function/library dependencies.  Tests may be repeated"
2267 echo "up to three times.  First test is for building Expect's shared library."
2268 echo "Second set is for building with Tcl.  Third is for building with Tk."
2269
2270 ######################################################################
2271 # required by Sequent ptx2
2272 unset ac_cv_func_gethostname
2273 echo $ac_n "checking for gethostname""... $ac_c" 1>&6
2274 echo "configure:2275: checking for gethostname" >&5
2275 if eval "test \"`echo '$''{'ac_cv_func_gethostname'+set}'`\" = set"; then
2276   echo $ac_n "(cached) $ac_c" 1>&6
2277 else
2278   cat > conftest.$ac_ext <<EOF
2279 #line 2280 "configure"
2280 #include "confdefs.h"
2281 /* System header to define __stub macros and hopefully few prototypes,
2282     which can conflict with char gethostname(); below.  */
2283 #include <assert.h>
2284 /* Override any gcc2 internal prototype to avoid an error.  */
2285 /* We use char because int might match the return type of a gcc2
2286     builtin and then its argument prototype would still apply.  */
2287 char gethostname();
2288
2289 int main() {
2290
2291 /* The GNU C library defines this for functions which it implements
2292     to always fail with ENOSYS.  Some functions are actually named
2293     something starting with __ and the normal name is an alias.  */
2294 #if defined (__stub_gethostname) || defined (__stub___gethostname)
2295 choke me
2296 #else
2297 gethostname();
2298 #endif
2299
2300 ; return 0; }
2301 EOF
2302 if { (eval echo configure:2303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2303   rm -rf conftest*
2304   eval "ac_cv_func_gethostname=yes"
2305 else
2306   echo "configure: failed program was:" >&5
2307   cat conftest.$ac_ext >&5
2308   rm -rf conftest*
2309   eval "ac_cv_func_gethostname=no"
2310 fi
2311 rm -f conftest*
2312 fi
2313
2314 if eval "test \"`echo '$ac_cv_func_'gethostname`\" = yes"; then
2315   echo "$ac_t""yes" 1>&6
2316   gethostname=1 
2317 else
2318   echo "$ac_t""no" 1>&6
2319 gethostname=0
2320 fi
2321
2322 if test $gethostname -eq 0 ; then
2323   unset ac_cv_lib_inet_gethostname
2324   echo $ac_n "checking for gethostname in -linet""... $ac_c" 1>&6
2325 echo "configure:2326: checking for gethostname in -linet" >&5
2326 ac_lib_var=`echo inet'_'gethostname | sed 'y%./+-%__p_%'`
2327 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2328   echo $ac_n "(cached) $ac_c" 1>&6
2329 else
2330   ac_save_LIBS="$LIBS"
2331 LIBS="-linet  $LIBS"
2332 cat > conftest.$ac_ext <<EOF
2333 #line 2334 "configure"
2334 #include "confdefs.h"
2335 /* Override any gcc2 internal prototype to avoid an error.  */
2336 /* We use char because int might match the return type of a gcc2
2337     builtin and then its argument prototype would still apply.  */
2338 char gethostname();
2339
2340 int main() {
2341 gethostname()
2342 ; return 0; }
2343 EOF
2344 if { (eval echo configure:2345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2345   rm -rf conftest*
2346   eval "ac_cv_lib_$ac_lib_var=yes"
2347 else
2348   echo "configure: failed program was:" >&5
2349   cat conftest.$ac_ext >&5
2350   rm -rf conftest*
2351   eval "ac_cv_lib_$ac_lib_var=no"
2352 fi
2353 rm -f conftest*
2354 LIBS="$ac_save_LIBS"
2355
2356 fi
2357 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2358   echo "$ac_t""yes" 1>&6
2359   LIBS="$LIBS -linet"
2360 else
2361   echo "$ac_t""no" 1>&6
2362 fi
2363
2364 fi
2365 # save results and retry for Tcl
2366 EXP_LIBS=$LIBS
2367 LIBS=$EXP_AND_TCL_LIBS
2368 unset ac_cv_func_gethostname
2369 echo $ac_n "checking for gethostname""... $ac_c" 1>&6
2370 echo "configure:2371: checking for gethostname" >&5
2371 if eval "test \"`echo '$''{'ac_cv_func_gethostname'+set}'`\" = set"; then
2372   echo $ac_n "(cached) $ac_c" 1>&6
2373 else
2374   cat > conftest.$ac_ext <<EOF
2375 #line 2376 "configure"
2376 #include "confdefs.h"
2377 /* System header to define __stub macros and hopefully few prototypes,
2378     which can conflict with char gethostname(); below.  */
2379 #include <assert.h>
2380 /* Override any gcc2 internal prototype to avoid an error.  */
2381 /* We use char because int might match the return type of a gcc2
2382     builtin and then its argument prototype would still apply.  */
2383 char gethostname();
2384
2385 int main() {
2386
2387 /* The GNU C library defines this for functions which it implements
2388     to always fail with ENOSYS.  Some functions are actually named
2389     something starting with __ and the normal name is an alias.  */
2390 #if defined (__stub_gethostname) || defined (__stub___gethostname)
2391 choke me
2392 #else
2393 gethostname();
2394 #endif
2395
2396 ; return 0; }
2397 EOF
2398 if { (eval echo configure:2399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2399   rm -rf conftest*
2400   eval "ac_cv_func_gethostname=yes"
2401 else
2402   echo "configure: failed program was:" >&5
2403   cat conftest.$ac_ext >&5
2404   rm -rf conftest*
2405   eval "ac_cv_func_gethostname=no"
2406 fi
2407 rm -f conftest*
2408 fi
2409
2410 if eval "test \"`echo '$ac_cv_func_'gethostname`\" = yes"; then
2411   echo "$ac_t""yes" 1>&6
2412   gethostname=1 
2413 else
2414   echo "$ac_t""no" 1>&6
2415 gethostname=0
2416 fi
2417
2418 if test $gethostname -eq 0 ; then
2419   unset ac_cv_lib_inet_gethostname
2420   echo $ac_n "checking for gethostname in -linet""... $ac_c" 1>&6
2421 echo "configure:2422: checking for gethostname in -linet" >&5
2422 ac_lib_var=`echo inet'_'gethostname | sed 'y%./+-%__p_%'`
2423 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2424   echo $ac_n "(cached) $ac_c" 1>&6
2425 else
2426   ac_save_LIBS="$LIBS"
2427 LIBS="-linet  $LIBS"
2428 cat > conftest.$ac_ext <<EOF
2429 #line 2430 "configure"
2430 #include "confdefs.h"
2431 /* Override any gcc2 internal prototype to avoid an error.  */
2432 /* We use char because int might match the return type of a gcc2
2433     builtin and then its argument prototype would still apply.  */
2434 char gethostname();
2435
2436 int main() {
2437 gethostname()
2438 ; return 0; }
2439 EOF
2440 if { (eval echo configure:2441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2441   rm -rf conftest*
2442   eval "ac_cv_lib_$ac_lib_var=yes"
2443 else
2444   echo "configure: failed program was:" >&5
2445   cat conftest.$ac_ext >&5
2446   rm -rf conftest*
2447   eval "ac_cv_lib_$ac_lib_var=no"
2448 fi
2449 rm -f conftest*
2450 LIBS="$ac_save_LIBS"
2451
2452 fi
2453 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2454   echo "$ac_t""yes" 1>&6
2455   LIBS="$LIBS -linet"
2456 else
2457   echo "$ac_t""no" 1>&6
2458 fi
2459
2460 fi
2461 # save Tcl results and retry for Tk
2462 EXP_AND_TCL_LIBS=$LIBS
2463 LIBS=$EXP_AND_TK_LIBS
2464 unset ac_cv_func_gethostname
2465 echo $ac_n "checking for gethostname""... $ac_c" 1>&6
2466 echo "configure:2467: checking for gethostname" >&5
2467 if eval "test \"`echo '$''{'ac_cv_func_gethostname'+set}'`\" = set"; then
2468   echo $ac_n "(cached) $ac_c" 1>&6
2469 else
2470   cat > conftest.$ac_ext <<EOF
2471 #line 2472 "configure"
2472 #include "confdefs.h"
2473 /* System header to define __stub macros and hopefully few prototypes,
2474     which can conflict with char gethostname(); below.  */
2475 #include <assert.h>
2476 /* Override any gcc2 internal prototype to avoid an error.  */
2477 /* We use char because int might match the return type of a gcc2
2478     builtin and then its argument prototype would still apply.  */
2479 char gethostname();
2480
2481 int main() {
2482
2483 /* The GNU C library defines this for functions which it implements
2484     to always fail with ENOSYS.  Some functions are actually named
2485     something starting with __ and the normal name is an alias.  */
2486 #if defined (__stub_gethostname) || defined (__stub___gethostname)
2487 choke me
2488 #else
2489 gethostname();
2490 #endif
2491
2492 ; return 0; }
2493 EOF
2494 if { (eval echo configure:2495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2495   rm -rf conftest*
2496   eval "ac_cv_func_gethostname=yes"
2497 else
2498   echo "configure: failed program was:" >&5
2499   cat conftest.$ac_ext >&5
2500   rm -rf conftest*
2501   eval "ac_cv_func_gethostname=no"
2502 fi
2503 rm -f conftest*
2504 fi
2505
2506 if eval "test \"`echo '$ac_cv_func_'gethostname`\" = yes"; then
2507   echo "$ac_t""yes" 1>&6
2508   gethostname=1 
2509 else
2510   echo "$ac_t""no" 1>&6
2511 gethostname=0
2512 fi
2513
2514 if test $gethostname -eq 0 ; then
2515   unset ac_cv_lib_inet_gethostname
2516   echo $ac_n "checking for gethostname in -linet""... $ac_c" 1>&6
2517 echo "configure:2518: checking for gethostname in -linet" >&5
2518 ac_lib_var=`echo inet'_'gethostname | sed 'y%./+-%__p_%'`
2519 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2520   echo $ac_n "(cached) $ac_c" 1>&6
2521 else
2522   ac_save_LIBS="$LIBS"
2523 LIBS="-linet  $LIBS"
2524 cat > conftest.$ac_ext <<EOF
2525 #line 2526 "configure"
2526 #include "confdefs.h"
2527 /* Override any gcc2 internal prototype to avoid an error.  */
2528 /* We use char because int might match the return type of a gcc2
2529     builtin and then its argument prototype would still apply.  */
2530 char gethostname();
2531
2532 int main() {
2533 gethostname()
2534 ; return 0; }
2535 EOF
2536 if { (eval echo configure:2537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2537   rm -rf conftest*
2538   eval "ac_cv_lib_$ac_lib_var=yes"
2539 else
2540   echo "configure: failed program was:" >&5
2541   cat conftest.$ac_ext >&5
2542   rm -rf conftest*
2543   eval "ac_cv_lib_$ac_lib_var=no"
2544 fi
2545 rm -f conftest*
2546 LIBS="$ac_save_LIBS"
2547
2548 fi
2549 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2550   echo "$ac_t""yes" 1>&6
2551   LIBS="$LIBS -linet"
2552 else
2553   echo "$ac_t""no" 1>&6
2554 fi
2555
2556 fi
2557 # save Tk results and reset for Expect
2558 EXP_AND_TK_LIBS=$LIBS
2559 LIBS=$EXP_LIBS
2560
2561 ######################################################################
2562 # required by Fischman's ISC 4.0
2563 unset ac_cv_func_socket
2564 echo $ac_n "checking for socket""... $ac_c" 1>&6
2565 echo "configure:2566: checking for socket" >&5
2566 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
2567   echo $ac_n "(cached) $ac_c" 1>&6
2568 else
2569   cat > conftest.$ac_ext <<EOF
2570 #line 2571 "configure"
2571 #include "confdefs.h"
2572 /* System header to define __stub macros and hopefully few prototypes,
2573     which can conflict with char socket(); below.  */
2574 #include <assert.h>
2575 /* Override any gcc2 internal prototype to avoid an error.  */
2576 /* We use char because int might match the return type of a gcc2
2577     builtin and then its argument prototype would still apply.  */
2578 char socket();
2579
2580 int main() {
2581
2582 /* The GNU C library defines this for functions which it implements
2583     to always fail with ENOSYS.  Some functions are actually named
2584     something starting with __ and the normal name is an alias.  */
2585 #if defined (__stub_socket) || defined (__stub___socket)
2586 choke me
2587 #else
2588 socket();
2589 #endif
2590
2591 ; return 0; }
2592 EOF
2593 if { (eval echo configure:2594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2594   rm -rf conftest*
2595   eval "ac_cv_func_socket=yes"
2596 else
2597   echo "configure: failed program was:" >&5
2598   cat conftest.$ac_ext >&5
2599   rm -rf conftest*
2600   eval "ac_cv_func_socket=no"
2601 fi
2602 rm -f conftest*
2603 fi
2604
2605 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
2606   echo "$ac_t""yes" 1>&6
2607   socket=1 
2608 else
2609   echo "$ac_t""no" 1>&6
2610 socket=0
2611 fi
2612
2613 if test $socket -eq 0 ; then
2614   unset ac_cv_lib_inet_socket
2615   echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
2616 echo "configure:2617: checking for socket in -linet" >&5
2617 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
2618 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2619   echo $ac_n "(cached) $ac_c" 1>&6
2620 else
2621   ac_save_LIBS="$LIBS"
2622 LIBS="-linet  $LIBS"
2623 cat > conftest.$ac_ext <<EOF
2624 #line 2625 "configure"
2625 #include "confdefs.h"
2626 /* Override any gcc2 internal prototype to avoid an error.  */
2627 /* We use char because int might match the return type of a gcc2
2628     builtin and then its argument prototype would still apply.  */
2629 char socket();
2630
2631 int main() {
2632 socket()
2633 ; return 0; }
2634 EOF
2635 if { (eval echo configure:2636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2636   rm -rf conftest*
2637   eval "ac_cv_lib_$ac_lib_var=yes"
2638 else
2639   echo "configure: failed program was:" >&5
2640   cat conftest.$ac_ext >&5
2641   rm -rf conftest*
2642   eval "ac_cv_lib_$ac_lib_var=no"
2643 fi
2644 rm -f conftest*
2645 LIBS="$ac_save_LIBS"
2646
2647 fi
2648 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2649   echo "$ac_t""yes" 1>&6
2650   LIBS="$LIBS -linet"
2651 else
2652   echo "$ac_t""no" 1>&6
2653 fi
2654
2655 fi
2656 # save results and retry for Tcl
2657 EXP_LIBS=$LIBS
2658 LIBS=$EXP_AND_TCL_LIBS
2659 unset ac_cv_func_socket
2660 echo $ac_n "checking for socket""... $ac_c" 1>&6
2661 echo "configure:2662: checking for socket" >&5
2662 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
2663   echo $ac_n "(cached) $ac_c" 1>&6
2664 else
2665   cat > conftest.$ac_ext <<EOF
2666 #line 2667 "configure"
2667 #include "confdefs.h"
2668 /* System header to define __stub macros and hopefully few prototypes,
2669     which can conflict with char socket(); below.  */
2670 #include <assert.h>
2671 /* Override any gcc2 internal prototype to avoid an error.  */
2672 /* We use char because int might match the return type of a gcc2
2673     builtin and then its argument prototype would still apply.  */
2674 char socket();
2675
2676 int main() {
2677
2678 /* The GNU C library defines this for functions which it implements
2679     to always fail with ENOSYS.  Some functions are actually named
2680     something starting with __ and the normal name is an alias.  */
2681 #if defined (__stub_socket) || defined (__stub___socket)
2682 choke me
2683 #else
2684 socket();
2685 #endif
2686
2687 ; return 0; }
2688 EOF
2689 if { (eval echo configure:2690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2690   rm -rf conftest*
2691   eval "ac_cv_func_socket=yes"
2692 else
2693   echo "configure: failed program was:" >&5
2694   cat conftest.$ac_ext >&5
2695   rm -rf conftest*
2696   eval "ac_cv_func_socket=no"
2697 fi
2698 rm -f conftest*
2699 fi
2700
2701 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
2702   echo "$ac_t""yes" 1>&6
2703   socket=1 
2704 else
2705   echo "$ac_t""no" 1>&6
2706 socket=0
2707 fi
2708
2709 if test $socket -eq 0 ; then
2710   unset ac_cv_lib_inet_socket
2711   echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
2712 echo "configure:2713: checking for socket in -linet" >&5
2713 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
2714 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2715   echo $ac_n "(cached) $ac_c" 1>&6
2716 else
2717   ac_save_LIBS="$LIBS"
2718 LIBS="-linet  $LIBS"
2719 cat > conftest.$ac_ext <<EOF
2720 #line 2721 "configure"
2721 #include "confdefs.h"
2722 /* Override any gcc2 internal prototype to avoid an error.  */
2723 /* We use char because int might match the return type of a gcc2
2724     builtin and then its argument prototype would still apply.  */
2725 char socket();
2726
2727 int main() {
2728 socket()
2729 ; return 0; }
2730 EOF
2731 if { (eval echo configure:2732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2732   rm -rf conftest*
2733   eval "ac_cv_lib_$ac_lib_var=yes"
2734 else
2735   echo "configure: failed program was:" >&5
2736   cat conftest.$ac_ext >&5
2737   rm -rf conftest*
2738   eval "ac_cv_lib_$ac_lib_var=no"
2739 fi
2740 rm -f conftest*
2741 LIBS="$ac_save_LIBS"
2742
2743 fi
2744 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2745   echo "$ac_t""yes" 1>&6
2746   LIBS="$LIBS -linet"
2747 else
2748   echo "$ac_t""no" 1>&6
2749 fi
2750
2751 fi
2752 # save Tcl results and retry for Tk
2753 EXP_AND_TCL_LIBS=$LIBS
2754 LIBS=$EXP_AND_TK_LIBS
2755 unset ac_cv_func_socket
2756 echo $ac_n "checking for socket""... $ac_c" 1>&6
2757 echo "configure:2758: checking for socket" >&5
2758 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
2759   echo $ac_n "(cached) $ac_c" 1>&6
2760 else
2761   cat > conftest.$ac_ext <<EOF
2762 #line 2763 "configure"
2763 #include "confdefs.h"
2764 /* System header to define __stub macros and hopefully few prototypes,
2765     which can conflict with char socket(); below.  */
2766 #include <assert.h>
2767 /* Override any gcc2 internal prototype to avoid an error.  */
2768 /* We use char because int might match the return type of a gcc2
2769     builtin and then its argument prototype would still apply.  */
2770 char socket();
2771
2772 int main() {
2773
2774 /* The GNU C library defines this for functions which it implements
2775     to always fail with ENOSYS.  Some functions are actually named
2776     something starting with __ and the normal name is an alias.  */
2777 #if defined (__stub_socket) || defined (__stub___socket)
2778 choke me
2779 #else
2780 socket();
2781 #endif
2782
2783 ; return 0; }
2784 EOF
2785 if { (eval echo configure:2786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2786   rm -rf conftest*
2787   eval "ac_cv_func_socket=yes"
2788 else
2789   echo "configure: failed program was:" >&5
2790   cat conftest.$ac_ext >&5
2791   rm -rf conftest*
2792   eval "ac_cv_func_socket=no"
2793 fi
2794 rm -f conftest*
2795 fi
2796
2797 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
2798   echo "$ac_t""yes" 1>&6
2799   socket=1 
2800 else
2801   echo "$ac_t""no" 1>&6
2802 socket=0
2803 fi
2804
2805 if test $socket -eq 0 ; then
2806   unset ac_cv_lib_inet_socket
2807   echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
2808 echo "configure:2809: checking for socket in -linet" >&5
2809 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
2810 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2811   echo $ac_n "(cached) $ac_c" 1>&6
2812 else
2813   ac_save_LIBS="$LIBS"
2814 LIBS="-linet  $LIBS"
2815 cat > conftest.$ac_ext <<EOF
2816 #line 2817 "configure"
2817 #include "confdefs.h"
2818 /* Override any gcc2 internal prototype to avoid an error.  */
2819 /* We use char because int might match the return type of a gcc2
2820     builtin and then its argument prototype would still apply.  */
2821 char socket();
2822
2823 int main() {
2824 socket()
2825 ; return 0; }
2826 EOF
2827 if { (eval echo configure:2828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2828   rm -rf conftest*
2829   eval "ac_cv_lib_$ac_lib_var=yes"
2830 else
2831   echo "configure: failed program was:" >&5
2832   cat conftest.$ac_ext >&5
2833   rm -rf conftest*
2834   eval "ac_cv_lib_$ac_lib_var=no"
2835 fi
2836 rm -f conftest*
2837 LIBS="$ac_save_LIBS"
2838
2839 fi
2840 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2841   echo "$ac_t""yes" 1>&6
2842   LIBS="$LIBS -linet"
2843 else
2844   echo "$ac_t""no" 1>&6
2845 fi
2846
2847 fi
2848 # save Tk results and reset for Expect
2849 EXP_AND_TK_LIBS=$LIBS
2850 LIBS=$EXP_LIBS
2851
2852 ######################################################################
2853 unset ac_cv_func_select
2854 echo $ac_n "checking for select""... $ac_c" 1>&6
2855 echo "configure:2856: checking for select" >&5
2856 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
2857   echo $ac_n "(cached) $ac_c" 1>&6
2858 else
2859   cat > conftest.$ac_ext <<EOF
2860 #line 2861 "configure"
2861 #include "confdefs.h"
2862 /* System header to define __stub macros and hopefully few prototypes,
2863     which can conflict with char select(); below.  */
2864 #include <assert.h>
2865 /* Override any gcc2 internal prototype to avoid an error.  */
2866 /* We use char because int might match the return type of a gcc2
2867     builtin and then its argument prototype would still apply.  */
2868 char select();
2869
2870 int main() {
2871
2872 /* The GNU C library defines this for functions which it implements
2873     to always fail with ENOSYS.  Some functions are actually named
2874     something starting with __ and the normal name is an alias.  */
2875 #if defined (__stub_select) || defined (__stub___select)
2876 choke me
2877 #else
2878 select();
2879 #endif
2880
2881 ; return 0; }
2882 EOF
2883 if { (eval echo configure:2884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2884   rm -rf conftest*
2885   eval "ac_cv_func_select=yes"
2886 else
2887   echo "configure: failed program was:" >&5
2888   cat conftest.$ac_ext >&5
2889   rm -rf conftest*
2890   eval "ac_cv_func_select=no"
2891 fi
2892 rm -f conftest*
2893 fi
2894
2895 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
2896   echo "$ac_t""yes" 1>&6
2897   select=1 
2898 else
2899   echo "$ac_t""no" 1>&6
2900 select=0
2901 fi
2902
2903 if test $select -eq 0 ; then
2904   unset ac_cv_lib_inet_select
2905   echo $ac_n "checking for select in -linet""... $ac_c" 1>&6
2906 echo "configure:2907: checking for select in -linet" >&5
2907 ac_lib_var=`echo inet'_'select | sed 'y%./+-%__p_%'`
2908 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2909   echo $ac_n "(cached) $ac_c" 1>&6
2910 else
2911   ac_save_LIBS="$LIBS"
2912 LIBS="-linet  $LIBS"
2913 cat > conftest.$ac_ext <<EOF
2914 #line 2915 "configure"
2915 #include "confdefs.h"
2916 /* Override any gcc2 internal prototype to avoid an error.  */
2917 /* We use char because int might match the return type of a gcc2
2918     builtin and then its argument prototype would still apply.  */
2919 char select();
2920
2921 int main() {
2922 select()
2923 ; return 0; }
2924 EOF
2925 if { (eval echo configure:2926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2926   rm -rf conftest*
2927   eval "ac_cv_lib_$ac_lib_var=yes"
2928 else
2929   echo "configure: failed program was:" >&5
2930   cat conftest.$ac_ext >&5
2931   rm -rf conftest*
2932   eval "ac_cv_lib_$ac_lib_var=no"
2933 fi
2934 rm -f conftest*
2935 LIBS="$ac_save_LIBS"
2936
2937 fi
2938 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2939   echo "$ac_t""yes" 1>&6
2940   LIBS="$LIBS -linet"
2941 else
2942   echo "$ac_t""no" 1>&6
2943 fi
2944
2945 fi
2946 # save results and retry for Tcl
2947 EXP_LIBS=$LIBS
2948 LIBS=$EXP_AND_TCL_LIBS
2949 unset ac_cv_func_select
2950 echo $ac_n "checking for select""... $ac_c" 1>&6
2951 echo "configure:2952: checking for select" >&5
2952 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
2953   echo $ac_n "(cached) $ac_c" 1>&6
2954 else
2955   cat > conftest.$ac_ext <<EOF
2956 #line 2957 "configure"
2957 #include "confdefs.h"
2958 /* System header to define __stub macros and hopefully few prototypes,
2959     which can conflict with char select(); below.  */
2960 #include <assert.h>
2961 /* Override any gcc2 internal prototype to avoid an error.  */
2962 /* We use char because int might match the return type of a gcc2
2963     builtin and then its argument prototype would still apply.  */
2964 char select();
2965
2966 int main() {
2967
2968 /* The GNU C library defines this for functions which it implements
2969     to always fail with ENOSYS.  Some functions are actually named
2970     something starting with __ and the normal name is an alias.  */
2971 #if defined (__stub_select) || defined (__stub___select)
2972 choke me
2973 #else
2974 select();
2975 #endif
2976
2977 ; return 0; }
2978 EOF
2979 if { (eval echo configure:2980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2980   rm -rf conftest*
2981   eval "ac_cv_func_select=yes"
2982 else
2983   echo "configure: failed program was:" >&5
2984   cat conftest.$ac_ext >&5
2985   rm -rf conftest*
2986   eval "ac_cv_func_select=no"
2987 fi
2988 rm -f conftest*
2989 fi
2990
2991 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
2992   echo "$ac_t""yes" 1>&6
2993   select=1 
2994 else
2995   echo "$ac_t""no" 1>&6
2996 select=0
2997 fi
2998
2999 if test $select -eq 0 ; then
3000   unset ac_cv_lib_inet_select
3001   echo $ac_n "checking for select in -linet""... $ac_c" 1>&6
3002 echo "configure:3003: checking for select in -linet" >&5
3003 ac_lib_var=`echo inet'_'select | sed 'y%./+-%__p_%'`
3004 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3005   echo $ac_n "(cached) $ac_c" 1>&6
3006 else
3007   ac_save_LIBS="$LIBS"
3008 LIBS="-linet  $LIBS"
3009 cat > conftest.$ac_ext <<EOF
3010 #line 3011 "configure"
3011 #include "confdefs.h"
3012 /* Override any gcc2 internal prototype to avoid an error.  */
3013 /* We use char because int might match the return type of a gcc2
3014     builtin and then its argument prototype would still apply.  */
3015 char select();
3016
3017 int main() {
3018 select()
3019 ; return 0; }
3020 EOF
3021 if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3022   rm -rf conftest*
3023   eval "ac_cv_lib_$ac_lib_var=yes"
3024 else
3025   echo "configure: failed program was:" >&5
3026   cat conftest.$ac_ext >&5
3027   rm -rf conftest*
3028   eval "ac_cv_lib_$ac_lib_var=no"
3029 fi
3030 rm -f conftest*
3031 LIBS="$ac_save_LIBS"
3032
3033 fi
3034 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3035   echo "$ac_t""yes" 1>&6
3036   LIBS="$LIBS -linet"
3037 else
3038   echo "$ac_t""no" 1>&6
3039 fi
3040
3041 fi
3042 # save Tcl results and retry for Tk
3043 EXP_AND_TCL_LIBS=$LIBS
3044 LIBS=$EXP_AND_TK_LIBS
3045 unset ac_cv_func_select
3046 echo $ac_n "checking for select""... $ac_c" 1>&6
3047 echo "configure:3048: checking for select" >&5
3048 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
3049   echo $ac_n "(cached) $ac_c" 1>&6
3050 else
3051   cat > conftest.$ac_ext <<EOF
3052 #line 3053 "configure"
3053 #include "confdefs.h"
3054 /* System header to define __stub macros and hopefully few prototypes,
3055     which can conflict with char select(); below.  */
3056 #include <assert.h>
3057 /* Override any gcc2 internal prototype to avoid an error.  */
3058 /* We use char because int might match the return type of a gcc2
3059     builtin and then its argument prototype would still apply.  */
3060 char select();
3061
3062 int main() {
3063
3064 /* The GNU C library defines this for functions which it implements
3065     to always fail with ENOSYS.  Some functions are actually named
3066     something starting with __ and the normal name is an alias.  */
3067 #if defined (__stub_select) || defined (__stub___select)
3068 choke me
3069 #else
3070 select();
3071 #endif
3072
3073 ; return 0; }
3074 EOF
3075 if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3076   rm -rf conftest*
3077   eval "ac_cv_func_select=yes"
3078 else
3079   echo "configure: failed program was:" >&5
3080   cat conftest.$ac_ext >&5
3081   rm -rf conftest*
3082   eval "ac_cv_func_select=no"
3083 fi
3084 rm -f conftest*
3085 fi
3086
3087 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
3088   echo "$ac_t""yes" 1>&6
3089   select=1 
3090 else
3091   echo "$ac_t""no" 1>&6
3092 select=0
3093 fi
3094
3095 if test $select -eq 0 ; then
3096   unset ac_cv_lib_inet_select
3097   echo $ac_n "checking for select in -linet""... $ac_c" 1>&6
3098 echo "configure:3099: checking for select in -linet" >&5
3099 ac_lib_var=`echo inet'_'select | sed 'y%./+-%__p_%'`
3100 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3101   echo $ac_n "(cached) $ac_c" 1>&6
3102 else
3103   ac_save_LIBS="$LIBS"
3104 LIBS="-linet  $LIBS"
3105 cat > conftest.$ac_ext <<EOF
3106 #line 3107 "configure"
3107 #include "confdefs.h"
3108 /* Override any gcc2 internal prototype to avoid an error.  */
3109 /* We use char because int might match the return type of a gcc2
3110     builtin and then its argument prototype would still apply.  */
3111 char select();
3112
3113 int main() {
3114 select()
3115 ; return 0; }
3116 EOF
3117 if { (eval echo configure:3118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3118   rm -rf conftest*
3119   eval "ac_cv_lib_$ac_lib_var=yes"
3120 else
3121   echo "configure: failed program was:" >&5
3122   cat conftest.$ac_ext >&5
3123   rm -rf conftest*
3124   eval "ac_cv_lib_$ac_lib_var=no"
3125 fi
3126 rm -f conftest*
3127 LIBS="$ac_save_LIBS"
3128
3129 fi
3130 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3131   echo "$ac_t""yes" 1>&6
3132   LIBS="$LIBS -linet"
3133 else
3134   echo "$ac_t""no" 1>&6
3135 fi
3136
3137 fi
3138 # save Tk results and reset for Expect
3139 EXP_AND_TK_LIBS=$LIBS
3140 LIBS=$EXP_LIBS
3141
3142 ######################################################################
3143 unset ac_cv_func_getpseudotty
3144 echo $ac_n "checking for getpseudotty""... $ac_c" 1>&6
3145 echo "configure:3146: checking for getpseudotty" >&5
3146 if eval "test \"`echo '$''{'ac_cv_func_getpseudotty'+set}'`\" = set"; then
3147   echo $ac_n "(cached) $ac_c" 1>&6
3148 else
3149   cat > conftest.$ac_ext <<EOF
3150 #line 3151 "configure"
3151 #include "confdefs.h"
3152 /* System header to define __stub macros and hopefully few prototypes,
3153     which can conflict with char getpseudotty(); below.  */
3154 #include <assert.h>
3155 /* Override any gcc2 internal prototype to avoid an error.  */
3156 /* We use char because int might match the return type of a gcc2
3157     builtin and then its argument prototype would still apply.  */
3158 char getpseudotty();
3159
3160 int main() {
3161
3162 /* The GNU C library defines this for functions which it implements
3163     to always fail with ENOSYS.  Some functions are actually named
3164     something starting with __ and the normal name is an alias.  */
3165 #if defined (__stub_getpseudotty) || defined (__stub___getpseudotty)
3166 choke me
3167 #else
3168 getpseudotty();
3169 #endif
3170
3171 ; return 0; }
3172 EOF
3173 if { (eval echo configure:3174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3174   rm -rf conftest*
3175   eval "ac_cv_func_getpseudotty=yes"
3176 else
3177   echo "configure: failed program was:" >&5
3178   cat conftest.$ac_ext >&5
3179   rm -rf conftest*
3180   eval "ac_cv_func_getpseudotty=no"
3181 fi
3182 rm -f conftest*
3183 fi
3184
3185 if eval "test \"`echo '$ac_cv_func_'getpseudotty`\" = yes"; then
3186   echo "$ac_t""yes" 1>&6
3187   getpseudotty=1 
3188 else
3189   echo "$ac_t""no" 1>&6
3190 getpseudotty=0
3191 fi
3192
3193 if test $getpseudotty -eq 0 ; then
3194   unset ac_cv_lib_seq_getpseudotty
3195   echo $ac_n "checking for getpseudotty in -lseq""... $ac_c" 1>&6
3196 echo "configure:3197: checking for getpseudotty in -lseq" >&5
3197 ac_lib_var=`echo seq'_'getpseudotty | sed 'y%./+-%__p_%'`
3198 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3199   echo $ac_n "(cached) $ac_c" 1>&6
3200 else
3201   ac_save_LIBS="$LIBS"
3202 LIBS="-lseq  $LIBS"
3203 cat > conftest.$ac_ext <<EOF
3204 #line 3205 "configure"
3205 #include "confdefs.h"
3206 /* Override any gcc2 internal prototype to avoid an error.  */
3207 /* We use char because int might match the return type of a gcc2
3208     builtin and then its argument prototype would still apply.  */
3209 char getpseudotty();
3210
3211 int main() {
3212 getpseudotty()
3213 ; return 0; }
3214 EOF
3215 if { (eval echo configure:3216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3216   rm -rf conftest*
3217   eval "ac_cv_lib_$ac_lib_var=yes"
3218 else
3219   echo "configure: failed program was:" >&5
3220   cat conftest.$ac_ext >&5
3221   rm -rf conftest*
3222   eval "ac_cv_lib_$ac_lib_var=no"
3223 fi
3224 rm -f conftest*
3225 LIBS="$ac_save_LIBS"
3226
3227 fi
3228 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3229   echo "$ac_t""yes" 1>&6
3230     ac_tr_lib=HAVE_LIB`echo seq | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3231     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3232   cat >> confdefs.h <<EOF
3233 #define $ac_tr_lib 1
3234 EOF
3235
3236   LIBS="-lseq $LIBS"
3237
3238 else
3239   echo "$ac_t""no" 1>&6
3240 fi
3241
3242 fi
3243 # save results and retry for Tcl
3244 EXP_LIBS=$LIBS
3245 LIBS=$EXP_AND_TCL_LIBS
3246 unset ac_cv_func_getpseudotty
3247 echo $ac_n "checking for getpseudotty""... $ac_c" 1>&6
3248 echo "configure:3249: checking for getpseudotty" >&5
3249 if eval "test \"`echo '$''{'ac_cv_func_getpseudotty'+set}'`\" = set"; then
3250   echo $ac_n "(cached) $ac_c" 1>&6
3251 else
3252   cat > conftest.$ac_ext <<EOF
3253 #line 3254 "configure"
3254 #include "confdefs.h"
3255 /* System header to define __stub macros and hopefully few prototypes,
3256     which can conflict with char getpseudotty(); below.  */
3257 #include <assert.h>
3258 /* Override any gcc2 internal prototype to avoid an error.  */
3259 /* We use char because int might match the return type of a gcc2
3260     builtin and then its argument prototype would still apply.  */
3261 char getpseudotty();
3262
3263 int main() {
3264
3265 /* The GNU C library defines this for functions which it implements
3266     to always fail with ENOSYS.  Some functions are actually named
3267     something starting with __ and the normal name is an alias.  */
3268 #if defined (__stub_getpseudotty) || defined (__stub___getpseudotty)
3269 choke me
3270 #else
3271 getpseudotty();
3272 #endif
3273
3274 ; return 0; }
3275 EOF
3276 if { (eval echo configure:3277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3277   rm -rf conftest*
3278   eval "ac_cv_func_getpseudotty=yes"
3279 else
3280   echo "configure: failed program was:" >&5
3281   cat conftest.$ac_ext >&5
3282   rm -rf conftest*
3283   eval "ac_cv_func_getpseudotty=no"
3284 fi
3285 rm -f conftest*
3286 fi
3287
3288 if eval "test \"`echo '$ac_cv_func_'getpseudotty`\" = yes"; then
3289   echo "$ac_t""yes" 1>&6
3290   getpseudotty=1 
3291 else
3292   echo "$ac_t""no" 1>&6
3293 getpseudotty=0
3294 fi
3295
3296 if test $getpseudotty -eq 0 ; then
3297   unset ac_cv_lib_seq_getpseudotty
3298   echo $ac_n "checking for getpseudotty in -lseq""... $ac_c" 1>&6
3299 echo "configure:3300: checking for getpseudotty in -lseq" >&5
3300 ac_lib_var=`echo seq'_'getpseudotty | sed 'y%./+-%__p_%'`
3301 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3302   echo $ac_n "(cached) $ac_c" 1>&6
3303 else
3304   ac_save_LIBS="$LIBS"
3305 LIBS="-lseq  $LIBS"
3306 cat > conftest.$ac_ext <<EOF
3307 #line 3308 "configure"
3308 #include "confdefs.h"
3309 /* Override any gcc2 internal prototype to avoid an error.  */
3310 /* We use char because int might match the return type of a gcc2
3311     builtin and then its argument prototype would still apply.  */
3312 char getpseudotty();
3313
3314 int main() {
3315 getpseudotty()
3316 ; return 0; }
3317 EOF
3318 if { (eval echo configure:3319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3319   rm -rf conftest*
3320   eval "ac_cv_lib_$ac_lib_var=yes"
3321 else
3322   echo "configure: failed program was:" >&5
3323   cat conftest.$ac_ext >&5
3324   rm -rf conftest*
3325   eval "ac_cv_lib_$ac_lib_var=no"
3326 fi
3327 rm -f conftest*
3328 LIBS="$ac_save_LIBS"
3329
3330 fi
3331 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3332   echo "$ac_t""yes" 1>&6
3333     ac_tr_lib=HAVE_LIB`echo seq | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3334     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3335   cat >> confdefs.h <<EOF
3336 #define $ac_tr_lib 1
3337 EOF
3338
3339   LIBS="-lseq $LIBS"
3340
3341 else
3342   echo "$ac_t""no" 1>&6
3343 fi
3344
3345 fi
3346 # save Tcl results and retry for Tk
3347 EXP_AND_TCL_LIBS=$LIBS
3348 LIBS=$EXP_AND_TK_LIBS
3349 unset ac_cv_func_getpseudotty
3350 echo $ac_n "checking for getpseudotty""... $ac_c" 1>&6
3351 echo "configure:3352: checking for getpseudotty" >&5
3352 if eval "test \"`echo '$''{'ac_cv_func_getpseudotty'+set}'`\" = set"; then
3353   echo $ac_n "(cached) $ac_c" 1>&6
3354 else
3355   cat > conftest.$ac_ext <<EOF
3356 #line 3357 "configure"
3357 #include "confdefs.h"
3358 /* System header to define __stub macros and hopefully few prototypes,
3359     which can conflict with char getpseudotty(); below.  */
3360 #include <assert.h>
3361 /* Override any gcc2 internal prototype to avoid an error.  */
3362 /* We use char because int might match the return type of a gcc2
3363     builtin and then its argument prototype would still apply.  */
3364 char getpseudotty();
3365
3366 int main() {
3367
3368 /* The GNU C library defines this for functions which it implements
3369     to always fail with ENOSYS.  Some functions are actually named
3370     something starting with __ and the normal name is an alias.  */
3371 #if defined (__stub_getpseudotty) || defined (__stub___getpseudotty)
3372 choke me
3373 #else
3374 getpseudotty();
3375 #endif
3376
3377 ; return 0; }
3378 EOF
3379 if { (eval echo configure:3380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3380   rm -rf conftest*
3381   eval "ac_cv_func_getpseudotty=yes"
3382 else
3383   echo "configure: failed program was:" >&5
3384   cat conftest.$ac_ext >&5
3385   rm -rf conftest*
3386   eval "ac_cv_func_getpseudotty=no"
3387 fi
3388 rm -f conftest*
3389 fi
3390
3391 if eval "test \"`echo '$ac_cv_func_'getpseudotty`\" = yes"; then
3392   echo "$ac_t""yes" 1>&6
3393   getpseudotty=1 
3394 else
3395   echo "$ac_t""no" 1>&6
3396 getpseudotty=0
3397 fi
3398
3399 if test $getpseudotty -eq 0 ; then
3400   unset ac_cv_lib_seq_getpseudotty
3401   echo $ac_n "checking for getpseudotty in -lseq""... $ac_c" 1>&6
3402 echo "configure:3403: checking for getpseudotty in -lseq" >&5
3403 ac_lib_var=`echo seq'_'getpseudotty | sed 'y%./+-%__p_%'`
3404 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3405   echo $ac_n "(cached) $ac_c" 1>&6
3406 else
3407   ac_save_LIBS="$LIBS"
3408 LIBS="-lseq  $LIBS"
3409 cat > conftest.$ac_ext <<EOF
3410 #line 3411 "configure"
3411 #include "confdefs.h"
3412 /* Override any gcc2 internal prototype to avoid an error.  */
3413 /* We use char because int might match the return type of a gcc2
3414     builtin and then its argument prototype would still apply.  */
3415 char getpseudotty();
3416
3417 int main() {
3418 getpseudotty()
3419 ; return 0; }
3420 EOF
3421 if { (eval echo configure:3422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3422   rm -rf conftest*
3423   eval "ac_cv_lib_$ac_lib_var=yes"
3424 else
3425   echo "configure: failed program was:" >&5
3426   cat conftest.$ac_ext >&5
3427   rm -rf conftest*
3428   eval "ac_cv_lib_$ac_lib_var=no"
3429 fi
3430 rm -f conftest*
3431 LIBS="$ac_save_LIBS"
3432
3433 fi
3434 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3435   echo "$ac_t""yes" 1>&6
3436     ac_tr_lib=HAVE_LIB`echo seq | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3437     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3438   cat >> confdefs.h <<EOF
3439 #define $ac_tr_lib 1
3440 EOF
3441
3442   LIBS="-lseq $LIBS"
3443
3444 else
3445   echo "$ac_t""no" 1>&6
3446 fi
3447
3448 fi
3449 # save Tk results and reset for Expect
3450 EXP_AND_TK_LIBS=$LIBS
3451 LIBS=$EXP_LIBS
3452
3453 ######################################################################
3454 # Check for FreeBSD/NetBSD openpty()
3455 # CYGNUS LOCAL: Don't do this on Linux.  Alpha Linux Red Hat 4.2 has
3456 # openpty, but it doesn't work correctly.
3457 case "${host}" in
3458 *-*-linux*) ;;
3459 *-*-cygwin*)
3460   EXP_AND_TCL_LIBS="$EXP_AND_TCL_LIBS -luser32" ;;
3461 *)
3462   unset ac_cv_func_openpty
3463   echo $ac_n "checking for openpty""... $ac_c" 1>&6
3464 echo "configure:3465: checking for openpty" >&5
3465 if eval "test \"`echo '$''{'ac_cv_func_openpty'+set}'`\" = set"; then
3466   echo $ac_n "(cached) $ac_c" 1>&6
3467 else
3468   cat > conftest.$ac_ext <<EOF
3469 #line 3470 "configure"
3470 #include "confdefs.h"
3471 /* System header to define __stub macros and hopefully few prototypes,
3472     which can conflict with char openpty(); below.  */
3473 #include <assert.h>
3474 /* Override any gcc2 internal prototype to avoid an error.  */
3475 /* We use char because int might match the return type of a gcc2
3476     builtin and then its argument prototype would still apply.  */
3477 char openpty();
3478
3479 int main() {
3480
3481 /* The GNU C library defines this for functions which it implements
3482     to always fail with ENOSYS.  Some functions are actually named
3483     something starting with __ and the normal name is an alias.  */
3484 #if defined (__stub_openpty) || defined (__stub___openpty)
3485 choke me
3486 #else
3487 openpty();
3488 #endif
3489
3490 ; return 0; }
3491 EOF
3492 if { (eval echo configure:3493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3493   rm -rf conftest*
3494   eval "ac_cv_func_openpty=yes"
3495 else
3496   echo "configure: failed program was:" >&5
3497   cat conftest.$ac_ext >&5
3498   rm -rf conftest*
3499   eval "ac_cv_func_openpty=no"
3500 fi
3501 rm -f conftest*
3502 fi
3503
3504 if eval "test \"`echo '$ac_cv_func_'openpty`\" = yes"; then
3505   echo "$ac_t""yes" 1>&6
3506   openpty=1 
3507 else
3508   echo "$ac_t""no" 1>&6
3509 openpty=0
3510 fi
3511
3512   if test $openpty -eq 0 ; then
3513     unset ac_cv_lib_util_openpty
3514     echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6
3515 echo "configure:3516: checking for openpty in -lutil" >&5
3516 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'`
3517 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3518   echo $ac_n "(cached) $ac_c" 1>&6
3519 else
3520   ac_save_LIBS="$LIBS"
3521 LIBS="-lutil  $LIBS"
3522 cat > conftest.$ac_ext <<EOF
3523 #line 3524 "configure"
3524 #include "confdefs.h"
3525 /* Override any gcc2 internal prototype to avoid an error.  */
3526 /* We use char because int might match the return type of a gcc2
3527     builtin and then its argument prototype would still apply.  */
3528 char openpty();
3529
3530 int main() {
3531 openpty()
3532 ; return 0; }
3533 EOF
3534 if { (eval echo configure:3535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3535   rm -rf conftest*
3536   eval "ac_cv_lib_$ac_lib_var=yes"
3537 else
3538   echo "configure: failed program was:" >&5
3539   cat conftest.$ac_ext >&5
3540   rm -rf conftest*
3541   eval "ac_cv_lib_$ac_lib_var=no"
3542 fi
3543 rm -f conftest*
3544 LIBS="$ac_save_LIBS"
3545
3546 fi
3547 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3548   echo "$ac_t""yes" 1>&6
3549   
3550           # we only need to define OPENPTY once, but since we are overriding
3551           # the default behavior, we must also handle augment LIBS too.
3552           # This needn't be done in the 2nd and 3rd tests.
3553           cat >> confdefs.h <<\EOF
3554 #define HAVE_OPENPTY 1
3555 EOF
3556
3557           LIBS="$LIBS -lutil"
3558     
3559 else
3560   echo "$ac_t""no" 1>&6
3561 fi
3562
3563   fi
3564   # save results and retry for Tcl
3565   EXP_LIBS=$LIBS
3566   LIBS=$EXP_AND_TCL_LIBS
3567   unset ac_cv_func_openpty
3568   echo $ac_n "checking for openpty""... $ac_c" 1>&6
3569 echo "configure:3570: checking for openpty" >&5
3570 if eval "test \"`echo '$''{'ac_cv_func_openpty'+set}'`\" = set"; then
3571   echo $ac_n "(cached) $ac_c" 1>&6
3572 else
3573   cat > conftest.$ac_ext <<EOF
3574 #line 3575 "configure"
3575 #include "confdefs.h"
3576 /* System header to define __stub macros and hopefully few prototypes,
3577     which can conflict with char openpty(); below.  */
3578 #include <assert.h>
3579 /* Override any gcc2 internal prototype to avoid an error.  */
3580 /* We use char because int might match the return type of a gcc2
3581     builtin and then its argument prototype would still apply.  */
3582 char openpty();
3583
3584 int main() {
3585
3586 /* The GNU C library defines this for functions which it implements
3587     to always fail with ENOSYS.  Some functions are actually named
3588     something starting with __ and the normal name is an alias.  */
3589 #if defined (__stub_openpty) || defined (__stub___openpty)
3590 choke me
3591 #else
3592 openpty();
3593 #endif
3594
3595 ; return 0; }
3596 EOF
3597 if { (eval echo configure:3598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3598   rm -rf conftest*
3599   eval "ac_cv_func_openpty=yes"
3600 else
3601   echo "configure: failed program was:" >&5
3602   cat conftest.$ac_ext >&5
3603   rm -rf conftest*
3604   eval "ac_cv_func_openpty=no"
3605 fi
3606 rm -f conftest*
3607 fi
3608
3609 if eval "test \"`echo '$ac_cv_func_'openpty`\" = yes"; then
3610   echo "$ac_t""yes" 1>&6
3611   openpty=1 
3612 else
3613   echo "$ac_t""no" 1>&6
3614 openpty=0
3615 fi
3616
3617   if test $openpty -eq 0 ; then
3618     unset ac_cv_lib_util_openpty
3619     echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6
3620 echo "configure:3621: checking for openpty in -lutil" >&5
3621 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'`
3622 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3623   echo $ac_n "(cached) $ac_c" 1>&6
3624 else
3625   ac_save_LIBS="$LIBS"
3626 LIBS="-lutil  $LIBS"
3627 cat > conftest.$ac_ext <<EOF
3628 #line 3629 "configure"
3629 #include "confdefs.h"
3630 /* Override any gcc2 internal prototype to avoid an error.  */
3631 /* We use char because int might match the return type of a gcc2
3632     builtin and then its argument prototype would still apply.  */
3633 char openpty();
3634
3635 int main() {
3636 openpty()
3637 ; return 0; }
3638 EOF
3639 if { (eval echo configure:3640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3640   rm -rf conftest*
3641   eval "ac_cv_lib_$ac_lib_var=yes"
3642 else
3643   echo "configure: failed program was:" >&5
3644   cat conftest.$ac_ext >&5
3645   rm -rf conftest*
3646   eval "ac_cv_lib_$ac_lib_var=no"
3647 fi
3648 rm -f conftest*
3649 LIBS="$ac_save_LIBS"
3650
3651 fi
3652 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3653   echo "$ac_t""yes" 1>&6
3654   
3655         cat >> confdefs.h <<\EOF
3656 #define HAVE_OPENPTY 1
3657 EOF
3658
3659         LIBS="$LIBS -lutil"
3660     
3661 else
3662   echo "$ac_t""no" 1>&6
3663 fi
3664
3665   fi
3666   # save Tcl results and retry for Tk
3667   EXP_AND_TCL_LIBS=$LIBS
3668   LIBS=$EXP_AND_TK_LIBS
3669   unset ac_cv_func_openpty
3670   echo $ac_n "checking for openpty""... $ac_c" 1>&6
3671 echo "configure:3672: checking for openpty" >&5
3672 if eval "test \"`echo '$''{'ac_cv_func_openpty'+set}'`\" = set"; then
3673   echo $ac_n "(cached) $ac_c" 1>&6
3674 else
3675   cat > conftest.$ac_ext <<EOF
3676 #line 3677 "configure"
3677 #include "confdefs.h"
3678 /* System header to define __stub macros and hopefully few prototypes,
3679     which can conflict with char openpty(); below.  */
3680 #include <assert.h>
3681 /* Override any gcc2 internal prototype to avoid an error.  */
3682 /* We use char because int might match the return type of a gcc2
3683     builtin and then its argument prototype would still apply.  */
3684 char openpty();
3685
3686 int main() {
3687
3688 /* The GNU C library defines this for functions which it implements
3689     to always fail with ENOSYS.  Some functions are actually named
3690     something starting with __ and the normal name is an alias.  */
3691 #if defined (__stub_openpty) || defined (__stub___openpty)
3692 choke me
3693 #else
3694 openpty();
3695 #endif
3696
3697 ; return 0; }
3698 EOF
3699 if { (eval echo configure:3700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3700   rm -rf conftest*
3701   eval "ac_cv_func_openpty=yes"
3702 else
3703   echo "configure: failed program was:" >&5
3704   cat conftest.$ac_ext >&5
3705   rm -rf conftest*
3706   eval "ac_cv_func_openpty=no"
3707 fi
3708 rm -f conftest*
3709 fi
3710
3711 if eval "test \"`echo '$ac_cv_func_'openpty`\" = yes"; then
3712   echo "$ac_t""yes" 1>&6
3713   openpty=1 
3714 else
3715   echo "$ac_t""no" 1>&6
3716 openpty=0
3717 fi
3718
3719   if test $openpty -eq 0 ; then
3720     unset ac_cv_lib_util_openpty
3721     echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6
3722 echo "configure:3723: checking for openpty in -lutil" >&5
3723 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'`
3724 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3725   echo $ac_n "(cached) $ac_c" 1>&6
3726 else
3727   ac_save_LIBS="$LIBS"
3728 LIBS="-lutil  $LIBS"
3729 cat > conftest.$ac_ext <<EOF
3730 #line 3731 "configure"
3731 #include "confdefs.h"
3732 /* Override any gcc2 internal prototype to avoid an error.  */
3733 /* We use char because int might match the return type of a gcc2
3734     builtin and then its argument prototype would still apply.  */
3735 char openpty();
3736
3737 int main() {
3738 openpty()
3739 ; return 0; }
3740 EOF
3741 if { (eval echo configure:3742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3742   rm -rf conftest*
3743   eval "ac_cv_lib_$ac_lib_var=yes"
3744 else
3745   echo "configure: failed program was:" >&5
3746   cat conftest.$ac_ext >&5
3747   rm -rf conftest*
3748   eval "ac_cv_lib_$ac_lib_var=no"
3749 fi
3750 rm -f conftest*
3751 LIBS="$ac_save_LIBS"
3752
3753 fi
3754 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3755   echo "$ac_t""yes" 1>&6
3756   
3757         cat >> confdefs.h <<\EOF
3758 #define HAVE_OPENPTY 1
3759 EOF
3760
3761         LIBS="$LIBS -lutil"
3762     
3763 else
3764   echo "$ac_t""no" 1>&6
3765 fi
3766
3767   fi
3768   # save Tk results and reset for Expect
3769   EXP_AND_TK_LIBS=$LIBS
3770   LIBS=$EXP_LIBS
3771 ;;
3772 esac
3773
3774 ######################################################################
3775 # End of library/func checking
3776 ######################################################################
3777
3778 ######################################################################
3779 #
3780 # Look for various header files
3781 #
3782 ac_safe=`echo "sys/sysmacros.h" | sed 'y%./+-%__p_%'`
3783 echo $ac_n "checking for sys/sysmacros.h""... $ac_c" 1>&6
3784 echo "configure:3785: checking for sys/sysmacros.h" >&5
3785 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3786   echo $ac_n "(cached) $ac_c" 1>&6
3787 else
3788   cat > conftest.$ac_ext <<EOF
3789 #line 3790 "configure"
3790 #include "confdefs.h"
3791 #include <sys/sysmacros.h>
3792 EOF
3793 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3794 { (eval echo configure:3795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3795 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3796 if test -z "$ac_err"; then
3797   rm -rf conftest*
3798   eval "ac_cv_header_$ac_safe=yes"
3799 else
3800   echo "$ac_err" >&5
3801   echo "configure: failed program was:" >&5
3802   cat conftest.$ac_ext >&5
3803   rm -rf conftest*
3804   eval "ac_cv_header_$ac_safe=no"
3805 fi
3806 rm -f conftest*
3807 fi
3808 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3809   echo "$ac_t""yes" 1>&6
3810   cat >> confdefs.h <<\EOF
3811 #define HAVE_SYSMACROS_H 1
3812 EOF
3813
3814 else
3815   echo "$ac_t""no" 1>&6
3816 fi
3817
3818 ac_safe=`echo "stdlib.h" | sed 'y%./+-%__p_%'`
3819 echo $ac_n "checking for stdlib.h""... $ac_c" 1>&6
3820 echo "configure:3821: checking for stdlib.h" >&5
3821 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3822   echo $ac_n "(cached) $ac_c" 1>&6
3823 else
3824   cat > conftest.$ac_ext <<EOF
3825 #line 3826 "configure"
3826 #include "confdefs.h"
3827 #include <stdlib.h>
3828 EOF
3829 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3830 { (eval echo configure:3831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3831 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3832 if test -z "$ac_err"; then
3833   rm -rf conftest*
3834   eval "ac_cv_header_$ac_safe=yes"
3835 else
3836   echo "$ac_err" >&5
3837   echo "configure: failed program was:" >&5
3838   cat conftest.$ac_ext >&5
3839   rm -rf conftest*
3840   eval "ac_cv_header_$ac_safe=no"
3841 fi
3842 rm -f conftest*
3843 fi
3844 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3845   echo "$ac_t""yes" 1>&6
3846   :
3847 else
3848   echo "$ac_t""no" 1>&6
3849 cat >> confdefs.h <<\EOF
3850 #define NO_STDLIB_H 1
3851 EOF
3852
3853 fi
3854
3855
3856 #
3857 # Look for inttypes.h. Sometimes there are data type conflicts
3858 # with sys/types.h, so we have to use our own special test.
3859 #
3860 echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6
3861 echo "configure:3862: checking for inttypes.h" >&5
3862 if eval "test \"`echo '$''{'ac_cv_inttypes_h'+set}'`\" = set"; then
3863   echo $ac_n "(cached) $ac_c" 1>&6
3864 else
3865   cat > conftest.$ac_ext <<EOF
3866 #line 3867 "configure"
3867 #include "confdefs.h"
3868
3869   #include <sys/types.h>
3870   #include <inttypes.h>
3871 int main() {
3872
3873   int16_t x = 0;
3874   
3875 ; return 0; }
3876 EOF
3877 if { (eval echo configure:3878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3878   rm -rf conftest*
3879   ac_cv_inttypes_h="yes"
3880 else
3881   echo "configure: failed program was:" >&5
3882   cat conftest.$ac_ext >&5
3883   rm -rf conftest*
3884   ac_cv_inttypes_h="no"
3885 fi
3886 rm -f conftest*
3887 fi
3888
3889 echo "$ac_t""$ac_cv_inttypes_h" 1>&6
3890 if test x"${ac_cv_inttypes_h}" = x"yes"; then
3891   cat >> confdefs.h <<\EOF
3892 #define HAVE_INTTYPES_H 1
3893 EOF
3894
3895 fi
3896
3897
3898 # Oddly, some systems have stdarg but don't support prototypes
3899 # Tcl avoids the whole issue by not using stdarg on UNIX at all!
3900
3901 ac_safe=`echo "varargs.h" | sed 'y%./+-%__p_%'`
3902 echo $ac_n "checking for varargs.h""... $ac_c" 1>&6
3903 echo "configure:3904: checking for varargs.h" >&5
3904 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3905   echo $ac_n "(cached) $ac_c" 1>&6
3906 else
3907   cat > conftest.$ac_ext <<EOF
3908 #line 3909 "configure"
3909 #include "confdefs.h"
3910 #include <varargs.h>
3911 EOF
3912 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3913 { (eval echo configure:3914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3914 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3915 if test -z "$ac_err"; then
3916   rm -rf conftest*
3917   eval "ac_cv_header_$ac_safe=yes"
3918 else
3919   echo "$ac_err" >&5
3920   echo "configure: failed program was:" >&5
3921   cat conftest.$ac_ext >&5
3922   rm -rf conftest*
3923   eval "ac_cv_header_$ac_safe=no"
3924 fi
3925 rm -f conftest*
3926 fi
3927 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3928   echo "$ac_t""yes" 1>&6
3929   cat >> confdefs.h <<\EOF
3930 #define HAVE_VARARGS_H 1
3931 EOF
3932
3933 else
3934   echo "$ac_t""no" 1>&6
3935 fi
3936
3937 ac_safe=`echo "unistd.h" | sed 'y%./+-%__p_%'`
3938 echo $ac_n "checking for unistd.h""... $ac_c" 1>&6
3939 echo "configure:3940: checking for unistd.h" >&5
3940 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3941   echo $ac_n "(cached) $ac_c" 1>&6
3942 else
3943   cat > conftest.$ac_ext <<EOF
3944 #line 3945 "configure"
3945 #include "confdefs.h"
3946 #include <unistd.h>
3947 EOF
3948 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3949 { (eval echo configure:3950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3950 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3951 if test -z "$ac_err"; then
3952   rm -rf conftest*
3953   eval "ac_cv_header_$ac_safe=yes"
3954 else
3955   echo "$ac_err" >&5
3956   echo "configure: failed program was:" >&5
3957   cat conftest.$ac_ext >&5
3958   rm -rf conftest*
3959   eval "ac_cv_header_$ac_safe=no"
3960 fi
3961 rm -f conftest*
3962 fi
3963 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3964   echo "$ac_t""yes" 1>&6
3965   cat >> confdefs.h <<\EOF
3966 #define HAVE_UNISTD_H 1
3967 EOF
3968
3969 else
3970   echo "$ac_t""no" 1>&6
3971 fi
3972
3973 ac_safe=`echo "sys/stropts.h" | sed 'y%./+-%__p_%'`
3974 echo $ac_n "checking for sys/stropts.h""... $ac_c" 1>&6
3975 echo "configure:3976: checking for sys/stropts.h" >&5
3976 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3977   echo $ac_n "(cached) $ac_c" 1>&6
3978 else
3979   cat > conftest.$ac_ext <<EOF
3980 #line 3981 "configure"
3981 #include "confdefs.h"
3982 #include <sys/stropts.h>
3983 EOF
3984 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3985 { (eval echo configure:3986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3986 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3987 if test -z "$ac_err"; then
3988   rm -rf conftest*
3989   eval "ac_cv_header_$ac_safe=yes"
3990 else
3991   echo "$ac_err" >&5
3992   echo "configure: failed program was:" >&5
3993   cat conftest.$ac_ext >&5
3994   rm -rf conftest*
3995   eval "ac_cv_header_$ac_safe=no"
3996 fi
3997 rm -f conftest*
3998 fi
3999 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4000   echo "$ac_t""yes" 1>&6
4001   cat >> confdefs.h <<\EOF
4002 #define HAVE_STROPTS_H 1
4003 EOF
4004
4005 else
4006   echo "$ac_t""no" 1>&6
4007 fi
4008
4009 ac_safe=`echo "sys/sysconfig.h" | sed 'y%./+-%__p_%'`
4010 echo $ac_n "checking for sys/sysconfig.h""... $ac_c" 1>&6
4011 echo "configure:4012: checking for sys/sysconfig.h" >&5
4012 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4013   echo $ac_n "(cached) $ac_c" 1>&6
4014 else
4015   cat > conftest.$ac_ext <<EOF
4016 #line 4017 "configure"
4017 #include "confdefs.h"
4018 #include <sys/sysconfig.h>
4019 EOF
4020 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4021 { (eval echo configure:4022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4022 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4023 if test -z "$ac_err"; then
4024   rm -rf conftest*
4025   eval "ac_cv_header_$ac_safe=yes"
4026 else
4027   echo "$ac_err" >&5
4028   echo "configure: failed program was:" >&5
4029   cat conftest.$ac_ext >&5
4030   rm -rf conftest*
4031   eval "ac_cv_header_$ac_safe=no"
4032 fi
4033 rm -f conftest*
4034 fi
4035 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4036   echo "$ac_t""yes" 1>&6
4037   cat >> confdefs.h <<\EOF
4038 #define HAVE_SYSCONF_H 1
4039 EOF
4040
4041 else
4042   echo "$ac_t""no" 1>&6
4043 fi
4044
4045 ac_safe=`echo "sys/fcntl.h" | sed 'y%./+-%__p_%'`
4046 echo $ac_n "checking for sys/fcntl.h""... $ac_c" 1>&6
4047 echo "configure:4048: checking for sys/fcntl.h" >&5
4048 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4049   echo $ac_n "(cached) $ac_c" 1>&6
4050 else
4051   cat > conftest.$ac_ext <<EOF
4052 #line 4053 "configure"
4053 #include "confdefs.h"
4054 #include <sys/fcntl.h>
4055 EOF
4056 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4057 { (eval echo configure:4058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4058 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4059 if test -z "$ac_err"; then
4060   rm -rf conftest*
4061   eval "ac_cv_header_$ac_safe=yes"
4062 else
4063   echo "$ac_err" >&5
4064   echo "configure: failed program was:" >&5
4065   cat conftest.$ac_ext >&5
4066   rm -rf conftest*
4067   eval "ac_cv_header_$ac_safe=no"
4068 fi
4069 rm -f conftest*
4070 fi
4071 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4072   echo "$ac_t""yes" 1>&6
4073   cat >> confdefs.h <<\EOF
4074 #define HAVE_SYS_FCNTL_H 1
4075 EOF
4076
4077 else
4078   echo "$ac_t""no" 1>&6
4079 fi
4080
4081 ac_safe=`echo "sys/select.h" | sed 'y%./+-%__p_%'`
4082 echo $ac_n "checking for sys/select.h""... $ac_c" 1>&6
4083 echo "configure:4084: checking for sys/select.h" >&5
4084 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4085   echo $ac_n "(cached) $ac_c" 1>&6
4086 else
4087   cat > conftest.$ac_ext <<EOF
4088 #line 4089 "configure"
4089 #include "confdefs.h"
4090 #include <sys/select.h>
4091 EOF
4092 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4093 { (eval echo configure:4094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4094 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4095 if test -z "$ac_err"; then
4096   rm -rf conftest*
4097   eval "ac_cv_header_$ac_safe=yes"
4098 else
4099   echo "$ac_err" >&5
4100   echo "configure: failed program was:" >&5
4101   cat conftest.$ac_ext >&5
4102   rm -rf conftest*
4103   eval "ac_cv_header_$ac_safe=no"
4104 fi
4105 rm -f conftest*
4106 fi
4107 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4108   echo "$ac_t""yes" 1>&6
4109   cat >> confdefs.h <<\EOF
4110 #define HAVE_SYS_SELECT_H 1
4111 EOF
4112
4113 else
4114   echo "$ac_t""no" 1>&6
4115 fi
4116
4117 ac_safe=`echo "sys/time.h" | sed 'y%./+-%__p_%'`
4118 echo $ac_n "checking for sys/time.h""... $ac_c" 1>&6
4119 echo "configure:4120: checking for sys/time.h" >&5
4120 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4121   echo $ac_n "(cached) $ac_c" 1>&6
4122 else
4123   cat > conftest.$ac_ext <<EOF
4124 #line 4125 "configure"
4125 #include "confdefs.h"
4126 #include <sys/time.h>
4127 EOF
4128 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4129 { (eval echo configure:4130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4130 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4131 if test -z "$ac_err"; then
4132   rm -rf conftest*
4133   eval "ac_cv_header_$ac_safe=yes"
4134 else
4135   echo "$ac_err" >&5
4136   echo "configure: failed program was:" >&5
4137   cat conftest.$ac_ext >&5
4138   rm -rf conftest*
4139   eval "ac_cv_header_$ac_safe=no"
4140 fi
4141 rm -f conftest*
4142 fi
4143 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4144   echo "$ac_t""yes" 1>&6
4145   cat >> confdefs.h <<\EOF
4146 #define HAVE_SYS_TIME_H 1
4147 EOF
4148
4149 else
4150   echo "$ac_t""no" 1>&6
4151 fi
4152
4153 ac_safe=`echo "sys/ptem.h" | sed 'y%./+-%__p_%'`
4154 echo $ac_n "checking for sys/ptem.h""... $ac_c" 1>&6
4155 echo "configure:4156: checking for sys/ptem.h" >&5
4156 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4157   echo $ac_n "(cached) $ac_c" 1>&6
4158 else
4159   cat > conftest.$ac_ext <<EOF
4160 #line 4161 "configure"
4161 #include "confdefs.h"
4162 #include <sys/ptem.h>
4163 EOF
4164 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4165 { (eval echo configure:4166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4166 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4167 if test -z "$ac_err"; then
4168   rm -rf conftest*
4169   eval "ac_cv_header_$ac_safe=yes"
4170 else
4171   echo "$ac_err" >&5
4172   echo "configure: failed program was:" >&5
4173   cat conftest.$ac_ext >&5
4174   rm -rf conftest*
4175   eval "ac_cv_header_$ac_safe=no"
4176 fi
4177 rm -f conftest*
4178 fi
4179 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4180   echo "$ac_t""yes" 1>&6
4181   cat >> confdefs.h <<\EOF
4182 #define HAVE_SYS_PTEM_H 1
4183 EOF
4184
4185 else
4186   echo "$ac_t""no" 1>&6
4187 fi
4188
4189 ac_safe=`echo "sys/strredir.h" | sed 'y%./+-%__p_%'`
4190 echo $ac_n "checking for sys/strredir.h""... $ac_c" 1>&6
4191 echo "configure:4192: checking for sys/strredir.h" >&5
4192 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4193   echo $ac_n "(cached) $ac_c" 1>&6
4194 else
4195   cat > conftest.$ac_ext <<EOF
4196 #line 4197 "configure"
4197 #include "confdefs.h"
4198 #include <sys/strredir.h>
4199 EOF
4200 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4201 { (eval echo configure:4202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4202 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4203 if test -z "$ac_err"; then
4204   rm -rf conftest*
4205   eval "ac_cv_header_$ac_safe=yes"
4206 else
4207   echo "$ac_err" >&5
4208   echo "configure: failed program was:" >&5
4209   cat conftest.$ac_ext >&5
4210   rm -rf conftest*
4211   eval "ac_cv_header_$ac_safe=no"
4212 fi
4213 rm -f conftest*
4214 fi
4215 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4216   echo "$ac_t""yes" 1>&6
4217   cat >> confdefs.h <<\EOF
4218 #define HAVE_STRREDIR_H 1
4219 EOF
4220
4221 else
4222   echo "$ac_t""no" 1>&6
4223 fi
4224
4225 ac_safe=`echo "sys/strpty.h" | sed 'y%./+-%__p_%'`
4226 echo $ac_n "checking for sys/strpty.h""... $ac_c" 1>&6
4227 echo "configure:4228: checking for sys/strpty.h" >&5
4228 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4229   echo $ac_n "(cached) $ac_c" 1>&6
4230 else
4231   cat > conftest.$ac_ext <<EOF
4232 #line 4233 "configure"
4233 #include "confdefs.h"
4234 #include <sys/strpty.h>
4235 EOF
4236 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4237 { (eval echo configure:4238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4238 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4239 if test -z "$ac_err"; then
4240   rm -rf conftest*
4241   eval "ac_cv_header_$ac_safe=yes"
4242 else
4243   echo "$ac_err" >&5
4244   echo "configure: failed program was:" >&5
4245   cat conftest.$ac_ext >&5
4246   rm -rf conftest*
4247   eval "ac_cv_header_$ac_safe=no"
4248 fi
4249 rm -f conftest*
4250 fi
4251 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4252   echo "$ac_t""yes" 1>&6
4253   cat >> confdefs.h <<\EOF
4254 #define HAVE_STRPTY_H 1
4255 EOF
4256
4257 else
4258   echo "$ac_t""no" 1>&6
4259 fi
4260
4261
4262
4263 echo $ac_n "checking for sys/bsdtypes.h""... $ac_c" 1>&6
4264 echo "configure:4265: checking for sys/bsdtypes.h" >&5
4265 if test "ISC_${ISC}" = "ISC_1"   ;    then
4266    echo "$ac_t""yes" 1>&6
4267    # if on ISC 1, we need <sys/bsdtypes.h> to get FD_SET macros
4268    for ac_hdr in sys/bsdtypes.h
4269 do
4270 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4271 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4272 echo "configure:4273: checking for $ac_hdr" >&5
4273 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4274   echo $ac_n "(cached) $ac_c" 1>&6
4275 else
4276   cat > conftest.$ac_ext <<EOF
4277 #line 4278 "configure"
4278 #include "confdefs.h"
4279 #include <$ac_hdr>
4280 EOF
4281 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4282 { (eval echo configure:4283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4283 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4284 if test -z "$ac_err"; then
4285   rm -rf conftest*
4286   eval "ac_cv_header_$ac_safe=yes"
4287 else
4288   echo "$ac_err" >&5
4289   echo "configure: failed program was:" >&5
4290   cat conftest.$ac_ext >&5
4291   rm -rf conftest*
4292   eval "ac_cv_header_$ac_safe=no"
4293 fi
4294 rm -f conftest*
4295 fi
4296 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4297   echo "$ac_t""yes" 1>&6
4298     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4299   cat >> confdefs.h <<EOF
4300 #define $ac_tr_hdr 1
4301 EOF
4302  
4303 else
4304   echo "$ac_t""no" 1>&6
4305 fi
4306 done
4307
4308 else
4309    echo "$ac_t""no" 1>&6
4310 fi
4311
4312 #
4313 # Look for functions that may be missing
4314 #
4315 echo $ac_n "checking for memmove""... $ac_c" 1>&6
4316 echo "configure:4317: checking for memmove" >&5
4317 if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then
4318   echo $ac_n "(cached) $ac_c" 1>&6
4319 else
4320   cat > conftest.$ac_ext <<EOF
4321 #line 4322 "configure"
4322 #include "confdefs.h"
4323 /* System header to define __stub macros and hopefully few prototypes,
4324     which can conflict with char memmove(); below.  */
4325 #include <assert.h>
4326 /* Override any gcc2 internal prototype to avoid an error.  */
4327 /* We use char because int might match the return type of a gcc2
4328     builtin and then its argument prototype would still apply.  */
4329 char memmove();
4330
4331 int main() {
4332
4333 /* The GNU C library defines this for functions which it implements
4334     to always fail with ENOSYS.  Some functions are actually named
4335     something starting with __ and the normal name is an alias.  */
4336 #if defined (__stub_memmove) || defined (__stub___memmove)
4337 choke me
4338 #else
4339 memmove();
4340 #endif
4341
4342 ; return 0; }
4343 EOF
4344 if { (eval echo configure:4345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4345   rm -rf conftest*
4346   eval "ac_cv_func_memmove=yes"
4347 else
4348   echo "configure: failed program was:" >&5
4349   cat conftest.$ac_ext >&5
4350   rm -rf conftest*
4351   eval "ac_cv_func_memmove=no"
4352 fi
4353 rm -f conftest*
4354 fi
4355
4356 if eval "test \"`echo '$ac_cv_func_'memmove`\" = yes"; then
4357   echo "$ac_t""yes" 1>&6
4358   cat >> confdefs.h <<\EOF
4359 #define HAVE_MEMMOVE 1
4360 EOF
4361
4362 else
4363   echo "$ac_t""no" 1>&6
4364 fi
4365
4366 echo $ac_n "checking for sysconf""... $ac_c" 1>&6
4367 echo "configure:4368: checking for sysconf" >&5
4368 if eval "test \"`echo '$''{'ac_cv_func_sysconf'+set}'`\" = set"; then
4369   echo $ac_n "(cached) $ac_c" 1>&6
4370 else
4371   cat > conftest.$ac_ext <<EOF
4372 #line 4373 "configure"
4373 #include "confdefs.h"
4374 /* System header to define __stub macros and hopefully few prototypes,
4375     which can conflict with char sysconf(); below.  */
4376 #include <assert.h>
4377 /* Override any gcc2 internal prototype to avoid an error.  */
4378 /* We use char because int might match the return type of a gcc2
4379     builtin and then its argument prototype would still apply.  */
4380 char sysconf();
4381
4382 int main() {
4383
4384 /* The GNU C library defines this for functions which it implements
4385     to always fail with ENOSYS.  Some functions are actually named
4386     something starting with __ and the normal name is an alias.  */
4387 #if defined (__stub_sysconf) || defined (__stub___sysconf)
4388 choke me
4389 #else
4390 sysconf();
4391 #endif
4392
4393 ; return 0; }
4394 EOF
4395 if { (eval echo configure:4396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4396   rm -rf conftest*
4397   eval "ac_cv_func_sysconf=yes"
4398 else
4399   echo "configure: failed program was:" >&5
4400   cat conftest.$ac_ext >&5
4401   rm -rf conftest*
4402   eval "ac_cv_func_sysconf=no"
4403 fi
4404 rm -f conftest*
4405 fi
4406
4407 if eval "test \"`echo '$ac_cv_func_'sysconf`\" = yes"; then
4408   echo "$ac_t""yes" 1>&6
4409   cat >> confdefs.h <<\EOF
4410 #define HAVE_SYSCONF 1
4411 EOF
4412
4413 else
4414   echo "$ac_t""no" 1>&6
4415 fi
4416
4417 echo $ac_n "checking for strftime""... $ac_c" 1>&6
4418 echo "configure:4419: checking for strftime" >&5
4419 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
4420   echo $ac_n "(cached) $ac_c" 1>&6
4421 else
4422   cat > conftest.$ac_ext <<EOF
4423 #line 4424 "configure"
4424 #include "confdefs.h"
4425 /* System header to define __stub macros and hopefully few prototypes,
4426     which can conflict with char strftime(); below.  */
4427 #include <assert.h>
4428 /* Override any gcc2 internal prototype to avoid an error.  */
4429 /* We use char because int might match the return type of a gcc2
4430     builtin and then its argument prototype would still apply.  */
4431 char strftime();
4432
4433 int main() {
4434
4435 /* The GNU C library defines this for functions which it implements
4436     to always fail with ENOSYS.  Some functions are actually named
4437     something starting with __ and the normal name is an alias.  */
4438 #if defined (__stub_strftime) || defined (__stub___strftime)
4439 choke me
4440 #else
4441 strftime();
4442 #endif
4443
4444 ; return 0; }
4445 EOF
4446 if { (eval echo configure:4447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4447   rm -rf conftest*
4448   eval "ac_cv_func_strftime=yes"
4449 else
4450   echo "configure: failed program was:" >&5
4451   cat conftest.$ac_ext >&5
4452   rm -rf conftest*
4453   eval "ac_cv_func_strftime=no"
4454 fi
4455 rm -f conftest*
4456 fi
4457
4458 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
4459   echo "$ac_t""yes" 1>&6
4460   cat >> confdefs.h <<\EOF
4461 #define HAVE_STRFTIME 1
4462 EOF
4463
4464 else
4465   echo "$ac_t""no" 1>&6
4466 fi
4467
4468 echo $ac_n "checking for strchr""... $ac_c" 1>&6
4469 echo "configure:4470: checking for strchr" >&5
4470 if eval "test \"`echo '$''{'ac_cv_func_strchr'+set}'`\" = set"; then
4471   echo $ac_n "(cached) $ac_c" 1>&6
4472 else
4473   cat > conftest.$ac_ext <<EOF
4474 #line 4475 "configure"
4475 #include "confdefs.h"
4476 /* System header to define __stub macros and hopefully few prototypes,
4477     which can conflict with char strchr(); below.  */
4478 #include <assert.h>
4479 /* Override any gcc2 internal prototype to avoid an error.  */
4480 /* We use char because int might match the return type of a gcc2
4481     builtin and then its argument prototype would still apply.  */
4482 char strchr();
4483
4484 int main() {
4485
4486 /* The GNU C library defines this for functions which it implements
4487     to always fail with ENOSYS.  Some functions are actually named
4488     something starting with __ and the normal name is an alias.  */
4489 #if defined (__stub_strchr) || defined (__stub___strchr)
4490 choke me
4491 #else
4492 strchr();
4493 #endif
4494
4495 ; return 0; }
4496 EOF
4497 if { (eval echo configure:4498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4498   rm -rf conftest*
4499   eval "ac_cv_func_strchr=yes"
4500 else
4501   echo "configure: failed program was:" >&5
4502   cat conftest.$ac_ext >&5
4503   rm -rf conftest*
4504   eval "ac_cv_func_strchr=no"
4505 fi
4506 rm -f conftest*
4507 fi
4508
4509 if eval "test \"`echo '$ac_cv_func_'strchr`\" = yes"; then
4510   echo "$ac_t""yes" 1>&6
4511   cat >> confdefs.h <<\EOF
4512 #define HAVE_STRCHR 1
4513 EOF
4514
4515 else
4516   echo "$ac_t""no" 1>&6
4517 fi
4518
4519 echo $ac_n "checking for timezone""... $ac_c" 1>&6
4520 echo "configure:4521: checking for timezone" >&5
4521 if eval "test \"`echo '$''{'ac_cv_func_timezone'+set}'`\" = set"; then
4522   echo $ac_n "(cached) $ac_c" 1>&6
4523 else
4524   cat > conftest.$ac_ext <<EOF
4525 #line 4526 "configure"
4526 #include "confdefs.h"
4527 /* System header to define __stub macros and hopefully few prototypes,
4528     which can conflict with char timezone(); below.  */
4529 #include <assert.h>
4530 /* Override any gcc2 internal prototype to avoid an error.  */
4531 /* We use char because int might match the return type of a gcc2
4532     builtin and then its argument prototype would still apply.  */
4533 char timezone();
4534
4535 int main() {
4536
4537 /* The GNU C library defines this for functions which it implements
4538     to always fail with ENOSYS.  Some functions are actually named
4539     something starting with __ and the normal name is an alias.  */
4540 #if defined (__stub_timezone) || defined (__stub___timezone)
4541 choke me
4542 #else
4543 timezone();
4544 #endif
4545
4546 ; return 0; }
4547 EOF
4548 if { (eval echo configure:4549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4549   rm -rf conftest*
4550   eval "ac_cv_func_timezone=yes"
4551 else
4552   echo "configure: failed program was:" >&5
4553   cat conftest.$ac_ext >&5
4554   rm -rf conftest*
4555   eval "ac_cv_func_timezone=no"
4556 fi
4557 rm -f conftest*
4558 fi
4559
4560 if eval "test \"`echo '$ac_cv_func_'timezone`\" = yes"; then
4561   echo "$ac_t""yes" 1>&6
4562   cat >> confdefs.h <<\EOF
4563 #define HAVE_TIMEZONE 1
4564 EOF
4565
4566 else
4567   echo "$ac_t""no" 1>&6
4568 fi
4569
4570
4571 # dnl check for memcpy by hand
4572 # because Unixware 2.0 handles it specially and refuses to compile
4573 # autoconf's automatic test that is a call with no arguments
4574 echo $ac_n "checking for memcpy""... $ac_c" 1>&6
4575 echo "configure:4576: checking for memcpy" >&5
4576 cat > conftest.$ac_ext <<EOF
4577 #line 4578 "configure"
4578 #include "confdefs.h"
4579
4580 int main() {
4581
4582 char *s1, *s2;
4583 memcpy(s1,s2,0);
4584
4585 ; return 0; }
4586 EOF
4587 if { (eval echo configure:4588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4588   rm -rf conftest*
4589   echo "$ac_t""yes" 1>&6
4590         cat >> confdefs.h <<\EOF
4591 #define HAVE_MEMCPY 1
4592 EOF
4593
4594         
4595 else
4596   echo "configure: failed program was:" >&5
4597   cat conftest.$ac_ext >&5
4598   rm -rf conftest*
4599   echo "$ac_t""no" 1>&6
4600
4601 fi
4602 rm -f conftest*
4603
4604 # Some systems only define WNOHANG if _POSIX_SOURCE is defined
4605 # The following merely tests that sys/wait.h can be included
4606 # and if so that WNOHANG is not defined.  The only place I've
4607 # seen this is ISC.
4608 echo $ac_n "checking if WNOHANG requires _POSIX_SOURCE""... $ac_c" 1>&6
4609 echo "configure:4610: checking if WNOHANG requires _POSIX_SOURCE" >&5
4610 if test "$cross_compiling" = yes; then
4611   case "${host}" in
4612          *-*-cygwin*) echo "$ac_t""no" 1>&6 ;;
4613          *) { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; } ;;
4614          esac
4615
4616 else
4617   cat > conftest.$ac_ext <<EOF
4618 #line 4619 "configure"
4619 #include "confdefs.h"
4620
4621 #include <sys/wait.h>
4622 main() {
4623 #ifndef WNOHANG
4624         return 0;
4625 #else
4626         return 1;
4627 #endif
4628 }
4629 EOF
4630 if { (eval echo configure:4631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4631 then
4632   echo "$ac_t""yes" 1>&6
4633         cat >> confdefs.h <<\EOF
4634 #define WNOHANG_REQUIRES_POSIX_SOURCE 1
4635 EOF
4636
4637
4638 else
4639   echo "configure: failed program was:" >&5
4640   cat conftest.$ac_ext >&5
4641   rm -fr conftest*
4642   echo "$ac_t""no" 1>&6
4643
4644 fi
4645 rm -fr conftest*
4646 fi
4647
4648
4649 echo $ac_n "checking if any value exists for WNOHANG""... $ac_c" 1>&6
4650 echo "configure:4651: checking if any value exists for WNOHANG" >&5
4651 rm -rf wnohang
4652 if test "$cross_compiling" = yes; then
4653   case "${host}" in
4654          *-*-cygwin*) echo "$ac_t""yes" 1>&6
4655                         cat >> confdefs.h <<\EOF
4656 #define WNOHANG_BACKUP_VALUE 1
4657 EOF
4658  ;;
4659          *) { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; } ;;
4660          esac
4661
4662 else
4663   cat > conftest.$ac_ext <<EOF
4664 #line 4665 "configure"
4665 #include "confdefs.h"
4666
4667 #include <stdio.h>
4668 #include <sys/wait.h>
4669 main() {
4670 #ifdef WNOHANG
4671         FILE *fp = fopen("wnohang","w");
4672         fprintf(fp,"%d",WNOHANG);
4673         fclose(fp);
4674         return 0;
4675 #else
4676         return 1;
4677 #endif
4678 }
4679 EOF
4680 if { (eval echo configure:4681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4681 then
4682   echo "$ac_t""yes" 1>&6
4683         cat >> confdefs.h <<EOF
4684 #define WNOHANG_BACKUP_VALUE `cat wnohang`
4685 EOF
4686
4687         rm -f wnohang
4688
4689 else
4690   echo "configure: failed program was:" >&5
4691   cat conftest.$ac_ext >&5
4692   rm -fr conftest*
4693   echo "$ac_t""no" 1>&6
4694         cat >> confdefs.h <<\EOF
4695 #define WNOHANG_BACKUP_VALUE 1
4696 EOF
4697
4698
4699 fi
4700 rm -fr conftest*
4701 fi
4702
4703
4704 #
4705 # check how signals work
4706 #
4707
4708 # Check for the data type of the mask used in select().
4709 # This picks up HP braindamage which defines fd_set and then 
4710 # proceeds to ignore it and use int.
4711 # Pattern matching on int could be loosened.
4712 # Can't use ac_header_egrep since that doesn't see prototypes with K&R cpp.
4713 echo $ac_n "checking mask type of select""... $ac_c" 1>&6
4714 echo "configure:4715: checking mask type of select" >&5
4715 if egrep "select\(size_t, int" /usr/include/sys/time.h >/dev/null 2>&1; then
4716   echo "$ac_t""int" 1>&6
4717   cat >> confdefs.h <<\EOF
4718 #define SELECT_MASK_TYPE int
4719 EOF
4720
4721 else
4722   echo "$ac_t""none" 1>&6
4723 fi
4724
4725
4726 # FIXME: check if alarm exists
4727 echo $ac_n "checking if signals need to be re-armed""... $ac_c" 1>&6
4728 echo "configure:4729: checking if signals need to be re-armed" >&5
4729 if test "$cross_compiling" = yes; then
4730   case "${host}" in
4731          *-*-cygwin*) echo "$ac_t""no" 1>&6 ;;
4732          *) echo "configure: warning: Expect can't be cross compiled" 1>&2 ;;
4733          esac
4734
4735 else
4736   cat > conftest.$ac_ext <<EOF
4737 #line 4738 "configure"
4738 #include "confdefs.h"
4739
4740 #include <signal.h>
4741 #define RETSIGTYPE $retsigtype
4742
4743 int signal_rearms = 0;
4744
4745 RETSIGTYPE
4746 child_sigint_handler(n)
4747 int n;
4748 {
4749 }
4750
4751 RETSIGTYPE
4752 parent_sigint_handler(n)
4753 int n;
4754 {
4755 signal_rearms++;
4756 }
4757
4758 main()
4759 {
4760         signal(SIGINT,parent_sigint_handler);
4761
4762         if (0 == fork()) {
4763                 signal(SIGINT,child_sigint_handler);
4764                 kill(getpid(),SIGINT);
4765                 kill(getpid(),SIGINT);
4766                 kill(getppid(),SIGINT);
4767         } else {
4768                 int status;
4769
4770                 wait(&status);
4771                 unlink("core");
4772                 exit(signal_rearms);
4773         }
4774 }
4775 EOF
4776 if { (eval echo configure:4777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4777 then
4778   echo "$ac_t""yes" 1>&6
4779         cat >> confdefs.h <<\EOF
4780 #define REARM_SIG 1
4781 EOF
4782
4783
4784 else
4785   echo "configure: failed program was:" >&5
4786   cat conftest.$ac_ext >&5
4787   rm -fr conftest*
4788   echo "$ac_t""no" 1>&6
4789
4790 fi
4791 rm -fr conftest*
4792 fi
4793
4794
4795 # HPUX7 has trouble with the big cat so split it
4796 # Owen Rees <rtor@ansa.co.uk> 29Mar93 
4797 SEDDEFS="${SEDDEFS}CONFEOF
4798 cat >> conftest.sed <<CONFEOF
4799 "
4800 #
4801
4802 # There are multiple versions of getpty, alas.
4803 # I don't remember who has the first one, but Convex just added one
4804 # so check for it.  Unfortunately, there is no header so the only
4805 # reasonable way to make sure is to look it we are on a Convex.
4806 echo $ac_n "checking if on Convex""... $ac_c" 1>&6
4807 echo "configure:4808: checking if on Convex" >&5
4808 convex=0
4809 case "${host}" in
4810   c[12]-*-*)            convex=1;;
4811 esac
4812
4813 if test $convex -eq 1 ; then
4814   echo "$ac_t""yes" 1>&6
4815   cat >> confdefs.h <<\EOF
4816 #define CONVEX 1
4817 EOF
4818
4819 else
4820   echo "$ac_t""no" 1>&6
4821 fi
4822
4823 EXP_LDFLAGS=
4824
4825 echo $ac_n "checking if on NeXT""... $ac_c" 1>&6
4826 echo "configure:4827: checking if on NeXT" >&5
4827 if test -r /NextApps -a "$cross_compiling" != "yes" ; then
4828   echo "$ac_t""yes" 1>&6
4829   # "-m" flag suppresses complaints about multiple strtod
4830   EXP_LDFLAGS="$EXP_LDFLAGS -m"
4831 else
4832   echo "$ac_t""no" 1>&6
4833 fi
4834
4835
4836 echo $ac_n "checking if on HP""... $ac_c" 1>&6
4837 echo "configure:4838: checking if on HP" >&5
4838 if test "x`(uname) 2>/dev/null`" = xHP-UX; then
4839   echo "$ac_t""yes" 1>&6
4840   hp=1
4841 else
4842   echo "$ac_t""no" 1>&6
4843   hp=0
4844 fi
4845
4846 echo $ac_n "checking sane default stty arguments""... $ac_c" 1>&6
4847 echo "configure:4848: checking sane default stty arguments" >&5
4848 DEFAULT_STTY_ARGS="sane"
4849
4850 if test $mach -eq 1 ; then
4851         DEFAULT_STTY_ARGS="cooked"
4852 fi
4853
4854 if test $hp -eq 1 ; then
4855         DEFAULT_STTY_ARGS="sane kill \15"
4856 fi
4857
4858 echo "$ac_t""$DEFAULT_STTY_ARG" 1>&6
4859
4860 # Look for various features to determine what kind of pty
4861 # we have. For some weird reason, ac_compile_check would not
4862 # work, but ac_test_program does.
4863 #
4864 echo $ac_n "checking for HP style pty allocation""... $ac_c" 1>&6
4865 echo "configure:4866: checking for HP style pty allocation" >&5
4866 # following test fails on DECstations and other things that don't grok -c
4867 # but that's ok, since they don't have PTYMs anyway
4868 if test -r /dev/ptym/ptyp0 2>/dev/null -a "$cross_compiling" != "yes" ; then
4869     echo "$ac_t""yes" 1>&6
4870     cat >> confdefs.h <<\EOF
4871 #define HAVE_PTYM 1
4872 EOF
4873
4874 else
4875     echo "$ac_t""no" 1>&6
4876 fi
4877
4878 echo $ac_n "checking for HP style pty trapping""... $ac_c" 1>&6
4879 echo "configure:4880: checking for HP style pty trapping" >&5
4880 cat > conftest.$ac_ext <<EOF
4881 #line 4882 "configure"
4882 #include "confdefs.h"
4883 #include <sys/ptyio.h>
4884 EOF
4885 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4886   egrep "struct.*request_info" >/dev/null 2>&1; then
4887   rm -rf conftest*
4888   echo "$ac_t""yes" 1>&6
4889         cat >> confdefs.h <<\EOF
4890 #define HAVE_PTYTRAP 1
4891 EOF
4892
4893
4894 else
4895   rm -rf conftest*
4896   echo "$ac_t""no" 1>&6
4897
4898 fi
4899 rm -f conftest*
4900
4901
4902 echo $ac_n "checking for AIX new-style pty allocation""... $ac_c" 1>&6
4903 echo "configure:4904: checking for AIX new-style pty allocation" >&5
4904 if test -r /dev/ptc -a -r /dev/pts -a "$cross_compiling" != "yes" ; then
4905     echo "$ac_t""yes" 1>&6
4906     cat >> confdefs.h <<\EOF
4907 #define HAVE_PTC_PTS 1
4908 EOF
4909
4910 else
4911     echo "$ac_t""no" 1>&6
4912 fi
4913
4914 echo $ac_n "checking for SGI old-style pty allocation""... $ac_c" 1>&6
4915 echo "configure:4916: checking for SGI old-style pty allocation" >&5
4916 if test -r /dev/ptc -a ! -r /dev/pts -a "$cross_compiling" != "yes" ; then
4917     echo "$ac_t""yes" 1>&6
4918     cat >> confdefs.h <<\EOF
4919 #define HAVE_PTC 1
4920 EOF
4921
4922 else
4923     echo "$ac_t""no" 1>&6
4924 fi
4925
4926 # On SCO OpenServer, two types of ptys are available: SVR4 streams and c-list.
4927 # The library routines to open the SVR4 ptys are broken on certain systems and
4928 # the SCO command to increase the number of ptys only configure c-list ones
4929 # anyway.  So we chose these, which have a special numbering scheme.
4930 #
4931 echo $ac_n "checking for SCO style pty allocation""... $ac_c" 1>&6
4932 echo "configure:4933: checking for SCO style pty allocation" >&5
4933 sco_ptys=""
4934 case "${host}" in
4935   *-sco3.2v[45]*)       sco_clist_ptys=1 svr4_ptys_broken=1;;
4936 esac
4937
4938 if test x"${sco_clist_ptys}" != x"" ; then
4939   echo "$ac_t""yes" 1>&6
4940   cat >> confdefs.h <<\EOF
4941 #define HAVE_SCO_CLIST_PTYS 1
4942 EOF
4943
4944 else
4945   echo "$ac_t""no" 1>&6
4946 fi
4947
4948 echo $ac_n "checking for SVR4 style pty allocation""... $ac_c" 1>&6
4949 echo "configure:4950: checking for SVR4 style pty allocation" >&5
4950 if test -r /dev/ptmx -a "x$svr4_ptys_broken" = x -a "$cross_compiling" != "yes" ; then
4951   echo "$ac_t""yes" 1>&6
4952   cat >> confdefs.h <<\EOF
4953 #define HAVE_PTMX 1
4954 EOF
4955
4956   # aargg. Some systems need libpt.a to use /dev/ptmx
4957   echo $ac_n "checking for ptsname""... $ac_c" 1>&6
4958 echo "configure:4959: checking for ptsname" >&5
4959 if eval "test \"`echo '$''{'ac_cv_func_ptsname'+set}'`\" = set"; then
4960   echo $ac_n "(cached) $ac_c" 1>&6
4961 else
4962   cat > conftest.$ac_ext <<EOF
4963 #line 4964 "configure"
4964 #include "confdefs.h"
4965 /* System header to define __stub macros and hopefully few prototypes,
4966     which can conflict with char ptsname(); below.  */
4967 #include <assert.h>
4968 /* Override any gcc2 internal prototype to avoid an error.  */
4969 /* We use char because int might match the return type of a gcc2
4970     builtin and then its argument prototype would still apply.  */
4971 char ptsname();
4972
4973 int main() {
4974
4975 /* The GNU C library defines this for functions which it implements
4976     to always fail with ENOSYS.  Some functions are actually named
4977     something starting with __ and the normal name is an alias.  */
4978 #if defined (__stub_ptsname) || defined (__stub___ptsname)
4979 choke me
4980 #else
4981 ptsname();
4982 #endif
4983
4984 ; return 0; }
4985 EOF
4986 if { (eval echo configure:4987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4987   rm -rf conftest*
4988   eval "ac_cv_func_ptsname=yes"
4989 else
4990   echo "configure: failed program was:" >&5
4991   cat conftest.$ac_ext >&5
4992   rm -rf conftest*
4993   eval "ac_cv_func_ptsname=no"
4994 fi
4995 rm -f conftest*
4996 fi
4997
4998 if eval "test \"`echo '$ac_cv_func_'ptsname`\" = yes"; then
4999   echo "$ac_t""yes" 1>&6
5000   :
5001 else
5002   echo "$ac_t""no" 1>&6
5003 LIBS="${LIBS} -lpt"
5004 fi
5005
5006   # I've never seen Tcl or Tk include -lpt so don't bother with explicit test
5007   echo $ac_n "checking for ptsname""... $ac_c" 1>&6
5008 echo "configure:5009: checking for ptsname" >&5
5009 if eval "test \"`echo '$''{'ac_cv_func_ptsname'+set}'`\" = set"; then
5010   echo $ac_n "(cached) $ac_c" 1>&6
5011 else
5012   cat > conftest.$ac_ext <<EOF
5013 #line 5014 "configure"
5014 #include "confdefs.h"
5015 /* System header to define __stub macros and hopefully few prototypes,
5016     which can conflict with char ptsname(); below.  */
5017 #include <assert.h>
5018 /* Override any gcc2 internal prototype to avoid an error.  */
5019 /* We use char because int might match the return type of a gcc2
5020     builtin and then its argument prototype would still apply.  */
5021 char ptsname();
5022
5023 int main() {
5024
5025 /* The GNU C library defines this for functions which it implements
5026     to always fail with ENOSYS.  Some functions are actually named
5027     something starting with __ and the normal name is an alias.  */
5028 #if defined (__stub_ptsname) || defined (__stub___ptsname)
5029 choke me
5030 #else
5031 ptsname();
5032 #endif
5033
5034 ; return 0; }
5035 EOF
5036 if { (eval echo configure:5037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5037   rm -rf conftest*
5038   eval "ac_cv_func_ptsname=yes"
5039 else
5040   echo "configure: failed program was:" >&5
5041   cat conftest.$ac_ext >&5
5042   rm -rf conftest*
5043   eval "ac_cv_func_ptsname=no"
5044 fi
5045 rm -f conftest*
5046 fi
5047
5048 if eval "test \"`echo '$ac_cv_func_'ptsname`\" = yes"; then
5049   echo "$ac_t""yes" 1>&6
5050   :
5051 else
5052   echo "$ac_t""no" 1>&6
5053 EXP_AND_TCL_LIBS="${EXP_AND_TCL_LIBS} -lpt"
5054 fi
5055
5056   echo $ac_n "checking for ptsname""... $ac_c" 1>&6
5057 echo "configure:5058: checking for ptsname" >&5
5058 if eval "test \"`echo '$''{'ac_cv_func_ptsname'+set}'`\" = set"; then
5059   echo $ac_n "(cached) $ac_c" 1>&6
5060 else
5061   cat > conftest.$ac_ext <<EOF
5062 #line 5063 "configure"
5063 #include "confdefs.h"
5064 /* System header to define __stub macros and hopefully few prototypes,
5065     which can conflict with char ptsname(); below.  */
5066 #include <assert.h>
5067 /* Override any gcc2 internal prototype to avoid an error.  */
5068 /* We use char because int might match the return type of a gcc2
5069     builtin and then its argument prototype would still apply.  */
5070 char ptsname();
5071
5072 int main() {
5073
5074 /* The GNU C library defines this for functions which it implements
5075     to always fail with ENOSYS.  Some functions are actually named
5076     something starting with __ and the normal name is an alias.  */
5077 #if defined (__stub_ptsname) || defined (__stub___ptsname)
5078 choke me
5079 #else
5080 ptsname();
5081 #endif
5082
5083 ; return 0; }
5084 EOF
5085 if { (eval echo configure:5086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5086   rm -rf conftest*
5087   eval "ac_cv_func_ptsname=yes"
5088 else
5089   echo "configure: failed program was:" >&5
5090   cat conftest.$ac_ext >&5
5091   rm -rf conftest*
5092   eval "ac_cv_func_ptsname=no"
5093 fi
5094 rm -f conftest*
5095 fi
5096
5097 if eval "test \"`echo '$ac_cv_func_'ptsname`\" = yes"; then
5098   echo "$ac_t""yes" 1>&6
5099   :
5100 else
5101   echo "$ac_t""no" 1>&6
5102 EXP_AND_TK_LIBS="${EXP_AND_TK_LIBS} -lpt"
5103 fi
5104
5105   # CYGNUS LOCAL: IA-64
5106   # On some systems (e.g., IA-64 Linux), we need to define _XOPEN_SOURCE
5107   # in order to get a declaration for ptsname.  It is safe to simply
5108   # define that whenever we are using ptsname.
5109   echo $ac_n "checking for NSIG definition with _XOPEN_SOURCE""... $ac_c" 1>&6
5110 echo "configure:5111: checking for NSIG definition with _XOPEN_SOURCE" >&5
5111   cat > conftest.$ac_ext <<EOF
5112 #line 5113 "configure"
5113 #include "confdefs.h"
5114
5115 /* _XOPEN_SOURCE can remove NSIG on UnixWare or OSF/1. */
5116 #define _XOPEN_SOURCE
5117 #include <signal.h>
5118 #ifndef NSIG
5119 #define NSIG _NSIG
5120 #endif
5121 char junk[NSIG];
5122 int main() {
5123
5124 ; return 0; }
5125 EOF
5126 if { (eval echo configure:5127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5127   rm -rf conftest*
5128   cat >> confdefs.h <<\EOF
5129 #define _XOPEN_SOURCE 1
5130 EOF
5131
5132         echo "$ac_t""yes" 1>&6
5133     
5134 else
5135   echo "configure: failed program was:" >&5
5136   cat conftest.$ac_ext >&5
5137   rm -rf conftest*
5138   echo "$ac_t""no" 1>&6
5139     
5140 fi
5141 rm -f conftest*
5142   # END CYGNUS LOCAL
5143 else
5144   echo "$ac_t""no" 1>&6
5145 fi
5146
5147 # In OSF/1 case, SVR4 are somewhat different.
5148 # Gregory Depp <depp@osf.org> 17Aug93
5149 echo $ac_n "checking for OSF/1 style pty allocation""... $ac_c" 1>&6
5150 echo "configure:5151: checking for OSF/1 style pty allocation" >&5
5151 if test -r /dev/ptmx_bsd -a "$cross_compiling" != "yes" ; then
5152     cat >> confdefs.h <<\EOF
5153 #define HAVE_PTMX_BSD 1
5154 EOF
5155
5156     echo "$ac_t""yes" 1>&6
5157 else
5158     echo "$ac_t""no" 1>&6
5159 fi
5160
5161 # Set the pty handling for Cygwin
5162 case "${host}" in
5163   *-*-cygwin*) cat >> confdefs.h <<\EOF
5164 #define HAVE_PTMX 1
5165 EOF
5166  ;;
5167   *) ;;
5168 esac
5169
5170 tcgetattr=0
5171 tcsetattr=0
5172 echo $ac_n "checking for tcgetattr""... $ac_c" 1>&6
5173 echo "configure:5174: checking for tcgetattr" >&5
5174 if eval "test \"`echo '$''{'ac_cv_func_tcgetattr'+set}'`\" = set"; then
5175   echo $ac_n "(cached) $ac_c" 1>&6
5176 else
5177   cat > conftest.$ac_ext <<EOF
5178 #line 5179 "configure"
5179 #include "confdefs.h"
5180 /* System header to define __stub macros and hopefully few prototypes,
5181     which can conflict with char tcgetattr(); below.  */
5182 #include <assert.h>
5183 /* Override any gcc2 internal prototype to avoid an error.  */
5184 /* We use char because int might match the return type of a gcc2
5185     builtin and then its argument prototype would still apply.  */
5186 char tcgetattr();
5187
5188 int main() {
5189
5190 /* The GNU C library defines this for functions which it implements
5191     to always fail with ENOSYS.  Some functions are actually named
5192     something starting with __ and the normal name is an alias.  */
5193 #if defined (__stub_tcgetattr) || defined (__stub___tcgetattr)
5194 choke me
5195 #else
5196 tcgetattr();
5197 #endif
5198
5199 ; return 0; }
5200 EOF
5201 if { (eval echo configure:5202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5202   rm -rf conftest*
5203   eval "ac_cv_func_tcgetattr=yes"
5204 else
5205   echo "configure: failed program was:" >&5
5206   cat conftest.$ac_ext >&5
5207   rm -rf conftest*
5208   eval "ac_cv_func_tcgetattr=no"
5209 fi
5210 rm -f conftest*
5211 fi
5212
5213 if eval "test \"`echo '$ac_cv_func_'tcgetattr`\" = yes"; then
5214   echo "$ac_t""yes" 1>&6
5215   tcgetattr=1
5216 else
5217   echo "$ac_t""no" 1>&6
5218 fi
5219
5220 echo $ac_n "checking for tcsetattr""... $ac_c" 1>&6
5221 echo "configure:5222: checking for tcsetattr" >&5
5222 if eval "test \"`echo '$''{'ac_cv_func_tcsetattr'+set}'`\" = set"; then
5223   echo $ac_n "(cached) $ac_c" 1>&6
5224 else
5225   cat > conftest.$ac_ext <<EOF
5226 #line 5227 "configure"
5227 #include "confdefs.h"
5228 /* System header to define __stub macros and hopefully few prototypes,
5229     which can conflict with char tcsetattr(); below.  */
5230 #include <assert.h>
5231 /* Override any gcc2 internal prototype to avoid an error.  */
5232 /* We use char because int might match the return type of a gcc2
5233     builtin and then its argument prototype would still apply.  */
5234 char tcsetattr();
5235
5236 int main() {
5237
5238 /* The GNU C library defines this for functions which it implements
5239     to always fail with ENOSYS.  Some functions are actually named
5240     something starting with __ and the normal name is an alias.  */
5241 #if defined (__stub_tcsetattr) || defined (__stub___tcsetattr)
5242 choke me
5243 #else
5244 tcsetattr();
5245 #endif
5246
5247 ; return 0; }
5248 EOF
5249 if { (eval echo configure:5250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5250   rm -rf conftest*
5251   eval "ac_cv_func_tcsetattr=yes"
5252 else
5253   echo "configure: failed program was:" >&5
5254   cat conftest.$ac_ext >&5
5255   rm -rf conftest*
5256   eval "ac_cv_func_tcsetattr=no"
5257 fi
5258 rm -f conftest*
5259 fi
5260
5261 if eval "test \"`echo '$ac_cv_func_'tcsetattr`\" = yes"; then
5262   echo "$ac_t""yes" 1>&6
5263   tcsetattr=1
5264 else
5265   echo "$ac_t""no" 1>&6
5266 fi
5267
5268 if test $tcgetattr -eq 1 -a $tcsetattr -eq 1 ; then
5269     cat >> confdefs.h <<\EOF
5270 #define HAVE_TCSETATTR 1
5271 EOF
5272
5273     cat >> confdefs.h <<\EOF
5274 #define POSIX 1
5275 EOF
5276
5277 fi
5278
5279 # first check for the pure bsd
5280 echo $ac_n "checking for struct sgttyb""... $ac_c" 1>&6
5281 echo "configure:5282: checking for struct sgttyb" >&5
5282 if test "$cross_compiling" = yes; then
5283   case "${host}" in
5284          *-*-cygwin*) echo "$ac_t""no" 1>&6 ;;
5285          *) { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; } ;;
5286          esac
5287
5288 else
5289   cat > conftest.$ac_ext <<EOF
5290 #line 5291 "configure"
5291 #include "confdefs.h"
5292
5293 #include <sgtty.h>
5294 main()
5295 {
5296   struct sgttyb tmp;
5297   exit(0);
5298 }
5299 EOF
5300 if { (eval echo configure:5301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5301 then
5302   echo "$ac_t""yes" 1>&6
5303         cat >> confdefs.h <<\EOF
5304 #define HAVE_SGTTYB 1
5305 EOF
5306
5307         PTY_TYPE=sgttyb
5308
5309 else
5310   echo "configure: failed program was:" >&5
5311   cat conftest.$ac_ext >&5
5312   rm -fr conftest*
5313   echo "$ac_t""no" 1>&6
5314
5315 fi
5316 rm -fr conftest*
5317 fi
5318
5319
5320 # mach systems have include files for unimplemented features
5321 # so avoid doing following test on those systems
5322 if test $mach -eq 0 ; then
5323
5324   # next check for the older style ttys
5325   # note that if we detect termio.h (only), we still set PTY_TYPE=termios
5326   # since that just controls which of pty_XXXX.c file is use and
5327   # pty_termios.c is set up to handle pty_termio.
5328   echo $ac_n "checking for struct termio""... $ac_c" 1>&6
5329 echo "configure:5330: checking for struct termio" >&5
5330   if test "$cross_compiling" = yes; then
5331   case "${host}" in
5332          *-*-cygwin*) echo "$ac_t""no" 1>&6 ;;
5333          *) { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; } ;;
5334          esac
5335
5336 else
5337   cat > conftest.$ac_ext <<EOF
5338 #line 5339 "configure"
5339 #include "confdefs.h"
5340 #include <termio.h>
5341   main()
5342   {
5343     struct termio tmp;
5344     exit(0);
5345   }
5346 EOF
5347 if { (eval echo configure:5348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5348 then
5349   cat >> confdefs.h <<\EOF
5350 #define HAVE_TERMIO 1
5351 EOF
5352
5353         PTY_TYPE=termios
5354         echo "$ac_t""yes" 1>&6
5355
5356 else
5357   echo "configure: failed program was:" >&5
5358   cat conftest.$ac_ext >&5
5359   rm -fr conftest*
5360   echo "$ac_t""no" 1>&6
5361
5362 fi
5363 rm -fr conftest*
5364 fi
5365
5366
5367   # now check for the new style ttys (not yet posix)
5368   echo $ac_n "checking for struct termios""... $ac_c" 1>&6
5369 echo "configure:5370: checking for struct termios" >&5
5370   if test "$cross_compiling" = yes; then
5371   case "${host}" in
5372          *-*-cygwin*) cat >> confdefs.h <<\EOF
5373 #define HAVE_TERMIOS 1
5374 EOF
5375
5376                         PTY_TYPE=termios
5377                         echo "$ac_t""yes" 1>&6 ;;
5378          *) { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; } ;;
5379          esac
5380   
5381 else
5382   cat > conftest.$ac_ext <<EOF
5383 #line 5384 "configure"
5384 #include "confdefs.h"
5385
5386 #  ifdef HAVE_INTTYPES_H
5387 #  include <inttypes.h>
5388 #  endif
5389 #  include <termios.h>
5390   main()
5391   {
5392     struct termios tmp;
5393     exit(0);
5394   }
5395 EOF
5396 if { (eval echo configure:5397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5397 then
5398   cat >> confdefs.h <<\EOF
5399 #define HAVE_TERMIOS 1
5400 EOF
5401
5402         PTY_TYPE=termios
5403         echo "$ac_t""yes" 1>&6
5404   
5405 else
5406   echo "configure: failed program was:" >&5
5407   cat conftest.$ac_ext >&5
5408   rm -fr conftest*
5409   echo "$ac_t""no" 1>&6
5410   
5411 fi
5412 rm -fr conftest*
5413 fi
5414
5415 fi
5416
5417 echo $ac_n "checking if TCGETS or TCGETA in termios.h""... $ac_c" 1>&6
5418 echo "configure:5419: checking if TCGETS or TCGETA in termios.h" >&5
5419 if test "$cross_compiling" = yes; then
5420   case "${host}" in
5421          *-*-cygwin*) cat >> confdefs.h <<\EOF
5422 #define HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H 1
5423 EOF
5424
5425                         echo "$ac_t""yes" 1>&6 ;;
5426          *) { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; } ;;
5427          esac
5428
5429 else
5430   cat > conftest.$ac_ext <<EOF
5431 #line 5432 "configure"
5432 #include "confdefs.h"
5433
5434 /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
5435 #ifdef HAVE_INTTYPES_H
5436 #include <inttypes.h>
5437 #endif
5438 #include <termios.h>
5439 main() {
5440 #if defined(TCGETS) || defined(TCGETA)
5441         return 0;
5442 #else
5443         return 1;
5444 #endif
5445 }
5446 EOF
5447 if { (eval echo configure:5448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5448 then
5449   cat >> confdefs.h <<\EOF
5450 #define HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H 1
5451 EOF
5452
5453         echo "$ac_t""yes" 1>&6
5454
5455 else
5456   echo "configure: failed program was:" >&5
5457   cat conftest.$ac_ext >&5
5458   rm -fr conftest*
5459   echo "$ac_t""no" 1>&6
5460
5461 fi
5462 rm -fr conftest*
5463 fi
5464
5465
5466 echo $ac_n "checking if TIOCGWINSZ in termios.h""... $ac_c" 1>&6
5467 echo "configure:5468: checking if TIOCGWINSZ in termios.h" >&5
5468 if test "$cross_compiling" = yes; then
5469   case "${host}" in
5470          *-*-cygwin*) cat >> confdefs.h <<\EOF
5471 #define HAVE_TIOCGWINSZ_IN_TERMIOS_H 1
5472 EOF
5473
5474                         echo "$ac_t""yes" 1>&6 ;;
5475          *) { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; } ;;
5476          esac
5477
5478 else
5479   cat > conftest.$ac_ext <<EOF
5480 #line 5481 "configure"
5481 #include "confdefs.h"
5482
5483 /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
5484 #ifdef HAVE_INTTYPES_H
5485 #include <inttypes.h>
5486 #endif
5487 #include <termios.h>
5488 main() {
5489 #ifdef TIOCGWINSZ
5490         return 0;
5491 #else
5492         return 1;
5493 #endif
5494 }
5495 EOF
5496 if { (eval echo configure:5497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5497 then
5498   cat >> confdefs.h <<\EOF
5499 #define HAVE_TIOCGWINSZ_IN_TERMIOS_H 1
5500 EOF
5501
5502         echo "$ac_t""yes" 1>&6
5503
5504 else
5505   echo "configure: failed program was:" >&5
5506   cat conftest.$ac_ext >&5
5507   rm -fr conftest*
5508   echo "$ac_t""no" 1>&6
5509
5510 fi
5511 rm -fr conftest*
5512 fi
5513
5514
5515 # finally check for Cray style ttys
5516 echo $ac_n "checking for Cray-style ptys""... $ac_c" 1>&6
5517 echo "configure:5518: checking for Cray-style ptys" >&5
5518 SETUID=":"
5519 if test "$cross_compiling" = yes; then
5520   case "${host}" in
5521          *-*-cygwin*) echo "$ac_t""no" 1>&6 ;;
5522          *) { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; } ;;
5523          esac
5524
5525 else
5526   cat > conftest.$ac_ext <<EOF
5527 #line 5528 "configure"
5528 #include "confdefs.h"
5529
5530 main(){
5531 #ifdef CRAY
5532         return 0;
5533 #else
5534         return 1;
5535 #endif
5536 }
5537
5538 EOF
5539 if { (eval echo configure:5540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5540 then
5541   PTY_TYPE=unicos
5542         SETUID="chmod u+s"
5543         echo "$ac_t""yes" 1>&6
5544
5545 else
5546   echo "configure: failed program was:" >&5
5547   cat conftest.$ac_ext >&5
5548   rm -fr conftest*
5549   echo "$ac_t""no" 1>&6
5550
5551 fi
5552 rm -fr conftest*
5553 fi
5554
5555
5556 #
5557 # Check for select and/or poll. If both exist, we prefer select.
5558 # if neither exists, define SIMPLE_EVENT.
5559 #
5560 select=0
5561 poll=0
5562 unset ac_cv_func_select
5563 echo $ac_n "checking for select""... $ac_c" 1>&6
5564 echo "configure:5565: checking for select" >&5
5565 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
5566   echo $ac_n "(cached) $ac_c" 1>&6
5567 else
5568   cat > conftest.$ac_ext <<EOF
5569 #line 5570 "configure"
5570 #include "confdefs.h"
5571 /* System header to define __stub macros and hopefully few prototypes,
5572     which can conflict with char select(); below.  */
5573 #include <assert.h>
5574 /* Override any gcc2 internal prototype to avoid an error.  */
5575 /* We use char because int might match the return type of a gcc2
5576     builtin and then its argument prototype would still apply.  */
5577 char select();
5578
5579 int main() {
5580
5581 /* The GNU C library defines this for functions which it implements
5582     to always fail with ENOSYS.  Some functions are actually named
5583     something starting with __ and the normal name is an alias.  */
5584 #if defined (__stub_select) || defined (__stub___select)
5585 choke me
5586 #else
5587 select();
5588 #endif
5589
5590 ; return 0; }
5591 EOF
5592 if { (eval echo configure:5593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5593   rm -rf conftest*
5594   eval "ac_cv_func_select=yes"
5595 else
5596   echo "configure: failed program was:" >&5
5597   cat conftest.$ac_ext >&5
5598   rm -rf conftest*
5599   eval "ac_cv_func_select=no"
5600 fi
5601 rm -f conftest*
5602 fi
5603
5604 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5605   echo "$ac_t""yes" 1>&6
5606   select=1
5607 else
5608   echo "$ac_t""no" 1>&6
5609 fi
5610
5611 echo $ac_n "checking for poll""... $ac_c" 1>&6
5612 echo "configure:5613: checking for poll" >&5
5613 if eval "test \"`echo '$''{'ac_cv_func_poll'+set}'`\" = set"; then
5614   echo $ac_n "(cached) $ac_c" 1>&6
5615 else
5616   cat > conftest.$ac_ext <<EOF
5617 #line 5618 "configure"
5618 #include "confdefs.h"
5619 /* System header to define __stub macros and hopefully few prototypes,
5620     which can conflict with char poll(); below.  */
5621 #include <assert.h>
5622 /* Override any gcc2 internal prototype to avoid an error.  */
5623 /* We use char because int might match the return type of a gcc2
5624     builtin and then its argument prototype would still apply.  */
5625 char poll();
5626
5627 int main() {
5628
5629 /* The GNU C library defines this for functions which it implements
5630     to always fail with ENOSYS.  Some functions are actually named
5631     something starting with __ and the normal name is an alias.  */
5632 #if defined (__stub_poll) || defined (__stub___poll)
5633 choke me
5634 #else
5635 poll();
5636 #endif
5637
5638 ; return 0; }
5639 EOF
5640 if { (eval echo configure:5641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5641   rm -rf conftest*
5642   eval "ac_cv_func_poll=yes"
5643 else
5644   echo "configure: failed program was:" >&5
5645   cat conftest.$ac_ext >&5
5646   rm -rf conftest*
5647   eval "ac_cv_func_poll=no"
5648 fi
5649 rm -f conftest*
5650 fi
5651
5652 if eval "test \"`echo '$ac_cv_func_'poll`\" = yes"; then
5653   echo "$ac_t""yes" 1>&6
5654   poll=1
5655 else
5656   echo "$ac_t""no" 1>&6
5657 fi
5658
5659 echo $ac_n "checking event handling""... $ac_c" 1>&6
5660 echo "configure:5661: checking event handling" >&5
5661 if test $select -eq 1 ; then
5662   EVENT_TYPE=select
5663   EVENT_ABLE=event
5664   echo "$ac_t""via select" 1>&6
5665 elif test $poll -eq 1 ; then
5666   EVENT_TYPE=poll
5667   EVENT_ABLE=event
5668   echo "$ac_t""via poll" 1>&6
5669 else
5670   EVENT_TYPE=simple
5671   EVENT_ABLE=noevent
5672   echo "$ac_t""none" 1>&6
5673   cat >> confdefs.h <<\EOF
5674 #define SIMPLE_EVENT 1
5675 EOF
5676
5677 fi
5678
5679 for ac_func in _getpty
5680 do
5681 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5682 echo "configure:5683: checking for $ac_func" >&5
5683 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5684   echo $ac_n "(cached) $ac_c" 1>&6
5685 else
5686   cat > conftest.$ac_ext <<EOF
5687 #line 5688 "configure"
5688 #include "confdefs.h"
5689 /* System header to define __stub macros and hopefully few prototypes,
5690     which can conflict with char $ac_func(); below.  */
5691 #include <assert.h>
5692 /* Override any gcc2 internal prototype to avoid an error.  */
5693 /* We use char because int might match the return type of a gcc2
5694     builtin and then its argument prototype would still apply.  */
5695 char $ac_func();
5696
5697 int main() {
5698
5699 /* The GNU C library defines this for functions which it implements
5700     to always fail with ENOSYS.  Some functions are actually named
5701     something starting with __ and the normal name is an alias.  */
5702 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5703 choke me
5704 #else
5705 $ac_func();
5706 #endif
5707
5708 ; return 0; }
5709 EOF
5710 if { (eval echo configure:5711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5711   rm -rf conftest*
5712   eval "ac_cv_func_$ac_func=yes"
5713 else
5714   echo "configure: failed program was:" >&5
5715   cat conftest.$ac_ext >&5
5716   rm -rf conftest*
5717   eval "ac_cv_func_$ac_func=no"
5718 fi
5719 rm -f conftest*
5720 fi
5721
5722 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5723   echo "$ac_t""yes" 1>&6
5724     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5725   cat >> confdefs.h <<EOF
5726 #define $ac_tr_func 1
5727 EOF
5728  
5729 else
5730   echo "$ac_t""no" 1>&6
5731 fi
5732 done
5733
5734 for ac_func in getpty
5735 do
5736 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5737 echo "configure:5738: checking for $ac_func" >&5
5738 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5739   echo $ac_n "(cached) $ac_c" 1>&6
5740 else
5741   cat > conftest.$ac_ext <<EOF
5742 #line 5743 "configure"
5743 #include "confdefs.h"
5744 /* System header to define __stub macros and hopefully few prototypes,
5745     which can conflict with char $ac_func(); below.  */
5746 #include <assert.h>
5747 /* Override any gcc2 internal prototype to avoid an error.  */
5748 /* We use char because int might match the return type of a gcc2
5749     builtin and then its argument prototype would still apply.  */
5750 char $ac_func();
5751
5752 int main() {
5753
5754 /* The GNU C library defines this for functions which it implements
5755     to always fail with ENOSYS.  Some functions are actually named
5756     something starting with __ and the normal name is an alias.  */
5757 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5758 choke me
5759 #else
5760 $ac_func();
5761 #endif
5762
5763 ; return 0; }
5764 EOF
5765 if { (eval echo configure:5766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5766   rm -rf conftest*
5767   eval "ac_cv_func_$ac_func=yes"
5768 else
5769   echo "configure: failed program was:" >&5
5770   cat conftest.$ac_ext >&5
5771   rm -rf conftest*
5772   eval "ac_cv_func_$ac_func=no"
5773 fi
5774 rm -f conftest*
5775 fi
5776
5777 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5778   echo "$ac_t""yes" 1>&6
5779     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5780   cat >> confdefs.h <<EOF
5781 #define $ac_tr_func 1
5782 EOF
5783  
5784 else
5785   echo "$ac_t""no" 1>&6
5786 fi
5787 done
5788
5789
5790 #
5791 # check for timezones
5792 #
5793 echo $ac_n "checking for SV-style timezone""... $ac_c" 1>&6
5794 echo "configure:5795: checking for SV-style timezone" >&5
5795 if test "$cross_compiling" = yes; then
5796   case "${host}" in
5797          *-*-cygwin*) echo "$ac_t""no" 1>&6 ;;
5798          *) { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; } ;;
5799          esac
5800
5801 else
5802   cat > conftest.$ac_ext <<EOF
5803 #line 5804 "configure"
5804 #include "confdefs.h"
5805
5806 extern char *tzname[2];
5807 extern int daylight;
5808 main()
5809 {
5810   int *x = &daylight;
5811   char **y = tzname;
5812
5813   exit(0);
5814 }
5815 EOF
5816 if { (eval echo configure:5817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5817 then
5818   cat >> confdefs.h <<\EOF
5819 #define HAVE_SV_TIMEZONE 1
5820 EOF
5821
5822         echo "$ac_t""yes" 1>&6
5823 else
5824   echo "configure: failed program was:" >&5
5825   cat conftest.$ac_ext >&5
5826   rm -fr conftest*
5827   echo "$ac_t""no" 1>&6
5828
5829 fi
5830 rm -fr conftest*
5831 fi
5832
5833
5834 # only look for Tk stuff if we have X11 and user doesn't say not to
5835 # Check whether --with-x or --without-x was given.
5836 if test "${with_x+set}" = set; then
5837   withval="$with_x"
5838   :
5839 else
5840   with_x=yes
5841 fi
5842
5843 if test "$with_x" = "no"; then
5844    no_tk=true
5845 else
5846    
5847 #
5848 # Ok, lets find the tk source trees so we can use the headers
5849 # If the directory (presumably symlink) named "tk" exists, use that one
5850 # in preference to any others.  Same logic is used when choosing library
5851 # and again with Tcl. The search order is the best place to look first, then in
5852 # decreasing significance. The loop breaks if the trigger file is found.
5853 # Note the gross little conversion here of srcdir by cd'ing to the found
5854 # directory. This converts the path from a relative to an absolute, so
5855 # recursive cache variables for the path will work right. We check all
5856 # the possible paths in one loop rather than many seperate loops to speed
5857 # things up.
5858 # the alternative search directory is involked by --with-tkinclude
5859 #
5860 #no_tk=true
5861 echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
5862 echo "configure:5863: checking for Tk private headers" >&5
5863 # Check whether --with-tkinclude or --without-tkinclude was given.
5864 if test "${with_tkinclude+set}" = set; then
5865   withval="$with_tkinclude"
5866   with_tkinclude=${withval}
5867 fi
5868
5869 if eval "test \"`echo '$''{'ac_cv_c_tkh'+set}'`\" = set"; then
5870   echo $ac_n "(cached) $ac_c" 1>&6
5871 else
5872   
5873 # first check to see if --with-tkinclude was specified
5874 if test x"${with_tkinclude}" != x ; then
5875   if test -f ${with_tkinclude}/tk.h ; then
5876     ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
5877   elif test -f ${with_tkinclude}/generic/tk.h ; then
5878     ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; pwd)`
5879   else
5880     { echo "configure: error: ${with_tkinclude} directory doesn't contain private headers" 1>&2; exit 1; }
5881   fi
5882 fi
5883
5884 # next check if it came with Tk configuration file
5885 if test x"${ac_cv_c_tkconfig}" != x ; then
5886   if test -f $ac_cv_c_tkconfig/../generic/tk.h ; then
5887     ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/../generic; pwd)`
5888   fi
5889 fi
5890
5891 # next check in private source directory
5892 #
5893 # since ls returns lowest version numbers first, reverse its output
5894
5895 if test x"${ac_cv_c_tkh}" = x ; then
5896   for i in \
5897                 ${srcdir}/../tk \
5898                 `ls -dr ${srcdir}/../tk[4-9].[0-9] 2>/dev/null` \
5899                 ${srcdir}/../../tk \
5900                 `ls -dr ${srcdir}/../../tk[4-9].[0-9] 2>/dev/null` \
5901                 ${srcdir}/../../../tk \
5902                 `ls -dr ${srcdir}/../../../tk[4-9].[0-9] 2>/dev/null ` ; do
5903     if test -f $i/generic/tk.h ; then
5904       ac_cv_c_tkh=`(cd $i/generic; pwd)`
5905       break
5906     fi
5907   done
5908 fi
5909
5910 # finally check in a few common install locations
5911 #
5912 # since ls returns lowest version numbers first, reverse its output
5913
5914 if test x"${ac_cv_c_tkh}" = x ; then
5915   for i in \
5916                 `ls -dr /usr/local/src/tk[4-9].[0-9] 2>/dev/null` \
5917                 `ls -dr /usr/local/lib/tk[4-9].[0-9] 2>/dev/null` \
5918                 /usr/local/src/tk \
5919                 /usr/local/lib/tk \
5920                 ${prefix}/include ; do
5921     if test -f $i/generic/tk.h ; then
5922       ac_cv_c_tkh=`(cd $i/generic; pwd)`
5923       break
5924     fi
5925   done
5926 fi
5927
5928 # see if one is installed
5929 if test x"${ac_cv_c_tkh}" = x ; then
5930    ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
5931 echo $ac_n "checking for tk.h""... $ac_c" 1>&6
5932 echo "configure:5933: checking for tk.h" >&5
5933 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5934   echo $ac_n "(cached) $ac_c" 1>&6
5935 else
5936   cat > conftest.$ac_ext <<EOF
5937 #line 5938 "configure"
5938 #include "confdefs.h"
5939 #include <tk.h>
5940 EOF
5941 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5942 { (eval echo configure:5943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5943 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5944 if test -z "$ac_err"; then
5945   rm -rf conftest*
5946   eval "ac_cv_header_$ac_safe=yes"
5947 else
5948   echo "$ac_err" >&5
5949   echo "configure: failed program was:" >&5
5950   cat conftest.$ac_ext >&5
5951   rm -rf conftest*
5952   eval "ac_cv_header_$ac_safe=no"
5953 fi
5954 rm -f conftest*
5955 fi
5956 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5957   echo "$ac_t""yes" 1>&6
5958   ac_cv_c_tkh=installed
5959 else
5960   echo "$ac_t""no" 1>&6
5961 ac_cv_c_tkh=""
5962 fi
5963
5964 fi
5965
5966 fi
5967
5968 if test x"${ac_cv_c_tkh}" != x ; then
5969 #  no_tk=""
5970   if test x"${ac_cv_c_tkh}" = x"installed" ; then
5971     echo "$ac_t""is installed" 1>&6
5972     TKHDIRDASHI=""
5973   else
5974     echo "$ac_t""found in ${ac_cv_c_tkh}" 1>&6
5975     # this hack is cause the TKHDIRDASHI won't print if there is a "-I" in it.
5976     TKHDIRDASHI="-I${ac_cv_c_tkh}"
5977   fi
5978 else
5979   TKHDIRDASHI="# no Tk directory found"
5980   echo "configure: warning: Can't find Tk private headers" 1>&2
5981   no_tk=true
5982 fi
5983
5984
5985
5986 fi
5987 if test x"$no_tk" != x"true" ; then
5988 # libexpectk no longer exists
5989 #  X_PROGS="expectk \$(LIBEXPECTK)"
5990   X_PROGS=expectk
5991 # should really generate following symbol, but I'm hitting configure's limit on substs.
5992   X_PROGS_INSTALLED=expectk_installed
5993 else
5994   X_PROGS="# no X support on this system"
5995   echo "configure: warning: No X based programs will be built" 1>&2
5996   echo "        WARNING: Can't find Tk headers or library.  You can still"
5997   echo "        build expect, but not expectk.  See Expect's README for"
5998   echo "        information on how to obtain Tk.  If Tk is installed, see"
5999   echo "        Expect's INSTALL on how to tell configure where Tk is"
6000   echo "        installed."
6001 fi
6002
6003 # consume these flags so that user can invoke Expect's configure with
6004 # the same command as Tcl's configure
6005 # Check whether --enable-load or --disable-load was given.
6006 if test "${enable_load+set}" = set; then
6007   enableval="$enable_load"
6008   disable_dl=$enableval
6009 else
6010   disable_dl=no
6011 fi
6012
6013
6014 # Check whether --enable-gcc or --disable-gcc was given.
6015 if test "${enable_gcc+set}" = set; then
6016   enableval="$enable_gcc"
6017   enable_gcc=$enableval
6018 else
6019   enable_gcc=no
6020 fi
6021
6022
6023
6024 # Following comment stolen from Tcl's configure.in:
6025 #   Note:  in the following variable, it's important to use the absolute
6026 #   path name of the Tcl directory rather than "..":  this is because
6027 #   AIX remembers this path and will attempt to use it at run-time to look
6028 #   up the Tcl library.
6029
6030 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
6031     EXP_LIB_VERSION=$EXP_VERSION
6032 else
6033     EXP_LIB_VERSION=$EXP_VERSION_NODOTS
6034 fi
6035 if test $iunix -eq 1 ; then
6036     EXP_LIB_VERSION=$EXP_VERSION_NODOTS
6037 fi
6038
6039 # also remove dots on systems that don't support filenames > 14
6040 # (are there systems which support shared libs and restrict filename lengths!?)
6041 echo $ac_n "checking for long file names""... $ac_c" 1>&6
6042 echo "configure:6043: checking for long file names" >&5
6043 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
6044   echo $ac_n "(cached) $ac_c" 1>&6
6045 else
6046   ac_cv_sys_long_file_names=yes
6047 # Test for long file names in all the places we know might matter:
6048 #      .                the current directory, where building will happen
6049 #      $prefix/lib      where we will be installing things
6050 #      $exec_prefix/lib likewise
6051 # eval it to expand exec_prefix.
6052 #      $TMPDIR          if set, where it might want to write temporary files
6053 # if $TMPDIR is not set:
6054 #      /tmp             where it might want to write temporary files
6055 #      /var/tmp         likewise
6056 #      /usr/tmp         likewise
6057 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
6058   ac_tmpdirs="$TMPDIR"
6059 else
6060   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
6061 fi
6062 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
6063   test -d $ac_dir || continue
6064   test -w $ac_dir || continue # It is less confusing to not echo anything here.
6065   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
6066   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
6067   val=`cat $ac_dir/conftest9012345 2>/dev/null`
6068   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
6069     ac_cv_sys_long_file_names=no
6070     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
6071     break
6072   fi
6073   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
6074 done
6075 fi
6076
6077 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
6078 if test $ac_cv_sys_long_file_names = yes; then
6079   cat >> confdefs.h <<\EOF
6080 #define HAVE_LONG_FILE_NAMES 1
6081 EOF
6082
6083 fi
6084
6085 if test $ac_cv_sys_long_file_names = no; then
6086     EXP_LIB_VERSION=$EXP_VERSION_NODOTS
6087 fi
6088
6089 EXP_BUILD_LIB_SPEC="-L`pwd` -lexpect${EXP_LIB_VERSION}"
6090 EXP_LIB_SPEC="-L\${libdir} -lexpect${EXP_LIB_VERSION}"
6091 EXP_UNSHARED_LIB_FILE=libexpect${EXP_LIB_VERSION}.a
6092 EXP_BUILD_LIB_SPEC=${EXP_UNSHARED_LIB_FILE}
6093
6094 echo $ac_n "checking for type of library to build""... $ac_c" 1>&6
6095 echo "configure:6096: checking for type of library to build" >&5
6096 if test "$enable_shared" = "yes" && test "x${TCL_SHLIB_SUFFIX}" != "x" ; then
6097   EXP_SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
6098 #  EXP_SHARED_LIB_FILE=libexpect$EXP_LIB_VERSION$TCL_SHLIB_SUFFIX
6099   eval "EXP_SHARED_LIB_FILE=libexpect${TCL_SHARED_LIB_SUFFIX}"
6100   EXP_LIB_FILE=$EXP_SHARED_LIB_FILE
6101   EXP_LIB_FILES="$EXP_SHARED_LIB_FILE $EXP_UNSHARED_LIB_FILE"
6102   echo "$ac_t""both shared and unshared" 1>&6
6103 else
6104   EXP_SHLIB_CFLAGS=
6105   EXP_SHARED_LIB_FILE="reconfigure_Tcl_for_shared_library"
6106   EXP_LIB_FILE=$EXP_UNSHARED_LIB_FILE
6107   EXP_LIB_FILES="$EXP_UNSHARED_LIB_FILE"
6108   echo "$ac_t""unshared" 1>&6
6109 fi
6110
6111 # CYGNUS LOCAL
6112 # We always link expect statically (against $EXP_UNSHARED_LIB_FILE)
6113 # so we can run it out of the build directory without hurting
6114 # ourselves and others.
6115
6116 # now broken out into EXP_AND_TCL_LIBS and EXP_AND_TK_LIBS.  Had to do this
6117 # in order to avoid repeating lib specs to which some systems object.
6118 EXP_AND_TCL_LIBS="$EXP_AND_TCL_LIBS $TCL_CC_SEARCH_FLAGS"
6119 EXP_AND_TK_LIBS="$EXP_AND_TK_LIBS $TCL_CC_SEARCH_FLAGS"
6120
6121 # Sigh - Tcl defines SHLIB_LD_LIBS to be either empty or ${LIBS} and
6122 # LIBS is intended to be expanded by Make.  But since we're too close
6123 # to hitting config's max symbols, pack everything together here and
6124 # do test ourselves.  Ugh.  
6125 #
6126 if test "x$TCL_SHLIB_LD_LIBS" = "x" ; then
6127         EXP_SHLIB_LD_LIBS=""
6128 else
6129         # seems a little strange to build in Tcl's build-lib, but
6130         # that's what Tk does.
6131         EXP_SHLIB_LD_LIBS="$TCL_BUILD_LIB_SPEC $TCL_DL_LIBS $LIBS -lc"
6132 fi
6133
6134 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
6135 echo "configure:6136: checking for Cygwin32 environment" >&5
6136 if eval "test \"`echo '$''{'ac_cv_cygwin32'+set}'`\" = set"; then
6137   echo $ac_n "(cached) $ac_c" 1>&6
6138 else
6139   cat > conftest.$ac_ext <<EOF
6140 #line 6141 "configure"
6141 #include "confdefs.h"
6142
6143 int main() {
6144 int main () { return __CYGWIN__; }
6145 ; return 0; }
6146 EOF
6147 if { (eval echo configure:6148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6148   rm -rf conftest*
6149   ac_cv_cygwin32=yes
6150 else
6151   echo "configure: failed program was:" >&5
6152   cat conftest.$ac_ext >&5
6153   rm -rf conftest*
6154   ac_cv_cygwin32=no
6155 fi
6156 rm -f conftest*
6157 rm -f conftest*
6158 fi
6159
6160 echo "$ac_t""$ac_cv_cygwin32" 1>&6
6161 CYGWIN=
6162 test "$ac_cv_cygwin32" = yes && CYGWIN=yes
6163 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
6164 echo "configure:6165: checking for executable suffix" >&5
6165 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
6166   echo $ac_n "(cached) $ac_c" 1>&6
6167 else
6168   if test "$CYGWIN" = yes; then
6169 ac_cv_exeext=.exe
6170 else
6171 cat > ac_c_test.c << 'EOF'
6172 int main() {
6173 /* Nothing needed here */
6174 }
6175 EOF
6176 ${CC-cc} -o ac_c_test $CFLAGS $CPPFLAGS $LDFLAGS ac_c_test.c $LIBS 1>&5
6177 ac_cv_exeext=`ls ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
6178 rm -f ac_c_test*
6179 fi
6180
6181 test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
6182 fi
6183 EXEEXT=""
6184 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
6185 echo "$ac_t""${ac_cv_exeext}" 1>&6
6186
6187
6188 #--------------------------------------------------------------------
6189 # This section is based on analogous thing in Tk installation. - DEL
6190 #       Various manipulations on the search path used at runtime to
6191 #       find shared libraries:
6192 #       2. On systems such as AIX and Ultrix that use "-L" as the
6193 #          search path option, colons cannot be used to separate
6194 #          directories from each other. Change colons to " -L".
6195 #       3. Create two sets of search flags, one for use in cc lines
6196 #          and the other for when the linker is invoked directly.  In
6197 #          the second case, '-Wl,' must be stripped off and commas must
6198 #          be replaced by spaces.
6199 #--------------------------------------------------------------------
6200
6201 LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'
6202
6203 # If Tcl and Expect are installed in different places, adjust the library
6204 # search path to reflect this.
6205
6206 if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then
6207     LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}"
6208 fi
6209
6210 if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
6211     LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'`
6212 fi
6213
6214 # The statement below is very tricky!  It actually *evaluates* the
6215 # string in TCL_LD_SEARCH_FLAGS, which causes a substitution of the
6216 # variable LIB_RUNTIME_DIR.
6217
6218 eval "EXP_CC_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\""
6219 if test "$GCC" = yes; then
6220   true
6221 else
6222   EXP_LD_SEARCH_FLAGS=`echo ${EXP_CC_SEARCH_FLAGS} |sed -e "s|-Wl,||g" -e "s|,| |g"`
6223 fi
6224
6225 #
6226 # Set up makefile substitutions
6227 #
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255 trap '' 1 2 15
6256
6257 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
6258
6259 test "x$prefix" = xNONE && prefix=$ac_default_prefix
6260 # Let make expand exec_prefix.
6261 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
6262
6263 # Any assignment to VPATH causes Sun make to only execute
6264 # the first set of double-colon rules, so remove it if not needed.
6265 # If there is a colon in the path, we need to keep it.
6266 if test "x$srcdir" = x.; then
6267   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
6268 fi
6269
6270 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
6271
6272 DEFS=-DHAVE_CONFIG_H
6273
6274 # Without the "./", some shells look in PATH for config.status.
6275 : ${CONFIG_STATUS=./config.status}
6276
6277 echo creating $CONFIG_STATUS
6278 rm -f $CONFIG_STATUS
6279 cat > $CONFIG_STATUS <<EOF
6280 #! /bin/sh
6281 # Generated automatically by configure.
6282 # Run this file to recreate the current configuration.
6283 # This directory was configured as follows,
6284 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6285 #
6286 # $0 $ac_configure_args
6287 #
6288 # Compiler output produced by configure, useful for debugging
6289 # configure, is in ./config.log if it exists.
6290
6291 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
6292 for ac_option
6293 do
6294   case "\$ac_option" in
6295   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
6296     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
6297     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
6298   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
6299     echo "$CONFIG_STATUS generated by autoconf version 2.13"
6300     exit 0 ;;
6301   -help | --help | --hel | --he | --h)
6302     echo "\$ac_cs_usage"; exit 0 ;;
6303   *) echo "\$ac_cs_usage"; exit 1 ;;
6304   esac
6305 done
6306
6307 ac_given_srcdir=$srcdir
6308 ac_given_INSTALL="$INSTALL"
6309
6310 trap 'rm -fr `echo "Makefile pkgIndex expect_cf.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
6311 EOF
6312 cat >> $CONFIG_STATUS <<EOF
6313
6314 # Protect against being on the right side of a sed subst in config.status.
6315 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
6316  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
6317 $ac_vpsub
6318 $extrasub
6319 s%@SHELL@%$SHELL%g
6320 s%@CFLAGS@%$CFLAGS%g
6321 s%@CPPFLAGS@%$CPPFLAGS%g
6322 s%@CXXFLAGS@%$CXXFLAGS%g
6323 s%@FFLAGS@%$FFLAGS%g
6324 s%@DEFS@%$DEFS%g
6325 s%@LDFLAGS@%$LDFLAGS%g
6326 s%@LIBS@%$LIBS%g
6327 s%@exec_prefix@%$exec_prefix%g
6328 s%@prefix@%$prefix%g
6329 s%@program_transform_name@%$program_transform_name%g
6330 s%@bindir@%$bindir%g
6331 s%@sbindir@%$sbindir%g
6332 s%@libexecdir@%$libexecdir%g
6333 s%@datadir@%$datadir%g
6334 s%@sysconfdir@%$sysconfdir%g
6335 s%@sharedstatedir@%$sharedstatedir%g
6336 s%@localstatedir@%$localstatedir%g
6337 s%@libdir@%$libdir%g
6338 s%@includedir@%$includedir%g
6339 s%@oldincludedir@%$oldincludedir%g
6340 s%@infodir@%$infodir%g
6341 s%@mandir@%$mandir%g
6342 s%@host@%$host%g
6343 s%@host_alias@%$host_alias%g
6344 s%@host_cpu@%$host_cpu%g
6345 s%@host_vendor@%$host_vendor%g
6346 s%@host_os@%$host_os%g
6347 s%@target@%$target%g
6348 s%@target_alias@%$target_alias%g
6349 s%@target_cpu@%$target_cpu%g
6350 s%@target_vendor@%$target_vendor%g
6351 s%@target_os@%$target_os%g
6352 s%@build@%$build%g
6353 s%@build_alias@%$build_alias%g
6354 s%@build_cpu@%$build_cpu%g
6355 s%@build_vendor@%$build_vendor%g
6356 s%@build_os@%$build_os%g
6357 s%@TCL_DEFS@%$TCL_DEFS%g
6358 s%@TCL_SHLIB_LD@%$TCL_SHLIB_LD%g
6359 s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
6360 s%@TCL_LD_FLAGS@%$TCL_LD_FLAGS%g
6361 s%@TCL_RANLIB@%$TCL_RANLIB%g
6362 s%@TCL_BUILD_LIB_SPEC@%$TCL_BUILD_LIB_SPEC%g
6363 s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
6364 s%@TCL_SHARED_LIB_SUFFIX@%$TCL_SHARED_LIB_SUFFIX%g
6365 s%@TK_VERSION@%$TK_VERSION%g
6366 s%@TK_DEFS@%$TK_DEFS%g
6367 s%@TK_XINCLUDES@%$TK_XINCLUDES%g
6368 s%@TK_XLIBSW@%$TK_XLIBSW%g
6369 s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g
6370 s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g
6371 s%@CC@%$CC%g
6372 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
6373 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
6374 s%@INSTALL_DATA@%$INSTALL_DATA%g
6375 s%@RANLIB@%$RANLIB%g
6376 s%@subdirs@%$subdirs%g
6377 s%@CPP@%$CPP%g
6378 s%@TCLHDIR@%$TCLHDIR%g
6379 s%@TCLHDIRDASHI@%$TCLHDIRDASHI%g
6380 s%@TCL_LIBRARY@%$TCL_LIBRARY%g
6381 s%@ITCLHDIR@%$ITCLHDIR%g
6382 s%@ITCLLIB@%$ITCLLIB%g
6383 s%@TKHDIRDASHI@%$TKHDIRDASHI%g
6384 s%@EXEEXT@%$EXEEXT%g
6385 s%@EXP_MAJOR_VERSION@%$EXP_MAJOR_VERSION%g
6386 s%@EXP_MINOR_VERSION@%$EXP_MINOR_VERSION%g
6387 s%@EXP_MICRO_VERSION@%$EXP_MICRO_VERSION%g
6388 s%@EXP_VERSION_FULL@%$EXP_VERSION_FULL%g
6389 s%@EXP_VERSION@%$EXP_VERSION%g
6390 s%@EXP_CONFIG_SHELL@%$EXP_CONFIG_SHELL%g
6391 s%@EXP_SHARED_LIB_FILE@%$EXP_SHARED_LIB_FILE%g
6392 s%@EXP_UNSHARED_LIB_FILE@%$EXP_UNSHARED_LIB_FILE%g
6393 s%@EXP_SHLIB_CFLAGS@%$EXP_SHLIB_CFLAGS%g
6394 s%@EXP_LIB_FILE@%$EXP_LIB_FILE%g
6395 s%@EXP_LIB_FILES@%$EXP_LIB_FILES%g
6396 s%@EXP_BUILD_LIB_SPEC@%$EXP_BUILD_LIB_SPEC%g
6397 s%@EXP_LIB_SPEC@%$EXP_LIB_SPEC%g
6398 s%@EXP_CFLAGS@%$EXP_CFLAGS%g
6399 s%@EXP_LDFLAGS@%$EXP_LDFLAGS%g
6400 s%@EXP_LD_SEARCH_FLAGS@%$EXP_LD_SEARCH_FLAGS%g
6401 s%@EXP_AND_TCL_LIBS@%$EXP_AND_TCL_LIBS%g
6402 s%@EXP_AND_TK_LIBS@%$EXP_AND_TK_LIBS%g
6403 s%@EXP_SHLIB_LD_LIBS@%$EXP_SHLIB_LD_LIBS%g
6404 s%@X_PROGS@%$X_PROGS%g
6405 s%@PTY_TYPE@%$PTY_TYPE%g
6406 s%@EVENT_TYPE@%$EVENT_TYPE%g
6407 s%@EVENT_ABLE@%$EVENT_ABLE%g
6408 s%@SETUID@%$SETUID%g
6409 s%@UNSHARED_RANLIB@%$UNSHARED_RANLIB%g
6410 s%@DEFAULT_STTY_ARGS@%$DEFAULT_STTY_ARGS%g
6411
6412 CEOF
6413 EOF
6414
6415 cat >> $CONFIG_STATUS <<\EOF
6416
6417 # Split the substitutions into bite-sized pieces for seds with
6418 # small command number limits, like on Digital OSF/1 and HP-UX.
6419 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
6420 ac_file=1 # Number of current file.
6421 ac_beg=1 # First line for current file.
6422 ac_end=$ac_max_sed_cmds # Line after last line for current file.
6423 ac_more_lines=:
6424 ac_sed_cmds=""
6425 while $ac_more_lines; do
6426   if test $ac_beg -gt 1; then
6427     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
6428   else
6429     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
6430   fi
6431   if test ! -s conftest.s$ac_file; then
6432     ac_more_lines=false
6433     rm -f conftest.s$ac_file
6434   else
6435     if test -z "$ac_sed_cmds"; then
6436       ac_sed_cmds="sed -f conftest.s$ac_file"
6437     else
6438       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
6439     fi
6440     ac_file=`expr $ac_file + 1`
6441     ac_beg=$ac_end
6442     ac_end=`expr $ac_end + $ac_max_sed_cmds`
6443   fi
6444 done
6445 if test -z "$ac_sed_cmds"; then
6446   ac_sed_cmds=cat
6447 fi
6448 EOF
6449
6450 cat >> $CONFIG_STATUS <<EOF
6451
6452 CONFIG_FILES=\${CONFIG_FILES-"Makefile pkgIndex"}
6453 EOF
6454 cat >> $CONFIG_STATUS <<\EOF
6455 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
6456   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
6457   case "$ac_file" in
6458   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
6459        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
6460   *) ac_file_in="${ac_file}.in" ;;
6461   esac
6462
6463   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
6464
6465   # Remove last slash and all that follows it.  Not all systems have dirname.
6466   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
6467   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
6468     # The file is in a subdirectory.
6469     test ! -d "$ac_dir" && mkdir "$ac_dir"
6470     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
6471     # A "../" for each directory in $ac_dir_suffix.
6472     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
6473   else
6474     ac_dir_suffix= ac_dots=
6475   fi
6476
6477   case "$ac_given_srcdir" in
6478   .)  srcdir=.
6479       if test -z "$ac_dots"; then top_srcdir=.
6480       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
6481   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
6482   *) # Relative path.
6483     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
6484     top_srcdir="$ac_dots$ac_given_srcdir" ;;
6485   esac
6486
6487   case "$ac_given_INSTALL" in
6488   [/$]*) INSTALL="$ac_given_INSTALL" ;;
6489   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
6490   esac
6491
6492   echo creating "$ac_file"
6493   rm -f "$ac_file"
6494   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
6495   case "$ac_file" in
6496   *Makefile*) ac_comsub="1i\\
6497 # $configure_input" ;;
6498   *) ac_comsub= ;;
6499   esac
6500
6501   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
6502   sed -e "$ac_comsub
6503 s%@configure_input@%$configure_input%g
6504 s%@srcdir@%$srcdir%g
6505 s%@top_srcdir@%$top_srcdir%g
6506 s%@INSTALL@%$INSTALL%g
6507 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
6508 fi; done
6509 rm -f conftest.s*
6510
6511 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
6512 # NAME is the cpp macro being defined and VALUE is the value it is being given.
6513 #
6514 # ac_d sets the value in "#define NAME VALUE" lines.
6515 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
6516 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
6517 ac_dC='\3'
6518 ac_dD='%g'
6519 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
6520 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
6521 ac_uB='\([      ]\)%\1#\2define\3'
6522 ac_uC=' '
6523 ac_uD='\4%g'
6524 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
6525 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
6526 ac_eB='$%\1#\2define\3'
6527 ac_eC=' '
6528 ac_eD='%g'
6529
6530 if test "${CONFIG_HEADERS+set}" != set; then
6531 EOF
6532 cat >> $CONFIG_STATUS <<EOF
6533   CONFIG_HEADERS="expect_cf.h"
6534 EOF
6535 cat >> $CONFIG_STATUS <<\EOF
6536 fi
6537 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
6538   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
6539   case "$ac_file" in
6540   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
6541        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
6542   *) ac_file_in="${ac_file}.in" ;;
6543   esac
6544
6545   echo creating $ac_file
6546
6547   rm -f conftest.frag conftest.in conftest.out
6548   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
6549   cat $ac_file_inputs > conftest.in
6550
6551 EOF
6552
6553 # Transform confdefs.h into a sed script conftest.vals that substitutes
6554 # the proper values into config.h.in to produce config.h.  And first:
6555 # Protect against being on the right side of a sed subst in config.status.
6556 # Protect against being in an unquoted here document in config.status.
6557 rm -f conftest.vals
6558 cat > conftest.hdr <<\EOF
6559 s/[\\&%]/\\&/g
6560 s%[\\$`]%\\&%g
6561 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
6562 s%ac_d%ac_u%gp
6563 s%ac_u%ac_e%gp
6564 EOF
6565 sed -n -f conftest.hdr confdefs.h > conftest.vals
6566 rm -f conftest.hdr
6567
6568 # This sed command replaces #undef with comments.  This is necessary, for
6569 # example, in the case of _POSIX_SOURCE, which is predefined and required
6570 # on some systems where configure will not decide to define it.
6571 cat >> conftest.vals <<\EOF
6572 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
6573 EOF
6574
6575 # Break up conftest.vals because some shells have a limit on
6576 # the size of here documents, and old seds have small limits too.
6577
6578 rm -f conftest.tail
6579 while :
6580 do
6581   ac_lines=`grep -c . conftest.vals`
6582   # grep -c gives empty output for an empty file on some AIX systems.
6583   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
6584   # Write a limited-size here document to conftest.frag.
6585   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
6586   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
6587   echo 'CEOF
6588   sed -f conftest.frag conftest.in > conftest.out
6589   rm -f conftest.in
6590   mv conftest.out conftest.in
6591 ' >> $CONFIG_STATUS
6592   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
6593   rm -f conftest.vals
6594   mv conftest.tail conftest.vals
6595 done
6596 rm -f conftest.vals
6597
6598 cat >> $CONFIG_STATUS <<\EOF
6599   rm -f conftest.frag conftest.h
6600   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
6601   cat conftest.in >> conftest.h
6602   rm -f conftest.in
6603   if cmp -s $ac_file conftest.h 2>/dev/null; then
6604     echo "$ac_file is unchanged"
6605     rm -f conftest.h
6606   else
6607     # Remove last slash and all that follows it.  Not all systems have dirname.
6608       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
6609       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
6610       # The file is in a subdirectory.
6611       test ! -d "$ac_dir" && mkdir "$ac_dir"
6612     fi
6613     rm -f $ac_file
6614     mv conftest.h $ac_file
6615   fi
6616 fi; done
6617
6618 EOF
6619 cat >> $CONFIG_STATUS <<EOF
6620
6621 EOF
6622 cat >> $CONFIG_STATUS <<\EOF
6623
6624 exit 0
6625 EOF
6626 chmod +x $CONFIG_STATUS
6627 rm -fr confdefs* $ac_clean_files
6628 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
6629
6630 if test "$no_recursion" != yes; then
6631
6632   # Remove --cache-file and --srcdir arguments so they do not pile up.
6633   ac_sub_configure_args=
6634   ac_prev=
6635   for ac_arg in $ac_configure_args; do
6636     if test -n "$ac_prev"; then
6637       ac_prev=
6638       continue
6639     fi
6640     case "$ac_arg" in
6641     -cache-file | --cache-file | --cache-fil | --cache-fi \
6642     | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
6643       ac_prev=cache_file ;;
6644     -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
6645     | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
6646       ;;
6647     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
6648       ac_prev=srcdir ;;
6649     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
6650       ;;
6651     *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
6652     esac
6653   done
6654
6655   for ac_config_dir in testsuite; do
6656
6657     # Do not complain, so a configure script can configure whichever
6658     # parts of a large source tree are present.
6659     if test ! -d $srcdir/$ac_config_dir; then
6660       continue
6661     fi
6662
6663     echo configuring in $ac_config_dir
6664
6665     case "$srcdir" in
6666     .) ;;
6667     *)
6668       if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
6669       else
6670         { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
6671       fi
6672       ;;
6673     esac
6674
6675     ac_popdir=`pwd`
6676     cd $ac_config_dir
6677
6678       # A "../" for each directory in /$ac_config_dir.
6679       ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
6680
6681     case "$srcdir" in
6682     .) # No --srcdir option.  We are building in place.
6683       ac_sub_srcdir=$srcdir ;;
6684     /*) # Absolute path.
6685       ac_sub_srcdir=$srcdir/$ac_config_dir ;;
6686     *) # Relative path.
6687       ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
6688     esac
6689
6690     # Check for guested configure; otherwise get Cygnus style configure.
6691     if test -f $ac_sub_srcdir/configure; then
6692       ac_sub_configure=$ac_sub_srcdir/configure
6693     elif test -f $ac_sub_srcdir/configure.in; then
6694       ac_sub_configure=$ac_configure
6695     else
6696       echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
6697       ac_sub_configure=
6698     fi
6699
6700     # The recursion is here.
6701     if test -n "$ac_sub_configure"; then
6702
6703       # Make the cache file name correct relative to the subdirectory.
6704       case "$cache_file" in
6705       /*) ac_sub_cache_file=$cache_file ;;
6706       *) # Relative path.
6707         ac_sub_cache_file="$ac_dots$cache_file" ;;
6708       esac
6709   case "$ac_given_INSTALL" in
6710         [/$]*) INSTALL="$ac_given_INSTALL" ;;
6711         *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
6712         esac
6713
6714       echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
6715       # The eval makes quoting arguments work.
6716       if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
6717       then :
6718       else
6719         { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
6720       fi
6721     fi
6722
6723     cd $ac_popdir
6724   done
6725 fi
6726