OSDN Git Service

Follow links from the gdb the user ran to the actual executable, so
[pf3gnuchains/sourceware.git] / tcl / cygwin / 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   --disable-load          disallow dynamic loading and "load" command"
16 ac_help="$ac_help
17   --enable-shared         build libtcl as a shared library"
18
19 # Initialize some variables set by options.
20 # The variables have the same names as the options, with
21 # dashes changed to underlines.
22 build=NONE
23 cache_file=./config.cache
24 exec_prefix=NONE
25 host=NONE
26 no_create=
27 nonopt=NONE
28 no_recursion=
29 prefix=NONE
30 program_prefix=NONE
31 program_suffix=NONE
32 program_transform_name=s,x,x,
33 silent=
34 site=
35 srcdir=
36 target=NONE
37 verbose=
38 x_includes=NONE
39 x_libraries=NONE
40 bindir='${exec_prefix}/bin'
41 sbindir='${exec_prefix}/sbin'
42 libexecdir='${exec_prefix}/libexec'
43 datadir='${prefix}/share'
44 sysconfdir='${prefix}/etc'
45 sharedstatedir='${prefix}/com'
46 localstatedir='${prefix}/var'
47 libdir='${exec_prefix}/lib'
48 includedir='${prefix}/include'
49 oldincludedir='/usr/include'
50 infodir='${prefix}/info'
51 mandir='${prefix}/man'
52
53 # Initialize some other variables.
54 subdirs=
55 MFLAGS= MAKEFLAGS=
56 SHELL=${CONFIG_SHELL-/bin/sh}
57 # Maximum number of lines to put in a shell here document.
58 ac_max_here_lines=12
59
60 ac_prev=
61 for ac_option
62 do
63
64   # If the previous option needs an argument, assign it.
65   if test -n "$ac_prev"; then
66     eval "$ac_prev=\$ac_option"
67     ac_prev=
68     continue
69   fi
70
71   case "$ac_option" in
72   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
73   *) ac_optarg= ;;
74   esac
75
76   # Accept the important Cygnus configure options, so we can diagnose typos.
77
78   case "$ac_option" in
79
80   -bindir | --bindir | --bindi | --bind | --bin | --bi)
81     ac_prev=bindir ;;
82   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
83     bindir="$ac_optarg" ;;
84
85   -build | --build | --buil | --bui | --bu)
86     ac_prev=build ;;
87   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
88     build="$ac_optarg" ;;
89
90   -cache-file | --cache-file | --cache-fil | --cache-fi \
91   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
92     ac_prev=cache_file ;;
93   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
94   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
95     cache_file="$ac_optarg" ;;
96
97   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
98     ac_prev=datadir ;;
99   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
100   | --da=*)
101     datadir="$ac_optarg" ;;
102
103   -disable-* | --disable-*)
104     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
105     # Reject names that are not valid shell variable names.
106     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
107       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
108     fi
109     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
110     eval "enable_${ac_feature}=no" ;;
111
112   -enable-* | --enable-*)
113     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
114     # Reject names that are not valid shell variable names.
115     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
116       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
117     fi
118     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
119     case "$ac_option" in
120       *=*) ;;
121       *) ac_optarg=yes ;;
122     esac
123     eval "enable_${ac_feature}='$ac_optarg'" ;;
124
125   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
126   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
127   | --exec | --exe | --ex)
128     ac_prev=exec_prefix ;;
129   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
130   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
131   | --exec=* | --exe=* | --ex=*)
132     exec_prefix="$ac_optarg" ;;
133
134   -gas | --gas | --ga | --g)
135     # Obsolete; use --with-gas.
136     with_gas=yes ;;
137
138   -help | --help | --hel | --he)
139     # Omit some internal or obsolete options to make the list less imposing.
140     # This message is too long to be a string in the A/UX 3.1 sh.
141     cat << EOF
142 Usage: configure [options] [host]
143 Options: [defaults in brackets after descriptions]
144 Configuration:
145   --cache-file=FILE       cache test results in FILE
146   --help                  print this message
147   --no-create             do not create output files
148   --quiet, --silent       do not print \`checking...' messages
149   --version               print the version of autoconf that created configure
150 Directory and file names:
151   --prefix=PREFIX         install architecture-independent files in PREFIX
152                           [$ac_default_prefix]
153   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
154                           [same as prefix]
155   --bindir=DIR            user executables in DIR [EPREFIX/bin]
156   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
157   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
158   --datadir=DIR           read-only architecture-independent data in DIR
159                           [PREFIX/share]
160   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
161   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
162                           [PREFIX/com]
163   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
164   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
165   --includedir=DIR        C header files in DIR [PREFIX/include]
166   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
167   --infodir=DIR           info documentation in DIR [PREFIX/info]
168   --mandir=DIR            man documentation in DIR [PREFIX/man]
169   --srcdir=DIR            find the sources in DIR [configure dir or ..]
170   --program-prefix=PREFIX prepend PREFIX to installed program names
171   --program-suffix=SUFFIX append SUFFIX to installed program names
172   --program-transform-name=PROGRAM
173                           run sed PROGRAM on installed program names
174 EOF
175     cat << EOF
176 Host type:
177   --build=BUILD           configure for building on BUILD [BUILD=HOST]
178   --host=HOST             configure for HOST [guessed]
179   --target=TARGET         configure for TARGET [TARGET=HOST]
180 Features and packages:
181   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
182   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
183   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
184   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
185   --x-includes=DIR        X include files are in DIR
186   --x-libraries=DIR       X library files are in DIR
187 EOF
188     if test -n "$ac_help"; then
189       echo "--enable and --with options recognized:$ac_help"
190     fi
191     exit 0 ;;
192
193   -host | --host | --hos | --ho)
194     ac_prev=host ;;
195   -host=* | --host=* | --hos=* | --ho=*)
196     host="$ac_optarg" ;;
197
198   -includedir | --includedir | --includedi | --included | --include \
199   | --includ | --inclu | --incl | --inc)
200     ac_prev=includedir ;;
201   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
202   | --includ=* | --inclu=* | --incl=* | --inc=*)
203     includedir="$ac_optarg" ;;
204
205   -infodir | --infodir | --infodi | --infod | --info | --inf)
206     ac_prev=infodir ;;
207   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
208     infodir="$ac_optarg" ;;
209
210   -libdir | --libdir | --libdi | --libd)
211     ac_prev=libdir ;;
212   -libdir=* | --libdir=* | --libdi=* | --libd=*)
213     libdir="$ac_optarg" ;;
214
215   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
216   | --libexe | --libex | --libe)
217     ac_prev=libexecdir ;;
218   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
219   | --libexe=* | --libex=* | --libe=*)
220     libexecdir="$ac_optarg" ;;
221
222   -localstatedir | --localstatedir | --localstatedi | --localstated \
223   | --localstate | --localstat | --localsta | --localst \
224   | --locals | --local | --loca | --loc | --lo)
225     ac_prev=localstatedir ;;
226   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
227   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
228   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
229     localstatedir="$ac_optarg" ;;
230
231   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
232     ac_prev=mandir ;;
233   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
234     mandir="$ac_optarg" ;;
235
236   -nfp | --nfp | --nf)
237     # Obsolete; use --without-fp.
238     with_fp=no ;;
239
240   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
241   | --no-cr | --no-c)
242     no_create=yes ;;
243
244   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
245   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
246     no_recursion=yes ;;
247
248   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
249   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
250   | --oldin | --oldi | --old | --ol | --o)
251     ac_prev=oldincludedir ;;
252   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
253   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
254   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
255     oldincludedir="$ac_optarg" ;;
256
257   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
258     ac_prev=prefix ;;
259   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
260     prefix="$ac_optarg" ;;
261
262   -program-prefix | --program-prefix | --program-prefi | --program-pref \
263   | --program-pre | --program-pr | --program-p)
264     ac_prev=program_prefix ;;
265   -program-prefix=* | --program-prefix=* | --program-prefi=* \
266   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
267     program_prefix="$ac_optarg" ;;
268
269   -program-suffix | --program-suffix | --program-suffi | --program-suff \
270   | --program-suf | --program-su | --program-s)
271     ac_prev=program_suffix ;;
272   -program-suffix=* | --program-suffix=* | --program-suffi=* \
273   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
274     program_suffix="$ac_optarg" ;;
275
276   -program-transform-name | --program-transform-name \
277   | --program-transform-nam | --program-transform-na \
278   | --program-transform-n | --program-transform- \
279   | --program-transform | --program-transfor \
280   | --program-transfo | --program-transf \
281   | --program-trans | --program-tran \
282   | --progr-tra | --program-tr | --program-t)
283     ac_prev=program_transform_name ;;
284   -program-transform-name=* | --program-transform-name=* \
285   | --program-transform-nam=* | --program-transform-na=* \
286   | --program-transform-n=* | --program-transform-=* \
287   | --program-transform=* | --program-transfor=* \
288   | --program-transfo=* | --program-transf=* \
289   | --program-trans=* | --program-tran=* \
290   | --progr-tra=* | --program-tr=* | --program-t=*)
291     program_transform_name="$ac_optarg" ;;
292
293   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
294   | -silent | --silent | --silen | --sile | --sil)
295     silent=yes ;;
296
297   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
298     ac_prev=sbindir ;;
299   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
300   | --sbi=* | --sb=*)
301     sbindir="$ac_optarg" ;;
302
303   -sharedstatedir | --sharedstatedir | --sharedstatedi \
304   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
305   | --sharedst | --shareds | --shared | --share | --shar \
306   | --sha | --sh)
307     ac_prev=sharedstatedir ;;
308   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
309   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
310   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
311   | --sha=* | --sh=*)
312     sharedstatedir="$ac_optarg" ;;
313
314   -site | --site | --sit)
315     ac_prev=site ;;
316   -site=* | --site=* | --sit=*)
317     site="$ac_optarg" ;;
318
319   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
320     ac_prev=srcdir ;;
321   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
322     srcdir="$ac_optarg" ;;
323
324   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
325   | --syscon | --sysco | --sysc | --sys | --sy)
326     ac_prev=sysconfdir ;;
327   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
328   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
329     sysconfdir="$ac_optarg" ;;
330
331   -target | --target | --targe | --targ | --tar | --ta | --t)
332     ac_prev=target ;;
333   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
334     target="$ac_optarg" ;;
335
336   -v | -verbose | --verbose | --verbos | --verbo | --verb)
337     verbose=yes ;;
338
339   -version | --version | --versio | --versi | --vers)
340     echo "configure generated by autoconf version 2.13"
341     exit 0 ;;
342
343   -with-* | --with-*)
344     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
345     # Reject names that are not valid shell variable names.
346     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
347       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
348     fi
349     ac_package=`echo $ac_package| sed 's/-/_/g'`
350     case "$ac_option" in
351       *=*) ;;
352       *) ac_optarg=yes ;;
353     esac
354     eval "with_${ac_package}='$ac_optarg'" ;;
355
356   -without-* | --without-*)
357     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
358     # Reject names that are not valid shell variable names.
359     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
360       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
361     fi
362     ac_package=`echo $ac_package| sed 's/-/_/g'`
363     eval "with_${ac_package}=no" ;;
364
365   --x)
366     # Obsolete; use --with-x.
367     with_x=yes ;;
368
369   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
370   | --x-incl | --x-inc | --x-in | --x-i)
371     ac_prev=x_includes ;;
372   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
373   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
374     x_includes="$ac_optarg" ;;
375
376   -x-libraries | --x-libraries | --x-librarie | --x-librari \
377   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
378     ac_prev=x_libraries ;;
379   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
380   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
381     x_libraries="$ac_optarg" ;;
382
383   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
384     ;;
385
386   *)
387     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
388       echo "configure: warning: $ac_option: invalid host type" 1>&2
389     fi
390     if test "x$nonopt" != xNONE; then
391       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
392     fi
393     nonopt="$ac_option"
394     ;;
395
396   esac
397 done
398
399 if test -n "$ac_prev"; then
400   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
401 fi
402
403 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
404
405 # File descriptor usage:
406 # 0 standard input
407 # 1 file creation
408 # 2 errors and warnings
409 # 3 some systems may open it to /dev/tty
410 # 4 used on the Kubota Titan
411 # 6 checking for... messages and results
412 # 5 compiler messages saved in config.log
413 if test "$silent" = yes; then
414   exec 6>/dev/null
415 else
416   exec 6>&1
417 fi
418 exec 5>./config.log
419
420 echo "\
421 This file contains any messages produced by compilers while
422 running configure, to aid debugging if configure makes a mistake.
423 " 1>&5
424
425 # Strip out --no-create and --no-recursion so they do not pile up.
426 # Also quote any args containing shell metacharacters.
427 ac_configure_args=
428 for ac_arg
429 do
430   case "$ac_arg" in
431   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
432   | --no-cr | --no-c) ;;
433   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
434   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
435   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
436   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
437   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
438   esac
439 done
440
441 # NLS nuisances.
442 # Only set these to C if already set.  These must not be set unconditionally
443 # because not all systems understand e.g. LANG=C (notably SCO).
444 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
445 # Non-C LC_CTYPE values break the ctype check.
446 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
447 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
448 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
449 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
450
451 # confdefs.h avoids OS command line length limits that DEFS can exceed.
452 rm -rf conftest* confdefs.h
453 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
454 echo > confdefs.h
455
456 # A filename unique to this package, relative to the directory that
457 # configure is in, which we can look for to find out if srcdir is correct.
458 ac_unique_file=../generic/tcl.h
459
460 # Find the source files, if location was not specified.
461 if test -z "$srcdir"; then
462   ac_srcdir_defaulted=yes
463   # Try the directory containing this script, then its parent.
464   ac_prog=$0
465   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
466   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
467   srcdir=$ac_confdir
468   if test ! -r $srcdir/$ac_unique_file; then
469     srcdir=..
470   fi
471 else
472   ac_srcdir_defaulted=no
473 fi
474 if test ! -r $srcdir/$ac_unique_file; then
475   if test "$ac_srcdir_defaulted" = yes; then
476     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
477   else
478     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
479   fi
480 fi
481 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
482
483 # Prefer explicitly selected file to automatically selected ones.
484 if test -z "$CONFIG_SITE"; then
485   if test "x$prefix" != xNONE; then
486     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
487   else
488     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
489   fi
490 fi
491 for ac_site_file in $CONFIG_SITE; do
492   if test -r "$ac_site_file"; then
493     echo "loading site script $ac_site_file"
494     . "$ac_site_file"
495   fi
496 done
497
498 if test -r "$cache_file"; then
499   echo "loading cache $cache_file"
500   . $cache_file
501 else
502   echo "creating cache $cache_file"
503   > $cache_file
504 fi
505
506 ac_ext=c
507 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
508 ac_cpp='$CPP $CPPFLAGS'
509 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
510 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
511 cross_compiling=$ac_cv_prog_cc_cross
512
513 ac_exeext=
514 ac_objext=o
515 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
516   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
517   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
518     ac_n= ac_c='
519 ' ac_t='        '
520   else
521     ac_n=-n ac_c= ac_t=
522   fi
523 else
524   ac_n= ac_c='\c' ac_t=
525 fi
526
527
528 # SCCS: @(#) configure.in 1.18 98/08/12 17:29:39
529
530 TCL_VERSION=8.0
531 TCL_MAJOR_VERSION=8
532 TCL_MINOR_VERSION=0
533 TCL_PATCH_LEVEL=".3"
534 VERSION=${TCL_VERSION}
535
536 if test "${prefix}" = "NONE"; then
537     prefix=/usr/local
538 fi
539 if test "${exec_prefix}" = "NONE"; then
540     exec_prefix=$prefix
541 fi
542 TCL_SRC_DIR=`cd $srcdir/..; pwd`
543
544 # Extract the first word of "ranlib", so it can be a program name with args.
545 set dummy ranlib; ac_word=$2
546 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
547 echo "configure:548: checking for $ac_word" >&5
548 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
549   echo $ac_n "(cached) $ac_c" 1>&6
550 else
551   if test -n "$RANLIB"; then
552   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
553 else
554   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
555   ac_dummy="$PATH"
556   for ac_dir in $ac_dummy; do
557     test -z "$ac_dir" && ac_dir=.
558     if test -f $ac_dir/$ac_word; then
559       ac_cv_prog_RANLIB="ranlib"
560       break
561     fi
562   done
563   IFS="$ac_save_ifs"
564   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
565 fi
566 fi
567 RANLIB="$ac_cv_prog_RANLIB"
568 if test -n "$RANLIB"; then
569   echo "$ac_t""$RANLIB" 1>&6
570 else
571   echo "$ac_t""no" 1>&6
572 fi
573
574     # Extract the first word of "gcc", so it can be a program name with args.
575 set dummy gcc; ac_word=$2
576 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
577 echo "configure:578: checking for $ac_word" >&5
578 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
579   echo $ac_n "(cached) $ac_c" 1>&6
580 else
581   if test -n "$CC"; then
582   ac_cv_prog_CC="$CC" # Let the user override the test.
583 else
584   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
585   ac_dummy="$PATH"
586   for ac_dir in $ac_dummy; do
587     test -z "$ac_dir" && ac_dir=.
588     if test -f $ac_dir/$ac_word; then
589       ac_cv_prog_CC="gcc"
590       break
591     fi
592   done
593   IFS="$ac_save_ifs"
594 fi
595 fi
596 CC="$ac_cv_prog_CC"
597 if test -n "$CC"; then
598   echo "$ac_t""$CC" 1>&6
599 else
600   echo "$ac_t""no" 1>&6
601 fi
602
603 if test -z "$CC"; then
604   # Extract the first word of "cc", so it can be a program name with args.
605 set dummy cc; ac_word=$2
606 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
607 echo "configure:608: checking for $ac_word" >&5
608 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
609   echo $ac_n "(cached) $ac_c" 1>&6
610 else
611   if test -n "$CC"; then
612   ac_cv_prog_CC="$CC" # Let the user override the test.
613 else
614   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
615   ac_prog_rejected=no
616   ac_dummy="$PATH"
617   for ac_dir in $ac_dummy; do
618     test -z "$ac_dir" && ac_dir=.
619     if test -f $ac_dir/$ac_word; then
620       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
621         ac_prog_rejected=yes
622         continue
623       fi
624       ac_cv_prog_CC="cc"
625       break
626     fi
627   done
628   IFS="$ac_save_ifs"
629 if test $ac_prog_rejected = yes; then
630   # We found a bogon in the path, so make sure we never use it.
631   set dummy $ac_cv_prog_CC
632   shift
633   if test $# -gt 0; then
634     # We chose a different compiler from the bogus one.
635     # However, it has the same basename, so the bogon will be chosen
636     # first if we set CC to just the basename; use the full file name.
637     shift
638     set dummy "$ac_dir/$ac_word" "$@"
639     shift
640     ac_cv_prog_CC="$@"
641   fi
642 fi
643 fi
644 fi
645 CC="$ac_cv_prog_CC"
646 if test -n "$CC"; then
647   echo "$ac_t""$CC" 1>&6
648 else
649   echo "$ac_t""no" 1>&6
650 fi
651
652   if test -z "$CC"; then
653     case "`uname -s`" in
654     *win32* | *WIN32*)
655       # Extract the first word of "cl", so it can be a program name with args.
656 set dummy cl; ac_word=$2
657 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
658 echo "configure:659: checking for $ac_word" >&5
659 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
660   echo $ac_n "(cached) $ac_c" 1>&6
661 else
662   if test -n "$CC"; then
663   ac_cv_prog_CC="$CC" # Let the user override the test.
664 else
665   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
666   ac_dummy="$PATH"
667   for ac_dir in $ac_dummy; do
668     test -z "$ac_dir" && ac_dir=.
669     if test -f $ac_dir/$ac_word; then
670       ac_cv_prog_CC="cl"
671       break
672     fi
673   done
674   IFS="$ac_save_ifs"
675 fi
676 fi
677 CC="$ac_cv_prog_CC"
678 if test -n "$CC"; then
679   echo "$ac_t""$CC" 1>&6
680 else
681   echo "$ac_t""no" 1>&6
682 fi
683  ;;
684     esac
685   fi
686   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
687 fi
688
689 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
690 echo "configure:691: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
691
692 ac_ext=c
693 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
694 ac_cpp='$CPP $CPPFLAGS'
695 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
696 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
697 cross_compiling=$ac_cv_prog_cc_cross
698
699 cat > conftest.$ac_ext << EOF
700
701 #line 702 "configure"
702 #include "confdefs.h"
703
704 main(){return(0);}
705 EOF
706 if { (eval echo configure:707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
707   ac_cv_prog_cc_works=yes
708   # If we can't run a trivial program, we are probably using a cross compiler.
709   if (./conftest; exit) 2>/dev/null; then
710     ac_cv_prog_cc_cross=no
711   else
712     ac_cv_prog_cc_cross=yes
713   fi
714 else
715   echo "configure: failed program was:" >&5
716   cat conftest.$ac_ext >&5
717   ac_cv_prog_cc_works=no
718 fi
719 rm -fr conftest*
720 ac_ext=c
721 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
722 ac_cpp='$CPP $CPPFLAGS'
723 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
724 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
725 cross_compiling=$ac_cv_prog_cc_cross
726
727 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
728 if test $ac_cv_prog_cc_works = no; then
729   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
730 fi
731 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
732 echo "configure:733: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
733 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
734 cross_compiling=$ac_cv_prog_cc_cross
735
736 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
737 echo "configure:738: checking whether we are using GNU C" >&5
738 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
739   echo $ac_n "(cached) $ac_c" 1>&6
740 else
741   cat > conftest.c <<EOF
742 #ifdef __GNUC__
743   yes;
744 #endif
745 EOF
746 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
747   ac_cv_prog_gcc=yes
748 else
749   ac_cv_prog_gcc=no
750 fi
751 fi
752
753 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
754
755 if test $ac_cv_prog_gcc = yes; then
756   GCC=yes
757 else
758   GCC=
759 fi
760
761 ac_test_CFLAGS="${CFLAGS+set}"
762 ac_save_CFLAGS="$CFLAGS"
763 CFLAGS=
764 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
765 echo "configure:766: checking whether ${CC-cc} accepts -g" >&5
766 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
767   echo $ac_n "(cached) $ac_c" 1>&6
768 else
769   echo 'void f(){}' > conftest.c
770 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
771   ac_cv_prog_cc_g=yes
772 else
773   ac_cv_prog_cc_g=no
774 fi
775 rm -f conftest*
776
777 fi
778
779 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
780 if test "$ac_test_CFLAGS" = set; then
781   CFLAGS="$ac_save_CFLAGS"
782 elif test $ac_cv_prog_cc_g = yes; then
783   if test "$GCC" = yes; then
784     CFLAGS="-g -O2"
785   else
786     CFLAGS="-g"
787   fi
788 else
789   if test "$GCC" = yes; then
790     CFLAGS="-O2"
791   else
792     CFLAGS=
793   fi
794 fi
795
796
797 # CYGNUS LOCAL
798 # dje/win32
799 AR=${AR-ar}
800 # We need this for substitutions in Makefile.in.
801 ac_aux_dir=
802 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
803   if test -f $ac_dir/install-sh; then
804     ac_aux_dir=$ac_dir
805     ac_install_sh="$ac_aux_dir/install-sh -c"
806     break
807   elif test -f $ac_dir/install.sh; then
808     ac_aux_dir=$ac_dir
809     ac_install_sh="$ac_aux_dir/install.sh -c"
810     break
811   fi
812 done
813 if test -z "$ac_aux_dir"; then
814   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
815 fi
816 ac_config_guess=$ac_aux_dir/config.guess
817 ac_config_sub=$ac_aux_dir/config.sub
818 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
819
820 # Find a good install program.  We prefer a C program (faster),
821 # so one script is as good as another.  But avoid the broken or
822 # incompatible versions:
823 # SysV /etc/install, /usr/sbin/install
824 # SunOS /usr/etc/install
825 # IRIX /sbin/install
826 # AIX /bin/install
827 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
828 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
829 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
830 # ./install, which can be erroneously created by make from ./install.sh.
831 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
832 echo "configure:833: checking for a BSD compatible install" >&5
833 if test -z "$INSTALL"; then
834 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
835   echo $ac_n "(cached) $ac_c" 1>&6
836 else
837     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
838   for ac_dir in $PATH; do
839     # Account for people who put trailing slashes in PATH elements.
840     case "$ac_dir/" in
841     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
842     *)
843       # OSF1 and SCO ODT 3.0 have their own names for install.
844       # Don't use installbsd from OSF since it installs stuff as root
845       # by default.
846       for ac_prog in ginstall scoinst install; do
847         if test -f $ac_dir/$ac_prog; then
848           if test $ac_prog = install &&
849             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
850             # AIX install.  It has an incompatible calling convention.
851             :
852           else
853             ac_cv_path_install="$ac_dir/$ac_prog -c"
854             break 2
855           fi
856         fi
857       done
858       ;;
859     esac
860   done
861   IFS="$ac_save_IFS"
862
863 fi
864   if test "${ac_cv_path_install+set}" = set; then
865     INSTALL="$ac_cv_path_install"
866   else
867     # As a last resort, use the slow shell script.  We don't cache a
868     # path for INSTALL within a source directory, because that will
869     # break other packages using the cache if that directory is
870     # removed, or if the path is relative.
871     INSTALL="$ac_install_sh"
872   fi
873 fi
874 echo "$ac_t""$INSTALL" 1>&6
875
876 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
877 # It thinks the first close brace ends the variable substitution.
878 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
879
880 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
881
882 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
883
884 # END CYGNUS LOCAL
885
886 #--------------------------------------------------------------------
887 # CYGNUS LOCAL:
888 # This is for LynxOS, which needs a flag to force true POSIX when
889 # building. It's weirder than that, cause the flag varies depending
890 # how old the compiler is. So...
891 # -X is for the old "cc" and "gcc" (based on 1.42)
892 # -mposix is for the new gcc (at least 2.5.8)
893 # This modifies the value of $CC to have the POSIX flag added
894 # so everything will configure correctly.
895 #--------------------------------------------------------------------
896 CY_AC_TCL_LYNX_POSIX
897
898 # set the warning flags depending on whether or not we are using gcc
899 if test "${GCC}" = "yes" ; then
900     CFLAGS_WARNING="-Wall -Wconversion"
901 else
902     CFLAGS_WARNING=""
903 fi
904
905 #--------------------------------------------------------------------
906 #       Supply substitutes for missing POSIX library procedures, or
907 #       set flags so Tcl uses alternate procedures.
908 #--------------------------------------------------------------------
909
910 # Check if Posix compliant getcwd exists, if not we'll use getwd.
911 for ac_func in getcwd
912 do
913 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
914 echo "configure:915: checking for $ac_func" >&5
915 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
916   echo $ac_n "(cached) $ac_c" 1>&6
917 else
918   cat > conftest.$ac_ext <<EOF
919 #line 920 "configure"
920 #include "confdefs.h"
921 /* System header to define __stub macros and hopefully few prototypes,
922     which can conflict with char $ac_func(); below.  */
923 #include <assert.h>
924 /* Override any gcc2 internal prototype to avoid an error.  */
925 /* We use char because int might match the return type of a gcc2
926     builtin and then its argument prototype would still apply.  */
927 char $ac_func();
928
929 int main() {
930
931 /* The GNU C library defines this for functions which it implements
932     to always fail with ENOSYS.  Some functions are actually named
933     something starting with __ and the normal name is an alias.  */
934 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
935 choke me
936 #else
937 $ac_func();
938 #endif
939
940 ; return 0; }
941 EOF
942 if { (eval echo configure:943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
943   rm -rf conftest*
944   eval "ac_cv_func_$ac_func=yes"
945 else
946   echo "configure: failed program was:" >&5
947   cat conftest.$ac_ext >&5
948   rm -rf conftest*
949   eval "ac_cv_func_$ac_func=no"
950 fi
951 rm -f conftest*
952 fi
953
954 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
955   echo "$ac_t""yes" 1>&6
956     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
957   cat >> confdefs.h <<EOF
958 #define $ac_tr_func 1
959 EOF
960  
961 else
962   echo "$ac_t""no" 1>&6
963 cat >> confdefs.h <<\EOF
964 #define USEGETWD 1
965 EOF
966
967 fi
968 done
969
970 # Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really
971 # define USEGETWD even if the posix getcwd exists. Add a test ?
972
973 for ac_func in opendir strstr
974 do
975 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
976 echo "configure:977: checking for $ac_func" >&5
977 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
978   echo $ac_n "(cached) $ac_c" 1>&6
979 else
980   cat > conftest.$ac_ext <<EOF
981 #line 982 "configure"
982 #include "confdefs.h"
983 /* System header to define __stub macros and hopefully few prototypes,
984     which can conflict with char $ac_func(); below.  */
985 #include <assert.h>
986 /* Override any gcc2 internal prototype to avoid an error.  */
987 /* We use char because int might match the return type of a gcc2
988     builtin and then its argument prototype would still apply.  */
989 char $ac_func();
990
991 int main() {
992
993 /* The GNU C library defines this for functions which it implements
994     to always fail with ENOSYS.  Some functions are actually named
995     something starting with __ and the normal name is an alias.  */
996 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
997 choke me
998 #else
999 $ac_func();
1000 #endif
1001
1002 ; return 0; }
1003 EOF
1004 if { (eval echo configure:1005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1005   rm -rf conftest*
1006   eval "ac_cv_func_$ac_func=yes"
1007 else
1008   echo "configure: failed program was:" >&5
1009   cat conftest.$ac_ext >&5
1010   rm -rf conftest*
1011   eval "ac_cv_func_$ac_func=no"
1012 fi
1013 rm -f conftest*
1014 fi
1015
1016 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1017   echo "$ac_t""yes" 1>&6
1018     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1019   cat >> confdefs.h <<EOF
1020 #define $ac_tr_func 1
1021 EOF
1022  
1023 else
1024   echo "$ac_t""no" 1>&6
1025 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
1026 fi
1027 done
1028
1029
1030
1031 for ac_func in strtol tmpnam waitpid
1032 do
1033 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1034 echo "configure:1035: checking for $ac_func" >&5
1035 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1036   echo $ac_n "(cached) $ac_c" 1>&6
1037 else
1038   cat > conftest.$ac_ext <<EOF
1039 #line 1040 "configure"
1040 #include "confdefs.h"
1041 /* System header to define __stub macros and hopefully few prototypes,
1042     which can conflict with char $ac_func(); below.  */
1043 #include <assert.h>
1044 /* Override any gcc2 internal prototype to avoid an error.  */
1045 /* We use char because int might match the return type of a gcc2
1046     builtin and then its argument prototype would still apply.  */
1047 char $ac_func();
1048
1049 int main() {
1050
1051 /* The GNU C library defines this for functions which it implements
1052     to always fail with ENOSYS.  Some functions are actually named
1053     something starting with __ and the normal name is an alias.  */
1054 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1055 choke me
1056 #else
1057 $ac_func();
1058 #endif
1059
1060 ; return 0; }
1061 EOF
1062 if { (eval echo configure:1063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1063   rm -rf conftest*
1064   eval "ac_cv_func_$ac_func=yes"
1065 else
1066   echo "configure: failed program was:" >&5
1067   cat conftest.$ac_ext >&5
1068   rm -rf conftest*
1069   eval "ac_cv_func_$ac_func=no"
1070 fi
1071 rm -f conftest*
1072 fi
1073
1074 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1075   echo "$ac_t""yes" 1>&6
1076     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1077   cat >> confdefs.h <<EOF
1078 #define $ac_tr_func 1
1079 EOF
1080  
1081 else
1082   echo "$ac_t""no" 1>&6
1083 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
1084 fi
1085 done
1086
1087
1088 echo $ac_n "checking for strerror""... $ac_c" 1>&6
1089 echo "configure:1090: checking for strerror" >&5
1090 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
1091   echo $ac_n "(cached) $ac_c" 1>&6
1092 else
1093   cat > conftest.$ac_ext <<EOF
1094 #line 1095 "configure"
1095 #include "confdefs.h"
1096 /* System header to define __stub macros and hopefully few prototypes,
1097     which can conflict with char strerror(); below.  */
1098 #include <assert.h>
1099 /* Override any gcc2 internal prototype to avoid an error.  */
1100 /* We use char because int might match the return type of a gcc2
1101     builtin and then its argument prototype would still apply.  */
1102 char strerror();
1103
1104 int main() {
1105
1106 /* The GNU C library defines this for functions which it implements
1107     to always fail with ENOSYS.  Some functions are actually named
1108     something starting with __ and the normal name is an alias.  */
1109 #if defined (__stub_strerror) || defined (__stub___strerror)
1110 choke me
1111 #else
1112 strerror();
1113 #endif
1114
1115 ; return 0; }
1116 EOF
1117 if { (eval echo configure:1118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1118   rm -rf conftest*
1119   eval "ac_cv_func_strerror=yes"
1120 else
1121   echo "configure: failed program was:" >&5
1122   cat conftest.$ac_ext >&5
1123   rm -rf conftest*
1124   eval "ac_cv_func_strerror=no"
1125 fi
1126 rm -f conftest*
1127 fi
1128
1129 if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then
1130   echo "$ac_t""yes" 1>&6
1131   :
1132 else
1133   echo "$ac_t""no" 1>&6
1134 cat >> confdefs.h <<\EOF
1135 #define NO_STRERROR 1
1136 EOF
1137
1138 fi
1139
1140 echo $ac_n "checking for getwd""... $ac_c" 1>&6
1141 echo "configure:1142: checking for getwd" >&5
1142 if eval "test \"`echo '$''{'ac_cv_func_getwd'+set}'`\" = set"; then
1143   echo $ac_n "(cached) $ac_c" 1>&6
1144 else
1145   cat > conftest.$ac_ext <<EOF
1146 #line 1147 "configure"
1147 #include "confdefs.h"
1148 /* System header to define __stub macros and hopefully few prototypes,
1149     which can conflict with char getwd(); below.  */
1150 #include <assert.h>
1151 /* Override any gcc2 internal prototype to avoid an error.  */
1152 /* We use char because int might match the return type of a gcc2
1153     builtin and then its argument prototype would still apply.  */
1154 char getwd();
1155
1156 int main() {
1157
1158 /* The GNU C library defines this for functions which it implements
1159     to always fail with ENOSYS.  Some functions are actually named
1160     something starting with __ and the normal name is an alias.  */
1161 #if defined (__stub_getwd) || defined (__stub___getwd)
1162 choke me
1163 #else
1164 getwd();
1165 #endif
1166
1167 ; return 0; }
1168 EOF
1169 if { (eval echo configure:1170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1170   rm -rf conftest*
1171   eval "ac_cv_func_getwd=yes"
1172 else
1173   echo "configure: failed program was:" >&5
1174   cat conftest.$ac_ext >&5
1175   rm -rf conftest*
1176   eval "ac_cv_func_getwd=no"
1177 fi
1178 rm -f conftest*
1179 fi
1180
1181 if eval "test \"`echo '$ac_cv_func_'getwd`\" = yes"; then
1182   echo "$ac_t""yes" 1>&6
1183   :
1184 else
1185   echo "$ac_t""no" 1>&6
1186 cat >> confdefs.h <<\EOF
1187 #define NO_GETWD 1
1188 EOF
1189
1190 fi
1191
1192 echo $ac_n "checking for wait3""... $ac_c" 1>&6
1193 echo "configure:1194: checking for wait3" >&5
1194 if eval "test \"`echo '$''{'ac_cv_func_wait3'+set}'`\" = set"; then
1195   echo $ac_n "(cached) $ac_c" 1>&6
1196 else
1197   cat > conftest.$ac_ext <<EOF
1198 #line 1199 "configure"
1199 #include "confdefs.h"
1200 /* System header to define __stub macros and hopefully few prototypes,
1201     which can conflict with char wait3(); below.  */
1202 #include <assert.h>
1203 /* Override any gcc2 internal prototype to avoid an error.  */
1204 /* We use char because int might match the return type of a gcc2
1205     builtin and then its argument prototype would still apply.  */
1206 char wait3();
1207
1208 int main() {
1209
1210 /* The GNU C library defines this for functions which it implements
1211     to always fail with ENOSYS.  Some functions are actually named
1212     something starting with __ and the normal name is an alias.  */
1213 #if defined (__stub_wait3) || defined (__stub___wait3)
1214 choke me
1215 #else
1216 wait3();
1217 #endif
1218
1219 ; return 0; }
1220 EOF
1221 if { (eval echo configure:1222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1222   rm -rf conftest*
1223   eval "ac_cv_func_wait3=yes"
1224 else
1225   echo "configure: failed program was:" >&5
1226   cat conftest.$ac_ext >&5
1227   rm -rf conftest*
1228   eval "ac_cv_func_wait3=no"
1229 fi
1230 rm -f conftest*
1231 fi
1232
1233 if eval "test \"`echo '$ac_cv_func_'wait3`\" = yes"; then
1234   echo "$ac_t""yes" 1>&6
1235   :
1236 else
1237   echo "$ac_t""no" 1>&6
1238 cat >> confdefs.h <<\EOF
1239 #define NO_WAIT3 1
1240 EOF
1241
1242 fi
1243
1244 echo $ac_n "checking for uname""... $ac_c" 1>&6
1245 echo "configure:1246: checking for uname" >&5
1246 if eval "test \"`echo '$''{'ac_cv_func_uname'+set}'`\" = set"; then
1247   echo $ac_n "(cached) $ac_c" 1>&6
1248 else
1249   cat > conftest.$ac_ext <<EOF
1250 #line 1251 "configure"
1251 #include "confdefs.h"
1252 /* System header to define __stub macros and hopefully few prototypes,
1253     which can conflict with char uname(); below.  */
1254 #include <assert.h>
1255 /* Override any gcc2 internal prototype to avoid an error.  */
1256 /* We use char because int might match the return type of a gcc2
1257     builtin and then its argument prototype would still apply.  */
1258 char uname();
1259
1260 int main() {
1261
1262 /* The GNU C library defines this for functions which it implements
1263     to always fail with ENOSYS.  Some functions are actually named
1264     something starting with __ and the normal name is an alias.  */
1265 #if defined (__stub_uname) || defined (__stub___uname)
1266 choke me
1267 #else
1268 uname();
1269 #endif
1270
1271 ; return 0; }
1272 EOF
1273 if { (eval echo configure:1274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1274   rm -rf conftest*
1275   eval "ac_cv_func_uname=yes"
1276 else
1277   echo "configure: failed program was:" >&5
1278   cat conftest.$ac_ext >&5
1279   rm -rf conftest*
1280   eval "ac_cv_func_uname=no"
1281 fi
1282 rm -f conftest*
1283 fi
1284
1285 if eval "test \"`echo '$ac_cv_func_'uname`\" = yes"; then
1286   echo "$ac_t""yes" 1>&6
1287   :
1288 else
1289   echo "$ac_t""no" 1>&6
1290 cat >> confdefs.h <<\EOF
1291 #define NO_UNAME 1
1292 EOF
1293
1294 fi
1295
1296
1297 #--------------------------------------------------------------------
1298 #       On a few very rare systems, all of the libm.a stuff is
1299 #       already in libc.a.  Set compiler flags accordingly.
1300 #       Also, Linux requires the "ieee" library for math to work
1301 #       right (and it must appear before "-lm").
1302 #--------------------------------------------------------------------
1303
1304 echo $ac_n "checking for sin""... $ac_c" 1>&6
1305 echo "configure:1306: checking for sin" >&5
1306 if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then
1307   echo $ac_n "(cached) $ac_c" 1>&6
1308 else
1309   cat > conftest.$ac_ext <<EOF
1310 #line 1311 "configure"
1311 #include "confdefs.h"
1312 /* System header to define __stub macros and hopefully few prototypes,
1313     which can conflict with char sin(); below.  */
1314 #include <assert.h>
1315 /* Override any gcc2 internal prototype to avoid an error.  */
1316 /* We use char because int might match the return type of a gcc2
1317     builtin and then its argument prototype would still apply.  */
1318 char sin();
1319
1320 int main() {
1321
1322 /* The GNU C library defines this for functions which it implements
1323     to always fail with ENOSYS.  Some functions are actually named
1324     something starting with __ and the normal name is an alias.  */
1325 #if defined (__stub_sin) || defined (__stub___sin)
1326 choke me
1327 #else
1328 sin();
1329 #endif
1330
1331 ; return 0; }
1332 EOF
1333 if { (eval echo configure:1334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1334   rm -rf conftest*
1335   eval "ac_cv_func_sin=yes"
1336 else
1337   echo "configure: failed program was:" >&5
1338   cat conftest.$ac_ext >&5
1339   rm -rf conftest*
1340   eval "ac_cv_func_sin=no"
1341 fi
1342 rm -f conftest*
1343 fi
1344
1345 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
1346   echo "$ac_t""yes" 1>&6
1347   MATH_LIBS=""
1348 else
1349   echo "$ac_t""no" 1>&6
1350 MATH_LIBS="-lm"
1351 fi
1352
1353 echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6
1354 echo "configure:1355: checking for main in -lieee" >&5
1355 ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'`
1356 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1357   echo $ac_n "(cached) $ac_c" 1>&6
1358 else
1359   ac_save_LIBS="$LIBS"
1360 LIBS="-lieee  $LIBS"
1361 cat > conftest.$ac_ext <<EOF
1362 #line 1363 "configure"
1363 #include "confdefs.h"
1364
1365 int main() {
1366 main()
1367 ; return 0; }
1368 EOF
1369 if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1370   rm -rf conftest*
1371   eval "ac_cv_lib_$ac_lib_var=yes"
1372 else
1373   echo "configure: failed program was:" >&5
1374   cat conftest.$ac_ext >&5
1375   rm -rf conftest*
1376   eval "ac_cv_lib_$ac_lib_var=no"
1377 fi
1378 rm -f conftest*
1379 LIBS="$ac_save_LIBS"
1380
1381 fi
1382 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1383   echo "$ac_t""yes" 1>&6
1384   MATH_LIBS="-lieee $MATH_LIBS"
1385 else
1386   echo "$ac_t""no" 1>&6
1387 fi
1388
1389
1390 #--------------------------------------------------------------------
1391 #       On AIX systems, libbsd.a has to be linked in to support
1392 #       non-blocking file IO.  This library has to be linked in after
1393 #       the MATH_LIBS or it breaks the pow() function.  The way to
1394 #       insure proper sequencing, is to add it to the tail of MATH_LIBS.
1395 #        This library also supplies gettimeofday.
1396 #--------------------------------------------------------------------
1397 libbsd=no
1398 if test "`uname -s`" = "AIX" ; then
1399     echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
1400 echo "configure:1401: checking for gettimeofday in -lbsd" >&5
1401 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
1402 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1403   echo $ac_n "(cached) $ac_c" 1>&6
1404 else
1405   ac_save_LIBS="$LIBS"
1406 LIBS="-lbsd  $LIBS"
1407 cat > conftest.$ac_ext <<EOF
1408 #line 1409 "configure"
1409 #include "confdefs.h"
1410 /* Override any gcc2 internal prototype to avoid an error.  */
1411 /* We use char because int might match the return type of a gcc2
1412     builtin and then its argument prototype would still apply.  */
1413 char gettimeofday();
1414
1415 int main() {
1416 gettimeofday()
1417 ; return 0; }
1418 EOF
1419 if { (eval echo configure:1420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1420   rm -rf conftest*
1421   eval "ac_cv_lib_$ac_lib_var=yes"
1422 else
1423   echo "configure: failed program was:" >&5
1424   cat conftest.$ac_ext >&5
1425   rm -rf conftest*
1426   eval "ac_cv_lib_$ac_lib_var=no"
1427 fi
1428 rm -f conftest*
1429 LIBS="$ac_save_LIBS"
1430
1431 fi
1432 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1433   echo "$ac_t""yes" 1>&6
1434   libbsd=yes
1435 else
1436   echo "$ac_t""no" 1>&6
1437 fi
1438
1439     if test $libbsd = yes; then
1440         MATH_LIBS="$MATH_LIBS -lbsd"
1441     fi
1442 fi
1443
1444 #--------------------------------------------------------------------
1445 #       Supply substitutes for missing POSIX header files.  Special
1446 #       notes:
1447 #           - stdlib.h doesn't define strtol, strtoul, or
1448 #             strtod insome versions of SunOS
1449 #           - some versions of string.h don't declare procedures such
1450 #             as strstr
1451 #--------------------------------------------------------------------
1452
1453 echo $ac_n "checking dirent.h""... $ac_c" 1>&6
1454 echo "configure:1455: checking dirent.h" >&5
1455 cat > conftest.$ac_ext <<EOF
1456 #line 1457 "configure"
1457 #include "confdefs.h"
1458 #include <sys/types.h>
1459 #include <dirent.h>
1460 int main() {
1461
1462 #ifndef _POSIX_SOURCE
1463 #   ifdef __Lynx__
1464         /*
1465          * Generate compilation error to make the test fail:  Lynx headers
1466          * are only valid if really in the POSIX environment.
1467          */
1468
1469         missing_procedure();
1470 #   endif
1471 #endif
1472 DIR *d;
1473 struct dirent *entryPtr;
1474 char *p;
1475 d = opendir("foobar");
1476 entryPtr = readdir(d);
1477 p = entryPtr->d_name;
1478 closedir(d);
1479
1480 ; return 0; }
1481 EOF
1482 if { (eval echo configure:1483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1483   rm -rf conftest*
1484   tcl_ok=yes
1485 else
1486   echo "configure: failed program was:" >&5
1487   cat conftest.$ac_ext >&5
1488   rm -rf conftest*
1489   tcl_ok=no
1490 fi
1491 rm -f conftest*
1492 if test $tcl_ok = no; then
1493     cat >> confdefs.h <<\EOF
1494 #define NO_DIRENT_H 1
1495 EOF
1496
1497 fi
1498 echo "$ac_t""$tcl_ok" 1>&6
1499 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1500 echo "configure:1501: checking how to run the C preprocessor" >&5
1501 # On Suns, sometimes $CPP names a directory.
1502 if test -n "$CPP" && test -d "$CPP"; then
1503   CPP=
1504 fi
1505 if test -z "$CPP"; then
1506 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1507   echo $ac_n "(cached) $ac_c" 1>&6
1508 else
1509     # This must be in double quotes, not single quotes, because CPP may get
1510   # substituted into the Makefile and "${CC-cc}" will confuse make.
1511   CPP="${CC-cc} -E"
1512   # On the NeXT, cc -E runs the code through the compiler's parser,
1513   # not just through cpp.
1514   cat > conftest.$ac_ext <<EOF
1515 #line 1516 "configure"
1516 #include "confdefs.h"
1517 #include <assert.h>
1518 Syntax Error
1519 EOF
1520 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1521 { (eval echo configure:1522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1522 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1523 if test -z "$ac_err"; then
1524   :
1525 else
1526   echo "$ac_err" >&5
1527   echo "configure: failed program was:" >&5
1528   cat conftest.$ac_ext >&5
1529   rm -rf conftest*
1530   CPP="${CC-cc} -E -traditional-cpp"
1531   cat > conftest.$ac_ext <<EOF
1532 #line 1533 "configure"
1533 #include "confdefs.h"
1534 #include <assert.h>
1535 Syntax Error
1536 EOF
1537 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1538 { (eval echo configure:1539: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1539 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1540 if test -z "$ac_err"; then
1541   :
1542 else
1543   echo "$ac_err" >&5
1544   echo "configure: failed program was:" >&5
1545   cat conftest.$ac_ext >&5
1546   rm -rf conftest*
1547   CPP="${CC-cc} -nologo -E"
1548   cat > conftest.$ac_ext <<EOF
1549 #line 1550 "configure"
1550 #include "confdefs.h"
1551 #include <assert.h>
1552 Syntax Error
1553 EOF
1554 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1555 { (eval echo configure:1556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1556 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1557 if test -z "$ac_err"; then
1558   :
1559 else
1560   echo "$ac_err" >&5
1561   echo "configure: failed program was:" >&5
1562   cat conftest.$ac_ext >&5
1563   rm -rf conftest*
1564   CPP=/lib/cpp
1565 fi
1566 rm -f conftest*
1567 fi
1568 rm -f conftest*
1569 fi
1570 rm -f conftest*
1571   ac_cv_prog_CPP="$CPP"
1572 fi
1573   CPP="$ac_cv_prog_CPP"
1574 else
1575   ac_cv_prog_CPP="$CPP"
1576 fi
1577 echo "$ac_t""$CPP" 1>&6
1578
1579 ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'`
1580 echo $ac_n "checking for errno.h""... $ac_c" 1>&6
1581 echo "configure:1582: checking for errno.h" >&5
1582 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1583   echo $ac_n "(cached) $ac_c" 1>&6
1584 else
1585   cat > conftest.$ac_ext <<EOF
1586 #line 1587 "configure"
1587 #include "confdefs.h"
1588 #include <errno.h>
1589 EOF
1590 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1591 { (eval echo configure:1592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1592 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1593 if test -z "$ac_err"; then
1594   rm -rf conftest*
1595   eval "ac_cv_header_$ac_safe=yes"
1596 else
1597   echo "$ac_err" >&5
1598   echo "configure: failed program was:" >&5
1599   cat conftest.$ac_ext >&5
1600   rm -rf conftest*
1601   eval "ac_cv_header_$ac_safe=no"
1602 fi
1603 rm -f conftest*
1604 fi
1605 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1606   echo "$ac_t""yes" 1>&6
1607   :
1608 else
1609   echo "$ac_t""no" 1>&6
1610 cat >> confdefs.h <<\EOF
1611 #define NO_ERRNO_H 1
1612 EOF
1613
1614 fi
1615
1616 ac_safe=`echo "float.h" | sed 'y%./+-%__p_%'`
1617 echo $ac_n "checking for float.h""... $ac_c" 1>&6
1618 echo "configure:1619: checking for float.h" >&5
1619 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1620   echo $ac_n "(cached) $ac_c" 1>&6
1621 else
1622   cat > conftest.$ac_ext <<EOF
1623 #line 1624 "configure"
1624 #include "confdefs.h"
1625 #include <float.h>
1626 EOF
1627 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1628 { (eval echo configure:1629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1629 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1630 if test -z "$ac_err"; then
1631   rm -rf conftest*
1632   eval "ac_cv_header_$ac_safe=yes"
1633 else
1634   echo "$ac_err" >&5
1635   echo "configure: failed program was:" >&5
1636   cat conftest.$ac_ext >&5
1637   rm -rf conftest*
1638   eval "ac_cv_header_$ac_safe=no"
1639 fi
1640 rm -f conftest*
1641 fi
1642 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1643   echo "$ac_t""yes" 1>&6
1644   :
1645 else
1646   echo "$ac_t""no" 1>&6
1647 cat >> confdefs.h <<\EOF
1648 #define NO_FLOAT_H 1
1649 EOF
1650
1651 fi
1652
1653 ac_safe=`echo "values.h" | sed 'y%./+-%__p_%'`
1654 echo $ac_n "checking for values.h""... $ac_c" 1>&6
1655 echo "configure:1656: checking for values.h" >&5
1656 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1657   echo $ac_n "(cached) $ac_c" 1>&6
1658 else
1659   cat > conftest.$ac_ext <<EOF
1660 #line 1661 "configure"
1661 #include "confdefs.h"
1662 #include <values.h>
1663 EOF
1664 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1665 { (eval echo configure:1666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1666 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1667 if test -z "$ac_err"; then
1668   rm -rf conftest*
1669   eval "ac_cv_header_$ac_safe=yes"
1670 else
1671   echo "$ac_err" >&5
1672   echo "configure: failed program was:" >&5
1673   cat conftest.$ac_ext >&5
1674   rm -rf conftest*
1675   eval "ac_cv_header_$ac_safe=no"
1676 fi
1677 rm -f conftest*
1678 fi
1679 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1680   echo "$ac_t""yes" 1>&6
1681   :
1682 else
1683   echo "$ac_t""no" 1>&6
1684 cat >> confdefs.h <<\EOF
1685 #define NO_VALUES_H 1
1686 EOF
1687
1688 fi
1689
1690 ac_safe=`echo "limits.h" | sed 'y%./+-%__p_%'`
1691 echo $ac_n "checking for limits.h""... $ac_c" 1>&6
1692 echo "configure:1693: checking for limits.h" >&5
1693 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1694   echo $ac_n "(cached) $ac_c" 1>&6
1695 else
1696   cat > conftest.$ac_ext <<EOF
1697 #line 1698 "configure"
1698 #include "confdefs.h"
1699 #include <limits.h>
1700 EOF
1701 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1702 { (eval echo configure:1703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1703 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1704 if test -z "$ac_err"; then
1705   rm -rf conftest*
1706   eval "ac_cv_header_$ac_safe=yes"
1707 else
1708   echo "$ac_err" >&5
1709   echo "configure: failed program was:" >&5
1710   cat conftest.$ac_ext >&5
1711   rm -rf conftest*
1712   eval "ac_cv_header_$ac_safe=no"
1713 fi
1714 rm -f conftest*
1715 fi
1716 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1717   echo "$ac_t""yes" 1>&6
1718   :
1719 else
1720   echo "$ac_t""no" 1>&6
1721 cat >> confdefs.h <<\EOF
1722 #define NO_LIMITS_H 1
1723 EOF
1724
1725 fi
1726
1727 ac_safe=`echo "stdlib.h" | sed 'y%./+-%__p_%'`
1728 echo $ac_n "checking for stdlib.h""... $ac_c" 1>&6
1729 echo "configure:1730: checking for stdlib.h" >&5
1730 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1731   echo $ac_n "(cached) $ac_c" 1>&6
1732 else
1733   cat > conftest.$ac_ext <<EOF
1734 #line 1735 "configure"
1735 #include "confdefs.h"
1736 #include <stdlib.h>
1737 EOF
1738 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1739 { (eval echo configure:1740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1740 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1741 if test -z "$ac_err"; then
1742   rm -rf conftest*
1743   eval "ac_cv_header_$ac_safe=yes"
1744 else
1745   echo "$ac_err" >&5
1746   echo "configure: failed program was:" >&5
1747   cat conftest.$ac_ext >&5
1748   rm -rf conftest*
1749   eval "ac_cv_header_$ac_safe=no"
1750 fi
1751 rm -f conftest*
1752 fi
1753 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1754   echo "$ac_t""yes" 1>&6
1755   tcl_ok=1
1756 else
1757   echo "$ac_t""no" 1>&6
1758 tcl_ok=0
1759 fi
1760
1761 cat > conftest.$ac_ext <<EOF
1762 #line 1763 "configure"
1763 #include "confdefs.h"
1764 #include <stdlib.h>
1765 EOF
1766 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1767   egrep "strtol" >/dev/null 2>&1; then
1768   :
1769 else
1770   rm -rf conftest*
1771   tcl_ok=0
1772 fi
1773 rm -f conftest*
1774
1775 cat > conftest.$ac_ext <<EOF
1776 #line 1777 "configure"
1777 #include "confdefs.h"
1778 #include <stdlib.h>
1779 EOF
1780 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1781   egrep "strtoul" >/dev/null 2>&1; then
1782   :
1783 else
1784   rm -rf conftest*
1785   tcl_ok=0
1786 fi
1787 rm -f conftest*
1788
1789 cat > conftest.$ac_ext <<EOF
1790 #line 1791 "configure"
1791 #include "confdefs.h"
1792 #include <stdlib.h>
1793 EOF
1794 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1795   egrep "strtod" >/dev/null 2>&1; then
1796   :
1797 else
1798   rm -rf conftest*
1799   tcl_ok=0
1800 fi
1801 rm -f conftest*
1802
1803 if test $tcl_ok = 0; then
1804     cat >> confdefs.h <<\EOF
1805 #define NO_STDLIB_H 1
1806 EOF
1807
1808 fi
1809 ac_safe=`echo "string.h" | sed 'y%./+-%__p_%'`
1810 echo $ac_n "checking for string.h""... $ac_c" 1>&6
1811 echo "configure:1812: checking for string.h" >&5
1812 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1813   echo $ac_n "(cached) $ac_c" 1>&6
1814 else
1815   cat > conftest.$ac_ext <<EOF
1816 #line 1817 "configure"
1817 #include "confdefs.h"
1818 #include <string.h>
1819 EOF
1820 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1821 { (eval echo configure:1822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1822 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1823 if test -z "$ac_err"; then
1824   rm -rf conftest*
1825   eval "ac_cv_header_$ac_safe=yes"
1826 else
1827   echo "$ac_err" >&5
1828   echo "configure: failed program was:" >&5
1829   cat conftest.$ac_ext >&5
1830   rm -rf conftest*
1831   eval "ac_cv_header_$ac_safe=no"
1832 fi
1833 rm -f conftest*
1834 fi
1835 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1836   echo "$ac_t""yes" 1>&6
1837   tcl_ok=1
1838 else
1839   echo "$ac_t""no" 1>&6
1840 tcl_ok=0
1841 fi
1842
1843 cat > conftest.$ac_ext <<EOF
1844 #line 1845 "configure"
1845 #include "confdefs.h"
1846 #include <string.h>
1847 EOF
1848 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1849   egrep "strstr" >/dev/null 2>&1; then
1850   :
1851 else
1852   rm -rf conftest*
1853   tcl_ok=0
1854 fi
1855 rm -f conftest*
1856
1857 cat > conftest.$ac_ext <<EOF
1858 #line 1859 "configure"
1859 #include "confdefs.h"
1860 #include <string.h>
1861 EOF
1862 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1863   egrep "strerror" >/dev/null 2>&1; then
1864   :
1865 else
1866   rm -rf conftest*
1867   tcl_ok=0
1868 fi
1869 rm -f conftest*
1870
1871 if test $tcl_ok = 0; then
1872     cat >> confdefs.h <<\EOF
1873 #define NO_STRING_H 1
1874 EOF
1875
1876 fi
1877 ac_safe=`echo "sys/wait.h" | sed 'y%./+-%__p_%'`
1878 echo $ac_n "checking for sys/wait.h""... $ac_c" 1>&6
1879 echo "configure:1880: checking for sys/wait.h" >&5
1880 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1881   echo $ac_n "(cached) $ac_c" 1>&6
1882 else
1883   cat > conftest.$ac_ext <<EOF
1884 #line 1885 "configure"
1885 #include "confdefs.h"
1886 #include <sys/wait.h>
1887 EOF
1888 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1889 { (eval echo configure:1890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1890 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1891 if test -z "$ac_err"; then
1892   rm -rf conftest*
1893   eval "ac_cv_header_$ac_safe=yes"
1894 else
1895   echo "$ac_err" >&5
1896   echo "configure: failed program was:" >&5
1897   cat conftest.$ac_ext >&5
1898   rm -rf conftest*
1899   eval "ac_cv_header_$ac_safe=no"
1900 fi
1901 rm -f conftest*
1902 fi
1903 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1904   echo "$ac_t""yes" 1>&6
1905   :
1906 else
1907   echo "$ac_t""no" 1>&6
1908 cat >> confdefs.h <<\EOF
1909 #define NO_SYS_WAIT_H 1
1910 EOF
1911
1912 fi
1913
1914 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
1915 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
1916 echo "configure:1917: checking for dlfcn.h" >&5
1917 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1918   echo $ac_n "(cached) $ac_c" 1>&6
1919 else
1920   cat > conftest.$ac_ext <<EOF
1921 #line 1922 "configure"
1922 #include "confdefs.h"
1923 #include <dlfcn.h>
1924 EOF
1925 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1926 { (eval echo configure:1927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1927 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1928 if test -z "$ac_err"; then
1929   rm -rf conftest*
1930   eval "ac_cv_header_$ac_safe=yes"
1931 else
1932   echo "$ac_err" >&5
1933   echo "configure: failed program was:" >&5
1934   cat conftest.$ac_ext >&5
1935   rm -rf conftest*
1936   eval "ac_cv_header_$ac_safe=no"
1937 fi
1938 rm -f conftest*
1939 fi
1940 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1941   echo "$ac_t""yes" 1>&6
1942   :
1943 else
1944   echo "$ac_t""no" 1>&6
1945 cat >> confdefs.h <<\EOF
1946 #define NO_DLFCN_H 1
1947 EOF
1948
1949 fi
1950
1951 for ac_hdr in unistd.h
1952 do
1953 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1954 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1955 echo "configure:1956: checking for $ac_hdr" >&5
1956 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1957   echo $ac_n "(cached) $ac_c" 1>&6
1958 else
1959   cat > conftest.$ac_ext <<EOF
1960 #line 1961 "configure"
1961 #include "confdefs.h"
1962 #include <$ac_hdr>
1963 EOF
1964 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1965 { (eval echo configure:1966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1966 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1967 if test -z "$ac_err"; then
1968   rm -rf conftest*
1969   eval "ac_cv_header_$ac_safe=yes"
1970 else
1971   echo "$ac_err" >&5
1972   echo "configure: failed program was:" >&5
1973   cat conftest.$ac_ext >&5
1974   rm -rf conftest*
1975   eval "ac_cv_header_$ac_safe=no"
1976 fi
1977 rm -f conftest*
1978 fi
1979 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1980   echo "$ac_t""yes" 1>&6
1981     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1982   cat >> confdefs.h <<EOF
1983 #define $ac_tr_hdr 1
1984 EOF
1985  
1986 else
1987   echo "$ac_t""no" 1>&6
1988 fi
1989 done
1990
1991
1992 #---------------------------------------------------------------------------
1993 #       Determine which interface to use to talk to the serial port.
1994 #       Note that #include lines must begin in leftmost column for
1995 #       some compilers to recognize them as preprocessor directives.
1996 #---------------------------------------------------------------------------
1997
1998 echo $ac_n "checking termios vs. termio vs. sgtty""... $ac_c" 1>&6
1999 echo "configure:2000: checking termios vs. termio vs. sgtty" >&5
2000 if test "$cross_compiling" = yes; then
2001   tk_ok=no
2002 else
2003   cat > conftest.$ac_ext <<EOF
2004 #line 2005 "configure"
2005 #include "confdefs.h"
2006
2007 #include <termios.h>
2008
2009 main()
2010 {
2011     struct termios t;
2012     if (tcgetattr(0, &t) == 0) {
2013         cfsetospeed(&t, 0);
2014         t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
2015         return 0;
2016     }
2017     return 1;
2018 }
2019 EOF
2020 if { (eval echo configure:2021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2021 then
2022   tk_ok=termios
2023 else
2024   echo "configure: failed program was:" >&5
2025   cat conftest.$ac_ext >&5
2026   rm -fr conftest*
2027   tk_ok=no
2028 fi
2029 rm -fr conftest*
2030 fi
2031
2032 if test $tk_ok = termios; then
2033     cat >> confdefs.h <<\EOF
2034 #define USE_TERMIOS 1
2035 EOF
2036
2037 else
2038 if test "$cross_compiling" = yes; then
2039   tk_ok=no
2040 else
2041   cat > conftest.$ac_ext <<EOF
2042 #line 2043 "configure"
2043 #include "confdefs.h"
2044
2045 #include <termio.h>
2046
2047 main()
2048 {
2049     struct termio t;
2050     if (ioctl(0, TCGETA, &t) == 0) {
2051         t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
2052         return 0;
2053     }
2054     return 1;
2055 }
2056 EOF
2057 if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2058 then
2059   tk_ok=termio
2060 else
2061   echo "configure: failed program was:" >&5
2062   cat conftest.$ac_ext >&5
2063   rm -fr conftest*
2064   tk_ok=no
2065 fi
2066 rm -fr conftest*
2067 fi
2068
2069 if test $tk_ok = termio; then
2070     cat >> confdefs.h <<\EOF
2071 #define USE_TERMIO 1
2072 EOF
2073
2074 else
2075 if test "$cross_compiling" = yes; then
2076   tk_ok=none
2077 else
2078   cat > conftest.$ac_ext <<EOF
2079 #line 2080 "configure"
2080 #include "confdefs.h"
2081
2082 #include <sgtty.h>
2083
2084 main()
2085 {
2086     struct sgttyb t;
2087     if (ioctl(0, TIOCGETP, &t) == 0) {
2088         t.sg_ospeed = 0;
2089         t.sg_flags |= ODDP | EVENP | RAW;
2090         return 0;
2091     }
2092     return 1;
2093 }
2094 EOF
2095 if { (eval echo configure:2096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2096 then
2097   tk_ok=sgtty
2098 else
2099   echo "configure: failed program was:" >&5
2100   cat conftest.$ac_ext >&5
2101   rm -fr conftest*
2102   tk_ok=none
2103 fi
2104 rm -fr conftest*
2105 fi
2106
2107 if test $tk_ok = sgtty; then
2108     cat >> confdefs.h <<\EOF
2109 #define USE_SGTTY 1
2110 EOF
2111
2112 fi
2113 fi
2114 fi
2115 echo "$ac_t""$tk_ok" 1>&6
2116
2117 #--------------------------------------------------------------------
2118 #       Include sys/select.h if it exists and if it supplies things
2119 #       that appear to be useful and aren't already in sys/types.h.
2120 #       This appears to be true only on the RS/6000 under AIX.  Some
2121 #       systems like OSF/1 have a sys/select.h that's of no use, and
2122 #       other systems like SCO UNIX have a sys/select.h that's
2123 #       pernicious.  If "fd_set" isn't defined anywhere then set a
2124 #       special flag.
2125 #--------------------------------------------------------------------
2126
2127 echo $ac_n "checking fd_set and sys/select""... $ac_c" 1>&6
2128 echo "configure:2129: checking fd_set and sys/select" >&5
2129 cat > conftest.$ac_ext <<EOF
2130 #line 2131 "configure"
2131 #include "confdefs.h"
2132 #include <sys/types.h>
2133 int main() {
2134 fd_set readMask, writeMask;
2135 ; return 0; }
2136 EOF
2137 if { (eval echo configure:2138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2138   rm -rf conftest*
2139   tk_ok=yes
2140 else
2141   echo "configure: failed program was:" >&5
2142   cat conftest.$ac_ext >&5
2143   rm -rf conftest*
2144   tk_ok=no
2145 fi
2146 rm -f conftest*
2147 if test $tk_ok = no; then
2148     cat > conftest.$ac_ext <<EOF
2149 #line 2150 "configure"
2150 #include "confdefs.h"
2151 #include <sys/select.h>
2152 EOF
2153 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2154   egrep "fd_mask" >/dev/null 2>&1; then
2155   rm -rf conftest*
2156   tk_ok=yes
2157 fi
2158 rm -f conftest*
2159
2160     if test $tk_ok = yes; then
2161         cat >> confdefs.h <<\EOF
2162 #define HAVE_SYS_SELECT_H 1
2163 EOF
2164
2165     fi
2166 fi
2167 echo "$ac_t""$tk_ok" 1>&6
2168 if test $tk_ok = no; then
2169     cat >> confdefs.h <<\EOF
2170 #define NO_FD_SET 1
2171 EOF
2172
2173 fi
2174
2175 #------------------------------------------------------------------------------
2176 #       Find out all about time handling differences.
2177 #------------------------------------------------------------------------------
2178
2179 for ac_hdr in sys/time.h
2180 do
2181 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2182 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2183 echo "configure:2184: checking for $ac_hdr" >&5
2184 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2185   echo $ac_n "(cached) $ac_c" 1>&6
2186 else
2187   cat > conftest.$ac_ext <<EOF
2188 #line 2189 "configure"
2189 #include "confdefs.h"
2190 #include <$ac_hdr>
2191 EOF
2192 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2193 { (eval echo configure:2194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2194 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2195 if test -z "$ac_err"; then
2196   rm -rf conftest*
2197   eval "ac_cv_header_$ac_safe=yes"
2198 else
2199   echo "$ac_err" >&5
2200   echo "configure: failed program was:" >&5
2201   cat conftest.$ac_ext >&5
2202   rm -rf conftest*
2203   eval "ac_cv_header_$ac_safe=no"
2204 fi
2205 rm -f conftest*
2206 fi
2207 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2208   echo "$ac_t""yes" 1>&6
2209     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2210   cat >> confdefs.h <<EOF
2211 #define $ac_tr_hdr 1
2212 EOF
2213  
2214 else
2215   echo "$ac_t""no" 1>&6
2216 fi
2217 done
2218
2219 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
2220 echo "configure:2221: checking whether time.h and sys/time.h may both be included" >&5
2221 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
2222   echo $ac_n "(cached) $ac_c" 1>&6
2223 else
2224   cat > conftest.$ac_ext <<EOF
2225 #line 2226 "configure"
2226 #include "confdefs.h"
2227 #include <sys/types.h>
2228 #include <sys/time.h>
2229 #include <time.h>
2230 int main() {
2231 struct tm *tp;
2232 ; return 0; }
2233 EOF
2234 if { (eval echo configure:2235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2235   rm -rf conftest*
2236   ac_cv_header_time=yes
2237 else
2238   echo "configure: failed program was:" >&5
2239   cat conftest.$ac_ext >&5
2240   rm -rf conftest*
2241   ac_cv_header_time=no
2242 fi
2243 rm -f conftest*
2244 fi
2245
2246 echo "$ac_t""$ac_cv_header_time" 1>&6
2247 if test $ac_cv_header_time = yes; then
2248   cat >> confdefs.h <<\EOF
2249 #define TIME_WITH_SYS_TIME 1
2250 EOF
2251
2252 fi
2253
2254 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
2255 echo "configure:2256: checking whether struct tm is in sys/time.h or time.h" >&5
2256 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
2257   echo $ac_n "(cached) $ac_c" 1>&6
2258 else
2259   cat > conftest.$ac_ext <<EOF
2260 #line 2261 "configure"
2261 #include "confdefs.h"
2262 #include <sys/types.h>
2263 #include <time.h>
2264 int main() {
2265 struct tm *tp; tp->tm_sec;
2266 ; return 0; }
2267 EOF
2268 if { (eval echo configure:2269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2269   rm -rf conftest*
2270   ac_cv_struct_tm=time.h
2271 else
2272   echo "configure: failed program was:" >&5
2273   cat conftest.$ac_ext >&5
2274   rm -rf conftest*
2275   ac_cv_struct_tm=sys/time.h
2276 fi
2277 rm -f conftest*
2278 fi
2279
2280 echo "$ac_t""$ac_cv_struct_tm" 1>&6
2281 if test $ac_cv_struct_tm = sys/time.h; then
2282   cat >> confdefs.h <<\EOF
2283 #define TM_IN_SYS_TIME 1
2284 EOF
2285
2286 fi
2287
2288 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
2289 echo "configure:2290: checking for tm_zone in struct tm" >&5
2290 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
2291   echo $ac_n "(cached) $ac_c" 1>&6
2292 else
2293   cat > conftest.$ac_ext <<EOF
2294 #line 2295 "configure"
2295 #include "confdefs.h"
2296 #include <sys/types.h>
2297 #include <$ac_cv_struct_tm>
2298 int main() {
2299 struct tm tm; tm.tm_zone;
2300 ; return 0; }
2301 EOF
2302 if { (eval echo configure:2303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2303   rm -rf conftest*
2304   ac_cv_struct_tm_zone=yes
2305 else
2306   echo "configure: failed program was:" >&5
2307   cat conftest.$ac_ext >&5
2308   rm -rf conftest*
2309   ac_cv_struct_tm_zone=no
2310 fi
2311 rm -f conftest*
2312 fi
2313
2314 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
2315 if test "$ac_cv_struct_tm_zone" = yes; then
2316   cat >> confdefs.h <<\EOF
2317 #define HAVE_TM_ZONE 1
2318 EOF
2319
2320 else
2321   echo $ac_n "checking for tzname""... $ac_c" 1>&6
2322 echo "configure:2323: checking for tzname" >&5
2323 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
2324   echo $ac_n "(cached) $ac_c" 1>&6
2325 else
2326   cat > conftest.$ac_ext <<EOF
2327 #line 2328 "configure"
2328 #include "confdefs.h"
2329 #include <time.h>
2330 #ifndef tzname /* For SGI.  */
2331 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
2332 #endif
2333 int main() {
2334 atoi(*tzname);
2335 ; return 0; }
2336 EOF
2337 if { (eval echo configure:2338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2338   rm -rf conftest*
2339   ac_cv_var_tzname=yes
2340 else
2341   echo "configure: failed program was:" >&5
2342   cat conftest.$ac_ext >&5
2343   rm -rf conftest*
2344   ac_cv_var_tzname=no
2345 fi
2346 rm -f conftest*
2347 fi
2348
2349 echo "$ac_t""$ac_cv_var_tzname" 1>&6
2350   if test $ac_cv_var_tzname = yes; then
2351     cat >> confdefs.h <<\EOF
2352 #define HAVE_TZNAME 1
2353 EOF
2354
2355   fi
2356 fi
2357
2358
2359 echo $ac_n "checking tm_tzadj in struct tm""... $ac_c" 1>&6
2360 echo "configure:2361: checking tm_tzadj in struct tm" >&5
2361 cat > conftest.$ac_ext <<EOF
2362 #line 2363 "configure"
2363 #include "confdefs.h"
2364 #include <time.h>
2365 int main() {
2366 struct tm tm; tm.tm_tzadj;
2367 ; return 0; }
2368 EOF
2369 if { (eval echo configure:2370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2370   rm -rf conftest*
2371   cat >> confdefs.h <<\EOF
2372 #define HAVE_TM_TZADJ 1
2373 EOF
2374
2375          echo "$ac_t""yes" 1>&6
2376 else
2377   echo "configure: failed program was:" >&5
2378   cat conftest.$ac_ext >&5
2379   rm -rf conftest*
2380   echo "$ac_t""no" 1>&6
2381 fi
2382 rm -f conftest*
2383
2384 echo $ac_n "checking tm_gmtoff in struct tm""... $ac_c" 1>&6
2385 echo "configure:2386: checking tm_gmtoff in struct tm" >&5
2386 cat > conftest.$ac_ext <<EOF
2387 #line 2388 "configure"
2388 #include "confdefs.h"
2389 #include <time.h>
2390 int main() {
2391 struct tm tm; tm.tm_gmtoff;
2392 ; return 0; }
2393 EOF
2394 if { (eval echo configure:2395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2395   rm -rf conftest*
2396   cat >> confdefs.h <<\EOF
2397 #define HAVE_TM_GMTOFF 1
2398 EOF
2399
2400          echo "$ac_t""yes" 1>&6
2401 else
2402   echo "configure: failed program was:" >&5
2403   cat conftest.$ac_ext >&5
2404   rm -rf conftest*
2405   echo "$ac_t""no" 1>&6
2406 fi
2407 rm -f conftest*
2408
2409 #
2410 # Its important to include time.h in this check, as some systems (like convex)
2411 # have timezone functions, etc.
2412 #
2413 have_timezone=no
2414 echo $ac_n "checking long timezone variable""... $ac_c" 1>&6
2415 echo "configure:2416: checking long timezone variable" >&5
2416 cat > conftest.$ac_ext <<EOF
2417 #line 2418 "configure"
2418 #include "confdefs.h"
2419 #include <time.h>
2420 int main() {
2421 extern long timezone;
2422          timezone += 1;
2423          exit (0);
2424 ; return 0; }
2425 EOF
2426 if { (eval echo configure:2427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2427   rm -rf conftest*
2428   have_timezone=yes
2429          cat >> confdefs.h <<\EOF
2430 #define HAVE_TIMEZONE_VAR 1
2431 EOF
2432
2433          echo "$ac_t""yes" 1>&6
2434 else
2435   echo "configure: failed program was:" >&5
2436   cat conftest.$ac_ext >&5
2437   rm -rf conftest*
2438   echo "$ac_t""no" 1>&6
2439 fi
2440 rm -f conftest*
2441
2442 #
2443 # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
2444 #
2445 if test "$have_timezone" = no; then
2446    echo $ac_n "checking time_t timezone variable""... $ac_c" 1>&6
2447 echo "configure:2448: checking time_t timezone variable" >&5
2448    cat > conftest.$ac_ext <<EOF
2449 #line 2450 "configure"
2450 #include "confdefs.h"
2451 #include <time.h>
2452 int main() {
2453 extern time_t timezone;
2454          timezone += 1;
2455          exit (0);
2456 ; return 0; }
2457 EOF
2458 if { (eval echo configure:2459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2459   rm -rf conftest*
2460   have_timezone=yes
2461          cat >> confdefs.h <<\EOF
2462 #define HAVE_TIMEZONE_VAR 1
2463 EOF
2464
2465          echo "$ac_t""yes" 1>&6
2466 else
2467   echo "configure: failed program was:" >&5
2468   cat conftest.$ac_ext >&5
2469   rm -rf conftest*
2470   echo "$ac_t""no" 1>&6
2471 fi
2472 rm -f conftest*
2473 fi
2474
2475 #
2476 # On some systems (eg Solaris 2.5.1, timezone is not declared in
2477 # time.h unless you jump through hoops.  Instead of that, we just
2478 # declare it ourselves when necessary.
2479 #
2480 if test "$have_timezone" = yes; then
2481    echo $ac_n "checking for timezone declaration""... $ac_c" 1>&6
2482 echo "configure:2483: checking for timezone declaration" >&5
2483    
2484    tzrx='^[     ]*extern.*timezone'
2485    
2486    cat > conftest.$ac_ext <<EOF
2487 #line 2488 "configure"
2488 #include "confdefs.h"
2489 #include <time.h>
2490 EOF
2491 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2492   egrep "$tzrx" >/dev/null 2>&1; then
2493   rm -rf conftest*
2494   
2495      cat >> confdefs.h <<\EOF
2496 #define HAVE_TIMEZONE_DECL 1
2497 EOF
2498
2499      echo "$ac_t""found" 1>&6
2500 else
2501   rm -rf conftest*
2502   echo "$ac_t""missing" 1>&6
2503 fi
2504 rm -f conftest*
2505
2506 fi
2507
2508 #
2509 # AIX does not have a timezone field in struct tm. When the AIX bsd
2510 # library is used, the timezone global and the gettimeofday methods are
2511 # to be avoided for timezone deduction instead, we deduce the timezone
2512 # by comparing the localtime result on a known GMT value.
2513 #
2514 if test $libbsd = yes; then
2515     cat >> confdefs.h <<\EOF
2516 #define USE_DELTA_FOR_TZ 1
2517 EOF
2518
2519 fi
2520
2521 #--------------------------------------------------------------------
2522 #       Some systems (e.g., IRIX 4.0.5) lack the st_blksize field
2523 #       in struct stat.
2524 #--------------------------------------------------------------------
2525 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
2526 echo "configure:2527: checking for st_blksize in struct stat" >&5
2527 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
2528   echo $ac_n "(cached) $ac_c" 1>&6
2529 else
2530   cat > conftest.$ac_ext <<EOF
2531 #line 2532 "configure"
2532 #include "confdefs.h"
2533 #include <sys/types.h>
2534 #include <sys/stat.h>
2535 int main() {
2536 struct stat s; s.st_blksize;
2537 ; return 0; }
2538 EOF
2539 if { (eval echo configure:2540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2540   rm -rf conftest*
2541   ac_cv_struct_st_blksize=yes
2542 else
2543   echo "configure: failed program was:" >&5
2544   cat conftest.$ac_ext >&5
2545   rm -rf conftest*
2546   ac_cv_struct_st_blksize=no
2547 fi
2548 rm -f conftest*
2549 fi
2550
2551 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
2552 if test $ac_cv_struct_st_blksize = yes; then
2553   cat >> confdefs.h <<\EOF
2554 #define HAVE_ST_BLKSIZE 1
2555 EOF
2556
2557 fi
2558
2559
2560 #--------------------------------------------------------------------
2561 #       On some systems strstr is broken: it returns a pointer even
2562 #       even if the original string is empty.
2563 #--------------------------------------------------------------------
2564
2565 echo $ac_n "checking proper strstr implementation""... $ac_c" 1>&6
2566 echo "configure:2567: checking proper strstr implementation" >&5
2567 if test "$cross_compiling" = yes; then
2568   tcl_ok=no
2569 else
2570   cat > conftest.$ac_ext <<EOF
2571 #line 2572 "configure"
2572 #include "confdefs.h"
2573
2574 extern int strstr();
2575 int main()
2576 {
2577     exit(strstr("\0test", "test") ? 1 : 0);
2578 }
2579
2580 EOF
2581 if { (eval echo configure:2582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2582 then
2583   tcl_ok=yes
2584 else
2585   echo "configure: failed program was:" >&5
2586   cat conftest.$ac_ext >&5
2587   rm -fr conftest*
2588   tcl_ok=no
2589 fi
2590 rm -fr conftest*
2591 fi
2592
2593 if test $tcl_ok = yes; then
2594     echo "$ac_t""yes" 1>&6
2595 else
2596     echo "$ac_t""broken, using substitute" 1>&6
2597     LIBOBJS="$LIBOBJS strstr.o"
2598 fi
2599
2600 #--------------------------------------------------------------------
2601 #       Check for strtoul function.  This is tricky because under some
2602 #       versions of AIX strtoul returns an incorrect terminator
2603 #       pointer for the string "0".
2604 #--------------------------------------------------------------------
2605
2606 echo $ac_n "checking for strtoul""... $ac_c" 1>&6
2607 echo "configure:2608: checking for strtoul" >&5
2608 if eval "test \"`echo '$''{'ac_cv_func_strtoul'+set}'`\" = set"; then
2609   echo $ac_n "(cached) $ac_c" 1>&6
2610 else
2611   cat > conftest.$ac_ext <<EOF
2612 #line 2613 "configure"
2613 #include "confdefs.h"
2614 /* System header to define __stub macros and hopefully few prototypes,
2615     which can conflict with char strtoul(); below.  */
2616 #include <assert.h>
2617 /* Override any gcc2 internal prototype to avoid an error.  */
2618 /* We use char because int might match the return type of a gcc2
2619     builtin and then its argument prototype would still apply.  */
2620 char strtoul();
2621
2622 int main() {
2623
2624 /* The GNU C library defines this for functions which it implements
2625     to always fail with ENOSYS.  Some functions are actually named
2626     something starting with __ and the normal name is an alias.  */
2627 #if defined (__stub_strtoul) || defined (__stub___strtoul)
2628 choke me
2629 #else
2630 strtoul();
2631 #endif
2632
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_func_strtoul=yes"
2638 else
2639   echo "configure: failed program was:" >&5
2640   cat conftest.$ac_ext >&5
2641   rm -rf conftest*
2642   eval "ac_cv_func_strtoul=no"
2643 fi
2644 rm -f conftest*
2645 fi
2646
2647 if eval "test \"`echo '$ac_cv_func_'strtoul`\" = yes"; then
2648   echo "$ac_t""yes" 1>&6
2649   tcl_ok=1
2650 else
2651   echo "$ac_t""no" 1>&6
2652 tcl_ok=0
2653 fi
2654
2655 if test "$cross_compiling" = yes; then
2656   tcl_ok=0
2657 else
2658   cat > conftest.$ac_ext <<EOF
2659 #line 2660 "configure"
2660 #include "confdefs.h"
2661
2662 extern int strtoul();
2663 int main()
2664 {
2665     char *string = "0";
2666     char *term;
2667     int value;
2668     value = strtoul(string, &term, 0);
2669     if ((value != 0) || (term != (string+1))) {
2670         exit(1);
2671     }
2672     exit(0);
2673 }
2674 EOF
2675 if { (eval echo configure:2676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2676 then
2677   :
2678 else
2679   echo "configure: failed program was:" >&5
2680   cat conftest.$ac_ext >&5
2681   rm -fr conftest*
2682   tcl_ok=0
2683 fi
2684 rm -fr conftest*
2685 fi
2686
2687 if test "$tcl_ok" = 0; then
2688     test -n "$verbose" && echo "        Adding strtoul.o."
2689     LIBOBJS="$LIBOBJS strtoul.o"
2690 fi
2691
2692 #--------------------------------------------------------------------
2693 #       Check for the strtod function.  This is tricky because in some
2694 #       versions of Linux strtod mis-parses strings starting with "+".
2695 #--------------------------------------------------------------------
2696
2697 echo $ac_n "checking for strtod""... $ac_c" 1>&6
2698 echo "configure:2699: checking for strtod" >&5
2699 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then
2700   echo $ac_n "(cached) $ac_c" 1>&6
2701 else
2702   cat > conftest.$ac_ext <<EOF
2703 #line 2704 "configure"
2704 #include "confdefs.h"
2705 /* System header to define __stub macros and hopefully few prototypes,
2706     which can conflict with char strtod(); below.  */
2707 #include <assert.h>
2708 /* Override any gcc2 internal prototype to avoid an error.  */
2709 /* We use char because int might match the return type of a gcc2
2710     builtin and then its argument prototype would still apply.  */
2711 char strtod();
2712
2713 int main() {
2714
2715 /* The GNU C library defines this for functions which it implements
2716     to always fail with ENOSYS.  Some functions are actually named
2717     something starting with __ and the normal name is an alias.  */
2718 #if defined (__stub_strtod) || defined (__stub___strtod)
2719 choke me
2720 #else
2721 strtod();
2722 #endif
2723
2724 ; return 0; }
2725 EOF
2726 if { (eval echo configure:2727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2727   rm -rf conftest*
2728   eval "ac_cv_func_strtod=yes"
2729 else
2730   echo "configure: failed program was:" >&5
2731   cat conftest.$ac_ext >&5
2732   rm -rf conftest*
2733   eval "ac_cv_func_strtod=no"
2734 fi
2735 rm -f conftest*
2736 fi
2737
2738 if eval "test \"`echo '$ac_cv_func_'strtod`\" = yes"; then
2739   echo "$ac_t""yes" 1>&6
2740   tcl_ok=1
2741 else
2742   echo "$ac_t""no" 1>&6
2743 tcl_ok=0
2744 fi
2745
2746 if test "$cross_compiling" = yes; then
2747   tcl_ok=0
2748 else
2749   cat > conftest.$ac_ext <<EOF
2750 #line 2751 "configure"
2751 #include "confdefs.h"
2752
2753 extern double strtod();
2754 int main()
2755 {
2756     char *string = " +69";
2757     char *term;
2758     double value;
2759     value = strtod(string, &term);
2760     if ((value != 69) || (term != (string+4))) {
2761         exit(1);
2762     }
2763     exit(0);
2764 }
2765 EOF
2766 if { (eval echo configure:2767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2767 then
2768   :
2769 else
2770   echo "configure: failed program was:" >&5
2771   cat conftest.$ac_ext >&5
2772   rm -fr conftest*
2773   tcl_ok=0
2774 fi
2775 rm -fr conftest*
2776 fi
2777
2778 if test "$tcl_ok" = 0; then
2779     test -n "$verbose" && echo "        Adding strtod.o."
2780     LIBOBJS="$LIBOBJS strtod.o"
2781 fi
2782
2783 #--------------------------------------------------------------------
2784 #       Under Solaris 2.4, strtod returns the wrong value for the
2785 #       terminating character under some conditions.  Check for this
2786 #       and if the problem exists use a substitute procedure
2787 #       "fixstrtod" that corrects the error.
2788 #--------------------------------------------------------------------
2789
2790 echo $ac_n "checking for strtod""... $ac_c" 1>&6
2791 echo "configure:2792: checking for strtod" >&5
2792 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then
2793   echo $ac_n "(cached) $ac_c" 1>&6
2794 else
2795   cat > conftest.$ac_ext <<EOF
2796 #line 2797 "configure"
2797 #include "confdefs.h"
2798 /* System header to define __stub macros and hopefully few prototypes,
2799     which can conflict with char strtod(); below.  */
2800 #include <assert.h>
2801 /* Override any gcc2 internal prototype to avoid an error.  */
2802 /* We use char because int might match the return type of a gcc2
2803     builtin and then its argument prototype would still apply.  */
2804 char strtod();
2805
2806 int main() {
2807
2808 /* The GNU C library defines this for functions which it implements
2809     to always fail with ENOSYS.  Some functions are actually named
2810     something starting with __ and the normal name is an alias.  */
2811 #if defined (__stub_strtod) || defined (__stub___strtod)
2812 choke me
2813 #else
2814 strtod();
2815 #endif
2816
2817 ; return 0; }
2818 EOF
2819 if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2820   rm -rf conftest*
2821   eval "ac_cv_func_strtod=yes"
2822 else
2823   echo "configure: failed program was:" >&5
2824   cat conftest.$ac_ext >&5
2825   rm -rf conftest*
2826   eval "ac_cv_func_strtod=no"
2827 fi
2828 rm -f conftest*
2829 fi
2830
2831 if eval "test \"`echo '$ac_cv_func_'strtod`\" = yes"; then
2832   echo "$ac_t""yes" 1>&6
2833   tcl_strtod=1
2834 else
2835   echo "$ac_t""no" 1>&6
2836 tcl_strtod=0
2837 fi
2838
2839 if test "$tcl_strtod" = 1; then
2840     echo $ac_n "checking for Solaris strtod bug""... $ac_c" 1>&6
2841 echo "configure:2842: checking for Solaris strtod bug" >&5
2842     if test "$cross_compiling" = yes; then
2843   tcl_ok=0
2844 else
2845   cat > conftest.$ac_ext <<EOF
2846 #line 2847 "configure"
2847 #include "confdefs.h"
2848
2849 extern double strtod();
2850 int main()
2851 {
2852     char *string = "NaN";
2853     char *term;
2854     strtod(string, &term);
2855     if ((term != string) && (term[-1] == 0)) {
2856         exit(1);
2857     }
2858     exit(0);
2859 }
2860 EOF
2861 if { (eval echo configure:2862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2862 then
2863   tcl_ok=1
2864 else
2865   echo "configure: failed program was:" >&5
2866   cat conftest.$ac_ext >&5
2867   rm -fr conftest*
2868   tcl_ok=0
2869 fi
2870 rm -fr conftest*
2871 fi
2872
2873     if test $tcl_ok = 1; then
2874         echo "$ac_t""ok" 1>&6
2875     else
2876         echo "$ac_t""buggy" 1>&6
2877         LIBOBJS="$LIBOBJS fixstrtod.o"
2878         cat >> confdefs.h <<\EOF
2879 #define strtod fixstrtod
2880 EOF
2881
2882     fi
2883 fi
2884
2885 #--------------------------------------------------------------------
2886 #       Check for various typedefs and provide substitutes if
2887 #       they don't exist.
2888 #--------------------------------------------------------------------
2889
2890 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
2891 echo "configure:2892: checking for ANSI C header files" >&5
2892 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
2893   echo $ac_n "(cached) $ac_c" 1>&6
2894 else
2895   cat > conftest.$ac_ext <<EOF
2896 #line 2897 "configure"
2897 #include "confdefs.h"
2898 #include <stdlib.h>
2899 #include <stdarg.h>
2900 #include <string.h>
2901 #include <float.h>
2902 EOF
2903 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2904 { (eval echo configure:2905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2905 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2906 if test -z "$ac_err"; then
2907   rm -rf conftest*
2908   ac_cv_header_stdc=yes
2909 else
2910   echo "$ac_err" >&5
2911   echo "configure: failed program was:" >&5
2912   cat conftest.$ac_ext >&5
2913   rm -rf conftest*
2914   ac_cv_header_stdc=no
2915 fi
2916 rm -f conftest*
2917
2918 if test $ac_cv_header_stdc = yes; then
2919   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
2920 cat > conftest.$ac_ext <<EOF
2921 #line 2922 "configure"
2922 #include "confdefs.h"
2923 #include <string.h>
2924 EOF
2925 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2926   egrep "memchr" >/dev/null 2>&1; then
2927   :
2928 else
2929   rm -rf conftest*
2930   ac_cv_header_stdc=no
2931 fi
2932 rm -f conftest*
2933
2934 fi
2935
2936 if test $ac_cv_header_stdc = yes; then
2937   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
2938 cat > conftest.$ac_ext <<EOF
2939 #line 2940 "configure"
2940 #include "confdefs.h"
2941 #include <stdlib.h>
2942 EOF
2943 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2944   egrep "free" >/dev/null 2>&1; then
2945   :
2946 else
2947   rm -rf conftest*
2948   ac_cv_header_stdc=no
2949 fi
2950 rm -f conftest*
2951
2952 fi
2953
2954 if test $ac_cv_header_stdc = yes; then
2955   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
2956 if test "$cross_compiling" = yes; then
2957   :
2958 else
2959   cat > conftest.$ac_ext <<EOF
2960 #line 2961 "configure"
2961 #include "confdefs.h"
2962 #include <ctype.h>
2963 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
2964 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
2965 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
2966 int main () { int i; for (i = 0; i < 256; i++)
2967 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
2968 exit (0); }
2969
2970 EOF
2971 if { (eval echo configure:2972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2972 then
2973   :
2974 else
2975   echo "configure: failed program was:" >&5
2976   cat conftest.$ac_ext >&5
2977   rm -fr conftest*
2978   ac_cv_header_stdc=no
2979 fi
2980 rm -fr conftest*
2981 fi
2982
2983 fi
2984 fi
2985
2986 echo "$ac_t""$ac_cv_header_stdc" 1>&6
2987 if test $ac_cv_header_stdc = yes; then
2988   cat >> confdefs.h <<\EOF
2989 #define STDC_HEADERS 1
2990 EOF
2991
2992 fi
2993
2994 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
2995 echo "configure:2996: checking for mode_t" >&5
2996 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
2997   echo $ac_n "(cached) $ac_c" 1>&6
2998 else
2999   cat > conftest.$ac_ext <<EOF
3000 #line 3001 "configure"
3001 #include "confdefs.h"
3002 #include <sys/types.h>
3003 #if STDC_HEADERS
3004 #include <stdlib.h>
3005 #include <stddef.h>
3006 #endif
3007 EOF
3008 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3009   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3010   rm -rf conftest*
3011   ac_cv_type_mode_t=yes
3012 else
3013   rm -rf conftest*
3014   ac_cv_type_mode_t=no
3015 fi
3016 rm -f conftest*
3017
3018 fi
3019 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3020 if test $ac_cv_type_mode_t = no; then
3021   cat >> confdefs.h <<\EOF
3022 #define mode_t int
3023 EOF
3024
3025 fi
3026
3027 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3028 echo "configure:3029: checking for pid_t" >&5
3029 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
3030   echo $ac_n "(cached) $ac_c" 1>&6
3031 else
3032   cat > conftest.$ac_ext <<EOF
3033 #line 3034 "configure"
3034 #include "confdefs.h"
3035 #include <sys/types.h>
3036 #if STDC_HEADERS
3037 #include <stdlib.h>
3038 #include <stddef.h>
3039 #endif
3040 EOF
3041 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3042   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3043   rm -rf conftest*
3044   ac_cv_type_pid_t=yes
3045 else
3046   rm -rf conftest*
3047   ac_cv_type_pid_t=no
3048 fi
3049 rm -f conftest*
3050
3051 fi
3052 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3053 if test $ac_cv_type_pid_t = no; then
3054   cat >> confdefs.h <<\EOF
3055 #define pid_t int
3056 EOF
3057
3058 fi
3059
3060 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3061 echo "configure:3062: checking for size_t" >&5
3062 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
3063   echo $ac_n "(cached) $ac_c" 1>&6
3064 else
3065   cat > conftest.$ac_ext <<EOF
3066 #line 3067 "configure"
3067 #include "confdefs.h"
3068 #include <sys/types.h>
3069 #if STDC_HEADERS
3070 #include <stdlib.h>
3071 #include <stddef.h>
3072 #endif
3073 EOF
3074 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3075   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3076   rm -rf conftest*
3077   ac_cv_type_size_t=yes
3078 else
3079   rm -rf conftest*
3080   ac_cv_type_size_t=no
3081 fi
3082 rm -f conftest*
3083
3084 fi
3085 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3086 if test $ac_cv_type_size_t = no; then
3087   cat >> confdefs.h <<\EOF
3088 #define size_t unsigned
3089 EOF
3090
3091 fi
3092
3093 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3094 echo "configure:3095: checking for uid_t in sys/types.h" >&5
3095 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
3096   echo $ac_n "(cached) $ac_c" 1>&6
3097 else
3098   cat > conftest.$ac_ext <<EOF
3099 #line 3100 "configure"
3100 #include "confdefs.h"
3101 #include <sys/types.h>
3102 EOF
3103 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3104   egrep "uid_t" >/dev/null 2>&1; then
3105   rm -rf conftest*
3106   ac_cv_type_uid_t=yes
3107 else
3108   rm -rf conftest*
3109   ac_cv_type_uid_t=no
3110 fi
3111 rm -f conftest*
3112
3113 fi
3114
3115 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3116 if test $ac_cv_type_uid_t = no; then
3117   cat >> confdefs.h <<\EOF
3118 #define uid_t int
3119 EOF
3120
3121   cat >> confdefs.h <<\EOF
3122 #define gid_t int
3123 EOF
3124
3125 fi
3126
3127
3128 #--------------------------------------------------------------------
3129 #       If a system doesn't have an opendir function (man, that's old!)
3130 #       then we have to supply a different version of dirent.h which
3131 #       is compatible with the substitute version of opendir that's
3132 #       provided.  This version only works with V7-style directories.
3133 #--------------------------------------------------------------------
3134
3135 echo $ac_n "checking for opendir""... $ac_c" 1>&6
3136 echo "configure:3137: checking for opendir" >&5
3137 if eval "test \"`echo '$''{'ac_cv_func_opendir'+set}'`\" = set"; then
3138   echo $ac_n "(cached) $ac_c" 1>&6
3139 else
3140   cat > conftest.$ac_ext <<EOF
3141 #line 3142 "configure"
3142 #include "confdefs.h"
3143 /* System header to define __stub macros and hopefully few prototypes,
3144     which can conflict with char opendir(); below.  */
3145 #include <assert.h>
3146 /* Override any gcc2 internal prototype to avoid an error.  */
3147 /* We use char because int might match the return type of a gcc2
3148     builtin and then its argument prototype would still apply.  */
3149 char opendir();
3150
3151 int main() {
3152
3153 /* The GNU C library defines this for functions which it implements
3154     to always fail with ENOSYS.  Some functions are actually named
3155     something starting with __ and the normal name is an alias.  */
3156 #if defined (__stub_opendir) || defined (__stub___opendir)
3157 choke me
3158 #else
3159 opendir();
3160 #endif
3161
3162 ; return 0; }
3163 EOF
3164 if { (eval echo configure:3165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3165   rm -rf conftest*
3166   eval "ac_cv_func_opendir=yes"
3167 else
3168   echo "configure: failed program was:" >&5
3169   cat conftest.$ac_ext >&5
3170   rm -rf conftest*
3171   eval "ac_cv_func_opendir=no"
3172 fi
3173 rm -f conftest*
3174 fi
3175
3176 if eval "test \"`echo '$ac_cv_func_'opendir`\" = yes"; then
3177   echo "$ac_t""yes" 1>&6
3178   :
3179 else
3180   echo "$ac_t""no" 1>&6
3181 cat >> confdefs.h <<\EOF
3182 #define USE_DIRENT2_H 1
3183 EOF
3184
3185 fi
3186
3187
3188 #--------------------------------------------------------------------
3189 #       The check below checks whether <sys/wait.h> defines the type
3190 #       "union wait" correctly.  It's needed because of weirdness in
3191 #       HP-UX where "union wait" is defined in both the BSD and SYS-V
3192 #       environments.  Checking the usability of WIFEXITED seems to do
3193 #       the trick.
3194 #--------------------------------------------------------------------
3195
3196 echo $ac_n "checking union wait""... $ac_c" 1>&6
3197 echo "configure:3198: checking union wait" >&5
3198 cat > conftest.$ac_ext <<EOF
3199 #line 3200 "configure"
3200 #include "confdefs.h"
3201 #include <sys/types.h> 
3202 #include <sys/wait.h>
3203 int main() {
3204
3205 union wait x;
3206 WIFEXITED(x);           /* Generates compiler error if WIFEXITED
3207                          * uses an int. */
3208
3209 ; return 0; }
3210 EOF
3211 if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3212   rm -rf conftest*
3213   tcl_ok=yes
3214 else
3215   echo "configure: failed program was:" >&5
3216   cat conftest.$ac_ext >&5
3217   rm -rf conftest*
3218   tcl_ok=no
3219 fi
3220 rm -f conftest*
3221 echo "$ac_t""$tcl_ok" 1>&6
3222 if test $tcl_ok = no; then
3223     cat >> confdefs.h <<\EOF
3224 #define NO_UNION_WAIT 1
3225 EOF
3226
3227 fi
3228
3229 #--------------------------------------------------------------------
3230 #       Check to see whether the system supports the matherr function
3231 #       and its associated type "struct exception".
3232 #--------------------------------------------------------------------
3233
3234 echo $ac_n "checking matherr support""... $ac_c" 1>&6
3235 echo "configure:3236: checking matherr support" >&5
3236 cat > conftest.$ac_ext <<EOF
3237 #line 3238 "configure"
3238 #include "confdefs.h"
3239 #include <math.h>
3240 int main() {
3241
3242 struct exception x;
3243 x.type = DOMAIN;
3244 x.type = SING;
3245
3246 ; return 0; }
3247 EOF
3248 if { (eval echo configure:3249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3249   rm -rf conftest*
3250   tcl_ok=yes
3251 else
3252   echo "configure: failed program was:" >&5
3253   cat conftest.$ac_ext >&5
3254   rm -rf conftest*
3255   tcl_ok=no
3256 fi
3257 rm -f conftest*
3258 echo "$ac_t""$tcl_ok" 1>&6
3259 if test $tcl_ok = yes; then
3260     cat >> confdefs.h <<\EOF
3261 #define NEED_MATHERR 1
3262 EOF
3263
3264 fi
3265
3266 #--------------------------------------------------------------------
3267 #       Check to see whether the system provides a vfork kernel call.
3268 #       If not, then use fork instead.  Also, check for a problem with
3269 #       vforks and signals that can cause core dumps if a vforked child
3270 #       resets a signal handler.  If the problem exists, then use fork
3271 #       instead of vfork.
3272 #--------------------------------------------------------------------
3273
3274 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3275 echo "configure:3276: checking return type of signal handlers" >&5
3276 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
3277   echo $ac_n "(cached) $ac_c" 1>&6
3278 else
3279   cat > conftest.$ac_ext <<EOF
3280 #line 3281 "configure"
3281 #include "confdefs.h"
3282 #include <sys/types.h>
3283 #include <signal.h>
3284 #ifdef signal
3285 #undef signal
3286 #endif
3287 #ifdef __cplusplus
3288 extern "C" void (*signal (int, void (*)(int)))(int);
3289 #else
3290 void (*signal ()) ();
3291 #endif
3292
3293 int main() {
3294 int i;
3295 ; return 0; }
3296 EOF
3297 if { (eval echo configure:3298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3298   rm -rf conftest*
3299   ac_cv_type_signal=void
3300 else
3301   echo "configure: failed program was:" >&5
3302   cat conftest.$ac_ext >&5
3303   rm -rf conftest*
3304   ac_cv_type_signal=int
3305 fi
3306 rm -f conftest*
3307 fi
3308
3309 echo "$ac_t""$ac_cv_type_signal" 1>&6
3310 cat >> confdefs.h <<EOF
3311 #define RETSIGTYPE $ac_cv_type_signal
3312 EOF
3313
3314
3315 echo $ac_n "checking for vfork""... $ac_c" 1>&6
3316 echo "configure:3317: checking for vfork" >&5
3317 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
3318   echo $ac_n "(cached) $ac_c" 1>&6
3319 else
3320   cat > conftest.$ac_ext <<EOF
3321 #line 3322 "configure"
3322 #include "confdefs.h"
3323 /* System header to define __stub macros and hopefully few prototypes,
3324     which can conflict with char vfork(); below.  */
3325 #include <assert.h>
3326 /* Override any gcc2 internal prototype to avoid an error.  */
3327 /* We use char because int might match the return type of a gcc2
3328     builtin and then its argument prototype would still apply.  */
3329 char vfork();
3330
3331 int main() {
3332
3333 /* The GNU C library defines this for functions which it implements
3334     to always fail with ENOSYS.  Some functions are actually named
3335     something starting with __ and the normal name is an alias.  */
3336 #if defined (__stub_vfork) || defined (__stub___vfork)
3337 choke me
3338 #else
3339 vfork();
3340 #endif
3341
3342 ; return 0; }
3343 EOF
3344 if { (eval echo configure:3345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3345   rm -rf conftest*
3346   eval "ac_cv_func_vfork=yes"
3347 else
3348   echo "configure: failed program was:" >&5
3349   cat conftest.$ac_ext >&5
3350   rm -rf conftest*
3351   eval "ac_cv_func_vfork=no"
3352 fi
3353 rm -f conftest*
3354 fi
3355
3356 if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
3357   echo "$ac_t""yes" 1>&6
3358   tcl_ok=1
3359 else
3360   echo "$ac_t""no" 1>&6
3361 tcl_ok=0
3362 fi
3363
3364 if test "$tcl_ok" = 1; then
3365     echo $ac_n "checking vfork/signal bug""... $ac_c" 1>&6
3366 echo "configure:3367: checking vfork/signal bug" >&5;
3367     if test "$cross_compiling" = yes; then
3368   tcl_ok=0
3369 else
3370   cat > conftest.$ac_ext <<EOF
3371 #line 3372 "configure"
3372 #include "confdefs.h"
3373
3374 #include <stdio.h>
3375 #include <signal.h>
3376 #include <sys/wait.h>
3377 int gotSignal = 0;
3378 sigProc(sig)
3379     int sig;
3380 {
3381     gotSignal = 1;
3382 }
3383 main()
3384 {
3385     int pid, sts;
3386     (void) signal(SIGCHLD, sigProc);
3387     pid = vfork();
3388     if (pid <  0) {
3389         exit(1);
3390     } else if (pid == 0) {
3391         (void) signal(SIGCHLD, SIG_DFL);
3392         _exit(0);
3393     } else {
3394         (void) wait(&sts);
3395     }
3396     exit((gotSignal) ? 0 : 1);
3397 }
3398 EOF
3399 if { (eval echo configure:3400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3400 then
3401   tcl_ok=1
3402 else
3403   echo "configure: failed program was:" >&5
3404   cat conftest.$ac_ext >&5
3405   rm -fr conftest*
3406   tcl_ok=0
3407 fi
3408 rm -fr conftest*
3409 fi
3410
3411     if test "$tcl_ok" = 1; then
3412         echo "$ac_t""ok" 1>&6
3413     else
3414         echo "$ac_t""buggy, using fork instead" 1>&6
3415     fi
3416 fi
3417 rm -f core
3418 if test "$tcl_ok" = 0; then
3419     cat >> confdefs.h <<\EOF
3420 #define vfork fork
3421 EOF
3422
3423 fi
3424
3425 #--------------------------------------------------------------------
3426 #       Check whether there is an strncasecmp function on this system.
3427 #       This is a bit tricky because under SCO it's in -lsocket and
3428 #       under Sequent Dynix it's in -linet.
3429 #--------------------------------------------------------------------
3430
3431 echo $ac_n "checking for strncasecmp""... $ac_c" 1>&6
3432 echo "configure:3433: checking for strncasecmp" >&5
3433 if eval "test \"`echo '$''{'ac_cv_func_strncasecmp'+set}'`\" = set"; then
3434   echo $ac_n "(cached) $ac_c" 1>&6
3435 else
3436   cat > conftest.$ac_ext <<EOF
3437 #line 3438 "configure"
3438 #include "confdefs.h"
3439 /* System header to define __stub macros and hopefully few prototypes,
3440     which can conflict with char strncasecmp(); below.  */
3441 #include <assert.h>
3442 /* Override any gcc2 internal prototype to avoid an error.  */
3443 /* We use char because int might match the return type of a gcc2
3444     builtin and then its argument prototype would still apply.  */
3445 char strncasecmp();
3446
3447 int main() {
3448
3449 /* The GNU C library defines this for functions which it implements
3450     to always fail with ENOSYS.  Some functions are actually named
3451     something starting with __ and the normal name is an alias.  */
3452 #if defined (__stub_strncasecmp) || defined (__stub___strncasecmp)
3453 choke me
3454 #else
3455 strncasecmp();
3456 #endif
3457
3458 ; return 0; }
3459 EOF
3460 if { (eval echo configure:3461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3461   rm -rf conftest*
3462   eval "ac_cv_func_strncasecmp=yes"
3463 else
3464   echo "configure: failed program was:" >&5
3465   cat conftest.$ac_ext >&5
3466   rm -rf conftest*
3467   eval "ac_cv_func_strncasecmp=no"
3468 fi
3469 rm -f conftest*
3470 fi
3471
3472 if eval "test \"`echo '$ac_cv_func_'strncasecmp`\" = yes"; then
3473   echo "$ac_t""yes" 1>&6
3474   tcl_ok=1
3475 else
3476   echo "$ac_t""no" 1>&6
3477 tcl_ok=0
3478 fi
3479
3480 if test "$tcl_ok" = 0; then
3481     echo $ac_n "checking for strncasecmp in -lsocket""... $ac_c" 1>&6
3482 echo "configure:3483: checking for strncasecmp in -lsocket" >&5
3483 ac_lib_var=`echo socket'_'strncasecmp | sed 'y%./+-%__p_%'`
3484 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3485   echo $ac_n "(cached) $ac_c" 1>&6
3486 else
3487   ac_save_LIBS="$LIBS"
3488 LIBS="-lsocket  $LIBS"
3489 cat > conftest.$ac_ext <<EOF
3490 #line 3491 "configure"
3491 #include "confdefs.h"
3492 /* Override any gcc2 internal prototype to avoid an error.  */
3493 /* We use char because int might match the return type of a gcc2
3494     builtin and then its argument prototype would still apply.  */
3495 char strncasecmp();
3496
3497 int main() {
3498 strncasecmp()
3499 ; return 0; }
3500 EOF
3501 if { (eval echo configure:3502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3502   rm -rf conftest*
3503   eval "ac_cv_lib_$ac_lib_var=yes"
3504 else
3505   echo "configure: failed program was:" >&5
3506   cat conftest.$ac_ext >&5
3507   rm -rf conftest*
3508   eval "ac_cv_lib_$ac_lib_var=no"
3509 fi
3510 rm -f conftest*
3511 LIBS="$ac_save_LIBS"
3512
3513 fi
3514 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3515   echo "$ac_t""yes" 1>&6
3516   tcl_ok=1
3517 else
3518   echo "$ac_t""no" 1>&6
3519 tcl_ok=0
3520 fi
3521
3522 fi
3523 if test "$tcl_ok" = 0; then
3524     echo $ac_n "checking for strncasecmp in -linet""... $ac_c" 1>&6
3525 echo "configure:3526: checking for strncasecmp in -linet" >&5
3526 ac_lib_var=`echo inet'_'strncasecmp | sed 'y%./+-%__p_%'`
3527 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3528   echo $ac_n "(cached) $ac_c" 1>&6
3529 else
3530   ac_save_LIBS="$LIBS"
3531 LIBS="-linet  $LIBS"
3532 cat > conftest.$ac_ext <<EOF
3533 #line 3534 "configure"
3534 #include "confdefs.h"
3535 /* Override any gcc2 internal prototype to avoid an error.  */
3536 /* We use char because int might match the return type of a gcc2
3537     builtin and then its argument prototype would still apply.  */
3538 char strncasecmp();
3539
3540 int main() {
3541 strncasecmp()
3542 ; return 0; }
3543 EOF
3544 if { (eval echo configure:3545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3545   rm -rf conftest*
3546   eval "ac_cv_lib_$ac_lib_var=yes"
3547 else
3548   echo "configure: failed program was:" >&5
3549   cat conftest.$ac_ext >&5
3550   rm -rf conftest*
3551   eval "ac_cv_lib_$ac_lib_var=no"
3552 fi
3553 rm -f conftest*
3554 LIBS="$ac_save_LIBS"
3555
3556 fi
3557 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3558   echo "$ac_t""yes" 1>&6
3559   tcl_ok=1
3560 else
3561   echo "$ac_t""no" 1>&6
3562 tcl_ok=0
3563 fi
3564
3565 fi
3566 if test "$tcl_ok" = 0; then
3567     LIBOBJS="$LIBOBJS strncasecmp.o"
3568 fi
3569
3570 #--------------------------------------------------------------------
3571 #       The code below deals with several issues related to gettimeofday:
3572 #       1. Some systems don't provide a gettimeofday function at all
3573 #          (set NO_GETTOD if this is the case).
3574 #       2. SGI systems don't use the BSD form of the gettimeofday function,
3575 #          but they have a BSDgettimeofday function that can be used instead.
3576 #       3. See if gettimeofday is declared in the <sys/time.h> header file.
3577 #          if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can
3578 #          declare it.
3579 #--------------------------------------------------------------------
3580
3581 echo $ac_n "checking for BSDgettimeofday""... $ac_c" 1>&6
3582 echo "configure:3583: checking for BSDgettimeofday" >&5
3583 if eval "test \"`echo '$''{'ac_cv_func_BSDgettimeofday'+set}'`\" = set"; then
3584   echo $ac_n "(cached) $ac_c" 1>&6
3585 else
3586   cat > conftest.$ac_ext <<EOF
3587 #line 3588 "configure"
3588 #include "confdefs.h"
3589 /* System header to define __stub macros and hopefully few prototypes,
3590     which can conflict with char BSDgettimeofday(); below.  */
3591 #include <assert.h>
3592 /* Override any gcc2 internal prototype to avoid an error.  */
3593 /* We use char because int might match the return type of a gcc2
3594     builtin and then its argument prototype would still apply.  */
3595 char BSDgettimeofday();
3596
3597 int main() {
3598
3599 /* The GNU C library defines this for functions which it implements
3600     to always fail with ENOSYS.  Some functions are actually named
3601     something starting with __ and the normal name is an alias.  */
3602 #if defined (__stub_BSDgettimeofday) || defined (__stub___BSDgettimeofday)
3603 choke me
3604 #else
3605 BSDgettimeofday();
3606 #endif
3607
3608 ; return 0; }
3609 EOF
3610 if { (eval echo configure:3611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3611   rm -rf conftest*
3612   eval "ac_cv_func_BSDgettimeofday=yes"
3613 else
3614   echo "configure: failed program was:" >&5
3615   cat conftest.$ac_ext >&5
3616   rm -rf conftest*
3617   eval "ac_cv_func_BSDgettimeofday=no"
3618 fi
3619 rm -f conftest*
3620 fi
3621
3622 if eval "test \"`echo '$ac_cv_func_'BSDgettimeofday`\" = yes"; then
3623   echo "$ac_t""yes" 1>&6
3624   cat >> confdefs.h <<\EOF
3625 #define HAVE_BSDGETTIMEOFDAY 1
3626 EOF
3627
3628 else
3629   echo "$ac_t""no" 1>&6
3630 echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6
3631 echo "configure:3632: checking for gettimeofday" >&5
3632 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then
3633   echo $ac_n "(cached) $ac_c" 1>&6
3634 else
3635   cat > conftest.$ac_ext <<EOF
3636 #line 3637 "configure"
3637 #include "confdefs.h"
3638 /* System header to define __stub macros and hopefully few prototypes,
3639     which can conflict with char gettimeofday(); below.  */
3640 #include <assert.h>
3641 /* Override any gcc2 internal prototype to avoid an error.  */
3642 /* We use char because int might match the return type of a gcc2
3643     builtin and then its argument prototype would still apply.  */
3644 char gettimeofday();
3645
3646 int main() {
3647
3648 /* The GNU C library defines this for functions which it implements
3649     to always fail with ENOSYS.  Some functions are actually named
3650     something starting with __ and the normal name is an alias.  */
3651 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
3652 choke me
3653 #else
3654 gettimeofday();
3655 #endif
3656
3657 ; return 0; }
3658 EOF
3659 if { (eval echo configure:3660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3660   rm -rf conftest*
3661   eval "ac_cv_func_gettimeofday=yes"
3662 else
3663   echo "configure: failed program was:" >&5
3664   cat conftest.$ac_ext >&5
3665   rm -rf conftest*
3666   eval "ac_cv_func_gettimeofday=no"
3667 fi
3668 rm -f conftest*
3669 fi
3670
3671 if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then
3672   echo "$ac_t""yes" 1>&6
3673   :
3674 else
3675   echo "$ac_t""no" 1>&6
3676 cat >> confdefs.h <<\EOF
3677 #define NO_GETTOD 1
3678 EOF
3679
3680 fi
3681
3682 fi
3683
3684 echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6
3685 echo "configure:3686: checking for gettimeofday declaration" >&5
3686 cat > conftest.$ac_ext <<EOF
3687 #line 3688 "configure"
3688 #include "confdefs.h"
3689 #include <sys/time.h>
3690 EOF
3691 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3692   egrep "gettimeofday" >/dev/null 2>&1; then
3693   rm -rf conftest*
3694   echo "$ac_t""present" 1>&6
3695 else
3696   rm -rf conftest*
3697   
3698     echo "$ac_t""missing" 1>&6
3699     cat >> confdefs.h <<\EOF
3700 #define GETTOD_NOT_DECLARED 1
3701 EOF
3702
3703
3704 fi
3705 rm -f conftest*
3706
3707
3708 #--------------------------------------------------------------------
3709 #       Interactive UNIX requires -linet instead of -lsocket, plus it
3710 #       needs net/errno.h to define the socket-related error codes.
3711 #--------------------------------------------------------------------
3712
3713 echo $ac_n "checking for main in -linet""... $ac_c" 1>&6
3714 echo "configure:3715: checking for main in -linet" >&5
3715 ac_lib_var=`echo inet'_'main | sed 'y%./+-%__p_%'`
3716 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3717   echo $ac_n "(cached) $ac_c" 1>&6
3718 else
3719   ac_save_LIBS="$LIBS"
3720 LIBS="-linet  $LIBS"
3721 cat > conftest.$ac_ext <<EOF
3722 #line 3723 "configure"
3723 #include "confdefs.h"
3724
3725 int main() {
3726 main()
3727 ; return 0; }
3728 EOF
3729 if { (eval echo configure:3730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3730   rm -rf conftest*
3731   eval "ac_cv_lib_$ac_lib_var=yes"
3732 else
3733   echo "configure: failed program was:" >&5
3734   cat conftest.$ac_ext >&5
3735   rm -rf conftest*
3736   eval "ac_cv_lib_$ac_lib_var=no"
3737 fi
3738 rm -f conftest*
3739 LIBS="$ac_save_LIBS"
3740
3741 fi
3742 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3743   echo "$ac_t""yes" 1>&6
3744   LIBS="$LIBS -linet"
3745 else
3746   echo "$ac_t""no" 1>&6
3747 fi
3748
3749 ac_safe=`echo "net/errno.h" | sed 'y%./+-%__p_%'`
3750 echo $ac_n "checking for net/errno.h""... $ac_c" 1>&6
3751 echo "configure:3752: checking for net/errno.h" >&5
3752 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3753   echo $ac_n "(cached) $ac_c" 1>&6
3754 else
3755   cat > conftest.$ac_ext <<EOF
3756 #line 3757 "configure"
3757 #include "confdefs.h"
3758 #include <net/errno.h>
3759 EOF
3760 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3761 { (eval echo configure:3762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3762 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3763 if test -z "$ac_err"; then
3764   rm -rf conftest*
3765   eval "ac_cv_header_$ac_safe=yes"
3766 else
3767   echo "$ac_err" >&5
3768   echo "configure: failed program was:" >&5
3769   cat conftest.$ac_ext >&5
3770   rm -rf conftest*
3771   eval "ac_cv_header_$ac_safe=no"
3772 fi
3773 rm -f conftest*
3774 fi
3775 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3776   echo "$ac_t""yes" 1>&6
3777   cat >> confdefs.h <<\EOF
3778 #define HAVE_NET_ERRNO_H 1
3779 EOF
3780
3781 else
3782   echo "$ac_t""no" 1>&6
3783 fi
3784
3785
3786 #--------------------------------------------------------------------
3787 #       The following code checks to see whether it is possible to get
3788 #       signed chars on this platform.  This is needed in order to
3789 #       properly generate sign-extended ints from character values.
3790 #--------------------------------------------------------------------
3791
3792 echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
3793 echo "configure:3794: checking whether char is unsigned" >&5
3794 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
3795   echo $ac_n "(cached) $ac_c" 1>&6
3796 else
3797   if test "$GCC" = yes; then
3798   # GCC predefines this symbol on systems where it applies.
3799 cat > conftest.$ac_ext <<EOF
3800 #line 3801 "configure"
3801 #include "confdefs.h"
3802 #ifdef __CHAR_UNSIGNED__
3803   yes
3804 #endif
3805
3806 EOF
3807 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3808   egrep "yes" >/dev/null 2>&1; then
3809   rm -rf conftest*
3810   ac_cv_c_char_unsigned=yes
3811 else
3812   rm -rf conftest*
3813   ac_cv_c_char_unsigned=no
3814 fi
3815 rm -f conftest*
3816
3817 else
3818 if test "$cross_compiling" = yes; then
3819     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
3820 else
3821   cat > conftest.$ac_ext <<EOF
3822 #line 3823 "configure"
3823 #include "confdefs.h"
3824 /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
3825 #if !defined(__STDC__) || __STDC__ != 1
3826 #define volatile
3827 #endif
3828 main() {
3829   volatile char c = 255; exit(c < 0);
3830 }
3831 EOF
3832 if { (eval echo configure:3833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3833 then
3834   ac_cv_c_char_unsigned=yes
3835 else
3836   echo "configure: failed program was:" >&5
3837   cat conftest.$ac_ext >&5
3838   rm -fr conftest*
3839   ac_cv_c_char_unsigned=no
3840 fi
3841 rm -fr conftest*
3842 fi
3843
3844 fi
3845 fi
3846
3847 echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6
3848 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
3849   cat >> confdefs.h <<\EOF
3850 #define __CHAR_UNSIGNED__ 1
3851 EOF
3852
3853 fi
3854
3855 echo $ac_n "checking signed char declarations""... $ac_c" 1>&6
3856 echo "configure:3857: checking signed char declarations" >&5
3857 cat > conftest.$ac_ext <<EOF
3858 #line 3859 "configure"
3859 #include "confdefs.h"
3860
3861 int main() {
3862
3863 signed char *p;
3864 p = 0;
3865
3866 ; return 0; }
3867 EOF
3868 if { (eval echo configure:3869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3869   rm -rf conftest*
3870   tcl_ok=yes
3871 else
3872   echo "configure: failed program was:" >&5
3873   cat conftest.$ac_ext >&5
3874   rm -rf conftest*
3875   tcl_ok=no
3876 fi
3877 rm -f conftest*
3878 echo "$ac_t""$tcl_ok" 1>&6
3879 if test $tcl_ok = yes; then
3880     cat >> confdefs.h <<\EOF
3881 #define HAVE_SIGNED_CHAR 1
3882 EOF
3883
3884 fi
3885
3886 #--------------------------------------------------------------------
3887 #       Check for the existence of the -lsocket and -lnsl libraries.
3888 #       The order here is important, so that they end up in the right
3889 #       order in the command line generated by make.  Here are some
3890 #       special considerations:
3891 #       1. Use "connect" and "accept" to check for -lsocket, and
3892 #          "gethostbyname" to check for -lnsl.
3893 #       2. Use each function name only once:  can't redo a check because
3894 #          autoconf caches the results of the last check and won't redo it.
3895 #       3. Use -lnsl and -lsocket only if they supply procedures that
3896 #          aren't already present in the normal libraries.  This is because
3897 #          IRIX 5.2 has libraries, but they aren't needed and they're
3898 #          bogus:  they goof up name resolution if used.
3899 #       4. On some SVR4 systems, can't use -lsocket without -lnsl too.
3900 #          To get around this problem, check for both libraries together
3901 #          if -lsocket doesn't work by itself.
3902 #--------------------------------------------------------------------
3903
3904 # CYGNUS LOCAL: Store any socket library(ies) in the cache, and don't
3905 # mess up the cache values of the functions we check for.
3906 echo $ac_n "checking for socket libraries""... $ac_c" 1>&6
3907 echo "configure:3908: checking for socket libraries" >&5
3908 if eval "test \"`echo '$''{'tcl_cv_lib_sockets'+set}'`\" = set"; then
3909   echo $ac_n "(cached) $ac_c" 1>&6
3910 else
3911   tcl_cv_lib_sockets=
3912   tcl_checkBoth=0
3913   unset ac_cv_func_connect
3914   echo $ac_n "checking for connect""... $ac_c" 1>&6
3915 echo "configure:3916: checking for connect" >&5
3916 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
3917   echo $ac_n "(cached) $ac_c" 1>&6
3918 else
3919   cat > conftest.$ac_ext <<EOF
3920 #line 3921 "configure"
3921 #include "confdefs.h"
3922 /* System header to define __stub macros and hopefully few prototypes,
3923     which can conflict with char connect(); below.  */
3924 #include <assert.h>
3925 /* Override any gcc2 internal prototype to avoid an error.  */
3926 /* We use char because int might match the return type of a gcc2
3927     builtin and then its argument prototype would still apply.  */
3928 char connect();
3929
3930 int main() {
3931
3932 /* The GNU C library defines this for functions which it implements
3933     to always fail with ENOSYS.  Some functions are actually named
3934     something starting with __ and the normal name is an alias.  */
3935 #if defined (__stub_connect) || defined (__stub___connect)
3936 choke me
3937 #else
3938 connect();
3939 #endif
3940
3941 ; return 0; }
3942 EOF
3943 if { (eval echo configure:3944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3944   rm -rf conftest*
3945   eval "ac_cv_func_connect=yes"
3946 else
3947   echo "configure: failed program was:" >&5
3948   cat conftest.$ac_ext >&5
3949   rm -rf conftest*
3950   eval "ac_cv_func_connect=no"
3951 fi
3952 rm -f conftest*
3953 fi
3954
3955 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
3956   echo "$ac_t""yes" 1>&6
3957   tcl_checkSocket=0
3958 else
3959   echo "$ac_t""no" 1>&6
3960 tcl_checkSocket=1
3961 fi
3962
3963   if test "$tcl_checkSocket" = 1; then
3964       unset ac_cv_func_connect
3965       echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3966 echo "configure:3967: checking for main in -lsocket" >&5
3967 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3968 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3969   echo $ac_n "(cached) $ac_c" 1>&6
3970 else
3971   ac_save_LIBS="$LIBS"
3972 LIBS="-lsocket  $LIBS"
3973 cat > conftest.$ac_ext <<EOF
3974 #line 3975 "configure"
3975 #include "confdefs.h"
3976
3977 int main() {
3978 main()
3979 ; return 0; }
3980 EOF
3981 if { (eval echo configure:3982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3982   rm -rf conftest*
3983   eval "ac_cv_lib_$ac_lib_var=yes"
3984 else
3985   echo "configure: failed program was:" >&5
3986   cat conftest.$ac_ext >&5
3987   rm -rf conftest*
3988   eval "ac_cv_lib_$ac_lib_var=no"
3989 fi
3990 rm -f conftest*
3991 LIBS="$ac_save_LIBS"
3992
3993 fi
3994 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3995   echo "$ac_t""yes" 1>&6
3996   tcl_cv_lib_sockets="-lsocket"
3997 else
3998   echo "$ac_t""no" 1>&6
3999 tcl_checkBoth=1
4000 fi
4001
4002   fi
4003   if test "$tcl_checkBoth" = 1; then
4004       tcl_oldLibs=$LIBS
4005       LIBS="$LIBS -lsocket -lnsl"
4006       unset ac_cv_func_accept
4007       echo $ac_n "checking for accept""... $ac_c" 1>&6
4008 echo "configure:4009: checking for accept" >&5
4009 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
4010   echo $ac_n "(cached) $ac_c" 1>&6
4011 else
4012   cat > conftest.$ac_ext <<EOF
4013 #line 4014 "configure"
4014 #include "confdefs.h"
4015 /* System header to define __stub macros and hopefully few prototypes,
4016     which can conflict with char accept(); below.  */
4017 #include <assert.h>
4018 /* Override any gcc2 internal prototype to avoid an error.  */
4019 /* We use char because int might match the return type of a gcc2
4020     builtin and then its argument prototype would still apply.  */
4021 char accept();
4022
4023 int main() {
4024
4025 /* The GNU C library defines this for functions which it implements
4026     to always fail with ENOSYS.  Some functions are actually named
4027     something starting with __ and the normal name is an alias.  */
4028 #if defined (__stub_accept) || defined (__stub___accept)
4029 choke me
4030 #else
4031 accept();
4032 #endif
4033
4034 ; return 0; }
4035 EOF
4036 if { (eval echo configure:4037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4037   rm -rf conftest*
4038   eval "ac_cv_func_accept=yes"
4039 else
4040   echo "configure: failed program was:" >&5
4041   cat conftest.$ac_ext >&5
4042   rm -rf conftest*
4043   eval "ac_cv_func_accept=no"
4044 fi
4045 rm -f conftest*
4046 fi
4047
4048 if eval "test \"`echo '$ac_cv_func_'accept`\" = yes"; then
4049   echo "$ac_t""yes" 1>&6
4050   tcl_checkNsl=0
4051                      tcl_cv_lib_sockets="-lsocket -lnsl"
4052 else
4053   echo "$ac_t""no" 1>&6
4054 fi
4055
4056       unset ac_cv_func_accept
4057       LIBS=$tcl_oldLibs
4058   fi
4059   unset ac_cv_func_gethostbyname
4060   tcl_oldLibs=$LIBS
4061   LIBS="$LIBS $tcl_cv_lib_sockets"
4062   echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
4063 echo "configure:4064: checking for gethostbyname" >&5
4064 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
4065   echo $ac_n "(cached) $ac_c" 1>&6
4066 else
4067   cat > conftest.$ac_ext <<EOF
4068 #line 4069 "configure"
4069 #include "confdefs.h"
4070 /* System header to define __stub macros and hopefully few prototypes,
4071     which can conflict with char gethostbyname(); below.  */
4072 #include <assert.h>
4073 /* Override any gcc2 internal prototype to avoid an error.  */
4074 /* We use char because int might match the return type of a gcc2
4075     builtin and then its argument prototype would still apply.  */
4076 char gethostbyname();
4077
4078 int main() {
4079
4080 /* The GNU C library defines this for functions which it implements
4081     to always fail with ENOSYS.  Some functions are actually named
4082     something starting with __ and the normal name is an alias.  */
4083 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
4084 choke me
4085 #else
4086 gethostbyname();
4087 #endif
4088
4089 ; return 0; }
4090 EOF
4091 if { (eval echo configure:4092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4092   rm -rf conftest*
4093   eval "ac_cv_func_gethostbyname=yes"
4094 else
4095   echo "configure: failed program was:" >&5
4096   cat conftest.$ac_ext >&5
4097   rm -rf conftest*
4098   eval "ac_cv_func_gethostbyname=no"
4099 fi
4100 rm -f conftest*
4101 fi
4102
4103 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
4104   echo "$ac_t""yes" 1>&6
4105   :
4106 else
4107   echo "$ac_t""no" 1>&6
4108 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4109 echo "configure:4110: checking for main in -lnsl" >&5
4110 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
4111 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4112   echo $ac_n "(cached) $ac_c" 1>&6
4113 else
4114   ac_save_LIBS="$LIBS"
4115 LIBS="-lnsl  $LIBS"
4116 cat > conftest.$ac_ext <<EOF
4117 #line 4118 "configure"
4118 #include "confdefs.h"
4119
4120 int main() {
4121 main()
4122 ; return 0; }
4123 EOF
4124 if { (eval echo configure:4125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4125   rm -rf conftest*
4126   eval "ac_cv_lib_$ac_lib_var=yes"
4127 else
4128   echo "configure: failed program was:" >&5
4129   cat conftest.$ac_ext >&5
4130   rm -rf conftest*
4131   eval "ac_cv_lib_$ac_lib_var=no"
4132 fi
4133 rm -f conftest*
4134 LIBS="$ac_save_LIBS"
4135
4136 fi
4137 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4138   echo "$ac_t""yes" 1>&6
4139   tcl_cv_lib_sockets="$tcl_cv_lib_sockets -lnsl"
4140 else
4141   echo "$ac_t""no" 1>&6
4142 fi
4143
4144 fi
4145
4146   unset ac_cv_func_gethostbyname
4147   LIBS=$tcl_oldLIBS
4148
4149 fi
4150
4151 echo "$ac_t""$tcl_cv_lib_sockets" 1>&6
4152 test -z "$tcl_cv_lib_sockets" || LIBS="$LIBS $tcl_cv_lib_sockets"
4153
4154 #--------------------------------------------------------------------
4155 #       The statements below define a collection of symbols related to
4156 #       dynamic loading and shared libraries:
4157 #
4158 #       DL_OBJS -       Name of the object file that implements dynamic
4159 #                       loading for Tcl on this system.
4160 #       DL_LIBS -       Library file(s) to include in tclsh and other base
4161 #                       applications in order for the "load" command to work.
4162 #       LD_FLAGS -      Flags to pass to the compiler when linking object
4163 #                       files into an executable application binary such
4164 #                       as tclsh.
4165 #       LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
4166 #                       that tell the run-time dynamic linker where to look
4167 #                       for shared libraries such as libtcl.so.  Depends on
4168 #                       the variable LIB_RUNTIME_DIR in the Makefile.
4169 #       MAKE_LIB -      Command to execute to build the Tcl library;
4170 #                       differs depending on whether or not Tcl is being
4171 #                       compiled as a shared library.
4172 #       SHLIB_CFLAGS -  Flags to pass to cc when compiling the components
4173 #                       of a shared library (may request position-independent
4174 #                       code, among other things).
4175 #       SHLIB_LD -      Base command to use for combining object files
4176 #                       into a shared library.
4177 #       SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
4178 #                       creating shared libraries.  This symbol typically
4179 #                       goes at the end of the "ld" commands that build
4180 #                       shared libraries. The value of the symbol is
4181 #                       "${LIBS}" if all of the dependent libraries should
4182 #                       be specified when creating a shared library.  If
4183 #                       dependent libraries should not be specified (as on
4184 #                       SunOS 4.x, where they cause the link to fail, or in
4185 #                       general if Tcl and Tk aren't themselves shared
4186 #                       libraries), then this symbol has an empty string
4187 #                       as its value.
4188 #       SHLIB_SUFFIX -  Suffix to use for the names of dynamically loadable
4189 #                       extensions.  An empty string means we don't know how
4190 #                       to use shared libraries on this platform.
4191 #       TCL_LIB_FILE -  Name of the file that contains the Tcl library, such
4192 #                       as libtcl7.8.so or libtcl7.8.a.
4193 #       TCL_LIB_SUFFIX -Specifies everything that comes after the "libtcl"
4194 #                       in the shared library name, using the $VERSION variable
4195 #                       to put the version in the right place.  This is used
4196 #                       by platforms that need non-standard library names.
4197 #                       Examples:  ${VERSION}.so.1.1 on NetBSD, since it needs
4198 #                       to have a version after the .so, and ${VERSION}.a
4199 #                       on AIX, since the Tcl shared library needs to have
4200 #                       a .a extension whereas shared objects for loadable
4201 #                       extensions have a .so extension.  Defaults to
4202 #                       ${VERSION}${SHLIB_SUFFIX}.
4203 #--------------------------------------------------------------------
4204
4205 # Step 1: set the variable "system" to hold the name and version number
4206 # for the system.  This can usually be done via the "uname" command, but
4207 # there are a few systems, like Next, where this doesn't work.
4208
4209 echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6
4210 echo "configure:4211: checking system version (for dynamic loading)" >&5
4211 if test -f /usr/lib/NextStep/software_version; then
4212     system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
4213 else
4214     system=`uname -s`-`uname -r`
4215     if test "$?" -ne 0 ; then
4216         echo "$ac_t""unknown (can't find uname command)" 1>&6
4217         system=unknown
4218     else
4219         # Special check for weird MP-RAS system (uname returns weird
4220         # results, and the version is kept in special file).
4221     
4222         if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
4223             system=MP-RAS-`awk '{print $3}' /etc/.relid'`
4224         fi
4225         if test "`uname -s`" = "AIX" ; then
4226             system=AIX-`uname -v`.`uname -r`
4227         fi
4228         echo "$ac_t""$system" 1>&6
4229     fi
4230 fi
4231
4232 # Step 2: check for existence of -ldl library.  This is needed because
4233 # Linux can use either -ldl or -ldld for dynamic loading.
4234
4235 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4236 echo "configure:4237: checking for dlopen in -ldl" >&5
4237 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
4238 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4239   echo $ac_n "(cached) $ac_c" 1>&6
4240 else
4241   ac_save_LIBS="$LIBS"
4242 LIBS="-ldl  $LIBS"
4243 cat > conftest.$ac_ext <<EOF
4244 #line 4245 "configure"
4245 #include "confdefs.h"
4246 /* Override any gcc2 internal prototype to avoid an error.  */
4247 /* We use char because int might match the return type of a gcc2
4248     builtin and then its argument prototype would still apply.  */
4249 char dlopen();
4250
4251 int main() {
4252 dlopen()
4253 ; return 0; }
4254 EOF
4255 if { (eval echo configure:4256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4256   rm -rf conftest*
4257   eval "ac_cv_lib_$ac_lib_var=yes"
4258 else
4259   echo "configure: failed program was:" >&5
4260   cat conftest.$ac_ext >&5
4261   rm -rf conftest*
4262   eval "ac_cv_lib_$ac_lib_var=no"
4263 fi
4264 rm -f conftest*
4265 LIBS="$ac_save_LIBS"
4266
4267 fi
4268 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4269   echo "$ac_t""yes" 1>&6
4270   have_dl=yes
4271 else
4272   echo "$ac_t""no" 1>&6
4273 have_dl=no
4274 fi
4275
4276
4277 # Step 3: set configuration options based on system name and version.
4278
4279 fullSrcDir=`cd $srcdir; pwd`
4280 TCL_SHARED_LIB_SUFFIX=""
4281 TCL_UNSHARED_LIB_SUFFIX=""
4282 TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
4283 ECHO_VERSION='`echo ${VERSION}`'
4284 TCL_LIB_VERSIONS_OK=ok
4285 case $system in
4286     AIX-4.[2-9])
4287         SHLIB_CFLAGS=""
4288         SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
4289         SHLIB_LD_LIBS='${LIBS}'
4290         SHLIB_SUFFIX=".so"
4291         DL_OBJS="tclLoadDl.o"
4292         DL_LIBS="-ldl"
4293         LD_FLAGS=""
4294         LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
4295         AIX=yes
4296         TCL_SHARED_LIB_SUFFIX='${VERSION}.a'
4297         ;;
4298     AIX-*)
4299         SHLIB_CFLAGS=""
4300         SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
4301         SHLIB_LD_LIBS='${LIBS}'
4302         SHLIB_SUFFIX=".so"
4303         DL_OBJS="tclLoadDl.o tclLoadAix.o"
4304         DL_LIBS="-lld"
4305         LD_FLAGS=""
4306         LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
4307         TCL_SHARED_LIB_SUFFIX='${VERSION}.a'
4308         ;;
4309     BSD/OS-2.1*|BSD/OS-3*)
4310         SHLIB_CFLAGS=""
4311         SHLIB_LD="shlicc -r"
4312         SHLIB_LD_LIBS='${LIBS}'
4313         SHLIB_SUFFIX=".so"
4314         DL_OBJS="tclLoadDl.o"
4315         DL_LIBS="-ldl"
4316         LD_FLAGS=""
4317         LD_SEARCH_FLAGS=""
4318         ;;
4319     dgux*)
4320         SHLIB_CFLAGS="-K PIC"
4321         SHLIB_LD="cc -G"
4322         SHLIB_LD_LIBS=""
4323         SHLIB_SUFFIX=".so"
4324         DL_OBJS="tclLoadDl.o"
4325         DL_LIBS="-ldl"
4326         LD_FLAGS=""
4327         LD_SEARCH_FLAGS=""
4328         ;;
4329     HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
4330         # CYGNUS LOCAL: Handle gcc and versions of HP-UX that can't
4331         # do dynamic linking.
4332         echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
4333 echo "configure:4334: checking for shl_load in -ldld" >&5
4334 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
4335 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4336   echo $ac_n "(cached) $ac_c" 1>&6
4337 else
4338   ac_save_LIBS="$LIBS"
4339 LIBS="-ldld  $LIBS"
4340 cat > conftest.$ac_ext <<EOF
4341 #line 4342 "configure"
4342 #include "confdefs.h"
4343 /* Override any gcc2 internal prototype to avoid an error.  */
4344 /* We use char because int might match the return type of a gcc2
4345     builtin and then its argument prototype would still apply.  */
4346 char shl_load();
4347
4348 int main() {
4349 shl_load()
4350 ; return 0; }
4351 EOF
4352 if { (eval echo configure:4353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4353   rm -rf conftest*
4354   eval "ac_cv_lib_$ac_lib_var=yes"
4355 else
4356   echo "configure: failed program was:" >&5
4357   cat conftest.$ac_ext >&5
4358   rm -rf conftest*
4359   eval "ac_cv_lib_$ac_lib_var=no"
4360 fi
4361 rm -f conftest*
4362 LIBS="$ac_save_LIBS"
4363
4364 fi
4365 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4366   echo "$ac_t""yes" 1>&6
4367   tcl_ok=yes
4368 else
4369   echo "$ac_t""no" 1>&6
4370 tcl_ok=no
4371 fi
4372
4373         if test "$tcl_ok" = "yes"; then
4374            if test "$GCC" = yes; then
4375               SHLIB_CFLAGS="-fPIC"
4376               SHLIB_LD="$CC -shared -fPIC"
4377            else
4378               SHLIB_CFLAGS="+z"
4379               SHLIB_LD="ld -b"
4380            fi
4381
4382            SHLIB_LD_LIBS=""
4383            SHLIB_SUFFIX=".sl"
4384            DL_OBJS="tclLoadShl.o"
4385            DL_LIBS="-ldld"
4386
4387            # The GNU linker requires the -export-dynamic
4388            # option to make all symbols visible in the dynamic symbol
4389            # table.  Note that the HP linker will give errors
4390            # -export-dynamic, but will still exit successfully.
4391            # Adding a -L option will make it fail.
4392            hold_ldflags=$LDFLAGS
4393            echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
4394 echo "configure:4395: checking for the ld -export-dynamic flag" >&5
4395            LDFLAGS="${LDFLAGS} -Wl,-export-dynamic -L`pwd`"
4396            cat > conftest.$ac_ext <<EOF
4397 #line 4398 "configure"
4398 #include "confdefs.h"
4399
4400 int main() {
4401 int i;
4402 ; return 0; }
4403 EOF
4404 if { (eval echo configure:4405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4405   rm -rf conftest*
4406   found=yes
4407 else
4408   echo "configure: failed program was:" >&5
4409   cat conftest.$ac_ext >&5
4410   rm -rf conftest*
4411   found=no
4412 fi
4413 rm -f conftest*
4414            LDFLAGS=$hold_ldflags
4415            echo "$ac_t""$found" 1>&6
4416            if test $found = yes; then
4417               LD_FLAGS="-Wl,-export-dynamic"
4418               LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
4419            else
4420               LD_FLAGS="-Wl,-E"
4421               LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
4422            fi
4423         fi
4424         # END CYGNUS LOCAL
4425         ;;
4426     IRIX-4.*)
4427         SHLIB_CFLAGS="-G 0"
4428         SHLIB_SUFFIX=".a"
4429         SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
4430         SHLIB_LD_LIBS='${LIBS}'
4431         DL_OBJS="tclLoadAout.o"
4432         DL_LIBS=""
4433         LD_FLAGS="-Wl,-D,08000000"
4434         LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
4435         TCL_SHARED_LIB_SUFFIX='${VERSION}.a'
4436         ;;
4437     IRIX-5.*|IRIX-6.*)
4438         SHLIB_CFLAGS=""
4439         SHLIB_LD="ld -n32 -shared -rdata_shared"
4440         SHLIB_LD_LIBS=""
4441         SHLIB_SUFFIX=".so"
4442         DL_OBJS="tclLoadDl.o"
4443         DL_LIBS=""
4444         LD_FLAGS=""
4445         LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
4446         ;;
4447     IRIX64-6.*)
4448         SHLIB_CFLAGS=""
4449         SHLIB_LD="ld -n32 -shared -rdata_shared -rpath /usr/local/lib"
4450         SHLIB_LD_LIBS=""
4451         SHLIB_SUFFIX=".so"
4452         DL_OBJS="tclLoadDl.o"
4453         DL_LIBS=""
4454         LD_FLAGS=""
4455         LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
4456         ;;
4457     Linux*)
4458         SHLIB_CFLAGS="-fPIC"
4459         SHLIB_LD_LIBS=""
4460         SHLIB_SUFFIX=".so"
4461         if test "$have_dl" = yes; then
4462             SHLIB_LD="${CC} -shared"
4463             DL_OBJS="tclLoadDl.o"
4464             DL_LIBS="-ldl"
4465             LD_FLAGS="-rdynamic"
4466             LD_SEARCH_FLAGS=""
4467         else
4468             ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'`
4469 echo $ac_n "checking for dld.h""... $ac_c" 1>&6
4470 echo "configure:4471: checking for dld.h" >&5
4471 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4472   echo $ac_n "(cached) $ac_c" 1>&6
4473 else
4474   cat > conftest.$ac_ext <<EOF
4475 #line 4476 "configure"
4476 #include "confdefs.h"
4477 #include <dld.h>
4478 EOF
4479 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4480 { (eval echo configure:4481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4481 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4482 if test -z "$ac_err"; then
4483   rm -rf conftest*
4484   eval "ac_cv_header_$ac_safe=yes"
4485 else
4486   echo "$ac_err" >&5
4487   echo "configure: failed program was:" >&5
4488   cat conftest.$ac_ext >&5
4489   rm -rf conftest*
4490   eval "ac_cv_header_$ac_safe=no"
4491 fi
4492 rm -f conftest*
4493 fi
4494 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4495   echo "$ac_t""yes" 1>&6
4496   
4497                 SHLIB_LD="ld -shared"
4498                 DL_OBJS="tclLoadDld.o"
4499                 DL_LIBS="-ldld"
4500                 LD_FLAGS=""
4501                 LD_SEARCH_FLAGS=""
4502 else
4503   echo "$ac_t""no" 1>&6
4504 fi
4505
4506         fi
4507         ;;
4508     MP-RAS-02*)
4509         SHLIB_CFLAGS="-K PIC"
4510         SHLIB_LD="cc -G"
4511         SHLIB_LD_LIBS=""
4512         SHLIB_SUFFIX=".so"
4513         DL_OBJS="tclLoadDl.o"
4514         DL_LIBS="-ldl"
4515         LD_FLAGS=""
4516         LD_SEARCH_FLAGS=""
4517         ;;
4518     MP-RAS-*)
4519         SHLIB_CFLAGS="-K PIC"
4520         SHLIB_LD="cc -G"
4521         SHLIB_LD_LIBS=""
4522         SHLIB_SUFFIX=".so"
4523         DL_OBJS="tclLoadDl.o"
4524         DL_LIBS="-ldl"
4525         LD_FLAGS="-Wl,-Bexport"
4526         LD_SEARCH_FLAGS=""
4527         ;;
4528     NetBSD-*|FreeBSD-*|OpenBSD-*)
4529         # Not available on all versions:  check for include file.
4530         ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
4531 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
4532 echo "configure:4533: checking for dlfcn.h" >&5
4533 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4534   echo $ac_n "(cached) $ac_c" 1>&6
4535 else
4536   cat > conftest.$ac_ext <<EOF
4537 #line 4538 "configure"
4538 #include "confdefs.h"
4539 #include <dlfcn.h>
4540 EOF
4541 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4542 { (eval echo configure:4543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4543 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4544 if test -z "$ac_err"; then
4545   rm -rf conftest*
4546   eval "ac_cv_header_$ac_safe=yes"
4547 else
4548   echo "$ac_err" >&5
4549   echo "configure: failed program was:" >&5
4550   cat conftest.$ac_ext >&5
4551   rm -rf conftest*
4552   eval "ac_cv_header_$ac_safe=no"
4553 fi
4554 rm -f conftest*
4555 fi
4556 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4557   echo "$ac_t""yes" 1>&6
4558   
4559             SHLIB_CFLAGS="-fpic"
4560             SHLIB_LD="ld -Bshareable -x"
4561             SHLIB_LD_LIBS=""
4562             SHLIB_SUFFIX=".so"
4563             DL_OBJS="tclLoadDl.o"
4564             DL_LIBS=""
4565             LD_FLAGS=""
4566             LD_SEARCH_FLAGS=""
4567             TCL_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.so.1.0'
4568         
4569 else
4570   echo "$ac_t""no" 1>&6
4571
4572             SHLIB_CFLAGS=""
4573             SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
4574             SHLIB_LD_LIBS='${LIBS}'
4575             SHLIB_SUFFIX=".a"
4576             DL_OBJS="tclLoadAout.o"
4577             DL_LIBS=""
4578             LD_FLAGS=""
4579             LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
4580             TCL_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.a'
4581         
4582 fi
4583
4584
4585         # FreeBSD doesn't handle version numbers with dots.
4586
4587         TCL_UNSHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.a'
4588         TCL_LIB_VERSIONS_OK=nodots
4589         ;;
4590     NEXTSTEP-*)
4591         SHLIB_CFLAGS=""
4592         SHLIB_LD="cc -nostdlib -r"
4593         SHLIB_LD_LIBS=""
4594         SHLIB_SUFFIX=".so"
4595         DL_OBJS="tclLoadNext.o"
4596         DL_LIBS=""
4597         LD_FLAGS=""
4598         LD_SEARCH_FLAGS=""
4599         ;;
4600     OSF1-1.0|OSF1-1.1|OSF1-1.2)
4601         # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
4602         SHLIB_CFLAGS=""
4603         # Hack: make package name same as library name
4604         SHLIB_LD='ld -R -export $@:'
4605         SHLIB_LD_LIBS=""
4606         SHLIB_SUFFIX=".so"
4607         DL_OBJS="tclLoadOSF.o"
4608         DL_LIBS=""
4609         LD_FLAGS=""
4610         LD_SEARCH_FLAGS=""
4611         ;;
4612     OSF1-1.*)
4613         # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
4614         SHLIB_CFLAGS="-fpic"
4615         SHLIB_LD="ld -shared"
4616         SHLIB_LD_LIBS=""
4617         SHLIB_SUFFIX=".so"
4618         DL_OBJS="tclLoadDl.o"
4619         DL_LIBS=""
4620         LD_FLAGS=""
4621         LD_SEARCH_FLAGS=""
4622         ;;
4623     OSF1-V*)
4624         # Digital OSF/1
4625         SHLIB_CFLAGS=""
4626         SHLIB_LD='ld -shared -expect_unresolved "*"'
4627         SHLIB_LD_LIBS=""
4628         SHLIB_SUFFIX=".so"
4629         DL_OBJS="tclLoadDl.o"
4630         DL_LIBS=""
4631         LD_FLAGS=""
4632         LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
4633         ;;
4634     RISCos-*)
4635         SHLIB_CFLAGS="-G 0"
4636         SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
4637         SHLIB_LD_LIBS='${LIBS}'
4638         SHLIB_SUFFIX=".a"
4639         DL_OBJS="tclLoadAout.o"
4640         DL_LIBS=""
4641         LD_FLAGS="-Wl,-D,08000000"
4642         LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
4643         ;;
4644     SCO_SV-3.2*)
4645         # Note, dlopen is available only on SCO 3.2.5 and greater.  However,
4646         # this test works, since "uname -s" was non-standard in 3.2.4 and
4647         # below.
4648         SHLIB_CFLAGS="-Kpic -belf"
4649         SHLIB_LD="ld -G"
4650         SHLIB_LD_LIBS=""
4651         SHLIB_SUFFIX=".so"
4652         DL_OBJS="tclLoadDl.o"
4653         DL_LIBS=""
4654         LD_FLAGS="-belf -Wl,-Bexport"
4655         LD_SEARCH_FLAGS=""
4656         ;;
4657      SINIX*5.4*)
4658         SHLIB_CFLAGS="-K PIC"
4659         SHLIB_LD="cc -G"
4660         SHLIB_LD_LIBS=""
4661         SHLIB_SUFFIX=".so"
4662         DL_OBJS="tclLoadDl.o"
4663         DL_LIBS="-ldl"
4664         LD_FLAGS=""
4665         LD_SEARCH_FLAGS=""
4666         ;;
4667     SunOS-4*)
4668         # CYGNUS LOCAL: gcc uses a different option than native cc.
4669         if test "$GCC" = yes; then
4670            SHLIB_CFLAGS="-fPIC"
4671            SHLIB_LD="$CC -shared -fPIC"
4672         else
4673            SHLIB_CFLAGS="-PIC"
4674            SHLIB_LD="ld"
4675         fi
4676         # END CYGNUS LOCAL
4677
4678         SHLIB_LD_LIBS=""
4679         SHLIB_SUFFIX=".so"
4680         DL_OBJS="tclLoadDl.o"
4681         DL_LIBS="-ldl"
4682         LD_FLAGS=""
4683         LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
4684
4685         # SunOS can't handle version numbers with dots in them in library
4686         # specs, like -ltcl7.5, so use -ltcl75 instead.  Also, it
4687         # requires an extra version number at the end of .so file names.
4688         # So, the library has to have a name like libtcl75.so.1.0
4689
4690         TCL_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.so.1.0'
4691         TCL_UNSHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.a'
4692         TCL_LIB_VERSIONS_OK=nodots
4693         ;;
4694     SunOS-5*)
4695         # CYGNUS LOCAL: gcc uses a different option than native cc.
4696         if test "$GCC" = yes; then
4697            SHLIB_CFLAGS="-fPIC"
4698            SHLIB_LD="$CC -shared -fPIC"
4699         else
4700            SHLIB_CFLAGS="-KPIC"
4701            SHLIB_LD="/usr/ccs/bin/ld -G -z text"
4702         fi
4703         # END CYGNUS LOCAL
4704
4705         # Note: need the LIBS below, otherwise Tk won't find Tcl's
4706         # symbols when dynamically loaded into tclsh.
4707
4708         SHLIB_LD_LIBS='${LIBS}'
4709         SHLIB_SUFFIX=".so"
4710         DL_OBJS="tclLoadDl.o"
4711         DL_LIBS="-ldl"
4712         # CYGNUS LOCAL: The GNU linker requires the -export-dynamic
4713         # option to make all symbols visible in the dynamic symbol
4714         # table.
4715         hold_ldflags=$LDFLAGS
4716         echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
4717 echo "configure:4718: checking for the ld -export-dynamic flag" >&5
4718         LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
4719         cat > conftest.$ac_ext <<EOF
4720 #line 4721 "configure"
4721 #include "confdefs.h"
4722
4723 int main() {
4724 int i;
4725 ; return 0; }
4726 EOF
4727 if { (eval echo configure:4728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4728   rm -rf conftest*
4729   found=yes
4730 else
4731   echo "configure: failed program was:" >&5
4732   cat conftest.$ac_ext >&5
4733   rm -rf conftest*
4734   found=no
4735 fi
4736 rm -f conftest*
4737         LDFLAGS=$hold_ldflags
4738         echo "$ac_t""$found" 1>&6
4739         if test $found = yes; then
4740            LD_FLAGS="-Wl,-export-dynamic"
4741            LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
4742         else
4743            LD_FLAGS=""
4744            LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
4745         fi
4746         # END CYGNUS LOCAL
4747         ;;
4748     ULTRIX-4.*)
4749         SHLIB_CFLAGS="-G 0"
4750         SHLIB_SUFFIX=".a"
4751         SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
4752         SHLIB_LD_LIBS='${LIBS}'
4753         DL_OBJS="tclLoadAout.o"
4754         DL_LIBS=""
4755         # CYGNUS LOCAL: The GNU linker doesn't accept `-D 08000000'.  It
4756         # doesn't appear to be needed, either.
4757         hold_ldflags="$LDFLAGS"
4758         echo $ac_n "checking whether ld accepts -D 08000000""... $ac_c" 1>&6
4759 echo "configure:4760: checking whether ld accepts -D 08000000" >&5
4760         LD_FLAGS="-Wl,-D,08000000"
4761         LDFLAGS="${LDFLAGS} -Wl,-D,08000000"
4762         cat > conftest.$ac_ext <<EOF
4763 #line 4764 "configure"
4764 #include "confdefs.h"
4765
4766 int main() {
4767 int i;
4768 ; return 0; }
4769 EOF
4770 if { (eval echo configure:4771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4771   rm -rf conftest*
4772   found=yes
4773 else
4774   echo "configure: failed program was:" >&5
4775   cat conftest.$ac_ext >&5
4776   rm -rf conftest*
4777   found=no
4778 fi
4779 rm -f conftest*
4780         LDFLAGS=$hold_ldflags
4781         echo "$ac_t""$found" 1>&6
4782         if test $found = yes; then
4783            LD_FLAGS="-Wl,-D,08000000"
4784         else
4785            LD_FLAGS=""
4786         fi
4787         # END CYGNUS LOCAL
4788         LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
4789         ;;
4790     UNIX_SV* | UnixWare-5*)
4791         SHLIB_CFLAGS="-KPIC"
4792         SHLIB_LD="cc -G"
4793         SHLIB_LD_LIBS=""
4794         SHLIB_SUFFIX=".so"
4795         DL_OBJS="tclLoadDl.o"
4796         DL_LIBS="-ldl"
4797         # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
4798         # that don't grok the -Bexport option.  Test that it does.
4799         hold_ldflags=$LDFLAGS
4800         echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6
4801 echo "configure:4802: checking for ld accepts -Bexport flag" >&5
4802         LDFLAGS="${LDFLAGS} -Wl,-Bexport"
4803         cat > conftest.$ac_ext <<EOF
4804 #line 4805 "configure"
4805 #include "confdefs.h"
4806
4807 int main() {
4808 int i;
4809 ; return 0; }
4810 EOF
4811 if { (eval echo configure:4812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4812   rm -rf conftest*
4813   found=yes
4814 else
4815   echo "configure: failed program was:" >&5
4816   cat conftest.$ac_ext >&5
4817   rm -rf conftest*
4818   found=no
4819 fi
4820 rm -f conftest*
4821         LDFLAGS=$hold_ldflags
4822         echo "$ac_t""$found" 1>&6
4823         if test $found = yes; then
4824           LD_FLAGS="-Wl,-Bexport"
4825         else
4826           LD_FLAGS=""
4827         fi
4828         LD_SEARCH_FLAGS=""
4829         ;;
4830 esac
4831
4832 # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic
4833 # Loading for Tcl -- What Became of It?".  Proc. 2nd Tcl/Tk Workshop,
4834 # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need
4835 # to determine which of several header files defines the a.out file
4836 # format (a.out.h, sys/exec.h, or sys/exec_aout.h).  At present, we
4837 # support only a file format that is more or less version-7-compatible. 
4838 # In particular,
4839 #       - a.out files must begin with `struct exec'.
4840 #       - the N_TXTOFF on the `struct exec' must compute the seek address
4841 #         of the text segment
4842 #       - The `struct exec' must contain a_magic, a_text, a_data, a_bss
4843 #         and a_entry fields.
4844 # The following compilation should succeed if and only if either sys/exec.h
4845 # or a.out.h is usable for the purpose.
4846 #
4847 # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the
4848 # `struct exec' includes a second header that contains information that
4849 # duplicates the v7 fields that are needed.
4850
4851 if test "x$DL_OBJS" = "xtclLoadAout.o" ; then
4852     echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6
4853 echo "configure:4854: checking sys/exec.h" >&5
4854     cat > conftest.$ac_ext <<EOF
4855 #line 4856 "configure"
4856 #include "confdefs.h"
4857 #include <sys/exec.h>
4858 int main() {
4859
4860         struct exec foo;
4861         unsigned long seek;
4862         int flag;
4863 #if defined(__mips) || defined(mips)
4864         seek = N_TXTOFF (foo.ex_f, foo.ex_o);
4865 #else
4866         seek = N_TXTOFF (foo);
4867 #endif
4868         flag = (foo.a_magic == OMAGIC);
4869         return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
4870
4871 ; return 0; }
4872 EOF
4873 if { (eval echo configure:4874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4874   rm -rf conftest*
4875   tcl_ok=usable
4876 else
4877   echo "configure: failed program was:" >&5
4878   cat conftest.$ac_ext >&5
4879   rm -rf conftest*
4880   tcl_ok=unusable
4881 fi
4882 rm -f conftest*
4883     echo "$ac_t""$tcl_ok" 1>&6
4884     if test $tcl_ok = usable; then
4885         cat >> confdefs.h <<\EOF
4886 #define USE_SYS_EXEC_H 1
4887 EOF
4888
4889     else
4890         echo $ac_n "checking a.out.h""... $ac_c" 1>&6
4891 echo "configure:4892: checking a.out.h" >&5
4892         cat > conftest.$ac_ext <<EOF
4893 #line 4894 "configure"
4894 #include "confdefs.h"
4895 #include <a.out.h>
4896 int main() {
4897
4898             struct exec foo;
4899             unsigned long seek;
4900             int flag;
4901 #if defined(__mips) || defined(mips)
4902             seek = N_TXTOFF (foo.ex_f, foo.ex_o);
4903 #else
4904             seek = N_TXTOFF (foo);
4905 #endif
4906             flag = (foo.a_magic == OMAGIC);
4907             return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
4908         
4909 ; return 0; }
4910 EOF
4911 if { (eval echo configure:4912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4912   rm -rf conftest*
4913   tcl_ok=usable
4914 else
4915   echo "configure: failed program was:" >&5
4916   cat conftest.$ac_ext >&5
4917   rm -rf conftest*
4918   tcl_ok=unusable
4919 fi
4920 rm -f conftest*
4921         echo "$ac_t""$tcl_ok" 1>&6
4922         if test $tcl_ok = usable; then
4923             cat >> confdefs.h <<\EOF
4924 #define USE_A_OUT_H 1
4925 EOF
4926
4927         else
4928             echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6
4929 echo "configure:4930: checking sys/exec_aout.h" >&5
4930             cat > conftest.$ac_ext <<EOF
4931 #line 4932 "configure"
4932 #include "confdefs.h"
4933 #include <sys/exec_aout.h>
4934 int main() {
4935
4936                 struct exec foo;
4937                 unsigned long seek;
4938                 int flag;
4939 #if defined(__mips) || defined(mips)
4940                 seek = N_TXTOFF (foo.ex_f, foo.ex_o);
4941 #else
4942                 seek = N_TXTOFF (foo);
4943 #endif
4944                 flag = (foo.a_midmag == OMAGIC);
4945                 return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
4946             
4947 ; return 0; }
4948 EOF
4949 if { (eval echo configure:4950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4950   rm -rf conftest*
4951   tcl_ok=usable
4952 else
4953   echo "configure: failed program was:" >&5
4954   cat conftest.$ac_ext >&5
4955   rm -rf conftest*
4956   tcl_ok=unusable
4957 fi
4958 rm -f conftest*
4959             echo "$ac_t""$tcl_ok" 1>&6
4960             if test $tcl_ok = usable; then
4961                 cat >> confdefs.h <<\EOF
4962 #define USE_SYS_EXEC_AOUT_H 1
4963 EOF
4964
4965             else
4966                 DL_OBJS=""
4967             fi
4968         fi
4969     fi
4970 fi
4971
4972 # Step 5: disable dynamic loading if requested via a command-line switch.
4973
4974 # Check whether --enable-load or --disable-load was given.
4975 if test "${enable_load+set}" = set; then
4976   enableval="$enable_load"
4977   tcl_ok=$enableval
4978 else
4979   tcl_ok=yes
4980 fi
4981
4982 if test "$tcl_ok" = "no"; then
4983     DL_OBJS=""
4984 fi
4985
4986 if test "x$DL_OBJS" != "x" ; then
4987     BUILD_DLTEST="\$(DLTEST_TARGETS)"
4988 else
4989     echo "Can't figure out how to do dynamic loading or shared libraries"
4990     echo "on this system."
4991     SHLIB_CFLAGS=""
4992     SHLIB_LD=""
4993     SHLIB_SUFFIX=""
4994     DL_OBJS="tclLoadNone.o"
4995     DL_LIBS=""
4996     LD_FLAGS=""
4997     LD_SEARCH_FLAGS=""
4998     BUILD_DLTEST=""
4999 fi
5000
5001 # If we're running gcc, then change the C flags for compiling shared
5002 # libraries to the right flags for gcc, instead of those for the
5003 # standard manufacturer compiler.
5004
5005 if test "$DL_OBJS" != "tclLoadNone.o" ; then
5006     if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
5007         case $system in
5008             AIX-*)
5009                 ;;
5010             BSD/OS*)
5011                 ;;
5012             IRIX*)
5013                 ;;
5014             NetBSD-*|FreeBSD-*|OpenBSD-*)
5015                 ;;
5016             RISCos-*)
5017                 ;;
5018             ULTRIX-4.*)
5019                 ;;
5020             *)
5021                 SHLIB_CFLAGS="-fPIC"
5022                 ;;
5023         esac
5024     fi
5025 fi
5026
5027 #--------------------------------------------------------------------
5028 #       The statements below check for systems where POSIX-style
5029 #       non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. 
5030 #       On these systems (mostly older ones), use the old BSD-style
5031 #       FIONBIO approach instead.
5032 #--------------------------------------------------------------------
5033
5034 for ac_hdr in sys/ioctl.h
5035 do
5036 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5037 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5038 echo "configure:5039: checking for $ac_hdr" >&5
5039 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5040   echo $ac_n "(cached) $ac_c" 1>&6
5041 else
5042   cat > conftest.$ac_ext <<EOF
5043 #line 5044 "configure"
5044 #include "confdefs.h"
5045 #include <$ac_hdr>
5046 EOF
5047 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5048 { (eval echo configure:5049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5049 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5050 if test -z "$ac_err"; then
5051   rm -rf conftest*
5052   eval "ac_cv_header_$ac_safe=yes"
5053 else
5054   echo "$ac_err" >&5
5055   echo "configure: failed program was:" >&5
5056   cat conftest.$ac_ext >&5
5057   rm -rf conftest*
5058   eval "ac_cv_header_$ac_safe=no"
5059 fi
5060 rm -f conftest*
5061 fi
5062 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5063   echo "$ac_t""yes" 1>&6
5064     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5065   cat >> confdefs.h <<EOF
5066 #define $ac_tr_hdr 1
5067 EOF
5068  
5069 else
5070   echo "$ac_t""no" 1>&6
5071 fi
5072 done
5073
5074 for ac_hdr in sys/filio.h
5075 do
5076 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5077 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5078 echo "configure:5079: checking for $ac_hdr" >&5
5079 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5080   echo $ac_n "(cached) $ac_c" 1>&6
5081 else
5082   cat > conftest.$ac_ext <<EOF
5083 #line 5084 "configure"
5084 #include "confdefs.h"
5085 #include <$ac_hdr>
5086 EOF
5087 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5088 { (eval echo configure:5089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5089 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5090 if test -z "$ac_err"; then
5091   rm -rf conftest*
5092   eval "ac_cv_header_$ac_safe=yes"
5093 else
5094   echo "$ac_err" >&5
5095   echo "configure: failed program was:" >&5
5096   cat conftest.$ac_ext >&5
5097   rm -rf conftest*
5098   eval "ac_cv_header_$ac_safe=no"
5099 fi
5100 rm -f conftest*
5101 fi
5102 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5103   echo "$ac_t""yes" 1>&6
5104     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5105   cat >> confdefs.h <<EOF
5106 #define $ac_tr_hdr 1
5107 EOF
5108  
5109 else
5110   echo "$ac_t""no" 1>&6
5111 fi
5112 done
5113
5114 echo $ac_n "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O""... $ac_c" 1>&6
5115 echo "configure:5116: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5
5116 if test -f /usr/lib/NextStep/software_version; then
5117     system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
5118 else
5119     system=`uname -s`-`uname -r`
5120     if test "$?" -ne 0 ; then
5121         system=unknown
5122     else
5123         # Special check for weird MP-RAS system (uname returns weird
5124         # results, and the version is kept in special file).
5125     
5126         if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
5127             system=MP-RAS-`awk '{print $3}' /etc/.relid'`
5128         fi
5129         if test "`uname -s`" = "AIX" ; then
5130             system=AIX-`uname -v`.`uname -r`
5131         fi
5132     fi
5133 fi
5134 case $system in
5135     # There used to be code here to use FIONBIO under AIX.  However, it
5136     # was reported that FIONBIO doesn't work under AIX 3.2.5.  Since
5137     # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
5138     # code (JO, 5/31/97).
5139
5140     OSF*)
5141         cat >> confdefs.h <<\EOF
5142 #define USE_FIONBIO 1
5143 EOF
5144
5145         echo "$ac_t""FIONBIO" 1>&6
5146         ;;
5147     SunOS-4*)
5148         cat >> confdefs.h <<\EOF
5149 #define USE_FIONBIO 1
5150 EOF
5151
5152         echo "$ac_t""FIONBIO" 1>&6
5153         ;;
5154     ULTRIX-4.*)
5155         cat >> confdefs.h <<\EOF
5156 #define USE_FIONBIO 1
5157 EOF
5158
5159         echo "$ac_t""FIONBIO" 1>&6
5160         ;;
5161     *)
5162         echo "$ac_t""O_NONBLOCK" 1>&6
5163         ;;
5164 esac
5165
5166 #--------------------------------------------------------------------
5167 #       The statements below define a collection of symbols related to
5168 #       building libtcl as a shared library instead of a static library.
5169 #--------------------------------------------------------------------
5170
5171 realRanlib=$RANLIB
5172 if test "$TCL_SHARED_LIB_SUFFIX" = "" ; then
5173     TCL_SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}'
5174 fi
5175 if test "$TCL_UNSHARED_LIB_SUFFIX" = "" ; then
5176     TCL_UNSHARED_LIB_SUFFIX='${VERSION}.a'
5177 fi
5178 # Check whether --enable-shared or --disable-shared was given.
5179 if test "${enable_shared+set}" = set; then
5180   enableval="$enable_shared"
5181   tcl_ok=$enableval
5182 else
5183   tcl_ok=no
5184 fi
5185
5186 # CYGNUS LOCAL: need extra variables for this information.
5187 TCL_SHARED_LIB_FILE=dummy1
5188 TCL_UNSHARED_LIB_FILE=dummy2
5189 # END CYGNUS LOCAL
5190 if test "$tcl_ok" = "yes" -a "${SHLIB_SUFFIX}" != "" ; then
5191     TCL_SHARED_BUILD=1
5192     TCL_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
5193     TCL_LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS}"
5194     eval "TCL_LIB_FILE=libtcl${TCL_SHARED_LIB_SUFFIX}"
5195     TCL_SHARED_LIB_FILE="$TCL_LIB_FILE"
5196     if test "x$DL_OBJS" = "xtclLoadAout.o"; then
5197         MAKE_LIB="ar cr \${TCL_LIB_FILE} \${OBJS}"
5198     else
5199         MAKE_LIB="\${SHLIB_LD} -o \${TCL_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}"
5200         RANLIB=":"
5201     fi
5202 else
5203     TCL_SHARED_BUILD=0
5204     case $system in
5205         BSD/OS*)
5206             ;;
5207
5208         AIX-*)
5209             ;;
5210
5211         *)
5212             SHLIB_LD_LIBS=""
5213             ;;
5214     esac
5215     TCL_SHLIB_CFLAGS=""
5216     TCL_LD_SEARCH_FLAGS=""
5217     eval "TCL_LIB_FILE=libtcl${TCL_UNSHARED_LIB_SUFFIX}"
5218     TCL_UNSHARED_LIB_FILE="$TCL_LIB_FILE"
5219     MAKE_LIB="$AR cr ${TCL_LIB_FILE} \${OBJS}"
5220 fi
5221
5222 # Note:  in the following variable, it's important to use the absolute
5223 # path name of the Tcl directory rather than "..":  this is because
5224 # AIX remembers this path and will attempt to use it at run-time to look
5225 # up the Tcl library.
5226
5227 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
5228     TCL_BUILD_LIB_SPEC="-L`pwd` -ltcl${VERSION}"
5229     TCL_LIB_SPEC="-L${exec_prefix}/lib -ltcl${VERSION}"
5230 else
5231     TCL_BUILD_LIB_SPEC="-L`pwd` -ltcl`echo ${VERSION} | tr -d .`"
5232     TCL_LIB_SPEC="-L${exec_prefix}/lib -ltcl`echo ${VERSION} | tr -d .`"
5233 fi
5234
5235 TCL_LIB_FULL_PATH="`pwd`/${TCL_LIB_FILE}"
5236
5237 #--------------------------------------------------------------------
5238 #       The statements below define the symbol TCL_PACKAGE_PATH, which
5239 #       gives a list of directories that may contain packages.  The list
5240 #       consists of one directory for machine-dependent binaries and
5241 #       another for platform-independent scripts.
5242 #--------------------------------------------------------------------
5243
5244 if test "$prefix" != "$exec_prefix"; then
5245     TCL_PACKAGE_PATH="${exec_prefix}/lib ${prefix}/lib"
5246 else
5247     TCL_PACKAGE_PATH="${prefix}/lib"
5248 fi
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277 # CYGNUS LOCAL
5278
5279
5280 # END CYGNUS LOCAL
5281
5282 trap '' 1 2 15
5283 cat > confcache <<\EOF
5284 # This file is a shell script that caches the results of configure
5285 # tests run on this system so they can be shared between configure
5286 # scripts and configure runs.  It is not useful on other systems.
5287 # If it contains results you don't want to keep, you may remove or edit it.
5288 #
5289 # By default, configure uses ./config.cache as the cache file,
5290 # creating it if it does not exist already.  You can give configure
5291 # the --cache-file=FILE option to use a different cache file; that is
5292 # what configure does when it calls configure scripts in
5293 # subdirectories, so they share the cache.
5294 # Giving --cache-file=/dev/null disables caching, for debugging configure.
5295 # config.status only pays attention to the cache file if you give it the
5296 # --recheck option to rerun configure.
5297 #
5298 EOF
5299 # The following way of writing the cache mishandles newlines in values,
5300 # but we know of no workaround that is simple, portable, and efficient.
5301 # So, don't put newlines in cache variables' values.
5302 # Ultrix sh set writes to stderr and can't be redirected directly,
5303 # and sets the high bit in the cache file unless we assign to the vars.
5304 (set) 2>&1 |
5305   case `(ac_space=' '; set | grep ac_space) 2>&1` in
5306   *ac_space=\ *)
5307     # `set' does not quote correctly, so add quotes (double-quote substitution
5308     # turns \\\\ into \\, and sed turns \\ into \).
5309     sed -n \
5310       -e "s/'/'\\\\''/g" \
5311       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
5312     ;;
5313   *)
5314     # `set' quotes correctly as required by POSIX, so do not add quotes.
5315     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
5316     ;;
5317   esac >> confcache
5318 if cmp -s $cache_file confcache; then
5319   :
5320 else
5321   if test -w $cache_file; then
5322     echo "updating cache $cache_file"
5323     cat confcache > $cache_file
5324   else
5325     echo "not updating unwritable cache $cache_file"
5326   fi
5327 fi
5328 rm -f confcache
5329
5330 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
5331
5332 test "x$prefix" = xNONE && prefix=$ac_default_prefix
5333 # Let make expand exec_prefix.
5334 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
5335
5336 # Any assignment to VPATH causes Sun make to only execute
5337 # the first set of double-colon rules, so remove it if not needed.
5338 # If there is a colon in the path, we need to keep it.
5339 if test "x$srcdir" = x.; then
5340   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
5341 fi
5342
5343 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
5344
5345 # Transform confdefs.h into DEFS.
5346 # Protect against shell expansion while executing Makefile rules.
5347 # Protect against Makefile macro expansion.
5348 cat > conftest.defs <<\EOF
5349 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
5350 s%[     `~#$^&*(){}\\|;'"<>?]%\\&%g
5351 s%\[%\\&%g
5352 s%\]%\\&%g
5353 s%\$%$$%g
5354 EOF
5355 DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
5356 rm -f conftest.defs
5357
5358
5359 # Without the "./", some shells look in PATH for config.status.
5360 : ${CONFIG_STATUS=./config.status}
5361
5362 echo creating $CONFIG_STATUS
5363 rm -f $CONFIG_STATUS
5364 cat > $CONFIG_STATUS <<EOF
5365 #! /bin/sh
5366 # Generated automatically by configure.
5367 # Run this file to recreate the current configuration.
5368 # This directory was configured as follows,
5369 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
5370 #
5371 # $0 $ac_configure_args
5372 #
5373 # Compiler output produced by configure, useful for debugging
5374 # configure, is in ./config.log if it exists.
5375
5376 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
5377 for ac_option
5378 do
5379   case "\$ac_option" in
5380   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
5381     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
5382     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
5383   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
5384     echo "$CONFIG_STATUS generated by autoconf version 2.13"
5385     exit 0 ;;
5386   -help | --help | --hel | --he | --h)
5387     echo "\$ac_cs_usage"; exit 0 ;;
5388   *) echo "\$ac_cs_usage"; exit 1 ;;
5389   esac
5390 done
5391
5392 ac_given_srcdir=$srcdir
5393 ac_given_INSTALL="$INSTALL"
5394
5395 trap 'rm -fr `echo "Makefile tclConfig.sh" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
5396 EOF
5397 cat >> $CONFIG_STATUS <<EOF
5398
5399 # Protect against being on the right side of a sed subst in config.status.
5400 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
5401  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
5402 $ac_vpsub
5403 $extrasub
5404 s%@SHELL@%$SHELL%g
5405 s%@CFLAGS@%$CFLAGS%g
5406 s%@CPPFLAGS@%$CPPFLAGS%g
5407 s%@CXXFLAGS@%$CXXFLAGS%g
5408 s%@FFLAGS@%$FFLAGS%g
5409 s%@DEFS@%$DEFS%g
5410 s%@LDFLAGS@%$LDFLAGS%g
5411 s%@LIBS@%$LIBS%g
5412 s%@exec_prefix@%$exec_prefix%g
5413 s%@prefix@%$prefix%g
5414 s%@program_transform_name@%$program_transform_name%g
5415 s%@bindir@%$bindir%g
5416 s%@sbindir@%$sbindir%g
5417 s%@libexecdir@%$libexecdir%g
5418 s%@datadir@%$datadir%g
5419 s%@sysconfdir@%$sysconfdir%g
5420 s%@sharedstatedir@%$sharedstatedir%g
5421 s%@localstatedir@%$localstatedir%g
5422 s%@libdir@%$libdir%g
5423 s%@includedir@%$includedir%g
5424 s%@oldincludedir@%$oldincludedir%g
5425 s%@infodir@%$infodir%g
5426 s%@mandir@%$mandir%g
5427 s%@RANLIB@%$RANLIB%g
5428 s%@CC@%$CC%g
5429 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
5430 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
5431 s%@INSTALL_DATA@%$INSTALL_DATA%g
5432 s%@LIBOBJS@%$LIBOBJS%g
5433 s%@CPP@%$CPP%g
5434 s%@BUILD_DLTEST@%$BUILD_DLTEST%g
5435 s%@DL_LIBS@%$DL_LIBS%g
5436 s%@DL_OBJS@%$DL_OBJS%g
5437 s%@LD_FLAGS@%$LD_FLAGS%g
5438 s%@MAKE_LIB@%$MAKE_LIB%g
5439 s%@MATH_LIBS@%$MATH_LIBS%g
5440 s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
5441 s%@SHLIB_LD@%$SHLIB_LD%g
5442 s%@SHLIB_LD_LIBS@%$SHLIB_LD_LIBS%g
5443 s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
5444 s%@TCL_BUILD_LIB_SPEC@%$TCL_BUILD_LIB_SPEC%g
5445 s%@TCL_LD_SEARCH_FLAGS@%$TCL_LD_SEARCH_FLAGS%g
5446 s%@TCL_LIB_FILE@%$TCL_LIB_FILE%g
5447 s%@TCL_LIB_FULL_PATH@%$TCL_LIB_FULL_PATH%g
5448 s%@TCL_LIB_FLAG@%$TCL_LIB_FLAG%g
5449 s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
5450 s%@TCL_LIB_VERSIONS_OK@%$TCL_LIB_VERSIONS_OK%g
5451 s%@TCL_MAJOR_VERSION@%$TCL_MAJOR_VERSION%g
5452 s%@TCL_MINOR_VERSION@%$TCL_MINOR_VERSION%g
5453 s%@TCL_PACKAGE_PATH@%$TCL_PACKAGE_PATH%g
5454 s%@TCL_PATCH_LEVEL@%$TCL_PATCH_LEVEL%g
5455 s%@TCL_SHARED_LIB_SUFFIX@%$TCL_SHARED_LIB_SUFFIX%g
5456 s%@TCL_SHARED_BUILD@%$TCL_SHARED_BUILD%g
5457 s%@TCL_SHLIB_CFLAGS@%$TCL_SHLIB_CFLAGS%g
5458 s%@TCL_SRC_DIR@%$TCL_SRC_DIR%g
5459 s%@TCL_UNSHARED_LIB_SUFFIX@%$TCL_UNSHARED_LIB_SUFFIX%g
5460 s%@TCL_VERSION@%$TCL_VERSION%g
5461 s%@TCL_SHARED_LIB_FILE@%$TCL_SHARED_LIB_FILE%g
5462 s%@TCL_UNSHARED_LIB_FILE@%$TCL_UNSHARED_LIB_FILE%g
5463
5464 CEOF
5465 EOF
5466
5467 cat >> $CONFIG_STATUS <<\EOF
5468
5469 # Split the substitutions into bite-sized pieces for seds with
5470 # small command number limits, like on Digital OSF/1 and HP-UX.
5471 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
5472 ac_file=1 # Number of current file.
5473 ac_beg=1 # First line for current file.
5474 ac_end=$ac_max_sed_cmds # Line after last line for current file.
5475 ac_more_lines=:
5476 ac_sed_cmds=""
5477 while $ac_more_lines; do
5478   if test $ac_beg -gt 1; then
5479     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
5480   else
5481     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
5482   fi
5483   if test ! -s conftest.s$ac_file; then
5484     ac_more_lines=false
5485     rm -f conftest.s$ac_file
5486   else
5487     if test -z "$ac_sed_cmds"; then
5488       ac_sed_cmds="sed -f conftest.s$ac_file"
5489     else
5490       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
5491     fi
5492     ac_file=`expr $ac_file + 1`
5493     ac_beg=$ac_end
5494     ac_end=`expr $ac_end + $ac_max_sed_cmds`
5495   fi
5496 done
5497 if test -z "$ac_sed_cmds"; then
5498   ac_sed_cmds=cat
5499 fi
5500 EOF
5501
5502 cat >> $CONFIG_STATUS <<EOF
5503
5504 CONFIG_FILES=\${CONFIG_FILES-"Makefile tclConfig.sh"}
5505 EOF
5506 cat >> $CONFIG_STATUS <<\EOF
5507 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
5508   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5509   case "$ac_file" in
5510   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5511        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5512   *) ac_file_in="${ac_file}.in" ;;
5513   esac
5514
5515   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
5516
5517   # Remove last slash and all that follows it.  Not all systems have dirname.
5518   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5519   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5520     # The file is in a subdirectory.
5521     test ! -d "$ac_dir" && mkdir "$ac_dir"
5522     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
5523     # A "../" for each directory in $ac_dir_suffix.
5524     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
5525   else
5526     ac_dir_suffix= ac_dots=
5527   fi
5528
5529   case "$ac_given_srcdir" in
5530   .)  srcdir=.
5531       if test -z "$ac_dots"; then top_srcdir=.
5532       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
5533   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
5534   *) # Relative path.
5535     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
5536     top_srcdir="$ac_dots$ac_given_srcdir" ;;
5537   esac
5538
5539   case "$ac_given_INSTALL" in
5540   [/$]*) INSTALL="$ac_given_INSTALL" ;;
5541   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
5542   esac
5543
5544   echo creating "$ac_file"
5545   rm -f "$ac_file"
5546   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
5547   case "$ac_file" in
5548   *Makefile*) ac_comsub="1i\\
5549 # $configure_input" ;;
5550   *) ac_comsub= ;;
5551   esac
5552
5553   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5554   sed -e "$ac_comsub
5555 s%@configure_input@%$configure_input%g
5556 s%@srcdir@%$srcdir%g
5557 s%@top_srcdir@%$top_srcdir%g
5558 s%@INSTALL@%$INSTALL%g
5559 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
5560 fi; done
5561 rm -f conftest.s*
5562
5563 EOF
5564 cat >> $CONFIG_STATUS <<EOF
5565
5566 EOF
5567 cat >> $CONFIG_STATUS <<\EOF
5568
5569 exit 0
5570 EOF
5571 chmod +x $CONFIG_STATUS
5572 rm -fr confdefs* $ac_clean_files
5573 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
5574