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