1#! /bin/sh
2
3# Guess values for system-dependent variables and create Makefiles.
4# Generated automatically using autoconf version 2.13 
5# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6#
7# This configure script is free software; the Free Software Foundation
8# gives unlimited permission to copy, distribute and modify it.
9
10# Defaults:
11ac_help=
12ac_default_prefix=/usr/local
13# Any additions from configure.in:
14ac_help="$ac_help
15  --enable-man-symlinks   use symlinks for the manpages"
16ac_help="$ac_help
17  --enable-man-compression=PROG
18		      compress the manpages with PROG"
19ac_help="$ac_help
20  --enable-man-suffix=STRING
21		      use STRING as a suffix to manpage file names
22		      (default: tcl)"
23ac_help="$ac_help
24  --enable-threads        build with threads"
25ac_help="$ac_help
26  --enable-shared         build and link with shared libraries [--enable-shared]"
27ac_help="$ac_help
28  --enable-64bit          enable 64bit support (where applicable)"
29ac_help="$ac_help
30  --enable-64bit-vis      enable 64bit Sparc VIS support"
31ac_help="$ac_help
32  --enable-corefoundation use CoreFoundation API [--enable-corefoundation]"
33ac_help="$ac_help
34  --disable-load          disallow dynamic loading and "load" command"
35ac_help="$ac_help
36  --enable-symbols        build with debugging symbols [--disable-symbols]"
37ac_help="$ac_help
38  --enable-langinfo	  use nl_langinfo if possible to determine
39			  encoding at startup, otherwise use old heuristic"
40ac_help="$ac_help
41  --enable-dtrace         build with DTrace support [--disable-dtrace]"
42ac_help="$ac_help
43  --enable-framework      package shared libraries in MacOSX frameworks [--disable-framework]"
44
45# Initialize some variables set by options.
46# The variables have the same names as the options, with
47# dashes changed to underlines.
48build=NONE
49cache_file=./config.cache
50exec_prefix=NONE
51host=NONE
52no_create=
53nonopt=NONE
54no_recursion=
55prefix=NONE
56program_prefix=NONE
57program_suffix=NONE
58program_transform_name=s,x,x,
59silent=
60site=
61srcdir=
62target=NONE
63verbose=
64x_includes=NONE
65x_libraries=NONE
66bindir='${exec_prefix}/bin'
67sbindir='${exec_prefix}/sbin'
68libexecdir='${exec_prefix}/libexec'
69datadir='${prefix}/share'
70sysconfdir='${prefix}/etc'
71sharedstatedir='${prefix}/com'
72localstatedir='${prefix}/var'
73libdir='${exec_prefix}/lib'
74includedir='${prefix}/include'
75oldincludedir='/usr/include'
76infodir='${prefix}/info'
77mandir='${prefix}/man'
78
79# Initialize some other variables.
80subdirs=
81MFLAGS= MAKEFLAGS=
82SHELL=${CONFIG_SHELL-/bin/sh}
83# Maximum number of lines to put in a shell here document.
84ac_max_here_lines=12
85
86ac_prev=
87for ac_option
88do
89
90  # If the previous option needs an argument, assign it.
91  if test -n "$ac_prev"; then
92    eval "$ac_prev=\$ac_option"
93    ac_prev=
94    continue
95  fi
96
97  case "$ac_option" in
98  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
99  *) ac_optarg= ;;
100  esac
101
102  # Accept the important Cygnus configure options, so we can diagnose typos.
103
104  case "$ac_option" in
105
106  -bindir | --bindir | --bindi | --bind | --bin | --bi)
107    ac_prev=bindir ;;
108  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
109    bindir="$ac_optarg" ;;
110
111  -build | --build | --buil | --bui | --bu)
112    ac_prev=build ;;
113  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
114    build="$ac_optarg" ;;
115
116  -cache-file | --cache-file | --cache-fil | --cache-fi \
117  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
118    ac_prev=cache_file ;;
119  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
120  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
121    cache_file="$ac_optarg" ;;
122
123  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
124    ac_prev=datadir ;;
125  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
126  | --da=*)
127    datadir="$ac_optarg" ;;
128
129  -disable-* | --disable-*)
130    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
131    # Reject names that are not valid shell variable names.
132    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
133      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
134    fi
135    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
136    eval "enable_${ac_feature}=no" ;;
137
138  -enable-* | --enable-*)
139    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
140    # Reject names that are not valid shell variable names.
141    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
142      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
143    fi
144    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
145    case "$ac_option" in
146      *=*) ;;
147      *) ac_optarg=yes ;;
148    esac
149    eval "enable_${ac_feature}='$ac_optarg'" ;;
150
151  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
152  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
153  | --exec | --exe | --ex)
154    ac_prev=exec_prefix ;;
155  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
156  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
157  | --exec=* | --exe=* | --ex=*)
158    exec_prefix="$ac_optarg" ;;
159
160  -gas | --gas | --ga | --g)
161    # Obsolete; use --with-gas.
162    with_gas=yes ;;
163
164  -help | --help | --hel | --he)
165    # Omit some internal or obsolete options to make the list less imposing.
166    # This message is too long to be a string in the A/UX 3.1 sh.
167    cat << EOF
168Usage: configure [options] [host]
169Options: [defaults in brackets after descriptions]
170Configuration:
171  --cache-file=FILE       cache test results in FILE
172  --help                  print this message
173  --no-create             do not create output files
174  --quiet, --silent       do not print \`checking...' messages
175  --version               print the version of autoconf that created configure
176Directory and file names:
177  --prefix=PREFIX         install architecture-independent files in PREFIX
178                          [$ac_default_prefix]
179  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
180                          [same as prefix]
181  --bindir=DIR            user executables in DIR [EPREFIX/bin]
182  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
183  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
184  --datadir=DIR           read-only architecture-independent data in DIR
185                          [PREFIX/share]
186  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
187  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
188                          [PREFIX/com]
189  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
190  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
191  --includedir=DIR        C header files in DIR [PREFIX/include]
192  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
193  --infodir=DIR           info documentation in DIR [PREFIX/info]
194  --mandir=DIR            man documentation in DIR [PREFIX/man]
195  --srcdir=DIR            find the sources in DIR [configure dir or ..]
196  --program-prefix=PREFIX prepend PREFIX to installed program names
197  --program-suffix=SUFFIX append SUFFIX to installed program names
198  --program-transform-name=PROGRAM
199                          run sed PROGRAM on installed program names
200EOF
201    cat << EOF
202Host type:
203  --build=BUILD           configure for building on BUILD [BUILD=HOST]
204  --host=HOST             configure for HOST [guessed]
205  --target=TARGET         configure for TARGET [TARGET=HOST]
206Features and packages:
207  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
208  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
209  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
210  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
211  --x-includes=DIR        X include files are in DIR
212  --x-libraries=DIR       X library files are in DIR
213EOF
214    if test -n "$ac_help"; then
215      echo "--enable and --with options recognized:$ac_help"
216    fi
217    exit 0 ;;
218
219  -host | --host | --hos | --ho)
220    ac_prev=host ;;
221  -host=* | --host=* | --hos=* | --ho=*)
222    host="$ac_optarg" ;;
223
224  -includedir | --includedir | --includedi | --included | --include \
225  | --includ | --inclu | --incl | --inc)
226    ac_prev=includedir ;;
227  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
228  | --includ=* | --inclu=* | --incl=* | --inc=*)
229    includedir="$ac_optarg" ;;
230
231  -infodir | --infodir | --infodi | --infod | --info | --inf)
232    ac_prev=infodir ;;
233  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
234    infodir="$ac_optarg" ;;
235
236  -libdir | --libdir | --libdi | --libd)
237    ac_prev=libdir ;;
238  -libdir=* | --libdir=* | --libdi=* | --libd=*)
239    libdir="$ac_optarg" ;;
240
241  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
242  | --libexe | --libex | --libe)
243    ac_prev=libexecdir ;;
244  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
245  | --libexe=* | --libex=* | --libe=*)
246    libexecdir="$ac_optarg" ;;
247
248  -localstatedir | --localstatedir | --localstatedi | --localstated \
249  | --localstate | --localstat | --localsta | --localst \
250  | --locals | --local | --loca | --loc | --lo)
251    ac_prev=localstatedir ;;
252  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
253  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
254  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
255    localstatedir="$ac_optarg" ;;
256
257  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
258    ac_prev=mandir ;;
259  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
260    mandir="$ac_optarg" ;;
261
262  -nfp | --nfp | --nf)
263    # Obsolete; use --without-fp.
264    with_fp=no ;;
265
266  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
267  | --no-cr | --no-c)
268    no_create=yes ;;
269
270  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
271  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
272    no_recursion=yes ;;
273
274  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
275  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
276  | --oldin | --oldi | --old | --ol | --o)
277    ac_prev=oldincludedir ;;
278  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
279  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
280  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
281    oldincludedir="$ac_optarg" ;;
282
283  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
284    ac_prev=prefix ;;
285  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
286    prefix="$ac_optarg" ;;
287
288  -program-prefix | --program-prefix | --program-prefi | --program-pref \
289  | --program-pre | --program-pr | --program-p)
290    ac_prev=program_prefix ;;
291  -program-prefix=* | --program-prefix=* | --program-prefi=* \
292  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
293    program_prefix="$ac_optarg" ;;
294
295  -program-suffix | --program-suffix | --program-suffi | --program-suff \
296  | --program-suf | --program-su | --program-s)
297    ac_prev=program_suffix ;;
298  -program-suffix=* | --program-suffix=* | --program-suffi=* \
299  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
300    program_suffix="$ac_optarg" ;;
301
302  -program-transform-name | --program-transform-name \
303  | --program-transform-nam | --program-transform-na \
304  | --program-transform-n | --program-transform- \
305  | --program-transform | --program-transfor \
306  | --program-transfo | --program-transf \
307  | --program-trans | --program-tran \
308  | --progr-tra | --program-tr | --program-t)
309    ac_prev=program_transform_name ;;
310  -program-transform-name=* | --program-transform-name=* \
311  | --program-transform-nam=* | --program-transform-na=* \
312  | --program-transform-n=* | --program-transform-=* \
313  | --program-transform=* | --program-transfor=* \
314  | --program-transfo=* | --program-transf=* \
315  | --program-trans=* | --program-tran=* \
316  | --progr-tra=* | --program-tr=* | --program-t=*)
317    program_transform_name="$ac_optarg" ;;
318
319  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
320  | -silent | --silent | --silen | --sile | --sil)
321    silent=yes ;;
322
323  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
324    ac_prev=sbindir ;;
325  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
326  | --sbi=* | --sb=*)
327    sbindir="$ac_optarg" ;;
328
329  -sharedstatedir | --sharedstatedir | --sharedstatedi \
330  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
331  | --sharedst | --shareds | --shared | --share | --shar \
332  | --sha | --sh)
333    ac_prev=sharedstatedir ;;
334  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
335  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
336  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
337  | --sha=* | --sh=*)
338    sharedstatedir="$ac_optarg" ;;
339
340  -site | --site | --sit)
341    ac_prev=site ;;
342  -site=* | --site=* | --sit=*)
343    site="$ac_optarg" ;;
344
345  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
346    ac_prev=srcdir ;;
347  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
348    srcdir="$ac_optarg" ;;
349
350  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
351  | --syscon | --sysco | --sysc | --sys | --sy)
352    ac_prev=sysconfdir ;;
353  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
354  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
355    sysconfdir="$ac_optarg" ;;
356
357  -target | --target | --targe | --targ | --tar | --ta | --t)
358    ac_prev=target ;;
359  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
360    target="$ac_optarg" ;;
361
362  -v | -verbose | --verbose | --verbos | --verbo | --verb)
363    verbose=yes ;;
364
365  -version | --version | --versio | --versi | --vers)
366    echo "configure generated by autoconf version 2.13"
367    exit 0 ;;
368
369  -with-* | --with-*)
370    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
371    # Reject names that are not valid shell variable names.
372    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
373      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
374    fi
375    ac_package=`echo $ac_package| sed 's/-/_/g'`
376    case "$ac_option" in
377      *=*) ;;
378      *) ac_optarg=yes ;;
379    esac
380    eval "with_${ac_package}='$ac_optarg'" ;;
381
382  -without-* | --without-*)
383    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
384    # Reject names that are not valid shell variable names.
385    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
386      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
387    fi
388    ac_package=`echo $ac_package| sed 's/-/_/g'`
389    eval "with_${ac_package}=no" ;;
390
391  --x)
392    # Obsolete; use --with-x.
393    with_x=yes ;;
394
395  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
396  | --x-incl | --x-inc | --x-in | --x-i)
397    ac_prev=x_includes ;;
398  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
399  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
400    x_includes="$ac_optarg" ;;
401
402  -x-libraries | --x-libraries | --x-librarie | --x-librari \
403  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
404    ac_prev=x_libraries ;;
405  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
406  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
407    x_libraries="$ac_optarg" ;;
408
409  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
410    ;;
411
412  *)
413    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
414      echo "configure: warning: $ac_option: invalid host type" 1>&2
415    fi
416    if test "x$nonopt" != xNONE; then
417      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
418    fi
419    nonopt="$ac_option"
420    ;;
421
422  esac
423done
424
425if test -n "$ac_prev"; then
426  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
427fi
428
429trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
430
431# File descriptor usage:
432# 0 standard input
433# 1 file creation
434# 2 errors and warnings
435# 3 some systems may open it to /dev/tty
436# 4 used on the Kubota Titan
437# 6 checking for... messages and results
438# 5 compiler messages saved in config.log
439if test "$silent" = yes; then
440  exec 6>/dev/null
441else
442  exec 6>&1
443fi
444exec 5>./config.log
445
446echo "\
447This file contains any messages produced by compilers while
448running configure, to aid debugging if configure makes a mistake.
449" 1>&5
450
451# Strip out --no-create and --no-recursion so they do not pile up.
452# Also quote any args containing shell metacharacters.
453ac_configure_args=
454for ac_arg
455do
456  case "$ac_arg" in
457  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
458  | --no-cr | --no-c) ;;
459  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
460  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
461  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
462  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
463  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
464  esac
465done
466
467# NLS nuisances.
468# Only set these to C if already set.  These must not be set unconditionally
469# because not all systems understand e.g. LANG=C (notably SCO).
470# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
471# Non-C LC_CTYPE values break the ctype check.
472if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
473if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
474if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
475if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
476
477# confdefs.h avoids OS command line length limits that DEFS can exceed.
478rm -rf conftest* confdefs.h
479# AIX cpp loses on an empty file, so make sure it contains at least a newline.
480echo > confdefs.h
481
482# A filename unique to this package, relative to the directory that
483# configure is in, which we can look for to find out if srcdir is correct.
484ac_unique_file=../generic/tcl.h
485
486# Find the source files, if location was not specified.
487if test -z "$srcdir"; then
488  ac_srcdir_defaulted=yes
489  # Try the directory containing this script, then its parent.
490  ac_prog=$0
491  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
492  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
493  srcdir=$ac_confdir
494  if test ! -r $srcdir/$ac_unique_file; then
495    srcdir=..
496  fi
497else
498  ac_srcdir_defaulted=no
499fi
500if test ! -r $srcdir/$ac_unique_file; then
501  if test "$ac_srcdir_defaulted" = yes; then
502    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
503  else
504    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
505  fi
506fi
507srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
508
509# Prefer explicitly selected file to automatically selected ones.
510if test -z "$CONFIG_SITE"; then
511  if test "x$prefix" != xNONE; then
512    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
513  else
514    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
515  fi
516fi
517for ac_site_file in $CONFIG_SITE; do
518  if test -r "$ac_site_file"; then
519    echo "loading site script $ac_site_file"
520    . "$ac_site_file"
521  fi
522done
523
524if test -r "$cache_file"; then
525  echo "loading cache $cache_file"
526  . $cache_file
527else
528  echo "creating cache $cache_file"
529  > $cache_file
530fi
531
532ac_ext=c
533# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
534ac_cpp='$CPP $CPPFLAGS'
535ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
536ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
537cross_compiling=$ac_cv_prog_cc_cross
538
539ac_exeext=
540ac_objext=o
541if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
542  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
543  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
544    ac_n= ac_c='
545' ac_t='	'
546  else
547    ac_n=-n ac_c= ac_t=
548  fi
549else
550  ac_n= ac_c='\c' ac_t=
551fi
552
553
554
555
556TCL_VERSION=8.4
557TCL_MAJOR_VERSION=8
558TCL_MINOR_VERSION=4
559TCL_PATCH_LEVEL=".19"
560VERSION=${TCL_VERSION}
561
562#------------------------------------------------------------------------
563# Handle the --prefix=... option
564#------------------------------------------------------------------------
565
566if test "${prefix}" = "NONE"; then
567    prefix=/usr/local
568fi
569if test "${exec_prefix}" = "NONE"; then
570    exec_prefix=$prefix
571fi
572# Make sure srcdir is fully qualified!
573srcdir=`cd $srcdir ; pwd`
574TCL_SRC_DIR=`cd $srcdir/..; pwd`
575
576#------------------------------------------------------------------------
577# Compress and/or soft link the manpages?
578#------------------------------------------------------------------------
579
580
581    echo $ac_n "checking whether to use symlinks for manpages""... $ac_c" 1>&6
582echo "configure:583: checking whether to use symlinks for manpages" >&5
583    # Check whether --enable-man-symlinks or --disable-man-symlinks was given.
584if test "${enable_man_symlinks+set}" = set; then
585  enableval="$enable_man_symlinks"
586  test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks"
587else
588  enableval="no"
589fi
590
591    echo "$ac_t""$enableval" 1>&6
592
593    echo $ac_n "checking whether to compress the manpages""... $ac_c" 1>&6
594echo "configure:595: checking whether to compress the manpages" >&5
595    # Check whether --enable-man-compression or --disable-man-compression was given.
596if test "${enable_man_compression+set}" = set; then
597  enableval="$enable_man_compression"
598  case $enableval in
599	    yes) { echo "configure: error: missing argument to --enable-man-compression" 1>&2; exit 1; };;
600	    no)  ;;
601	    *)   MAN_FLAGS="$MAN_FLAGS --compress $enableval";;
602	esac
603else
604  enableval="no"
605fi
606
607    echo "$ac_t""$enableval" 1>&6
608    if test "$enableval" != "no"; then
609	echo $ac_n "checking for compressed file suffix""... $ac_c" 1>&6
610echo "configure:611: checking for compressed file suffix" >&5
611	touch TeST
612	$enableval TeST
613	Z=`ls TeST* | sed 's/^....//'`
614	rm -f TeST*
615	MAN_FLAGS="$MAN_FLAGS --extension $Z"
616	echo "$ac_t""$Z" 1>&6
617    fi
618
619    echo $ac_n "checking whether to add a package name suffix for the manpages""... $ac_c" 1>&6
620echo "configure:621: checking whether to add a package name suffix for the manpages" >&5
621    # Check whether --enable-man-suffix or --disable-man-suffix was given.
622if test "${enable_man_suffix+set}" = set; then
623  enableval="$enable_man_suffix"
624  case $enableval in
625	    yes) enableval="tcl" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
626	    no)  ;;
627	    *)   MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
628	esac
629else
630  enableval="no"
631fi
632
633    echo "$ac_t""$enableval" 1>&6
634
635    
636
637
638#------------------------------------------------------------------------
639# Standard compiler checks
640#------------------------------------------------------------------------
641
642# If the user did not set CFLAGS, set it now to keep
643# the AC_PROG_CC macro from adding "-g -O2".
644if test "${CFLAGS+set}" != "set" ; then
645    CFLAGS=""
646fi
647
648# Extract the first word of "gcc", so it can be a program name with args.
649set dummy gcc; ac_word=$2
650echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
651echo "configure:652: checking for $ac_word" >&5
652if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
653  echo $ac_n "(cached) $ac_c" 1>&6
654else
655  if test -n "$CC"; then
656  ac_cv_prog_CC="$CC" # Let the user override the test.
657else
658  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
659  ac_dummy="$PATH"
660  for ac_dir in $ac_dummy; do
661    test -z "$ac_dir" && ac_dir=.
662    if test -f $ac_dir/$ac_word; then
663      ac_cv_prog_CC="gcc"
664      break
665    fi
666  done
667  IFS="$ac_save_ifs"
668fi
669fi
670CC="$ac_cv_prog_CC"
671if test -n "$CC"; then
672  echo "$ac_t""$CC" 1>&6
673else
674  echo "$ac_t""no" 1>&6
675fi
676
677if test -z "$CC"; then
678  # Extract the first word of "cc", so it can be a program name with args.
679set dummy cc; ac_word=$2
680echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
681echo "configure:682: checking for $ac_word" >&5
682if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
683  echo $ac_n "(cached) $ac_c" 1>&6
684else
685  if test -n "$CC"; then
686  ac_cv_prog_CC="$CC" # Let the user override the test.
687else
688  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
689  ac_prog_rejected=no
690  ac_dummy="$PATH"
691  for ac_dir in $ac_dummy; do
692    test -z "$ac_dir" && ac_dir=.
693    if test -f $ac_dir/$ac_word; then
694      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
695        ac_prog_rejected=yes
696	continue
697      fi
698      ac_cv_prog_CC="cc"
699      break
700    fi
701  done
702  IFS="$ac_save_ifs"
703if test $ac_prog_rejected = yes; then
704  # We found a bogon in the path, so make sure we never use it.
705  set dummy $ac_cv_prog_CC
706  shift
707  if test $# -gt 0; then
708    # We chose a different compiler from the bogus one.
709    # However, it has the same basename, so the bogon will be chosen
710    # first if we set CC to just the basename; use the full file name.
711    shift
712    set dummy "$ac_dir/$ac_word" "$@"
713    shift
714    ac_cv_prog_CC="$@"
715  fi
716fi
717fi
718fi
719CC="$ac_cv_prog_CC"
720if test -n "$CC"; then
721  echo "$ac_t""$CC" 1>&6
722else
723  echo "$ac_t""no" 1>&6
724fi
725
726  if test -z "$CC"; then
727    case "`uname -s`" in
728    *win32* | *WIN32*)
729      # Extract the first word of "cl", so it can be a program name with args.
730set dummy cl; ac_word=$2
731echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
732echo "configure:733: checking for $ac_word" >&5
733if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
734  echo $ac_n "(cached) $ac_c" 1>&6
735else
736  if test -n "$CC"; then
737  ac_cv_prog_CC="$CC" # Let the user override the test.
738else
739  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
740  ac_dummy="$PATH"
741  for ac_dir in $ac_dummy; do
742    test -z "$ac_dir" && ac_dir=.
743    if test -f $ac_dir/$ac_word; then
744      ac_cv_prog_CC="cl"
745      break
746    fi
747  done
748  IFS="$ac_save_ifs"
749fi
750fi
751CC="$ac_cv_prog_CC"
752if test -n "$CC"; then
753  echo "$ac_t""$CC" 1>&6
754else
755  echo "$ac_t""no" 1>&6
756fi
757 ;;
758    esac
759  fi
760  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
761fi
762
763echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
764echo "configure:765: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
765
766ac_ext=c
767# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
768ac_cpp='$CPP $CPPFLAGS'
769ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
770ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
771cross_compiling=$ac_cv_prog_cc_cross
772
773cat > conftest.$ac_ext << EOF
774
775#line 776 "configure"
776#include "confdefs.h"
777
778main(){return(0);}
779EOF
780if { (eval echo configure:781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
781  ac_cv_prog_cc_works=yes
782  # If we can't run a trivial program, we are probably using a cross compiler.
783  if (./conftest; exit) 2>/dev/null; then
784    ac_cv_prog_cc_cross=no
785  else
786    ac_cv_prog_cc_cross=yes
787  fi
788else
789  echo "configure: failed program was:" >&5
790  cat conftest.$ac_ext >&5
791  ac_cv_prog_cc_works=no
792fi
793rm -fr conftest*
794ac_ext=c
795# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
796ac_cpp='$CPP $CPPFLAGS'
797ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
798ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
799cross_compiling=$ac_cv_prog_cc_cross
800
801echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
802if test $ac_cv_prog_cc_works = no; then
803  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
804fi
805echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
806echo "configure:807: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
807echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
808cross_compiling=$ac_cv_prog_cc_cross
809
810echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
811echo "configure:812: checking whether we are using GNU C" >&5
812if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
813  echo $ac_n "(cached) $ac_c" 1>&6
814else
815  cat > conftest.c <<EOF
816#ifdef __GNUC__
817  yes;
818#endif
819EOF
820if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
821  ac_cv_prog_gcc=yes
822else
823  ac_cv_prog_gcc=no
824fi
825fi
826
827echo "$ac_t""$ac_cv_prog_gcc" 1>&6
828
829if test $ac_cv_prog_gcc = yes; then
830  GCC=yes
831else
832  GCC=
833fi
834
835ac_test_CFLAGS="${CFLAGS+set}"
836ac_save_CFLAGS="$CFLAGS"
837CFLAGS=
838echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
839echo "configure:840: checking whether ${CC-cc} accepts -g" >&5
840if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
841  echo $ac_n "(cached) $ac_c" 1>&6
842else
843  echo 'void f(){}' > conftest.c
844if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
845  ac_cv_prog_cc_g=yes
846else
847  ac_cv_prog_cc_g=no
848fi
849rm -f conftest*
850
851fi
852
853echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
854if test "$ac_test_CFLAGS" = set; then
855  CFLAGS="$ac_save_CFLAGS"
856elif test $ac_cv_prog_cc_g = yes; then
857  if test "$GCC" = yes; then
858    CFLAGS="-g -O2"
859  else
860    CFLAGS="-g"
861  fi
862else
863  if test "$GCC" = yes; then
864    CFLAGS="-O2"
865  else
866    CFLAGS=
867  fi
868fi
869
870
871#--------------------------------------------------------------------
872# Supply substitutes for missing POSIX header files.  Special notes:
873#	- stdlib.h doesn't define strtol, strtoul, or
874#	  strtod insome versions of SunOS
875#	- some versions of string.h don't declare procedures such
876#	  as strstr
877# Do this early, otherwise an autoconf bug throws errors on configure
878#--------------------------------------------------------------------
879
880echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
881echo "configure:882: checking how to run the C preprocessor" >&5
882# On Suns, sometimes $CPP names a directory.
883if test -n "$CPP" && test -d "$CPP"; then
884  CPP=
885fi
886if test -z "$CPP"; then
887if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
888  echo $ac_n "(cached) $ac_c" 1>&6
889else
890    # This must be in double quotes, not single quotes, because CPP may get
891  # substituted into the Makefile and "${CC-cc}" will confuse make.
892  CPP="${CC-cc} -E"
893  # On the NeXT, cc -E runs the code through the compiler's parser,
894  # not just through cpp.
895  cat > conftest.$ac_ext <<EOF
896#line 897 "configure"
897#include "confdefs.h"
898#include <assert.h>
899Syntax Error
900EOF
901ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
902{ (eval echo configure:903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
903ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
904if test -z "$ac_err"; then
905  :
906else
907  echo "$ac_err" >&5
908  echo "configure: failed program was:" >&5
909  cat conftest.$ac_ext >&5
910  rm -rf conftest*
911  CPP="${CC-cc} -E -traditional-cpp"
912  cat > conftest.$ac_ext <<EOF
913#line 914 "configure"
914#include "confdefs.h"
915#include <assert.h>
916Syntax Error
917EOF
918ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
919{ (eval echo configure:920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
920ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
921if test -z "$ac_err"; then
922  :
923else
924  echo "$ac_err" >&5
925  echo "configure: failed program was:" >&5
926  cat conftest.$ac_ext >&5
927  rm -rf conftest*
928  CPP="${CC-cc} -nologo -E"
929  cat > conftest.$ac_ext <<EOF
930#line 931 "configure"
931#include "confdefs.h"
932#include <assert.h>
933Syntax Error
934EOF
935ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
936{ (eval echo configure:937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
937ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
938if test -z "$ac_err"; then
939  :
940else
941  echo "$ac_err" >&5
942  echo "configure: failed program was:" >&5
943  cat conftest.$ac_ext >&5
944  rm -rf conftest*
945  CPP=/lib/cpp
946fi
947rm -f conftest*
948fi
949rm -f conftest*
950fi
951rm -f conftest*
952  ac_cv_prog_CPP="$CPP"
953fi
954  CPP="$ac_cv_prog_CPP"
955else
956  ac_cv_prog_CPP="$CPP"
957fi
958echo "$ac_t""$CPP" 1>&6
959
960
961    echo $ac_n "checking dirent.h""... $ac_c" 1>&6
962echo "configure:963: checking dirent.h" >&5
963if eval "test \"`echo '$''{'tcl_cv_dirent_h'+set}'`\" = set"; then
964  echo $ac_n "(cached) $ac_c" 1>&6
965else
966  
967    cat > conftest.$ac_ext <<EOF
968#line 969 "configure"
969#include "confdefs.h"
970#include <sys/types.h>
971#include <dirent.h>
972int main() {
973
974#ifndef _POSIX_SOURCE
975#   ifdef __Lynx__
976	/*
977	 * Generate compilation error to make the test fail:  Lynx headers
978	 * are only valid if really in the POSIX environment.
979	 */
980
981	missing_procedure();
982#   endif
983#endif
984DIR *d;
985struct dirent *entryPtr;
986char *p;
987d = opendir("foobar");
988entryPtr = readdir(d);
989p = entryPtr->d_name;
990closedir(d);
991
992; return 0; }
993EOF
994if { (eval echo configure:995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
995  rm -rf conftest*
996  tcl_cv_dirent_h=yes
997else
998  echo "configure: failed program was:" >&5
999  cat conftest.$ac_ext >&5
1000  rm -rf conftest*
1001  tcl_cv_dirent_h=no
1002fi
1003rm -f conftest*
1004fi
1005
1006echo "$ac_t""$tcl_cv_dirent_h" 1>&6
1007
1008    if test $tcl_cv_dirent_h = no; then
1009	cat >> confdefs.h <<\EOF
1010#define NO_DIRENT_H 1
1011EOF
1012
1013    fi
1014
1015    ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'`
1016echo $ac_n "checking for errno.h""... $ac_c" 1>&6
1017echo "configure:1018: checking for errno.h" >&5
1018if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1019  echo $ac_n "(cached) $ac_c" 1>&6
1020else
1021  cat > conftest.$ac_ext <<EOF
1022#line 1023 "configure"
1023#include "confdefs.h"
1024#include <errno.h>
1025EOF
1026ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1027{ (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1028ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1029if test -z "$ac_err"; then
1030  rm -rf conftest*
1031  eval "ac_cv_header_$ac_safe=yes"
1032else
1033  echo "$ac_err" >&5
1034  echo "configure: failed program was:" >&5
1035  cat conftest.$ac_ext >&5
1036  rm -rf conftest*
1037  eval "ac_cv_header_$ac_safe=no"
1038fi
1039rm -f conftest*
1040fi
1041if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1042  echo "$ac_t""yes" 1>&6
1043  :
1044else
1045  echo "$ac_t""no" 1>&6
1046cat >> confdefs.h <<\EOF
1047#define NO_ERRNO_H 1
1048EOF
1049
1050fi
1051
1052    ac_safe=`echo "float.h" | sed 'y%./+-%__p_%'`
1053echo $ac_n "checking for float.h""... $ac_c" 1>&6
1054echo "configure:1055: checking for float.h" >&5
1055if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1056  echo $ac_n "(cached) $ac_c" 1>&6
1057else
1058  cat > conftest.$ac_ext <<EOF
1059#line 1060 "configure"
1060#include "confdefs.h"
1061#include <float.h>
1062EOF
1063ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1064{ (eval echo configure:1065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1065ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1066if test -z "$ac_err"; then
1067  rm -rf conftest*
1068  eval "ac_cv_header_$ac_safe=yes"
1069else
1070  echo "$ac_err" >&5
1071  echo "configure: failed program was:" >&5
1072  cat conftest.$ac_ext >&5
1073  rm -rf conftest*
1074  eval "ac_cv_header_$ac_safe=no"
1075fi
1076rm -f conftest*
1077fi
1078if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1079  echo "$ac_t""yes" 1>&6
1080  :
1081else
1082  echo "$ac_t""no" 1>&6
1083cat >> confdefs.h <<\EOF
1084#define NO_FLOAT_H 1
1085EOF
1086
1087fi
1088
1089    ac_safe=`echo "values.h" | sed 'y%./+-%__p_%'`
1090echo $ac_n "checking for values.h""... $ac_c" 1>&6
1091echo "configure:1092: checking for values.h" >&5
1092if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1093  echo $ac_n "(cached) $ac_c" 1>&6
1094else
1095  cat > conftest.$ac_ext <<EOF
1096#line 1097 "configure"
1097#include "confdefs.h"
1098#include <values.h>
1099EOF
1100ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1101{ (eval echo configure:1102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1102ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1103if test -z "$ac_err"; then
1104  rm -rf conftest*
1105  eval "ac_cv_header_$ac_safe=yes"
1106else
1107  echo "$ac_err" >&5
1108  echo "configure: failed program was:" >&5
1109  cat conftest.$ac_ext >&5
1110  rm -rf conftest*
1111  eval "ac_cv_header_$ac_safe=no"
1112fi
1113rm -f conftest*
1114fi
1115if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1116  echo "$ac_t""yes" 1>&6
1117  :
1118else
1119  echo "$ac_t""no" 1>&6
1120cat >> confdefs.h <<\EOF
1121#define NO_VALUES_H 1
1122EOF
1123
1124fi
1125
1126    ac_safe=`echo "limits.h" | sed 'y%./+-%__p_%'`
1127echo $ac_n "checking for limits.h""... $ac_c" 1>&6
1128echo "configure:1129: checking for limits.h" >&5
1129if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1130  echo $ac_n "(cached) $ac_c" 1>&6
1131else
1132  cat > conftest.$ac_ext <<EOF
1133#line 1134 "configure"
1134#include "confdefs.h"
1135#include <limits.h>
1136EOF
1137ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1138{ (eval echo configure:1139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1139ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1140if test -z "$ac_err"; then
1141  rm -rf conftest*
1142  eval "ac_cv_header_$ac_safe=yes"
1143else
1144  echo "$ac_err" >&5
1145  echo "configure: failed program was:" >&5
1146  cat conftest.$ac_ext >&5
1147  rm -rf conftest*
1148  eval "ac_cv_header_$ac_safe=no"
1149fi
1150rm -f conftest*
1151fi
1152if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1153  echo "$ac_t""yes" 1>&6
1154  cat >> confdefs.h <<\EOF
1155#define HAVE_LIMITS_H 1
1156EOF
1157
1158else
1159  echo "$ac_t""no" 1>&6
1160cat >> confdefs.h <<\EOF
1161#define NO_LIMITS_H 1
1162EOF
1163
1164fi
1165
1166    ac_safe=`echo "stdlib.h" | sed 'y%./+-%__p_%'`
1167echo $ac_n "checking for stdlib.h""... $ac_c" 1>&6
1168echo "configure:1169: checking for stdlib.h" >&5
1169if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1170  echo $ac_n "(cached) $ac_c" 1>&6
1171else
1172  cat > conftest.$ac_ext <<EOF
1173#line 1174 "configure"
1174#include "confdefs.h"
1175#include <stdlib.h>
1176EOF
1177ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1178{ (eval echo configure:1179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1179ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
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  echo "configure: failed program was:" >&5
1186  cat conftest.$ac_ext >&5
1187  rm -rf conftest*
1188  eval "ac_cv_header_$ac_safe=no"
1189fi
1190rm -f conftest*
1191fi
1192if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1193  echo "$ac_t""yes" 1>&6
1194  tcl_ok=1
1195else
1196  echo "$ac_t""no" 1>&6
1197tcl_ok=0
1198fi
1199
1200    cat > conftest.$ac_ext <<EOF
1201#line 1202 "configure"
1202#include "confdefs.h"
1203#include <stdlib.h>
1204EOF
1205if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1206  egrep "strtol" >/dev/null 2>&1; then
1207  :
1208else
1209  rm -rf conftest*
1210  tcl_ok=0
1211fi
1212rm -f conftest*
1213
1214    cat > conftest.$ac_ext <<EOF
1215#line 1216 "configure"
1216#include "confdefs.h"
1217#include <stdlib.h>
1218EOF
1219if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1220  egrep "strtoul" >/dev/null 2>&1; then
1221  :
1222else
1223  rm -rf conftest*
1224  tcl_ok=0
1225fi
1226rm -f conftest*
1227
1228    cat > conftest.$ac_ext <<EOF
1229#line 1230 "configure"
1230#include "confdefs.h"
1231#include <stdlib.h>
1232EOF
1233if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1234  egrep "strtod" >/dev/null 2>&1; then
1235  :
1236else
1237  rm -rf conftest*
1238  tcl_ok=0
1239fi
1240rm -f conftest*
1241
1242    if test $tcl_ok = 0; then
1243	cat >> confdefs.h <<\EOF
1244#define NO_STDLIB_H 1
1245EOF
1246
1247    fi
1248    ac_safe=`echo "string.h" | sed 'y%./+-%__p_%'`
1249echo $ac_n "checking for string.h""... $ac_c" 1>&6
1250echo "configure:1251: checking for string.h" >&5
1251if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1252  echo $ac_n "(cached) $ac_c" 1>&6
1253else
1254  cat > conftest.$ac_ext <<EOF
1255#line 1256 "configure"
1256#include "confdefs.h"
1257#include <string.h>
1258EOF
1259ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1260{ (eval echo configure:1261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1261ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1262if test -z "$ac_err"; then
1263  rm -rf conftest*
1264  eval "ac_cv_header_$ac_safe=yes"
1265else
1266  echo "$ac_err" >&5
1267  echo "configure: failed program was:" >&5
1268  cat conftest.$ac_ext >&5
1269  rm -rf conftest*
1270  eval "ac_cv_header_$ac_safe=no"
1271fi
1272rm -f conftest*
1273fi
1274if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1275  echo "$ac_t""yes" 1>&6
1276  tcl_ok=1
1277else
1278  echo "$ac_t""no" 1>&6
1279tcl_ok=0
1280fi
1281
1282    cat > conftest.$ac_ext <<EOF
1283#line 1284 "configure"
1284#include "confdefs.h"
1285#include <string.h>
1286EOF
1287if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1288  egrep "strstr" >/dev/null 2>&1; then
1289  :
1290else
1291  rm -rf conftest*
1292  tcl_ok=0
1293fi
1294rm -f conftest*
1295
1296    cat > conftest.$ac_ext <<EOF
1297#line 1298 "configure"
1298#include "confdefs.h"
1299#include <string.h>
1300EOF
1301if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1302  egrep "strerror" >/dev/null 2>&1; then
1303  :
1304else
1305  rm -rf conftest*
1306  tcl_ok=0
1307fi
1308rm -f conftest*
1309
1310
1311    # See also memmove check below for a place where NO_STRING_H can be
1312    # set and why.
1313
1314    if test $tcl_ok = 0; then
1315	cat >> confdefs.h <<\EOF
1316#define NO_STRING_H 1
1317EOF
1318
1319    fi
1320
1321    ac_safe=`echo "sys/wait.h" | sed 'y%./+-%__p_%'`
1322echo $ac_n "checking for sys/wait.h""... $ac_c" 1>&6
1323echo "configure:1324: checking for sys/wait.h" >&5
1324if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1325  echo $ac_n "(cached) $ac_c" 1>&6
1326else
1327  cat > conftest.$ac_ext <<EOF
1328#line 1329 "configure"
1329#include "confdefs.h"
1330#include <sys/wait.h>
1331EOF
1332ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1333{ (eval echo configure:1334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1334ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1335if test -z "$ac_err"; then
1336  rm -rf conftest*
1337  eval "ac_cv_header_$ac_safe=yes"
1338else
1339  echo "$ac_err" >&5
1340  echo "configure: failed program was:" >&5
1341  cat conftest.$ac_ext >&5
1342  rm -rf conftest*
1343  eval "ac_cv_header_$ac_safe=no"
1344fi
1345rm -f conftest*
1346fi
1347if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1348  echo "$ac_t""yes" 1>&6
1349  :
1350else
1351  echo "$ac_t""no" 1>&6
1352cat >> confdefs.h <<\EOF
1353#define NO_SYS_WAIT_H 1
1354EOF
1355
1356fi
1357
1358    ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
1359echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
1360echo "configure:1361: checking for dlfcn.h" >&5
1361if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1362  echo $ac_n "(cached) $ac_c" 1>&6
1363else
1364  cat > conftest.$ac_ext <<EOF
1365#line 1366 "configure"
1366#include "confdefs.h"
1367#include <dlfcn.h>
1368EOF
1369ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1370{ (eval echo configure:1371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1371ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1372if test -z "$ac_err"; then
1373  rm -rf conftest*
1374  eval "ac_cv_header_$ac_safe=yes"
1375else
1376  echo "$ac_err" >&5
1377  echo "configure: failed program was:" >&5
1378  cat conftest.$ac_ext >&5
1379  rm -rf conftest*
1380  eval "ac_cv_header_$ac_safe=no"
1381fi
1382rm -f conftest*
1383fi
1384if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1385  echo "$ac_t""yes" 1>&6
1386  :
1387else
1388  echo "$ac_t""no" 1>&6
1389cat >> confdefs.h <<\EOF
1390#define NO_DLFCN_H 1
1391EOF
1392
1393fi
1394
1395
1396    # OS/390 lacks sys/param.h (and doesn't need it, by chance).
1397    for ac_hdr in unistd.h sys/param.h
1398do
1399ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1400echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1401echo "configure:1402: checking for $ac_hdr" >&5
1402if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1403  echo $ac_n "(cached) $ac_c" 1>&6
1404else
1405  cat > conftest.$ac_ext <<EOF
1406#line 1407 "configure"
1407#include "confdefs.h"
1408#include <$ac_hdr>
1409EOF
1410ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1411{ (eval echo configure:1412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1412ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1413if test -z "$ac_err"; then
1414  rm -rf conftest*
1415  eval "ac_cv_header_$ac_safe=yes"
1416else
1417  echo "$ac_err" >&5
1418  echo "configure: failed program was:" >&5
1419  cat conftest.$ac_ext >&5
1420  rm -rf conftest*
1421  eval "ac_cv_header_$ac_safe=no"
1422fi
1423rm -f conftest*
1424fi
1425if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1426  echo "$ac_t""yes" 1>&6
1427    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1428  cat >> confdefs.h <<EOF
1429#define $ac_tr_hdr 1
1430EOF
1431 
1432else
1433  echo "$ac_t""no" 1>&6
1434fi
1435done
1436
1437
1438
1439#------------------------------------------------------------------------
1440# If we're using GCC, see if the compiler understands -pipe.  If so, use it.
1441# It makes compiling go faster.  (This is only a performance feature.)
1442#------------------------------------------------------------------------
1443
1444if test -z "$no_pipe" && test -n "$GCC"; then
1445    echo $ac_n "checking if the compiler understands -pipe""... $ac_c" 1>&6
1446echo "configure:1447: checking if the compiler understands -pipe" >&5
1447if eval "test \"`echo '$''{'tcl_cv_cc_pipe'+set}'`\" = set"; then
1448  echo $ac_n "(cached) $ac_c" 1>&6
1449else
1450  
1451	hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
1452	cat > conftest.$ac_ext <<EOF
1453#line 1454 "configure"
1454#include "confdefs.h"
1455
1456int main() {
1457
1458; return 0; }
1459EOF
1460if { (eval echo configure:1461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1461  rm -rf conftest*
1462  tcl_cv_cc_pipe=yes
1463else
1464  echo "configure: failed program was:" >&5
1465  cat conftest.$ac_ext >&5
1466  rm -rf conftest*
1467  tcl_cv_cc_pipe=no
1468fi
1469rm -f conftest*
1470	CFLAGS=$hold_cflags
1471fi
1472
1473echo "$ac_t""$tcl_cv_cc_pipe" 1>&6
1474    if test $tcl_cv_cc_pipe = yes; then
1475	CFLAGS="$CFLAGS -pipe"
1476    fi
1477fi
1478
1479#------------------------------------------------------------------------
1480# Threads support
1481#------------------------------------------------------------------------
1482
1483
1484    # Check whether --enable-threads or --disable-threads was given.
1485if test "${enable_threads+set}" = set; then
1486  enableval="$enable_threads"
1487  tcl_ok=$enableval
1488else
1489  tcl_ok=no
1490fi
1491
1492
1493    if test "${TCL_THREADS}" = 1; then
1494	tcl_threaded_core=1;
1495    fi
1496
1497    if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
1498	TCL_THREADS=1
1499	# USE_THREAD_ALLOC tells us to try the special thread-based
1500	# allocator that significantly reduces lock contention
1501	cat >> confdefs.h <<\EOF
1502#define USE_THREAD_ALLOC 1
1503EOF
1504
1505	cat >> confdefs.h <<\EOF
1506#define _REENTRANT 1
1507EOF
1508
1509	if test "`uname -s`" = "SunOS" ; then
1510	    cat >> confdefs.h <<\EOF
1511#define _POSIX_PTHREAD_SEMANTICS 1
1512EOF
1513
1514	fi
1515	cat >> confdefs.h <<\EOF
1516#define _THREAD_SAFE 1
1517EOF
1518
1519	echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6
1520echo "configure:1521: checking for pthread_mutex_init in -lpthread" >&5
1521ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
1522if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1523  echo $ac_n "(cached) $ac_c" 1>&6
1524else
1525  ac_save_LIBS="$LIBS"
1526LIBS="-lpthread  $LIBS"
1527cat > conftest.$ac_ext <<EOF
1528#line 1529 "configure"
1529#include "confdefs.h"
1530/* Override any gcc2 internal prototype to avoid an error.  */
1531/* We use char because int might match the return type of a gcc2
1532    builtin and then its argument prototype would still apply.  */
1533char pthread_mutex_init();
1534
1535int main() {
1536pthread_mutex_init()
1537; return 0; }
1538EOF
1539if { (eval echo configure:1540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1540  rm -rf conftest*
1541  eval "ac_cv_lib_$ac_lib_var=yes"
1542else
1543  echo "configure: failed program was:" >&5
1544  cat conftest.$ac_ext >&5
1545  rm -rf conftest*
1546  eval "ac_cv_lib_$ac_lib_var=no"
1547fi
1548rm -f conftest*
1549LIBS="$ac_save_LIBS"
1550
1551fi
1552if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1553  echo "$ac_t""yes" 1>&6
1554  tcl_ok=yes
1555else
1556  echo "$ac_t""no" 1>&6
1557tcl_ok=no
1558fi
1559
1560	if test "$tcl_ok" = "no"; then
1561	    # Check a little harder for __pthread_mutex_init in the same
1562	    # library, as some systems hide it there until pthread.h is
1563	    # defined.  We could alternatively do an AC_TRY_COMPILE with
1564	    # pthread.h, but that will work with libpthread really doesn't
1565	    # exist, like AIX 4.2.  [Bug: 4359]
1566	    echo $ac_n "checking for __pthread_mutex_init in -lpthread""... $ac_c" 1>&6
1567echo "configure:1568: checking for __pthread_mutex_init in -lpthread" >&5
1568ac_lib_var=`echo pthread'_'__pthread_mutex_init | sed 'y%./+-%__p_%'`
1569if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1570  echo $ac_n "(cached) $ac_c" 1>&6
1571else
1572  ac_save_LIBS="$LIBS"
1573LIBS="-lpthread  $LIBS"
1574cat > conftest.$ac_ext <<EOF
1575#line 1576 "configure"
1576#include "confdefs.h"
1577/* Override any gcc2 internal prototype to avoid an error.  */
1578/* We use char because int might match the return type of a gcc2
1579    builtin and then its argument prototype would still apply.  */
1580char __pthread_mutex_init();
1581
1582int main() {
1583__pthread_mutex_init()
1584; return 0; }
1585EOF
1586if { (eval echo configure:1587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1587  rm -rf conftest*
1588  eval "ac_cv_lib_$ac_lib_var=yes"
1589else
1590  echo "configure: failed program was:" >&5
1591  cat conftest.$ac_ext >&5
1592  rm -rf conftest*
1593  eval "ac_cv_lib_$ac_lib_var=no"
1594fi
1595rm -f conftest*
1596LIBS="$ac_save_LIBS"
1597
1598fi
1599if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1600  echo "$ac_t""yes" 1>&6
1601  tcl_ok=yes
1602else
1603  echo "$ac_t""no" 1>&6
1604tcl_ok=no
1605fi
1606
1607	fi
1608
1609	if test "$tcl_ok" = "yes"; then
1610	    # The space is needed
1611	    THREADS_LIBS=" -lpthread"
1612	else
1613	    echo $ac_n "checking for pthread_mutex_init in -lpthreads""... $ac_c" 1>&6
1614echo "configure:1615: checking for pthread_mutex_init in -lpthreads" >&5
1615ac_lib_var=`echo pthreads'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
1616if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1617  echo $ac_n "(cached) $ac_c" 1>&6
1618else
1619  ac_save_LIBS="$LIBS"
1620LIBS="-lpthreads  $LIBS"
1621cat > conftest.$ac_ext <<EOF
1622#line 1623 "configure"
1623#include "confdefs.h"
1624/* Override any gcc2 internal prototype to avoid an error.  */
1625/* We use char because int might match the return type of a gcc2
1626    builtin and then its argument prototype would still apply.  */
1627char pthread_mutex_init();
1628
1629int main() {
1630pthread_mutex_init()
1631; return 0; }
1632EOF
1633if { (eval echo configure:1634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1634  rm -rf conftest*
1635  eval "ac_cv_lib_$ac_lib_var=yes"
1636else
1637  echo "configure: failed program was:" >&5
1638  cat conftest.$ac_ext >&5
1639  rm -rf conftest*
1640  eval "ac_cv_lib_$ac_lib_var=no"
1641fi
1642rm -f conftest*
1643LIBS="$ac_save_LIBS"
1644
1645fi
1646if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1647  echo "$ac_t""yes" 1>&6
1648  tcl_ok=yes
1649else
1650  echo "$ac_t""no" 1>&6
1651tcl_ok=no
1652fi
1653
1654	    if test "$tcl_ok" = "yes"; then
1655		# The space is needed
1656		THREADS_LIBS=" -lpthreads"
1657	    else
1658		echo $ac_n "checking for pthread_mutex_init in -lc""... $ac_c" 1>&6
1659echo "configure:1660: checking for pthread_mutex_init in -lc" >&5
1660ac_lib_var=`echo c'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
1661if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1662  echo $ac_n "(cached) $ac_c" 1>&6
1663else
1664  ac_save_LIBS="$LIBS"
1665LIBS="-lc  $LIBS"
1666cat > conftest.$ac_ext <<EOF
1667#line 1668 "configure"
1668#include "confdefs.h"
1669/* Override any gcc2 internal prototype to avoid an error.  */
1670/* We use char because int might match the return type of a gcc2
1671    builtin and then its argument prototype would still apply.  */
1672char pthread_mutex_init();
1673
1674int main() {
1675pthread_mutex_init()
1676; return 0; }
1677EOF
1678if { (eval echo configure:1679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1679  rm -rf conftest*
1680  eval "ac_cv_lib_$ac_lib_var=yes"
1681else
1682  echo "configure: failed program was:" >&5
1683  cat conftest.$ac_ext >&5
1684  rm -rf conftest*
1685  eval "ac_cv_lib_$ac_lib_var=no"
1686fi
1687rm -f conftest*
1688LIBS="$ac_save_LIBS"
1689
1690fi
1691if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1692  echo "$ac_t""yes" 1>&6
1693  tcl_ok=yes
1694else
1695  echo "$ac_t""no" 1>&6
1696tcl_ok=no
1697fi
1698
1699		if test "$tcl_ok" = "no"; then
1700		    echo $ac_n "checking for pthread_mutex_init in -lc_r""... $ac_c" 1>&6
1701echo "configure:1702: checking for pthread_mutex_init in -lc_r" >&5
1702ac_lib_var=`echo c_r'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
1703if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1704  echo $ac_n "(cached) $ac_c" 1>&6
1705else
1706  ac_save_LIBS="$LIBS"
1707LIBS="-lc_r  $LIBS"
1708cat > conftest.$ac_ext <<EOF
1709#line 1710 "configure"
1710#include "confdefs.h"
1711/* Override any gcc2 internal prototype to avoid an error.  */
1712/* We use char because int might match the return type of a gcc2
1713    builtin and then its argument prototype would still apply.  */
1714char pthread_mutex_init();
1715
1716int main() {
1717pthread_mutex_init()
1718; return 0; }
1719EOF
1720if { (eval echo configure:1721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1721  rm -rf conftest*
1722  eval "ac_cv_lib_$ac_lib_var=yes"
1723else
1724  echo "configure: failed program was:" >&5
1725  cat conftest.$ac_ext >&5
1726  rm -rf conftest*
1727  eval "ac_cv_lib_$ac_lib_var=no"
1728fi
1729rm -f conftest*
1730LIBS="$ac_save_LIBS"
1731
1732fi
1733if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1734  echo "$ac_t""yes" 1>&6
1735  tcl_ok=yes
1736else
1737  echo "$ac_t""no" 1>&6
1738tcl_ok=no
1739fi
1740
1741		    if test "$tcl_ok" = "yes"; then
1742			# The space is needed
1743			THREADS_LIBS=" -pthread"
1744		    else
1745			TCL_THREADS=0
1746			echo "configure: warning: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." 1>&2
1747		    fi
1748		fi
1749	    fi
1750	fi
1751
1752	# Does the pthread-implementation provide
1753	# 'pthread_attr_setstacksize' ?
1754
1755	ac_saved_libs=$LIBS
1756	LIBS="$LIBS $THREADS_LIBS"
1757	for ac_func in pthread_attr_setstacksize
1758do
1759echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1760echo "configure:1761: checking for $ac_func" >&5
1761if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1762  echo $ac_n "(cached) $ac_c" 1>&6
1763else
1764  cat > conftest.$ac_ext <<EOF
1765#line 1766 "configure"
1766#include "confdefs.h"
1767/* System header to define __stub macros and hopefully few prototypes,
1768    which can conflict with char $ac_func(); below.  */
1769#include <assert.h>
1770/* Override any gcc2 internal prototype to avoid an error.  */
1771/* We use char because int might match the return type of a gcc2
1772    builtin and then its argument prototype would still apply.  */
1773char $ac_func();
1774
1775int main() {
1776
1777/* The GNU C library defines this for functions which it implements
1778    to always fail with ENOSYS.  Some functions are actually named
1779    something starting with __ and the normal name is an alias.  */
1780#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1781choke me
1782#else
1783$ac_func();
1784#endif
1785
1786; return 0; }
1787EOF
1788if { (eval echo configure:1789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1789  rm -rf conftest*
1790  eval "ac_cv_func_$ac_func=yes"
1791else
1792  echo "configure: failed program was:" >&5
1793  cat conftest.$ac_ext >&5
1794  rm -rf conftest*
1795  eval "ac_cv_func_$ac_func=no"
1796fi
1797rm -f conftest*
1798fi
1799
1800if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1801  echo "$ac_t""yes" 1>&6
1802    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1803  cat >> confdefs.h <<EOF
1804#define $ac_tr_func 1
1805EOF
1806 
1807else
1808  echo "$ac_t""no" 1>&6
1809fi
1810done
1811
1812	for ac_func in pthread_atfork
1813do
1814echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1815echo "configure:1816: checking for $ac_func" >&5
1816if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1817  echo $ac_n "(cached) $ac_c" 1>&6
1818else
1819  cat > conftest.$ac_ext <<EOF
1820#line 1821 "configure"
1821#include "confdefs.h"
1822/* System header to define __stub macros and hopefully few prototypes,
1823    which can conflict with char $ac_func(); below.  */
1824#include <assert.h>
1825/* Override any gcc2 internal prototype to avoid an error.  */
1826/* We use char because int might match the return type of a gcc2
1827    builtin and then its argument prototype would still apply.  */
1828char $ac_func();
1829
1830int main() {
1831
1832/* The GNU C library defines this for functions which it implements
1833    to always fail with ENOSYS.  Some functions are actually named
1834    something starting with __ and the normal name is an alias.  */
1835#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1836choke me
1837#else
1838$ac_func();
1839#endif
1840
1841; return 0; }
1842EOF
1843if { (eval echo configure:1844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1844  rm -rf conftest*
1845  eval "ac_cv_func_$ac_func=yes"
1846else
1847  echo "configure: failed program was:" >&5
1848  cat conftest.$ac_ext >&5
1849  rm -rf conftest*
1850  eval "ac_cv_func_$ac_func=no"
1851fi
1852rm -f conftest*
1853fi
1854
1855if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1856  echo "$ac_t""yes" 1>&6
1857    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1858  cat >> confdefs.h <<EOF
1859#define $ac_tr_func 1
1860EOF
1861 
1862else
1863  echo "$ac_t""no" 1>&6
1864fi
1865done
1866
1867	LIBS=$ac_saved_libs
1868    else
1869	TCL_THREADS=0
1870    fi
1871    # Do checking message here to not mess up interleaved configure output
1872    echo $ac_n "checking for building with threads""... $ac_c" 1>&6
1873echo "configure:1874: checking for building with threads" >&5
1874    if test "${TCL_THREADS}" = 1; then
1875	cat >> confdefs.h <<\EOF
1876#define TCL_THREADS 1
1877EOF
1878
1879	if test "${tcl_threaded_core}" = 1; then
1880	    echo "$ac_t""yes (threaded core)" 1>&6
1881	else
1882	    echo "$ac_t""yes" 1>&6
1883	fi
1884    else
1885	echo "$ac_t""no (default)" 1>&6
1886    fi
1887
1888    
1889
1890
1891#--------------------------------------------------------------------
1892# Look for libraries that we will need when compiling the Tcl shell
1893#--------------------------------------------------------------------
1894
1895
1896    #--------------------------------------------------------------------
1897    # On a few very rare systems, all of the libm.a stuff is
1898    # already in libc.a.  Set compiler flags accordingly.
1899    # Also, Linux requires the "ieee" library for math to work
1900    # right (and it must appear before "-lm").
1901    #--------------------------------------------------------------------
1902
1903    echo $ac_n "checking for sin""... $ac_c" 1>&6
1904echo "configure:1905: checking for sin" >&5
1905if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then
1906  echo $ac_n "(cached) $ac_c" 1>&6
1907else
1908  cat > conftest.$ac_ext <<EOF
1909#line 1910 "configure"
1910#include "confdefs.h"
1911/* System header to define __stub macros and hopefully few prototypes,
1912    which can conflict with char sin(); below.  */
1913#include <assert.h>
1914/* Override any gcc2 internal prototype to avoid an error.  */
1915/* We use char because int might match the return type of a gcc2
1916    builtin and then its argument prototype would still apply.  */
1917char sin();
1918
1919int main() {
1920
1921/* The GNU C library defines this for functions which it implements
1922    to always fail with ENOSYS.  Some functions are actually named
1923    something starting with __ and the normal name is an alias.  */
1924#if defined (__stub_sin) || defined (__stub___sin)
1925choke me
1926#else
1927sin();
1928#endif
1929
1930; return 0; }
1931EOF
1932if { (eval echo configure:1933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1933  rm -rf conftest*
1934  eval "ac_cv_func_sin=yes"
1935else
1936  echo "configure: failed program was:" >&5
1937  cat conftest.$ac_ext >&5
1938  rm -rf conftest*
1939  eval "ac_cv_func_sin=no"
1940fi
1941rm -f conftest*
1942fi
1943
1944if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
1945  echo "$ac_t""yes" 1>&6
1946  MATH_LIBS=""
1947else
1948  echo "$ac_t""no" 1>&6
1949MATH_LIBS="-lm"
1950fi
1951
1952    echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6
1953echo "configure:1954: checking for main in -lieee" >&5
1954ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'`
1955if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1956  echo $ac_n "(cached) $ac_c" 1>&6
1957else
1958  ac_save_LIBS="$LIBS"
1959LIBS="-lieee  $LIBS"
1960cat > conftest.$ac_ext <<EOF
1961#line 1962 "configure"
1962#include "confdefs.h"
1963
1964int main() {
1965main()
1966; return 0; }
1967EOF
1968if { (eval echo configure:1969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1969  rm -rf conftest*
1970  eval "ac_cv_lib_$ac_lib_var=yes"
1971else
1972  echo "configure: failed program was:" >&5
1973  cat conftest.$ac_ext >&5
1974  rm -rf conftest*
1975  eval "ac_cv_lib_$ac_lib_var=no"
1976fi
1977rm -f conftest*
1978LIBS="$ac_save_LIBS"
1979
1980fi
1981if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1982  echo "$ac_t""yes" 1>&6
1983  MATH_LIBS="-lieee $MATH_LIBS"
1984else
1985  echo "$ac_t""no" 1>&6
1986fi
1987
1988
1989    #--------------------------------------------------------------------
1990    # Interactive UNIX requires -linet instead of -lsocket, plus it
1991    # needs net/errno.h to define the socket-related error codes.
1992    #--------------------------------------------------------------------
1993
1994    echo $ac_n "checking for main in -linet""... $ac_c" 1>&6
1995echo "configure:1996: checking for main in -linet" >&5
1996ac_lib_var=`echo inet'_'main | sed 'y%./+-%__p_%'`
1997if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1998  echo $ac_n "(cached) $ac_c" 1>&6
1999else
2000  ac_save_LIBS="$LIBS"
2001LIBS="-linet  $LIBS"
2002cat > conftest.$ac_ext <<EOF
2003#line 2004 "configure"
2004#include "confdefs.h"
2005
2006int main() {
2007main()
2008; return 0; }
2009EOF
2010if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2011  rm -rf conftest*
2012  eval "ac_cv_lib_$ac_lib_var=yes"
2013else
2014  echo "configure: failed program was:" >&5
2015  cat conftest.$ac_ext >&5
2016  rm -rf conftest*
2017  eval "ac_cv_lib_$ac_lib_var=no"
2018fi
2019rm -f conftest*
2020LIBS="$ac_save_LIBS"
2021
2022fi
2023if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2024  echo "$ac_t""yes" 1>&6
2025  LIBS="$LIBS -linet"
2026else
2027  echo "$ac_t""no" 1>&6
2028fi
2029
2030    ac_safe=`echo "net/errno.h" | sed 'y%./+-%__p_%'`
2031echo $ac_n "checking for net/errno.h""... $ac_c" 1>&6
2032echo "configure:2033: checking for net/errno.h" >&5
2033if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2034  echo $ac_n "(cached) $ac_c" 1>&6
2035else
2036  cat > conftest.$ac_ext <<EOF
2037#line 2038 "configure"
2038#include "confdefs.h"
2039#include <net/errno.h>
2040EOF
2041ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2042{ (eval echo configure:2043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2043ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2044if test -z "$ac_err"; then
2045  rm -rf conftest*
2046  eval "ac_cv_header_$ac_safe=yes"
2047else
2048  echo "$ac_err" >&5
2049  echo "configure: failed program was:" >&5
2050  cat conftest.$ac_ext >&5
2051  rm -rf conftest*
2052  eval "ac_cv_header_$ac_safe=no"
2053fi
2054rm -f conftest*
2055fi
2056if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2057  echo "$ac_t""yes" 1>&6
2058  cat >> confdefs.h <<\EOF
2059#define HAVE_NET_ERRNO_H 1
2060EOF
2061
2062else
2063  echo "$ac_t""no" 1>&6
2064fi
2065
2066
2067    #--------------------------------------------------------------------
2068    #	Check for the existence of the -lsocket and -lnsl libraries.
2069    #	The order here is important, so that they end up in the right
2070    #	order in the command line generated by make.  Here are some
2071    #	special considerations:
2072    #	1. Use "connect" and "accept" to check for -lsocket, and
2073    #	   "gethostbyname" to check for -lnsl.
2074    #	2. Use each function name only once:  can't redo a check because
2075    #	   autoconf caches the results of the last check and won't redo it.
2076    #	3. Use -lnsl and -lsocket only if they supply procedures that
2077    #	   aren't already present in the normal libraries.  This is because
2078    #	   IRIX 5.2 has libraries, but they aren't needed and they're
2079    #	   bogus:  they goof up name resolution if used.
2080    #	4. On some SVR4 systems, can't use -lsocket without -lnsl too.
2081    #	   To get around this problem, check for both libraries together
2082    #	   if -lsocket doesn't work by itself.
2083    #--------------------------------------------------------------------
2084
2085    tcl_checkBoth=0
2086    echo $ac_n "checking for connect""... $ac_c" 1>&6
2087echo "configure:2088: checking for connect" >&5
2088if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
2089  echo $ac_n "(cached) $ac_c" 1>&6
2090else
2091  cat > conftest.$ac_ext <<EOF
2092#line 2093 "configure"
2093#include "confdefs.h"
2094/* System header to define __stub macros and hopefully few prototypes,
2095    which can conflict with char connect(); below.  */
2096#include <assert.h>
2097/* Override any gcc2 internal prototype to avoid an error.  */
2098/* We use char because int might match the return type of a gcc2
2099    builtin and then its argument prototype would still apply.  */
2100char connect();
2101
2102int main() {
2103
2104/* The GNU C library defines this for functions which it implements
2105    to always fail with ENOSYS.  Some functions are actually named
2106    something starting with __ and the normal name is an alias.  */
2107#if defined (__stub_connect) || defined (__stub___connect)
2108choke me
2109#else
2110connect();
2111#endif
2112
2113; return 0; }
2114EOF
2115if { (eval echo configure:2116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2116  rm -rf conftest*
2117  eval "ac_cv_func_connect=yes"
2118else
2119  echo "configure: failed program was:" >&5
2120  cat conftest.$ac_ext >&5
2121  rm -rf conftest*
2122  eval "ac_cv_func_connect=no"
2123fi
2124rm -f conftest*
2125fi
2126
2127if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
2128  echo "$ac_t""yes" 1>&6
2129  tcl_checkSocket=0
2130else
2131  echo "$ac_t""no" 1>&6
2132tcl_checkSocket=1
2133fi
2134
2135    if test "$tcl_checkSocket" = 1; then
2136	echo $ac_n "checking for setsockopt""... $ac_c" 1>&6
2137echo "configure:2138: checking for setsockopt" >&5
2138if eval "test \"`echo '$''{'ac_cv_func_setsockopt'+set}'`\" = set"; then
2139  echo $ac_n "(cached) $ac_c" 1>&6
2140else
2141  cat > conftest.$ac_ext <<EOF
2142#line 2143 "configure"
2143#include "confdefs.h"
2144/* System header to define __stub macros and hopefully few prototypes,
2145    which can conflict with char setsockopt(); below.  */
2146#include <assert.h>
2147/* Override any gcc2 internal prototype to avoid an error.  */
2148/* We use char because int might match the return type of a gcc2
2149    builtin and then its argument prototype would still apply.  */
2150char setsockopt();
2151
2152int main() {
2153
2154/* The GNU C library defines this for functions which it implements
2155    to always fail with ENOSYS.  Some functions are actually named
2156    something starting with __ and the normal name is an alias.  */
2157#if defined (__stub_setsockopt) || defined (__stub___setsockopt)
2158choke me
2159#else
2160setsockopt();
2161#endif
2162
2163; return 0; }
2164EOF
2165if { (eval echo configure:2166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2166  rm -rf conftest*
2167  eval "ac_cv_func_setsockopt=yes"
2168else
2169  echo "configure: failed program was:" >&5
2170  cat conftest.$ac_ext >&5
2171  rm -rf conftest*
2172  eval "ac_cv_func_setsockopt=no"
2173fi
2174rm -f conftest*
2175fi
2176
2177if eval "test \"`echo '$ac_cv_func_'setsockopt`\" = yes"; then
2178  echo "$ac_t""yes" 1>&6
2179  :
2180else
2181  echo "$ac_t""no" 1>&6
2182echo $ac_n "checking for setsockopt in -lsocket""... $ac_c" 1>&6
2183echo "configure:2184: checking for setsockopt in -lsocket" >&5
2184ac_lib_var=`echo socket'_'setsockopt | sed 'y%./+-%__p_%'`
2185if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2186  echo $ac_n "(cached) $ac_c" 1>&6
2187else
2188  ac_save_LIBS="$LIBS"
2189LIBS="-lsocket  $LIBS"
2190cat > conftest.$ac_ext <<EOF
2191#line 2192 "configure"
2192#include "confdefs.h"
2193/* Override any gcc2 internal prototype to avoid an error.  */
2194/* We use char because int might match the return type of a gcc2
2195    builtin and then its argument prototype would still apply.  */
2196char setsockopt();
2197
2198int main() {
2199setsockopt()
2200; return 0; }
2201EOF
2202if { (eval echo configure:2203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2203  rm -rf conftest*
2204  eval "ac_cv_lib_$ac_lib_var=yes"
2205else
2206  echo "configure: failed program was:" >&5
2207  cat conftest.$ac_ext >&5
2208  rm -rf conftest*
2209  eval "ac_cv_lib_$ac_lib_var=no"
2210fi
2211rm -f conftest*
2212LIBS="$ac_save_LIBS"
2213
2214fi
2215if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2216  echo "$ac_t""yes" 1>&6
2217  LIBS="$LIBS -lsocket"
2218else
2219  echo "$ac_t""no" 1>&6
2220tcl_checkBoth=1
2221fi
2222
2223fi
2224
2225    fi
2226    if test "$tcl_checkBoth" = 1; then
2227	tk_oldLibs=$LIBS
2228	LIBS="$LIBS -lsocket -lnsl"
2229	echo $ac_n "checking for accept""... $ac_c" 1>&6
2230echo "configure:2231: checking for accept" >&5
2231if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
2232  echo $ac_n "(cached) $ac_c" 1>&6
2233else
2234  cat > conftest.$ac_ext <<EOF
2235#line 2236 "configure"
2236#include "confdefs.h"
2237/* System header to define __stub macros and hopefully few prototypes,
2238    which can conflict with char accept(); below.  */
2239#include <assert.h>
2240/* Override any gcc2 internal prototype to avoid an error.  */
2241/* We use char because int might match the return type of a gcc2
2242    builtin and then its argument prototype would still apply.  */
2243char accept();
2244
2245int main() {
2246
2247/* The GNU C library defines this for functions which it implements
2248    to always fail with ENOSYS.  Some functions are actually named
2249    something starting with __ and the normal name is an alias.  */
2250#if defined (__stub_accept) || defined (__stub___accept)
2251choke me
2252#else
2253accept();
2254#endif
2255
2256; return 0; }
2257EOF
2258if { (eval echo configure:2259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2259  rm -rf conftest*
2260  eval "ac_cv_func_accept=yes"
2261else
2262  echo "configure: failed program was:" >&5
2263  cat conftest.$ac_ext >&5
2264  rm -rf conftest*
2265  eval "ac_cv_func_accept=no"
2266fi
2267rm -f conftest*
2268fi
2269
2270if eval "test \"`echo '$ac_cv_func_'accept`\" = yes"; then
2271  echo "$ac_t""yes" 1>&6
2272  tcl_checkNsl=0
2273else
2274  echo "$ac_t""no" 1>&6
2275LIBS=$tk_oldLibs
2276fi
2277
2278    fi
2279    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
2280echo "configure:2281: checking for gethostbyname" >&5
2281if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
2282  echo $ac_n "(cached) $ac_c" 1>&6
2283else
2284  cat > conftest.$ac_ext <<EOF
2285#line 2286 "configure"
2286#include "confdefs.h"
2287/* System header to define __stub macros and hopefully few prototypes,
2288    which can conflict with char gethostbyname(); below.  */
2289#include <assert.h>
2290/* Override any gcc2 internal prototype to avoid an error.  */
2291/* We use char because int might match the return type of a gcc2
2292    builtin and then its argument prototype would still apply.  */
2293char gethostbyname();
2294
2295int main() {
2296
2297/* The GNU C library defines this for functions which it implements
2298    to always fail with ENOSYS.  Some functions are actually named
2299    something starting with __ and the normal name is an alias.  */
2300#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
2301choke me
2302#else
2303gethostbyname();
2304#endif
2305
2306; return 0; }
2307EOF
2308if { (eval echo configure:2309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2309  rm -rf conftest*
2310  eval "ac_cv_func_gethostbyname=yes"
2311else
2312  echo "configure: failed program was:" >&5
2313  cat conftest.$ac_ext >&5
2314  rm -rf conftest*
2315  eval "ac_cv_func_gethostbyname=no"
2316fi
2317rm -f conftest*
2318fi
2319
2320if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
2321  echo "$ac_t""yes" 1>&6
2322  :
2323else
2324  echo "$ac_t""no" 1>&6
2325echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
2326echo "configure:2327: checking for gethostbyname in -lnsl" >&5
2327ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
2328if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2329  echo $ac_n "(cached) $ac_c" 1>&6
2330else
2331  ac_save_LIBS="$LIBS"
2332LIBS="-lnsl  $LIBS"
2333cat > conftest.$ac_ext <<EOF
2334#line 2335 "configure"
2335#include "confdefs.h"
2336/* Override any gcc2 internal prototype to avoid an error.  */
2337/* We use char because int might match the return type of a gcc2
2338    builtin and then its argument prototype would still apply.  */
2339char gethostbyname();
2340
2341int main() {
2342gethostbyname()
2343; return 0; }
2344EOF
2345if { (eval echo configure:2346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2346  rm -rf conftest*
2347  eval "ac_cv_lib_$ac_lib_var=yes"
2348else
2349  echo "configure: failed program was:" >&5
2350  cat conftest.$ac_ext >&5
2351  rm -rf conftest*
2352  eval "ac_cv_lib_$ac_lib_var=no"
2353fi
2354rm -f conftest*
2355LIBS="$ac_save_LIBS"
2356
2357fi
2358if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2359  echo "$ac_t""yes" 1>&6
2360  LIBS="$LIBS -lnsl"
2361else
2362  echo "$ac_t""no" 1>&6
2363fi
2364
2365fi
2366
2367
2368    # Don't perform the eval of the libraries here because DL_LIBS
2369    # won't be set until we call SC_CONFIG_CFLAGS
2370
2371    TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
2372    
2373    
2374
2375
2376# Add the threads support libraries
2377LIBS="$LIBS$THREADS_LIBS"
2378
2379
2380    echo $ac_n "checking how to build libraries""... $ac_c" 1>&6
2381echo "configure:2382: checking how to build libraries" >&5
2382    # Check whether --enable-shared or --disable-shared was given.
2383if test "${enable_shared+set}" = set; then
2384  enableval="$enable_shared"
2385  tcl_ok=$enableval
2386else
2387  tcl_ok=yes
2388fi
2389
2390
2391    if test "${enable_shared+set}" = set; then
2392	enableval="$enable_shared"
2393	tcl_ok=$enableval
2394    else
2395	tcl_ok=yes
2396    fi
2397
2398    if test "$tcl_ok" = "yes" ; then
2399	echo "$ac_t""shared" 1>&6
2400	SHARED_BUILD=1
2401    else
2402	echo "$ac_t""static" 1>&6
2403	SHARED_BUILD=0
2404	cat >> confdefs.h <<\EOF
2405#define STATIC_BUILD 1
2406EOF
2407
2408    fi
2409
2410
2411#--------------------------------------------------------------------
2412# The statements below define a collection of compile flags.  This
2413# macro depends on the value of SHARED_BUILD, and should be called
2414# after SC_ENABLE_SHARED checks the configure switches.
2415#--------------------------------------------------------------------
2416
2417# Extract the first word of "ranlib", so it can be a program name with args.
2418set dummy ranlib; ac_word=$2
2419echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2420echo "configure:2421: checking for $ac_word" >&5
2421if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
2422  echo $ac_n "(cached) $ac_c" 1>&6
2423else
2424  if test -n "$RANLIB"; then
2425  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2426else
2427  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
2428  ac_dummy="$PATH"
2429  for ac_dir in $ac_dummy; do
2430    test -z "$ac_dir" && ac_dir=.
2431    if test -f $ac_dir/$ac_word; then
2432      ac_cv_prog_RANLIB="ranlib"
2433      break
2434    fi
2435  done
2436  IFS="$ac_save_ifs"
2437  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2438fi
2439fi
2440RANLIB="$ac_cv_prog_RANLIB"
2441if test -n "$RANLIB"; then
2442  echo "$ac_t""$RANLIB" 1>&6
2443else
2444  echo "$ac_t""no" 1>&6
2445fi
2446
2447
2448
2449    # Step 0.a: Enable 64 bit support?
2450
2451    echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6
2452echo "configure:2453: checking if 64bit support is requested" >&5
2453    # Check whether --enable-64bit or --disable-64bit was given.
2454if test "${enable_64bit+set}" = set; then
2455  enableval="$enable_64bit"
2456  do64bit=$enableval
2457else
2458  do64bit=no
2459fi
2460
2461    echo "$ac_t""$do64bit" 1>&6
2462
2463    # Step 0.b: Enable Solaris 64 bit VIS support?
2464
2465    echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6
2466echo "configure:2467: checking if 64bit Sparc VIS support is requested" >&5
2467    # Check whether --enable-64bit-vis or --disable-64bit-vis was given.
2468if test "${enable_64bit_vis+set}" = set; then
2469  enableval="$enable_64bit_vis"
2470  do64bitVIS=$enableval
2471else
2472  do64bitVIS=no
2473fi
2474
2475    echo "$ac_t""$do64bitVIS" 1>&6
2476
2477    if test "$do64bitVIS" = "yes"; then
2478	# Force 64bit on with VIS
2479	do64bit=yes
2480    fi
2481
2482    # Step 1: set the variable "system" to hold the name and version number
2483    # for the system.
2484
2485    
2486    echo $ac_n "checking system version""... $ac_c" 1>&6
2487echo "configure:2488: checking system version" >&5
2488if eval "test \"`echo '$''{'tcl_cv_sys_version'+set}'`\" = set"; then
2489  echo $ac_n "(cached) $ac_c" 1>&6
2490else
2491  
2492	if test -f /usr/lib/NextStep/software_version; then
2493	    tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
2494	else
2495	    tcl_cv_sys_version=`uname -s`-`uname -r`
2496	    if test "$?" -ne 0 ; then
2497		echo "configure: warning: can't find uname command" 1>&2
2498		tcl_cv_sys_version=unknown
2499	    else
2500		# Special check for weird MP-RAS system (uname returns weird
2501		# results, and the version is kept in special file).
2502
2503		if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
2504		    tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid`
2505		fi
2506		if test "`uname -s`" = "AIX" ; then
2507		    tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
2508		fi
2509	    fi
2510	fi
2511    
2512fi
2513
2514echo "$ac_t""$tcl_cv_sys_version" 1>&6
2515    system=$tcl_cv_sys_version
2516
2517
2518    # Step 2: check for existence of -ldl library.  This is needed because
2519    # Linux can use either -ldl or -ldld for dynamic loading.
2520
2521    echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
2522echo "configure:2523: checking for dlopen in -ldl" >&5
2523ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
2524if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2525  echo $ac_n "(cached) $ac_c" 1>&6
2526else
2527  ac_save_LIBS="$LIBS"
2528LIBS="-ldl  $LIBS"
2529cat > conftest.$ac_ext <<EOF
2530#line 2531 "configure"
2531#include "confdefs.h"
2532/* Override any gcc2 internal prototype to avoid an error.  */
2533/* We use char because int might match the return type of a gcc2
2534    builtin and then its argument prototype would still apply.  */
2535char dlopen();
2536
2537int main() {
2538dlopen()
2539; return 0; }
2540EOF
2541if { (eval echo configure:2542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2542  rm -rf conftest*
2543  eval "ac_cv_lib_$ac_lib_var=yes"
2544else
2545  echo "configure: failed program was:" >&5
2546  cat conftest.$ac_ext >&5
2547  rm -rf conftest*
2548  eval "ac_cv_lib_$ac_lib_var=no"
2549fi
2550rm -f conftest*
2551LIBS="$ac_save_LIBS"
2552
2553fi
2554if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2555  echo "$ac_t""yes" 1>&6
2556  have_dl=yes
2557else
2558  echo "$ac_t""no" 1>&6
2559have_dl=no
2560fi
2561
2562
2563    # Require ranlib early so we can override it in special cases below.
2564
2565    
2566
2567    # Step 3: set configuration options based on system name and version.
2568
2569    do64bit_ok=no
2570    LDFLAGS_ORIG="$LDFLAGS"
2571    TCL_EXPORT_FILE_SUFFIX=""
2572    UNSHARED_LIB_SUFFIX=""
2573    TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
2574    ECHO_VERSION='`echo ${VERSION}`'
2575    TCL_LIB_VERSIONS_OK=ok
2576    CFLAGS_DEBUG=-g
2577    CFLAGS_OPTIMIZE=-O
2578    if test "$GCC" = "yes" ; then
2579	CFLAGS_WARNING="-Wall -fno-strict-aliasing"
2580    else
2581	CFLAGS_WARNING=""
2582    fi
2583    TCL_NEEDS_EXP_FILE=0
2584    TCL_BUILD_EXP_FILE=""
2585    TCL_EXP_FILE=""
2586    # Extract the first word of "ar", so it can be a program name with args.
2587set dummy ar; ac_word=$2
2588echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2589echo "configure:2590: checking for $ac_word" >&5
2590if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
2591  echo $ac_n "(cached) $ac_c" 1>&6
2592else
2593  if test -n "$AR"; then
2594  ac_cv_prog_AR="$AR" # Let the user override the test.
2595else
2596  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
2597  ac_dummy="$PATH"
2598  for ac_dir in $ac_dummy; do
2599    test -z "$ac_dir" && ac_dir=.
2600    if test -f $ac_dir/$ac_word; then
2601      ac_cv_prog_AR="ar"
2602      break
2603    fi
2604  done
2605  IFS="$ac_save_ifs"
2606fi
2607fi
2608AR="$ac_cv_prog_AR"
2609if test -n "$AR"; then
2610  echo "$ac_t""$AR" 1>&6
2611else
2612  echo "$ac_t""no" 1>&6
2613fi
2614
2615    if test "${AR}" = "" ; then
2616	{ echo "configure: error: Required archive tool 'ar' not found on PATH." 1>&2; exit 1; }
2617    fi
2618    STLIB_LD='${AR} cr'
2619    LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
2620    PLAT_OBJS=""
2621    PLAT_SRCS=""
2622    case $system in
2623	AIX-*)
2624	    if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
2625		# AIX requires the _r compiler when gcc isn't being used
2626		case "${CC}" in
2627		    *_r|*_r\ *)
2628			# ok ...
2629			;;
2630		    *)
2631			# Make sure only first arg gets _r
2632		    	CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'`
2633			;;
2634		esac
2635		echo "$ac_t""Using $CC for compiling with threads" 1>&6
2636	    fi
2637	    LIBS="$LIBS -lc"
2638	    SHLIB_CFLAGS=""
2639	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
2640	    # symbols when dynamically loaded into tclsh.
2641	    SHLIB_LD_LIBS='${LIBS}'
2642	    SHLIB_SUFFIX=".so"
2643
2644	    DL_OBJS="tclLoadDl.o"
2645	    LD_LIBRARY_PATH_VAR="LIBPATH"
2646
2647	    # Check to enable 64-bit flags for compiler/linker on AIX 4+
2648	    if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
2649		if test "$GCC" = "yes" ; then
2650		    echo "configure: warning: 64bit mode not supported with GCC on $system" 1>&2
2651		else 
2652		    do64bit_ok=yes
2653		    CFLAGS="$CFLAGS -q64"
2654		    LDFLAGS="$LDFLAGS -q64"
2655		    RANLIB="${RANLIB} -X64"
2656		    AR="${AR} -X64"
2657		    SHLIB_LD_FLAGS="-b64"
2658		fi
2659	    fi
2660
2661	    if test "`uname -m`" = "ia64" ; then
2662		# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
2663		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
2664		# AIX-5 has dl* in libc.so
2665		DL_LIBS=""
2666		if test "$GCC" = "yes" ; then
2667		    CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
2668		else
2669		    CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
2670		fi
2671		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
2672	    else
2673		if test "$GCC" = "yes" ; then
2674		    SHLIB_LD="gcc -shared"
2675		else
2676		    SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
2677		fi
2678		SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
2679		DL_LIBS="-ldl"
2680		CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
2681		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2682		TCL_NEEDS_EXP_FILE=1
2683		TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
2684	    fi
2685
2686	    # AIX v<=4.1 has some different flags than 4.2+
2687	    if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
2688		LIBOBJS="$LIBOBJS tclLoadAix.o"
2689		DL_LIBS="-lld"
2690	    fi
2691
2692	    # On AIX <=v4 systems, libbsd.a has to be linked in to support
2693	    # non-blocking file IO.  This library has to be linked in after
2694	    # the MATH_LIBS or it breaks the pow() function.  The way to
2695	    # insure proper sequencing, is to add it to the tail of MATH_LIBS.
2696	    # This library also supplies gettimeofday.
2697	    #
2698	    # AIX does not have a timezone field in struct tm. When the AIX
2699	    # bsd library is used, the timezone global and the gettimeofday
2700	    # methods are to be avoided for timezone deduction instead, we
2701	    # deduce the timezone by comparing the localtime result on a
2702	    # known GMT value.
2703
2704	    echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
2705echo "configure:2706: checking for gettimeofday in -lbsd" >&5
2706ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
2707if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2708  echo $ac_n "(cached) $ac_c" 1>&6
2709else
2710  ac_save_LIBS="$LIBS"
2711LIBS="-lbsd  $LIBS"
2712cat > conftest.$ac_ext <<EOF
2713#line 2714 "configure"
2714#include "confdefs.h"
2715/* Override any gcc2 internal prototype to avoid an error.  */
2716/* We use char because int might match the return type of a gcc2
2717    builtin and then its argument prototype would still apply.  */
2718char gettimeofday();
2719
2720int main() {
2721gettimeofday()
2722; return 0; }
2723EOF
2724if { (eval echo configure:2725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2725  rm -rf conftest*
2726  eval "ac_cv_lib_$ac_lib_var=yes"
2727else
2728  echo "configure: failed program was:" >&5
2729  cat conftest.$ac_ext >&5
2730  rm -rf conftest*
2731  eval "ac_cv_lib_$ac_lib_var=no"
2732fi
2733rm -f conftest*
2734LIBS="$ac_save_LIBS"
2735
2736fi
2737if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2738  echo "$ac_t""yes" 1>&6
2739  libbsd=yes
2740else
2741  echo "$ac_t""no" 1>&6
2742libbsd=no
2743fi
2744
2745	    if test $libbsd = yes; then
2746	    	MATH_LIBS="$MATH_LIBS -lbsd"
2747	    	cat >> confdefs.h <<\EOF
2748#define USE_DELTA_FOR_TZ 1
2749EOF
2750
2751	    fi
2752	    ;;
2753	BeOS*)
2754	    SHLIB_CFLAGS="-fPIC"
2755	    SHLIB_LD="${CC} -nostart"
2756	    SHLIB_LD_LIBS='${LIBS}'
2757	    SHLIB_SUFFIX=".so"
2758	    DL_OBJS="tclLoadDl.o"
2759	    DL_LIBS="-ldl"
2760
2761	    #-----------------------------------------------------------
2762	    # Check for inet_ntoa in -lbind, for BeOS (which also needs
2763	    # -lsocket, even if the network functions are in -lnet which
2764	    # is always linked to, for compatibility.
2765	    #-----------------------------------------------------------
2766	    echo $ac_n "checking for inet_ntoa in -lbind""... $ac_c" 1>&6
2767echo "configure:2768: checking for inet_ntoa in -lbind" >&5
2768ac_lib_var=`echo bind'_'inet_ntoa | sed 'y%./+-%__p_%'`
2769if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2770  echo $ac_n "(cached) $ac_c" 1>&6
2771else
2772  ac_save_LIBS="$LIBS"
2773LIBS="-lbind  $LIBS"
2774cat > conftest.$ac_ext <<EOF
2775#line 2776 "configure"
2776#include "confdefs.h"
2777/* Override any gcc2 internal prototype to avoid an error.  */
2778/* We use char because int might match the return type of a gcc2
2779    builtin and then its argument prototype would still apply.  */
2780char inet_ntoa();
2781
2782int main() {
2783inet_ntoa()
2784; return 0; }
2785EOF
2786if { (eval echo configure:2787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2787  rm -rf conftest*
2788  eval "ac_cv_lib_$ac_lib_var=yes"
2789else
2790  echo "configure: failed program was:" >&5
2791  cat conftest.$ac_ext >&5
2792  rm -rf conftest*
2793  eval "ac_cv_lib_$ac_lib_var=no"
2794fi
2795rm -f conftest*
2796LIBS="$ac_save_LIBS"
2797
2798fi
2799if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2800  echo "$ac_t""yes" 1>&6
2801  LIBS="$LIBS -lbind -lsocket"
2802else
2803  echo "$ac_t""no" 1>&6
2804fi
2805
2806	    ;;
2807	BSD/OS-2.1*|BSD/OS-3*)
2808	    SHLIB_CFLAGS=""
2809	    SHLIB_LD="shlicc -r"
2810	    SHLIB_LD_LIBS='${LIBS}'
2811	    SHLIB_SUFFIX=".so"
2812	    DL_OBJS="tclLoadDl.o"
2813	    DL_LIBS="-ldl"
2814	    CC_SEARCH_FLAGS=""
2815	    LD_SEARCH_FLAGS=""
2816	    ;;
2817	BSD/OS-4.*)
2818	    SHLIB_CFLAGS="-export-dynamic -fPIC"
2819	    SHLIB_LD="cc -shared"
2820	    SHLIB_LD_LIBS='${LIBS}'
2821	    SHLIB_SUFFIX=".so"
2822	    DL_OBJS="tclLoadDl.o"
2823	    DL_LIBS="-ldl"
2824	    LDFLAGS="$LDFLAGS -export-dynamic"
2825	    CC_SEARCH_FLAGS=""
2826	    LD_SEARCH_FLAGS=""
2827	    ;;
2828	dgux*)
2829	    SHLIB_CFLAGS="-K PIC"
2830	    SHLIB_LD="cc -G"
2831	    SHLIB_LD_LIBS=""
2832	    SHLIB_SUFFIX=".so"
2833	    DL_OBJS="tclLoadDl.o"
2834	    DL_LIBS="-ldl"
2835	    CC_SEARCH_FLAGS=""
2836	    LD_SEARCH_FLAGS=""
2837	    ;;
2838	HP-UX-*.11.*)
2839	    # Use updated header definitions where possible
2840	    cat >> confdefs.h <<\EOF
2841#define _XOPEN_SOURCE 1
2842EOF
2843          # Use the XOPEN network library
2844	    cat >> confdefs.h <<\EOF
2845#define _XOPEN_SOURCE_EXTENDED 1
2846EOF
2847 # Use the XOPEN network library
2848	    LIBS="$LIBS -lxnet"               # Use the XOPEN network library
2849
2850	    if test "`uname -m`" = "ia64" ; then
2851		SHLIB_SUFFIX=".so"
2852	    else
2853		SHLIB_SUFFIX=".sl"
2854	    fi
2855	    echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
2856echo "configure:2857: checking for shl_load in -ldld" >&5
2857ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
2858if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2859  echo $ac_n "(cached) $ac_c" 1>&6
2860else
2861  ac_save_LIBS="$LIBS"
2862LIBS="-ldld  $LIBS"
2863cat > conftest.$ac_ext <<EOF
2864#line 2865 "configure"
2865#include "confdefs.h"
2866/* Override any gcc2 internal prototype to avoid an error.  */
2867/* We use char because int might match the return type of a gcc2
2868    builtin and then its argument prototype would still apply.  */
2869char shl_load();
2870
2871int main() {
2872shl_load()
2873; return 0; }
2874EOF
2875if { (eval echo configure:2876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2876  rm -rf conftest*
2877  eval "ac_cv_lib_$ac_lib_var=yes"
2878else
2879  echo "configure: failed program was:" >&5
2880  cat conftest.$ac_ext >&5
2881  rm -rf conftest*
2882  eval "ac_cv_lib_$ac_lib_var=no"
2883fi
2884rm -f conftest*
2885LIBS="$ac_save_LIBS"
2886
2887fi
2888if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2889  echo "$ac_t""yes" 1>&6
2890  tcl_ok=yes
2891else
2892  echo "$ac_t""no" 1>&6
2893tcl_ok=no
2894fi
2895
2896	    if test "$tcl_ok" = yes; then
2897		SHLIB_CFLAGS="+z"
2898		SHLIB_LD="ld -b"
2899		SHLIB_LD_LIBS='${LIBS}'
2900		DL_OBJS="tclLoadShl.o"
2901		DL_LIBS="-ldld"
2902		LDFLAGS="$LDFLAGS -Wl,-E"
2903		CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
2904		LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
2905		LD_LIBRARY_PATH_VAR="SHLIB_PATH"
2906	    fi
2907	    if test "$GCC" = "yes" ; then
2908		SHLIB_LD="gcc -shared"
2909		SHLIB_LD_LIBS='${LIBS}'
2910		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2911	    fi
2912
2913	    # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
2914	    #CFLAGS="$CFLAGS +DAportable"
2915
2916	    # Check to enable 64-bit flags for compiler/linker
2917	    if test "$do64bit" = "yes" ; then
2918		if test "$GCC" = "yes" ; then
2919		    hpux_arch=`${CC} -dumpmachine`
2920		    case $hpux_arch in
2921			hppa64*)
2922			    # 64-bit gcc in use.  Fix flags for GNU ld.
2923			    do64bit_ok=yes
2924			    SHLIB_LD="${CC} -shared"
2925			    SHLIB_LD_LIBS='${LIBS}'
2926			    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2927			    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2928			    ;;
2929			*)
2930			    echo "configure: warning: 64bit mode not supported with GCC on $system" 1>&2
2931			    ;;
2932		    esac
2933		else
2934		    do64bit_ok=yes
2935		    CFLAGS="$CFLAGS +DD64"
2936		    LDFLAGS="$LDFLAGS +DD64"
2937		fi
2938	    fi
2939	    ;;
2940	HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
2941	    SHLIB_SUFFIX=".sl"
2942	    echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
2943echo "configure:2944: checking for shl_load in -ldld" >&5
2944ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
2945if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2946  echo $ac_n "(cached) $ac_c" 1>&6
2947else
2948  ac_save_LIBS="$LIBS"
2949LIBS="-ldld  $LIBS"
2950cat > conftest.$ac_ext <<EOF
2951#line 2952 "configure"
2952#include "confdefs.h"
2953/* Override any gcc2 internal prototype to avoid an error.  */
2954/* We use char because int might match the return type of a gcc2
2955    builtin and then its argument prototype would still apply.  */
2956char shl_load();
2957
2958int main() {
2959shl_load()
2960; return 0; }
2961EOF
2962if { (eval echo configure:2963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2963  rm -rf conftest*
2964  eval "ac_cv_lib_$ac_lib_var=yes"
2965else
2966  echo "configure: failed program was:" >&5
2967  cat conftest.$ac_ext >&5
2968  rm -rf conftest*
2969  eval "ac_cv_lib_$ac_lib_var=no"
2970fi
2971rm -f conftest*
2972LIBS="$ac_save_LIBS"
2973
2974fi
2975if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2976  echo "$ac_t""yes" 1>&6
2977  tcl_ok=yes
2978else
2979  echo "$ac_t""no" 1>&6
2980tcl_ok=no
2981fi
2982
2983	    if test "$tcl_ok" = yes; then
2984		SHLIB_CFLAGS="+z"
2985		SHLIB_LD="ld -b"
2986		SHLIB_LD_LIBS=""
2987		DL_OBJS="tclLoadShl.o"
2988		DL_LIBS="-ldld"
2989		LDFLAGS="$LDFLAGS -Wl,-E"
2990		CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
2991		LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
2992		LD_LIBRARY_PATH_VAR="SHLIB_PATH"
2993	    fi
2994	    ;;
2995	IRIX-4.*)
2996	    SHLIB_CFLAGS="-G 0"
2997	    SHLIB_SUFFIX=".a"
2998	    SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
2999	    SHLIB_LD_LIBS='${LIBS}'
3000	    DL_OBJS="tclLoadAout.o"
3001	    DL_LIBS=""
3002	    LDFLAGS="$LDFLAGS -Wl,-D,08000000"
3003	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
3004	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3005	    SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
3006	    ;;
3007	IRIX-5.*)
3008	    SHLIB_CFLAGS=""
3009	    SHLIB_LD="ld -shared -rdata_shared"
3010	    SHLIB_LD_LIBS='${LIBS}'
3011	    SHLIB_SUFFIX=".so"
3012	    DL_OBJS="tclLoadDl.o"
3013	    DL_LIBS=""
3014	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3015	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
3016	    ;;
3017	IRIX-6.*)
3018	    SHLIB_CFLAGS=""
3019	    SHLIB_LD="ld -n32 -shared -rdata_shared"
3020	    SHLIB_LD_LIBS='${LIBS}'
3021	    SHLIB_SUFFIX=".so"
3022	    DL_OBJS="tclLoadDl.o"
3023	    DL_LIBS=""
3024	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3025	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
3026	    if test "$GCC" = "yes" ; then
3027		CFLAGS="$CFLAGS -mabi=n32"
3028		LDFLAGS="$LDFLAGS -mabi=n32"
3029	    else
3030		case $system in
3031		    IRIX-6.3)
3032			# Use to build 6.2 compatible binaries on 6.3.
3033			CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
3034			;;
3035		    *)
3036			CFLAGS="$CFLAGS -n32"
3037			;;
3038		esac
3039		LDFLAGS="$LDFLAGS -n32"
3040	    fi
3041	    ;;
3042	IRIX64-6.*)
3043	    SHLIB_CFLAGS=""
3044	    SHLIB_LD="ld -n32 -shared -rdata_shared"
3045	    SHLIB_LD_LIBS='${LIBS}'
3046	    SHLIB_SUFFIX=".so"
3047	    DL_OBJS="tclLoadDl.o"
3048	    DL_LIBS=""
3049	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3050	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
3051
3052	    # Check to enable 64-bit flags for compiler/linker
3053
3054	    if test "$do64bit" = "yes" ; then
3055	        if test "$GCC" = "yes" ; then
3056	            echo "configure: warning: 64bit mode not supported by gcc" 1>&2
3057	        else
3058	            do64bit_ok=yes
3059	            SHLIB_LD="ld -64 -shared -rdata_shared"
3060	            CFLAGS="$CFLAGS -64"
3061	            LDFLAGS="$LDFLAGS -64"
3062	        fi
3063	    fi
3064	    ;;
3065	Linux*)
3066	    SHLIB_CFLAGS="-fPIC"
3067	    SHLIB_LD_LIBS='${LIBS}'
3068	    SHLIB_SUFFIX=".so"
3069
3070	    CFLAGS_OPTIMIZE=-O2
3071	    # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings 
3072	    # when you inline the string and math operations.  Turn this off to
3073	    # get rid of the warnings.
3074	    #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
3075
3076	    if test "$have_dl" = yes; then
3077		SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
3078		DL_OBJS="tclLoadDl.o"
3079		DL_LIBS="-ldl"
3080		LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
3081		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3082		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3083	    else
3084		ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'`
3085echo $ac_n "checking for dld.h""... $ac_c" 1>&6
3086echo "configure:3087: checking for dld.h" >&5
3087if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3088  echo $ac_n "(cached) $ac_c" 1>&6
3089else
3090  cat > conftest.$ac_ext <<EOF
3091#line 3092 "configure"
3092#include "confdefs.h"
3093#include <dld.h>
3094EOF
3095ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3096{ (eval echo configure:3097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3097ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3098if test -z "$ac_err"; then
3099  rm -rf conftest*
3100  eval "ac_cv_header_$ac_safe=yes"
3101else
3102  echo "$ac_err" >&5
3103  echo "configure: failed program was:" >&5
3104  cat conftest.$ac_ext >&5
3105  rm -rf conftest*
3106  eval "ac_cv_header_$ac_safe=no"
3107fi
3108rm -f conftest*
3109fi
3110if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3111  echo "$ac_t""yes" 1>&6
3112  
3113		    SHLIB_LD="ld -shared"
3114		    DL_OBJS="tclLoadDld.o"
3115		    DL_LIBS="-ldld"
3116		    CC_SEARCH_FLAGS=""
3117		    LD_SEARCH_FLAGS=""
3118else
3119  echo "$ac_t""no" 1>&6
3120fi
3121
3122	    fi
3123	    if test "`uname -m`" = "alpha" ; then
3124		CFLAGS="$CFLAGS -mieee"
3125	    fi
3126	    if test $do64bit = yes; then
3127		echo $ac_n "checking if compiler accepts -m64 flag""... $ac_c" 1>&6
3128echo "configure:3129: checking if compiler accepts -m64 flag" >&5
3129if eval "test \"`echo '$''{'tcl_cv_cc_m64'+set}'`\" = set"; then
3130  echo $ac_n "(cached) $ac_c" 1>&6
3131else
3132  
3133		    hold_cflags=$CFLAGS
3134		    CFLAGS="$CFLAGS -m64"
3135		    cat > conftest.$ac_ext <<EOF
3136#line 3137 "configure"
3137#include "confdefs.h"
3138
3139int main() {
3140
3141; return 0; }
3142EOF
3143if { (eval echo configure:3144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3144  rm -rf conftest*
3145  tcl_cv_cc_m64=yes
3146else
3147  echo "configure: failed program was:" >&5
3148  cat conftest.$ac_ext >&5
3149  rm -rf conftest*
3150  tcl_cv_cc_m64=no
3151fi
3152rm -f conftest*
3153		    CFLAGS=$hold_cflags
3154fi
3155
3156echo "$ac_t""$tcl_cv_cc_m64" 1>&6
3157		if test $tcl_cv_cc_m64 = yes; then
3158		    CFLAGS="$CFLAGS -m64"
3159		    do64bit_ok=yes
3160		fi
3161	    fi
3162
3163	    # The combo of gcc + glibc has a bug related
3164	    # to inlining of functions like strtod(). The
3165	    # -fno-builtin flag should address this problem
3166	    # but it does not work. The -fno-inline flag
3167	    # is kind of overkill but it works.
3168	    # Disable inlining only when one of the
3169	    # files in compat/*.c is being linked in.
3170	    if test x"${LIBOBJS}" != x ; then
3171	        CFLAGS="$CFLAGS -fno-inline"
3172	    fi
3173
3174	    # XIM peeking works under XFree86.
3175	    cat >> confdefs.h <<\EOF
3176#define PEEK_XCLOSEIM 1
3177EOF
3178
3179
3180	    ;;
3181	GNU*)
3182	    SHLIB_CFLAGS="-fPIC"
3183	    SHLIB_LD_LIBS='${LIBS}'
3184	    SHLIB_SUFFIX=".so"
3185
3186	    if test "$have_dl" = yes; then
3187		SHLIB_LD="${CC} -shared"
3188		DL_OBJS=""
3189		DL_LIBS="-ldl"
3190		LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
3191		CC_SEARCH_FLAGS=""
3192		LD_SEARCH_FLAGS=""
3193	    else
3194		ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'`
3195echo $ac_n "checking for dld.h""... $ac_c" 1>&6
3196echo "configure:3197: checking for dld.h" >&5
3197if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3198  echo $ac_n "(cached) $ac_c" 1>&6
3199else
3200  cat > conftest.$ac_ext <<EOF
3201#line 3202 "configure"
3202#include "confdefs.h"
3203#include <dld.h>
3204EOF
3205ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3206{ (eval echo configure:3207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3207ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3208if test -z "$ac_err"; then
3209  rm -rf conftest*
3210  eval "ac_cv_header_$ac_safe=yes"
3211else
3212  echo "$ac_err" >&5
3213  echo "configure: failed program was:" >&5
3214  cat conftest.$ac_ext >&5
3215  rm -rf conftest*
3216  eval "ac_cv_header_$ac_safe=no"
3217fi
3218rm -f conftest*
3219fi
3220if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3221  echo "$ac_t""yes" 1>&6
3222  
3223		    SHLIB_LD="ld -shared"
3224		    DL_OBJS=""
3225		    DL_LIBS="-ldld"
3226		    CC_SEARCH_FLAGS=""
3227		    LD_SEARCH_FLAGS=""
3228else
3229  echo "$ac_t""no" 1>&6
3230fi
3231
3232	    fi
3233	    if test "`uname -m`" = "alpha" ; then
3234		CFLAGS="$CFLAGS -mieee"
3235	    fi
3236	    ;;
3237	Lynx*)
3238	    SHLIB_CFLAGS="-fPIC"
3239	    SHLIB_LD_LIBS='${LIBS}'
3240	    SHLIB_SUFFIX=".so"
3241	    CFLAGS_OPTIMIZE=-02
3242	    SHLIB_LD="${CC} -shared "
3243	    DL_OBJS="tclLoadDl.o"
3244	    DL_LIBS="-mshared -ldl"
3245	    LD_FLAGS="-Wl,--export-dynamic"
3246	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3247	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3248	    ;;
3249	MP-RAS-02*)
3250	    SHLIB_CFLAGS="-K PIC"
3251	    SHLIB_LD="cc -G"
3252	    SHLIB_LD_LIBS=""
3253	    SHLIB_SUFFIX=".so"
3254	    DL_OBJS="tclLoadDl.o"
3255	    DL_LIBS="-ldl"
3256	    CC_SEARCH_FLAGS=""
3257	    LD_SEARCH_FLAGS=""
3258	    ;;
3259	MP-RAS-*)
3260	    SHLIB_CFLAGS="-K PIC"
3261	    SHLIB_LD="cc -G"
3262	    SHLIB_LD_LIBS=""
3263	    SHLIB_SUFFIX=".so"
3264	    DL_OBJS="tclLoadDl.o"
3265	    DL_LIBS="-ldl"
3266	    LDFLAGS="$LDFLAGS -Wl,-Bexport"
3267	    CC_SEARCH_FLAGS=""
3268	    LD_SEARCH_FLAGS=""
3269	    ;;
3270	NetBSD-*|FreeBSD-[1-2].*)
3271	    # Not available on all versions:  check for include file.
3272	    ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
3273echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
3274echo "configure:3275: checking for dlfcn.h" >&5
3275if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3276  echo $ac_n "(cached) $ac_c" 1>&6
3277else
3278  cat > conftest.$ac_ext <<EOF
3279#line 3280 "configure"
3280#include "confdefs.h"
3281#include <dlfcn.h>
3282EOF
3283ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3284{ (eval echo configure:3285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3285ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3286if test -z "$ac_err"; then
3287  rm -rf conftest*
3288  eval "ac_cv_header_$ac_safe=yes"
3289else
3290  echo "$ac_err" >&5
3291  echo "configure: failed program was:" >&5
3292  cat conftest.$ac_ext >&5
3293  rm -rf conftest*
3294  eval "ac_cv_header_$ac_safe=no"
3295fi
3296rm -f conftest*
3297fi
3298if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3299  echo "$ac_t""yes" 1>&6
3300  
3301		# NetBSD/SPARC needs -fPIC, -fpic will not do.
3302		SHLIB_CFLAGS="-fPIC"
3303		SHLIB_LD="ld -Bshareable -x"
3304		SHLIB_LD_LIBS='${LIBS}'
3305		SHLIB_SUFFIX=".so"
3306		DL_OBJS="tclLoadDl.o"
3307		DL_LIBS=""
3308		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3309		LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
3310		echo $ac_n "checking for ELF""... $ac_c" 1>&6
3311echo "configure:3312: checking for ELF" >&5
3312if eval "test \"`echo '$''{'tcl_cv_ld_elf'+set}'`\" = set"; then
3313  echo $ac_n "(cached) $ac_c" 1>&6
3314else
3315  
3316		    cat > conftest.$ac_ext <<EOF
3317#line 3318 "configure"
3318#include "confdefs.h"
3319
3320#ifdef __ELF__
3321	yes
3322#endif
3323		    
3324EOF
3325if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3326  egrep "yes" >/dev/null 2>&1; then
3327  rm -rf conftest*
3328  tcl_cv_ld_elf=yes
3329else
3330  rm -rf conftest*
3331  tcl_cv_ld_elf=no
3332fi
3333rm -f conftest*
3334
3335fi
3336
3337echo "$ac_t""$tcl_cv_ld_elf" 1>&6
3338		if test $tcl_cv_ld_elf = yes; then
3339		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
3340		else
3341		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
3342		fi
3343	    
3344else
3345  echo "$ac_t""no" 1>&6
3346
3347		SHLIB_CFLAGS=""
3348		SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
3349		SHLIB_LD_LIBS='${LIBS}'
3350		SHLIB_SUFFIX=".a"
3351		DL_OBJS="tclLoadAout.o"
3352		DL_LIBS=""
3353		CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
3354		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3355		SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
3356	    
3357fi
3358
3359
3360	    # FreeBSD doesn't handle version numbers with dots.
3361
3362	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
3363	    TCL_LIB_VERSIONS_OK=nodots
3364	    ;;
3365	OpenBSD-*)
3366	    case `arch -s` in
3367	    m88k|vax)
3368		SHLIB_CFLAGS=""
3369		SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
3370		SHLIB_LD_LIBS='${LIBS}'
3371		SHLIB_SUFFIX=".a"
3372		DL_OBJS="tclLoadAout.o"
3373		DL_LIBS=""
3374		LDFLAGS=""
3375		CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
3376		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3377		SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
3378		;;
3379	    *)
3380		# OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
3381		case `machine` in
3382		sparc|sparc64)
3383		    SHLIB_CFLAGS="-fPIC";;
3384	        *)
3385		    SHLIB_CFLAGS="-fpic";;
3386	        esac
3387		SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
3388		SHLIB_LD_LIBS='${LIBS}'
3389		SHLIB_SUFFIX=".so"
3390		DL_OBJS="tclLoadDl.o"
3391		DL_LIBS=""
3392		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3393		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3394		SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
3395		echo $ac_n "checking for ELF""... $ac_c" 1>&6
3396echo "configure:3397: checking for ELF" >&5
3397if eval "test \"`echo '$''{'tcl_cv_ld_elf'+set}'`\" = set"; then
3398  echo $ac_n "(cached) $ac_c" 1>&6
3399else
3400  
3401		    cat > conftest.$ac_ext <<EOF
3402#line 3403 "configure"
3403#include "confdefs.h"
3404
3405#ifdef __ELF__
3406	yes
3407#endif
3408		    
3409EOF
3410if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3411  egrep "yes" >/dev/null 2>&1; then
3412  rm -rf conftest*
3413  tcl_cv_ld_elf=yes
3414else
3415  rm -rf conftest*
3416  tcl_cv_ld_elf=no
3417fi
3418rm -f conftest*
3419
3420fi
3421
3422echo "$ac_t""$tcl_cv_ld_elf" 1>&6
3423		if test $tcl_cv_ld_elf = yes; then
3424		    LDFLAGS=-Wl,-export-dynamic
3425		else
3426		    LDFLAGS=""
3427	        fi
3428		;;
3429	    esac
3430
3431	    # OpenBSD doesn't do version numbers with dots.
3432	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
3433	    TCL_LIB_VERSIONS_OK=nodots
3434	    ;;
3435	FreeBSD-*)
3436	    # FreeBSD 3.* and greater have ELF.
3437	    SHLIB_CFLAGS="-fPIC"
3438	    SHLIB_LD="ld -Bshareable -x"
3439	    SHLIB_LD_LIBS='${LIBS}'
3440	    SHLIB_SUFFIX=".so"
3441	    DL_OBJS="tclLoadDl.o"
3442	    DL_LIBS=""
3443	    LDFLAGS="$LDFLAGS -export-dynamic"
3444	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3445	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
3446	    if test "${TCL_THREADS}" = "1" ; then
3447		# The -pthread needs to go in the CFLAGS, not LIBS
3448		LIBS=`echo $LIBS | sed s/-pthread//`
3449		CFLAGS="$CFLAGS -pthread"
3450	    	LDFLAGS="$LDFLAGS -pthread"
3451	    fi
3452	    case $system in
3453	    FreeBSD-3.*)
3454	    	# FreeBSD-3 doesn't handle version numbers with dots.
3455	    	UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
3456	    	SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
3457	    	TCL_LIB_VERSIONS_OK=nodots
3458		;;
3459	    esac
3460	    ;;
3461	Darwin-*)
3462	    CFLAGS_OPTIMIZE="-Os"
3463	    SHLIB_CFLAGS="-fno-common"
3464	    # To avoid discrepancies between what headers configure sees during
3465	    # preprocessing tests and compiling tests, move any -isysroot and
3466	    # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
3467	    CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
3468		awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
3469		if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`"
3470	    CFLAGS="`echo " ${CFLAGS}" | \
3471		awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
3472		if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`"
3473	    if test $do64bit = yes; then
3474		case `arch` in
3475		    ppc)
3476			echo $ac_n "checking if compiler accepts -arch ppc64 flag""... $ac_c" 1>&6
3477echo "configure:3478: checking if compiler accepts -arch ppc64 flag" >&5
3478if eval "test \"`echo '$''{'tcl_cv_cc_arch_ppc64'+set}'`\" = set"; then
3479  echo $ac_n "(cached) $ac_c" 1>&6
3480else
3481  
3482			    hold_cflags=$CFLAGS
3483			    CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
3484			    cat > conftest.$ac_ext <<EOF
3485#line 3486 "configure"
3486#include "confdefs.h"
3487
3488int main() {
3489
3490; return 0; }
3491EOF
3492if { (eval echo configure:3493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3493  rm -rf conftest*
3494  tcl_cv_cc_arch_ppc64=yes
3495else
3496  echo "configure: failed program was:" >&5
3497  cat conftest.$ac_ext >&5
3498  rm -rf conftest*
3499  tcl_cv_cc_arch_ppc64=no
3500fi
3501rm -f conftest*
3502			    CFLAGS=$hold_cflags
3503fi
3504
3505echo "$ac_t""$tcl_cv_cc_arch_ppc64" 1>&6
3506			if test $tcl_cv_cc_arch_ppc64 = yes; then
3507			    CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
3508			    do64bit_ok=yes
3509			fi;;
3510		    i386)
3511			echo $ac_n "checking if compiler accepts -arch x86_64 flag""... $ac_c" 1>&6
3512echo "configure:3513: checking if compiler accepts -arch x86_64 flag" >&5
3513if eval "test \"`echo '$''{'tcl_cv_cc_arch_x86_64'+set}'`\" = set"; then
3514  echo $ac_n "(cached) $ac_c" 1>&6
3515else
3516  
3517			    hold_cflags=$CFLAGS
3518			    CFLAGS="$CFLAGS -arch x86_64"
3519			    cat > conftest.$ac_ext <<EOF
3520#line 3521 "configure"
3521#include "confdefs.h"
3522
3523int main() {
3524
3525; return 0; }
3526EOF
3527if { (eval echo configure:3528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3528  rm -rf conftest*
3529  tcl_cv_cc_arch_x86_64=yes
3530else
3531  echo "configure: failed program was:" >&5
3532  cat conftest.$ac_ext >&5
3533  rm -rf conftest*
3534  tcl_cv_cc_arch_x86_64=no
3535fi
3536rm -f conftest*
3537			    CFLAGS=$hold_cflags
3538fi
3539
3540echo "$ac_t""$tcl_cv_cc_arch_x86_64" 1>&6
3541			if test $tcl_cv_cc_arch_x86_64 = yes; then
3542			    CFLAGS="$CFLAGS -arch x86_64"
3543			    do64bit_ok=yes
3544			fi;;
3545		    *)
3546			echo "configure: warning: Don't know how enable 64-bit on architecture `arch`" 1>&2;;
3547		esac
3548	    else
3549		# Check for combined 32-bit and 64-bit fat build
3550		echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \
3551		    echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \
3552		    fat_32_64=yes
3553	    fi
3554	    SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}'
3555	    echo $ac_n "checking if ld accepts -single_module flag""... $ac_c" 1>&6
3556echo "configure:3557: checking if ld accepts -single_module flag" >&5
3557if eval "test \"`echo '$''{'tcl_cv_ld_single_module'+set}'`\" = set"; then
3558  echo $ac_n "(cached) $ac_c" 1>&6
3559else
3560  
3561		hold_ldflags=$LDFLAGS
3562		LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
3563		cat > conftest.$ac_ext <<EOF
3564#line 3565 "configure"
3565#include "confdefs.h"
3566
3567int main() {
3568int i;
3569; return 0; }
3570EOF
3571if { (eval echo configure:3572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3572  rm -rf conftest*
3573  tcl_cv_ld_single_module=yes
3574else
3575  echo "configure: failed program was:" >&5
3576  cat conftest.$ac_ext >&5
3577  rm -rf conftest*
3578  tcl_cv_ld_single_module=no
3579fi
3580rm -f conftest*
3581		LDFLAGS=$hold_ldflags
3582fi
3583
3584echo "$ac_t""$tcl_cv_ld_single_module" 1>&6
3585	    if test $tcl_cv_ld_single_module = yes; then
3586		SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
3587	    fi
3588	    SHLIB_LD_LIBS='${LIBS}'
3589	    SHLIB_SUFFIX=".dylib"
3590	    DL_OBJS="tclLoadDyld.o"
3591	    DL_LIBS=""
3592	    # Don't use -prebind when building for Mac OS X 10.4 or later only:
3593	    test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \
3594		"`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \
3595		LDFLAGS="$LDFLAGS -prebind"
3596	    LDFLAGS="$LDFLAGS -headerpad_max_install_names"
3597	    echo $ac_n "checking if ld accepts -search_paths_first flag""... $ac_c" 1>&6
3598echo "configure:3599: checking if ld accepts -search_paths_first flag" >&5
3599if eval "test \"`echo '$''{'tcl_cv_ld_search_paths_first'+set}'`\" = set"; then
3600  echo $ac_n "(cached) $ac_c" 1>&6
3601else
3602  
3603		hold_ldflags=$LDFLAGS
3604		LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
3605		cat > conftest.$ac_ext <<EOF
3606#line 3607 "configure"
3607#include "confdefs.h"
3608
3609int main() {
3610int i;
3611; return 0; }
3612EOF
3613if { (eval echo configure:3614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3614  rm -rf conftest*
3615  tcl_cv_ld_search_paths_first=yes
3616else
3617  echo "configure: failed program was:" >&5
3618  cat conftest.$ac_ext >&5
3619  rm -rf conftest*
3620  tcl_cv_ld_search_paths_first=no
3621fi
3622rm -f conftest*
3623		LDFLAGS=$hold_ldflags
3624fi
3625
3626echo "$ac_t""$tcl_cv_ld_search_paths_first" 1>&6
3627	    if test $tcl_cv_ld_search_paths_first = yes; then
3628		LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
3629	    fi
3630	    CC_SEARCH_FLAGS=""
3631	    LD_SEARCH_FLAGS=""
3632	    LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
3633	    PLAT_OBJS=\$\(MAC\_OSX_OBJS\)
3634	    PLAT_SRCS=\$\(MAC\_OSX_SRCS\)
3635	    echo $ac_n "checking whether to use CoreFoundation""... $ac_c" 1>&6
3636echo "configure:3637: checking whether to use CoreFoundation" >&5
3637	    # Check whether --enable-corefoundation or --disable-corefoundation was given.
3638if test "${enable_corefoundation+set}" = set; then
3639  enableval="$enable_corefoundation"
3640  tcl_corefoundation=$enableval
3641else
3642  tcl_corefoundation=yes
3643fi
3644
3645	    echo "$ac_t""$tcl_corefoundation" 1>&6
3646	    if test $tcl_corefoundation = yes; then
3647		echo $ac_n "checking for CoreFoundation.framework""... $ac_c" 1>&6
3648echo "configure:3649: checking for CoreFoundation.framework" >&5
3649if eval "test \"`echo '$''{'tcl_cv_lib_corefoundation'+set}'`\" = set"; then
3650  echo $ac_n "(cached) $ac_c" 1>&6
3651else
3652  
3653		    hold_libs=$LIBS
3654		    if test "$fat_32_64" = yes; then for v in CFLAGS CPPFLAGS LDFLAGS; do
3655			# On Tiger there is no 64-bit CF, so remove 64-bit archs
3656			# from CFLAGS et al. while testing for presence of CF.
3657			# 64-bit CF is disabled in tclUnixPort.h if necessary.
3658			eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
3659		    done; fi
3660		    LIBS="$LIBS -framework CoreFoundation"
3661		    cat > conftest.$ac_ext <<EOF
3662#line 3663 "configure"
3663#include "confdefs.h"
3664#include <CoreFoundation/CoreFoundation.h>
3665int main() {
3666CFBundleRef b = CFBundleGetMainBundle();
3667; return 0; }
3668EOF
3669if { (eval echo configure:3670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3670  rm -rf conftest*
3671  tcl_cv_lib_corefoundation=yes
3672else
3673  echo "configure: failed program was:" >&5
3674  cat conftest.$ac_ext >&5
3675  rm -rf conftest*
3676  tcl_cv_lib_corefoundation=no
3677fi
3678rm -f conftest*
3679		    if test "$fat_32_64" = yes; then for v in CFLAGS CPPFLAGS LDFLAGS; do
3680			eval $v'="$hold_'$v'"'
3681		    done; fi; LIBS=$hold_libs
3682fi
3683
3684echo "$ac_t""$tcl_cv_lib_corefoundation" 1>&6
3685		if test $tcl_cv_lib_corefoundation = yes; then
3686		    LIBS="$LIBS -framework CoreFoundation"
3687		    cat >> confdefs.h <<\EOF
3688#define HAVE_COREFOUNDATION 1
3689EOF
3690
3691		else
3692		    tcl_corefoundation=no
3693		fi
3694		if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then
3695		    echo $ac_n "checking for 64-bit CoreFoundation""... $ac_c" 1>&6
3696echo "configure:3697: checking for 64-bit CoreFoundation" >&5
3697if eval "test \"`echo '$''{'tcl_cv_lib_corefoundation_64'+set}'`\" = set"; then
3698  echo $ac_n "(cached) $ac_c" 1>&6
3699else
3700  
3701			for v in CFLAGS CPPFLAGS LDFLAGS; do
3702			    eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
3703			done
3704			cat > conftest.$ac_ext <<EOF
3705#line 3706 "configure"
3706#include "confdefs.h"
3707#include <CoreFoundation/CoreFoundation.h>
3708int main() {
3709CFBundleRef b = CFBundleGetMainBundle();
3710; return 0; }
3711EOF
3712if { (eval echo configure:3713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3713  rm -rf conftest*
3714  tcl_cv_lib_corefoundation_64=yes
3715else
3716  echo "configure: failed program was:" >&5
3717  cat conftest.$ac_ext >&5
3718  rm -rf conftest*
3719  tcl_cv_lib_corefoundation_64=no
3720fi
3721rm -f conftest*
3722			for v in CFLAGS CPPFLAGS LDFLAGS; do
3723			    eval $v'="$hold_'$v'"'
3724			done
3725fi
3726
3727echo "$ac_t""$tcl_cv_lib_corefoundation_64" 1>&6
3728		    if test $tcl_cv_lib_corefoundation_64 = no; then
3729			cat >> confdefs.h <<\EOF
3730#define NO_COREFOUNDATION_64 1
3731EOF
3732
3733		    fi
3734		fi
3735	    fi
3736	    cat >> confdefs.h <<\EOF
3737#define MAC_OSX_TCL 1
3738EOF
3739
3740	    ;;
3741	NEXTSTEP-*)
3742	    SHLIB_CFLAGS=""
3743	    SHLIB_LD="cc -nostdlib -r"
3744	    SHLIB_LD_LIBS=""
3745	    SHLIB_SUFFIX=".so"
3746	    DL_OBJS="tclLoadNext.o"
3747	    DL_LIBS=""
3748	    CC_SEARCH_FLAGS=""
3749	    LD_SEARCH_FLAGS=""
3750	    ;;
3751	OS/390-*)
3752	    CFLAGS_OPTIMIZE=""		# Optimizer is buggy
3753	    cat >> confdefs.h <<\EOF
3754#define _OE_SOCKETS 1
3755EOF
3756	# needed in sys/socket.h
3757	    ;;      
3758	OSF1-1.0|OSF1-1.1|OSF1-1.2)
3759	    # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
3760	    SHLIB_CFLAGS=""
3761	    # Hack: make package name same as library name
3762	    SHLIB_LD='ld -R -export :'
3763	    SHLIB_LD_LIBS=""
3764	    SHLIB_SUFFIX=".so"
3765	    DL_OBJS="tclLoadOSF.o"
3766	    DL_LIBS=""
3767	    CC_SEARCH_FLAGS=""
3768	    LD_SEARCH_FLAGS=""
3769	    ;;
3770	OSF1-1.*)
3771	    # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
3772	    SHLIB_CFLAGS="-fPIC"
3773	    if test "$SHARED_BUILD" = "1" ; then
3774	        SHLIB_LD="ld -shared"
3775	    else
3776	        SHLIB_LD="ld -non_shared"
3777	    fi
3778	    SHLIB_LD_LIBS=""
3779	    SHLIB_SUFFIX=".so"
3780	    DL_OBJS="tclLoadDl.o"
3781	    DL_LIBS=""
3782	    CC_SEARCH_FLAGS=""
3783	    LD_SEARCH_FLAGS=""
3784	    ;;
3785	OSF1-V*)
3786	    # Digital OSF/1
3787	    SHLIB_CFLAGS=""
3788	    if test "$SHARED_BUILD" = "1" ; then
3789	        SHLIB_LD='ld -shared -expect_unresolved "*"'
3790	    else
3791	        SHLIB_LD='ld -non_shared -expect_unresolved "*"'
3792	    fi
3793	    SHLIB_LD_LIBS=""
3794	    SHLIB_SUFFIX=".so"
3795	    DL_OBJS="tclLoadDl.o"
3796	    DL_LIBS=""
3797	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3798	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
3799	    if test "$GCC" = "yes" ; then
3800		CFLAGS="$CFLAGS -mieee"
3801            else
3802		CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
3803	    fi
3804	    # see pthread_intro(3) for pthread support on osf1, k.furukawa
3805	    if test "${TCL_THREADS}" = "1" ; then
3806		CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
3807		CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
3808		LIBS=`echo $LIBS | sed s/-lpthreads//`
3809		if test "$GCC" = "yes" ; then
3810		    LIBS="$LIBS -lpthread -lmach -lexc"
3811		else
3812		    CFLAGS="$CFLAGS -pthread"
3813		    LDFLAGS="$LDFLAGS -pthread"
3814		fi
3815	    fi
3816
3817	    ;;
3818	QNX-6*)
3819	    # QNX RTP
3820	    # This may work for all QNX, but it was only reported for v6.
3821	    SHLIB_CFLAGS="-fPIC"
3822	    SHLIB_LD="ld -Bshareable -x"
3823	    SHLIB_LD_LIBS=""
3824	    SHLIB_SUFFIX=".so"
3825	    DL_OBJS="tclLoadDl.o"
3826	    # dlopen is in -lc on QNX
3827	    DL_LIBS=""
3828	    CC_SEARCH_FLAGS=""
3829	    LD_SEARCH_FLAGS=""
3830	    ;;
3831	RISCos-*)
3832	    SHLIB_CFLAGS="-G 0"
3833	    SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
3834	    SHLIB_LD_LIBS='${LIBS}'
3835	    SHLIB_SUFFIX=".a"
3836	    DL_OBJS="tclLoadAout.o"
3837	    DL_LIBS=""
3838	    LDFLAGS="$LDFLAGS -Wl,-D,08000000"
3839	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
3840	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3841	    ;;
3842	SCO_SV-3.2*)
3843	    # Note, dlopen is available only on SCO 3.2.5 and greater. However,
3844	    # this test works, since "uname -s" was non-standard in 3.2.4 and
3845	    # below.
3846	    if test "$GCC" = "yes" ; then
3847	    	SHLIB_CFLAGS="-fPIC -melf"
3848	    	LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
3849	    else
3850	    	SHLIB_CFLAGS="-Kpic -belf"
3851	    	LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
3852	    fi
3853	    SHLIB_LD="ld -G"
3854	    SHLIB_LD_LIBS=""
3855	    SHLIB_SUFFIX=".so"
3856	    DL_OBJS="tclLoadDl.o"
3857	    DL_LIBS=""
3858	    CC_SEARCH_FLAGS=""
3859	    LD_SEARCH_FLAGS=""
3860	    ;;
3861	SINIX*5.4*)
3862	    SHLIB_CFLAGS="-K PIC"
3863	    SHLIB_LD="cc -G"
3864	    SHLIB_LD_LIBS=""
3865	    SHLIB_SUFFIX=".so"
3866	    DL_OBJS="tclLoadDl.o"
3867	    DL_LIBS="-ldl"
3868	    CC_SEARCH_FLAGS=""
3869	    LD_SEARCH_FLAGS=""
3870	    ;;
3871	SunOS-4*)
3872	    SHLIB_CFLAGS="-PIC"
3873	    SHLIB_LD="ld"
3874	    SHLIB_LD_LIBS=""
3875	    SHLIB_SUFFIX=".so"
3876	    DL_OBJS="tclLoadDl.o"
3877	    DL_LIBS="-ldl"
3878	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
3879	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3880
3881	    # SunOS can't handle version numbers with dots in them in library
3882	    # specs, like -ltcl7.5, so use -ltcl75 instead.  Also, it
3883	    # requires an extra version number at the end of .so file names.
3884	    # So, the library has to have a name like libtcl75.so.1.0
3885
3886	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
3887	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
3888	    TCL_LIB_VERSIONS_OK=nodots
3889	    ;;
3890	SunOS-5.[0-6])
3891	    # Careful to not let 5.10+ fall into this case
3892
3893	    # Note: If _REENTRANT isn't defined, then Solaris
3894	    # won't define thread-safe library routines.
3895
3896	    cat >> confdefs.h <<\EOF
3897#define _REENTRANT 1
3898EOF
3899
3900	    cat >> confdefs.h <<\EOF
3901#define _POSIX_PTHREAD_SEMANTICS 1
3902EOF
3903
3904
3905	    SHLIB_CFLAGS="-KPIC"
3906
3907	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
3908	    # symbols when dynamically loaded into tclsh.
3909
3910	    SHLIB_LD_LIBS='${LIBS}'
3911	    SHLIB_SUFFIX=".so"
3912	    DL_OBJS="tclLoadDl.o"
3913	    DL_LIBS="-ldl"
3914	    if test "$GCC" = "yes" ; then
3915		SHLIB_LD="$CC -shared"
3916		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
3917		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3918	    else
3919		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
3920		CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
3921		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3922	    fi
3923	    ;;
3924	SunOS-5*)
3925	    # Note: If _REENTRANT isn't defined, then Solaris
3926	    # won't define thread-safe library routines.
3927
3928	    cat >> confdefs.h <<\EOF
3929#define _REENTRANT 1
3930EOF
3931
3932	    cat >> confdefs.h <<\EOF
3933#define _POSIX_PTHREAD_SEMANTICS 1
3934EOF
3935
3936
3937	    SHLIB_CFLAGS="-KPIC"
3938
3939	    # Check to enable 64-bit flags for compiler/linker
3940	    if test "$do64bit" = "yes" ; then
3941		arch=`isainfo`
3942		if test "$arch" = "sparcv9 sparc" ; then
3943			if test "$GCC" = "yes" ; then
3944			    if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then
3945				echo "configure: warning: 64bit mode not supported with GCC < 3.2 on $system" 1>&2
3946			    else
3947				do64bit_ok=yes
3948				CFLAGS="$CFLAGS -m64 -mcpu=v9"
3949				LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
3950				SHLIB_CFLAGS="-fPIC"
3951			    fi
3952			else
3953			    do64bit_ok=yes
3954			    if test "$do64bitVIS" = "yes" ; then
3955				CFLAGS="$CFLAGS -xarch=v9a"
3956				LDFLAGS="$LDFLAGS -xarch=v9a"
3957			    else
3958				CFLAGS="$CFLAGS -xarch=v9"
3959				LDFLAGS="$LDFLAGS -xarch=v9"
3960			    fi
3961			    # Solaris 64 uses this as well
3962			    #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
3963			fi
3964		elif test "$arch" = "amd64 i386" ; then
3965		    if test "$GCC" = "yes" ; then
3966			case $system in
3967			    SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
3968				do64bit_ok=yes
3969				CFLAGS="$CFLAGS -m64"
3970				LDFLAGS="$LDFLAGS -m64";;
3971			    *)
3972				echo "configure: warning: 64bit mode not supported with GCC on $system" 1>&2;;
3973			esac
3974		    else
3975			do64bit_ok=yes
3976			case $system in
3977			    SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
3978				CFLAGS="$CFLAGS -m64"
3979				LDFLAGS="$LDFLAGS -m64";;
3980			    *)
3981				CFLAGS="$CFLAGS -xarch=amd64"
3982				LDFLAGS="$LDFLAGS -xarch=amd64";;
3983			esac
3984		    fi
3985		else
3986		    echo "configure: warning: 64bit mode not supported for $arch" 1>&2
3987		fi
3988	    fi
3989
3990	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
3991	    # symbols when dynamically loaded into tclsh.
3992
3993	    SHLIB_LD_LIBS='${LIBS}'
3994	    SHLIB_SUFFIX=".so"
3995	    DL_OBJS="tclLoadDl.o"
3996	    DL_LIBS="-ldl"
3997	    if test "$GCC" = "yes" ; then
3998		SHLIB_LD="$CC -shared"
3999		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
4000		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
4001		if test "$do64bit_ok" = "yes" ; then
4002		    if test "$arch" = "sparcv9 sparc" ; then
4003			# We need to specify -static-libgcc or we need to
4004			# add the path to the sparv9 libgcc.
4005			SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
4006			# for finding sparcv9 libgcc, get the regular libgcc
4007			# path, remove so name and append 'sparcv9'
4008			#v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
4009			#CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
4010		    elif test "$arch" = "amd64 i386" ; then
4011			SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
4012		    fi
4013		fi
4014	    else
4015		case $system in
4016		    SunOS-5.[1-9][0-9]*)
4017			SHLIB_LD='${CC} -G -z text ${LDFLAGS}';;
4018		    *)
4019			SHLIB_LD="/usr/ccs/bin/ld -G -z text";;
4020		esac
4021		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
4022		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
4023	    fi
4024	    ;;
4025	ULTRIX-4.*)
4026	    SHLIB_CFLAGS="-G 0"
4027	    SHLIB_SUFFIX=".a"
4028	    SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
4029	    SHLIB_LD_LIBS='${LIBS}'
4030	    DL_OBJS="tclLoadAout.o"
4031	    DL_LIBS=""
4032	    LDFLAGS="$LDFLAGS -Wl,-D,08000000"
4033	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
4034	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
4035	    if test "$GCC" != "yes" ; then
4036		CFLAGS="$CFLAGS -DHAVE_TZSET -std1"
4037	    fi
4038	    ;;
4039	UNIX_SV* | UnixWare-5*)
4040	    SHLIB_CFLAGS="-KPIC"
4041	    SHLIB_LD="cc -G"
4042	    SHLIB_LD_LIBS=""
4043	    SHLIB_SUFFIX=".so"
4044	    DL_OBJS="tclLoadDl.o"
4045	    DL_LIBS="-ldl"
4046	    # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
4047	    # that don't grok the -Bexport option.  Test that it does.
4048	    echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6
4049echo "configure:4050: checking for ld accepts -Bexport flag" >&5
4050if eval "test \"`echo '$''{'tcl_cv_ld_Bexport'+set}'`\" = set"; then
4051  echo $ac_n "(cached) $ac_c" 1>&6
4052else
4053  
4054		hold_ldflags=$LDFLAGS
4055		LDFLAGS="$LDFLAGS -Wl,-Bexport"
4056		cat > conftest.$ac_ext <<EOF
4057#line 4058 "configure"
4058#include "confdefs.h"
4059
4060int main() {
4061int i;
4062; return 0; }
4063EOF
4064if { (eval echo configure:4065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4065  rm -rf conftest*
4066  tcl_cv_ld_Bexport=yes
4067else
4068  echo "configure: failed program was:" >&5
4069  cat conftest.$ac_ext >&5
4070  rm -rf conftest*
4071  tcl_cv_ld_Bexport=no
4072fi
4073rm -f conftest*
4074	        LDFLAGS=$hold_ldflags
4075fi
4076
4077echo "$ac_t""$tcl_cv_ld_Bexport" 1>&6
4078	    if test $tcl_cv_ld_Bexport = yes; then
4079		LDFLAGS="$LDFLAGS -Wl,-Bexport"
4080	    fi
4081	    CC_SEARCH_FLAGS=""
4082	    LD_SEARCH_FLAGS=""
4083	    ;;
4084    esac
4085
4086    if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
4087	echo "configure: warning: 64bit support being disabled -- don't know magic for this platform" 1>&2
4088    fi
4089
4090    
4091    
4092
4093    # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic
4094    # Loading for Tcl -- What Became of It?".  Proc. 2nd Tcl/Tk Workshop,
4095    # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need
4096    # to determine which of several header files defines the a.out file
4097    # format (a.out.h, sys/exec.h, or sys/exec_aout.h).  At present, we
4098    # support only a file format that is more or less version-7-compatible. 
4099    # In particular,
4100    #	- a.out files must begin with `struct exec'.
4101    #	- the N_TXTOFF on the `struct exec' must compute the seek address
4102    #	  of the text segment
4103    #	- The `struct exec' must contain a_magic, a_text, a_data, a_bss
4104    #	  and a_entry fields.
4105    # The following compilation should succeed if and only if either sys/exec.h
4106    # or a.out.h is usable for the purpose.
4107    #
4108    # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the
4109    # `struct exec' includes a second header that contains information that
4110    # duplicates the v7 fields that are needed.
4111
4112    if test "x$DL_OBJS" = "xtclLoadAout.o" ; then
4113	echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6
4114echo "configure:4115: checking sys/exec.h" >&5
4115if eval "test \"`echo '$''{'tcl_cv_sysexec_h'+set}'`\" = set"; then
4116  echo $ac_n "(cached) $ac_c" 1>&6
4117else
4118  
4119	cat > conftest.$ac_ext <<EOF
4120#line 4121 "configure"
4121#include "confdefs.h"
4122#include <sys/exec.h>
4123int main() {
4124
4125	    struct exec foo;
4126	    unsigned long seek;
4127	    int flag;
4128#if defined(__mips) || defined(mips)
4129	    seek = N_TXTOFF (foo.ex_f, foo.ex_o);
4130#else
4131	    seek = N_TXTOFF (foo);
4132#endif
4133	    flag = (foo.a_magic == OMAGIC);
4134	    return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
4135    
4136; return 0; }
4137EOF
4138if { (eval echo configure:4139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4139  rm -rf conftest*
4140  tcl_cv_sysexec_h=usable
4141else
4142  echo "configure: failed program was:" >&5
4143  cat conftest.$ac_ext >&5
4144  rm -rf conftest*
4145  tcl_cv_sysexec_h=unusable
4146fi
4147rm -f conftest*
4148fi
4149
4150echo "$ac_t""$tcl_cv_sysexec_h" 1>&6
4151	if test $tcl_cv_sysexec_h = usable; then
4152	    cat >> confdefs.h <<\EOF
4153#define USE_SYS_EXEC_H 1
4154EOF
4155
4156	else
4157	    echo $ac_n "checking a.out.h""... $ac_c" 1>&6
4158echo "configure:4159: checking a.out.h" >&5
4159if eval "test \"`echo '$''{'tcl_cv_aout_h'+set}'`\" = set"; then
4160  echo $ac_n "(cached) $ac_c" 1>&6
4161else
4162  
4163	    cat > conftest.$ac_ext <<EOF
4164#line 4165 "configure"
4165#include "confdefs.h"
4166#include <a.out.h>
4167int main() {
4168
4169		struct exec foo;
4170		unsigned long seek;
4171		int flag;
4172#if defined(__mips) || defined(mips)
4173		seek = N_TXTOFF (foo.ex_f, foo.ex_o);
4174#else
4175		seek = N_TXTOFF (foo);
4176#endif
4177		flag = (foo.a_magic == OMAGIC);
4178		return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
4179	    
4180; return 0; }
4181EOF
4182if { (eval echo configure:4183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4183  rm -rf conftest*
4184  tcl_cv_aout_h=usable
4185else
4186  echo "configure: failed program was:" >&5
4187  cat conftest.$ac_ext >&5
4188  rm -rf conftest*
4189  tcl_cv_aout_h=unusable
4190fi
4191rm -f conftest*
4192fi
4193
4194echo "$ac_t""$tcl_cv_aout_h" 1>&6
4195	    if test $tcl_cv_aout_h = usable; then
4196		cat >> confdefs.h <<\EOF
4197#define USE_A_OUT_H 1
4198EOF
4199
4200	    else
4201		echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6
4202echo "configure:4203: checking sys/exec_aout.h" >&5
4203if eval "test \"`echo '$''{'tcl_cv_sysexecaout_h'+set}'`\" = set"; then
4204  echo $ac_n "(cached) $ac_c" 1>&6
4205else
4206  
4207		cat > conftest.$ac_ext <<EOF
4208#line 4209 "configure"
4209#include "confdefs.h"
4210#include <sys/exec_aout.h>
4211int main() {
4212
4213		    struct exec foo;
4214		    unsigned long seek;
4215		    int flag;
4216#if defined(__mips) || defined(mips)
4217		    seek = N_TXTOFF (foo.ex_f, foo.ex_o);
4218#else
4219		    seek = N_TXTOFF (foo);
4220#endif
4221		    flag = (foo.a_midmag == OMAGIC);
4222		    return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
4223		
4224; return 0; }
4225EOF
4226if { (eval echo configure:4227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4227  rm -rf conftest*
4228  tcl_cv_sysexecaout_h=usable
4229else
4230  echo "configure: failed program was:" >&5
4231  cat conftest.$ac_ext >&5
4232  rm -rf conftest*
4233  tcl_cv_sysexecaout_h=unusable
4234fi
4235rm -f conftest*
4236fi
4237
4238echo "$ac_t""$tcl_cv_sysexecaout_h" 1>&6
4239		if test $tcl_cv_sysexecaout_h = usable; then
4240		    cat >> confdefs.h <<\EOF
4241#define USE_SYS_EXEC_AOUT_H 1
4242EOF
4243
4244		else
4245		    DL_OBJS=""
4246		fi
4247	    fi
4248	fi
4249    fi
4250
4251    # Step 5: disable dynamic loading if requested via a command-line switch.
4252
4253    # Check whether --enable-load or --disable-load was given.
4254if test "${enable_load+set}" = set; then
4255  enableval="$enable_load"
4256  tcl_ok=$enableval
4257else
4258  tcl_ok=yes
4259fi
4260
4261    if test "$tcl_ok" = "no"; then
4262	DL_OBJS=""
4263    fi
4264
4265    if test "x$DL_OBJS" != "x" ; then
4266	BUILD_DLTEST="\$(DLTEST_TARGETS)"
4267    else
4268	echo "Can't figure out how to do dynamic loading or shared libraries"
4269	echo "on this system."
4270	SHLIB_CFLAGS=""
4271	SHLIB_LD=""
4272	SHLIB_SUFFIX=""
4273	DL_OBJS="tclLoadNone.o"
4274	DL_LIBS=""
4275	LDFLAGS="$LDFLAGS_ORIG"
4276	CC_SEARCH_FLAGS=""
4277	LD_SEARCH_FLAGS=""
4278	BUILD_DLTEST=""
4279    fi
4280
4281    # If we're running gcc, then change the C flags for compiling shared
4282    # libraries to the right flags for gcc, instead of those for the
4283    # standard manufacturer compiler.
4284
4285    if test "$DL_OBJS" != "tclLoadNone.o" ; then
4286	if test "$GCC" = "yes" ; then
4287	    case $system in
4288		AIX-*)
4289		    ;;
4290		BSD/OS*)
4291		    ;;
4292		IRIX*)
4293		    ;;
4294		NetBSD-*|FreeBSD-*|OpenBSD-*)
4295		    ;;
4296		Darwin-*)
4297		    ;;
4298		RISCos-*)
4299		    ;;
4300		SCO_SV-3.2*)
4301		    ;;
4302		ULTRIX-4.*)
4303		    ;;
4304		*)
4305		    SHLIB_CFLAGS="-fPIC"
4306		    ;;
4307	    esac
4308	fi
4309    fi
4310
4311    if test "$SHARED_LIB_SUFFIX" = "" ; then
4312	SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}'
4313    fi
4314    if test "$UNSHARED_LIB_SUFFIX" = "" ; then
4315	UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
4316    fi
4317
4318    if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then
4319        LIB_SUFFIX=${SHARED_LIB_SUFFIX}
4320        MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
4321        INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
4322    else
4323        LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
4324
4325        if test "$RANLIB" = "" ; then
4326            MAKE_LIB='$(STLIB_LD) $@ ${OBJS}'
4327            INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
4328        else
4329            MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@'
4330            INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))'
4331        fi
4332
4333    fi
4334
4335
4336    # Stub lib does not depend on shared/static configuration
4337    if test "$RANLIB" = "" ; then
4338        MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}'
4339        INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)'
4340    else
4341        MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@'
4342        INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))'
4343    fi
4344
4345
4346    
4347
4348    
4349    
4350    
4351    
4352    
4353    
4354    
4355
4356    
4357    
4358    
4359    
4360    
4361
4362    
4363    
4364    
4365    
4366    
4367    
4368    
4369
4370    
4371    
4372    
4373    
4374    
4375
4376
4377
4378    echo $ac_n "checking for build with symbols""... $ac_c" 1>&6
4379echo "configure:4380: checking for build with symbols" >&5
4380    # Check whether --enable-symbols or --disable-symbols was given.
4381if test "${enable_symbols+set}" = set; then
4382  enableval="$enable_symbols"
4383  tcl_ok=$enableval
4384else
4385  tcl_ok=no
4386fi
4387
4388# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
4389    if test "$tcl_ok" = "no"; then
4390	CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
4391	LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
4392	DBGX=""
4393	echo "$ac_t""no" 1>&6
4394    else
4395	CFLAGS_DEFAULT='$(CFLAGS_DEBUG)'
4396	LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
4397	DBGX=g
4398	if test "$tcl_ok" = "yes"; then
4399	    echo "$ac_t""yes (standard debugging)" 1>&6
4400	fi
4401    fi
4402    
4403    
4404
4405    if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
4406	cat >> confdefs.h <<\EOF
4407#define TCL_MEM_DEBUG 1
4408EOF
4409
4410    fi
4411
4412    if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
4413	cat >> confdefs.h <<\EOF
4414#define TCL_COMPILE_DEBUG 1
4415EOF
4416
4417	cat >> confdefs.h <<\EOF
4418#define TCL_COMPILE_STATS 1
4419EOF
4420
4421    fi
4422
4423    if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
4424	if test "$tcl_ok" = "all"; then
4425	    echo "$ac_t""enabled symbols mem compile debugging" 1>&6
4426	else
4427	    echo "$ac_t""enabled $tcl_ok debugging" 1>&6
4428	fi
4429    fi
4430
4431
4432TCL_DBGX=${DBGX}
4433
4434#--------------------------------------------------------------------
4435#	Detect what compiler flags to set for 64-bit support.
4436#--------------------------------------------------------------------
4437
4438
4439    echo $ac_n "checking for required early compiler flags""... $ac_c" 1>&6
4440echo "configure:4441: checking for required early compiler flags" >&5
4441    tcl_flags=""
4442    
4443    if eval "test \"`echo '$''{'tcl_cv_flag__isoc99_source'+set}'`\" = set"; then
4444  echo $ac_n "(cached) $ac_c" 1>&6
4445else
4446  cat > conftest.$ac_ext <<EOF
4447#line 4448 "configure"
4448#include "confdefs.h"
4449#include <stdlib.h>
4450int main() {
4451char *p = (char *)strtoll; char *q = (char *)strtoull;
4452; return 0; }
4453EOF
4454if { (eval echo configure:4455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4455  rm -rf conftest*
4456  tcl_cv_flag__isoc99_source=no
4457else
4458  echo "configure: failed program was:" >&5
4459  cat conftest.$ac_ext >&5
4460  rm -rf conftest*
4461  cat > conftest.$ac_ext <<EOF
4462#line 4463 "configure"
4463#include "confdefs.h"
4464#define _ISOC99_SOURCE 1
4465#include <stdlib.h>
4466int main() {
4467char *p = (char *)strtoll; char *q = (char *)strtoull;
4468; return 0; }
4469EOF
4470if { (eval echo configure:4471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4471  rm -rf conftest*
4472  tcl_cv_flag__isoc99_source=yes
4473else
4474  echo "configure: failed program was:" >&5
4475  cat conftest.$ac_ext >&5
4476  rm -rf conftest*
4477  tcl_cv_flag__isoc99_source=no
4478fi
4479rm -f conftest*
4480fi
4481rm -f conftest*
4482fi
4483
4484    if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
4485	cat >> confdefs.h <<\EOF
4486#define _ISOC99_SOURCE 1
4487EOF
4488
4489	tcl_flags="$tcl_flags _ISOC99_SOURCE"
4490    fi
4491
4492    
4493    if eval "test \"`echo '$''{'tcl_cv_flag__largefile64_source'+set}'`\" = set"; then
4494  echo $ac_n "(cached) $ac_c" 1>&6
4495else
4496  cat > conftest.$ac_ext <<EOF
4497#line 4498 "configure"
4498#include "confdefs.h"
4499#include <sys/stat.h>
4500int main() {
4501struct stat64 buf; int i = stat64("/", &buf);
4502; return 0; }
4503EOF
4504if { (eval echo configure:4505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4505  rm -rf conftest*
4506  tcl_cv_flag__largefile64_source=no
4507else
4508  echo "configure: failed program was:" >&5
4509  cat conftest.$ac_ext >&5
4510  rm -rf conftest*
4511  cat > conftest.$ac_ext <<EOF
4512#line 4513 "configure"
4513#include "confdefs.h"
4514#define _LARGEFILE64_SOURCE 1
4515#include <sys/stat.h>
4516int main() {
4517struct stat64 buf; int i = stat64("/", &buf);
4518; return 0; }
4519EOF
4520if { (eval echo configure:4521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4521  rm -rf conftest*
4522  tcl_cv_flag__largefile64_source=yes
4523else
4524  echo "configure: failed program was:" >&5
4525  cat conftest.$ac_ext >&5
4526  rm -rf conftest*
4527  tcl_cv_flag__largefile64_source=no
4528fi
4529rm -f conftest*
4530fi
4531rm -f conftest*
4532fi
4533
4534    if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
4535	cat >> confdefs.h <<\EOF
4536#define _LARGEFILE64_SOURCE 1
4537EOF
4538
4539	tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
4540    fi
4541
4542    
4543    if eval "test \"`echo '$''{'tcl_cv_flag__largefile_source64'+set}'`\" = set"; then
4544  echo $ac_n "(cached) $ac_c" 1>&6
4545else
4546  cat > conftest.$ac_ext <<EOF
4547#line 4548 "configure"
4548#include "confdefs.h"
4549#include <sys/stat.h>
4550int main() {
4551char *p = (char *)open64;
4552; return 0; }
4553EOF
4554if { (eval echo configure:4555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4555  rm -rf conftest*
4556  tcl_cv_flag__largefile_source64=no
4557else
4558  echo "configure: failed program was:" >&5
4559  cat conftest.$ac_ext >&5
4560  rm -rf conftest*
4561  cat > conftest.$ac_ext <<EOF
4562#line 4563 "configure"
4563#include "confdefs.h"
4564#define _LARGEFILE_SOURCE64 1
4565#include <sys/stat.h>
4566int main() {
4567char *p = (char *)open64;
4568; return 0; }
4569EOF
4570if { (eval echo configure:4571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4571  rm -rf conftest*
4572  tcl_cv_flag__largefile_source64=yes
4573else
4574  echo "configure: failed program was:" >&5
4575  cat conftest.$ac_ext >&5
4576  rm -rf conftest*
4577  tcl_cv_flag__largefile_source64=no
4578fi
4579rm -f conftest*
4580fi
4581rm -f conftest*
4582fi
4583
4584    if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then
4585	cat >> confdefs.h <<\EOF
4586#define _LARGEFILE_SOURCE64 1
4587EOF
4588
4589	tcl_flags="$tcl_flags _LARGEFILE_SOURCE64"
4590    fi
4591
4592    if test "x${tcl_flags}" = "x" ; then
4593	echo "$ac_t""none" 1>&6
4594    else
4595	echo "$ac_t""${tcl_flags}" 1>&6
4596    fi
4597
4598
4599
4600    echo $ac_n "checking for 64-bit integer type""... $ac_c" 1>&6
4601echo "configure:4602: checking for 64-bit integer type" >&5
4602    if eval "test \"`echo '$''{'tcl_cv_type_64bit'+set}'`\" = set"; then
4603  echo $ac_n "(cached) $ac_c" 1>&6
4604else
4605  
4606	tcl_cv_type_64bit=none
4607	# See if the compiler knows natively about __int64
4608	cat > conftest.$ac_ext <<EOF
4609#line 4610 "configure"
4610#include "confdefs.h"
4611
4612int main() {
4613__int64 value = (__int64) 0;
4614; return 0; }
4615EOF
4616if { (eval echo configure:4617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4617  rm -rf conftest*
4618  tcl_type_64bit=__int64
4619else
4620  echo "configure: failed program was:" >&5
4621  cat conftest.$ac_ext >&5
4622  rm -rf conftest*
4623  tcl_type_64bit="long long"
4624fi
4625rm -f conftest*
4626	# See if we should use long anyway  Note that we substitute in the
4627	# type that is our current guess for a 64-bit type inside this check
4628	# program, so it should be modified only carefully...
4629        cat > conftest.$ac_ext <<EOF
4630#line 4631 "configure"
4631#include "confdefs.h"
4632
4633int main() {
4634switch (0) { 
4635            case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; 
4636        }
4637; return 0; }
4638EOF
4639if { (eval echo configure:4640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4640  rm -rf conftest*
4641  tcl_cv_type_64bit=${tcl_type_64bit}
4642else
4643  echo "configure: failed program was:" >&5
4644  cat conftest.$ac_ext >&5
4645fi
4646rm -f conftest*
4647fi
4648
4649    if test "${tcl_cv_type_64bit}" = none ; then
4650	cat >> confdefs.h <<\EOF
4651#define TCL_WIDE_INT_IS_LONG 1
4652EOF
4653
4654	echo "$ac_t""using long" 1>&6
4655    else
4656	cat >> confdefs.h <<EOF
4657#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}
4658EOF
4659
4660	echo "$ac_t""${tcl_cv_type_64bit}" 1>&6
4661
4662	# Now check for auxiliary declarations
4663	echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6
4664echo "configure:4665: checking for struct dirent64" >&5
4665if eval "test \"`echo '$''{'tcl_cv_struct_dirent64'+set}'`\" = set"; then
4666  echo $ac_n "(cached) $ac_c" 1>&6
4667else
4668  
4669	    cat > conftest.$ac_ext <<EOF
4670#line 4671 "configure"
4671#include "confdefs.h"
4672#include <sys/types.h>
4673#include <sys/dirent.h>
4674int main() {
4675struct dirent64 p;
4676; return 0; }
4677EOF
4678if { (eval echo configure:4679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4679  rm -rf conftest*
4680  tcl_cv_struct_dirent64=yes
4681else
4682  echo "configure: failed program was:" >&5
4683  cat conftest.$ac_ext >&5
4684  rm -rf conftest*
4685  tcl_cv_struct_dirent64=no
4686fi
4687rm -f conftest*
4688fi
4689
4690echo "$ac_t""$tcl_cv_struct_dirent64" 1>&6
4691	if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
4692	    cat >> confdefs.h <<\EOF
4693#define HAVE_STRUCT_DIRENT64 1
4694EOF
4695
4696	fi
4697
4698	echo $ac_n "checking for struct stat64""... $ac_c" 1>&6
4699echo "configure:4700: checking for struct stat64" >&5
4700if eval "test \"`echo '$''{'tcl_cv_struct_stat64'+set}'`\" = set"; then
4701  echo $ac_n "(cached) $ac_c" 1>&6
4702else
4703  
4704	    cat > conftest.$ac_ext <<EOF
4705#line 4706 "configure"
4706#include "confdefs.h"
4707#include <sys/stat.h>
4708int main() {
4709struct stat64 p;
4710
4711; return 0; }
4712EOF
4713if { (eval echo configure:4714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4714  rm -rf conftest*
4715  tcl_cv_struct_stat64=yes
4716else
4717  echo "configure: failed program was:" >&5
4718  cat conftest.$ac_ext >&5
4719  rm -rf conftest*
4720  tcl_cv_struct_stat64=no
4721fi
4722rm -f conftest*
4723fi
4724
4725echo "$ac_t""$tcl_cv_struct_stat64" 1>&6
4726	if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
4727	    cat >> confdefs.h <<\EOF
4728#define HAVE_STRUCT_STAT64 1
4729EOF
4730
4731	fi
4732
4733	for ac_func in open64 lseek64
4734do
4735echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4736echo "configure:4737: checking for $ac_func" >&5
4737if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4738  echo $ac_n "(cached) $ac_c" 1>&6
4739else
4740  cat > conftest.$ac_ext <<EOF
4741#line 4742 "configure"
4742#include "confdefs.h"
4743/* System header to define __stub macros and hopefully few prototypes,
4744    which can conflict with char $ac_func(); below.  */
4745#include <assert.h>
4746/* Override any gcc2 internal prototype to avoid an error.  */
4747/* We use char because int might match the return type of a gcc2
4748    builtin and then its argument prototype would still apply.  */
4749char $ac_func();
4750
4751int main() {
4752
4753/* The GNU C library defines this for functions which it implements
4754    to always fail with ENOSYS.  Some functions are actually named
4755    something starting with __ and the normal name is an alias.  */
4756#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4757choke me
4758#else
4759$ac_func();
4760#endif
4761
4762; return 0; }
4763EOF
4764if { (eval echo configure:4765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4765  rm -rf conftest*
4766  eval "ac_cv_func_$ac_func=yes"
4767else
4768  echo "configure: failed program was:" >&5
4769  cat conftest.$ac_ext >&5
4770  rm -rf conftest*
4771  eval "ac_cv_func_$ac_func=no"
4772fi
4773rm -f conftest*
4774fi
4775
4776if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4777  echo "$ac_t""yes" 1>&6
4778    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4779  cat >> confdefs.h <<EOF
4780#define $ac_tr_func 1
4781EOF
4782 
4783else
4784  echo "$ac_t""no" 1>&6
4785fi
4786done
4787
4788	echo $ac_n "checking for off64_t""... $ac_c" 1>&6
4789echo "configure:4790: checking for off64_t" >&5
4790	if eval "test \"`echo '$''{'tcl_cv_type_off64_t'+set}'`\" = set"; then
4791  echo $ac_n "(cached) $ac_c" 1>&6
4792else
4793  
4794	    cat > conftest.$ac_ext <<EOF
4795#line 4796 "configure"
4796#include "confdefs.h"
4797#include <sys/types.h>
4798int main() {
4799off64_t offset;
4800
4801; return 0; }
4802EOF
4803if { (eval echo configure:4804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4804  rm -rf conftest*
4805  tcl_cv_type_off64_t=yes
4806else
4807  echo "configure: failed program was:" >&5
4808  cat conftest.$ac_ext >&5
4809  rm -rf conftest*
4810  tcl_cv_type_off64_t=no
4811fi
4812rm -f conftest*
4813fi
4814
4815			if test "x${tcl_cv_type_off64_t}" = "xyes" && \
4816	        test "x${ac_cv_func_lseek64}" = "xyes" && \
4817	        test "x${ac_cv_func_open64}" = "xyes" ; then
4818	    cat >> confdefs.h <<\EOF
4819#define HAVE_TYPE_OFF64_T 1
4820EOF
4821
4822	    echo "$ac_t""yes" 1>&6
4823	else
4824	    echo "$ac_t""no" 1>&6
4825	fi
4826    fi
4827
4828
4829#--------------------------------------------------------------------
4830#	Check endianness because we can optimize comparisons of
4831#	Tcl_UniChar strings to memcmp on big-endian systems.
4832#--------------------------------------------------------------------
4833
4834echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4835echo "configure:4836: checking whether byte ordering is bigendian" >&5
4836if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
4837  echo $ac_n "(cached) $ac_c" 1>&6
4838else
4839  ac_cv_c_bigendian=unknown
4840# See if sys/param.h defines the BYTE_ORDER macro.
4841cat > conftest.$ac_ext <<EOF
4842#line 4843 "configure"
4843#include "confdefs.h"
4844#include <sys/types.h>
4845#include <sys/param.h>
4846int main() {
4847
4848#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4849 bogus endian macros
4850#endif
4851; return 0; }
4852EOF
4853if { (eval echo configure:4854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4854  rm -rf conftest*
4855  # It does; now see whether it defined to BIG_ENDIAN or not.
4856cat > conftest.$ac_ext <<EOF
4857#line 4858 "configure"
4858#include "confdefs.h"
4859#include <sys/types.h>
4860#include <sys/param.h>
4861int main() {
4862
4863#if BYTE_ORDER != BIG_ENDIAN
4864 not big endian
4865#endif
4866; return 0; }
4867EOF
4868if { (eval echo configure:4869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4869  rm -rf conftest*
4870  ac_cv_c_bigendian=yes
4871else
4872  echo "configure: failed program was:" >&5
4873  cat conftest.$ac_ext >&5
4874  rm -rf conftest*
4875  ac_cv_c_bigendian=no
4876fi
4877rm -f conftest*
4878else
4879  echo "configure: failed program was:" >&5
4880  cat conftest.$ac_ext >&5
4881fi
4882rm -f conftest*
4883if test $ac_cv_c_bigendian = unknown; then
4884if test "$cross_compiling" = yes; then
4885    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
4886else
4887  cat > conftest.$ac_ext <<EOF
4888#line 4889 "configure"
4889#include "confdefs.h"
4890main () {
4891  /* Are we little or big endian?  From Harbison&Steele.  */
4892  union
4893  {
4894    long l;
4895    char c[sizeof (long)];
4896  } u;
4897  u.l = 1;
4898  exit (u.c[sizeof (long) - 1] == 1);
4899}
4900EOF
4901if { (eval echo configure:4902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4902then
4903  ac_cv_c_bigendian=no
4904else
4905  echo "configure: failed program was:" >&5
4906  cat conftest.$ac_ext >&5
4907  rm -fr conftest*
4908  ac_cv_c_bigendian=yes
4909fi
4910rm -fr conftest*
4911fi
4912
4913fi
4914fi
4915
4916echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4917if test $ac_cv_c_bigendian = yes; then
4918  cat >> confdefs.h <<\EOF
4919#define WORDS_BIGENDIAN 1
4920EOF
4921
4922fi
4923
4924
4925#--------------------------------------------------------------------
4926#	Supply substitutes for missing POSIX library procedures, or
4927#	set flags so Tcl uses alternate procedures.
4928#--------------------------------------------------------------------
4929
4930# Check if Posix compliant getcwd exists, if not we'll use getwd.
4931for ac_func in getcwd
4932do
4933echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4934echo "configure:4935: checking for $ac_func" >&5
4935if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4936  echo $ac_n "(cached) $ac_c" 1>&6
4937else
4938  cat > conftest.$ac_ext <<EOF
4939#line 4940 "configure"
4940#include "confdefs.h"
4941/* System header to define __stub macros and hopefully few prototypes,
4942    which can conflict with char $ac_func(); below.  */
4943#include <assert.h>
4944/* Override any gcc2 internal prototype to avoid an error.  */
4945/* We use char because int might match the return type of a gcc2
4946    builtin and then its argument prototype would still apply.  */
4947char $ac_func();
4948
4949int main() {
4950
4951/* The GNU C library defines this for functions which it implements
4952    to always fail with ENOSYS.  Some functions are actually named
4953    something starting with __ and the normal name is an alias.  */
4954#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4955choke me
4956#else
4957$ac_func();
4958#endif
4959
4960; return 0; }
4961EOF
4962if { (eval echo configure:4963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4963  rm -rf conftest*
4964  eval "ac_cv_func_$ac_func=yes"
4965else
4966  echo "configure: failed program was:" >&5
4967  cat conftest.$ac_ext >&5
4968  rm -rf conftest*
4969  eval "ac_cv_func_$ac_func=no"
4970fi
4971rm -f conftest*
4972fi
4973
4974if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4975  echo "$ac_t""yes" 1>&6
4976    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4977  cat >> confdefs.h <<EOF
4978#define $ac_tr_func 1
4979EOF
4980 
4981else
4982  echo "$ac_t""no" 1>&6
4983cat >> confdefs.h <<\EOF
4984#define USEGETWD 1
4985EOF
4986
4987fi
4988done
4989
4990# Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really
4991# define USEGETWD even if the posix getcwd exists. Add a test ?
4992
4993for ac_func in opendir strstr strtol strtoll strtoull tmpnam waitpid
4994do
4995echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4996echo "configure:4997: checking for $ac_func" >&5
4997if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4998  echo $ac_n "(cached) $ac_c" 1>&6
4999else
5000  cat > conftest.$ac_ext <<EOF
5001#line 5002 "configure"
5002#include "confdefs.h"
5003/* System header to define __stub macros and hopefully few prototypes,
5004    which can conflict with char $ac_func(); below.  */
5005#include <assert.h>
5006/* Override any gcc2 internal prototype to avoid an error.  */
5007/* We use char because int might match the return type of a gcc2
5008    builtin and then its argument prototype would still apply.  */
5009char $ac_func();
5010
5011int main() {
5012
5013/* The GNU C library defines this for functions which it implements
5014    to always fail with ENOSYS.  Some functions are actually named
5015    something starting with __ and the normal name is an alias.  */
5016#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5017choke me
5018#else
5019$ac_func();
5020#endif
5021
5022; return 0; }
5023EOF
5024if { (eval echo configure:5025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5025  rm -rf conftest*
5026  eval "ac_cv_func_$ac_func=yes"
5027else
5028  echo "configure: failed program was:" >&5
5029  cat conftest.$ac_ext >&5
5030  rm -rf conftest*
5031  eval "ac_cv_func_$ac_func=no"
5032fi
5033rm -f conftest*
5034fi
5035
5036if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5037  echo "$ac_t""yes" 1>&6
5038    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5039  cat >> confdefs.h <<EOF
5040#define $ac_tr_func 1
5041EOF
5042 
5043else
5044  echo "$ac_t""no" 1>&6
5045LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
5046fi
5047done
5048
5049
5050echo $ac_n "checking for strerror""... $ac_c" 1>&6
5051echo "configure:5052: checking for strerror" >&5
5052if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
5053  echo $ac_n "(cached) $ac_c" 1>&6
5054else
5055  cat > conftest.$ac_ext <<EOF
5056#line 5057 "configure"
5057#include "confdefs.h"
5058/* System header to define __stub macros and hopefully few prototypes,
5059    which can conflict with char strerror(); below.  */
5060#include <assert.h>
5061/* Override any gcc2 internal prototype to avoid an error.  */
5062/* We use char because int might match the return type of a gcc2
5063    builtin and then its argument prototype would still apply.  */
5064char strerror();
5065
5066int main() {
5067
5068/* The GNU C library defines this for functions which it implements
5069    to always fail with ENOSYS.  Some functions are actually named
5070    something starting with __ and the normal name is an alias.  */
5071#if defined (__stub_strerror) || defined (__stub___strerror)
5072choke me
5073#else
5074strerror();
5075#endif
5076
5077; return 0; }
5078EOF
5079if { (eval echo configure:5080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5080  rm -rf conftest*
5081  eval "ac_cv_func_strerror=yes"
5082else
5083  echo "configure: failed program was:" >&5
5084  cat conftest.$ac_ext >&5
5085  rm -rf conftest*
5086  eval "ac_cv_func_strerror=no"
5087fi
5088rm -f conftest*
5089fi
5090
5091if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then
5092  echo "$ac_t""yes" 1>&6
5093  :
5094else
5095  echo "$ac_t""no" 1>&6
5096cat >> confdefs.h <<\EOF
5097#define NO_STRERROR 1
5098EOF
5099
5100fi
5101
5102echo $ac_n "checking for getwd""... $ac_c" 1>&6
5103echo "configure:5104: checking for getwd" >&5
5104if eval "test \"`echo '$''{'ac_cv_func_getwd'+set}'`\" = set"; then
5105  echo $ac_n "(cached) $ac_c" 1>&6
5106else
5107  cat > conftest.$ac_ext <<EOF
5108#line 5109 "configure"
5109#include "confdefs.h"
5110/* System header to define __stub macros and hopefully few prototypes,
5111    which can conflict with char getwd(); below.  */
5112#include <assert.h>
5113/* Override any gcc2 internal prototype to avoid an error.  */
5114/* We use char because int might match the return type of a gcc2
5115    builtin and then its argument prototype would still apply.  */
5116char getwd();
5117
5118int main() {
5119
5120/* The GNU C library defines this for functions which it implements
5121    to always fail with ENOSYS.  Some functions are actually named
5122    something starting with __ and the normal name is an alias.  */
5123#if defined (__stub_getwd) || defined (__stub___getwd)
5124choke me
5125#else
5126getwd();
5127#endif
5128
5129; return 0; }
5130EOF
5131if { (eval echo configure:5132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5132  rm -rf conftest*
5133  eval "ac_cv_func_getwd=yes"
5134else
5135  echo "configure: failed program was:" >&5
5136  cat conftest.$ac_ext >&5
5137  rm -rf conftest*
5138  eval "ac_cv_func_getwd=no"
5139fi
5140rm -f conftest*
5141fi
5142
5143if eval "test \"`echo '$ac_cv_func_'getwd`\" = yes"; then
5144  echo "$ac_t""yes" 1>&6
5145  :
5146else
5147  echo "$ac_t""no" 1>&6
5148cat >> confdefs.h <<\EOF
5149#define NO_GETWD 1
5150EOF
5151
5152fi
5153
5154echo $ac_n "checking for wait3""... $ac_c" 1>&6
5155echo "configure:5156: checking for wait3" >&5
5156if eval "test \"`echo '$''{'ac_cv_func_wait3'+set}'`\" = set"; then
5157  echo $ac_n "(cached) $ac_c" 1>&6
5158else
5159  cat > conftest.$ac_ext <<EOF
5160#line 5161 "configure"
5161#include "confdefs.h"
5162/* System header to define __stub macros and hopefully few prototypes,
5163    which can conflict with char wait3(); below.  */
5164#include <assert.h>
5165/* Override any gcc2 internal prototype to avoid an error.  */
5166/* We use char because int might match the return type of a gcc2
5167    builtin and then its argument prototype would still apply.  */
5168char wait3();
5169
5170int main() {
5171
5172/* The GNU C library defines this for functions which it implements
5173    to always fail with ENOSYS.  Some functions are actually named
5174    something starting with __ and the normal name is an alias.  */
5175#if defined (__stub_wait3) || defined (__stub___wait3)
5176choke me
5177#else
5178wait3();
5179#endif
5180
5181; return 0; }
5182EOF
5183if { (eval echo configure:5184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5184  rm -rf conftest*
5185  eval "ac_cv_func_wait3=yes"
5186else
5187  echo "configure: failed program was:" >&5
5188  cat conftest.$ac_ext >&5
5189  rm -rf conftest*
5190  eval "ac_cv_func_wait3=no"
5191fi
5192rm -f conftest*
5193fi
5194
5195if eval "test \"`echo '$ac_cv_func_'wait3`\" = yes"; then
5196  echo "$ac_t""yes" 1>&6
5197  :
5198else
5199  echo "$ac_t""no" 1>&6
5200cat >> confdefs.h <<\EOF
5201#define NO_WAIT3 1
5202EOF
5203
5204fi
5205
5206echo $ac_n "checking for uname""... $ac_c" 1>&6
5207echo "configure:5208: checking for uname" >&5
5208if eval "test \"`echo '$''{'ac_cv_func_uname'+set}'`\" = set"; then
5209  echo $ac_n "(cached) $ac_c" 1>&6
5210else
5211  cat > conftest.$ac_ext <<EOF
5212#line 5213 "configure"
5213#include "confdefs.h"
5214/* System header to define __stub macros and hopefully few prototypes,
5215    which can conflict with char uname(); below.  */
5216#include <assert.h>
5217/* Override any gcc2 internal prototype to avoid an error.  */
5218/* We use char because int might match the return type of a gcc2
5219    builtin and then its argument prototype would still apply.  */
5220char uname();
5221
5222int main() {
5223
5224/* The GNU C library defines this for functions which it implements
5225    to always fail with ENOSYS.  Some functions are actually named
5226    something starting with __ and the normal name is an alias.  */
5227#if defined (__stub_uname) || defined (__stub___uname)
5228choke me
5229#else
5230uname();
5231#endif
5232
5233; return 0; }
5234EOF
5235if { (eval echo configure:5236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5236  rm -rf conftest*
5237  eval "ac_cv_func_uname=yes"
5238else
5239  echo "configure: failed program was:" >&5
5240  cat conftest.$ac_ext >&5
5241  rm -rf conftest*
5242  eval "ac_cv_func_uname=no"
5243fi
5244rm -f conftest*
5245fi
5246
5247if eval "test \"`echo '$ac_cv_func_'uname`\" = yes"; then
5248  echo "$ac_t""yes" 1>&6
5249  :
5250else
5251  echo "$ac_t""no" 1>&6
5252cat >> confdefs.h <<\EOF
5253#define NO_UNAME 1
5254EOF
5255
5256fi
5257
5258
5259if test "`uname -s`" = "Darwin" && test "${TCL_THREADS}" = 1 && \
5260	test "`uname -r | awk -F. '{print $1}'`" -lt 7; then
5261    # prior to Darwin 7, realpath is not threadsafe, so don't
5262    # use it when threads are enabled, c.f. bug # 711232
5263    ac_cv_func_realpath=no
5264fi
5265echo $ac_n "checking for realpath""... $ac_c" 1>&6
5266echo "configure:5267: checking for realpath" >&5
5267if eval "test \"`echo '$''{'ac_cv_func_realpath'+set}'`\" = set"; then
5268  echo $ac_n "(cached) $ac_c" 1>&6
5269else
5270  cat > conftest.$ac_ext <<EOF
5271#line 5272 "configure"
5272#include "confdefs.h"
5273/* System header to define __stub macros and hopefully few prototypes,
5274    which can conflict with char realpath(); below.  */
5275#include <assert.h>
5276/* Override any gcc2 internal prototype to avoid an error.  */
5277/* We use char because int might match the return type of a gcc2
5278    builtin and then its argument prototype would still apply.  */
5279char realpath();
5280
5281int main() {
5282
5283/* The GNU C library defines this for functions which it implements
5284    to always fail with ENOSYS.  Some functions are actually named
5285    something starting with __ and the normal name is an alias.  */
5286#if defined (__stub_realpath) || defined (__stub___realpath)
5287choke me
5288#else
5289realpath();
5290#endif
5291
5292; return 0; }
5293EOF
5294if { (eval echo configure:5295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5295  rm -rf conftest*
5296  eval "ac_cv_func_realpath=yes"
5297else
5298  echo "configure: failed program was:" >&5
5299  cat conftest.$ac_ext >&5
5300  rm -rf conftest*
5301  eval "ac_cv_func_realpath=no"
5302fi
5303rm -f conftest*
5304fi
5305
5306if eval "test \"`echo '$ac_cv_func_'realpath`\" = yes"; then
5307  echo "$ac_t""yes" 1>&6
5308  :
5309else
5310  echo "$ac_t""no" 1>&6
5311cat >> confdefs.h <<\EOF
5312#define NO_REALPATH 1
5313EOF
5314
5315fi
5316
5317
5318#--------------------------------------------------------------------
5319#	Look for thread-safe variants of some library functions.
5320#--------------------------------------------------------------------
5321
5322if test "${TCL_THREADS}" = 1; then
5323    echo $ac_n "checking for getpwuid_r""... $ac_c" 1>&6
5324echo "configure:5325: checking for getpwuid_r" >&5
5325if eval "test \"`echo '$''{'ac_cv_func_getpwuid_r'+set}'`\" = set"; then
5326  echo $ac_n "(cached) $ac_c" 1>&6
5327else
5328  cat > conftest.$ac_ext <<EOF
5329#line 5330 "configure"
5330#include "confdefs.h"
5331/* System header to define __stub macros and hopefully few prototypes,
5332    which can conflict with char getpwuid_r(); below.  */
5333#include <assert.h>
5334/* Override any gcc2 internal prototype to avoid an error.  */
5335/* We use char because int might match the return type of a gcc2
5336    builtin and then its argument prototype would still apply.  */
5337char getpwuid_r();
5338
5339int main() {
5340
5341/* The GNU C library defines this for functions which it implements
5342    to always fail with ENOSYS.  Some functions are actually named
5343    something starting with __ and the normal name is an alias.  */
5344#if defined (__stub_getpwuid_r) || defined (__stub___getpwuid_r)
5345choke me
5346#else
5347getpwuid_r();
5348#endif
5349
5350; return 0; }
5351EOF
5352if { (eval echo configure:5353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5353  rm -rf conftest*
5354  eval "ac_cv_func_getpwuid_r=yes"
5355else
5356  echo "configure: failed program was:" >&5
5357  cat conftest.$ac_ext >&5
5358  rm -rf conftest*
5359  eval "ac_cv_func_getpwuid_r=no"
5360fi
5361rm -f conftest*
5362fi
5363
5364if eval "test \"`echo '$ac_cv_func_'getpwuid_r`\" = yes"; then
5365  echo "$ac_t""yes" 1>&6
5366  
5367    echo $ac_n "checking for getpwuid_r with 5 args""... $ac_c" 1>&6
5368echo "configure:5369: checking for getpwuid_r with 5 args" >&5
5369if eval "test \"`echo '$''{'tcl_cv_api_getpwuid_r_5'+set}'`\" = set"; then
5370  echo $ac_n "(cached) $ac_c" 1>&6
5371else
5372  
5373    cat > conftest.$ac_ext <<EOF
5374#line 5375 "configure"
5375#include "confdefs.h"
5376
5377	#include <sys/types.h>
5378	#include <pwd.h>
5379    
5380int main() {
5381
5382	uid_t uid;
5383	struct passwd pw, *pwp;
5384	char buf[512];
5385	int buflen = 512;
5386
5387	(void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
5388    
5389; return 0; }
5390EOF
5391if { (eval echo configure:5392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5392  rm -rf conftest*
5393  tcl_cv_api_getpwuid_r_5=yes
5394else
5395  echo "configure: failed program was:" >&5
5396  cat conftest.$ac_ext >&5
5397  rm -rf conftest*
5398  tcl_cv_api_getpwuid_r_5=no
5399fi
5400rm -f conftest*
5401fi
5402
5403echo "$ac_t""$tcl_cv_api_getpwuid_r_5" 1>&6
5404    tcl_ok=$tcl_cv_api_getpwuid_r_5
5405    if test "$tcl_ok" = yes; then
5406	cat >> confdefs.h <<\EOF
5407#define HAVE_GETPWUID_R_5 1
5408EOF
5409
5410    else
5411	echo $ac_n "checking for getpwuid_r with 4 args""... $ac_c" 1>&6
5412echo "configure:5413: checking for getpwuid_r with 4 args" >&5
5413if eval "test \"`echo '$''{'tcl_cv_api_getpwuid_r_4'+set}'`\" = set"; then
5414  echo $ac_n "(cached) $ac_c" 1>&6
5415else
5416  
5417	cat > conftest.$ac_ext <<EOF
5418#line 5419 "configure"
5419#include "confdefs.h"
5420
5421	    #include <sys/types.h>
5422	    #include <pwd.h>
5423	
5424int main() {
5425
5426	    uid_t uid;
5427	    struct passwd pw;
5428	    char buf[512];
5429	    int buflen = 512;
5430
5431	    (void)getpwnam_r(uid, &pw, buf, buflen);
5432	
5433; return 0; }
5434EOF
5435if { (eval echo configure:5436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5436  rm -rf conftest*
5437  tcl_cv_api_getpwuid_r_4=yes
5438else
5439  echo "configure: failed program was:" >&5
5440  cat conftest.$ac_ext >&5
5441  rm -rf conftest*
5442  tcl_cv_api_getpwuid_r_4=no
5443fi
5444rm -f conftest*
5445fi
5446
5447echo "$ac_t""$tcl_cv_api_getpwuid_r_4" 1>&6
5448	tcl_ok=$tcl_cv_api_getpwuid_r_4
5449	if test "$tcl_ok" = yes; then
5450	    cat >> confdefs.h <<\EOF
5451#define HAVE_GETPWUID_R_4 1
5452EOF
5453
5454	fi
5455    fi
5456    if test "$tcl_ok" = yes; then
5457	cat >> confdefs.h <<\EOF
5458#define HAVE_GETPWUID_R 1
5459EOF
5460
5461    fi
5462
5463else
5464  echo "$ac_t""no" 1>&6
5465fi
5466
5467    echo $ac_n "checking for getpwnam_r""... $ac_c" 1>&6
5468echo "configure:5469: checking for getpwnam_r" >&5
5469if eval "test \"`echo '$''{'ac_cv_func_getpwnam_r'+set}'`\" = set"; then
5470  echo $ac_n "(cached) $ac_c" 1>&6
5471else
5472  cat > conftest.$ac_ext <<EOF
5473#line 5474 "configure"
5474#include "confdefs.h"
5475/* System header to define __stub macros and hopefully few prototypes,
5476    which can conflict with char getpwnam_r(); below.  */
5477#include <assert.h>
5478/* Override any gcc2 internal prototype to avoid an error.  */
5479/* We use char because int might match the return type of a gcc2
5480    builtin and then its argument prototype would still apply.  */
5481char getpwnam_r();
5482
5483int main() {
5484
5485/* The GNU C library defines this for functions which it implements
5486    to always fail with ENOSYS.  Some functions are actually named
5487    something starting with __ and the normal name is an alias.  */
5488#if defined (__stub_getpwnam_r) || defined (__stub___getpwnam_r)
5489choke me
5490#else
5491getpwnam_r();
5492#endif
5493
5494; return 0; }
5495EOF
5496if { (eval echo configure:5497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5497  rm -rf conftest*
5498  eval "ac_cv_func_getpwnam_r=yes"
5499else
5500  echo "configure: failed program was:" >&5
5501  cat conftest.$ac_ext >&5
5502  rm -rf conftest*
5503  eval "ac_cv_func_getpwnam_r=no"
5504fi
5505rm -f conftest*
5506fi
5507
5508if eval "test \"`echo '$ac_cv_func_'getpwnam_r`\" = yes"; then
5509  echo "$ac_t""yes" 1>&6
5510  
5511    echo $ac_n "checking for getpwnam_r with 5 args""... $ac_c" 1>&6
5512echo "configure:5513: checking for getpwnam_r with 5 args" >&5
5513if eval "test \"`echo '$''{'tcl_cv_api_getpwnam_r_5'+set}'`\" = set"; then
5514  echo $ac_n "(cached) $ac_c" 1>&6
5515else
5516  
5517    cat > conftest.$ac_ext <<EOF
5518#line 5519 "configure"
5519#include "confdefs.h"
5520
5521	#include <sys/types.h>
5522	#include <pwd.h>
5523    
5524int main() {
5525
5526	char *name;
5527	struct passwd pw, *pwp;
5528	char buf[512];
5529	int buflen = 512;
5530
5531	(void) getpwnam_r(name, &pw, buf, buflen, &pwp);
5532    
5533; return 0; }
5534EOF
5535if { (eval echo configure:5536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5536  rm -rf conftest*
5537  tcl_cv_api_getpwnam_r_5=yes
5538else
5539  echo "configure: failed program was:" >&5
5540  cat conftest.$ac_ext >&5
5541  rm -rf conftest*
5542  tcl_cv_api_getpwnam_r_5=no
5543fi
5544rm -f conftest*
5545fi
5546
5547echo "$ac_t""$tcl_cv_api_getpwnam_r_5" 1>&6
5548    tcl_ok=$tcl_cv_api_getpwnam_r_5
5549    if test "$tcl_ok" = yes; then
5550	cat >> confdefs.h <<\EOF
5551#define HAVE_GETPWNAM_R_5 1
5552EOF
5553
5554    else
5555	echo $ac_n "checking for getpwnam_r with 4 args""... $ac_c" 1>&6
5556echo "configure:5557: checking for getpwnam_r with 4 args" >&5
5557if eval "test \"`echo '$''{'tcl_cv_api_getpwnam_r_4'+set}'`\" = set"; then
5558  echo $ac_n "(cached) $ac_c" 1>&6
5559else
5560  
5561	cat > conftest.$ac_ext <<EOF
5562#line 5563 "configure"
5563#include "confdefs.h"
5564
5565	    #include <sys/types.h>
5566	    #include <pwd.h>
5567	
5568int main() {
5569
5570	    char *name;
5571	    struct passwd pw;
5572	    char buf[512];
5573	    int buflen = 512;
5574
5575	    (void)getpwnam_r(name, &pw, buf, buflen);
5576	
5577; return 0; }
5578EOF
5579if { (eval echo configure:5580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5580  rm -rf conftest*
5581  tcl_cv_api_getpwnam_r_4=yes
5582else
5583  echo "configure: failed program was:" >&5
5584  cat conftest.$ac_ext >&5
5585  rm -rf conftest*
5586  tcl_cv_api_getpwnam_r_4=no
5587fi
5588rm -f conftest*
5589fi
5590
5591echo "$ac_t""$tcl_cv_api_getpwnam_r_4" 1>&6
5592	tcl_ok=$tcl_cv_api_getpwnam_r_4
5593	if test "$tcl_ok" = yes; then
5594	    cat >> confdefs.h <<\EOF
5595#define HAVE_GETPWNAM_R_4 1
5596EOF
5597
5598	fi
5599    fi
5600    if test "$tcl_ok" = yes; then
5601	cat >> confdefs.h <<\EOF
5602#define HAVE_GETPWNAM_R 1
5603EOF
5604
5605    fi
5606
5607else
5608  echo "$ac_t""no" 1>&6
5609fi
5610
5611    echo $ac_n "checking for getgrgid_r""... $ac_c" 1>&6
5612echo "configure:5613: checking for getgrgid_r" >&5
5613if eval "test \"`echo '$''{'ac_cv_func_getgrgid_r'+set}'`\" = set"; then
5614  echo $ac_n "(cached) $ac_c" 1>&6
5615else
5616  cat > conftest.$ac_ext <<EOF
5617#line 5618 "configure"
5618#include "confdefs.h"
5619/* System header to define __stub macros and hopefully few prototypes,
5620    which can conflict with char getgrgid_r(); below.  */
5621#include <assert.h>
5622/* Override any gcc2 internal prototype to avoid an error.  */
5623/* We use char because int might match the return type of a gcc2
5624    builtin and then its argument prototype would still apply.  */
5625char getgrgid_r();
5626
5627int main() {
5628
5629/* The GNU C library defines this for functions which it implements
5630    to always fail with ENOSYS.  Some functions are actually named
5631    something starting with __ and the normal name is an alias.  */
5632#if defined (__stub_getgrgid_r) || defined (__stub___getgrgid_r)
5633choke me
5634#else
5635getgrgid_r();
5636#endif
5637
5638; return 0; }
5639EOF
5640if { (eval echo configure:5641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5641  rm -rf conftest*
5642  eval "ac_cv_func_getgrgid_r=yes"
5643else
5644  echo "configure: failed program was:" >&5
5645  cat conftest.$ac_ext >&5
5646  rm -rf conftest*
5647  eval "ac_cv_func_getgrgid_r=no"
5648fi
5649rm -f conftest*
5650fi
5651
5652if eval "test \"`echo '$ac_cv_func_'getgrgid_r`\" = yes"; then
5653  echo "$ac_t""yes" 1>&6
5654  
5655    echo $ac_n "checking for getgrgid_r with 5 args""... $ac_c" 1>&6
5656echo "configure:5657: checking for getgrgid_r with 5 args" >&5
5657if eval "test \"`echo '$''{'tcl_cv_api_getgrgid_r_5'+set}'`\" = set"; then
5658  echo $ac_n "(cached) $ac_c" 1>&6
5659else
5660  
5661    cat > conftest.$ac_ext <<EOF
5662#line 5663 "configure"
5663#include "confdefs.h"
5664
5665	#include <sys/types.h>
5666	#include <grp.h>
5667    
5668int main() {
5669
5670	gid_t gid;
5671	struct group gr, *grp;
5672	char buf[512];
5673	int buflen = 512;
5674
5675	(void) getgrgid_r(gid, &gr, buf, buflen, &grp);
5676    
5677; return 0; }
5678EOF
5679if { (eval echo configure:5680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5680  rm -rf conftest*
5681  tcl_cv_api_getgrgid_r_5=yes
5682else
5683  echo "configure: failed program was:" >&5
5684  cat conftest.$ac_ext >&5
5685  rm -rf conftest*
5686  tcl_cv_api_getgrgid_r_5=no
5687fi
5688rm -f conftest*
5689fi
5690
5691echo "$ac_t""$tcl_cv_api_getgrgid_r_5" 1>&6
5692    tcl_ok=$tcl_cv_api_getgrgid_r_5
5693    if test "$tcl_ok" = yes; then
5694	cat >> confdefs.h <<\EOF
5695#define HAVE_GETGRGID_R_5 1
5696EOF
5697
5698    else
5699	echo $ac_n "checking for getgrgid_r with 4 args""... $ac_c" 1>&6
5700echo "configure:5701: checking for getgrgid_r with 4 args" >&5
5701if eval "test \"`echo '$''{'tcl_cv_api_getgrgid_r_4'+set}'`\" = set"; then
5702  echo $ac_n "(cached) $ac_c" 1>&6
5703else
5704  
5705	cat > conftest.$ac_ext <<EOF
5706#line 5707 "configure"
5707#include "confdefs.h"
5708
5709	    #include <sys/types.h>
5710	    #include <grp.h>
5711	
5712int main() {
5713
5714	    gid_t gid;
5715	    struct group gr;
5716	    char buf[512];
5717	    int buflen = 512;
5718
5719	    (void)getgrgid_r(gid, &gr, buf, buflen);
5720	
5721; return 0; }
5722EOF
5723if { (eval echo configure:5724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5724  rm -rf conftest*
5725  tcl_cv_api_getgrgid_r_4=yes
5726else
5727  echo "configure: failed program was:" >&5
5728  cat conftest.$ac_ext >&5
5729  rm -rf conftest*
5730  tcl_cv_api_getgrgid_r_4=no
5731fi
5732rm -f conftest*
5733fi
5734
5735echo "$ac_t""$tcl_cv_api_getgrgid_r_4" 1>&6
5736	tcl_ok=$tcl_cv_api_getgrgid_r_4
5737	if test "$tcl_ok" = yes; then
5738	    cat >> confdefs.h <<\EOF
5739#define HAVE_GETGRGID_R_4 1
5740EOF
5741
5742	fi
5743    fi
5744    if test "$tcl_ok" = yes; then
5745	cat >> confdefs.h <<\EOF
5746#define HAVE_GETGRGID_R 1
5747EOF
5748
5749    fi
5750
5751else
5752  echo "$ac_t""no" 1>&6
5753fi
5754
5755    echo $ac_n "checking for getgrnam_r""... $ac_c" 1>&6
5756echo "configure:5757: checking for getgrnam_r" >&5
5757if eval "test \"`echo '$''{'ac_cv_func_getgrnam_r'+set}'`\" = set"; then
5758  echo $ac_n "(cached) $ac_c" 1>&6
5759else
5760  cat > conftest.$ac_ext <<EOF
5761#line 5762 "configure"
5762#include "confdefs.h"
5763/* System header to define __stub macros and hopefully few prototypes,
5764    which can conflict with char getgrnam_r(); below.  */
5765#include <assert.h>
5766/* Override any gcc2 internal prototype to avoid an error.  */
5767/* We use char because int might match the return type of a gcc2
5768    builtin and then its argument prototype would still apply.  */
5769char getgrnam_r();
5770
5771int main() {
5772
5773/* The GNU C library defines this for functions which it implements
5774    to always fail with ENOSYS.  Some functions are actually named
5775    something starting with __ and the normal name is an alias.  */
5776#if defined (__stub_getgrnam_r) || defined (__stub___getgrnam_r)
5777choke me
5778#else
5779getgrnam_r();
5780#endif
5781
5782; return 0; }
5783EOF
5784if { (eval echo configure:5785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5785  rm -rf conftest*
5786  eval "ac_cv_func_getgrnam_r=yes"
5787else
5788  echo "configure: failed program was:" >&5
5789  cat conftest.$ac_ext >&5
5790  rm -rf conftest*
5791  eval "ac_cv_func_getgrnam_r=no"
5792fi
5793rm -f conftest*
5794fi
5795
5796if eval "test \"`echo '$ac_cv_func_'getgrnam_r`\" = yes"; then
5797  echo "$ac_t""yes" 1>&6
5798  
5799    echo $ac_n "checking for getgrnam_r with 5 args""... $ac_c" 1>&6
5800echo "configure:5801: checking for getgrnam_r with 5 args" >&5
5801if eval "test \"`echo '$''{'tcl_cv_api_getgrnam_r_5'+set}'`\" = set"; then
5802  echo $ac_n "(cached) $ac_c" 1>&6
5803else
5804  
5805    cat > conftest.$ac_ext <<EOF
5806#line 5807 "configure"
5807#include "confdefs.h"
5808
5809	#include <sys/types.h>
5810	#include <grp.h>
5811    
5812int main() {
5813
5814	char *name;
5815	struct group gr, *grp;
5816	char buf[512];
5817	int buflen = 512;
5818
5819	(void) getgrnam_r(name, &gr, buf, buflen, &grp);
5820    
5821; return 0; }
5822EOF
5823if { (eval echo configure:5824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5824  rm -rf conftest*
5825  tcl_cv_api_getgrnam_r_5=yes
5826else
5827  echo "configure: failed program was:" >&5
5828  cat conftest.$ac_ext >&5
5829  rm -rf conftest*
5830  tcl_cv_api_getgrnam_r_5=no
5831fi
5832rm -f conftest*
5833fi
5834
5835echo "$ac_t""$tcl_cv_api_getgrnam_r_5" 1>&6
5836    tcl_ok=$tcl_cv_api_getgrnam_r_5
5837    if test "$tcl_ok" = yes; then
5838	cat >> confdefs.h <<\EOF
5839#define HAVE_GETGRNAM_R_5 1
5840EOF
5841
5842    else
5843	echo $ac_n "checking for getgrnam_r with 4 args""... $ac_c" 1>&6
5844echo "configure:5845: checking for getgrnam_r with 4 args" >&5
5845if eval "test \"`echo '$''{'tcl_cv_api_getgrnam_r_4'+set}'`\" = set"; then
5846  echo $ac_n "(cached) $ac_c" 1>&6
5847else
5848  
5849	cat > conftest.$ac_ext <<EOF
5850#line 5851 "configure"
5851#include "confdefs.h"
5852
5853	    #include <sys/types.h>
5854	    #include <grp.h>
5855	
5856int main() {
5857
5858	    char *name;
5859	    struct group gr;
5860	    char buf[512];
5861	    int buflen = 512;
5862
5863	    (void)getgrnam_r(name, &gr, buf, buflen);
5864	
5865; return 0; }
5866EOF
5867if { (eval echo configure:5868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5868  rm -rf conftest*
5869  tcl_cv_api_getgrnam_r_4=yes
5870else
5871  echo "configure: failed program was:" >&5
5872  cat conftest.$ac_ext >&5
5873  rm -rf conftest*
5874  tcl_cv_api_getgrnam_r_4=no
5875fi
5876rm -f conftest*
5877fi
5878
5879echo "$ac_t""$tcl_cv_api_getgrnam_r_4" 1>&6
5880	tcl_ok=$tcl_cv_api_getgrnam_r_4
5881	if test "$tcl_ok" = yes; then
5882	    cat >> confdefs.h <<\EOF
5883#define HAVE_GETGRNAM_R_4 1
5884EOF
5885
5886	fi
5887    fi
5888    if test "$tcl_ok" = yes; then
5889	cat >> confdefs.h <<\EOF
5890#define HAVE_GETGRNAM_R 1
5891EOF
5892
5893    fi
5894
5895else
5896  echo "$ac_t""no" 1>&6
5897fi
5898
5899    if test "`uname -s`" = "Darwin" && \
5900	    test "`uname -r | awk -F. '{print $1}'`" -gt 5; then
5901	# Starting with Darwin 6 (Mac OSX 10.2), gethostbyX 
5902	# are actually MT-safe as they always return pointers
5903	# from the TSD instead of the static storage.
5904	cat >> confdefs.h <<\EOF
5905#define HAVE_MTSAFE_GETHOSTBYNAME 1
5906EOF
5907
5908	cat >> confdefs.h <<\EOF
5909#define HAVE_MTSAFE_GETHOSTBYADDR 1
5910EOF
5911
5912    elif test "`uname -s`" = "HP-UX" && \
5913	      test "`uname -r|sed -e 's|B\.||' -e 's|\..*$||'`" -gt 10; then
5914        # Starting with HPUX 11.00 (we believe), gethostbyX
5915        # are actually MT-safe as they always return pointers
5916	# from TSD instead of static storage.
5917	cat >> confdefs.h <<\EOF
5918#define HAVE_MTSAFE_GETHOSTBYNAME 1
5919EOF
5920
5921	cat >> confdefs.h <<\EOF
5922#define HAVE_MTSAFE_GETHOSTBYADDR 1
5923EOF
5924
5925    else
5926	echo $ac_n "checking for gethostbyname_r""... $ac_c" 1>&6
5927echo "configure:5928: checking for gethostbyname_r" >&5
5928if eval "test \"`echo '$''{'ac_cv_func_gethostbyname_r'+set}'`\" = set"; then
5929  echo $ac_n "(cached) $ac_c" 1>&6
5930else
5931  cat > conftest.$ac_ext <<EOF
5932#line 5933 "configure"
5933#include "confdefs.h"
5934/* System header to define __stub macros and hopefully few prototypes,
5935    which can conflict with char gethostbyname_r(); below.  */
5936#include <assert.h>
5937/* Override any gcc2 internal prototype to avoid an error.  */
5938/* We use char because int might match the return type of a gcc2
5939    builtin and then its argument prototype would still apply.  */
5940char gethostbyname_r();
5941
5942int main() {
5943
5944/* The GNU C library defines this for functions which it implements
5945    to always fail with ENOSYS.  Some functions are actually named
5946    something starting with __ and the normal name is an alias.  */
5947#if defined (__stub_gethostbyname_r) || defined (__stub___gethostbyname_r)
5948choke me
5949#else
5950gethostbyname_r();
5951#endif
5952
5953; return 0; }
5954EOF
5955if { (eval echo configure:5956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5956  rm -rf conftest*
5957  eval "ac_cv_func_gethostbyname_r=yes"
5958else
5959  echo "configure: failed program was:" >&5
5960  cat conftest.$ac_ext >&5
5961  rm -rf conftest*
5962  eval "ac_cv_func_gethostbyname_r=no"
5963fi
5964rm -f conftest*
5965fi
5966
5967if eval "test \"`echo '$ac_cv_func_'gethostbyname_r`\" = yes"; then
5968  echo "$ac_t""yes" 1>&6
5969  
5970    echo $ac_n "checking for gethostbyname_r with 6 args""... $ac_c" 1>&6
5971echo "configure:5972: checking for gethostbyname_r with 6 args" >&5
5972if eval "test \"`echo '$''{'tcl_cv_api_gethostbyname_r_6'+set}'`\" = set"; then
5973  echo $ac_n "(cached) $ac_c" 1>&6
5974else
5975  
5976    cat > conftest.$ac_ext <<EOF
5977#line 5978 "configure"
5978#include "confdefs.h"
5979
5980	#include <netdb.h>
5981    
5982int main() {
5983
5984	char *name;
5985	struct hostent *he, *res;
5986	char buffer[2048];
5987	int buflen = 2048;
5988	int h_errnop;
5989
5990	(void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
5991    
5992; return 0; }
5993EOF
5994if { (eval echo configure:5995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5995  rm -rf conftest*
5996  tcl_cv_api_gethostbyname_r_6=yes
5997else
5998  echo "configure: failed program was:" >&5
5999  cat conftest.$ac_ext >&5
6000  rm -rf conftest*
6001  tcl_cv_api_gethostbyname_r_6=no
6002fi
6003rm -f conftest*
6004fi
6005
6006echo "$ac_t""$tcl_cv_api_gethostbyname_r_6" 1>&6
6007    tcl_ok=$tcl_cv_api_gethostbyname_r_6
6008    if test "$tcl_ok" = yes; then
6009	cat >> confdefs.h <<\EOF
6010#define HAVE_GETHOSTBYNAME_R_6 1
6011EOF
6012
6013    else
6014	echo $ac_n "checking for gethostbyname_r with 5 args""... $ac_c" 1>&6
6015echo "configure:6016: checking for gethostbyname_r with 5 args" >&5
6016if eval "test \"`echo '$''{'tcl_cv_api_gethostbyname_r_5'+set}'`\" = set"; then
6017  echo $ac_n "(cached) $ac_c" 1>&6
6018else
6019  
6020	cat > conftest.$ac_ext <<EOF
6021#line 6022 "configure"
6022#include "confdefs.h"
6023
6024	    #include <netdb.h>
6025	
6026int main() {
6027
6028	    char *name;
6029	    struct hostent *he;
6030	    char buffer[2048];
6031	    int buflen = 2048;
6032	    int h_errnop;
6033
6034	    (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
6035	
6036; return 0; }
6037EOF
6038if { (eval echo configure:6039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6039  rm -rf conftest*
6040  tcl_cv_api_gethostbyname_r_5=yes
6041else
6042  echo "configure: failed program was:" >&5
6043  cat conftest.$ac_ext >&5
6044  rm -rf conftest*
6045  tcl_cv_api_gethostbyname_r_5=no
6046fi
6047rm -f conftest*
6048fi
6049
6050echo "$ac_t""$tcl_cv_api_gethostbyname_r_5" 1>&6
6051	tcl_ok=$tcl_cv_api_gethostbyname_r_5
6052	if test "$tcl_ok" = yes; then
6053	    cat >> confdefs.h <<\EOF
6054#define HAVE_GETHOSTBYNAME_R_5 1
6055EOF
6056
6057	else
6058	    echo $ac_n "checking for gethostbyname_r with 3 args""... $ac_c" 1>&6
6059echo "configure:6060: checking for gethostbyname_r with 3 args" >&5
6060if eval "test \"`echo '$''{'tcl_cv_api_gethostbyname_r_3'+set}'`\" = set"; then
6061  echo $ac_n "(cached) $ac_c" 1>&6
6062else
6063  
6064	    cat > conftest.$ac_ext <<EOF
6065#line 6066 "configure"
6066#include "confdefs.h"
6067
6068		#include <netdb.h>
6069	    
6070int main() {
6071
6072		char *name;
6073		struct hostent *he;
6074		struct hostent_data data;
6075
6076		(void) gethostbyname_r(name, he, &data);
6077	    
6078; return 0; }
6079EOF
6080if { (eval echo configure:6081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6081  rm -rf conftest*
6082  tcl_cv_api_gethostbyname_r_3=yes
6083else
6084  echo "configure: failed program was:" >&5
6085  cat conftest.$ac_ext >&5
6086  rm -rf conftest*
6087  tcl_cv_api_gethostbyname_r_3=no
6088fi
6089rm -f conftest*
6090fi
6091
6092echo "$ac_t""$tcl_cv_api_gethostbyname_r_3" 1>&6
6093	    tcl_ok=$tcl_cv_api_gethostbyname_r_3
6094	    if test "$tcl_ok" = yes; then
6095		cat >> confdefs.h <<\EOF
6096#define HAVE_GETHOSTBYNAME_R_3 1
6097EOF
6098
6099	    fi
6100	fi
6101    fi
6102    if test "$tcl_ok" = yes; then
6103	cat >> confdefs.h <<\EOF
6104#define HAVE_GETHOSTBYNAME_R 1
6105EOF
6106
6107    fi
6108
6109else
6110  echo "$ac_t""no" 1>&6
6111fi
6112
6113	echo $ac_n "checking for gethostbyaddr_r""... $ac_c" 1>&6
6114echo "configure:6115: checking for gethostbyaddr_r" >&5
6115if eval "test \"`echo '$''{'ac_cv_func_gethostbyaddr_r'+set}'`\" = set"; then
6116  echo $ac_n "(cached) $ac_c" 1>&6
6117else
6118  cat > conftest.$ac_ext <<EOF
6119#line 6120 "configure"
6120#include "confdefs.h"
6121/* System header to define __stub macros and hopefully few prototypes,
6122    which can conflict with char gethostbyaddr_r(); below.  */
6123#include <assert.h>
6124/* Override any gcc2 internal prototype to avoid an error.  */
6125/* We use char because int might match the return type of a gcc2
6126    builtin and then its argument prototype would still apply.  */
6127char gethostbyaddr_r();
6128
6129int main() {
6130
6131/* The GNU C library defines this for functions which it implements
6132    to always fail with ENOSYS.  Some functions are actually named
6133    something starting with __ and the normal name is an alias.  */
6134#if defined (__stub_gethostbyaddr_r) || defined (__stub___gethostbyaddr_r)
6135choke me
6136#else
6137gethostbyaddr_r();
6138#endif
6139
6140; return 0; }
6141EOF
6142if { (eval echo configure:6143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6143  rm -rf conftest*
6144  eval "ac_cv_func_gethostbyaddr_r=yes"
6145else
6146  echo "configure: failed program was:" >&5
6147  cat conftest.$ac_ext >&5
6148  rm -rf conftest*
6149  eval "ac_cv_func_gethostbyaddr_r=no"
6150fi
6151rm -f conftest*
6152fi
6153
6154if eval "test \"`echo '$ac_cv_func_'gethostbyaddr_r`\" = yes"; then
6155  echo "$ac_t""yes" 1>&6
6156  
6157    echo $ac_n "checking for gethostbyaddr_r with 7 args""... $ac_c" 1>&6
6158echo "configure:6159: checking for gethostbyaddr_r with 7 args" >&5
6159if eval "test \"`echo '$''{'tcl_cv_api_gethostbyaddr_r_7'+set}'`\" = set"; then
6160  echo $ac_n "(cached) $ac_c" 1>&6
6161else
6162  
6163    cat > conftest.$ac_ext <<EOF
6164#line 6165 "configure"
6165#include "confdefs.h"
6166
6167	#include <netdb.h>
6168    
6169int main() {
6170
6171	char *addr;
6172	int length;
6173	int type;
6174	struct hostent *result;
6175	char buffer[2048];
6176	int buflen = 2048;
6177	int h_errnop;
6178
6179	(void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
6180			       &h_errnop);
6181    
6182; return 0; }
6183EOF
6184if { (eval echo configure:6185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6185  rm -rf conftest*
6186  tcl_cv_api_gethostbyaddr_r_7=yes
6187else
6188  echo "configure: failed program was:" >&5
6189  cat conftest.$ac_ext >&5
6190  rm -rf conftest*
6191  tcl_cv_api_gethostbyaddr_r_7=no
6192fi
6193rm -f conftest*
6194fi
6195
6196echo "$ac_t""$tcl_cv_api_gethostbyaddr_r_7" 1>&6
6197    tcl_ok=$tcl_cv_api_gethostbyaddr_r_7
6198    if test "$tcl_ok" = yes; then
6199	cat >> confdefs.h <<\EOF
6200#define HAVE_GETHOSTBYADDR_R_7 1
6201EOF
6202
6203    else
6204	echo $ac_n "checking for gethostbyaddr_r with 8 args""... $ac_c" 1>&6
6205echo "configure:6206: checking for gethostbyaddr_r with 8 args" >&5
6206if eval "test \"`echo '$''{'tcl_cv_api_gethostbyaddr_r_8'+set}'`\" = set"; then
6207  echo $ac_n "(cached) $ac_c" 1>&6
6208else
6209  
6210	cat > conftest.$ac_ext <<EOF
6211#line 6212 "configure"
6212#include "confdefs.h"
6213
6214	    #include <netdb.h>
6215	
6216int main() {
6217
6218	    char *addr;
6219	    int length;
6220	    int type;
6221	    struct hostent *result, *resultp;
6222	    char buffer[2048];
6223	    int buflen = 2048;
6224	    int h_errnop;
6225
6226	    (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
6227				   &resultp, &h_errnop);
6228	
6229; return 0; }
6230EOF
6231if { (eval echo configure:6232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6232  rm -rf conftest*
6233  tcl_cv_api_gethostbyaddr_r_8=yes
6234else
6235  echo "configure: failed program was:" >&5
6236  cat conftest.$ac_ext >&5
6237  rm -rf conftest*
6238  tcl_cv_api_gethostbyaddr_r_8=no
6239fi
6240rm -f conftest*
6241fi
6242
6243echo "$ac_t""$tcl_cv_api_gethostbyaddr_r_8" 1>&6
6244	tcl_ok=$tcl_cv_api_gethostbyaddr_r_8
6245	if test "$tcl_ok" = yes; then
6246	    cat >> confdefs.h <<\EOF
6247#define HAVE_GETHOSTBYADDR_R_8 1
6248EOF
6249
6250	fi
6251    fi
6252    if test "$tcl_ok" = yes; then
6253	cat >> confdefs.h <<\EOF
6254#define HAVE_GETHOSTBYADDR_R 1
6255EOF
6256
6257    fi
6258
6259else
6260  echo "$ac_t""no" 1>&6
6261fi
6262
6263    fi
6264fi
6265
6266#---------------------------------------------------------------------------
6267#	Determine which interface to use to talk to the serial port.
6268#	Note that #include lines must begin in leftmost column for
6269#	some compilers to recognize them as preprocessor directives.
6270#---------------------------------------------------------------------------
6271
6272
6273    for ac_hdr in sys/modem.h
6274do
6275ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6276echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6277echo "configure:6278: checking for $ac_hdr" >&5
6278if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6279  echo $ac_n "(cached) $ac_c" 1>&6
6280else
6281  cat > conftest.$ac_ext <<EOF
6282#line 6283 "configure"
6283#include "confdefs.h"
6284#include <$ac_hdr>
6285EOF
6286ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6287{ (eval echo configure:6288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6288ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6289if test -z "$ac_err"; then
6290  rm -rf conftest*
6291  eval "ac_cv_header_$ac_safe=yes"
6292else
6293  echo "$ac_err" >&5
6294  echo "configure: failed program was:" >&5
6295  cat conftest.$ac_ext >&5
6296  rm -rf conftest*
6297  eval "ac_cv_header_$ac_safe=no"
6298fi
6299rm -f conftest*
6300fi
6301if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6302  echo "$ac_t""yes" 1>&6
6303    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6304  cat >> confdefs.h <<EOF
6305#define $ac_tr_hdr 1
6306EOF
6307 
6308else
6309  echo "$ac_t""no" 1>&6
6310fi
6311done
6312
6313    echo $ac_n "checking termios vs. termio vs. sgtty""... $ac_c" 1>&6
6314echo "configure:6315: checking termios vs. termio vs. sgtty" >&5
6315if eval "test \"`echo '$''{'tcl_cv_api_serial'+set}'`\" = set"; then
6316  echo $ac_n "(cached) $ac_c" 1>&6
6317else
6318  
6319    if test "$cross_compiling" = yes; then
6320  tcl_cv_api_serial=no
6321else
6322  cat > conftest.$ac_ext <<EOF
6323#line 6324 "configure"
6324#include "confdefs.h"
6325
6326#include <termios.h>
6327
6328int main() {
6329    struct termios t;
6330    if (tcgetattr(0, &t) == 0) {
6331	cfsetospeed(&t, 0);
6332	t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
6333	return 0;
6334    }
6335    return 1;
6336}
6337EOF
6338if { (eval echo configure:6339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6339then
6340  tcl_cv_api_serial=termios
6341else
6342  echo "configure: failed program was:" >&5
6343  cat conftest.$ac_ext >&5
6344  rm -fr conftest*
6345  tcl_cv_api_serial=no
6346fi
6347rm -fr conftest*
6348fi
6349
6350    if test $tcl_cv_api_serial = no ; then
6351	if test "$cross_compiling" = yes; then
6352  tcl_cv_api_serial=no
6353else
6354  cat > conftest.$ac_ext <<EOF
6355#line 6356 "configure"
6356#include "confdefs.h"
6357
6358#include <termio.h>
6359
6360int main() {
6361    struct termio t;
6362    if (ioctl(0, TCGETA, &t) == 0) {
6363	t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
6364	return 0;
6365    }
6366    return 1;
6367}
6368EOF
6369if { (eval echo configure:6370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6370then
6371  tcl_cv_api_serial=termio
6372else
6373  echo "configure: failed program was:" >&5
6374  cat conftest.$ac_ext >&5
6375  rm -fr conftest*
6376  tcl_cv_api_serial=no
6377fi
6378rm -fr conftest*
6379fi
6380
6381    fi
6382    if test $tcl_cv_api_serial = no ; then
6383	if test "$cross_compiling" = yes; then
6384  tcl_cv_api_serial=no
6385else
6386  cat > conftest.$ac_ext <<EOF
6387#line 6388 "configure"
6388#include "confdefs.h"
6389
6390#include <sgtty.h>
6391
6392int main() {
6393    struct sgttyb t;
6394    if (ioctl(0, TIOCGETP, &t) == 0) {
6395	t.sg_ospeed = 0;
6396	t.sg_flags |= ODDP | EVENP | RAW;
6397	return 0;
6398    }
6399    return 1;
6400}
6401EOF
6402if { (eval echo configure:6403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6403then
6404  tcl_cv_api_serial=sgtty
6405else
6406  echo "configure: failed program was:" >&5
6407  cat conftest.$ac_ext >&5
6408  rm -fr conftest*
6409  tcl_cv_api_serial=no
6410fi
6411rm -fr conftest*
6412fi
6413
6414    fi
6415    if test $tcl_cv_api_serial = no ; then
6416	if test "$cross_compiling" = yes; then
6417  tcl_cv_api_serial=no
6418else
6419  cat > conftest.$ac_ext <<EOF
6420#line 6421 "configure"
6421#include "confdefs.h"
6422
6423#include <termios.h>
6424#include <errno.h>
6425
6426int main() {
6427    struct termios t;
6428    if (tcgetattr(0, &t) == 0
6429	|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
6430	cfsetospeed(&t, 0);
6431	t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
6432	return 0;
6433    }
6434    return 1;
6435}
6436EOF
6437if { (eval echo configure:6438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6438then
6439  tcl_cv_api_serial=termios
6440else
6441  echo "configure: failed program was:" >&5
6442  cat conftest.$ac_ext >&5
6443  rm -fr conftest*
6444  tcl_cv_api_serial=no
6445fi
6446rm -fr conftest*
6447fi
6448
6449    fi
6450    if test $tcl_cv_api_serial = no; then
6451	if test "$cross_compiling" = yes; then
6452  tcl_cv_api_serial=no
6453else
6454  cat > conftest.$ac_ext <<EOF
6455#line 6456 "configure"
6456#include "confdefs.h"
6457
6458#include <termio.h>
6459#include <errno.h>
6460
6461int main() {
6462    struct termio t;
6463    if (ioctl(0, TCGETA, &t) == 0
6464	|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
6465	t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
6466	return 0;
6467    }
6468    return 1;
6469    }
6470EOF
6471if { (eval echo configure:6472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6472then
6473  tcl_cv_api_serial=termio
6474else
6475  echo "configure: failed program was:" >&5
6476  cat conftest.$ac_ext >&5
6477  rm -fr conftest*
6478  tcl_cv_api_serial=no
6479fi
6480rm -fr conftest*
6481fi
6482
6483    fi
6484    if test $tcl_cv_api_serial = no; then
6485	if test "$cross_compiling" = yes; then
6486  tcl_cv_api_serial=none
6487else
6488  cat > conftest.$ac_ext <<EOF
6489#line 6490 "configure"
6490#include "confdefs.h"
6491
6492#include <sgtty.h>
6493#include <errno.h>
6494
6495int main() {
6496    struct sgttyb t;
6497    if (ioctl(0, TIOCGETP, &t) == 0
6498	|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
6499	t.sg_ospeed = 0;
6500	t.sg_flags |= ODDP | EVENP | RAW;
6501	return 0;
6502    }
6503    return 1;
6504}
6505EOF
6506if { (eval echo configure:6507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6507then
6508  tcl_cv_api_serial=sgtty
6509else
6510  echo "configure: failed program was:" >&5
6511  cat conftest.$ac_ext >&5
6512  rm -fr conftest*
6513  tcl_cv_api_serial=none
6514fi
6515rm -fr conftest*
6516fi
6517
6518    fi
6519fi
6520
6521echo "$ac_t""$tcl_cv_api_serial" 1>&6
6522    case $tcl_cv_api_serial in
6523	termios) cat >> confdefs.h <<\EOF
6524#define USE_TERMIOS 1
6525EOF
6526;;
6527	termio)  cat >> confdefs.h <<\EOF
6528#define USE_TERMIO 1
6529EOF
6530;;
6531	sgtty)   cat >> confdefs.h <<\EOF
6532#define USE_SGTTY 1
6533EOF
6534;;
6535    esac
6536
6537
6538#--------------------------------------------------------------------
6539#	Include sys/select.h if it exists and if it supplies things
6540#	that appear to be useful and aren't already in sys/types.h.
6541#	This appears to be true only on the RS/6000 under AIX.  Some
6542#	systems like OSF/1 have a sys/select.h that's of no use, and
6543#	other systems like SCO UNIX have a sys/select.h that's
6544#	pernicious.  If "fd_set" isn't defined anywhere then set a
6545#	special flag.
6546#--------------------------------------------------------------------
6547
6548echo $ac_n "checking for fd_set in sys/types""... $ac_c" 1>&6
6549echo "configure:6550: checking for fd_set in sys/types" >&5
6550if eval "test \"`echo '$''{'tcl_cv_type_fd_set'+set}'`\" = set"; then
6551  echo $ac_n "(cached) $ac_c" 1>&6
6552else
6553  
6554    cat > conftest.$ac_ext <<EOF
6555#line 6556 "configure"
6556#include "confdefs.h"
6557#include <sys/types.h>
6558int main() {
6559fd_set readMask, writeMask;
6560; return 0; }
6561EOF
6562if { (eval echo configure:6563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6563  rm -rf conftest*
6564  tcl_cv_type_fd_set=yes
6565else
6566  echo "configure: failed program was:" >&5
6567  cat conftest.$ac_ext >&5
6568  rm -rf conftest*
6569  tcl_cv_type_fd_set=no
6570fi
6571rm -f conftest*
6572fi
6573
6574echo "$ac_t""$tcl_cv_type_fd_set" 1>&6
6575tcl_ok=$tcl_cv_type_fd_set
6576if test $tcl_ok = no; then
6577    echo $ac_n "checking for fd_mask in sys/select""... $ac_c" 1>&6
6578echo "configure:6579: checking for fd_mask in sys/select" >&5
6579if eval "test \"`echo '$''{'tcl_cv_grep_fd_mask'+set}'`\" = set"; then
6580  echo $ac_n "(cached) $ac_c" 1>&6
6581else
6582  
6583	cat > conftest.$ac_ext <<EOF
6584#line 6585 "configure"
6585#include "confdefs.h"
6586#include <sys/select.h>
6587EOF
6588if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6589  egrep "fd_mask" >/dev/null 2>&1; then
6590  rm -rf conftest*
6591  tcl_cv_grep_fd_mask=present
6592else
6593  rm -rf conftest*
6594  tcl_cv_grep_fd_mask=missing
6595fi
6596rm -f conftest*
6597
6598fi
6599
6600echo "$ac_t""$tcl_cv_grep_fd_mask" 1>&6
6601    if test $tcl_cv_grep_fd_mask = present; then
6602	cat >> confdefs.h <<\EOF
6603#define HAVE_SYS_SELECT_H 1
6604EOF
6605
6606	tcl_ok=yes
6607    fi
6608fi
6609if test $tcl_ok = no; then
6610    cat >> confdefs.h <<\EOF
6611#define NO_FD_SET 1
6612EOF
6613
6614fi
6615
6616#------------------------------------------------------------------------------
6617#       Find out all about time handling differences.
6618#------------------------------------------------------------------------------
6619
6620echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
6621echo "configure:6622: checking whether struct tm is in sys/time.h or time.h" >&5
6622if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
6623  echo $ac_n "(cached) $ac_c" 1>&6
6624else
6625  cat > conftest.$ac_ext <<EOF
6626#line 6627 "configure"
6627#include "confdefs.h"
6628#include <sys/types.h>
6629#include <time.h>
6630int main() {
6631struct tm *tp; tp->tm_sec;
6632; return 0; }
6633EOF
6634if { (eval echo configure:6635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6635  rm -rf conftest*
6636  ac_cv_struct_tm=time.h
6637else
6638  echo "configure: failed program was:" >&5
6639  cat conftest.$ac_ext >&5
6640  rm -rf conftest*
6641  ac_cv_struct_tm=sys/time.h
6642fi
6643rm -f conftest*
6644fi
6645
6646echo "$ac_t""$ac_cv_struct_tm" 1>&6
6647if test $ac_cv_struct_tm = sys/time.h; then
6648  cat >> confdefs.h <<\EOF
6649#define TM_IN_SYS_TIME 1
6650EOF
6651
6652fi
6653
6654
6655    for ac_hdr in sys/time.h
6656do
6657ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6658echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6659echo "configure:6660: checking for $ac_hdr" >&5
6660if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6661  echo $ac_n "(cached) $ac_c" 1>&6
6662else
6663  cat > conftest.$ac_ext <<EOF
6664#line 6665 "configure"
6665#include "confdefs.h"
6666#include <$ac_hdr>
6667EOF
6668ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6669{ (eval echo configure:6670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6670ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6671if test -z "$ac_err"; then
6672  rm -rf conftest*
6673  eval "ac_cv_header_$ac_safe=yes"
6674else
6675  echo "$ac_err" >&5
6676  echo "configure: failed program was:" >&5
6677  cat conftest.$ac_ext >&5
6678  rm -rf conftest*
6679  eval "ac_cv_header_$ac_safe=no"
6680fi
6681rm -f conftest*
6682fi
6683if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6684  echo "$ac_t""yes" 1>&6
6685    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6686  cat >> confdefs.h <<EOF
6687#define $ac_tr_hdr 1
6688EOF
6689 
6690else
6691  echo "$ac_t""no" 1>&6
6692fi
6693done
6694
6695    echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
6696echo "configure:6697: checking whether time.h and sys/time.h may both be included" >&5
6697if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
6698  echo $ac_n "(cached) $ac_c" 1>&6
6699else
6700  cat > conftest.$ac_ext <<EOF
6701#line 6702 "configure"
6702#include "confdefs.h"
6703#include <sys/types.h>
6704#include <sys/time.h>
6705#include <time.h>
6706int main() {
6707struct tm *tp;
6708; return 0; }
6709EOF
6710if { (eval echo configure:6711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6711  rm -rf conftest*
6712  ac_cv_header_time=yes
6713else
6714  echo "configure: failed program was:" >&5
6715  cat conftest.$ac_ext >&5
6716  rm -rf conftest*
6717  ac_cv_header_time=no
6718fi
6719rm -f conftest*
6720fi
6721
6722echo "$ac_t""$ac_cv_header_time" 1>&6
6723if test $ac_cv_header_time = yes; then
6724  cat >> confdefs.h <<\EOF
6725#define TIME_WITH_SYS_TIME 1
6726EOF
6727
6728fi
6729
6730    echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
6731echo "configure:6732: checking for tm_zone in struct tm" >&5
6732if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
6733  echo $ac_n "(cached) $ac_c" 1>&6
6734else
6735  cat > conftest.$ac_ext <<EOF
6736#line 6737 "configure"
6737#include "confdefs.h"
6738#include <sys/types.h>
6739#include <$ac_cv_struct_tm>
6740int main() {
6741struct tm tm; tm.tm_zone;
6742; return 0; }
6743EOF
6744if { (eval echo configure:6745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6745  rm -rf conftest*
6746  ac_cv_struct_tm_zone=yes
6747else
6748  echo "configure: failed program was:" >&5
6749  cat conftest.$ac_ext >&5
6750  rm -rf conftest*
6751  ac_cv_struct_tm_zone=no
6752fi
6753rm -f conftest*
6754fi
6755
6756echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
6757if test "$ac_cv_struct_tm_zone" = yes; then
6758  cat >> confdefs.h <<\EOF
6759#define HAVE_TM_ZONE 1
6760EOF
6761
6762else
6763  echo $ac_n "checking for tzname""... $ac_c" 1>&6
6764echo "configure:6765: checking for tzname" >&5
6765if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
6766  echo $ac_n "(cached) $ac_c" 1>&6
6767else
6768  cat > conftest.$ac_ext <<EOF
6769#line 6770 "configure"
6770#include "confdefs.h"
6771#include <time.h>
6772#ifndef tzname /* For SGI.  */
6773extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
6774#endif
6775int main() {
6776atoi(*tzname);
6777; return 0; }
6778EOF
6779if { (eval echo configure:6780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6780  rm -rf conftest*
6781  ac_cv_var_tzname=yes
6782else
6783  echo "configure: failed program was:" >&5
6784  cat conftest.$ac_ext >&5
6785  rm -rf conftest*
6786  ac_cv_var_tzname=no
6787fi
6788rm -f conftest*
6789fi
6790
6791echo "$ac_t""$ac_cv_var_tzname" 1>&6
6792  if test $ac_cv_var_tzname = yes; then
6793    cat >> confdefs.h <<\EOF
6794#define HAVE_TZNAME 1
6795EOF
6796
6797  fi
6798fi
6799
6800
6801    for ac_func in gmtime_r localtime_r
6802do
6803echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6804echo "configure:6805: checking for $ac_func" >&5
6805if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6806  echo $ac_n "(cached) $ac_c" 1>&6
6807else
6808  cat > conftest.$ac_ext <<EOF
6809#line 6810 "configure"
6810#include "confdefs.h"
6811/* System header to define __stub macros and hopefully few prototypes,
6812    which can conflict with char $ac_func(); below.  */
6813#include <assert.h>
6814/* Override any gcc2 internal prototype to avoid an error.  */
6815/* We use char because int might match the return type of a gcc2
6816    builtin and then its argument prototype would still apply.  */
6817char $ac_func();
6818
6819int main() {
6820
6821/* The GNU C library defines this for functions which it implements
6822    to always fail with ENOSYS.  Some functions are actually named
6823    something starting with __ and the normal name is an alias.  */
6824#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6825choke me
6826#else
6827$ac_func();
6828#endif
6829
6830; return 0; }
6831EOF
6832if { (eval echo configure:6833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6833  rm -rf conftest*
6834  eval "ac_cv_func_$ac_func=yes"
6835else
6836  echo "configure: failed program was:" >&5
6837  cat conftest.$ac_ext >&5
6838  rm -rf conftest*
6839  eval "ac_cv_func_$ac_func=no"
6840fi
6841rm -f conftest*
6842fi
6843
6844if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6845  echo "$ac_t""yes" 1>&6
6846    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6847  cat >> confdefs.h <<EOF
6848#define $ac_tr_func 1
6849EOF
6850 
6851else
6852  echo "$ac_t""no" 1>&6
6853fi
6854done
6855
6856
6857    echo $ac_n "checking tm_tzadj in struct tm""... $ac_c" 1>&6
6858echo "configure:6859: checking tm_tzadj in struct tm" >&5
6859if eval "test \"`echo '$''{'tcl_cv_member_tm_tzadj'+set}'`\" = set"; then
6860  echo $ac_n "(cached) $ac_c" 1>&6
6861else
6862  
6863	cat > conftest.$ac_ext <<EOF
6864#line 6865 "configure"
6865#include "confdefs.h"
6866#include <time.h>
6867int main() {
6868struct tm tm; tm.tm_tzadj;
6869; return 0; }
6870EOF
6871if { (eval echo configure:6872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6872  rm -rf conftest*
6873  tcl_cv_member_tm_tzadj=yes
6874else
6875  echo "configure: failed program was:" >&5
6876  cat conftest.$ac_ext >&5
6877  rm -rf conftest*
6878  tcl_cv_member_tm_tzadj=no
6879fi
6880rm -f conftest*
6881fi
6882
6883echo "$ac_t""$tcl_cv_member_tm_tzadj" 1>&6
6884    if test $tcl_cv_member_tm_tzadj = yes ; then
6885	cat >> confdefs.h <<\EOF
6886#define HAVE_TM_TZADJ 1
6887EOF
6888
6889    fi
6890
6891    echo $ac_n "checking tm_gmtoff in struct tm""... $ac_c" 1>&6
6892echo "configure:6893: checking tm_gmtoff in struct tm" >&5
6893if eval "test \"`echo '$''{'tcl_cv_member_tm_gmtoff'+set}'`\" = set"; then
6894  echo $ac_n "(cached) $ac_c" 1>&6
6895else
6896  
6897	cat > conftest.$ac_ext <<EOF
6898#line 6899 "configure"
6899#include "confdefs.h"
6900#include <time.h>
6901int main() {
6902struct tm tm; tm.tm_gmtoff;
6903; return 0; }
6904EOF
6905if { (eval echo configure:6906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6906  rm -rf conftest*
6907  tcl_cv_member_tm_gmtoff=yes
6908else
6909  echo "configure: failed program was:" >&5
6910  cat conftest.$ac_ext >&5
6911  rm -rf conftest*
6912  tcl_cv_member_tm_gmtoff=no
6913fi
6914rm -f conftest*
6915fi
6916
6917echo "$ac_t""$tcl_cv_member_tm_gmtoff" 1>&6
6918    if test $tcl_cv_member_tm_gmtoff = yes ; then
6919	cat >> confdefs.h <<\EOF
6920#define HAVE_TM_GMTOFF 1
6921EOF
6922
6923    fi
6924
6925    #
6926    # Its important to include time.h in this check, as some systems
6927    # (like convex) have timezone functions, etc.
6928    #
6929    echo $ac_n "checking long timezone variable""... $ac_c" 1>&6
6930echo "configure:6931: checking long timezone variable" >&5
6931if eval "test \"`echo '$''{'tcl_cv_timezone_long'+set}'`\" = set"; then
6932  echo $ac_n "(cached) $ac_c" 1>&6
6933else
6934  
6935	cat > conftest.$ac_ext <<EOF
6936#line 6937 "configure"
6937#include "confdefs.h"
6938#include <time.h>
6939int main() {
6940extern long timezone;
6941	    timezone += 1;
6942	    exit (0);
6943; return 0; }
6944EOF
6945if { (eval echo configure:6946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6946  rm -rf conftest*
6947  tcl_cv_timezone_long=yes
6948else
6949  echo "configure: failed program was:" >&5
6950  cat conftest.$ac_ext >&5
6951  rm -rf conftest*
6952  tcl_cv_timezone_long=no
6953fi
6954rm -f conftest*
6955fi
6956
6957echo "$ac_t""$tcl_cv_timezone_long" 1>&6
6958    if test $tcl_cv_timezone_long = yes ; then
6959	cat >> confdefs.h <<\EOF
6960#define HAVE_TIMEZONE_VAR 1
6961EOF
6962
6963    else
6964	#
6965	# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
6966	#
6967	echo $ac_n "checking time_t timezone variable""... $ac_c" 1>&6
6968echo "configure:6969: checking time_t timezone variable" >&5
6969if eval "test \"`echo '$''{'tcl_cv_timezone_time'+set}'`\" = set"; then
6970  echo $ac_n "(cached) $ac_c" 1>&6
6971else
6972  
6973	    cat > conftest.$ac_ext <<EOF
6974#line 6975 "configure"
6975#include "confdefs.h"
6976#include <time.h>
6977int main() {
6978extern time_t timezone;
6979		timezone += 1;
6980		exit (0);
6981; return 0; }
6982EOF
6983if { (eval echo configure:6984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6984  rm -rf conftest*
6985  tcl_cv_timezone_time=yes
6986else
6987  echo "configure: failed program was:" >&5
6988  cat conftest.$ac_ext >&5
6989  rm -rf conftest*
6990  tcl_cv_timezone_time=no
6991fi
6992rm -f conftest*
6993fi
6994
6995echo "$ac_t""$tcl_cv_timezone_time" 1>&6
6996	if test $tcl_cv_timezone_time = yes ; then
6997	    cat >> confdefs.h <<\EOF
6998#define HAVE_TIMEZONE_VAR 1
6999EOF
7000
7001	fi
7002    fi
7003
7004
7005#--------------------------------------------------------------------
7006#	Some systems (e.g., IRIX 4.0.5) lack the st_blksize field
7007#	in struct stat.  But we might be able to use fstatfs instead.
7008#--------------------------------------------------------------------
7009echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
7010echo "configure:7011: checking for st_blksize in struct stat" >&5
7011if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
7012  echo $ac_n "(cached) $ac_c" 1>&6
7013else
7014  cat > conftest.$ac_ext <<EOF
7015#line 7016 "configure"
7016#include "confdefs.h"
7017#include <sys/types.h>
7018#include <sys/stat.h>
7019int main() {
7020struct stat s; s.st_blksize;
7021; return 0; }
7022EOF
7023if { (eval echo configure:7024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7024  rm -rf conftest*
7025  ac_cv_struct_st_blksize=yes
7026else
7027  echo "configure: failed program was:" >&5
7028  cat conftest.$ac_ext >&5
7029  rm -rf conftest*
7030  ac_cv_struct_st_blksize=no
7031fi
7032rm -f conftest*
7033fi
7034
7035echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
7036if test $ac_cv_struct_st_blksize = yes; then
7037  cat >> confdefs.h <<\EOF
7038#define HAVE_ST_BLKSIZE 1
7039EOF
7040
7041fi
7042
7043echo $ac_n "checking for fstatfs""... $ac_c" 1>&6
7044echo "configure:7045: checking for fstatfs" >&5
7045if eval "test \"`echo '$''{'ac_cv_func_fstatfs'+set}'`\" = set"; then
7046  echo $ac_n "(cached) $ac_c" 1>&6
7047else
7048  cat > conftest.$ac_ext <<EOF
7049#line 7050 "configure"
7050#include "confdefs.h"
7051/* System header to define __stub macros and hopefully few prototypes,
7052    which can conflict with char fstatfs(); below.  */
7053#include <assert.h>
7054/* Override any gcc2 internal prototype to avoid an error.  */
7055/* We use char because int might match the return type of a gcc2
7056    builtin and then its argument prototype would still apply.  */
7057char fstatfs();
7058
7059int main() {
7060
7061/* The GNU C library defines this for functions which it implements
7062    to always fail with ENOSYS.  Some functions are actually named
7063    something starting with __ and the normal name is an alias.  */
7064#if defined (__stub_fstatfs) || defined (__stub___fstatfs)
7065choke me
7066#else
7067fstatfs();
7068#endif
7069
7070; return 0; }
7071EOF
7072if { (eval echo configure:7073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7073  rm -rf conftest*
7074  eval "ac_cv_func_fstatfs=yes"
7075else
7076  echo "configure: failed program was:" >&5
7077  cat conftest.$ac_ext >&5
7078  rm -rf conftest*
7079  eval "ac_cv_func_fstatfs=no"
7080fi
7081rm -f conftest*
7082fi
7083
7084if eval "test \"`echo '$ac_cv_func_'fstatfs`\" = yes"; then
7085  echo "$ac_t""yes" 1>&6
7086  :
7087else
7088  echo "$ac_t""no" 1>&6
7089cat >> confdefs.h <<\EOF
7090#define NO_FSTATFS 1
7091EOF
7092
7093fi
7094
7095
7096#--------------------------------------------------------------------
7097#       Some system have no memcmp or it does not work with 8 bit
7098#       data, this checks it and add memcmp.o to LIBOBJS if needed
7099#--------------------------------------------------------------------
7100echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
7101echo "configure:7102: checking for 8-bit clean memcmp" >&5
7102if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
7103  echo $ac_n "(cached) $ac_c" 1>&6
7104else
7105  if test "$cross_compiling" = yes; then
7106  ac_cv_func_memcmp_clean=no
7107else
7108  cat > conftest.$ac_ext <<EOF
7109#line 7110 "configure"
7110#include "confdefs.h"
7111
7112main()
7113{
7114  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
7115  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
7116}
7117
7118EOF
7119if { (eval echo configure:7120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7120then
7121  ac_cv_func_memcmp_clean=yes
7122else
7123  echo "configure: failed program was:" >&5
7124  cat conftest.$ac_ext >&5
7125  rm -fr conftest*
7126  ac_cv_func_memcmp_clean=no
7127fi
7128rm -fr conftest*
7129fi
7130
7131fi
7132
7133echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
7134test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
7135
7136
7137#--------------------------------------------------------------------
7138#       Some system like SunOS 4 and other BSD like systems
7139#       have no memmove (we assume they have bcopy instead).
7140#       {The replacement define is in compat/string.h}
7141#--------------------------------------------------------------------
7142echo $ac_n "checking for memmove""... $ac_c" 1>&6
7143echo "configure:7144: checking for memmove" >&5
7144if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then
7145  echo $ac_n "(cached) $ac_c" 1>&6
7146else
7147  cat > conftest.$ac_ext <<EOF
7148#line 7149 "configure"
7149#include "confdefs.h"
7150/* System header to define __stub macros and hopefully few prototypes,
7151    which can conflict with char memmove(); below.  */
7152#include <assert.h>
7153/* Override any gcc2 internal prototype to avoid an error.  */
7154/* We use char because int might match the return type of a gcc2
7155    builtin and then its argument prototype would still apply.  */
7156char memmove();
7157
7158int main() {
7159
7160/* The GNU C library defines this for functions which it implements
7161    to always fail with ENOSYS.  Some functions are actually named
7162    something starting with __ and the normal name is an alias.  */
7163#if defined (__stub_memmove) || defined (__stub___memmove)
7164choke me
7165#else
7166memmove();
7167#endif
7168
7169; return 0; }
7170EOF
7171if { (eval echo configure:7172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7172  rm -rf conftest*
7173  eval "ac_cv_func_memmove=yes"
7174else
7175  echo "configure: failed program was:" >&5
7176  cat conftest.$ac_ext >&5
7177  rm -rf conftest*
7178  eval "ac_cv_func_memmove=no"
7179fi
7180rm -f conftest*
7181fi
7182
7183if eval "test \"`echo '$ac_cv_func_'memmove`\" = yes"; then
7184  echo "$ac_t""yes" 1>&6
7185  :
7186else
7187  echo "$ac_t""no" 1>&6
7188cat >> confdefs.h <<\EOF
7189#define NO_MEMMOVE 1
7190EOF
7191 cat >> confdefs.h <<\EOF
7192#define NO_STRING_H 1
7193EOF
7194
7195fi
7196
7197
7198#--------------------------------------------------------------------
7199#	On some systems strstr is broken: it returns a pointer even
7200#	even if the original string is empty.
7201#--------------------------------------------------------------------
7202if test "x${ac_cv_func_strstr}" = "xyes"; then
7203    echo $ac_n "checking proper strstr implementation""... $ac_c" 1>&6
7204echo "configure:7205: checking proper strstr implementation" >&5
7205if eval "test \"`echo '$''{'tcl_cv_strstr_unbroken'+set}'`\" = set"; then
7206  echo $ac_n "(cached) $ac_c" 1>&6
7207else
7208  
7209	if test "$cross_compiling" = yes; then
7210  tcl_cv_strstr_unbroken=broken
7211else
7212  cat > conftest.$ac_ext <<EOF
7213#line 7214 "configure"
7214#include "confdefs.h"
7215
7216	extern int strstr();
7217	int main()
7218	{
7219	    exit(strstr("\0test", "test") ? 1 : 0);
7220	}
7221EOF
7222if { (eval echo configure:7223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7223then
7224  tcl_cv_strstr_unbroken=ok
7225else
7226  echo "configure: failed program was:" >&5
7227  cat conftest.$ac_ext >&5
7228  rm -fr conftest*
7229  tcl_cv_strstr_unbroken=broken
7230fi
7231rm -fr conftest*
7232fi
7233
7234fi
7235
7236echo "$ac_t""$tcl_cv_strstr_unbroken" 1>&6
7237    if test $tcl_cv_strstr_unbroken = broken; then
7238        LIBOBJS="$LIBOBJS strstr.o"
7239    fi
7240fi
7241
7242#--------------------------------------------------------------------
7243#	Check for strtoul function.  This is tricky because under some
7244#	versions of AIX strtoul returns an incorrect terminator
7245#	pointer for the string "0".
7246#--------------------------------------------------------------------
7247
7248echo $ac_n "checking for strtoul""... $ac_c" 1>&6
7249echo "configure:7250: checking for strtoul" >&5
7250if eval "test \"`echo '$''{'ac_cv_func_strtoul'+set}'`\" = set"; then
7251  echo $ac_n "(cached) $ac_c" 1>&6
7252else
7253  cat > conftest.$ac_ext <<EOF
7254#line 7255 "configure"
7255#include "confdefs.h"
7256/* System header to define __stub macros and hopefully few prototypes,
7257    which can conflict with char strtoul(); below.  */
7258#include <assert.h>
7259/* Override any gcc2 internal prototype to avoid an error.  */
7260/* We use char because int might match the return type of a gcc2
7261    builtin and then its argument prototype would still apply.  */
7262char strtoul();
7263
7264int main() {
7265
7266/* The GNU C library defines this for functions which it implements
7267    to always fail with ENOSYS.  Some functions are actually named
7268    something starting with __ and the normal name is an alias.  */
7269#if defined (__stub_strtoul) || defined (__stub___strtoul)
7270choke me
7271#else
7272strtoul();
7273#endif
7274
7275; return 0; }
7276EOF
7277if { (eval echo configure:7278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7278  rm -rf conftest*
7279  eval "ac_cv_func_strtoul=yes"
7280else
7281  echo "configure: failed program was:" >&5
7282  cat conftest.$ac_ext >&5
7283  rm -rf conftest*
7284  eval "ac_cv_func_strtoul=no"
7285fi
7286rm -f conftest*
7287fi
7288
7289if eval "test \"`echo '$ac_cv_func_'strtoul`\" = yes"; then
7290  echo "$ac_t""yes" 1>&6
7291  tcl_ok=1
7292else
7293  echo "$ac_t""no" 1>&6
7294tcl_ok=0
7295fi
7296
7297if test $tcl_ok = 1; then
7298    echo $ac_n "checking proper strtoul implementation""... $ac_c" 1>&6
7299echo "configure:7300: checking proper strtoul implementation" >&5
7300if eval "test \"`echo '$''{'tcl_cv_strtoul_unbroken'+set}'`\" = set"; then
7301  echo $ac_n "(cached) $ac_c" 1>&6
7302else
7303  
7304	if test "$cross_compiling" = yes; then
7305  tcl_cv_strtoul_unbroken=broken
7306else
7307  cat > conftest.$ac_ext <<EOF
7308#line 7309 "configure"
7309#include "confdefs.h"
7310
7311	extern int strtoul();
7312	int main()
7313	{
7314	    char *string = "0";
7315	    char *term;
7316	    int value;
7317	    value = strtoul(string, &term, 0);
7318	    if ((value != 0) || (term != (string+1))) {
7319		exit(1);
7320	    }
7321	    exit(0);
7322	}
7323EOF
7324if { (eval echo configure:7325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7325then
7326  tcl_cv_strtoul_unbroken=ok 
7327else
7328  echo "configure: failed program was:" >&5
7329  cat conftest.$ac_ext >&5
7330  rm -fr conftest*
7331  tcl_cv_strtoul_unbroken=broken
7332fi
7333rm -fr conftest*
7334fi
7335
7336fi
7337
7338echo "$ac_t""$tcl_cv_strtoul_unbroken" 1>&6
7339    if test $tcl_cv_strtoul_unbroken = broken; then
7340	tcl_ok=0
7341    fi
7342fi
7343if test $tcl_ok = 0; then
7344    LIBOBJS="$LIBOBJS strtoul.o"
7345fi
7346
7347#--------------------------------------------------------------------
7348#	Check for the strtod function.  This is tricky because in some
7349#	versions of Linux strtod mis-parses strings starting with "+".
7350#--------------------------------------------------------------------
7351
7352echo $ac_n "checking for strtod""... $ac_c" 1>&6
7353echo "configure:7354: checking for strtod" >&5
7354if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then
7355  echo $ac_n "(cached) $ac_c" 1>&6
7356else
7357  cat > conftest.$ac_ext <<EOF
7358#line 7359 "configure"
7359#include "confdefs.h"
7360/* System header to define __stub macros and hopefully few prototypes,
7361    which can conflict with char strtod(); below.  */
7362#include <assert.h>
7363/* Override any gcc2 internal prototype to avoid an error.  */
7364/* We use char because int might match the return type of a gcc2
7365    builtin and then its argument prototype would still apply.  */
7366char strtod();
7367
7368int main() {
7369
7370/* The GNU C library defines this for functions which it implements
7371    to always fail with ENOSYS.  Some functions are actually named
7372    something starting with __ and the normal name is an alias.  */
7373#if defined (__stub_strtod) || defined (__stub___strtod)
7374choke me
7375#else
7376strtod();
7377#endif
7378
7379; return 0; }
7380EOF
7381if { (eval echo configure:7382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7382  rm -rf conftest*
7383  eval "ac_cv_func_strtod=yes"
7384else
7385  echo "configure: failed program was:" >&5
7386  cat conftest.$ac_ext >&5
7387  rm -rf conftest*
7388  eval "ac_cv_func_strtod=no"
7389fi
7390rm -f conftest*
7391fi
7392
7393if eval "test \"`echo '$ac_cv_func_'strtod`\" = yes"; then
7394  echo "$ac_t""yes" 1>&6
7395  tcl_ok=1
7396else
7397  echo "$ac_t""no" 1>&6
7398tcl_ok=0
7399fi
7400
7401if test $tcl_ok = 1; then
7402    echo $ac_n "checking proper strtod implementation""... $ac_c" 1>&6
7403echo "configure:7404: checking proper strtod implementation" >&5
7404if eval "test \"`echo '$''{'tcl_cv_strtod_unbroken'+set}'`\" = set"; then
7405  echo $ac_n "(cached) $ac_c" 1>&6
7406else
7407  
7408	if test "$cross_compiling" = yes; then
7409  tcl_cv_strtod_unbroken=broken
7410else
7411  cat > conftest.$ac_ext <<EOF
7412#line 7413 "configure"
7413#include "confdefs.h"
7414
7415	extern double strtod();
7416	int main()
7417	{
7418	    char *string = " +69";
7419	    char *term;
7420	    double value;
7421	    value = strtod(string, &term);
7422	    if ((value != 69) || (term != (string+4))) {
7423		exit(1);
7424	    }
7425	    exit(0);
7426	}
7427EOF
7428if { (eval echo configure:7429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7429then
7430  tcl_cv_strtod_unbroken=ok 
7431else
7432  echo "configure: failed program was:" >&5
7433  cat conftest.$ac_ext >&5
7434  rm -fr conftest*
7435  tcl_cv_strtod_unbroken=broken
7436fi
7437rm -fr conftest*
7438fi
7439
7440fi
7441
7442echo "$ac_t""$tcl_cv_strtod_unbroken" 1>&6
7443    if test $tcl_cv_strtod_unbroken = broken; then
7444	tcl_ok=0
7445    fi
7446fi
7447if test $tcl_ok = 0; then
7448    LIBOBJS="$LIBOBJS strtod.o"
7449fi
7450
7451#--------------------------------------------------------------------
7452#	Under Solaris 2.4, strtod returns the wrong value for the
7453#	terminating character under some conditions.  Check for this
7454#	and if the problem exists use a substitute procedure
7455#	"fixstrtod" that corrects the error.
7456#--------------------------------------------------------------------
7457
7458
7459    echo $ac_n "checking for strtod""... $ac_c" 1>&6
7460echo "configure:7461: checking for strtod" >&5
7461if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then
7462  echo $ac_n "(cached) $ac_c" 1>&6
7463else
7464  cat > conftest.$ac_ext <<EOF
7465#line 7466 "configure"
7466#include "confdefs.h"
7467/* System header to define __stub macros and hopefully few prototypes,
7468    which can conflict with char strtod(); below.  */
7469#include <assert.h>
7470/* Override any gcc2 internal prototype to avoid an error.  */
7471/* We use char because int might match the return type of a gcc2
7472    builtin and then its argument prototype would still apply.  */
7473char strtod();
7474
7475int main() {
7476
7477/* The GNU C library defines this for functions which it implements
7478    to always fail with ENOSYS.  Some functions are actually named
7479    something starting with __ and the normal name is an alias.  */
7480#if defined (__stub_strtod) || defined (__stub___strtod)
7481choke me
7482#else
7483strtod();
7484#endif
7485
7486; return 0; }
7487EOF
7488if { (eval echo configure:7489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7489  rm -rf conftest*
7490  eval "ac_cv_func_strtod=yes"
7491else
7492  echo "configure: failed program was:" >&5
7493  cat conftest.$ac_ext >&5
7494  rm -rf conftest*
7495  eval "ac_cv_func_strtod=no"
7496fi
7497rm -f conftest*
7498fi
7499
7500if eval "test \"`echo '$ac_cv_func_'strtod`\" = yes"; then
7501  echo "$ac_t""yes" 1>&6
7502  tcl_strtod=1
7503else
7504  echo "$ac_t""no" 1>&6
7505tcl_strtod=0
7506fi
7507
7508    if test "$tcl_strtod" = 1; then
7509	echo $ac_n "checking for Solaris2.4/Tru64 strtod bugs""... $ac_c" 1>&6
7510echo "configure:7511: checking for Solaris2.4/Tru64 strtod bugs" >&5
7511if eval "test \"`echo '$''{'tcl_cv_strtod_buggy'+set}'`\" = set"; then
7512  echo $ac_n "(cached) $ac_c" 1>&6
7513else
7514  
7515	    if test "$cross_compiling" = yes; then
7516  tcl_cv_strtod_buggy=buggy
7517else
7518  cat > conftest.$ac_ext <<EOF
7519#line 7520 "configure"
7520#include "confdefs.h"
7521
7522		extern double strtod();
7523		int main() {
7524		    char *infString="Inf", *nanString="NaN", *spaceString=" ";
7525		    char *term;
7526		    double value;
7527		    value = strtod(infString, &term);
7528		    if ((term != infString) && (term[-1] == 0)) {
7529			exit(1);
7530		    }
7531		    value = strtod(nanString, &term);
7532		    if ((term != nanString) && (term[-1] == 0)) {
7533			exit(1);
7534		    }
7535		    value = strtod(spaceString, &term);
7536		    if (term == (spaceString+1)) {
7537			exit(1);
7538		    }
7539		    exit(0);
7540		}
7541EOF
7542if { (eval echo configure:7543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7543then
7544  tcl_cv_strtod_buggy=ok
7545else
7546  echo "configure: failed program was:" >&5
7547  cat conftest.$ac_ext >&5
7548  rm -fr conftest*
7549  tcl_cv_strtod_buggy=buggy
7550fi
7551rm -fr conftest*
7552fi
7553
7554fi
7555
7556echo "$ac_t""$tcl_cv_strtod_buggy" 1>&6
7557	if test "$tcl_cv_strtod_buggy" = buggy; then
7558	    LIBOBJS="$LIBOBJS fixstrtod.o"
7559	    cat >> confdefs.h <<\EOF
7560#define strtod fixstrtod
7561EOF
7562
7563	fi
7564    fi
7565
7566
7567#--------------------------------------------------------------------
7568#	Check for various typedefs and provide substitutes if
7569#	they don't exist.
7570#--------------------------------------------------------------------
7571
7572echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
7573echo "configure:7574: checking for ANSI C header files" >&5
7574if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
7575  echo $ac_n "(cached) $ac_c" 1>&6
7576else
7577  cat > conftest.$ac_ext <<EOF
7578#line 7579 "configure"
7579#include "confdefs.h"
7580#include <stdlib.h>
7581#include <stdarg.h>
7582#include <string.h>
7583#include <float.h>
7584EOF
7585ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7586{ (eval echo configure:7587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7587ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7588if test -z "$ac_err"; then
7589  rm -rf conftest*
7590  ac_cv_header_stdc=yes
7591else
7592  echo "$ac_err" >&5
7593  echo "configure: failed program was:" >&5
7594  cat conftest.$ac_ext >&5
7595  rm -rf conftest*
7596  ac_cv_header_stdc=no
7597fi
7598rm -f conftest*
7599
7600if test $ac_cv_header_stdc = yes; then
7601  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
7602cat > conftest.$ac_ext <<EOF
7603#line 7604 "configure"
7604#include "confdefs.h"
7605#include <string.h>
7606EOF
7607if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7608  egrep "memchr" >/dev/null 2>&1; then
7609  :
7610else
7611  rm -rf conftest*
7612  ac_cv_header_stdc=no
7613fi
7614rm -f conftest*
7615
7616fi
7617
7618if test $ac_cv_header_stdc = yes; then
7619  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
7620cat > conftest.$ac_ext <<EOF
7621#line 7622 "configure"
7622#include "confdefs.h"
7623#include <stdlib.h>
7624EOF
7625if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7626  egrep "free" >/dev/null 2>&1; then
7627  :
7628else
7629  rm -rf conftest*
7630  ac_cv_header_stdc=no
7631fi
7632rm -f conftest*
7633
7634fi
7635
7636if test $ac_cv_header_stdc = yes; then
7637  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
7638if test "$cross_compiling" = yes; then
7639  :
7640else
7641  cat > conftest.$ac_ext <<EOF
7642#line 7643 "configure"
7643#include "confdefs.h"
7644#include <ctype.h>
7645#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
7646#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
7647#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7648int main () { int i; for (i = 0; i < 256; i++)
7649if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
7650exit (0); }
7651
7652EOF
7653if { (eval echo configure:7654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7654then
7655  :
7656else
7657  echo "configure: failed program was:" >&5
7658  cat conftest.$ac_ext >&5
7659  rm -fr conftest*
7660  ac_cv_header_stdc=no
7661fi
7662rm -fr conftest*
7663fi
7664
7665fi
7666fi
7667
7668echo "$ac_t""$ac_cv_header_stdc" 1>&6
7669if test $ac_cv_header_stdc = yes; then
7670  cat >> confdefs.h <<\EOF
7671#define STDC_HEADERS 1
7672EOF
7673
7674fi
7675
7676echo $ac_n "checking for mode_t""... $ac_c" 1>&6
7677echo "configure:7678: checking for mode_t" >&5
7678if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
7679  echo $ac_n "(cached) $ac_c" 1>&6
7680else
7681  cat > conftest.$ac_ext <<EOF
7682#line 7683 "configure"
7683#include "confdefs.h"
7684#include <sys/types.h>
7685#if STDC_HEADERS
7686#include <stdlib.h>
7687#include <stddef.h>
7688#endif
7689EOF
7690if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7691  egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7692  rm -rf conftest*
7693  ac_cv_type_mode_t=yes
7694else
7695  rm -rf conftest*
7696  ac_cv_type_mode_t=no
7697fi
7698rm -f conftest*
7699
7700fi
7701echo "$ac_t""$ac_cv_type_mode_t" 1>&6
7702if test $ac_cv_type_mode_t = no; then
7703  cat >> confdefs.h <<\EOF
7704#define mode_t int
7705EOF
7706
7707fi
7708
7709echo $ac_n "checking for pid_t""... $ac_c" 1>&6
7710echo "configure:7711: checking for pid_t" >&5
7711if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
7712  echo $ac_n "(cached) $ac_c" 1>&6
7713else
7714  cat > conftest.$ac_ext <<EOF
7715#line 7716 "configure"
7716#include "confdefs.h"
7717#include <sys/types.h>
7718#if STDC_HEADERS
7719#include <stdlib.h>
7720#include <stddef.h>
7721#endif
7722EOF
7723if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7724  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7725  rm -rf conftest*
7726  ac_cv_type_pid_t=yes
7727else
7728  rm -rf conftest*
7729  ac_cv_type_pid_t=no
7730fi
7731rm -f conftest*
7732
7733fi
7734echo "$ac_t""$ac_cv_type_pid_t" 1>&6
7735if test $ac_cv_type_pid_t = no; then
7736  cat >> confdefs.h <<\EOF
7737#define pid_t int
7738EOF
7739
7740fi
7741
7742echo $ac_n "checking for size_t""... $ac_c" 1>&6
7743echo "configure:7744: checking for size_t" >&5
7744if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
7745  echo $ac_n "(cached) $ac_c" 1>&6
7746else
7747  cat > conftest.$ac_ext <<EOF
7748#line 7749 "configure"
7749#include "confdefs.h"
7750#include <sys/types.h>
7751#if STDC_HEADERS
7752#include <stdlib.h>
7753#include <stddef.h>
7754#endif
7755EOF
7756if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7757  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7758  rm -rf conftest*
7759  ac_cv_type_size_t=yes
7760else
7761  rm -rf conftest*
7762  ac_cv_type_size_t=no
7763fi
7764rm -f conftest*
7765
7766fi
7767echo "$ac_t""$ac_cv_type_size_t" 1>&6
7768if test $ac_cv_type_size_t = no; then
7769  cat >> confdefs.h <<\EOF
7770#define size_t unsigned
7771EOF
7772
7773fi
7774
7775echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
7776echo "configure:7777: checking for uid_t in sys/types.h" >&5
7777if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
7778  echo $ac_n "(cached) $ac_c" 1>&6
7779else
7780  cat > conftest.$ac_ext <<EOF
7781#line 7782 "configure"
7782#include "confdefs.h"
7783#include <sys/types.h>
7784EOF
7785if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7786  egrep "uid_t" >/dev/null 2>&1; then
7787  rm -rf conftest*
7788  ac_cv_type_uid_t=yes
7789else
7790  rm -rf conftest*
7791  ac_cv_type_uid_t=no
7792fi
7793rm -f conftest*
7794
7795fi
7796
7797echo "$ac_t""$ac_cv_type_uid_t" 1>&6
7798if test $ac_cv_type_uid_t = no; then
7799  cat >> confdefs.h <<\EOF
7800#define uid_t int
7801EOF
7802
7803  cat >> confdefs.h <<\EOF
7804#define gid_t int
7805EOF
7806
7807fi
7808
7809
7810echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
7811echo "configure:7812: checking for socklen_t" >&5
7812if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then
7813  echo $ac_n "(cached) $ac_c" 1>&6
7814else
7815  
7816    cat > conftest.$ac_ext <<EOF
7817#line 7818 "configure"
7818#include "confdefs.h"
7819
7820    #include <sys/types.h>
7821    #include <sys/socket.h>
7822    #if STDC_HEADERS
7823    #include <stdlib.h>
7824    #include <stddef.h>
7825    #endif
7826    
7827EOF
7828if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7829  egrep "(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
7830  rm -rf conftest*
7831  ac_cv_type_socklen_t=yes
7832else
7833  rm -rf conftest*
7834  ac_cv_type_socklen_t=no
7835fi
7836rm -f conftest*
7837
7838fi
7839
7840echo "$ac_t""$ac_cv_type_socklen_t" 1>&6
7841if test $ac_cv_type_socklen_t = no; then
7842    cat >> confdefs.h <<\EOF
7843#define socklen_t unsigned
7844EOF
7845
7846fi
7847
7848#--------------------------------------------------------------------
7849#	If a system doesn't have an opendir function (man, that's old!)
7850#	then we have to supply a different version of dirent.h which
7851#	is compatible with the substitute version of opendir that's
7852#	provided.  This version only works with V7-style directories.
7853#--------------------------------------------------------------------
7854
7855echo $ac_n "checking for opendir""... $ac_c" 1>&6
7856echo "configure:7857: checking for opendir" >&5
7857if eval "test \"`echo '$''{'ac_cv_func_opendir'+set}'`\" = set"; then
7858  echo $ac_n "(cached) $ac_c" 1>&6
7859else
7860  cat > conftest.$ac_ext <<EOF
7861#line 7862 "configure"
7862#include "confdefs.h"
7863/* System header to define __stub macros and hopefully few prototypes,
7864    which can conflict with char opendir(); below.  */
7865#include <assert.h>
7866/* Override any gcc2 internal prototype to avoid an error.  */
7867/* We use char because int might match the return type of a gcc2
7868    builtin and then its argument prototype would still apply.  */
7869char opendir();
7870
7871int main() {
7872
7873/* The GNU C library defines this for functions which it implements
7874    to always fail with ENOSYS.  Some functions are actually named
7875    something starting with __ and the normal name is an alias.  */
7876#if defined (__stub_opendir) || defined (__stub___opendir)
7877choke me
7878#else
7879opendir();
7880#endif
7881
7882; return 0; }
7883EOF
7884if { (eval echo configure:7885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7885  rm -rf conftest*
7886  eval "ac_cv_func_opendir=yes"
7887else
7888  echo "configure: failed program was:" >&5
7889  cat conftest.$ac_ext >&5
7890  rm -rf conftest*
7891  eval "ac_cv_func_opendir=no"
7892fi
7893rm -f conftest*
7894fi
7895
7896if eval "test \"`echo '$ac_cv_func_'opendir`\" = yes"; then
7897  echo "$ac_t""yes" 1>&6
7898  :
7899else
7900  echo "$ac_t""no" 1>&6
7901cat >> confdefs.h <<\EOF
7902#define USE_DIRENT2_H 1
7903EOF
7904
7905fi
7906
7907
7908#--------------------------------------------------------------------
7909#	The check below checks whether <sys/wait.h> defines the type
7910#	"union wait" correctly.  It's needed because of weirdness in
7911#	HP-UX where "union wait" is defined in both the BSD and SYS-V
7912#	environments.  Checking the usability of WIFEXITED seems to do
7913#	the trick.
7914#--------------------------------------------------------------------
7915
7916echo $ac_n "checking union wait""... $ac_c" 1>&6
7917echo "configure:7918: checking union wait" >&5
7918if eval "test \"`echo '$''{'tcl_cv_union_wait'+set}'`\" = set"; then
7919  echo $ac_n "(cached) $ac_c" 1>&6
7920else
7921  
7922    cat > conftest.$ac_ext <<EOF
7923#line 7924 "configure"
7924#include "confdefs.h"
7925#include <sys/types.h> 
7926#include <sys/wait.h>
7927int main() {
7928
7929union wait x;
7930WIFEXITED(x);		/* Generates compiler error if WIFEXITED
7931			 * uses an int. */
7932    
7933; return 0; }
7934EOF
7935if { (eval echo configure:7936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7936  rm -rf conftest*
7937  tcl_cv_union_wait=yes
7938else
7939  echo "configure: failed program was:" >&5
7940  cat conftest.$ac_ext >&5
7941  rm -rf conftest*
7942  tcl_cv_union_wait=no
7943fi
7944rm -f conftest*
7945fi
7946
7947echo "$ac_t""$tcl_cv_union_wait" 1>&6
7948if test $tcl_cv_union_wait = no; then
7949    cat >> confdefs.h <<\EOF
7950#define NO_UNION_WAIT 1
7951EOF
7952
7953fi
7954
7955#--------------------------------------------------------------------
7956#	Check whether there is an strncasecmp function on this system.
7957#	This is a bit tricky because under SCO it's in -lsocket and
7958#	under Sequent Dynix it's in -linet.
7959#--------------------------------------------------------------------
7960
7961echo $ac_n "checking for strncasecmp""... $ac_c" 1>&6
7962echo "configure:7963: checking for strncasecmp" >&5
7963if eval "test \"`echo '$''{'ac_cv_func_strncasecmp'+set}'`\" = set"; then
7964  echo $ac_n "(cached) $ac_c" 1>&6
7965else
7966  cat > conftest.$ac_ext <<EOF
7967#line 7968 "configure"
7968#include "confdefs.h"
7969/* System header to define __stub macros and hopefully few prototypes,
7970    which can conflict with char strncasecmp(); below.  */
7971#include <assert.h>
7972/* Override any gcc2 internal prototype to avoid an error.  */
7973/* We use char because int might match the return type of a gcc2
7974    builtin and then its argument prototype would still apply.  */
7975char strncasecmp();
7976
7977int main() {
7978
7979/* The GNU C library defines this for functions which it implements
7980    to always fail with ENOSYS.  Some functions are actually named
7981    something starting with __ and the normal name is an alias.  */
7982#if defined (__stub_strncasecmp) || defined (__stub___strncasecmp)
7983choke me
7984#else
7985strncasecmp();
7986#endif
7987
7988; return 0; }
7989EOF
7990if { (eval echo configure:7991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7991  rm -rf conftest*
7992  eval "ac_cv_func_strncasecmp=yes"
7993else
7994  echo "configure: failed program was:" >&5
7995  cat conftest.$ac_ext >&5
7996  rm -rf conftest*
7997  eval "ac_cv_func_strncasecmp=no"
7998fi
7999rm -f conftest*
8000fi
8001
8002if eval "test \"`echo '$ac_cv_func_'strncasecmp`\" = yes"; then
8003  echo "$ac_t""yes" 1>&6
8004  tcl_ok=1
8005else
8006  echo "$ac_t""no" 1>&6
8007tcl_ok=0
8008fi
8009
8010if test "$tcl_ok" = 0; then
8011    echo $ac_n "checking for strncasecmp in -lsocket""... $ac_c" 1>&6
8012echo "configure:8013: checking for strncasecmp in -lsocket" >&5
8013ac_lib_var=`echo socket'_'strncasecmp | sed 'y%./+-%__p_%'`
8014if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8015  echo $ac_n "(cached) $ac_c" 1>&6
8016else
8017  ac_save_LIBS="$LIBS"
8018LIBS="-lsocket  $LIBS"
8019cat > conftest.$ac_ext <<EOF
8020#line 8021 "configure"
8021#include "confdefs.h"
8022/* Override any gcc2 internal prototype to avoid an error.  */
8023/* We use char because int might match the return type of a gcc2
8024    builtin and then its argument prototype would still apply.  */
8025char strncasecmp();
8026
8027int main() {
8028strncasecmp()
8029; return 0; }
8030EOF
8031if { (eval echo configure:8032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8032  rm -rf conftest*
8033  eval "ac_cv_lib_$ac_lib_var=yes"
8034else
8035  echo "configure: failed program was:" >&5
8036  cat conftest.$ac_ext >&5
8037  rm -rf conftest*
8038  eval "ac_cv_lib_$ac_lib_var=no"
8039fi
8040rm -f conftest*
8041LIBS="$ac_save_LIBS"
8042
8043fi
8044if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8045  echo "$ac_t""yes" 1>&6
8046  tcl_ok=1
8047else
8048  echo "$ac_t""no" 1>&6
8049tcl_ok=0
8050fi
8051
8052fi
8053if test "$tcl_ok" = 0; then
8054    echo $ac_n "checking for strncasecmp in -linet""... $ac_c" 1>&6
8055echo "configure:8056: checking for strncasecmp in -linet" >&5
8056ac_lib_var=`echo inet'_'strncasecmp | sed 'y%./+-%__p_%'`
8057if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8058  echo $ac_n "(cached) $ac_c" 1>&6
8059else
8060  ac_save_LIBS="$LIBS"
8061LIBS="-linet  $LIBS"
8062cat > conftest.$ac_ext <<EOF
8063#line 8064 "configure"
8064#include "confdefs.h"
8065/* Override any gcc2 internal prototype to avoid an error.  */
8066/* We use char because int might match the return type of a gcc2
8067    builtin and then its argument prototype would still apply.  */
8068char strncasecmp();
8069
8070int main() {
8071strncasecmp()
8072; return 0; }
8073EOF
8074if { (eval echo configure:8075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8075  rm -rf conftest*
8076  eval "ac_cv_lib_$ac_lib_var=yes"
8077else
8078  echo "configure: failed program was:" >&5
8079  cat conftest.$ac_ext >&5
8080  rm -rf conftest*
8081  eval "ac_cv_lib_$ac_lib_var=no"
8082fi
8083rm -f conftest*
8084LIBS="$ac_save_LIBS"
8085
8086fi
8087if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8088  echo "$ac_t""yes" 1>&6
8089  tcl_ok=1
8090else
8091  echo "$ac_t""no" 1>&6
8092tcl_ok=0
8093fi
8094
8095fi
8096if test "$tcl_ok" = 0; then
8097    LIBOBJS="$LIBOBJS strncasecmp.o"
8098fi
8099
8100#--------------------------------------------------------------------
8101#	The code below deals with several issues related to gettimeofday:
8102#	1. Some systems don't provide a gettimeofday function at all
8103#	   (set NO_GETTOD if this is the case).
8104#	2. SGI systems don't use the BSD form of the gettimeofday function,
8105#	   but they have a BSDgettimeofday function that can be used instead.
8106#	3. See if gettimeofday is declared in the <sys/time.h> header file.
8107#	   if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can
8108#	   declare it.
8109#--------------------------------------------------------------------
8110
8111echo $ac_n "checking for BSDgettimeofday""... $ac_c" 1>&6
8112echo "configure:8113: checking for BSDgettimeofday" >&5
8113if eval "test \"`echo '$''{'ac_cv_func_BSDgettimeofday'+set}'`\" = set"; then
8114  echo $ac_n "(cached) $ac_c" 1>&6
8115else
8116  cat > conftest.$ac_ext <<EOF
8117#line 8118 "configure"
8118#include "confdefs.h"
8119/* System header to define __stub macros and hopefully few prototypes,
8120    which can conflict with char BSDgettimeofday(); below.  */
8121#include <assert.h>
8122/* Override any gcc2 internal prototype to avoid an error.  */
8123/* We use char because int might match the return type of a gcc2
8124    builtin and then its argument prototype would still apply.  */
8125char BSDgettimeofday();
8126
8127int main() {
8128
8129/* The GNU C library defines this for functions which it implements
8130    to always fail with ENOSYS.  Some functions are actually named
8131    something starting with __ and the normal name is an alias.  */
8132#if defined (__stub_BSDgettimeofday) || defined (__stub___BSDgettimeofday)
8133choke me
8134#else
8135BSDgettimeofday();
8136#endif
8137
8138; return 0; }
8139EOF
8140if { (eval echo configure:8141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8141  rm -rf conftest*
8142  eval "ac_cv_func_BSDgettimeofday=yes"
8143else
8144  echo "configure: failed program was:" >&5
8145  cat conftest.$ac_ext >&5
8146  rm -rf conftest*
8147  eval "ac_cv_func_BSDgettimeofday=no"
8148fi
8149rm -f conftest*
8150fi
8151
8152if eval "test \"`echo '$ac_cv_func_'BSDgettimeofday`\" = yes"; then
8153  echo "$ac_t""yes" 1>&6
8154  cat >> confdefs.h <<\EOF
8155#define HAVE_BSDGETTIMEOFDAY 1
8156EOF
8157
8158else
8159  echo "$ac_t""no" 1>&6
8160
8161    echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6
8162echo "configure:8163: checking for gettimeofday" >&5
8163if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then
8164  echo $ac_n "(cached) $ac_c" 1>&6
8165else
8166  cat > conftest.$ac_ext <<EOF
8167#line 8168 "configure"
8168#include "confdefs.h"
8169/* System header to define __stub macros and hopefully few prototypes,
8170    which can conflict with char gettimeofday(); below.  */
8171#include <assert.h>
8172/* Override any gcc2 internal prototype to avoid an error.  */
8173/* We use char because int might match the return type of a gcc2
8174    builtin and then its argument prototype would still apply.  */
8175char gettimeofday();
8176
8177int main() {
8178
8179/* The GNU C library defines this for functions which it implements
8180    to always fail with ENOSYS.  Some functions are actually named
8181    something starting with __ and the normal name is an alias.  */
8182#if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
8183choke me
8184#else
8185gettimeofday();
8186#endif
8187
8188; return 0; }
8189EOF
8190if { (eval echo configure:8191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8191  rm -rf conftest*
8192  eval "ac_cv_func_gettimeofday=yes"
8193else
8194  echo "configure: failed program was:" >&5
8195  cat conftest.$ac_ext >&5
8196  rm -rf conftest*
8197  eval "ac_cv_func_gettimeofday=no"
8198fi
8199rm -f conftest*
8200fi
8201
8202if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then
8203  echo "$ac_t""yes" 1>&6
8204  :
8205else
8206  echo "$ac_t""no" 1>&6
8207cat >> confdefs.h <<\EOF
8208#define NO_GETTOD 1
8209EOF
8210
8211fi
8212
8213
8214fi
8215
8216echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6
8217echo "configure:8218: checking for gettimeofday declaration" >&5
8218if eval "test \"`echo '$''{'tcl_cv_grep_gettimeofday'+set}'`\" = set"; then
8219  echo $ac_n "(cached) $ac_c" 1>&6
8220else
8221  
8222    cat > conftest.$ac_ext <<EOF
8223#line 8224 "configure"
8224#include "confdefs.h"
8225#include <sys/time.h>
8226EOF
8227if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8228  egrep "gettimeofday" >/dev/null 2>&1; then
8229  rm -rf conftest*
8230  tcl_cv_grep_gettimeofday=present
8231else
8232  rm -rf conftest*
8233  tcl_cv_grep_gettimeofday=missing
8234fi
8235rm -f conftest*
8236
8237fi
8238
8239echo "$ac_t""$tcl_cv_grep_gettimeofday" 1>&6
8240if test $tcl_cv_grep_gettimeofday = missing ; then
8241    cat >> confdefs.h <<\EOF
8242#define GETTOD_NOT_DECLARED 1
8243EOF
8244
8245fi
8246
8247#--------------------------------------------------------------------
8248#	The following code checks to see whether it is possible to get
8249#	signed chars on this platform.  This is needed in order to
8250#	properly generate sign-extended ints from character values.
8251#--------------------------------------------------------------------
8252
8253echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
8254echo "configure:8255: checking whether char is unsigned" >&5
8255if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
8256  echo $ac_n "(cached) $ac_c" 1>&6
8257else
8258  if test "$GCC" = yes; then
8259  # GCC predefines this symbol on systems where it applies.
8260cat > conftest.$ac_ext <<EOF
8261#line 8262 "configure"
8262#include "confdefs.h"
8263#ifdef __CHAR_UNSIGNED__
8264  yes
8265#endif
8266
8267EOF
8268if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8269  egrep "yes" >/dev/null 2>&1; then
8270  rm -rf conftest*
8271  ac_cv_c_char_unsigned=yes
8272else
8273  rm -rf conftest*
8274  ac_cv_c_char_unsigned=no
8275fi
8276rm -f conftest*
8277
8278else
8279if test "$cross_compiling" = yes; then
8280    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
8281else
8282  cat > conftest.$ac_ext <<EOF
8283#line 8284 "configure"
8284#include "confdefs.h"
8285/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
8286#if !defined(__STDC__) || __STDC__ != 1
8287#define volatile
8288#endif
8289main() {
8290  volatile char c = 255; exit(c < 0);
8291}
8292EOF
8293if { (eval echo configure:8294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8294then
8295  ac_cv_c_char_unsigned=yes
8296else
8297  echo "configure: failed program was:" >&5
8298  cat conftest.$ac_ext >&5
8299  rm -fr conftest*
8300  ac_cv_c_char_unsigned=no
8301fi
8302rm -fr conftest*
8303fi
8304
8305fi
8306fi
8307
8308echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6
8309if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
8310  cat >> confdefs.h <<\EOF
8311#define __CHAR_UNSIGNED__ 1
8312EOF
8313
8314fi
8315
8316echo $ac_n "checking signed char declarations""... $ac_c" 1>&6
8317echo "configure:8318: checking signed char declarations" >&5
8318if eval "test \"`echo '$''{'tcl_cv_char_signed'+set}'`\" = set"; then
8319  echo $ac_n "(cached) $ac_c" 1>&6
8320else
8321  
8322    cat > conftest.$ac_ext <<EOF
8323#line 8324 "configure"
8324#include "confdefs.h"
8325
8326int main() {
8327
8328	signed char *p;
8329	p = 0;
8330	
8331; return 0; }
8332EOF
8333if { (eval echo configure:8334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8334  rm -rf conftest*
8335  tcl_cv_char_signed=yes
8336else
8337  echo "configure: failed program was:" >&5
8338  cat conftest.$ac_ext >&5
8339  rm -rf conftest*
8340  tcl_cv_char_signed=no
8341fi
8342rm -f conftest*
8343fi
8344
8345echo "$ac_t""$tcl_cv_char_signed" 1>&6
8346if test $tcl_cv_char_signed = yes; then
8347    cat >> confdefs.h <<\EOF
8348#define HAVE_SIGNED_CHAR 1
8349EOF
8350
8351fi
8352
8353#--------------------------------------------------------------------
8354#  Does putenv() copy or not?  We need to know to avoid memory leaks.
8355#--------------------------------------------------------------------
8356
8357echo $ac_n "checking for a putenv() that copies the buffer""... $ac_c" 1>&6
8358echo "configure:8359: checking for a putenv() that copies the buffer" >&5
8359if eval "test \"`echo '$''{'tcl_cv_putenv_copy'+set}'`\" = set"; then
8360  echo $ac_n "(cached) $ac_c" 1>&6
8361else
8362  
8363    if test "$cross_compiling" = yes; then
8364  tcl_cv_putenv_copy=no
8365else
8366  cat > conftest.$ac_ext <<EOF
8367#line 8368 "configure"
8368#include "confdefs.h"
8369
8370	#include <stdlib.h>
8371	#define OURVAR "havecopy=yes"
8372	int main (int argc, char *argv[])
8373	{
8374	    char *foo, *bar;
8375	    foo = (char *)strdup(OURVAR);
8376	    putenv(foo);
8377	    strcpy((char *)(strchr(foo, '=') + 1), "no");
8378	    bar = getenv("havecopy");
8379	    if (!strcmp(bar, "no")) {
8380		/* doesnt copy */
8381		return 0;
8382	    } else {
8383		/* does copy */
8384		return 1;
8385	    }
8386	}
8387    
8388EOF
8389if { (eval echo configure:8390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8390then
8391  tcl_cv_putenv_copy=no
8392else
8393  echo "configure: failed program was:" >&5
8394  cat conftest.$ac_ext >&5
8395  rm -fr conftest*
8396  tcl_cv_putenv_copy=yes
8397fi
8398rm -fr conftest*
8399fi
8400
8401fi
8402
8403echo "$ac_t""$tcl_cv_putenv_copy" 1>&6
8404if test $tcl_cv_putenv_copy = yes; then
8405    cat >> confdefs.h <<\EOF
8406#define HAVE_PUTENV_THAT_COPIES 1
8407EOF
8408
8409fi
8410
8411#--------------------------------------------------------------------
8412# Check for support of nl_langinfo function
8413#--------------------------------------------------------------------
8414
8415
8416    # Check whether --enable-langinfo or --disable-langinfo was given.
8417if test "${enable_langinfo+set}" = set; then
8418  enableval="$enable_langinfo"
8419  langinfo_ok=$enableval
8420else
8421  langinfo_ok=yes
8422fi
8423
8424
8425    HAVE_LANGINFO=0
8426    if test "$langinfo_ok" = "yes"; then
8427	ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
8428echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
8429echo "configure:8430: checking for langinfo.h" >&5
8430if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8431  echo $ac_n "(cached) $ac_c" 1>&6
8432else
8433  cat > conftest.$ac_ext <<EOF
8434#line 8435 "configure"
8435#include "confdefs.h"
8436#include <langinfo.h>
8437EOF
8438ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8439{ (eval echo configure:8440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8440ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8441if test -z "$ac_err"; then
8442  rm -rf conftest*
8443  eval "ac_cv_header_$ac_safe=yes"
8444else
8445  echo "$ac_err" >&5
8446  echo "configure: failed program was:" >&5
8447  cat conftest.$ac_ext >&5
8448  rm -rf conftest*
8449  eval "ac_cv_header_$ac_safe=no"
8450fi
8451rm -f conftest*
8452fi
8453if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8454  echo "$ac_t""yes" 1>&6
8455  langinfo_ok=yes
8456else
8457  echo "$ac_t""no" 1>&6
8458langinfo_ok=no
8459fi
8460
8461    fi
8462    echo $ac_n "checking whether to use nl_langinfo""... $ac_c" 1>&6
8463echo "configure:8464: checking whether to use nl_langinfo" >&5
8464    if test "$langinfo_ok" = "yes"; then
8465	if eval "test \"`echo '$''{'tcl_cv_langinfo_h'+set}'`\" = set"; then
8466  echo $ac_n "(cached) $ac_c" 1>&6
8467else
8468  
8469	    cat > conftest.$ac_ext <<EOF
8470#line 8471 "configure"
8471#include "confdefs.h"
8472#include <langinfo.h>
8473int main() {
8474nl_langinfo(CODESET);
8475; return 0; }
8476EOF
8477if { (eval echo configure:8478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8478  rm -rf conftest*
8479  tcl_cv_langinfo_h=yes
8480else
8481  echo "configure: failed program was:" >&5
8482  cat conftest.$ac_ext >&5
8483  rm -rf conftest*
8484  tcl_cv_langinfo_h=no
8485fi
8486rm -f conftest*
8487fi
8488
8489	echo "$ac_t""$tcl_cv_langinfo_h" 1>&6
8490	if test $tcl_cv_langinfo_h = yes; then
8491	    cat >> confdefs.h <<\EOF
8492#define HAVE_LANGINFO 1
8493EOF
8494
8495	fi
8496    else 
8497	echo "$ac_t""$langinfo_ok" 1>&6
8498    fi
8499
8500
8501#--------------------------------------------------------------------
8502# Darwin specific API checks and defines
8503#--------------------------------------------------------------------
8504
8505if test "`uname -s`" = "Darwin" ; then
8506    for ac_hdr in copyfile.h
8507do
8508ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8509echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8510echo "configure:8511: checking for $ac_hdr" >&5
8511if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8512  echo $ac_n "(cached) $ac_c" 1>&6
8513else
8514  cat > conftest.$ac_ext <<EOF
8515#line 8516 "configure"
8516#include "confdefs.h"
8517#include <$ac_hdr>
8518EOF
8519ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8520{ (eval echo configure:8521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8521ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8522if test -z "$ac_err"; then
8523  rm -rf conftest*
8524  eval "ac_cv_header_$ac_safe=yes"
8525else
8526  echo "$ac_err" >&5
8527  echo "configure: failed program was:" >&5
8528  cat conftest.$ac_ext >&5
8529  rm -rf conftest*
8530  eval "ac_cv_header_$ac_safe=no"
8531fi
8532rm -f conftest*
8533fi
8534if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8535  echo "$ac_t""yes" 1>&6
8536    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8537  cat >> confdefs.h <<EOF
8538#define $ac_tr_hdr 1
8539EOF
8540 
8541else
8542  echo "$ac_t""no" 1>&6
8543fi
8544done
8545
8546    for ac_func in copyfile
8547do
8548echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8549echo "configure:8550: checking for $ac_func" >&5
8550if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8551  echo $ac_n "(cached) $ac_c" 1>&6
8552else
8553  cat > conftest.$ac_ext <<EOF
8554#line 8555 "configure"
8555#include "confdefs.h"
8556/* System header to define __stub macros and hopefully few prototypes,
8557    which can conflict with char $ac_func(); below.  */
8558#include <assert.h>
8559/* Override any gcc2 internal prototype to avoid an error.  */
8560/* We use char because int might match the return type of a gcc2
8561    builtin and then its argument prototype would still apply.  */
8562char $ac_func();
8563
8564int main() {
8565
8566/* The GNU C library defines this for functions which it implements
8567    to always fail with ENOSYS.  Some functions are actually named
8568    something starting with __ and the normal name is an alias.  */
8569#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8570choke me
8571#else
8572$ac_func();
8573#endif
8574
8575; return 0; }
8576EOF
8577if { (eval echo configure:8578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8578  rm -rf conftest*
8579  eval "ac_cv_func_$ac_func=yes"
8580else
8581  echo "configure: failed program was:" >&5
8582  cat conftest.$ac_ext >&5
8583  rm -rf conftest*
8584  eval "ac_cv_func_$ac_func=no"
8585fi
8586rm -f conftest*
8587fi
8588
8589if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8590  echo "$ac_t""yes" 1>&6
8591    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8592  cat >> confdefs.h <<EOF
8593#define $ac_tr_func 1
8594EOF
8595 
8596else
8597  echo "$ac_t""no" 1>&6
8598fi
8599done
8600
8601    if test $tcl_corefoundation = yes; then
8602	for ac_hdr in libkern/OSAtomic.h
8603do
8604ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8605echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8606echo "configure:8607: checking for $ac_hdr" >&5
8607if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8608  echo $ac_n "(cached) $ac_c" 1>&6
8609else
8610  cat > conftest.$ac_ext <<EOF
8611#line 8612 "configure"
8612#include "confdefs.h"
8613#include <$ac_hdr>
8614EOF
8615ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8616{ (eval echo configure:8617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8617ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8618if test -z "$ac_err"; then
8619  rm -rf conftest*
8620  eval "ac_cv_header_$ac_safe=yes"
8621else
8622  echo "$ac_err" >&5
8623  echo "configure: failed program was:" >&5
8624  cat conftest.$ac_ext >&5
8625  rm -rf conftest*
8626  eval "ac_cv_header_$ac_safe=no"
8627fi
8628rm -f conftest*
8629fi
8630if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8631  echo "$ac_t""yes" 1>&6
8632    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8633  cat >> confdefs.h <<EOF
8634#define $ac_tr_hdr 1
8635EOF
8636 
8637else
8638  echo "$ac_t""no" 1>&6
8639fi
8640done
8641
8642	for ac_func in OSSpinLockLock
8643do
8644echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8645echo "configure:8646: checking for $ac_func" >&5
8646if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8647  echo $ac_n "(cached) $ac_c" 1>&6
8648else
8649  cat > conftest.$ac_ext <<EOF
8650#line 8651 "configure"
8651#include "confdefs.h"
8652/* System header to define __stub macros and hopefully few prototypes,
8653    which can conflict with char $ac_func(); below.  */
8654#include <assert.h>
8655/* Override any gcc2 internal prototype to avoid an error.  */
8656/* We use char because int might match the return type of a gcc2
8657    builtin and then its argument prototype would still apply.  */
8658char $ac_func();
8659
8660int main() {
8661
8662/* The GNU C library defines this for functions which it implements
8663    to always fail with ENOSYS.  Some functions are actually named
8664    something starting with __ and the normal name is an alias.  */
8665#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8666choke me
8667#else
8668$ac_func();
8669#endif
8670
8671; return 0; }
8672EOF
8673if { (eval echo configure:8674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8674  rm -rf conftest*
8675  eval "ac_cv_func_$ac_func=yes"
8676else
8677  echo "configure: failed program was:" >&5
8678  cat conftest.$ac_ext >&5
8679  rm -rf conftest*
8680  eval "ac_cv_func_$ac_func=no"
8681fi
8682rm -f conftest*
8683fi
8684
8685if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8686  echo "$ac_t""yes" 1>&6
8687    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8688  cat >> confdefs.h <<EOF
8689#define $ac_tr_func 1
8690EOF
8691 
8692else
8693  echo "$ac_t""no" 1>&6
8694fi
8695done
8696
8697	for ac_func in pthread_atfork
8698do
8699echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8700echo "configure:8701: checking for $ac_func" >&5
8701if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8702  echo $ac_n "(cached) $ac_c" 1>&6
8703else
8704  cat > conftest.$ac_ext <<EOF
8705#line 8706 "configure"
8706#include "confdefs.h"
8707/* System header to define __stub macros and hopefully few prototypes,
8708    which can conflict with char $ac_func(); below.  */
8709#include <assert.h>
8710/* Override any gcc2 internal prototype to avoid an error.  */
8711/* We use char because int might match the return type of a gcc2
8712    builtin and then its argument prototype would still apply.  */
8713char $ac_func();
8714
8715int main() {
8716
8717/* The GNU C library defines this for functions which it implements
8718    to always fail with ENOSYS.  Some functions are actually named
8719    something starting with __ and the normal name is an alias.  */
8720#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8721choke me
8722#else
8723$ac_func();
8724#endif
8725
8726; return 0; }
8727EOF
8728if { (eval echo configure:8729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8729  rm -rf conftest*
8730  eval "ac_cv_func_$ac_func=yes"
8731else
8732  echo "configure: failed program was:" >&5
8733  cat conftest.$ac_ext >&5
8734  rm -rf conftest*
8735  eval "ac_cv_func_$ac_func=no"
8736fi
8737rm -f conftest*
8738fi
8739
8740if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8741  echo "$ac_t""yes" 1>&6
8742    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8743  cat >> confdefs.h <<EOF
8744#define $ac_tr_func 1
8745EOF
8746 
8747else
8748  echo "$ac_t""no" 1>&6
8749fi
8750done
8751
8752    fi
8753    cat >> confdefs.h <<\EOF
8754#define USE_VFORK 1
8755EOF
8756
8757    cat >> confdefs.h <<\EOF
8758#define TCL_DEFAULT_ENCODING "utf-8"
8759EOF
8760
8761    cat >> confdefs.h <<\EOF
8762#define TCL_LOAD_FROM_MEMORY 1
8763EOF
8764
8765    for ac_hdr in AvailabilityMacros.h
8766do
8767ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8768echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8769echo "configure:8770: checking for $ac_hdr" >&5
8770if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8771  echo $ac_n "(cached) $ac_c" 1>&6
8772else
8773  cat > conftest.$ac_ext <<EOF
8774#line 8775 "configure"
8775#include "confdefs.h"
8776#include <$ac_hdr>
8777EOF
8778ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8779{ (eval echo configure:8780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8780ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8781if test -z "$ac_err"; then
8782  rm -rf conftest*
8783  eval "ac_cv_header_$ac_safe=yes"
8784else
8785  echo "$ac_err" >&5
8786  echo "configure: failed program was:" >&5
8787  cat conftest.$ac_ext >&5
8788  rm -rf conftest*
8789  eval "ac_cv_header_$ac_safe=no"
8790fi
8791rm -f conftest*
8792fi
8793if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8794  echo "$ac_t""yes" 1>&6
8795    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8796  cat >> confdefs.h <<EOF
8797#define $ac_tr_hdr 1
8798EOF
8799 
8800else
8801  echo "$ac_t""no" 1>&6
8802fi
8803done
8804
8805    if test "$ac_cv_header_AvailabilityMacros_h" = yes; then
8806	echo $ac_n "checking if weak import is available""... $ac_c" 1>&6
8807echo "configure:8808: checking if weak import is available" >&5
8808if eval "test \"`echo '$''{'tcl_cv_cc_weak_import'+set}'`\" = set"; then
8809  echo $ac_n "(cached) $ac_c" 1>&6
8810else
8811  
8812	    hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
8813	    cat > conftest.$ac_ext <<EOF
8814#line 8815 "configure"
8815#include "confdefs.h"
8816
8817		    #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
8818		    #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
8819		    #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
8820		    #endif
8821		    #elif MAC_OS_X_VERSION_MIN_REQUIRED < 1020
8822		    #error MAC_OS_X_VERSION_MIN_REQUIRED < 1020
8823		    #endif
8824		    int rand(void) __attribute__((weak_import));
8825		
8826int main() {
8827rand();
8828; return 0; }
8829EOF
8830if { (eval echo configure:8831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8831  rm -rf conftest*
8832  tcl_cv_cc_weak_import=yes
8833else
8834  echo "configure: failed program was:" >&5
8835  cat conftest.$ac_ext >&5
8836  rm -rf conftest*
8837  tcl_cv_cc_weak_import=no
8838fi
8839rm -f conftest*
8840	    CFLAGS=$hold_cflags
8841fi
8842
8843echo "$ac_t""$tcl_cv_cc_weak_import" 1>&6
8844	if test $tcl_cv_cc_weak_import = yes; then
8845	    cat >> confdefs.h <<\EOF
8846#define HAVE_WEAK_IMPORT 1
8847EOF
8848
8849	fi
8850    fi
8851fi
8852
8853#--------------------------------------------------------------------
8854# Check for support of fts functions (readdir replacement)
8855#--------------------------------------------------------------------
8856
8857echo $ac_n "checking for fts""... $ac_c" 1>&6
8858echo "configure:8859: checking for fts" >&5
8859if eval "test \"`echo '$''{'tcl_cv_api_fts'+set}'`\" = set"; then
8860  echo $ac_n "(cached) $ac_c" 1>&6
8861else
8862  
8863    cat > conftest.$ac_ext <<EOF
8864#line 8865 "configure"
8865#include "confdefs.h"
8866
8867	    #include <sys/param.h>
8868	    #include <sys/stat.h>
8869	    #include <fts.h>
8870	
8871int main() {
8872
8873	    char*const p[2] = {"/", NULL};
8874	    FTS *f = fts_open(p, FTS_PHYSICAL|FTS_NOCHDIR|FTS_NOSTAT, NULL);
8875	    FTSENT *e = fts_read(f); fts_close(f);
8876	
8877; return 0; }
8878EOF
8879if { (eval echo configure:8880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8880  rm -rf conftest*
8881  tcl_cv_api_fts=yes
8882else
8883  echo "configure: failed program was:" >&5
8884  cat conftest.$ac_ext >&5
8885  rm -rf conftest*
8886  tcl_cv_api_fts=no
8887fi
8888rm -f conftest*
8889fi
8890
8891echo "$ac_t""$tcl_cv_api_fts" 1>&6
8892if test $tcl_cv_api_fts = yes; then
8893    cat >> confdefs.h <<\EOF
8894#define HAVE_FTS 1
8895EOF
8896
8897fi
8898
8899#--------------------------------------------------------------------
8900#	The statements below check for systems where POSIX-style
8901#	non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. 
8902#	On these systems (mostly older ones), use the old BSD-style
8903#	FIONBIO approach instead.
8904#--------------------------------------------------------------------
8905
8906
8907    for ac_hdr in sys/ioctl.h
8908do
8909ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8910echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8911echo "configure:8912: checking for $ac_hdr" >&5
8912if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8913  echo $ac_n "(cached) $ac_c" 1>&6
8914else
8915  cat > conftest.$ac_ext <<EOF
8916#line 8917 "configure"
8917#include "confdefs.h"
8918#include <$ac_hdr>
8919EOF
8920ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8921{ (eval echo configure:8922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8922ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8923if test -z "$ac_err"; then
8924  rm -rf conftest*
8925  eval "ac_cv_header_$ac_safe=yes"
8926else
8927  echo "$ac_err" >&5
8928  echo "configure: failed program was:" >&5
8929  cat conftest.$ac_ext >&5
8930  rm -rf conftest*
8931  eval "ac_cv_header_$ac_safe=no"
8932fi
8933rm -f conftest*
8934fi
8935if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8936  echo "$ac_t""yes" 1>&6
8937    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8938  cat >> confdefs.h <<EOF
8939#define $ac_tr_hdr 1
8940EOF
8941 
8942else
8943  echo "$ac_t""no" 1>&6
8944fi
8945done
8946
8947    for ac_hdr in sys/filio.h
8948do
8949ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8950echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8951echo "configure:8952: checking for $ac_hdr" >&5
8952if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8953  echo $ac_n "(cached) $ac_c" 1>&6
8954else
8955  cat > conftest.$ac_ext <<EOF
8956#line 8957 "configure"
8957#include "confdefs.h"
8958#include <$ac_hdr>
8959EOF
8960ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8961{ (eval echo configure:8962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8962ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8963if test -z "$ac_err"; then
8964  rm -rf conftest*
8965  eval "ac_cv_header_$ac_safe=yes"
8966else
8967  echo "$ac_err" >&5
8968  echo "configure: failed program was:" >&5
8969  cat conftest.$ac_ext >&5
8970  rm -rf conftest*
8971  eval "ac_cv_header_$ac_safe=no"
8972fi
8973rm -f conftest*
8974fi
8975if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8976  echo "$ac_t""yes" 1>&6
8977    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8978  cat >> confdefs.h <<EOF
8979#define $ac_tr_hdr 1
8980EOF
8981 
8982else
8983  echo "$ac_t""no" 1>&6
8984fi
8985done
8986
8987    
8988    echo $ac_n "checking system version""... $ac_c" 1>&6
8989echo "configure:8990: checking system version" >&5
8990if eval "test \"`echo '$''{'tcl_cv_sys_version'+set}'`\" = set"; then
8991  echo $ac_n "(cached) $ac_c" 1>&6
8992else
8993  
8994	if test -f /usr/lib/NextStep/software_version; then
8995	    tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
8996	else
8997	    tcl_cv_sys_version=`uname -s`-`uname -r`
8998	    if test "$?" -ne 0 ; then
8999		echo "configure: warning: can't find uname command" 1>&2
9000		tcl_cv_sys_version=unknown
9001	    else
9002		# Special check for weird MP-RAS system (uname returns weird
9003		# results, and the version is kept in special file).
9004
9005		if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
9006		    tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid`
9007		fi
9008		if test "`uname -s`" = "AIX" ; then
9009		    tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
9010		fi
9011	    fi
9012	fi
9013    
9014fi
9015
9016echo "$ac_t""$tcl_cv_sys_version" 1>&6
9017    system=$tcl_cv_sys_version
9018
9019    echo $ac_n "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O""... $ac_c" 1>&6
9020echo "configure:9021: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5
9021    case $system in
9022	# There used to be code here to use FIONBIO under AIX.  However, it
9023	# was reported that FIONBIO doesn't work under AIX 3.2.5.  Since
9024	# using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
9025	# code (JO, 5/31/97).
9026
9027	OSF*)
9028	    cat >> confdefs.h <<\EOF
9029#define USE_FIONBIO 1
9030EOF
9031
9032	    echo "$ac_t""FIONBIO" 1>&6
9033	    ;;
9034	SunOS-4*)
9035	    cat >> confdefs.h <<\EOF
9036#define USE_FIONBIO 1
9037EOF
9038
9039	    echo "$ac_t""FIONBIO" 1>&6
9040	    ;;
9041	ULTRIX-4.*)
9042	    cat >> confdefs.h <<\EOF
9043#define USE_FIONBIO 1
9044EOF
9045
9046	    echo "$ac_t""FIONBIO" 1>&6
9047	    ;;
9048	*)
9049	    echo "$ac_t""O_NONBLOCK" 1>&6
9050	    ;;
9051    esac
9052
9053
9054#--------------------------------------------------------------------
9055#	DTrace support
9056#--------------------------------------------------------------------
9057
9058# Check whether --enable-dtrace or --disable-dtrace was given.
9059if test "${enable_dtrace+set}" = set; then
9060  enableval="$enable_dtrace"
9061  tcl_ok=$enableval
9062else
9063  tcl_ok=no
9064fi
9065
9066if test $tcl_ok = yes; then
9067    ac_safe=`echo "sys/sdt.h" | sed 'y%./+-%__p_%'`
9068echo $ac_n "checking for sys/sdt.h""... $ac_c" 1>&6
9069echo "configure:9070: checking for sys/sdt.h" >&5
9070if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9071  echo $ac_n "(cached) $ac_c" 1>&6
9072else
9073  cat > conftest.$ac_ext <<EOF
9074#line 9075 "configure"
9075#include "confdefs.h"
9076#include <sys/sdt.h>
9077EOF
9078ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9079{ (eval echo configure:9080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9080ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9081if test -z "$ac_err"; then
9082  rm -rf conftest*
9083  eval "ac_cv_header_$ac_safe=yes"
9084else
9085  echo "$ac_err" >&5
9086  echo "configure: failed program was:" >&5
9087  cat conftest.$ac_ext >&5
9088  rm -rf conftest*
9089  eval "ac_cv_header_$ac_safe=no"
9090fi
9091rm -f conftest*
9092fi
9093if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9094  echo "$ac_t""yes" 1>&6
9095  tcl_ok=yes
9096else
9097  echo "$ac_t""no" 1>&6
9098tcl_ok=no
9099fi
9100
9101fi
9102if test $tcl_ok = yes; then
9103    # Extract the first word of "dtrace", so it can be a program name with args.
9104set dummy dtrace; ac_word=$2
9105echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9106echo "configure:9107: checking for $ac_word" >&5
9107if eval "test \"`echo '$''{'ac_cv_path_DTRACE'+set}'`\" = set"; then
9108  echo $ac_n "(cached) $ac_c" 1>&6
9109else
9110  case "$DTRACE" in
9111  /*)
9112  ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path.
9113  ;;
9114  ?:/*)			 
9115  ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a dos path.
9116  ;;
9117  *)
9118  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
9119  ac_dummy="$PATH:/usr/sbin"
9120  for ac_dir in $ac_dummy; do 
9121    test -z "$ac_dir" && ac_dir=.
9122    if test -f $ac_dir/$ac_word; then
9123      ac_cv_path_DTRACE="$ac_dir/$ac_word"
9124      break
9125    fi
9126  done
9127  IFS="$ac_save_ifs"
9128  ;;
9129esac
9130fi
9131DTRACE="$ac_cv_path_DTRACE"
9132if test -n "$DTRACE"; then
9133  echo "$ac_t""$DTRACE" 1>&6
9134else
9135  echo "$ac_t""no" 1>&6
9136fi
9137
9138    test -z "$ac_cv_path_DTRACE" && tcl_ok=no
9139fi
9140echo $ac_n "checking whether to enable DTrace support""... $ac_c" 1>&6
9141echo "configure:9142: checking whether to enable DTrace support" >&5
9142MAKEFILE_SHELL='/bin/sh'
9143if test $tcl_ok = yes; then
9144    cat >> confdefs.h <<\EOF
9145#define USE_DTRACE 1
9146EOF
9147
9148    DTRACE_SRC="\${DTRACE_SRC}"
9149    DTRACE_HDR="\${DTRACE_HDR}"
9150    if test "`uname -s`" != "Darwin" ; then
9151	DTRACE_OBJ="\${DTRACE_OBJ}"
9152	if test "`uname -s`" = "SunOS" -a "$SHARED_BUILD" = "0" ; then
9153	    # Need to create an intermediate object file to ensure tclDTrace.o
9154	    # gets included when linking against the static tcl library.
9155	    STLIB_LD='stlib_ld () { /usr/ccs/bin/ld -r -o $${1%.a}.o "$${@:2}" && '"${STLIB_LD}"' $${1} $${1%.a}.o ; } && stlib_ld'
9156	    MAKEFILE_SHELL='/bin/bash'
9157	    # Force use of Sun ar and ranlib, the GNU versions choke on
9158	    # tclDTrace.o and the combined object file above.
9159	    AR='/usr/ccs/bin/ar'
9160	    RANLIB='/usr/ccs/bin/ranlib'
9161	fi
9162    fi
9163fi
9164echo "$ac_t""$tcl_ok" 1>&6
9165
9166#--------------------------------------------------------------------
9167#	The statements below define a collection of symbols related to
9168#	building libtcl as a shared library instead of a static library.
9169#--------------------------------------------------------------------
9170
9171TCL_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
9172TCL_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}
9173eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
9174
9175# tclConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed
9176# so that the backslashes quoting the DBX braces are dropped.
9177
9178# Trick to replace DBGX with TCL_DBGX
9179DBGX='${TCL_DBGX}'
9180eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
9181
9182TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
9183PRIVATE_INCLUDE_DIR='$(includedir)'
9184HTML_DIR='$(DISTDIR)/html'
9185
9186# Note:  in the following variable, it's important to use the absolute
9187# path name of the Tcl directory rather than "..":  this is because
9188# AIX remembers this path and will attempt to use it at run-time to look
9189# up the Tcl library.
9190
9191if test "`uname -s`" = "Darwin" ; then
9192    
9193    if test "`uname -s`" = "Darwin" ; then
9194	echo $ac_n "checking how to package libraries""... $ac_c" 1>&6
9195echo "configure:9196: checking how to package libraries" >&5
9196	# Check whether --enable-framework or --disable-framework was given.
9197if test "${enable_framework+set}" = set; then
9198  enableval="$enable_framework"
9199  enable_framework=$enableval
9200else
9201  enable_framework=no
9202fi
9203
9204	if test $enable_framework = yes; then
9205	    if test $SHARED_BUILD = 0; then
9206		echo "configure: warning: Frameworks can only be built if --enable-shared is yes" 1>&2
9207		enable_framework=no
9208	    fi
9209	    if test $tcl_corefoundation = no; then
9210		echo "configure: warning: Frameworks can only be used when CoreFoundation is available" 1>&2
9211		enable_framework=no
9212	    fi
9213	fi
9214	if test $enable_framework = yes; then
9215	    echo "$ac_t""framework" 1>&6
9216	    FRAMEWORK_BUILD=1
9217	else
9218	    if test $SHARED_BUILD = 1; then
9219		echo "$ac_t""shared library" 1>&6
9220	    else
9221		echo "$ac_t""static library" 1>&6
9222	    fi
9223	    FRAMEWORK_BUILD=0
9224	fi
9225    fi
9226
9227    TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`"
9228    TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name ${DYLIB_INSTALL_DIR}/${TCL_LIB_FILE}'
9229    echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xa000000'
9230    TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist'
9231    EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist'
9232    EXTRA_APP_CC_SWITCHES='-mdynamic-no-pic'
9233    tcl_config_files="${tcl_config_files} Tcl-Info.plist:../macosx/Tcl-Info.plist.in Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in"
9234    TCL_YEAR="`date +%Y`"
9235fi
9236
9237if test "$FRAMEWORK_BUILD" = "1" ; then
9238    cat >> confdefs.h <<\EOF
9239#define TCL_FRAMEWORK 1
9240EOF
9241
9242    # Construct a fake local framework structure to make linking with
9243    # '-framework Tcl' and running of tcltest work
9244    
9245    LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH"
9246    if test "${libdir}" = '${exec_prefix}/lib'; then
9247        # override libdir default
9248        libdir="/Library/Frameworks"
9249    fi
9250    TCL_LIB_FILE="Tcl"
9251    TCL_LIB_FLAG="-framework Tcl"
9252    TCL_BUILD_LIB_SPEC="-F`pwd` -framework Tcl"
9253    TCL_LIB_SPEC="-F${libdir} -framework Tcl"
9254    libdir="${libdir}/Tcl.framework/Versions/\${VERSION}"
9255    TCL_LIBRARY="${libdir}/Resources/Scripts"
9256    includedir="${libdir}/Headers"
9257    PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders"
9258    HTML_DIR="${libdir}/Resources/Documentation/Reference/Tcl"
9259    EXTRA_INSTALL="install-private-headers html-tcl"
9260    EXTRA_BUILD_HTML='@ln -fs contents.htm $(HTML_INSTALL_DIR)/TclTOC.html' 
9261    EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tcl-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"'
9262    EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"'
9263    EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tcl.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tclConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."'
9264    # Don't use AC_DEFINE for the following as the framework version define 
9265    # needs to go into the Makefile even when using autoheader, so that we  
9266    # can pick up a potential make override of VERSION. Also, don't put this
9267    # into CFLAGS as it should not go into tclConfig.sh
9268    EXTRA_CC_SWITCHES='-DTCL_FRAMEWORK_VERSION=\"$(VERSION)\"'
9269else
9270    # libdir must be a fully qualified path and not ${exec_prefix}/lib
9271    eval libdir="$libdir"
9272    if test "$SHARED_BUILD" = "0" || test "$TCL_NEEDS_EXP_FILE" = "0"; then
9273        if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
9274            TCL_LIB_FLAG="-ltcl${TCL_VERSION}\${TCL_DBGX}"
9275        else
9276            TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`\${TCL_DBGX}"
9277        fi
9278        TCL_BUILD_LIB_SPEC="-L`pwd` ${TCL_LIB_FLAG}"
9279        TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}"
9280    else
9281        TCL_BUILD_EXP_FILE="lib.exp"
9282        eval "TCL_EXP_FILE=libtcl${TCL_EXPORT_FILE_SUFFIX}"
9283    
9284        # Replace DBGX with TCL_DBGX
9285        eval "TCL_EXP_FILE=\"${TCL_EXP_FILE}\""
9286        
9287        if test "$GCC" = "yes" ; then
9288            TCL_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TCL_BUILD_EXP_FILE} -L`pwd`"
9289            TCL_LIB_SPEC="-Wl,-bI:${libdir}/${TCL_EXP_FILE} -L`pwd`"
9290        else
9291            TCL_BUILD_LIB_SPEC="-bI:`pwd`/${TCL_BUILD_EXP_FILE}"
9292            TCL_LIB_SPEC="-bI:${libdir}/${TCL_EXP_FILE}"
9293        fi
9294    fi
9295fi
9296VERSION='${VERSION}'
9297eval "CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}"
9298eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}"
9299eval "CFG_TCL_EXPORT_FILE_SUFFIX=${TCL_EXPORT_FILE_SUFFIX}"
9300VERSION=${TCL_VERSION}
9301
9302#--------------------------------------------------------------------
9303#	The statements below define the symbol TCL_PACKAGE_PATH, which
9304#	gives a list of directories that may contain packages.  The list
9305#	consists of one directory for machine-dependent binaries and
9306#	another for platform-independent scripts.
9307#--------------------------------------------------------------------
9308
9309if test "$FRAMEWORK_BUILD" = "1" ; then
9310    test -z "$TCL_PACKAGE_PATH" && \
9311        TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl ~/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks"
9312elif test "$prefix" != "$exec_prefix"; then
9313    TCL_PACKAGE_PATH="${libdir} ${prefix}/lib ${TCL_PACKAGE_PATH}"
9314else
9315    TCL_PACKAGE_PATH="${prefix}/lib ${TCL_PACKAGE_PATH}"
9316fi
9317
9318#--------------------------------------------------------------------
9319#       The statements below define various symbols relating to Tcl
9320#       stub support.
9321#--------------------------------------------------------------------
9322
9323# Replace ${VERSION} with contents of ${TCL_VERSION}
9324eval "TCL_STUB_LIB_FILE=libtclstub${TCL_UNSHARED_LIB_SUFFIX}"
9325# Replace DBGX with TCL_DBGX
9326eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
9327eval "TCL_STUB_LIB_DIR=${libdir}"
9328
9329if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
9330    TCL_STUB_LIB_FLAG="-ltclstub${TCL_VERSION}\${TCL_DBGX}"
9331else
9332    TCL_STUB_LIB_FLAG="-ltclstub`echo ${TCL_VERSION} | tr -d .`\${TCL_DBGX}"
9333fi
9334
9335TCL_BUILD_STUB_LIB_SPEC="-L`pwd` ${TCL_STUB_LIB_FLAG}"
9336TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}"
9337TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}"
9338TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}"
9339
9340# Install time header dir can be set via --includedir
9341eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
9342
9343#------------------------------------------------------------------------
9344# tclConfig.sh refers to this by a different name
9345#------------------------------------------------------------------------
9346
9347TCL_SHARED_BUILD=${SHARED_BUILD}
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
9406
9407
9408tcl_config_files="${tcl_config_files} Makefile dltest/Makefile tclConfig.sh"
9409trap '' 1 2 15
9410cat > confcache <<\EOF
9411# This file is a shell script that caches the results of configure
9412# tests run on this system so they can be shared between configure
9413# scripts and configure runs.  It is not useful on other systems.
9414# If it contains results you don't want to keep, you may remove or edit it.
9415#
9416# By default, configure uses ./config.cache as the cache file,
9417# creating it if it does not exist already.  You can give configure
9418# the --cache-file=FILE option to use a different cache file; that is
9419# what configure does when it calls configure scripts in
9420# subdirectories, so they share the cache.
9421# Giving --cache-file=/dev/null disables caching, for debugging configure.
9422# config.status only pays attention to the cache file if you give it the
9423# --recheck option to rerun configure.
9424#
9425EOF
9426# The following way of writing the cache mishandles newlines in values,
9427# but we know of no workaround that is simple, portable, and efficient.
9428# So, don't put newlines in cache variables' values.
9429# Ultrix sh set writes to stderr and can't be redirected directly,
9430# and sets the high bit in the cache file unless we assign to the vars.
9431(set) 2>&1 |
9432  case `(ac_space=' '; set | grep ac_space) 2>&1` in
9433  *ac_space=\ *)
9434    # `set' does not quote correctly, so add quotes (double-quote substitution
9435    # turns \\\\ into \\, and sed turns \\ into \).
9436    sed -n \
9437      -e "s/'/'\\\\''/g" \
9438      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
9439    ;;
9440  *)
9441    # `set' quotes correctly as required by POSIX, so do not add quotes.
9442    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
9443    ;;
9444  esac >> confcache
9445if cmp -s $cache_file confcache; then
9446  :
9447else
9448  if test -w $cache_file; then
9449    echo "updating cache $cache_file"
9450    cat confcache > $cache_file
9451  else
9452    echo "not updating unwritable cache $cache_file"
9453  fi
9454fi
9455rm -f confcache
9456
9457trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
9458
9459test "x$prefix" = xNONE && prefix=$ac_default_prefix
9460# Let make expand exec_prefix.
9461test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
9462
9463# Any assignment to VPATH causes Sun make to only execute
9464# the first set of double-colon rules, so remove it if not needed.
9465# If there is a colon in the path, we need to keep it.
9466if test "x$srcdir" = x.; then
9467  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
9468fi
9469
9470trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
9471
9472# Transform confdefs.h into DEFS.
9473# Protect against shell expansion while executing Makefile rules.
9474# Protect against Makefile macro expansion.
9475cat > conftest.defs <<\EOF
9476s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
9477s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
9478s%\[%\\&%g
9479s%\]%\\&%g
9480s%\$%$$%g
9481EOF
9482DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
9483rm -f conftest.defs
9484
9485
9486# Without the "./", some shells look in PATH for config.status.
9487: ${CONFIG_STATUS=./config.status}
9488
9489echo creating $CONFIG_STATUS
9490rm -f $CONFIG_STATUS
9491cat > $CONFIG_STATUS <<EOF
9492#! /bin/sh
9493# Generated automatically by configure.
9494# Run this file to recreate the current configuration.
9495# This directory was configured as follows,
9496# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
9497#
9498# $0 $ac_configure_args
9499#
9500# Compiler output produced by configure, useful for debugging
9501# configure, is in ./config.log if it exists.
9502
9503ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
9504for ac_option
9505do
9506  case "\$ac_option" in
9507  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
9508    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
9509    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
9510  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
9511    echo "$CONFIG_STATUS generated by autoconf version 2.13"
9512    exit 0 ;;
9513  -help | --help | --hel | --he | --h)
9514    echo "\$ac_cs_usage"; exit 0 ;;
9515  *) echo "\$ac_cs_usage"; exit 1 ;;
9516  esac
9517done
9518
9519ac_given_srcdir=$srcdir
9520
9521trap 'rm -fr `echo "${tcl_config_files}" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
9522EOF
9523cat >> $CONFIG_STATUS <<EOF
9524
9525# Protect against being on the right side of a sed subst in config.status.
9526sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
9527 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
9528$ac_vpsub
9529$extrasub
9530s%@SHELL@%$SHELL%g
9531s%@CFLAGS@%$CFLAGS%g
9532s%@CPPFLAGS@%$CPPFLAGS%g
9533s%@CXXFLAGS@%$CXXFLAGS%g
9534s%@FFLAGS@%$FFLAGS%g
9535s%@DEFS@%$DEFS%g
9536s%@LDFLAGS@%$LDFLAGS%g
9537s%@LIBS@%$LIBS%g
9538s%@exec_prefix@%$exec_prefix%g
9539s%@prefix@%$prefix%g
9540s%@program_transform_name@%$program_transform_name%g
9541s%@bindir@%$bindir%g
9542s%@sbindir@%$sbindir%g
9543s%@libexecdir@%$libexecdir%g
9544s%@datadir@%$datadir%g
9545s%@sysconfdir@%$sysconfdir%g
9546s%@sharedstatedir@%$sharedstatedir%g
9547s%@localstatedir@%$localstatedir%g
9548s%@libdir@%$libdir%g
9549s%@includedir@%$includedir%g
9550s%@oldincludedir@%$oldincludedir%g
9551s%@infodir@%$infodir%g
9552s%@mandir@%$mandir%g
9553s%@MAN_FLAGS@%$MAN_FLAGS%g
9554s%@CC@%$CC%g
9555s%@CPP@%$CPP%g
9556s%@TCL_THREADS@%$TCL_THREADS%g
9557s%@TCL_LIBS@%$TCL_LIBS%g
9558s%@MATH_LIBS@%$MATH_LIBS%g
9559s%@RANLIB@%$RANLIB%g
9560s%@AR@%$AR%g
9561s%@DL_LIBS@%$DL_LIBS%g
9562s%@DL_OBJS@%$DL_OBJS%g
9563s%@PLAT_OBJS@%$PLAT_OBJS%g
9564s%@PLAT_SRCS@%$PLAT_SRCS%g
9565s%@CFLAGS_DEBUG@%$CFLAGS_DEBUG%g
9566s%@CFLAGS_OPTIMIZE@%$CFLAGS_OPTIMIZE%g
9567s%@CFLAGS_WARNING@%$CFLAGS_WARNING%g
9568s%@LDFLAGS_DEBUG@%$LDFLAGS_DEBUG%g
9569s%@LDFLAGS_OPTIMIZE@%$LDFLAGS_OPTIMIZE%g
9570s%@CC_SEARCH_FLAGS@%$CC_SEARCH_FLAGS%g
9571s%@LD_SEARCH_FLAGS@%$LD_SEARCH_FLAGS%g
9572s%@STLIB_LD@%$STLIB_LD%g
9573s%@SHLIB_LD@%$SHLIB_LD%g
9574s%@TCL_SHLIB_LD_EXTRAS@%$TCL_SHLIB_LD_EXTRAS%g
9575s%@TK_SHLIB_LD_EXTRAS@%$TK_SHLIB_LD_EXTRAS%g
9576s%@SHLIB_LD_LIBS@%$SHLIB_LD_LIBS%g
9577s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
9578s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
9579s%@MAKE_LIB@%$MAKE_LIB%g
9580s%@MAKE_STUB_LIB@%$MAKE_STUB_LIB%g
9581s%@INSTALL_LIB@%$INSTALL_LIB%g
9582s%@INSTALL_STUB_LIB@%$INSTALL_STUB_LIB%g
9583s%@CFLAGS_DEFAULT@%$CFLAGS_DEFAULT%g
9584s%@LDFLAGS_DEFAULT@%$LDFLAGS_DEFAULT%g
9585s%@LIBOBJS@%$LIBOBJS%g
9586s%@DTRACE@%$DTRACE%g
9587s%@TCL_VERSION@%$TCL_VERSION%g
9588s%@TCL_MAJOR_VERSION@%$TCL_MAJOR_VERSION%g
9589s%@TCL_MINOR_VERSION@%$TCL_MINOR_VERSION%g
9590s%@TCL_PATCH_LEVEL@%$TCL_PATCH_LEVEL%g
9591s%@TCL_YEAR@%$TCL_YEAR%g
9592s%@TCL_LIB_FILE@%$TCL_LIB_FILE%g
9593s%@TCL_LIB_FLAG@%$TCL_LIB_FLAG%g
9594s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
9595s%@TCL_STUB_LIB_FILE@%$TCL_STUB_LIB_FILE%g
9596s%@TCL_STUB_LIB_FLAG@%$TCL_STUB_LIB_FLAG%g
9597s%@TCL_STUB_LIB_SPEC@%$TCL_STUB_LIB_SPEC%g
9598s%@TCL_STUB_LIB_PATH@%$TCL_STUB_LIB_PATH%g
9599s%@TCL_INCLUDE_SPEC@%$TCL_INCLUDE_SPEC%g
9600s%@TCL_BUILD_STUB_LIB_SPEC@%$TCL_BUILD_STUB_LIB_SPEC%g
9601s%@TCL_BUILD_STUB_LIB_PATH@%$TCL_BUILD_STUB_LIB_PATH%g
9602s%@TCL_SRC_DIR@%$TCL_SRC_DIR%g
9603s%@TCL_DBGX@%$TCL_DBGX%g
9604s%@CFG_TCL_SHARED_LIB_SUFFIX@%$CFG_TCL_SHARED_LIB_SUFFIX%g
9605s%@CFG_TCL_UNSHARED_LIB_SUFFIX@%$CFG_TCL_UNSHARED_LIB_SUFFIX%g
9606s%@CFG_TCL_EXPORT_FILE_SUFFIX@%$CFG_TCL_EXPORT_FILE_SUFFIX%g
9607s%@TCL_SHARED_BUILD@%$TCL_SHARED_BUILD%g
9608s%@LD_LIBRARY_PATH_VAR@%$LD_LIBRARY_PATH_VAR%g
9609s%@TCL_BUILD_LIB_SPEC@%$TCL_BUILD_LIB_SPEC%g
9610s%@TCL_NEEDS_EXP_FILE@%$TCL_NEEDS_EXP_FILE%g
9611s%@TCL_BUILD_EXP_FILE@%$TCL_BUILD_EXP_FILE%g
9612s%@TCL_EXP_FILE@%$TCL_EXP_FILE%g
9613s%@TCL_LIB_VERSIONS_OK@%$TCL_LIB_VERSIONS_OK%g
9614s%@TCL_SHARED_LIB_SUFFIX@%$TCL_SHARED_LIB_SUFFIX%g
9615s%@TCL_UNSHARED_LIB_SUFFIX@%$TCL_UNSHARED_LIB_SUFFIX%g
9616s%@TCL_HAS_LONGLONG@%$TCL_HAS_LONGLONG%g
9617s%@DTRACE_SRC@%$DTRACE_SRC%g
9618s%@DTRACE_HDR@%$DTRACE_HDR%g
9619s%@DTRACE_OBJ@%$DTRACE_OBJ%g
9620s%@MAKEFILE_SHELL@%$MAKEFILE_SHELL%g
9621s%@BUILD_DLTEST@%$BUILD_DLTEST%g
9622s%@TCL_PACKAGE_PATH@%$TCL_PACKAGE_PATH%g
9623s%@TCL_LIBRARY@%$TCL_LIBRARY%g
9624s%@PRIVATE_INCLUDE_DIR@%$PRIVATE_INCLUDE_DIR%g
9625s%@HTML_DIR@%$HTML_DIR%g
9626s%@EXTRA_CC_SWITCHES@%$EXTRA_CC_SWITCHES%g
9627s%@EXTRA_APP_CC_SWITCHES@%$EXTRA_APP_CC_SWITCHES%g
9628s%@EXTRA_INSTALL@%$EXTRA_INSTALL%g
9629s%@EXTRA_INSTALL_BINARIES@%$EXTRA_INSTALL_BINARIES%g
9630s%@EXTRA_BUILD_HTML@%$EXTRA_BUILD_HTML%g
9631s%@EXTRA_TCLSH_LIBS@%$EXTRA_TCLSH_LIBS%g
9632
9633CEOF
9634EOF
9635
9636cat >> $CONFIG_STATUS <<\EOF
9637
9638# Split the substitutions into bite-sized pieces for seds with
9639# small command number limits, like on Digital OSF/1 and HP-UX.
9640ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
9641ac_file=1 # Number of current file.
9642ac_beg=1 # First line for current file.
9643ac_end=$ac_max_sed_cmds # Line after last line for current file.
9644ac_more_lines=:
9645ac_sed_cmds=""
9646while $ac_more_lines; do
9647  if test $ac_beg -gt 1; then
9648    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
9649  else
9650    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
9651  fi
9652  if test ! -s conftest.s$ac_file; then
9653    ac_more_lines=false
9654    rm -f conftest.s$ac_file
9655  else
9656    if test -z "$ac_sed_cmds"; then
9657      ac_sed_cmds="sed -f conftest.s$ac_file"
9658    else
9659      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
9660    fi
9661    ac_file=`expr $ac_file + 1`
9662    ac_beg=$ac_end
9663    ac_end=`expr $ac_end + $ac_max_sed_cmds`
9664  fi
9665done
9666if test -z "$ac_sed_cmds"; then
9667  ac_sed_cmds=cat
9668fi
9669EOF
9670
9671cat >> $CONFIG_STATUS <<EOF
9672
9673CONFIG_FILES=\${CONFIG_FILES-"${tcl_config_files}"}
9674EOF
9675cat >> $CONFIG_STATUS <<\EOF
9676for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
9677  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
9678  case "$ac_file" in
9679  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9680       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9681  *) ac_file_in="${ac_file}.in" ;;
9682  esac
9683
9684  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
9685
9686  # Remove last slash and all that follows it.  Not all systems have dirname.
9687  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9688  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9689    # The file is in a subdirectory.
9690    test ! -d "$ac_dir" && mkdir "$ac_dir"
9691    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
9692    # A "../" for each directory in $ac_dir_suffix.
9693    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
9694  else
9695    ac_dir_suffix= ac_dots=
9696  fi
9697
9698  case "$ac_given_srcdir" in
9699  .)  srcdir=.
9700      if test -z "$ac_dots"; then top_srcdir=.
9701      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
9702  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
9703  *) # Relative path.
9704    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
9705    top_srcdir="$ac_dots$ac_given_srcdir" ;;
9706  esac
9707
9708
9709  echo creating "$ac_file"
9710  rm -f "$ac_file"
9711  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
9712  case "$ac_file" in
9713  *Makefile*) ac_comsub="1i\\
9714# $configure_input" ;;
9715  *) ac_comsub= ;;
9716  esac
9717
9718  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9719  sed -e "$ac_comsub
9720s%@configure_input@%$configure_input%g
9721s%@srcdir@%$srcdir%g
9722s%@top_srcdir@%$top_srcdir%g
9723" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
9724fi; done
9725rm -f conftest.s*
9726
9727EOF
9728cat >> $CONFIG_STATUS <<EOF
9729VERSION=${TCL_VERSION} FRAMEWORK_BUILD=${FRAMEWORK_BUILD}
9730
9731EOF
9732cat >> $CONFIG_STATUS <<\EOF
9733test "$FRAMEWORK_BUILD" = "1" && n=Tcl &&
9734	f=$n.framework && v=Versions/$VERSION &&
9735	echo "creating $f" && rm -rf $f && mkdir -p $f/$v/Resources &&
9736	ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v &&
9737	ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist &&
9738	unset n f v
9739    
9740
9741exit 0
9742EOF
9743chmod +x $CONFIG_STATUS
9744rm -fr confdefs* $ac_clean_files
9745test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
9746
9747