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