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  --with-tcl              directory containing tcl configuration (tclConfig.sh)"
16ac_help="$ac_help
17  --enable-man-symlinks   use symlinks for the manpages"
18ac_help="$ac_help
19  --enable-man-compression=PROG
20		      compress the manpages with PROG"
21ac_help="$ac_help
22  --enable-man-suffix=STRING
23		      use STRING as a suffix to manpage file names
24		      (default: tk)"
25ac_help="$ac_help
26  --enable-threads        build with threads"
27ac_help="$ac_help
28  --enable-shared         build and link with shared libraries [--enable-shared]"
29ac_help="$ac_help
30  --enable-64bit          enable 64bit support (where applicable)"
31ac_help="$ac_help
32  --enable-64bit-vis      enable 64bit Sparc VIS support"
33ac_help="$ac_help
34  --enable-corefoundation use CoreFoundation API [--enable-corefoundation]"
35ac_help="$ac_help
36  --disable-load          disallow dynamic loading and "load" command"
37ac_help="$ac_help
38  --enable-symbols        build with debugging symbols [--disable-symbols]"
39ac_help="$ac_help
40  --enable-aqua           enable Aqua windowingsystem on Mac OS X [--disable-aqua]"
41ac_help="$ac_help
42  --with-x                use the X Window System"
43ac_help="$ac_help
44  --enable-framework      package shared libraries in MacOSX frameworks [--disable-framework]"
45
46# Initialize some variables set by options.
47# The variables have the same names as the options, with
48# dashes changed to underlines.
49build=NONE
50cache_file=./config.cache
51exec_prefix=NONE
52host=NONE
53no_create=
54nonopt=NONE
55no_recursion=
56prefix=NONE
57program_prefix=NONE
58program_suffix=NONE
59program_transform_name=s,x,x,
60silent=
61site=
62srcdir=
63target=NONE
64verbose=
65x_includes=NONE
66x_libraries=NONE
67bindir='${exec_prefix}/bin'
68sbindir='${exec_prefix}/sbin'
69libexecdir='${exec_prefix}/libexec'
70datadir='${prefix}/share'
71sysconfdir='${prefix}/etc'
72sharedstatedir='${prefix}/com'
73localstatedir='${prefix}/var'
74libdir='${exec_prefix}/lib'
75includedir='${prefix}/include'
76oldincludedir='/usr/include'
77infodir='${prefix}/info'
78mandir='${prefix}/man'
79
80# Initialize some other variables.
81subdirs=
82MFLAGS= MAKEFLAGS=
83SHELL=${CONFIG_SHELL-/bin/sh}
84# Maximum number of lines to put in a shell here document.
85ac_max_here_lines=12
86
87ac_prev=
88for ac_option
89do
90
91  # If the previous option needs an argument, assign it.
92  if test -n "$ac_prev"; then
93    eval "$ac_prev=\$ac_option"
94    ac_prev=
95    continue
96  fi
97
98  case "$ac_option" in
99  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
100  *) ac_optarg= ;;
101  esac
102
103  # Accept the important Cygnus configure options, so we can diagnose typos.
104
105  case "$ac_option" in
106
107  -bindir | --bindir | --bindi | --bind | --bin | --bi)
108    ac_prev=bindir ;;
109  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
110    bindir="$ac_optarg" ;;
111
112  -build | --build | --buil | --bui | --bu)
113    ac_prev=build ;;
114  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
115    build="$ac_optarg" ;;
116
117  -cache-file | --cache-file | --cache-fil | --cache-fi \
118  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
119    ac_prev=cache_file ;;
120  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
121  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
122    cache_file="$ac_optarg" ;;
123
124  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
125    ac_prev=datadir ;;
126  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
127  | --da=*)
128    datadir="$ac_optarg" ;;
129
130  -disable-* | --disable-*)
131    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
132    # Reject names that are not valid shell variable names.
133    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
134      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
135    fi
136    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
137    eval "enable_${ac_feature}=no" ;;
138
139  -enable-* | --enable-*)
140    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
141    # Reject names that are not valid shell variable names.
142    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
143      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
144    fi
145    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
146    case "$ac_option" in
147      *=*) ;;
148      *) ac_optarg=yes ;;
149    esac
150    eval "enable_${ac_feature}='$ac_optarg'" ;;
151
152  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
153  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
154  | --exec | --exe | --ex)
155    ac_prev=exec_prefix ;;
156  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
157  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
158  | --exec=* | --exe=* | --ex=*)
159    exec_prefix="$ac_optarg" ;;
160
161  -gas | --gas | --ga | --g)
162    # Obsolete; use --with-gas.
163    with_gas=yes ;;
164
165  -help | --help | --hel | --he)
166    # Omit some internal or obsolete options to make the list less imposing.
167    # This message is too long to be a string in the A/UX 3.1 sh.
168    cat << EOF
169Usage: configure [options] [host]
170Options: [defaults in brackets after descriptions]
171Configuration:
172  --cache-file=FILE       cache test results in FILE
173  --help                  print this message
174  --no-create             do not create output files
175  --quiet, --silent       do not print \`checking...' messages
176  --version               print the version of autoconf that created configure
177Directory and file names:
178  --prefix=PREFIX         install architecture-independent files in PREFIX
179                          [$ac_default_prefix]
180  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
181                          [same as prefix]
182  --bindir=DIR            user executables in DIR [EPREFIX/bin]
183  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
184  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
185  --datadir=DIR           read-only architecture-independent data in DIR
186                          [PREFIX/share]
187  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
188  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
189                          [PREFIX/com]
190  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
191  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
192  --includedir=DIR        C header files in DIR [PREFIX/include]
193  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
194  --infodir=DIR           info documentation in DIR [PREFIX/info]
195  --mandir=DIR            man documentation in DIR [PREFIX/man]
196  --srcdir=DIR            find the sources in DIR [configure dir or ..]
197  --program-prefix=PREFIX prepend PREFIX to installed program names
198  --program-suffix=SUFFIX append SUFFIX to installed program names
199  --program-transform-name=PROGRAM
200                          run sed PROGRAM on installed program names
201EOF
202    cat << EOF
203Host type:
204  --build=BUILD           configure for building on BUILD [BUILD=HOST]
205  --host=HOST             configure for HOST [guessed]
206  --target=TARGET         configure for TARGET [TARGET=HOST]
207Features and packages:
208  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
209  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
210  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
211  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
212  --x-includes=DIR        X include files are in DIR
213  --x-libraries=DIR       X library files are in DIR
214EOF
215    if test -n "$ac_help"; then
216      echo "--enable and --with options recognized:$ac_help"
217    fi
218    exit 0 ;;
219
220  -host | --host | --hos | --ho)
221    ac_prev=host ;;
222  -host=* | --host=* | --hos=* | --ho=*)
223    host="$ac_optarg" ;;
224
225  -includedir | --includedir | --includedi | --included | --include \
226  | --includ | --inclu | --incl | --inc)
227    ac_prev=includedir ;;
228  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
229  | --includ=* | --inclu=* | --incl=* | --inc=*)
230    includedir="$ac_optarg" ;;
231
232  -infodir | --infodir | --infodi | --infod | --info | --inf)
233    ac_prev=infodir ;;
234  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
235    infodir="$ac_optarg" ;;
236
237  -libdir | --libdir | --libdi | --libd)
238    ac_prev=libdir ;;
239  -libdir=* | --libdir=* | --libdi=* | --libd=*)
240    libdir="$ac_optarg" ;;
241
242  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
243  | --libexe | --libex | --libe)
244    ac_prev=libexecdir ;;
245  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
246  | --libexe=* | --libex=* | --libe=*)
247    libexecdir="$ac_optarg" ;;
248
249  -localstatedir | --localstatedir | --localstatedi | --localstated \
250  | --localstate | --localstat | --localsta | --localst \
251  | --locals | --local | --loca | --loc | --lo)
252    ac_prev=localstatedir ;;
253  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
254  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
255  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
256    localstatedir="$ac_optarg" ;;
257
258  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
259    ac_prev=mandir ;;
260  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
261    mandir="$ac_optarg" ;;
262
263  -nfp | --nfp | --nf)
264    # Obsolete; use --without-fp.
265    with_fp=no ;;
266
267  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
268  | --no-cr | --no-c)
269    no_create=yes ;;
270
271  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
272  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
273    no_recursion=yes ;;
274
275  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
276  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
277  | --oldin | --oldi | --old | --ol | --o)
278    ac_prev=oldincludedir ;;
279  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
280  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
281  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
282    oldincludedir="$ac_optarg" ;;
283
284  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
285    ac_prev=prefix ;;
286  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
287    prefix="$ac_optarg" ;;
288
289  -program-prefix | --program-prefix | --program-prefi | --program-pref \
290  | --program-pre | --program-pr | --program-p)
291    ac_prev=program_prefix ;;
292  -program-prefix=* | --program-prefix=* | --program-prefi=* \
293  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
294    program_prefix="$ac_optarg" ;;
295
296  -program-suffix | --program-suffix | --program-suffi | --program-suff \
297  | --program-suf | --program-su | --program-s)
298    ac_prev=program_suffix ;;
299  -program-suffix=* | --program-suffix=* | --program-suffi=* \
300  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
301    program_suffix="$ac_optarg" ;;
302
303  -program-transform-name | --program-transform-name \
304  | --program-transform-nam | --program-transform-na \
305  | --program-transform-n | --program-transform- \
306  | --program-transform | --program-transfor \
307  | --program-transfo | --program-transf \
308  | --program-trans | --program-tran \
309  | --progr-tra | --program-tr | --program-t)
310    ac_prev=program_transform_name ;;
311  -program-transform-name=* | --program-transform-name=* \
312  | --program-transform-nam=* | --program-transform-na=* \
313  | --program-transform-n=* | --program-transform-=* \
314  | --program-transform=* | --program-transfor=* \
315  | --program-transfo=* | --program-transf=* \
316  | --program-trans=* | --program-tran=* \
317  | --progr-tra=* | --program-tr=* | --program-t=*)
318    program_transform_name="$ac_optarg" ;;
319
320  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
321  | -silent | --silent | --silen | --sile | --sil)
322    silent=yes ;;
323
324  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
325    ac_prev=sbindir ;;
326  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
327  | --sbi=* | --sb=*)
328    sbindir="$ac_optarg" ;;
329
330  -sharedstatedir | --sharedstatedir | --sharedstatedi \
331  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
332  | --sharedst | --shareds | --shared | --share | --shar \
333  | --sha | --sh)
334    ac_prev=sharedstatedir ;;
335  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
336  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
337  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
338  | --sha=* | --sh=*)
339    sharedstatedir="$ac_optarg" ;;
340
341  -site | --site | --sit)
342    ac_prev=site ;;
343  -site=* | --site=* | --sit=*)
344    site="$ac_optarg" ;;
345
346  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
347    ac_prev=srcdir ;;
348  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
349    srcdir="$ac_optarg" ;;
350
351  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
352  | --syscon | --sysco | --sysc | --sys | --sy)
353    ac_prev=sysconfdir ;;
354  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
355  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
356    sysconfdir="$ac_optarg" ;;
357
358  -target | --target | --targe | --targ | --tar | --ta | --t)
359    ac_prev=target ;;
360  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
361    target="$ac_optarg" ;;
362
363  -v | -verbose | --verbose | --verbos | --verbo | --verb)
364    verbose=yes ;;
365
366  -version | --version | --versio | --versi | --vers)
367    echo "configure generated by autoconf version 2.13"
368    exit 0 ;;
369
370  -with-* | --with-*)
371    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
372    # Reject names that are not valid shell variable names.
373    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
374      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
375    fi
376    ac_package=`echo $ac_package| sed 's/-/_/g'`
377    case "$ac_option" in
378      *=*) ;;
379      *) ac_optarg=yes ;;
380    esac
381    eval "with_${ac_package}='$ac_optarg'" ;;
382
383  -without-* | --without-*)
384    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
385    # Reject names that are not valid shell variable names.
386    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
387      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
388    fi
389    ac_package=`echo $ac_package| sed 's/-/_/g'`
390    eval "with_${ac_package}=no" ;;
391
392  --x)
393    # Obsolete; use --with-x.
394    with_x=yes ;;
395
396  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
397  | --x-incl | --x-inc | --x-in | --x-i)
398    ac_prev=x_includes ;;
399  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
400  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
401    x_includes="$ac_optarg" ;;
402
403  -x-libraries | --x-libraries | --x-librarie | --x-librari \
404  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
405    ac_prev=x_libraries ;;
406  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
407  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
408    x_libraries="$ac_optarg" ;;
409
410  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
411    ;;
412
413  *)
414    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
415      echo "configure: warning: $ac_option: invalid host type" 1>&2
416    fi
417    if test "x$nonopt" != xNONE; then
418      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
419    fi
420    nonopt="$ac_option"
421    ;;
422
423  esac
424done
425
426if test -n "$ac_prev"; then
427  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
428fi
429
430trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
431
432# File descriptor usage:
433# 0 standard input
434# 1 file creation
435# 2 errors and warnings
436# 3 some systems may open it to /dev/tty
437# 4 used on the Kubota Titan
438# 6 checking for... messages and results
439# 5 compiler messages saved in config.log
440if test "$silent" = yes; then
441  exec 6>/dev/null
442else
443  exec 6>&1
444fi
445exec 5>./config.log
446
447echo "\
448This file contains any messages produced by compilers while
449running configure, to aid debugging if configure makes a mistake.
450" 1>&5
451
452# Strip out --no-create and --no-recursion so they do not pile up.
453# Also quote any args containing shell metacharacters.
454ac_configure_args=
455for ac_arg
456do
457  case "$ac_arg" in
458  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
459  | --no-cr | --no-c) ;;
460  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
461  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
462  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
463  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
464  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
465  esac
466done
467
468# NLS nuisances.
469# Only set these to C if already set.  These must not be set unconditionally
470# because not all systems understand e.g. LANG=C (notably SCO).
471# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
472# Non-C LC_CTYPE values break the ctype check.
473if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
474if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
475if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
476if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
477
478# confdefs.h avoids OS command line length limits that DEFS can exceed.
479rm -rf conftest* confdefs.h
480# AIX cpp loses on an empty file, so make sure it contains at least a newline.
481echo > confdefs.h
482
483# A filename unique to this package, relative to the directory that
484# configure is in, which we can look for to find out if srcdir is correct.
485ac_unique_file=../generic/tk.h
486
487# Find the source files, if location was not specified.
488if test -z "$srcdir"; then
489  ac_srcdir_defaulted=yes
490  # Try the directory containing this script, then its parent.
491  ac_prog=$0
492  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
493  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
494  srcdir=$ac_confdir
495  if test ! -r $srcdir/$ac_unique_file; then
496    srcdir=..
497  fi
498else
499  ac_srcdir_defaulted=no
500fi
501if test ! -r $srcdir/$ac_unique_file; then
502  if test "$ac_srcdir_defaulted" = yes; then
503    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
504  else
505    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
506  fi
507fi
508srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
509
510# Prefer explicitly selected file to automatically selected ones.
511if test -z "$CONFIG_SITE"; then
512  if test "x$prefix" != xNONE; then
513    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
514  else
515    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
516  fi
517fi
518for ac_site_file in $CONFIG_SITE; do
519  if test -r "$ac_site_file"; then
520    echo "loading site script $ac_site_file"
521    . "$ac_site_file"
522  fi
523done
524
525if test -r "$cache_file"; then
526  echo "loading cache $cache_file"
527  . $cache_file
528else
529  echo "creating cache $cache_file"
530  > $cache_file
531fi
532
533ac_ext=c
534# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
535ac_cpp='$CPP $CPPFLAGS'
536ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
537ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
538cross_compiling=$ac_cv_prog_cc_cross
539
540ac_exeext=
541ac_objext=o
542if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
543  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
544  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
545    ac_n= ac_c='
546' ac_t='	'
547  else
548    ac_n=-n ac_c= ac_t=
549  fi
550else
551  ac_n= ac_c='\c' ac_t=
552fi
553
554
555
556
557TK_VERSION=8.4
558TK_MAJOR_VERSION=8
559TK_MINOR_VERSION=4
560TK_PATCH_LEVEL=".19"
561VERSION=${TK_VERSION}
562LOCALES="cs de el en en_gb eo es fr hu it nl pl pt ru"
563
564#--------------------------------------------------------------------
565# Find and load the tclConfig.sh file
566#--------------------------------------------------------------------
567
568
569    #
570    # Ok, lets find the tcl configuration
571    # First, look for one uninstalled.
572    # the alternative search directory is invoked by --with-tcl
573    #
574
575    if test x"${no_tcl}" = x ; then
576	# we reset no_tcl in case something fails here
577	no_tcl=true
578	# Check whether --with-tcl or --without-tcl was given.
579if test "${with_tcl+set}" = set; then
580  withval="$with_tcl"
581  with_tclconfig=${withval}
582fi
583
584	echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
585echo "configure:586: checking for Tcl configuration" >&5
586	if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
587  echo $ac_n "(cached) $ac_c" 1>&6
588else
589  
590
591	    # First check to see if --with-tcl was specified.
592	    if test x"${with_tclconfig}" != x ; then
593		if test -f "${with_tclconfig}/tclConfig.sh" ; then
594		    ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
595		else
596		    { echo "configure: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" 1>&2; exit 1; }
597		fi
598	    fi
599
600	    # then check for a private Tcl installation
601	    if test x"${ac_cv_c_tclconfig}" = x ; then
602		for i in \
603			../tcl \
604			`ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
605			`ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
606			`ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
607			../../tcl \
608			`ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
609			`ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
610			`ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
611			../../../tcl \
612			`ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
613			`ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
614			`ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
615		    if test -f "$i/unix/tclConfig.sh" ; then
616			ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
617			break
618		    fi
619		done
620	    fi
621
622	    # on Darwin, check in Framework installation locations
623	    if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
624		for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
625			`ls -d /Library/Frameworks 2>/dev/null` \
626			`ls -d /Network/Library/Frameworks 2>/dev/null` \
627			`ls -d /System/Library/Frameworks 2>/dev/null` \
628			; do
629		    if test -f "$i/Tcl.framework/tclConfig.sh" ; then
630			ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)`
631			break
632		    fi
633		done
634	    fi
635
636	    # check in a few common install locations
637	    if test x"${ac_cv_c_tclconfig}" = x ; then
638		for i in `ls -d ${libdir} 2>/dev/null` \
639			`ls -d ${exec_prefix}/lib 2>/dev/null` \
640			`ls -d ${prefix}/lib 2>/dev/null` \
641			`ls -d /usr/local/lib 2>/dev/null` \
642			`ls -d /usr/contrib/lib 2>/dev/null` \
643			`ls -d /usr/lib 2>/dev/null` \
644			; do
645		    if test -f "$i/tclConfig.sh" ; then
646			ac_cv_c_tclconfig=`(cd $i; pwd)`
647			break
648		    fi
649		done
650	    fi
651
652	    # check in a few other private locations
653	    if test x"${ac_cv_c_tclconfig}" = x ; then
654		for i in \
655			${srcdir}/../tcl \
656			`ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
657			`ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
658			`ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
659		    if test -f "$i/unix/tclConfig.sh" ; then
660		    ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
661		    break
662		fi
663		done
664	    fi
665	
666fi
667
668
669	if test x"${ac_cv_c_tclconfig}" = x ; then
670	    TCL_BIN_DIR="# no Tcl configs found"
671	    echo "configure: warning: Can't find Tcl configuration definitions" 1>&2
672	    exit 0
673	else
674	    no_tcl=
675	    TCL_BIN_DIR=${ac_cv_c_tclconfig}
676	    echo "$ac_t""found ${TCL_BIN_DIR}/tclConfig.sh" 1>&6
677	fi
678    fi
679
680
681    echo $ac_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh""... $ac_c" 1>&6
682echo "configure:683: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5
683
684    if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
685        echo "$ac_t""loading" 1>&6
686	. ${TCL_BIN_DIR}/tclConfig.sh
687    else
688        echo "$ac_t""could not find ${TCL_BIN_DIR}/tclConfig.sh" 1>&6
689    fi
690
691    # eval is required to do the TCL_DBGX substitution
692    eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
693    eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
694
695    # If the TCL_BIN_DIR is the build directory (not the install directory),
696    # then set the common variable name to the value of the build variables.
697    # For example, the variable TCL_LIB_SPEC will be set to the value
698    # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
699    # instead of TCL_BUILD_LIB_SPEC since it will work with both an
700    # installed and uninstalled version of Tcl.
701    if test -f ${TCL_BIN_DIR}/Makefile ; then
702        TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
703        TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
704        TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
705    elif test "`uname -s`" = "Darwin"; then
706	# If Tcl was built as a framework, attempt to use the libraries
707	# from the framework at the given location so that linking works
708	# against Tcl.framework installed in an arbitary location.
709	case ${TCL_DEFS} in
710	    *TCL_FRAMEWORK*)
711		if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then
712		    for i in "`cd ${TCL_BIN_DIR}; pwd`" \
713			     "`cd ${TCL_BIN_DIR}/../..; pwd`"; do
714			if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
715			    TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
716			    break
717			fi
718		    done
719		fi
720		if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then
721		    TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
722		    TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
723		fi
724		;;
725	esac
726    fi
727
728    # eval is required to do the TCL_DBGX substitution
729    eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
730    eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
731    eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
732    eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
733
734    
735    
736    
737    
738
739    
740    
741    
742
743    
744    
745    
746
747
748
749    echo $ac_n "checking for tclsh""... $ac_c" 1>&6
750echo "configure:751: checking for tclsh" >&5
751    if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then
752  echo $ac_n "(cached) $ac_c" 1>&6
753else
754  
755	search_path=`echo ${PATH} | sed -e 's/:/ /g'`
756	for dir in $search_path ; do
757	    for j in `ls -r $dir/tclsh[8-9]* 2> /dev/null` \
758		    `ls -r $dir/tclsh* 2> /dev/null` ; do
759		if test x"$ac_cv_path_tclsh" = x ; then
760		    if test -f "$j" ; then
761			ac_cv_path_tclsh=$j
762			break
763		    fi
764		fi
765	    done
766	done
767    
768fi
769
770
771    if test -f "$ac_cv_path_tclsh" ; then
772	TCLSH_PROG="$ac_cv_path_tclsh"
773	echo "$ac_t""$TCLSH_PROG" 1>&6
774    else
775	# It is not an error if an installed version of Tcl can't be located.
776	TCLSH_PROG=""
777	echo "$ac_t""No tclsh found on PATH" 1>&6
778    fi
779    
780
781
782    echo $ac_n "checking for tclsh in Tcl build directory""... $ac_c" 1>&6
783echo "configure:784: checking for tclsh in Tcl build directory" >&5
784    BUILD_TCLSH=${TCL_BIN_DIR}/tclsh
785    echo "$ac_t""$BUILD_TCLSH" 1>&6
786    
787
788
789if test "${TCL_VERSION}" != "${TK_VERSION}"; then
790    { echo "configure: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
791Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
792Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." 1>&2; exit 1; }
793fi
794
795#------------------------------------------------------------------------
796# Handle the --prefix=... option
797#------------------------------------------------------------------------
798
799if test "${prefix}" = "NONE"; then
800    prefix="$TCL_PREFIX"
801fi
802if test "${exec_prefix}" = "NONE"; then
803    exec_prefix=$prefix
804fi
805# Make sure srcdir is fully qualified!
806srcdir=`cd $srcdir ; pwd`
807TK_SRC_DIR=`cd $srcdir/..; pwd`
808
809#------------------------------------------------------------------------
810# Compress and/or soft link the manpages?
811#------------------------------------------------------------------------
812
813
814    echo $ac_n "checking whether to use symlinks for manpages""... $ac_c" 1>&6
815echo "configure:816: checking whether to use symlinks for manpages" >&5
816    # Check whether --enable-man-symlinks or --disable-man-symlinks was given.
817if test "${enable_man_symlinks+set}" = set; then
818  enableval="$enable_man_symlinks"
819  test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks"
820else
821  enableval="no"
822fi
823
824    echo "$ac_t""$enableval" 1>&6
825
826    echo $ac_n "checking whether to compress the manpages""... $ac_c" 1>&6
827echo "configure:828: checking whether to compress the manpages" >&5
828    # Check whether --enable-man-compression or --disable-man-compression was given.
829if test "${enable_man_compression+set}" = set; then
830  enableval="$enable_man_compression"
831  case $enableval in
832	    yes) { echo "configure: error: missing argument to --enable-man-compression" 1>&2; exit 1; };;
833	    no)  ;;
834	    *)   MAN_FLAGS="$MAN_FLAGS --compress $enableval";;
835	esac
836else
837  enableval="no"
838fi
839
840    echo "$ac_t""$enableval" 1>&6
841    if test "$enableval" != "no"; then
842	echo $ac_n "checking for compressed file suffix""... $ac_c" 1>&6
843echo "configure:844: checking for compressed file suffix" >&5
844	touch TeST
845	$enableval TeST
846	Z=`ls TeST* | sed 's/^....//'`
847	rm -f TeST*
848	MAN_FLAGS="$MAN_FLAGS --extension $Z"
849	echo "$ac_t""$Z" 1>&6
850    fi
851
852    echo $ac_n "checking whether to add a package name suffix for the manpages""... $ac_c" 1>&6
853echo "configure:854: checking whether to add a package name suffix for the manpages" >&5
854    # Check whether --enable-man-suffix or --disable-man-suffix was given.
855if test "${enable_man_suffix+set}" = set; then
856  enableval="$enable_man_suffix"
857  case $enableval in
858	    yes) enableval="tk" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
859	    no)  ;;
860	    *)   MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
861	esac
862else
863  enableval="no"
864fi
865
866    echo "$ac_t""$enableval" 1>&6
867
868    
869
870
871#------------------------------------------------------------------------
872# Standard compiler checks
873#------------------------------------------------------------------------
874
875# If the user did not set CFLAGS, set it now to keep
876# the AC_PROG_CC macro from adding "-g -O2".
877if test "${CFLAGS+set}" != "set" ; then
878    CFLAGS=""
879fi
880
881# Extract the first word of "gcc", so it can be a program name with args.
882set dummy gcc; ac_word=$2
883echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
884echo "configure:885: checking for $ac_word" >&5
885if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
886  echo $ac_n "(cached) $ac_c" 1>&6
887else
888  if test -n "$CC"; then
889  ac_cv_prog_CC="$CC" # Let the user override the test.
890else
891  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
892  ac_dummy="$PATH"
893  for ac_dir in $ac_dummy; do
894    test -z "$ac_dir" && ac_dir=.
895    if test -f $ac_dir/$ac_word; then
896      ac_cv_prog_CC="gcc"
897      break
898    fi
899  done
900  IFS="$ac_save_ifs"
901fi
902fi
903CC="$ac_cv_prog_CC"
904if test -n "$CC"; then
905  echo "$ac_t""$CC" 1>&6
906else
907  echo "$ac_t""no" 1>&6
908fi
909
910if test -z "$CC"; then
911  # Extract the first word of "cc", so it can be a program name with args.
912set dummy cc; ac_word=$2
913echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
914echo "configure:915: checking for $ac_word" >&5
915if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
916  echo $ac_n "(cached) $ac_c" 1>&6
917else
918  if test -n "$CC"; then
919  ac_cv_prog_CC="$CC" # Let the user override the test.
920else
921  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
922  ac_prog_rejected=no
923  ac_dummy="$PATH"
924  for ac_dir in $ac_dummy; do
925    test -z "$ac_dir" && ac_dir=.
926    if test -f $ac_dir/$ac_word; then
927      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
928        ac_prog_rejected=yes
929	continue
930      fi
931      ac_cv_prog_CC="cc"
932      break
933    fi
934  done
935  IFS="$ac_save_ifs"
936if test $ac_prog_rejected = yes; then
937  # We found a bogon in the path, so make sure we never use it.
938  set dummy $ac_cv_prog_CC
939  shift
940  if test $# -gt 0; then
941    # We chose a different compiler from the bogus one.
942    # However, it has the same basename, so the bogon will be chosen
943    # first if we set CC to just the basename; use the full file name.
944    shift
945    set dummy "$ac_dir/$ac_word" "$@"
946    shift
947    ac_cv_prog_CC="$@"
948  fi
949fi
950fi
951fi
952CC="$ac_cv_prog_CC"
953if test -n "$CC"; then
954  echo "$ac_t""$CC" 1>&6
955else
956  echo "$ac_t""no" 1>&6
957fi
958
959  if test -z "$CC"; then
960    case "`uname -s`" in
961    *win32* | *WIN32*)
962      # Extract the first word of "cl", so it can be a program name with args.
963set dummy cl; ac_word=$2
964echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
965echo "configure:966: checking for $ac_word" >&5
966if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
967  echo $ac_n "(cached) $ac_c" 1>&6
968else
969  if test -n "$CC"; then
970  ac_cv_prog_CC="$CC" # Let the user override the test.
971else
972  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
973  ac_dummy="$PATH"
974  for ac_dir in $ac_dummy; do
975    test -z "$ac_dir" && ac_dir=.
976    if test -f $ac_dir/$ac_word; then
977      ac_cv_prog_CC="cl"
978      break
979    fi
980  done
981  IFS="$ac_save_ifs"
982fi
983fi
984CC="$ac_cv_prog_CC"
985if test -n "$CC"; then
986  echo "$ac_t""$CC" 1>&6
987else
988  echo "$ac_t""no" 1>&6
989fi
990 ;;
991    esac
992  fi
993  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
994fi
995
996echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
997echo "configure:998: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
998
999ac_ext=c
1000# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1001ac_cpp='$CPP $CPPFLAGS'
1002ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1003ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1004cross_compiling=$ac_cv_prog_cc_cross
1005
1006cat > conftest.$ac_ext << EOF
1007
1008#line 1009 "configure"
1009#include "confdefs.h"
1010
1011main(){return(0);}
1012EOF
1013if { (eval echo configure:1014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1014  ac_cv_prog_cc_works=yes
1015  # If we can't run a trivial program, we are probably using a cross compiler.
1016  if (./conftest; exit) 2>/dev/null; then
1017    ac_cv_prog_cc_cross=no
1018  else
1019    ac_cv_prog_cc_cross=yes
1020  fi
1021else
1022  echo "configure: failed program was:" >&5
1023  cat conftest.$ac_ext >&5
1024  ac_cv_prog_cc_works=no
1025fi
1026rm -fr conftest*
1027ac_ext=c
1028# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1029ac_cpp='$CPP $CPPFLAGS'
1030ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1031ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1032cross_compiling=$ac_cv_prog_cc_cross
1033
1034echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1035if test $ac_cv_prog_cc_works = no; then
1036  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1037fi
1038echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1039echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1040echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1041cross_compiling=$ac_cv_prog_cc_cross
1042
1043echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1044echo "configure:1045: checking whether we are using GNU C" >&5
1045if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1046  echo $ac_n "(cached) $ac_c" 1>&6
1047else
1048  cat > conftest.c <<EOF
1049#ifdef __GNUC__
1050  yes;
1051#endif
1052EOF
1053if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1054  ac_cv_prog_gcc=yes
1055else
1056  ac_cv_prog_gcc=no
1057fi
1058fi
1059
1060echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1061
1062if test $ac_cv_prog_gcc = yes; then
1063  GCC=yes
1064else
1065  GCC=
1066fi
1067
1068ac_test_CFLAGS="${CFLAGS+set}"
1069ac_save_CFLAGS="$CFLAGS"
1070CFLAGS=
1071echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1072echo "configure:1073: checking whether ${CC-cc} accepts -g" >&5
1073if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1074  echo $ac_n "(cached) $ac_c" 1>&6
1075else
1076  echo 'void f(){}' > conftest.c
1077if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1078  ac_cv_prog_cc_g=yes
1079else
1080  ac_cv_prog_cc_g=no
1081fi
1082rm -f conftest*
1083
1084fi
1085
1086echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1087if test "$ac_test_CFLAGS" = set; then
1088  CFLAGS="$ac_save_CFLAGS"
1089elif test $ac_cv_prog_cc_g = yes; then
1090  if test "$GCC" = yes; then
1091    CFLAGS="-g -O2"
1092  else
1093    CFLAGS="-g"
1094  fi
1095else
1096  if test "$GCC" = yes; then
1097    CFLAGS="-O2"
1098  else
1099    CFLAGS=
1100  fi
1101fi
1102
1103
1104# limits header checks must come early to prevent
1105# an autoconf bug that throws errors on configure
1106echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1107echo "configure:1108: checking how to run the C preprocessor" >&5
1108# On Suns, sometimes $CPP names a directory.
1109if test -n "$CPP" && test -d "$CPP"; then
1110  CPP=
1111fi
1112if test -z "$CPP"; then
1113if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1114  echo $ac_n "(cached) $ac_c" 1>&6
1115else
1116    # This must be in double quotes, not single quotes, because CPP may get
1117  # substituted into the Makefile and "${CC-cc}" will confuse make.
1118  CPP="${CC-cc} -E"
1119  # On the NeXT, cc -E runs the code through the compiler's parser,
1120  # not just through cpp.
1121  cat > conftest.$ac_ext <<EOF
1122#line 1123 "configure"
1123#include "confdefs.h"
1124#include <assert.h>
1125Syntax Error
1126EOF
1127ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1128{ (eval echo configure:1129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1129ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1130if test -z "$ac_err"; then
1131  :
1132else
1133  echo "$ac_err" >&5
1134  echo "configure: failed program was:" >&5
1135  cat conftest.$ac_ext >&5
1136  rm -rf conftest*
1137  CPP="${CC-cc} -E -traditional-cpp"
1138  cat > conftest.$ac_ext <<EOF
1139#line 1140 "configure"
1140#include "confdefs.h"
1141#include <assert.h>
1142Syntax Error
1143EOF
1144ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1145{ (eval echo configure:1146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1146ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1147if test -z "$ac_err"; then
1148  :
1149else
1150  echo "$ac_err" >&5
1151  echo "configure: failed program was:" >&5
1152  cat conftest.$ac_ext >&5
1153  rm -rf conftest*
1154  CPP="${CC-cc} -nologo -E"
1155  cat > conftest.$ac_ext <<EOF
1156#line 1157 "configure"
1157#include "confdefs.h"
1158#include <assert.h>
1159Syntax Error
1160EOF
1161ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1162{ (eval echo configure:1163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1163ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1164if test -z "$ac_err"; then
1165  :
1166else
1167  echo "$ac_err" >&5
1168  echo "configure: failed program was:" >&5
1169  cat conftest.$ac_ext >&5
1170  rm -rf conftest*
1171  CPP=/lib/cpp
1172fi
1173rm -f conftest*
1174fi
1175rm -f conftest*
1176fi
1177rm -f conftest*
1178  ac_cv_prog_CPP="$CPP"
1179fi
1180  CPP="$ac_cv_prog_CPP"
1181else
1182  ac_cv_prog_CPP="$CPP"
1183fi
1184echo "$ac_t""$CPP" 1>&6
1185
1186ac_safe=`echo "limits.h" | sed 'y%./+-%__p_%'`
1187echo $ac_n "checking for limits.h""... $ac_c" 1>&6
1188echo "configure:1189: checking for limits.h" >&5
1189if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1190  echo $ac_n "(cached) $ac_c" 1>&6
1191else
1192  cat > conftest.$ac_ext <<EOF
1193#line 1194 "configure"
1194#include "confdefs.h"
1195#include <limits.h>
1196EOF
1197ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1198{ (eval echo configure:1199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1199ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1200if test -z "$ac_err"; then
1201  rm -rf conftest*
1202  eval "ac_cv_header_$ac_safe=yes"
1203else
1204  echo "$ac_err" >&5
1205  echo "configure: failed program was:" >&5
1206  cat conftest.$ac_ext >&5
1207  rm -rf conftest*
1208  eval "ac_cv_header_$ac_safe=no"
1209fi
1210rm -f conftest*
1211fi
1212if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1213  echo "$ac_t""yes" 1>&6
1214  cat >> confdefs.h <<\EOF
1215#define HAVE_LIMITS_H 1
1216EOF
1217
1218else
1219  echo "$ac_t""no" 1>&6
1220cat >> confdefs.h <<\EOF
1221#define NO_LIMITS_H 1
1222EOF
1223
1224fi
1225
1226for ac_hdr in unistd.h
1227do
1228ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1229echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1230echo "configure:1231: checking for $ac_hdr" >&5
1231if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1232  echo $ac_n "(cached) $ac_c" 1>&6
1233else
1234  cat > conftest.$ac_ext <<EOF
1235#line 1236 "configure"
1236#include "confdefs.h"
1237#include <$ac_hdr>
1238EOF
1239ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1240{ (eval echo configure:1241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1241ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1242if test -z "$ac_err"; then
1243  rm -rf conftest*
1244  eval "ac_cv_header_$ac_safe=yes"
1245else
1246  echo "$ac_err" >&5
1247  echo "configure: failed program was:" >&5
1248  cat conftest.$ac_ext >&5
1249  rm -rf conftest*
1250  eval "ac_cv_header_$ac_safe=no"
1251fi
1252rm -f conftest*
1253fi
1254if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1255  echo "$ac_t""yes" 1>&6
1256    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1257  cat >> confdefs.h <<EOF
1258#define $ac_tr_hdr 1
1259EOF
1260 
1261else
1262  echo "$ac_t""no" 1>&6
1263fi
1264done
1265
1266
1267#--------------------------------------------------------------------
1268# Supply a substitute for stdlib.h if it doesn't define strtol,
1269# strtoul, or strtod (which it doesn't in some versions of SunOS).
1270#--------------------------------------------------------------------
1271
1272echo $ac_n "checking stdlib.h""... $ac_c" 1>&6
1273echo "configure:1274: checking stdlib.h" >&5
1274cat > conftest.$ac_ext <<EOF
1275#line 1276 "configure"
1276#include "confdefs.h"
1277#include <stdlib.h>
1278EOF
1279if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1280  egrep "strtol" >/dev/null 2>&1; then
1281  rm -rf conftest*
1282  tk_ok=yes
1283else
1284  rm -rf conftest*
1285  tk_ok=no
1286fi
1287rm -f conftest*
1288
1289cat > conftest.$ac_ext <<EOF
1290#line 1291 "configure"
1291#include "confdefs.h"
1292#include <stdlib.h>
1293EOF
1294if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1295  egrep "strtoul" >/dev/null 2>&1; then
1296  :
1297else
1298  rm -rf conftest*
1299  tk_ok=no
1300fi
1301rm -f conftest*
1302
1303cat > conftest.$ac_ext <<EOF
1304#line 1305 "configure"
1305#include "confdefs.h"
1306#include <stdlib.h>
1307EOF
1308if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1309  egrep "strtod" >/dev/null 2>&1; then
1310  :
1311else
1312  rm -rf conftest*
1313  tk_ok=no
1314fi
1315rm -f conftest*
1316
1317if test $tk_ok = no; then
1318    cat >> confdefs.h <<\EOF
1319#define NO_STDLIB_H 1
1320EOF
1321
1322fi
1323echo "$ac_t""$tk_ok" 1>&6
1324
1325#------------------------------------------------------------------------
1326# If we're using GCC, see if the compiler understands -pipe.  If so, use it.
1327# It makes compiling go faster.  (This is only a performance feature.)
1328#------------------------------------------------------------------------
1329
1330if test -z "$no_pipe" && test -n "$GCC"; then
1331    echo $ac_n "checking if the compiler understands -pipe""... $ac_c" 1>&6
1332echo "configure:1333: checking if the compiler understands -pipe" >&5
1333if eval "test \"`echo '$''{'tcl_cv_cc_pipe'+set}'`\" = set"; then
1334  echo $ac_n "(cached) $ac_c" 1>&6
1335else
1336  
1337	hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
1338	cat > conftest.$ac_ext <<EOF
1339#line 1340 "configure"
1340#include "confdefs.h"
1341
1342int main() {
1343
1344; return 0; }
1345EOF
1346if { (eval echo configure:1347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1347  rm -rf conftest*
1348  tcl_cv_cc_pipe=yes
1349else
1350  echo "configure: failed program was:" >&5
1351  cat conftest.$ac_ext >&5
1352  rm -rf conftest*
1353  tcl_cv_cc_pipe=no
1354fi
1355rm -f conftest*
1356	CFLAGS=$hold_cflags
1357fi
1358
1359echo "$ac_t""$tcl_cv_cc_pipe" 1>&6
1360    if test $tcl_cv_cc_pipe = yes; then
1361	CFLAGS="$CFLAGS -pipe"
1362    fi
1363fi
1364
1365#------------------------------------------------------------------------
1366# Threads support - this auto-enables if Tcl was compiled threaded
1367#------------------------------------------------------------------------
1368
1369
1370    # Check whether --enable-threads or --disable-threads was given.
1371if test "${enable_threads+set}" = set; then
1372  enableval="$enable_threads"
1373  tcl_ok=$enableval
1374else
1375  tcl_ok=no
1376fi
1377
1378
1379    if test "${TCL_THREADS}" = 1; then
1380	tcl_threaded_core=1;
1381    fi
1382
1383    if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
1384	TCL_THREADS=1
1385	# USE_THREAD_ALLOC tells us to try the special thread-based
1386	# allocator that significantly reduces lock contention
1387	cat >> confdefs.h <<\EOF
1388#define USE_THREAD_ALLOC 1
1389EOF
1390
1391	cat >> confdefs.h <<\EOF
1392#define _REENTRANT 1
1393EOF
1394
1395	if test "`uname -s`" = "SunOS" ; then
1396	    cat >> confdefs.h <<\EOF
1397#define _POSIX_PTHREAD_SEMANTICS 1
1398EOF
1399
1400	fi
1401	cat >> confdefs.h <<\EOF
1402#define _THREAD_SAFE 1
1403EOF
1404
1405	echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6
1406echo "configure:1407: checking for pthread_mutex_init in -lpthread" >&5
1407ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
1408if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1409  echo $ac_n "(cached) $ac_c" 1>&6
1410else
1411  ac_save_LIBS="$LIBS"
1412LIBS="-lpthread  $LIBS"
1413cat > conftest.$ac_ext <<EOF
1414#line 1415 "configure"
1415#include "confdefs.h"
1416/* Override any gcc2 internal prototype to avoid an error.  */
1417/* We use char because int might match the return type of a gcc2
1418    builtin and then its argument prototype would still apply.  */
1419char pthread_mutex_init();
1420
1421int main() {
1422pthread_mutex_init()
1423; return 0; }
1424EOF
1425if { (eval echo configure:1426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1426  rm -rf conftest*
1427  eval "ac_cv_lib_$ac_lib_var=yes"
1428else
1429  echo "configure: failed program was:" >&5
1430  cat conftest.$ac_ext >&5
1431  rm -rf conftest*
1432  eval "ac_cv_lib_$ac_lib_var=no"
1433fi
1434rm -f conftest*
1435LIBS="$ac_save_LIBS"
1436
1437fi
1438if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1439  echo "$ac_t""yes" 1>&6
1440  tcl_ok=yes
1441else
1442  echo "$ac_t""no" 1>&6
1443tcl_ok=no
1444fi
1445
1446	if test "$tcl_ok" = "no"; then
1447	    # Check a little harder for __pthread_mutex_init in the same
1448	    # library, as some systems hide it there until pthread.h is
1449	    # defined.  We could alternatively do an AC_TRY_COMPILE with
1450	    # pthread.h, but that will work with libpthread really doesn't
1451	    # exist, like AIX 4.2.  [Bug: 4359]
1452	    echo $ac_n "checking for __pthread_mutex_init in -lpthread""... $ac_c" 1>&6
1453echo "configure:1454: checking for __pthread_mutex_init in -lpthread" >&5
1454ac_lib_var=`echo pthread'_'__pthread_mutex_init | sed 'y%./+-%__p_%'`
1455if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1456  echo $ac_n "(cached) $ac_c" 1>&6
1457else
1458  ac_save_LIBS="$LIBS"
1459LIBS="-lpthread  $LIBS"
1460cat > conftest.$ac_ext <<EOF
1461#line 1462 "configure"
1462#include "confdefs.h"
1463/* Override any gcc2 internal prototype to avoid an error.  */
1464/* We use char because int might match the return type of a gcc2
1465    builtin and then its argument prototype would still apply.  */
1466char __pthread_mutex_init();
1467
1468int main() {
1469__pthread_mutex_init()
1470; return 0; }
1471EOF
1472if { (eval echo configure:1473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1473  rm -rf conftest*
1474  eval "ac_cv_lib_$ac_lib_var=yes"
1475else
1476  echo "configure: failed program was:" >&5
1477  cat conftest.$ac_ext >&5
1478  rm -rf conftest*
1479  eval "ac_cv_lib_$ac_lib_var=no"
1480fi
1481rm -f conftest*
1482LIBS="$ac_save_LIBS"
1483
1484fi
1485if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1486  echo "$ac_t""yes" 1>&6
1487  tcl_ok=yes
1488else
1489  echo "$ac_t""no" 1>&6
1490tcl_ok=no
1491fi
1492
1493	fi
1494
1495	if test "$tcl_ok" = "yes"; then
1496	    # The space is needed
1497	    THREADS_LIBS=" -lpthread"
1498	else
1499	    echo $ac_n "checking for pthread_mutex_init in -lpthreads""... $ac_c" 1>&6
1500echo "configure:1501: checking for pthread_mutex_init in -lpthreads" >&5
1501ac_lib_var=`echo pthreads'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
1502if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1503  echo $ac_n "(cached) $ac_c" 1>&6
1504else
1505  ac_save_LIBS="$LIBS"
1506LIBS="-lpthreads  $LIBS"
1507cat > conftest.$ac_ext <<EOF
1508#line 1509 "configure"
1509#include "confdefs.h"
1510/* Override any gcc2 internal prototype to avoid an error.  */
1511/* We use char because int might match the return type of a gcc2
1512    builtin and then its argument prototype would still apply.  */
1513char pthread_mutex_init();
1514
1515int main() {
1516pthread_mutex_init()
1517; return 0; }
1518EOF
1519if { (eval echo configure:1520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1520  rm -rf conftest*
1521  eval "ac_cv_lib_$ac_lib_var=yes"
1522else
1523  echo "configure: failed program was:" >&5
1524  cat conftest.$ac_ext >&5
1525  rm -rf conftest*
1526  eval "ac_cv_lib_$ac_lib_var=no"
1527fi
1528rm -f conftest*
1529LIBS="$ac_save_LIBS"
1530
1531fi
1532if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1533  echo "$ac_t""yes" 1>&6
1534  tcl_ok=yes
1535else
1536  echo "$ac_t""no" 1>&6
1537tcl_ok=no
1538fi
1539
1540	    if test "$tcl_ok" = "yes"; then
1541		# The space is needed
1542		THREADS_LIBS=" -lpthreads"
1543	    else
1544		echo $ac_n "checking for pthread_mutex_init in -lc""... $ac_c" 1>&6
1545echo "configure:1546: checking for pthread_mutex_init in -lc" >&5
1546ac_lib_var=`echo c'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
1547if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1548  echo $ac_n "(cached) $ac_c" 1>&6
1549else
1550  ac_save_LIBS="$LIBS"
1551LIBS="-lc  $LIBS"
1552cat > conftest.$ac_ext <<EOF
1553#line 1554 "configure"
1554#include "confdefs.h"
1555/* Override any gcc2 internal prototype to avoid an error.  */
1556/* We use char because int might match the return type of a gcc2
1557    builtin and then its argument prototype would still apply.  */
1558char pthread_mutex_init();
1559
1560int main() {
1561pthread_mutex_init()
1562; return 0; }
1563EOF
1564if { (eval echo configure:1565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1565  rm -rf conftest*
1566  eval "ac_cv_lib_$ac_lib_var=yes"
1567else
1568  echo "configure: failed program was:" >&5
1569  cat conftest.$ac_ext >&5
1570  rm -rf conftest*
1571  eval "ac_cv_lib_$ac_lib_var=no"
1572fi
1573rm -f conftest*
1574LIBS="$ac_save_LIBS"
1575
1576fi
1577if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1578  echo "$ac_t""yes" 1>&6
1579  tcl_ok=yes
1580else
1581  echo "$ac_t""no" 1>&6
1582tcl_ok=no
1583fi
1584
1585		if test "$tcl_ok" = "no"; then
1586		    echo $ac_n "checking for pthread_mutex_init in -lc_r""... $ac_c" 1>&6
1587echo "configure:1588: checking for pthread_mutex_init in -lc_r" >&5
1588ac_lib_var=`echo c_r'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
1589if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1590  echo $ac_n "(cached) $ac_c" 1>&6
1591else
1592  ac_save_LIBS="$LIBS"
1593LIBS="-lc_r  $LIBS"
1594cat > conftest.$ac_ext <<EOF
1595#line 1596 "configure"
1596#include "confdefs.h"
1597/* Override any gcc2 internal prototype to avoid an error.  */
1598/* We use char because int might match the return type of a gcc2
1599    builtin and then its argument prototype would still apply.  */
1600char pthread_mutex_init();
1601
1602int main() {
1603pthread_mutex_init()
1604; return 0; }
1605EOF
1606if { (eval echo configure:1607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1607  rm -rf conftest*
1608  eval "ac_cv_lib_$ac_lib_var=yes"
1609else
1610  echo "configure: failed program was:" >&5
1611  cat conftest.$ac_ext >&5
1612  rm -rf conftest*
1613  eval "ac_cv_lib_$ac_lib_var=no"
1614fi
1615rm -f conftest*
1616LIBS="$ac_save_LIBS"
1617
1618fi
1619if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1620  echo "$ac_t""yes" 1>&6
1621  tcl_ok=yes
1622else
1623  echo "$ac_t""no" 1>&6
1624tcl_ok=no
1625fi
1626
1627		    if test "$tcl_ok" = "yes"; then
1628			# The space is needed
1629			THREADS_LIBS=" -pthread"
1630		    else
1631			TCL_THREADS=0
1632			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
1633		    fi
1634		fi
1635	    fi
1636	fi
1637
1638	# Does the pthread-implementation provide
1639	# 'pthread_attr_setstacksize' ?
1640
1641	ac_saved_libs=$LIBS
1642	LIBS="$LIBS $THREADS_LIBS"
1643	for ac_func in pthread_attr_setstacksize
1644do
1645echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1646echo "configure:1647: checking for $ac_func" >&5
1647if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1648  echo $ac_n "(cached) $ac_c" 1>&6
1649else
1650  cat > conftest.$ac_ext <<EOF
1651#line 1652 "configure"
1652#include "confdefs.h"
1653/* System header to define __stub macros and hopefully few prototypes,
1654    which can conflict with char $ac_func(); below.  */
1655#include <assert.h>
1656/* Override any gcc2 internal prototype to avoid an error.  */
1657/* We use char because int might match the return type of a gcc2
1658    builtin and then its argument prototype would still apply.  */
1659char $ac_func();
1660
1661int main() {
1662
1663/* The GNU C library defines this for functions which it implements
1664    to always fail with ENOSYS.  Some functions are actually named
1665    something starting with __ and the normal name is an alias.  */
1666#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1667choke me
1668#else
1669$ac_func();
1670#endif
1671
1672; return 0; }
1673EOF
1674if { (eval echo configure:1675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1675  rm -rf conftest*
1676  eval "ac_cv_func_$ac_func=yes"
1677else
1678  echo "configure: failed program was:" >&5
1679  cat conftest.$ac_ext >&5
1680  rm -rf conftest*
1681  eval "ac_cv_func_$ac_func=no"
1682fi
1683rm -f conftest*
1684fi
1685
1686if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1687  echo "$ac_t""yes" 1>&6
1688    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1689  cat >> confdefs.h <<EOF
1690#define $ac_tr_func 1
1691EOF
1692 
1693else
1694  echo "$ac_t""no" 1>&6
1695fi
1696done
1697
1698	for ac_func in pthread_atfork
1699do
1700echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1701echo "configure:1702: checking for $ac_func" >&5
1702if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1703  echo $ac_n "(cached) $ac_c" 1>&6
1704else
1705  cat > conftest.$ac_ext <<EOF
1706#line 1707 "configure"
1707#include "confdefs.h"
1708/* System header to define __stub macros and hopefully few prototypes,
1709    which can conflict with char $ac_func(); below.  */
1710#include <assert.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 $ac_func();
1715
1716int main() {
1717
1718/* The GNU C library defines this for functions which it implements
1719    to always fail with ENOSYS.  Some functions are actually named
1720    something starting with __ and the normal name is an alias.  */
1721#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1722choke me
1723#else
1724$ac_func();
1725#endif
1726
1727; return 0; }
1728EOF
1729if { (eval echo configure:1730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1730  rm -rf conftest*
1731  eval "ac_cv_func_$ac_func=yes"
1732else
1733  echo "configure: failed program was:" >&5
1734  cat conftest.$ac_ext >&5
1735  rm -rf conftest*
1736  eval "ac_cv_func_$ac_func=no"
1737fi
1738rm -f conftest*
1739fi
1740
1741if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1742  echo "$ac_t""yes" 1>&6
1743    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1744  cat >> confdefs.h <<EOF
1745#define $ac_tr_func 1
1746EOF
1747 
1748else
1749  echo "$ac_t""no" 1>&6
1750fi
1751done
1752
1753	LIBS=$ac_saved_libs
1754    else
1755	TCL_THREADS=0
1756    fi
1757    # Do checking message here to not mess up interleaved configure output
1758    echo $ac_n "checking for building with threads""... $ac_c" 1>&6
1759echo "configure:1760: checking for building with threads" >&5
1760    if test "${TCL_THREADS}" = 1; then
1761	cat >> confdefs.h <<\EOF
1762#define TCL_THREADS 1
1763EOF
1764
1765	if test "${tcl_threaded_core}" = 1; then
1766	    echo "$ac_t""yes (threaded core)" 1>&6
1767	else
1768	    echo "$ac_t""yes" 1>&6
1769	fi
1770    else
1771	echo "$ac_t""no (default)" 1>&6
1772    fi
1773
1774    
1775
1776
1777#--------------------------------------------------------------------
1778# On a few very rare systems, all of the libm.a stuff is
1779# already in libc.a.  Set compiler flags accordingly.
1780# Also, Linux requires the "ieee" library for math to work
1781# right (and it must appear before "-lm").
1782#--------------------------------------------------------------------
1783
1784MATH_LIBS=""
1785echo $ac_n "checking for sin""... $ac_c" 1>&6
1786echo "configure:1787: checking for sin" >&5
1787if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then
1788  echo $ac_n "(cached) $ac_c" 1>&6
1789else
1790  cat > conftest.$ac_ext <<EOF
1791#line 1792 "configure"
1792#include "confdefs.h"
1793/* System header to define __stub macros and hopefully few prototypes,
1794    which can conflict with char sin(); below.  */
1795#include <assert.h>
1796/* Override any gcc2 internal prototype to avoid an error.  */
1797/* We use char because int might match the return type of a gcc2
1798    builtin and then its argument prototype would still apply.  */
1799char sin();
1800
1801int main() {
1802
1803/* The GNU C library defines this for functions which it implements
1804    to always fail with ENOSYS.  Some functions are actually named
1805    something starting with __ and the normal name is an alias.  */
1806#if defined (__stub_sin) || defined (__stub___sin)
1807choke me
1808#else
1809sin();
1810#endif
1811
1812; return 0; }
1813EOF
1814if { (eval echo configure:1815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1815  rm -rf conftest*
1816  eval "ac_cv_func_sin=yes"
1817else
1818  echo "configure: failed program was:" >&5
1819  cat conftest.$ac_ext >&5
1820  rm -rf conftest*
1821  eval "ac_cv_func_sin=no"
1822fi
1823rm -f conftest*
1824fi
1825
1826if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
1827  echo "$ac_t""yes" 1>&6
1828  :
1829else
1830  echo "$ac_t""no" 1>&6
1831MATH_LIBS="-lm"
1832fi
1833
1834echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6
1835echo "configure:1836: checking for main in -lieee" >&5
1836ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'`
1837if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1838  echo $ac_n "(cached) $ac_c" 1>&6
1839else
1840  ac_save_LIBS="$LIBS"
1841LIBS="-lieee  $LIBS"
1842cat > conftest.$ac_ext <<EOF
1843#line 1844 "configure"
1844#include "confdefs.h"
1845
1846int main() {
1847main()
1848; return 0; }
1849EOF
1850if { (eval echo configure:1851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1851  rm -rf conftest*
1852  eval "ac_cv_lib_$ac_lib_var=yes"
1853else
1854  echo "configure: failed program was:" >&5
1855  cat conftest.$ac_ext >&5
1856  rm -rf conftest*
1857  eval "ac_cv_lib_$ac_lib_var=no"
1858fi
1859rm -f conftest*
1860LIBS="$ac_save_LIBS"
1861
1862fi
1863if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1864  echo "$ac_t""yes" 1>&6
1865  MATH_LIBS="-lieee $MATH_LIBS"
1866else
1867  echo "$ac_t""no" 1>&6
1868fi
1869
1870
1871# Add the threads support libraries
1872LIBS="$LIBS$THREADS_LIBS"
1873
1874
1875    echo $ac_n "checking how to build libraries""... $ac_c" 1>&6
1876echo "configure:1877: checking how to build libraries" >&5
1877    # Check whether --enable-shared or --disable-shared was given.
1878if test "${enable_shared+set}" = set; then
1879  enableval="$enable_shared"
1880  tcl_ok=$enableval
1881else
1882  tcl_ok=yes
1883fi
1884
1885
1886    if test "${enable_shared+set}" = set; then
1887	enableval="$enable_shared"
1888	tcl_ok=$enableval
1889    else
1890	tcl_ok=yes
1891    fi
1892
1893    if test "$tcl_ok" = "yes" ; then
1894	echo "$ac_t""shared" 1>&6
1895	SHARED_BUILD=1
1896    else
1897	echo "$ac_t""static" 1>&6
1898	SHARED_BUILD=0
1899	cat >> confdefs.h <<\EOF
1900#define STATIC_BUILD 1
1901EOF
1902
1903    fi
1904
1905
1906#--------------------------------------------------------------------
1907# The statements below define a collection of compile flags.  This
1908# macro depends on the value of SHARED_BUILD, and should be called
1909# after SC_ENABLE_SHARED checks the configure switches.
1910#--------------------------------------------------------------------
1911
1912# Extract the first word of "ranlib", so it can be a program name with args.
1913set dummy ranlib; ac_word=$2
1914echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1915echo "configure:1916: checking for $ac_word" >&5
1916if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1917  echo $ac_n "(cached) $ac_c" 1>&6
1918else
1919  if test -n "$RANLIB"; then
1920  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1921else
1922  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
1923  ac_dummy="$PATH"
1924  for ac_dir in $ac_dummy; do
1925    test -z "$ac_dir" && ac_dir=.
1926    if test -f $ac_dir/$ac_word; then
1927      ac_cv_prog_RANLIB="ranlib"
1928      break
1929    fi
1930  done
1931  IFS="$ac_save_ifs"
1932  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1933fi
1934fi
1935RANLIB="$ac_cv_prog_RANLIB"
1936if test -n "$RANLIB"; then
1937  echo "$ac_t""$RANLIB" 1>&6
1938else
1939  echo "$ac_t""no" 1>&6
1940fi
1941
1942
1943
1944    # Step 0.a: Enable 64 bit support?
1945
1946    echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6
1947echo "configure:1948: checking if 64bit support is requested" >&5
1948    # Check whether --enable-64bit or --disable-64bit was given.
1949if test "${enable_64bit+set}" = set; then
1950  enableval="$enable_64bit"
1951  do64bit=$enableval
1952else
1953  do64bit=no
1954fi
1955
1956    echo "$ac_t""$do64bit" 1>&6
1957
1958    # Step 0.b: Enable Solaris 64 bit VIS support?
1959
1960    echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6
1961echo "configure:1962: checking if 64bit Sparc VIS support is requested" >&5
1962    # Check whether --enable-64bit-vis or --disable-64bit-vis was given.
1963if test "${enable_64bit_vis+set}" = set; then
1964  enableval="$enable_64bit_vis"
1965  do64bitVIS=$enableval
1966else
1967  do64bitVIS=no
1968fi
1969
1970    echo "$ac_t""$do64bitVIS" 1>&6
1971
1972    if test "$do64bitVIS" = "yes"; then
1973	# Force 64bit on with VIS
1974	do64bit=yes
1975    fi
1976
1977    # Step 1: set the variable "system" to hold the name and version number
1978    # for the system.
1979
1980    
1981    echo $ac_n "checking system version""... $ac_c" 1>&6
1982echo "configure:1983: checking system version" >&5
1983if eval "test \"`echo '$''{'tcl_cv_sys_version'+set}'`\" = set"; then
1984  echo $ac_n "(cached) $ac_c" 1>&6
1985else
1986  
1987	if test -f /usr/lib/NextStep/software_version; then
1988	    tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
1989	else
1990	    tcl_cv_sys_version=`uname -s`-`uname -r`
1991	    if test "$?" -ne 0 ; then
1992		echo "configure: warning: can't find uname command" 1>&2
1993		tcl_cv_sys_version=unknown
1994	    else
1995		# Special check for weird MP-RAS system (uname returns weird
1996		# results, and the version is kept in special file).
1997
1998		if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
1999		    tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid`
2000		fi
2001		if test "`uname -s`" = "AIX" ; then
2002		    tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
2003		fi
2004	    fi
2005	fi
2006    
2007fi
2008
2009echo "$ac_t""$tcl_cv_sys_version" 1>&6
2010    system=$tcl_cv_sys_version
2011
2012
2013    # Step 2: check for existence of -ldl library.  This is needed because
2014    # Linux can use either -ldl or -ldld for dynamic loading.
2015
2016    echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
2017echo "configure:2018: checking for dlopen in -ldl" >&5
2018ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
2019if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2020  echo $ac_n "(cached) $ac_c" 1>&6
2021else
2022  ac_save_LIBS="$LIBS"
2023LIBS="-ldl  $LIBS"
2024cat > conftest.$ac_ext <<EOF
2025#line 2026 "configure"
2026#include "confdefs.h"
2027/* Override any gcc2 internal prototype to avoid an error.  */
2028/* We use char because int might match the return type of a gcc2
2029    builtin and then its argument prototype would still apply.  */
2030char dlopen();
2031
2032int main() {
2033dlopen()
2034; return 0; }
2035EOF
2036if { (eval echo configure:2037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2037  rm -rf conftest*
2038  eval "ac_cv_lib_$ac_lib_var=yes"
2039else
2040  echo "configure: failed program was:" >&5
2041  cat conftest.$ac_ext >&5
2042  rm -rf conftest*
2043  eval "ac_cv_lib_$ac_lib_var=no"
2044fi
2045rm -f conftest*
2046LIBS="$ac_save_LIBS"
2047
2048fi
2049if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2050  echo "$ac_t""yes" 1>&6
2051  have_dl=yes
2052else
2053  echo "$ac_t""no" 1>&6
2054have_dl=no
2055fi
2056
2057
2058    # Require ranlib early so we can override it in special cases below.
2059
2060    
2061
2062    # Step 3: set configuration options based on system name and version.
2063
2064    do64bit_ok=no
2065    LDFLAGS_ORIG="$LDFLAGS"
2066    TCL_EXPORT_FILE_SUFFIX=""
2067    UNSHARED_LIB_SUFFIX=""
2068    TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
2069    ECHO_VERSION='`echo ${VERSION}`'
2070    TCL_LIB_VERSIONS_OK=ok
2071    CFLAGS_DEBUG=-g
2072    CFLAGS_OPTIMIZE=-O
2073    if test "$GCC" = "yes" ; then
2074	CFLAGS_WARNING="-Wall -fno-strict-aliasing"
2075    else
2076	CFLAGS_WARNING=""
2077    fi
2078    TCL_NEEDS_EXP_FILE=0
2079    TCL_BUILD_EXP_FILE=""
2080    TCL_EXP_FILE=""
2081    # Extract the first word of "ar", so it can be a program name with args.
2082set dummy ar; ac_word=$2
2083echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2084echo "configure:2085: checking for $ac_word" >&5
2085if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
2086  echo $ac_n "(cached) $ac_c" 1>&6
2087else
2088  if test -n "$AR"; then
2089  ac_cv_prog_AR="$AR" # Let the user override the test.
2090else
2091  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
2092  ac_dummy="$PATH"
2093  for ac_dir in $ac_dummy; do
2094    test -z "$ac_dir" && ac_dir=.
2095    if test -f $ac_dir/$ac_word; then
2096      ac_cv_prog_AR="ar"
2097      break
2098    fi
2099  done
2100  IFS="$ac_save_ifs"
2101fi
2102fi
2103AR="$ac_cv_prog_AR"
2104if test -n "$AR"; then
2105  echo "$ac_t""$AR" 1>&6
2106else
2107  echo "$ac_t""no" 1>&6
2108fi
2109
2110    if test "${AR}" = "" ; then
2111	{ echo "configure: error: Required archive tool 'ar' not found on PATH." 1>&2; exit 1; }
2112    fi
2113    STLIB_LD='${AR} cr'
2114    LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
2115    PLAT_OBJS=""
2116    PLAT_SRCS=""
2117    case $system in
2118	AIX-*)
2119	    if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
2120		# AIX requires the _r compiler when gcc isn't being used
2121		case "${CC}" in
2122		    *_r|*_r\ *)
2123			# ok ...
2124			;;
2125		    *)
2126			# Make sure only first arg gets _r
2127		    	CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'`
2128			;;
2129		esac
2130		echo "$ac_t""Using $CC for compiling with threads" 1>&6
2131	    fi
2132	    LIBS="$LIBS -lc"
2133	    SHLIB_CFLAGS=""
2134	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
2135	    # symbols when dynamically loaded into tclsh.
2136	    SHLIB_LD_LIBS='${LIBS}'
2137	    SHLIB_SUFFIX=".so"
2138
2139	    DL_OBJS="tclLoadDl.o"
2140	    LD_LIBRARY_PATH_VAR="LIBPATH"
2141
2142	    # Check to enable 64-bit flags for compiler/linker on AIX 4+
2143	    if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
2144		if test "$GCC" = "yes" ; then
2145		    echo "configure: warning: 64bit mode not supported with GCC on $system" 1>&2
2146		else 
2147		    do64bit_ok=yes
2148		    CFLAGS="$CFLAGS -q64"
2149		    LDFLAGS="$LDFLAGS -q64"
2150		    RANLIB="${RANLIB} -X64"
2151		    AR="${AR} -X64"
2152		    SHLIB_LD_FLAGS="-b64"
2153		fi
2154	    fi
2155
2156	    if test "`uname -m`" = "ia64" ; then
2157		# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
2158		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
2159		# AIX-5 has dl* in libc.so
2160		DL_LIBS=""
2161		if test "$GCC" = "yes" ; then
2162		    CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
2163		else
2164		    CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
2165		fi
2166		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
2167	    else
2168		if test "$GCC" = "yes" ; then
2169		    SHLIB_LD="gcc -shared"
2170		else
2171		    SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
2172		fi
2173		SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
2174		DL_LIBS="-ldl"
2175		CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
2176		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2177		TCL_NEEDS_EXP_FILE=1
2178		TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
2179	    fi
2180
2181	    # AIX v<=4.1 has some different flags than 4.2+
2182	    if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
2183		LIBOBJS="$LIBOBJS tclLoadAix.o"
2184		DL_LIBS="-lld"
2185	    fi
2186
2187	    # On AIX <=v4 systems, libbsd.a has to be linked in to support
2188	    # non-blocking file IO.  This library has to be linked in after
2189	    # the MATH_LIBS or it breaks the pow() function.  The way to
2190	    # insure proper sequencing, is to add it to the tail of MATH_LIBS.
2191	    # This library also supplies gettimeofday.
2192	    #
2193	    # AIX does not have a timezone field in struct tm. When the AIX
2194	    # bsd library is used, the timezone global and the gettimeofday
2195	    # methods are to be avoided for timezone deduction instead, we
2196	    # deduce the timezone by comparing the localtime result on a
2197	    # known GMT value.
2198
2199	    echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
2200echo "configure:2201: checking for gettimeofday in -lbsd" >&5
2201ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
2202if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2203  echo $ac_n "(cached) $ac_c" 1>&6
2204else
2205  ac_save_LIBS="$LIBS"
2206LIBS="-lbsd  $LIBS"
2207cat > conftest.$ac_ext <<EOF
2208#line 2209 "configure"
2209#include "confdefs.h"
2210/* Override any gcc2 internal prototype to avoid an error.  */
2211/* We use char because int might match the return type of a gcc2
2212    builtin and then its argument prototype would still apply.  */
2213char gettimeofday();
2214
2215int main() {
2216gettimeofday()
2217; return 0; }
2218EOF
2219if { (eval echo configure:2220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2220  rm -rf conftest*
2221  eval "ac_cv_lib_$ac_lib_var=yes"
2222else
2223  echo "configure: failed program was:" >&5
2224  cat conftest.$ac_ext >&5
2225  rm -rf conftest*
2226  eval "ac_cv_lib_$ac_lib_var=no"
2227fi
2228rm -f conftest*
2229LIBS="$ac_save_LIBS"
2230
2231fi
2232if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2233  echo "$ac_t""yes" 1>&6
2234  libbsd=yes
2235else
2236  echo "$ac_t""no" 1>&6
2237libbsd=no
2238fi
2239
2240	    if test $libbsd = yes; then
2241	    	MATH_LIBS="$MATH_LIBS -lbsd"
2242	    	cat >> confdefs.h <<\EOF
2243#define USE_DELTA_FOR_TZ 1
2244EOF
2245
2246	    fi
2247	    ;;
2248	BeOS*)
2249	    SHLIB_CFLAGS="-fPIC"
2250	    SHLIB_LD="${CC} -nostart"
2251	    SHLIB_LD_LIBS='${LIBS}'
2252	    SHLIB_SUFFIX=".so"
2253	    DL_OBJS="tclLoadDl.o"
2254	    DL_LIBS="-ldl"
2255
2256	    #-----------------------------------------------------------
2257	    # Check for inet_ntoa in -lbind, for BeOS (which also needs
2258	    # -lsocket, even if the network functions are in -lnet which
2259	    # is always linked to, for compatibility.
2260	    #-----------------------------------------------------------
2261	    echo $ac_n "checking for inet_ntoa in -lbind""... $ac_c" 1>&6
2262echo "configure:2263: checking for inet_ntoa in -lbind" >&5
2263ac_lib_var=`echo bind'_'inet_ntoa | sed 'y%./+-%__p_%'`
2264if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2265  echo $ac_n "(cached) $ac_c" 1>&6
2266else
2267  ac_save_LIBS="$LIBS"
2268LIBS="-lbind  $LIBS"
2269cat > conftest.$ac_ext <<EOF
2270#line 2271 "configure"
2271#include "confdefs.h"
2272/* Override any gcc2 internal prototype to avoid an error.  */
2273/* We use char because int might match the return type of a gcc2
2274    builtin and then its argument prototype would still apply.  */
2275char inet_ntoa();
2276
2277int main() {
2278inet_ntoa()
2279; return 0; }
2280EOF
2281if { (eval echo configure:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2282  rm -rf conftest*
2283  eval "ac_cv_lib_$ac_lib_var=yes"
2284else
2285  echo "configure: failed program was:" >&5
2286  cat conftest.$ac_ext >&5
2287  rm -rf conftest*
2288  eval "ac_cv_lib_$ac_lib_var=no"
2289fi
2290rm -f conftest*
2291LIBS="$ac_save_LIBS"
2292
2293fi
2294if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2295  echo "$ac_t""yes" 1>&6
2296  LIBS="$LIBS -lbind -lsocket"
2297else
2298  echo "$ac_t""no" 1>&6
2299fi
2300
2301	    ;;
2302	BSD/OS-2.1*|BSD/OS-3*)
2303	    SHLIB_CFLAGS=""
2304	    SHLIB_LD="shlicc -r"
2305	    SHLIB_LD_LIBS='${LIBS}'
2306	    SHLIB_SUFFIX=".so"
2307	    DL_OBJS="tclLoadDl.o"
2308	    DL_LIBS="-ldl"
2309	    CC_SEARCH_FLAGS=""
2310	    LD_SEARCH_FLAGS=""
2311	    ;;
2312	BSD/OS-4.*)
2313	    SHLIB_CFLAGS="-export-dynamic -fPIC"
2314	    SHLIB_LD="cc -shared"
2315	    SHLIB_LD_LIBS='${LIBS}'
2316	    SHLIB_SUFFIX=".so"
2317	    DL_OBJS="tclLoadDl.o"
2318	    DL_LIBS="-ldl"
2319	    LDFLAGS="$LDFLAGS -export-dynamic"
2320	    CC_SEARCH_FLAGS=""
2321	    LD_SEARCH_FLAGS=""
2322	    ;;
2323	dgux*)
2324	    SHLIB_CFLAGS="-K PIC"
2325	    SHLIB_LD="cc -G"
2326	    SHLIB_LD_LIBS=""
2327	    SHLIB_SUFFIX=".so"
2328	    DL_OBJS="tclLoadDl.o"
2329	    DL_LIBS="-ldl"
2330	    CC_SEARCH_FLAGS=""
2331	    LD_SEARCH_FLAGS=""
2332	    ;;
2333	HP-UX-*.11.*)
2334	    # Use updated header definitions where possible
2335	    cat >> confdefs.h <<\EOF
2336#define _XOPEN_SOURCE 1
2337EOF
2338          # Use the XOPEN network library
2339	    cat >> confdefs.h <<\EOF
2340#define _XOPEN_SOURCE_EXTENDED 1
2341EOF
2342 # Use the XOPEN network library
2343	    LIBS="$LIBS -lxnet"               # Use the XOPEN network library
2344
2345	    if test "`uname -m`" = "ia64" ; then
2346		SHLIB_SUFFIX=".so"
2347	    else
2348		SHLIB_SUFFIX=".sl"
2349	    fi
2350	    echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
2351echo "configure:2352: checking for shl_load in -ldld" >&5
2352ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
2353if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2354  echo $ac_n "(cached) $ac_c" 1>&6
2355else
2356  ac_save_LIBS="$LIBS"
2357LIBS="-ldld  $LIBS"
2358cat > conftest.$ac_ext <<EOF
2359#line 2360 "configure"
2360#include "confdefs.h"
2361/* Override any gcc2 internal prototype to avoid an error.  */
2362/* We use char because int might match the return type of a gcc2
2363    builtin and then its argument prototype would still apply.  */
2364char shl_load();
2365
2366int main() {
2367shl_load()
2368; return 0; }
2369EOF
2370if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2371  rm -rf conftest*
2372  eval "ac_cv_lib_$ac_lib_var=yes"
2373else
2374  echo "configure: failed program was:" >&5
2375  cat conftest.$ac_ext >&5
2376  rm -rf conftest*
2377  eval "ac_cv_lib_$ac_lib_var=no"
2378fi
2379rm -f conftest*
2380LIBS="$ac_save_LIBS"
2381
2382fi
2383if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2384  echo "$ac_t""yes" 1>&6
2385  tcl_ok=yes
2386else
2387  echo "$ac_t""no" 1>&6
2388tcl_ok=no
2389fi
2390
2391	    if test "$tcl_ok" = yes; then
2392		SHLIB_CFLAGS="+z"
2393		SHLIB_LD="ld -b"
2394		SHLIB_LD_LIBS='${LIBS}'
2395		DL_OBJS="tclLoadShl.o"
2396		DL_LIBS="-ldld"
2397		LDFLAGS="$LDFLAGS -Wl,-E"
2398		CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
2399		LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
2400		LD_LIBRARY_PATH_VAR="SHLIB_PATH"
2401	    fi
2402	    if test "$GCC" = "yes" ; then
2403		SHLIB_LD="gcc -shared"
2404		SHLIB_LD_LIBS='${LIBS}'
2405		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2406	    fi
2407
2408	    # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
2409	    #CFLAGS="$CFLAGS +DAportable"
2410
2411	    # Check to enable 64-bit flags for compiler/linker
2412	    if test "$do64bit" = "yes" ; then
2413		if test "$GCC" = "yes" ; then
2414		    hpux_arch=`${CC} -dumpmachine`
2415		    case $hpux_arch in
2416			hppa64*)
2417			    # 64-bit gcc in use.  Fix flags for GNU ld.
2418			    do64bit_ok=yes
2419			    SHLIB_LD="${CC} -shared"
2420			    SHLIB_LD_LIBS='${LIBS}'
2421			    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2422			    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2423			    ;;
2424			*)
2425			    echo "configure: warning: 64bit mode not supported with GCC on $system" 1>&2
2426			    ;;
2427		    esac
2428		else
2429		    do64bit_ok=yes
2430		    CFLAGS="$CFLAGS +DD64"
2431		    LDFLAGS="$LDFLAGS +DD64"
2432		fi
2433	    fi
2434	    ;;
2435	HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
2436	    SHLIB_SUFFIX=".sl"
2437	    echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
2438echo "configure:2439: checking for shl_load in -ldld" >&5
2439ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
2440if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2441  echo $ac_n "(cached) $ac_c" 1>&6
2442else
2443  ac_save_LIBS="$LIBS"
2444LIBS="-ldld  $LIBS"
2445cat > conftest.$ac_ext <<EOF
2446#line 2447 "configure"
2447#include "confdefs.h"
2448/* Override any gcc2 internal prototype to avoid an error.  */
2449/* We use char because int might match the return type of a gcc2
2450    builtin and then its argument prototype would still apply.  */
2451char shl_load();
2452
2453int main() {
2454shl_load()
2455; return 0; }
2456EOF
2457if { (eval echo configure:2458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2458  rm -rf conftest*
2459  eval "ac_cv_lib_$ac_lib_var=yes"
2460else
2461  echo "configure: failed program was:" >&5
2462  cat conftest.$ac_ext >&5
2463  rm -rf conftest*
2464  eval "ac_cv_lib_$ac_lib_var=no"
2465fi
2466rm -f conftest*
2467LIBS="$ac_save_LIBS"
2468
2469fi
2470if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2471  echo "$ac_t""yes" 1>&6
2472  tcl_ok=yes
2473else
2474  echo "$ac_t""no" 1>&6
2475tcl_ok=no
2476fi
2477
2478	    if test "$tcl_ok" = yes; then
2479		SHLIB_CFLAGS="+z"
2480		SHLIB_LD="ld -b"
2481		SHLIB_LD_LIBS=""
2482		DL_OBJS="tclLoadShl.o"
2483		DL_LIBS="-ldld"
2484		LDFLAGS="$LDFLAGS -Wl,-E"
2485		CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
2486		LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
2487		LD_LIBRARY_PATH_VAR="SHLIB_PATH"
2488	    fi
2489	    ;;
2490	IRIX-4.*)
2491	    SHLIB_CFLAGS="-G 0"
2492	    SHLIB_SUFFIX=".a"
2493	    SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
2494	    SHLIB_LD_LIBS='${LIBS}'
2495	    DL_OBJS="tclLoadAout.o"
2496	    DL_LIBS=""
2497	    LDFLAGS="$LDFLAGS -Wl,-D,08000000"
2498	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
2499	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2500	    SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
2501	    ;;
2502	IRIX-5.*)
2503	    SHLIB_CFLAGS=""
2504	    SHLIB_LD="ld -shared -rdata_shared"
2505	    SHLIB_LD_LIBS='${LIBS}'
2506	    SHLIB_SUFFIX=".so"
2507	    DL_OBJS="tclLoadDl.o"
2508	    DL_LIBS=""
2509	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2510	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
2511	    ;;
2512	IRIX-6.*)
2513	    SHLIB_CFLAGS=""
2514	    SHLIB_LD="ld -n32 -shared -rdata_shared"
2515	    SHLIB_LD_LIBS='${LIBS}'
2516	    SHLIB_SUFFIX=".so"
2517	    DL_OBJS="tclLoadDl.o"
2518	    DL_LIBS=""
2519	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2520	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
2521	    if test "$GCC" = "yes" ; then
2522		CFLAGS="$CFLAGS -mabi=n32"
2523		LDFLAGS="$LDFLAGS -mabi=n32"
2524	    else
2525		case $system in
2526		    IRIX-6.3)
2527			# Use to build 6.2 compatible binaries on 6.3.
2528			CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
2529			;;
2530		    *)
2531			CFLAGS="$CFLAGS -n32"
2532			;;
2533		esac
2534		LDFLAGS="$LDFLAGS -n32"
2535	    fi
2536	    ;;
2537	IRIX64-6.*)
2538	    SHLIB_CFLAGS=""
2539	    SHLIB_LD="ld -n32 -shared -rdata_shared"
2540	    SHLIB_LD_LIBS='${LIBS}'
2541	    SHLIB_SUFFIX=".so"
2542	    DL_OBJS="tclLoadDl.o"
2543	    DL_LIBS=""
2544	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2545	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
2546
2547	    # Check to enable 64-bit flags for compiler/linker
2548
2549	    if test "$do64bit" = "yes" ; then
2550	        if test "$GCC" = "yes" ; then
2551	            echo "configure: warning: 64bit mode not supported by gcc" 1>&2
2552	        else
2553	            do64bit_ok=yes
2554	            SHLIB_LD="ld -64 -shared -rdata_shared"
2555	            CFLAGS="$CFLAGS -64"
2556	            LDFLAGS="$LDFLAGS -64"
2557	        fi
2558	    fi
2559	    ;;
2560	Linux*)
2561	    SHLIB_CFLAGS="-fPIC"
2562	    SHLIB_LD_LIBS='${LIBS}'
2563	    SHLIB_SUFFIX=".so"
2564
2565	    CFLAGS_OPTIMIZE=-O2
2566	    # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings 
2567	    # when you inline the string and math operations.  Turn this off to
2568	    # get rid of the warnings.
2569	    #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
2570
2571	    if test "$have_dl" = yes; then
2572		SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
2573		DL_OBJS="tclLoadDl.o"
2574		DL_LIBS="-ldl"
2575		LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
2576		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2577		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2578	    else
2579		ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'`
2580echo $ac_n "checking for dld.h""... $ac_c" 1>&6
2581echo "configure:2582: checking for dld.h" >&5
2582if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2583  echo $ac_n "(cached) $ac_c" 1>&6
2584else
2585  cat > conftest.$ac_ext <<EOF
2586#line 2587 "configure"
2587#include "confdefs.h"
2588#include <dld.h>
2589EOF
2590ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2591{ (eval echo configure:2592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2592ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2593if test -z "$ac_err"; then
2594  rm -rf conftest*
2595  eval "ac_cv_header_$ac_safe=yes"
2596else
2597  echo "$ac_err" >&5
2598  echo "configure: failed program was:" >&5
2599  cat conftest.$ac_ext >&5
2600  rm -rf conftest*
2601  eval "ac_cv_header_$ac_safe=no"
2602fi
2603rm -f conftest*
2604fi
2605if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2606  echo "$ac_t""yes" 1>&6
2607  
2608		    SHLIB_LD="ld -shared"
2609		    DL_OBJS="tclLoadDld.o"
2610		    DL_LIBS="-ldld"
2611		    CC_SEARCH_FLAGS=""
2612		    LD_SEARCH_FLAGS=""
2613else
2614  echo "$ac_t""no" 1>&6
2615fi
2616
2617	    fi
2618	    if test "`uname -m`" = "alpha" ; then
2619		CFLAGS="$CFLAGS -mieee"
2620	    fi
2621	    if test $do64bit = yes; then
2622		echo $ac_n "checking if compiler accepts -m64 flag""... $ac_c" 1>&6
2623echo "configure:2624: checking if compiler accepts -m64 flag" >&5
2624if eval "test \"`echo '$''{'tcl_cv_cc_m64'+set}'`\" = set"; then
2625  echo $ac_n "(cached) $ac_c" 1>&6
2626else
2627  
2628		    hold_cflags=$CFLAGS
2629		    CFLAGS="$CFLAGS -m64"
2630		    cat > conftest.$ac_ext <<EOF
2631#line 2632 "configure"
2632#include "confdefs.h"
2633
2634int main() {
2635
2636; return 0; }
2637EOF
2638if { (eval echo configure:2639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2639  rm -rf conftest*
2640  tcl_cv_cc_m64=yes
2641else
2642  echo "configure: failed program was:" >&5
2643  cat conftest.$ac_ext >&5
2644  rm -rf conftest*
2645  tcl_cv_cc_m64=no
2646fi
2647rm -f conftest*
2648		    CFLAGS=$hold_cflags
2649fi
2650
2651echo "$ac_t""$tcl_cv_cc_m64" 1>&6
2652		if test $tcl_cv_cc_m64 = yes; then
2653		    CFLAGS="$CFLAGS -m64"
2654		    do64bit_ok=yes
2655		fi
2656	    fi
2657
2658	    # The combo of gcc + glibc has a bug related
2659	    # to inlining of functions like strtod(). The
2660	    # -fno-builtin flag should address this problem
2661	    # but it does not work. The -fno-inline flag
2662	    # is kind of overkill but it works.
2663	    # Disable inlining only when one of the
2664	    # files in compat/*.c is being linked in.
2665	    if test x"${LIBOBJS}" != x ; then
2666	        CFLAGS="$CFLAGS -fno-inline"
2667	    fi
2668
2669	    # XIM peeking works under XFree86.
2670	    cat >> confdefs.h <<\EOF
2671#define PEEK_XCLOSEIM 1
2672EOF
2673
2674
2675	    ;;
2676	GNU*)
2677	    SHLIB_CFLAGS="-fPIC"
2678	    SHLIB_LD_LIBS='${LIBS}'
2679	    SHLIB_SUFFIX=".so"
2680
2681	    if test "$have_dl" = yes; then
2682		SHLIB_LD="${CC} -shared"
2683		DL_OBJS=""
2684		DL_LIBS="-ldl"
2685		LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
2686		CC_SEARCH_FLAGS=""
2687		LD_SEARCH_FLAGS=""
2688	    else
2689		ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'`
2690echo $ac_n "checking for dld.h""... $ac_c" 1>&6
2691echo "configure:2692: checking for dld.h" >&5
2692if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2693  echo $ac_n "(cached) $ac_c" 1>&6
2694else
2695  cat > conftest.$ac_ext <<EOF
2696#line 2697 "configure"
2697#include "confdefs.h"
2698#include <dld.h>
2699EOF
2700ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2701{ (eval echo configure:2702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2702ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2703if test -z "$ac_err"; then
2704  rm -rf conftest*
2705  eval "ac_cv_header_$ac_safe=yes"
2706else
2707  echo "$ac_err" >&5
2708  echo "configure: failed program was:" >&5
2709  cat conftest.$ac_ext >&5
2710  rm -rf conftest*
2711  eval "ac_cv_header_$ac_safe=no"
2712fi
2713rm -f conftest*
2714fi
2715if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2716  echo "$ac_t""yes" 1>&6
2717  
2718		    SHLIB_LD="ld -shared"
2719		    DL_OBJS=""
2720		    DL_LIBS="-ldld"
2721		    CC_SEARCH_FLAGS=""
2722		    LD_SEARCH_FLAGS=""
2723else
2724  echo "$ac_t""no" 1>&6
2725fi
2726
2727	    fi
2728	    if test "`uname -m`" = "alpha" ; then
2729		CFLAGS="$CFLAGS -mieee"
2730	    fi
2731	    ;;
2732	Lynx*)
2733	    SHLIB_CFLAGS="-fPIC"
2734	    SHLIB_LD_LIBS='${LIBS}'
2735	    SHLIB_SUFFIX=".so"
2736	    CFLAGS_OPTIMIZE=-02
2737	    SHLIB_LD="${CC} -shared "
2738	    DL_OBJS="tclLoadDl.o"
2739	    DL_LIBS="-mshared -ldl"
2740	    LD_FLAGS="-Wl,--export-dynamic"
2741	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2742	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2743	    ;;
2744	MP-RAS-02*)
2745	    SHLIB_CFLAGS="-K PIC"
2746	    SHLIB_LD="cc -G"
2747	    SHLIB_LD_LIBS=""
2748	    SHLIB_SUFFIX=".so"
2749	    DL_OBJS="tclLoadDl.o"
2750	    DL_LIBS="-ldl"
2751	    CC_SEARCH_FLAGS=""
2752	    LD_SEARCH_FLAGS=""
2753	    ;;
2754	MP-RAS-*)
2755	    SHLIB_CFLAGS="-K PIC"
2756	    SHLIB_LD="cc -G"
2757	    SHLIB_LD_LIBS=""
2758	    SHLIB_SUFFIX=".so"
2759	    DL_OBJS="tclLoadDl.o"
2760	    DL_LIBS="-ldl"
2761	    LDFLAGS="$LDFLAGS -Wl,-Bexport"
2762	    CC_SEARCH_FLAGS=""
2763	    LD_SEARCH_FLAGS=""
2764	    ;;
2765	NetBSD-*|FreeBSD-[1-2].*)
2766	    # Not available on all versions:  check for include file.
2767	    ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
2768echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
2769echo "configure:2770: checking for dlfcn.h" >&5
2770if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2771  echo $ac_n "(cached) $ac_c" 1>&6
2772else
2773  cat > conftest.$ac_ext <<EOF
2774#line 2775 "configure"
2775#include "confdefs.h"
2776#include <dlfcn.h>
2777EOF
2778ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2779{ (eval echo configure:2780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2780ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2781if test -z "$ac_err"; then
2782  rm -rf conftest*
2783  eval "ac_cv_header_$ac_safe=yes"
2784else
2785  echo "$ac_err" >&5
2786  echo "configure: failed program was:" >&5
2787  cat conftest.$ac_ext >&5
2788  rm -rf conftest*
2789  eval "ac_cv_header_$ac_safe=no"
2790fi
2791rm -f conftest*
2792fi
2793if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2794  echo "$ac_t""yes" 1>&6
2795  
2796		# NetBSD/SPARC needs -fPIC, -fpic will not do.
2797		SHLIB_CFLAGS="-fPIC"
2798		SHLIB_LD="ld -Bshareable -x"
2799		SHLIB_LD_LIBS='${LIBS}'
2800		SHLIB_SUFFIX=".so"
2801		DL_OBJS="tclLoadDl.o"
2802		DL_LIBS=""
2803		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2804		LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
2805		echo $ac_n "checking for ELF""... $ac_c" 1>&6
2806echo "configure:2807: checking for ELF" >&5
2807if eval "test \"`echo '$''{'tcl_cv_ld_elf'+set}'`\" = set"; then
2808  echo $ac_n "(cached) $ac_c" 1>&6
2809else
2810  
2811		    cat > conftest.$ac_ext <<EOF
2812#line 2813 "configure"
2813#include "confdefs.h"
2814
2815#ifdef __ELF__
2816	yes
2817#endif
2818		    
2819EOF
2820if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2821  egrep "yes" >/dev/null 2>&1; then
2822  rm -rf conftest*
2823  tcl_cv_ld_elf=yes
2824else
2825  rm -rf conftest*
2826  tcl_cv_ld_elf=no
2827fi
2828rm -f conftest*
2829
2830fi
2831
2832echo "$ac_t""$tcl_cv_ld_elf" 1>&6
2833		if test $tcl_cv_ld_elf = yes; then
2834		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
2835		else
2836		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
2837		fi
2838	    
2839else
2840  echo "$ac_t""no" 1>&6
2841
2842		SHLIB_CFLAGS=""
2843		SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
2844		SHLIB_LD_LIBS='${LIBS}'
2845		SHLIB_SUFFIX=".a"
2846		DL_OBJS="tclLoadAout.o"
2847		DL_LIBS=""
2848		CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
2849		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2850		SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
2851	    
2852fi
2853
2854
2855	    # FreeBSD doesn't handle version numbers with dots.
2856
2857	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
2858	    TCL_LIB_VERSIONS_OK=nodots
2859	    ;;
2860	OpenBSD-*)
2861	    case `arch -s` in
2862	    m88k|vax)
2863		SHLIB_CFLAGS=""
2864		SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
2865		SHLIB_LD_LIBS='${LIBS}'
2866		SHLIB_SUFFIX=".a"
2867		DL_OBJS="tclLoadAout.o"
2868		DL_LIBS=""
2869		LDFLAGS=""
2870		CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
2871		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2872		SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
2873		;;
2874	    *)
2875		# OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
2876		case `machine` in
2877		sparc|sparc64)
2878		    SHLIB_CFLAGS="-fPIC";;
2879	        *)
2880		    SHLIB_CFLAGS="-fpic";;
2881	        esac
2882		SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
2883		SHLIB_LD_LIBS='${LIBS}'
2884		SHLIB_SUFFIX=".so"
2885		DL_OBJS="tclLoadDl.o"
2886		DL_LIBS=""
2887		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2888		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2889		SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
2890		echo $ac_n "checking for ELF""... $ac_c" 1>&6
2891echo "configure:2892: checking for ELF" >&5
2892if eval "test \"`echo '$''{'tcl_cv_ld_elf'+set}'`\" = set"; then
2893  echo $ac_n "(cached) $ac_c" 1>&6
2894else
2895  
2896		    cat > conftest.$ac_ext <<EOF
2897#line 2898 "configure"
2898#include "confdefs.h"
2899
2900#ifdef __ELF__
2901	yes
2902#endif
2903		    
2904EOF
2905if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2906  egrep "yes" >/dev/null 2>&1; then
2907  rm -rf conftest*
2908  tcl_cv_ld_elf=yes
2909else
2910  rm -rf conftest*
2911  tcl_cv_ld_elf=no
2912fi
2913rm -f conftest*
2914
2915fi
2916
2917echo "$ac_t""$tcl_cv_ld_elf" 1>&6
2918		if test $tcl_cv_ld_elf = yes; then
2919		    LDFLAGS=-Wl,-export-dynamic
2920		else
2921		    LDFLAGS=""
2922	        fi
2923		;;
2924	    esac
2925
2926	    # OpenBSD doesn't do version numbers with dots.
2927	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
2928	    TCL_LIB_VERSIONS_OK=nodots
2929	    ;;
2930	FreeBSD-*)
2931	    # FreeBSD 3.* and greater have ELF.
2932	    SHLIB_CFLAGS="-fPIC"
2933	    SHLIB_LD="ld -Bshareable -x"
2934	    SHLIB_LD_LIBS='${LIBS}'
2935	    SHLIB_SUFFIX=".so"
2936	    DL_OBJS="tclLoadDl.o"
2937	    DL_LIBS=""
2938	    LDFLAGS="$LDFLAGS -export-dynamic"
2939	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
2940	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
2941	    if test "${TCL_THREADS}" = "1" ; then
2942		# The -pthread needs to go in the CFLAGS, not LIBS
2943		LIBS=`echo $LIBS | sed s/-pthread//`
2944		CFLAGS="$CFLAGS -pthread"
2945	    	LDFLAGS="$LDFLAGS -pthread"
2946	    fi
2947	    case $system in
2948	    FreeBSD-3.*)
2949	    	# FreeBSD-3 doesn't handle version numbers with dots.
2950	    	UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
2951	    	SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
2952	    	TCL_LIB_VERSIONS_OK=nodots
2953		;;
2954	    esac
2955	    ;;
2956	Darwin-*)
2957	    CFLAGS_OPTIMIZE="-Os"
2958	    SHLIB_CFLAGS="-fno-common"
2959	    # To avoid discrepancies between what headers configure sees during
2960	    # preprocessing tests and compiling tests, move any -isysroot and
2961	    # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
2962	    CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
2963		awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
2964		if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`"
2965	    CFLAGS="`echo " ${CFLAGS}" | \
2966		awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
2967		if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`"
2968	    if test $do64bit = yes; then
2969		case `arch` in
2970		    ppc)
2971			echo $ac_n "checking if compiler accepts -arch ppc64 flag""... $ac_c" 1>&6
2972echo "configure:2973: checking if compiler accepts -arch ppc64 flag" >&5
2973if eval "test \"`echo '$''{'tcl_cv_cc_arch_ppc64'+set}'`\" = set"; then
2974  echo $ac_n "(cached) $ac_c" 1>&6
2975else
2976  
2977			    hold_cflags=$CFLAGS
2978			    CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
2979			    cat > conftest.$ac_ext <<EOF
2980#line 2981 "configure"
2981#include "confdefs.h"
2982
2983int main() {
2984
2985; return 0; }
2986EOF
2987if { (eval echo configure:2988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2988  rm -rf conftest*
2989  tcl_cv_cc_arch_ppc64=yes
2990else
2991  echo "configure: failed program was:" >&5
2992  cat conftest.$ac_ext >&5
2993  rm -rf conftest*
2994  tcl_cv_cc_arch_ppc64=no
2995fi
2996rm -f conftest*
2997			    CFLAGS=$hold_cflags
2998fi
2999
3000echo "$ac_t""$tcl_cv_cc_arch_ppc64" 1>&6
3001			if test $tcl_cv_cc_arch_ppc64 = yes; then
3002			    CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
3003			    do64bit_ok=yes
3004			fi;;
3005		    i386)
3006			echo $ac_n "checking if compiler accepts -arch x86_64 flag""... $ac_c" 1>&6
3007echo "configure:3008: checking if compiler accepts -arch x86_64 flag" >&5
3008if eval "test \"`echo '$''{'tcl_cv_cc_arch_x86_64'+set}'`\" = set"; then
3009  echo $ac_n "(cached) $ac_c" 1>&6
3010else
3011  
3012			    hold_cflags=$CFLAGS
3013			    CFLAGS="$CFLAGS -arch x86_64"
3014			    cat > conftest.$ac_ext <<EOF
3015#line 3016 "configure"
3016#include "confdefs.h"
3017
3018int main() {
3019
3020; return 0; }
3021EOF
3022if { (eval echo configure:3023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3023  rm -rf conftest*
3024  tcl_cv_cc_arch_x86_64=yes
3025else
3026  echo "configure: failed program was:" >&5
3027  cat conftest.$ac_ext >&5
3028  rm -rf conftest*
3029  tcl_cv_cc_arch_x86_64=no
3030fi
3031rm -f conftest*
3032			    CFLAGS=$hold_cflags
3033fi
3034
3035echo "$ac_t""$tcl_cv_cc_arch_x86_64" 1>&6
3036			if test $tcl_cv_cc_arch_x86_64 = yes; then
3037			    CFLAGS="$CFLAGS -arch x86_64"
3038			    do64bit_ok=yes
3039			fi;;
3040		    *)
3041			echo "configure: warning: Don't know how enable 64-bit on architecture `arch`" 1>&2;;
3042		esac
3043	    else
3044		# Check for combined 32-bit and 64-bit fat build
3045		echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \
3046		    echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \
3047		    fat_32_64=yes
3048	    fi
3049	    SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}'
3050	    echo $ac_n "checking if ld accepts -single_module flag""... $ac_c" 1>&6
3051echo "configure:3052: checking if ld accepts -single_module flag" >&5
3052if eval "test \"`echo '$''{'tcl_cv_ld_single_module'+set}'`\" = set"; then
3053  echo $ac_n "(cached) $ac_c" 1>&6
3054else
3055  
3056		hold_ldflags=$LDFLAGS
3057		LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
3058		cat > conftest.$ac_ext <<EOF
3059#line 3060 "configure"
3060#include "confdefs.h"
3061
3062int main() {
3063int i;
3064; return 0; }
3065EOF
3066if { (eval echo configure:3067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3067  rm -rf conftest*
3068  tcl_cv_ld_single_module=yes
3069else
3070  echo "configure: failed program was:" >&5
3071  cat conftest.$ac_ext >&5
3072  rm -rf conftest*
3073  tcl_cv_ld_single_module=no
3074fi
3075rm -f conftest*
3076		LDFLAGS=$hold_ldflags
3077fi
3078
3079echo "$ac_t""$tcl_cv_ld_single_module" 1>&6
3080	    if test $tcl_cv_ld_single_module = yes; then
3081		SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
3082	    fi
3083	    SHLIB_LD_LIBS='${LIBS}'
3084	    SHLIB_SUFFIX=".dylib"
3085	    DL_OBJS="tclLoadDyld.o"
3086	    DL_LIBS=""
3087	    # Don't use -prebind when building for Mac OS X 10.4 or later only:
3088	    test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \
3089		"`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \
3090		LDFLAGS="$LDFLAGS -prebind"
3091	    LDFLAGS="$LDFLAGS -headerpad_max_install_names"
3092	    echo $ac_n "checking if ld accepts -search_paths_first flag""... $ac_c" 1>&6
3093echo "configure:3094: checking if ld accepts -search_paths_first flag" >&5
3094if eval "test \"`echo '$''{'tcl_cv_ld_search_paths_first'+set}'`\" = set"; then
3095  echo $ac_n "(cached) $ac_c" 1>&6
3096else
3097  
3098		hold_ldflags=$LDFLAGS
3099		LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
3100		cat > conftest.$ac_ext <<EOF
3101#line 3102 "configure"
3102#include "confdefs.h"
3103
3104int main() {
3105int i;
3106; return 0; }
3107EOF
3108if { (eval echo configure:3109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3109  rm -rf conftest*
3110  tcl_cv_ld_search_paths_first=yes
3111else
3112  echo "configure: failed program was:" >&5
3113  cat conftest.$ac_ext >&5
3114  rm -rf conftest*
3115  tcl_cv_ld_search_paths_first=no
3116fi
3117rm -f conftest*
3118		LDFLAGS=$hold_ldflags
3119fi
3120
3121echo "$ac_t""$tcl_cv_ld_search_paths_first" 1>&6
3122	    if test $tcl_cv_ld_search_paths_first = yes; then
3123		LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
3124	    fi
3125	    CC_SEARCH_FLAGS=""
3126	    LD_SEARCH_FLAGS=""
3127	    LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
3128	    PLAT_OBJS=\$\(MAC\_OSX_OBJS\)
3129	    PLAT_SRCS=\$\(MAC\_OSX_SRCS\)
3130	    echo $ac_n "checking whether to use CoreFoundation""... $ac_c" 1>&6
3131echo "configure:3132: checking whether to use CoreFoundation" >&5
3132	    # Check whether --enable-corefoundation or --disable-corefoundation was given.
3133if test "${enable_corefoundation+set}" = set; then
3134  enableval="$enable_corefoundation"
3135  tcl_corefoundation=$enableval
3136else
3137  tcl_corefoundation=yes
3138fi
3139
3140	    echo "$ac_t""$tcl_corefoundation" 1>&6
3141	    if test $tcl_corefoundation = yes; then
3142		echo $ac_n "checking for CoreFoundation.framework""... $ac_c" 1>&6
3143echo "configure:3144: checking for CoreFoundation.framework" >&5
3144if eval "test \"`echo '$''{'tcl_cv_lib_corefoundation'+set}'`\" = set"; then
3145  echo $ac_n "(cached) $ac_c" 1>&6
3146else
3147  
3148		    hold_libs=$LIBS
3149		    if test "$fat_32_64" = yes; then for v in CFLAGS CPPFLAGS LDFLAGS; do
3150			# On Tiger there is no 64-bit CF, so remove 64-bit archs
3151			# from CFLAGS et al. while testing for presence of CF.
3152			# 64-bit CF is disabled in tclUnixPort.h if necessary.
3153			eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
3154		    done; fi
3155		    LIBS="$LIBS -framework CoreFoundation"
3156		    cat > conftest.$ac_ext <<EOF
3157#line 3158 "configure"
3158#include "confdefs.h"
3159#include <CoreFoundation/CoreFoundation.h>
3160int main() {
3161CFBundleRef b = CFBundleGetMainBundle();
3162; return 0; }
3163EOF
3164if { (eval echo configure:3165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3165  rm -rf conftest*
3166  tcl_cv_lib_corefoundation=yes
3167else
3168  echo "configure: failed program was:" >&5
3169  cat conftest.$ac_ext >&5
3170  rm -rf conftest*
3171  tcl_cv_lib_corefoundation=no
3172fi
3173rm -f conftest*
3174		    if test "$fat_32_64" = yes; then for v in CFLAGS CPPFLAGS LDFLAGS; do
3175			eval $v'="$hold_'$v'"'
3176		    done; fi; LIBS=$hold_libs
3177fi
3178
3179echo "$ac_t""$tcl_cv_lib_corefoundation" 1>&6
3180		if test $tcl_cv_lib_corefoundation = yes; then
3181		    LIBS="$LIBS -framework CoreFoundation"
3182		    cat >> confdefs.h <<\EOF
3183#define HAVE_COREFOUNDATION 1
3184EOF
3185
3186		else
3187		    tcl_corefoundation=no
3188		fi
3189		if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then
3190		    echo $ac_n "checking for 64-bit CoreFoundation""... $ac_c" 1>&6
3191echo "configure:3192: checking for 64-bit CoreFoundation" >&5
3192if eval "test \"`echo '$''{'tcl_cv_lib_corefoundation_64'+set}'`\" = set"; then
3193  echo $ac_n "(cached) $ac_c" 1>&6
3194else
3195  
3196			for v in CFLAGS CPPFLAGS LDFLAGS; do
3197			    eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
3198			done
3199			cat > conftest.$ac_ext <<EOF
3200#line 3201 "configure"
3201#include "confdefs.h"
3202#include <CoreFoundation/CoreFoundation.h>
3203int main() {
3204CFBundleRef b = CFBundleGetMainBundle();
3205; return 0; }
3206EOF
3207if { (eval echo configure:3208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3208  rm -rf conftest*
3209  tcl_cv_lib_corefoundation_64=yes
3210else
3211  echo "configure: failed program was:" >&5
3212  cat conftest.$ac_ext >&5
3213  rm -rf conftest*
3214  tcl_cv_lib_corefoundation_64=no
3215fi
3216rm -f conftest*
3217			for v in CFLAGS CPPFLAGS LDFLAGS; do
3218			    eval $v'="$hold_'$v'"'
3219			done
3220fi
3221
3222echo "$ac_t""$tcl_cv_lib_corefoundation_64" 1>&6
3223		    if test $tcl_cv_lib_corefoundation_64 = no; then
3224			cat >> confdefs.h <<\EOF
3225#define NO_COREFOUNDATION_64 1
3226EOF
3227
3228		    fi
3229		fi
3230	    fi
3231	    cat >> confdefs.h <<\EOF
3232#define MAC_OSX_TCL 1
3233EOF
3234
3235	    ;;
3236	NEXTSTEP-*)
3237	    SHLIB_CFLAGS=""
3238	    SHLIB_LD="cc -nostdlib -r"
3239	    SHLIB_LD_LIBS=""
3240	    SHLIB_SUFFIX=".so"
3241	    DL_OBJS="tclLoadNext.o"
3242	    DL_LIBS=""
3243	    CC_SEARCH_FLAGS=""
3244	    LD_SEARCH_FLAGS=""
3245	    ;;
3246	OS/390-*)
3247	    CFLAGS_OPTIMIZE=""		# Optimizer is buggy
3248	    cat >> confdefs.h <<\EOF
3249#define _OE_SOCKETS 1
3250EOF
3251	# needed in sys/socket.h
3252	    ;;      
3253	OSF1-1.0|OSF1-1.1|OSF1-1.2)
3254	    # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
3255	    SHLIB_CFLAGS=""
3256	    # Hack: make package name same as library name
3257	    SHLIB_LD='ld -R -export :'
3258	    SHLIB_LD_LIBS=""
3259	    SHLIB_SUFFIX=".so"
3260	    DL_OBJS="tclLoadOSF.o"
3261	    DL_LIBS=""
3262	    CC_SEARCH_FLAGS=""
3263	    LD_SEARCH_FLAGS=""
3264	    ;;
3265	OSF1-1.*)
3266	    # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
3267	    SHLIB_CFLAGS="-fPIC"
3268	    if test "$SHARED_BUILD" = "1" ; then
3269	        SHLIB_LD="ld -shared"
3270	    else
3271	        SHLIB_LD="ld -non_shared"
3272	    fi
3273	    SHLIB_LD_LIBS=""
3274	    SHLIB_SUFFIX=".so"
3275	    DL_OBJS="tclLoadDl.o"
3276	    DL_LIBS=""
3277	    CC_SEARCH_FLAGS=""
3278	    LD_SEARCH_FLAGS=""
3279	    ;;
3280	OSF1-V*)
3281	    # Digital OSF/1
3282	    SHLIB_CFLAGS=""
3283	    if test "$SHARED_BUILD" = "1" ; then
3284	        SHLIB_LD='ld -shared -expect_unresolved "*"'
3285	    else
3286	        SHLIB_LD='ld -non_shared -expect_unresolved "*"'
3287	    fi
3288	    SHLIB_LD_LIBS=""
3289	    SHLIB_SUFFIX=".so"
3290	    DL_OBJS="tclLoadDl.o"
3291	    DL_LIBS=""
3292	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
3293	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
3294	    if test "$GCC" = "yes" ; then
3295		CFLAGS="$CFLAGS -mieee"
3296            else
3297		CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
3298	    fi
3299	    # see pthread_intro(3) for pthread support on osf1, k.furukawa
3300	    if test "${TCL_THREADS}" = "1" ; then
3301		CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
3302		CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
3303		LIBS=`echo $LIBS | sed s/-lpthreads//`
3304		if test "$GCC" = "yes" ; then
3305		    LIBS="$LIBS -lpthread -lmach -lexc"
3306		else
3307		    CFLAGS="$CFLAGS -pthread"
3308		    LDFLAGS="$LDFLAGS -pthread"
3309		fi
3310	    fi
3311
3312	    ;;
3313	QNX-6*)
3314	    # QNX RTP
3315	    # This may work for all QNX, but it was only reported for v6.
3316	    SHLIB_CFLAGS="-fPIC"
3317	    SHLIB_LD="ld -Bshareable -x"
3318	    SHLIB_LD_LIBS=""
3319	    SHLIB_SUFFIX=".so"
3320	    DL_OBJS="tclLoadDl.o"
3321	    # dlopen is in -lc on QNX
3322	    DL_LIBS=""
3323	    CC_SEARCH_FLAGS=""
3324	    LD_SEARCH_FLAGS=""
3325	    ;;
3326	RISCos-*)
3327	    SHLIB_CFLAGS="-G 0"
3328	    SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
3329	    SHLIB_LD_LIBS='${LIBS}'
3330	    SHLIB_SUFFIX=".a"
3331	    DL_OBJS="tclLoadAout.o"
3332	    DL_LIBS=""
3333	    LDFLAGS="$LDFLAGS -Wl,-D,08000000"
3334	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
3335	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3336	    ;;
3337	SCO_SV-3.2*)
3338	    # Note, dlopen is available only on SCO 3.2.5 and greater. However,
3339	    # this test works, since "uname -s" was non-standard in 3.2.4 and
3340	    # below.
3341	    if test "$GCC" = "yes" ; then
3342	    	SHLIB_CFLAGS="-fPIC -melf"
3343	    	LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
3344	    else
3345	    	SHLIB_CFLAGS="-Kpic -belf"
3346	    	LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
3347	    fi
3348	    SHLIB_LD="ld -G"
3349	    SHLIB_LD_LIBS=""
3350	    SHLIB_SUFFIX=".so"
3351	    DL_OBJS="tclLoadDl.o"
3352	    DL_LIBS=""
3353	    CC_SEARCH_FLAGS=""
3354	    LD_SEARCH_FLAGS=""
3355	    ;;
3356	SINIX*5.4*)
3357	    SHLIB_CFLAGS="-K PIC"
3358	    SHLIB_LD="cc -G"
3359	    SHLIB_LD_LIBS=""
3360	    SHLIB_SUFFIX=".so"
3361	    DL_OBJS="tclLoadDl.o"
3362	    DL_LIBS="-ldl"
3363	    CC_SEARCH_FLAGS=""
3364	    LD_SEARCH_FLAGS=""
3365	    ;;
3366	SunOS-4*)
3367	    SHLIB_CFLAGS="-PIC"
3368	    SHLIB_LD="ld"
3369	    SHLIB_LD_LIBS=""
3370	    SHLIB_SUFFIX=".so"
3371	    DL_OBJS="tclLoadDl.o"
3372	    DL_LIBS="-ldl"
3373	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
3374	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3375
3376	    # SunOS can't handle version numbers with dots in them in library
3377	    # specs, like -ltcl7.5, so use -ltcl75 instead.  Also, it
3378	    # requires an extra version number at the end of .so file names.
3379	    # So, the library has to have a name like libtcl75.so.1.0
3380
3381	    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
3382	    UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
3383	    TCL_LIB_VERSIONS_OK=nodots
3384	    ;;
3385	SunOS-5.[0-6])
3386	    # Careful to not let 5.10+ fall into this case
3387
3388	    # Note: If _REENTRANT isn't defined, then Solaris
3389	    # won't define thread-safe library routines.
3390
3391	    cat >> confdefs.h <<\EOF
3392#define _REENTRANT 1
3393EOF
3394
3395	    cat >> confdefs.h <<\EOF
3396#define _POSIX_PTHREAD_SEMANTICS 1
3397EOF
3398
3399
3400	    SHLIB_CFLAGS="-KPIC"
3401
3402	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
3403	    # symbols when dynamically loaded into tclsh.
3404
3405	    SHLIB_LD_LIBS='${LIBS}'
3406	    SHLIB_SUFFIX=".so"
3407	    DL_OBJS="tclLoadDl.o"
3408	    DL_LIBS="-ldl"
3409	    if test "$GCC" = "yes" ; then
3410		SHLIB_LD="$CC -shared"
3411		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
3412		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3413	    else
3414		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
3415		CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
3416		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3417	    fi
3418	    ;;
3419	SunOS-5*)
3420	    # Note: If _REENTRANT isn't defined, then Solaris
3421	    # won't define thread-safe library routines.
3422
3423	    cat >> confdefs.h <<\EOF
3424#define _REENTRANT 1
3425EOF
3426
3427	    cat >> confdefs.h <<\EOF
3428#define _POSIX_PTHREAD_SEMANTICS 1
3429EOF
3430
3431
3432	    SHLIB_CFLAGS="-KPIC"
3433
3434	    # Check to enable 64-bit flags for compiler/linker
3435	    if test "$do64bit" = "yes" ; then
3436		arch=`isainfo`
3437		if test "$arch" = "sparcv9 sparc" ; then
3438			if test "$GCC" = "yes" ; then
3439			    if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then
3440				echo "configure: warning: 64bit mode not supported with GCC < 3.2 on $system" 1>&2
3441			    else
3442				do64bit_ok=yes
3443				CFLAGS="$CFLAGS -m64 -mcpu=v9"
3444				LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
3445				SHLIB_CFLAGS="-fPIC"
3446			    fi
3447			else
3448			    do64bit_ok=yes
3449			    if test "$do64bitVIS" = "yes" ; then
3450				CFLAGS="$CFLAGS -xarch=v9a"
3451				LDFLAGS="$LDFLAGS -xarch=v9a"
3452			    else
3453				CFLAGS="$CFLAGS -xarch=v9"
3454				LDFLAGS="$LDFLAGS -xarch=v9"
3455			    fi
3456			    # Solaris 64 uses this as well
3457			    #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
3458			fi
3459		elif test "$arch" = "amd64 i386" ; then
3460		    if test "$GCC" = "yes" ; then
3461			case $system in
3462			    SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
3463				do64bit_ok=yes
3464				CFLAGS="$CFLAGS -m64"
3465				LDFLAGS="$LDFLAGS -m64";;
3466			    *)
3467				echo "configure: warning: 64bit mode not supported with GCC on $system" 1>&2;;
3468			esac
3469		    else
3470			do64bit_ok=yes
3471			case $system in
3472			    SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
3473				CFLAGS="$CFLAGS -m64"
3474				LDFLAGS="$LDFLAGS -m64";;
3475			    *)
3476				CFLAGS="$CFLAGS -xarch=amd64"
3477				LDFLAGS="$LDFLAGS -xarch=amd64";;
3478			esac
3479		    fi
3480		else
3481		    echo "configure: warning: 64bit mode not supported for $arch" 1>&2
3482		fi
3483	    fi
3484
3485	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
3486	    # symbols when dynamically loaded into tclsh.
3487
3488	    SHLIB_LD_LIBS='${LIBS}'
3489	    SHLIB_SUFFIX=".so"
3490	    DL_OBJS="tclLoadDl.o"
3491	    DL_LIBS="-ldl"
3492	    if test "$GCC" = "yes" ; then
3493		SHLIB_LD="$CC -shared"
3494		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
3495		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3496		if test "$do64bit_ok" = "yes" ; then
3497		    if test "$arch" = "sparcv9 sparc" ; then
3498			# We need to specify -static-libgcc or we need to
3499			# add the path to the sparv9 libgcc.
3500			SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
3501			# for finding sparcv9 libgcc, get the regular libgcc
3502			# path, remove so name and append 'sparcv9'
3503			#v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
3504			#CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
3505		    elif test "$arch" = "amd64 i386" ; then
3506			SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
3507		    fi
3508		fi
3509	    else
3510		case $system in
3511		    SunOS-5.[1-9][0-9]*)
3512			SHLIB_LD='${CC} -G -z text ${LDFLAGS}';;
3513		    *)
3514			SHLIB_LD="/usr/ccs/bin/ld -G -z text";;
3515		esac
3516		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
3517		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
3518	    fi
3519	    ;;
3520	ULTRIX-4.*)
3521	    SHLIB_CFLAGS="-G 0"
3522	    SHLIB_SUFFIX=".a"
3523	    SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
3524	    SHLIB_LD_LIBS='${LIBS}'
3525	    DL_OBJS="tclLoadAout.o"
3526	    DL_LIBS=""
3527	    LDFLAGS="$LDFLAGS -Wl,-D,08000000"
3528	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
3529	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
3530	    if test "$GCC" != "yes" ; then
3531		CFLAGS="$CFLAGS -DHAVE_TZSET -std1"
3532	    fi
3533	    ;;
3534	UNIX_SV* | UnixWare-5*)
3535	    SHLIB_CFLAGS="-KPIC"
3536	    SHLIB_LD="cc -G"
3537	    SHLIB_LD_LIBS=""
3538	    SHLIB_SUFFIX=".so"
3539	    DL_OBJS="tclLoadDl.o"
3540	    DL_LIBS="-ldl"
3541	    # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
3542	    # that don't grok the -Bexport option.  Test that it does.
3543	    echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6
3544echo "configure:3545: checking for ld accepts -Bexport flag" >&5
3545if eval "test \"`echo '$''{'tcl_cv_ld_Bexport'+set}'`\" = set"; then
3546  echo $ac_n "(cached) $ac_c" 1>&6
3547else
3548  
3549		hold_ldflags=$LDFLAGS
3550		LDFLAGS="$LDFLAGS -Wl,-Bexport"
3551		cat > conftest.$ac_ext <<EOF
3552#line 3553 "configure"
3553#include "confdefs.h"
3554
3555int main() {
3556int i;
3557; return 0; }
3558EOF
3559if { (eval echo configure:3560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3560  rm -rf conftest*
3561  tcl_cv_ld_Bexport=yes
3562else
3563  echo "configure: failed program was:" >&5
3564  cat conftest.$ac_ext >&5
3565  rm -rf conftest*
3566  tcl_cv_ld_Bexport=no
3567fi
3568rm -f conftest*
3569	        LDFLAGS=$hold_ldflags
3570fi
3571
3572echo "$ac_t""$tcl_cv_ld_Bexport" 1>&6
3573	    if test $tcl_cv_ld_Bexport = yes; then
3574		LDFLAGS="$LDFLAGS -Wl,-Bexport"
3575	    fi
3576	    CC_SEARCH_FLAGS=""
3577	    LD_SEARCH_FLAGS=""
3578	    ;;
3579    esac
3580
3581    if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
3582	echo "configure: warning: 64bit support being disabled -- don't know magic for this platform" 1>&2
3583    fi
3584
3585    
3586    
3587
3588    # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic
3589    # Loading for Tcl -- What Became of It?".  Proc. 2nd Tcl/Tk Workshop,
3590    # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need
3591    # to determine which of several header files defines the a.out file
3592    # format (a.out.h, sys/exec.h, or sys/exec_aout.h).  At present, we
3593    # support only a file format that is more or less version-7-compatible. 
3594    # In particular,
3595    #	- a.out files must begin with `struct exec'.
3596    #	- the N_TXTOFF on the `struct exec' must compute the seek address
3597    #	  of the text segment
3598    #	- The `struct exec' must contain a_magic, a_text, a_data, a_bss
3599    #	  and a_entry fields.
3600    # The following compilation should succeed if and only if either sys/exec.h
3601    # or a.out.h is usable for the purpose.
3602    #
3603    # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the
3604    # `struct exec' includes a second header that contains information that
3605    # duplicates the v7 fields that are needed.
3606
3607    if test "x$DL_OBJS" = "xtclLoadAout.o" ; then
3608	echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6
3609echo "configure:3610: checking sys/exec.h" >&5
3610if eval "test \"`echo '$''{'tcl_cv_sysexec_h'+set}'`\" = set"; then
3611  echo $ac_n "(cached) $ac_c" 1>&6
3612else
3613  
3614	cat > conftest.$ac_ext <<EOF
3615#line 3616 "configure"
3616#include "confdefs.h"
3617#include <sys/exec.h>
3618int main() {
3619
3620	    struct exec foo;
3621	    unsigned long seek;
3622	    int flag;
3623#if defined(__mips) || defined(mips)
3624	    seek = N_TXTOFF (foo.ex_f, foo.ex_o);
3625#else
3626	    seek = N_TXTOFF (foo);
3627#endif
3628	    flag = (foo.a_magic == OMAGIC);
3629	    return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
3630    
3631; return 0; }
3632EOF
3633if { (eval echo configure:3634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3634  rm -rf conftest*
3635  tcl_cv_sysexec_h=usable
3636else
3637  echo "configure: failed program was:" >&5
3638  cat conftest.$ac_ext >&5
3639  rm -rf conftest*
3640  tcl_cv_sysexec_h=unusable
3641fi
3642rm -f conftest*
3643fi
3644
3645echo "$ac_t""$tcl_cv_sysexec_h" 1>&6
3646	if test $tcl_cv_sysexec_h = usable; then
3647	    cat >> confdefs.h <<\EOF
3648#define USE_SYS_EXEC_H 1
3649EOF
3650
3651	else
3652	    echo $ac_n "checking a.out.h""... $ac_c" 1>&6
3653echo "configure:3654: checking a.out.h" >&5
3654if eval "test \"`echo '$''{'tcl_cv_aout_h'+set}'`\" = set"; then
3655  echo $ac_n "(cached) $ac_c" 1>&6
3656else
3657  
3658	    cat > conftest.$ac_ext <<EOF
3659#line 3660 "configure"
3660#include "confdefs.h"
3661#include <a.out.h>
3662int main() {
3663
3664		struct exec foo;
3665		unsigned long seek;
3666		int flag;
3667#if defined(__mips) || defined(mips)
3668		seek = N_TXTOFF (foo.ex_f, foo.ex_o);
3669#else
3670		seek = N_TXTOFF (foo);
3671#endif
3672		flag = (foo.a_magic == OMAGIC);
3673		return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
3674	    
3675; return 0; }
3676EOF
3677if { (eval echo configure:3678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3678  rm -rf conftest*
3679  tcl_cv_aout_h=usable
3680else
3681  echo "configure: failed program was:" >&5
3682  cat conftest.$ac_ext >&5
3683  rm -rf conftest*
3684  tcl_cv_aout_h=unusable
3685fi
3686rm -f conftest*
3687fi
3688
3689echo "$ac_t""$tcl_cv_aout_h" 1>&6
3690	    if test $tcl_cv_aout_h = usable; then
3691		cat >> confdefs.h <<\EOF
3692#define USE_A_OUT_H 1
3693EOF
3694
3695	    else
3696		echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6
3697echo "configure:3698: checking sys/exec_aout.h" >&5
3698if eval "test \"`echo '$''{'tcl_cv_sysexecaout_h'+set}'`\" = set"; then
3699  echo $ac_n "(cached) $ac_c" 1>&6
3700else
3701  
3702		cat > conftest.$ac_ext <<EOF
3703#line 3704 "configure"
3704#include "confdefs.h"
3705#include <sys/exec_aout.h>
3706int main() {
3707
3708		    struct exec foo;
3709		    unsigned long seek;
3710		    int flag;
3711#if defined(__mips) || defined(mips)
3712		    seek = N_TXTOFF (foo.ex_f, foo.ex_o);
3713#else
3714		    seek = N_TXTOFF (foo);
3715#endif
3716		    flag = (foo.a_midmag == OMAGIC);
3717		    return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
3718		
3719; return 0; }
3720EOF
3721if { (eval echo configure:3722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3722  rm -rf conftest*
3723  tcl_cv_sysexecaout_h=usable
3724else
3725  echo "configure: failed program was:" >&5
3726  cat conftest.$ac_ext >&5
3727  rm -rf conftest*
3728  tcl_cv_sysexecaout_h=unusable
3729fi
3730rm -f conftest*
3731fi
3732
3733echo "$ac_t""$tcl_cv_sysexecaout_h" 1>&6
3734		if test $tcl_cv_sysexecaout_h = usable; then
3735		    cat >> confdefs.h <<\EOF
3736#define USE_SYS_EXEC_AOUT_H 1
3737EOF
3738
3739		else
3740		    DL_OBJS=""
3741		fi
3742	    fi
3743	fi
3744    fi
3745
3746    # Step 5: disable dynamic loading if requested via a command-line switch.
3747
3748    # Check whether --enable-load or --disable-load was given.
3749if test "${enable_load+set}" = set; then
3750  enableval="$enable_load"
3751  tcl_ok=$enableval
3752else
3753  tcl_ok=yes
3754fi
3755
3756    if test "$tcl_ok" = "no"; then
3757	DL_OBJS=""
3758    fi
3759
3760    if test "x$DL_OBJS" != "x" ; then
3761	BUILD_DLTEST="\$(DLTEST_TARGETS)"
3762    else
3763	echo "Can't figure out how to do dynamic loading or shared libraries"
3764	echo "on this system."
3765	SHLIB_CFLAGS=""
3766	SHLIB_LD=""
3767	SHLIB_SUFFIX=""
3768	DL_OBJS="tclLoadNone.o"
3769	DL_LIBS=""
3770	LDFLAGS="$LDFLAGS_ORIG"
3771	CC_SEARCH_FLAGS=""
3772	LD_SEARCH_FLAGS=""
3773	BUILD_DLTEST=""
3774    fi
3775
3776    # If we're running gcc, then change the C flags for compiling shared
3777    # libraries to the right flags for gcc, instead of those for the
3778    # standard manufacturer compiler.
3779
3780    if test "$DL_OBJS" != "tclLoadNone.o" ; then
3781	if test "$GCC" = "yes" ; then
3782	    case $system in
3783		AIX-*)
3784		    ;;
3785		BSD/OS*)
3786		    ;;
3787		IRIX*)
3788		    ;;
3789		NetBSD-*|FreeBSD-*|OpenBSD-*)
3790		    ;;
3791		Darwin-*)
3792		    ;;
3793		RISCos-*)
3794		    ;;
3795		SCO_SV-3.2*)
3796		    ;;
3797		ULTRIX-4.*)
3798		    ;;
3799		*)
3800		    SHLIB_CFLAGS="-fPIC"
3801		    ;;
3802	    esac
3803	fi
3804    fi
3805
3806    if test "$SHARED_LIB_SUFFIX" = "" ; then
3807	SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}'
3808    fi
3809    if test "$UNSHARED_LIB_SUFFIX" = "" ; then
3810	UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
3811    fi
3812
3813    if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then
3814        LIB_SUFFIX=${SHARED_LIB_SUFFIX}
3815        MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
3816        INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
3817    else
3818        LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
3819
3820        if test "$RANLIB" = "" ; then
3821            MAKE_LIB='$(STLIB_LD) $@ ${OBJS}'
3822            INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
3823        else
3824            MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@'
3825            INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))'
3826        fi
3827
3828    fi
3829
3830
3831    # Stub lib does not depend on shared/static configuration
3832    if test "$RANLIB" = "" ; then
3833        MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}'
3834        INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)'
3835    else
3836        MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@'
3837        INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))'
3838    fi
3839
3840
3841    
3842
3843    
3844    
3845    
3846    
3847    
3848    
3849    
3850
3851    
3852    
3853    
3854    
3855    
3856
3857    
3858    
3859    
3860    
3861    
3862    
3863    
3864
3865    
3866    
3867    
3868    
3869    
3870
3871
3872
3873    echo $ac_n "checking for build with symbols""... $ac_c" 1>&6
3874echo "configure:3875: checking for build with symbols" >&5
3875    # Check whether --enable-symbols or --disable-symbols was given.
3876if test "${enable_symbols+set}" = set; then
3877  enableval="$enable_symbols"
3878  tcl_ok=$enableval
3879else
3880  tcl_ok=no
3881fi
3882
3883# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
3884    if test "$tcl_ok" = "no"; then
3885	CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
3886	LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
3887	DBGX=""
3888	echo "$ac_t""no" 1>&6
3889    else
3890	CFLAGS_DEFAULT='$(CFLAGS_DEBUG)'
3891	LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
3892	DBGX=g
3893	if test "$tcl_ok" = "yes"; then
3894	    echo "$ac_t""yes (standard debugging)" 1>&6
3895	fi
3896    fi
3897    
3898    
3899
3900    if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
3901	cat >> confdefs.h <<\EOF
3902#define TCL_MEM_DEBUG 1
3903EOF
3904
3905    fi
3906
3907    if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
3908	cat >> confdefs.h <<\EOF
3909#define TCL_COMPILE_DEBUG 1
3910EOF
3911
3912	cat >> confdefs.h <<\EOF
3913#define TCL_COMPILE_STATS 1
3914EOF
3915
3916    fi
3917
3918    if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
3919	if test "$tcl_ok" = "all"; then
3920	    echo "$ac_t""enabled symbols mem compile debugging" 1>&6
3921	else
3922	    echo "$ac_t""enabled $tcl_ok debugging" 1>&6
3923	fi
3924    fi
3925
3926
3927TK_DBGX=${DBGX}
3928
3929#--------------------------------------------------------------------
3930#	Detect what compiler flags to set for 64-bit support.
3931#--------------------------------------------------------------------
3932
3933
3934    echo $ac_n "checking for required early compiler flags""... $ac_c" 1>&6
3935echo "configure:3936: checking for required early compiler flags" >&5
3936    tcl_flags=""
3937    
3938    if eval "test \"`echo '$''{'tcl_cv_flag__isoc99_source'+set}'`\" = set"; then
3939  echo $ac_n "(cached) $ac_c" 1>&6
3940else
3941  cat > conftest.$ac_ext <<EOF
3942#line 3943 "configure"
3943#include "confdefs.h"
3944#include <stdlib.h>
3945int main() {
3946char *p = (char *)strtoll; char *q = (char *)strtoull;
3947; return 0; }
3948EOF
3949if { (eval echo configure:3950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3950  rm -rf conftest*
3951  tcl_cv_flag__isoc99_source=no
3952else
3953  echo "configure: failed program was:" >&5
3954  cat conftest.$ac_ext >&5
3955  rm -rf conftest*
3956  cat > conftest.$ac_ext <<EOF
3957#line 3958 "configure"
3958#include "confdefs.h"
3959#define _ISOC99_SOURCE 1
3960#include <stdlib.h>
3961int main() {
3962char *p = (char *)strtoll; char *q = (char *)strtoull;
3963; return 0; }
3964EOF
3965if { (eval echo configure:3966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3966  rm -rf conftest*
3967  tcl_cv_flag__isoc99_source=yes
3968else
3969  echo "configure: failed program was:" >&5
3970  cat conftest.$ac_ext >&5
3971  rm -rf conftest*
3972  tcl_cv_flag__isoc99_source=no
3973fi
3974rm -f conftest*
3975fi
3976rm -f conftest*
3977fi
3978
3979    if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
3980	cat >> confdefs.h <<\EOF
3981#define _ISOC99_SOURCE 1
3982EOF
3983
3984	tcl_flags="$tcl_flags _ISOC99_SOURCE"
3985    fi
3986
3987    
3988    if eval "test \"`echo '$''{'tcl_cv_flag__largefile64_source'+set}'`\" = set"; then
3989  echo $ac_n "(cached) $ac_c" 1>&6
3990else
3991  cat > conftest.$ac_ext <<EOF
3992#line 3993 "configure"
3993#include "confdefs.h"
3994#include <sys/stat.h>
3995int main() {
3996struct stat64 buf; int i = stat64("/", &buf);
3997; return 0; }
3998EOF
3999if { (eval echo configure:4000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4000  rm -rf conftest*
4001  tcl_cv_flag__largefile64_source=no
4002else
4003  echo "configure: failed program was:" >&5
4004  cat conftest.$ac_ext >&5
4005  rm -rf conftest*
4006  cat > conftest.$ac_ext <<EOF
4007#line 4008 "configure"
4008#include "confdefs.h"
4009#define _LARGEFILE64_SOURCE 1
4010#include <sys/stat.h>
4011int main() {
4012struct stat64 buf; int i = stat64("/", &buf);
4013; return 0; }
4014EOF
4015if { (eval echo configure:4016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4016  rm -rf conftest*
4017  tcl_cv_flag__largefile64_source=yes
4018else
4019  echo "configure: failed program was:" >&5
4020  cat conftest.$ac_ext >&5
4021  rm -rf conftest*
4022  tcl_cv_flag__largefile64_source=no
4023fi
4024rm -f conftest*
4025fi
4026rm -f conftest*
4027fi
4028
4029    if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
4030	cat >> confdefs.h <<\EOF
4031#define _LARGEFILE64_SOURCE 1
4032EOF
4033
4034	tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
4035    fi
4036
4037    
4038    if eval "test \"`echo '$''{'tcl_cv_flag__largefile_source64'+set}'`\" = set"; then
4039  echo $ac_n "(cached) $ac_c" 1>&6
4040else
4041  cat > conftest.$ac_ext <<EOF
4042#line 4043 "configure"
4043#include "confdefs.h"
4044#include <sys/stat.h>
4045int main() {
4046char *p = (char *)open64;
4047; return 0; }
4048EOF
4049if { (eval echo configure:4050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4050  rm -rf conftest*
4051  tcl_cv_flag__largefile_source64=no
4052else
4053  echo "configure: failed program was:" >&5
4054  cat conftest.$ac_ext >&5
4055  rm -rf conftest*
4056  cat > conftest.$ac_ext <<EOF
4057#line 4058 "configure"
4058#include "confdefs.h"
4059#define _LARGEFILE_SOURCE64 1
4060#include <sys/stat.h>
4061int main() {
4062char *p = (char *)open64;
4063; return 0; }
4064EOF
4065if { (eval echo configure:4066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4066  rm -rf conftest*
4067  tcl_cv_flag__largefile_source64=yes
4068else
4069  echo "configure: failed program was:" >&5
4070  cat conftest.$ac_ext >&5
4071  rm -rf conftest*
4072  tcl_cv_flag__largefile_source64=no
4073fi
4074rm -f conftest*
4075fi
4076rm -f conftest*
4077fi
4078
4079    if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then
4080	cat >> confdefs.h <<\EOF
4081#define _LARGEFILE_SOURCE64 1
4082EOF
4083
4084	tcl_flags="$tcl_flags _LARGEFILE_SOURCE64"
4085    fi
4086
4087    if test "x${tcl_flags}" = "x" ; then
4088	echo "$ac_t""none" 1>&6
4089    else
4090	echo "$ac_t""${tcl_flags}" 1>&6
4091    fi
4092
4093
4094
4095    echo $ac_n "checking for 64-bit integer type""... $ac_c" 1>&6
4096echo "configure:4097: checking for 64-bit integer type" >&5
4097    if eval "test \"`echo '$''{'tcl_cv_type_64bit'+set}'`\" = set"; then
4098  echo $ac_n "(cached) $ac_c" 1>&6
4099else
4100  
4101	tcl_cv_type_64bit=none
4102	# See if the compiler knows natively about __int64
4103	cat > conftest.$ac_ext <<EOF
4104#line 4105 "configure"
4105#include "confdefs.h"
4106
4107int main() {
4108__int64 value = (__int64) 0;
4109; return 0; }
4110EOF
4111if { (eval echo configure:4112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4112  rm -rf conftest*
4113  tcl_type_64bit=__int64
4114else
4115  echo "configure: failed program was:" >&5
4116  cat conftest.$ac_ext >&5
4117  rm -rf conftest*
4118  tcl_type_64bit="long long"
4119fi
4120rm -f conftest*
4121	# See if we should use long anyway  Note that we substitute in the
4122	# type that is our current guess for a 64-bit type inside this check
4123	# program, so it should be modified only carefully...
4124        cat > conftest.$ac_ext <<EOF
4125#line 4126 "configure"
4126#include "confdefs.h"
4127
4128int main() {
4129switch (0) { 
4130            case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; 
4131        }
4132; return 0; }
4133EOF
4134if { (eval echo configure:4135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4135  rm -rf conftest*
4136  tcl_cv_type_64bit=${tcl_type_64bit}
4137else
4138  echo "configure: failed program was:" >&5
4139  cat conftest.$ac_ext >&5
4140fi
4141rm -f conftest*
4142fi
4143
4144    if test "${tcl_cv_type_64bit}" = none ; then
4145	cat >> confdefs.h <<\EOF
4146#define TCL_WIDE_INT_IS_LONG 1
4147EOF
4148
4149	echo "$ac_t""using long" 1>&6
4150    else
4151	cat >> confdefs.h <<EOF
4152#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}
4153EOF
4154
4155	echo "$ac_t""${tcl_cv_type_64bit}" 1>&6
4156
4157	# Now check for auxiliary declarations
4158	echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6
4159echo "configure:4160: checking for struct dirent64" >&5
4160if eval "test \"`echo '$''{'tcl_cv_struct_dirent64'+set}'`\" = set"; then
4161  echo $ac_n "(cached) $ac_c" 1>&6
4162else
4163  
4164	    cat > conftest.$ac_ext <<EOF
4165#line 4166 "configure"
4166#include "confdefs.h"
4167#include <sys/types.h>
4168#include <sys/dirent.h>
4169int main() {
4170struct dirent64 p;
4171; return 0; }
4172EOF
4173if { (eval echo configure:4174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4174  rm -rf conftest*
4175  tcl_cv_struct_dirent64=yes
4176else
4177  echo "configure: failed program was:" >&5
4178  cat conftest.$ac_ext >&5
4179  rm -rf conftest*
4180  tcl_cv_struct_dirent64=no
4181fi
4182rm -f conftest*
4183fi
4184
4185echo "$ac_t""$tcl_cv_struct_dirent64" 1>&6
4186	if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
4187	    cat >> confdefs.h <<\EOF
4188#define HAVE_STRUCT_DIRENT64 1
4189EOF
4190
4191	fi
4192
4193	echo $ac_n "checking for struct stat64""... $ac_c" 1>&6
4194echo "configure:4195: checking for struct stat64" >&5
4195if eval "test \"`echo '$''{'tcl_cv_struct_stat64'+set}'`\" = set"; then
4196  echo $ac_n "(cached) $ac_c" 1>&6
4197else
4198  
4199	    cat > conftest.$ac_ext <<EOF
4200#line 4201 "configure"
4201#include "confdefs.h"
4202#include <sys/stat.h>
4203int main() {
4204struct stat64 p;
4205
4206; return 0; }
4207EOF
4208if { (eval echo configure:4209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4209  rm -rf conftest*
4210  tcl_cv_struct_stat64=yes
4211else
4212  echo "configure: failed program was:" >&5
4213  cat conftest.$ac_ext >&5
4214  rm -rf conftest*
4215  tcl_cv_struct_stat64=no
4216fi
4217rm -f conftest*
4218fi
4219
4220echo "$ac_t""$tcl_cv_struct_stat64" 1>&6
4221	if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
4222	    cat >> confdefs.h <<\EOF
4223#define HAVE_STRUCT_STAT64 1
4224EOF
4225
4226	fi
4227
4228	for ac_func in open64 lseek64
4229do
4230echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4231echo "configure:4232: checking for $ac_func" >&5
4232if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4233  echo $ac_n "(cached) $ac_c" 1>&6
4234else
4235  cat > conftest.$ac_ext <<EOF
4236#line 4237 "configure"
4237#include "confdefs.h"
4238/* System header to define __stub macros and hopefully few prototypes,
4239    which can conflict with char $ac_func(); below.  */
4240#include <assert.h>
4241/* Override any gcc2 internal prototype to avoid an error.  */
4242/* We use char because int might match the return type of a gcc2
4243    builtin and then its argument prototype would still apply.  */
4244char $ac_func();
4245
4246int main() {
4247
4248/* The GNU C library defines this for functions which it implements
4249    to always fail with ENOSYS.  Some functions are actually named
4250    something starting with __ and the normal name is an alias.  */
4251#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4252choke me
4253#else
4254$ac_func();
4255#endif
4256
4257; return 0; }
4258EOF
4259if { (eval echo configure:4260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4260  rm -rf conftest*
4261  eval "ac_cv_func_$ac_func=yes"
4262else
4263  echo "configure: failed program was:" >&5
4264  cat conftest.$ac_ext >&5
4265  rm -rf conftest*
4266  eval "ac_cv_func_$ac_func=no"
4267fi
4268rm -f conftest*
4269fi
4270
4271if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4272  echo "$ac_t""yes" 1>&6
4273    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4274  cat >> confdefs.h <<EOF
4275#define $ac_tr_func 1
4276EOF
4277 
4278else
4279  echo "$ac_t""no" 1>&6
4280fi
4281done
4282
4283	echo $ac_n "checking for off64_t""... $ac_c" 1>&6
4284echo "configure:4285: checking for off64_t" >&5
4285	if eval "test \"`echo '$''{'tcl_cv_type_off64_t'+set}'`\" = set"; then
4286  echo $ac_n "(cached) $ac_c" 1>&6
4287else
4288  
4289	    cat > conftest.$ac_ext <<EOF
4290#line 4291 "configure"
4291#include "confdefs.h"
4292#include <sys/types.h>
4293int main() {
4294off64_t offset;
4295
4296; return 0; }
4297EOF
4298if { (eval echo configure:4299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4299  rm -rf conftest*
4300  tcl_cv_type_off64_t=yes
4301else
4302  echo "configure: failed program was:" >&5
4303  cat conftest.$ac_ext >&5
4304  rm -rf conftest*
4305  tcl_cv_type_off64_t=no
4306fi
4307rm -f conftest*
4308fi
4309
4310			if test "x${tcl_cv_type_off64_t}" = "xyes" && \
4311	        test "x${ac_cv_func_lseek64}" = "xyes" && \
4312	        test "x${ac_cv_func_open64}" = "xyes" ; then
4313	    cat >> confdefs.h <<\EOF
4314#define HAVE_TYPE_OFF64_T 1
4315EOF
4316
4317	    echo "$ac_t""yes" 1>&6
4318	else
4319	    echo "$ac_t""no" 1>&6
4320	fi
4321    fi
4322
4323
4324#--------------------------------------------------------------------
4325#	Check endianness because we can optimize some operations
4326#--------------------------------------------------------------------
4327
4328echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4329echo "configure:4330: checking whether byte ordering is bigendian" >&5
4330if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
4331  echo $ac_n "(cached) $ac_c" 1>&6
4332else
4333  ac_cv_c_bigendian=unknown
4334# See if sys/param.h defines the BYTE_ORDER macro.
4335cat > conftest.$ac_ext <<EOF
4336#line 4337 "configure"
4337#include "confdefs.h"
4338#include <sys/types.h>
4339#include <sys/param.h>
4340int main() {
4341
4342#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4343 bogus endian macros
4344#endif
4345; return 0; }
4346EOF
4347if { (eval echo configure:4348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4348  rm -rf conftest*
4349  # It does; now see whether it defined to BIG_ENDIAN or not.
4350cat > conftest.$ac_ext <<EOF
4351#line 4352 "configure"
4352#include "confdefs.h"
4353#include <sys/types.h>
4354#include <sys/param.h>
4355int main() {
4356
4357#if BYTE_ORDER != BIG_ENDIAN
4358 not big endian
4359#endif
4360; return 0; }
4361EOF
4362if { (eval echo configure:4363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4363  rm -rf conftest*
4364  ac_cv_c_bigendian=yes
4365else
4366  echo "configure: failed program was:" >&5
4367  cat conftest.$ac_ext >&5
4368  rm -rf conftest*
4369  ac_cv_c_bigendian=no
4370fi
4371rm -f conftest*
4372else
4373  echo "configure: failed program was:" >&5
4374  cat conftest.$ac_ext >&5
4375fi
4376rm -f conftest*
4377if test $ac_cv_c_bigendian = unknown; then
4378if test "$cross_compiling" = yes; then
4379    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
4380else
4381  cat > conftest.$ac_ext <<EOF
4382#line 4383 "configure"
4383#include "confdefs.h"
4384main () {
4385  /* Are we little or big endian?  From Harbison&Steele.  */
4386  union
4387  {
4388    long l;
4389    char c[sizeof (long)];
4390  } u;
4391  u.l = 1;
4392  exit (u.c[sizeof (long) - 1] == 1);
4393}
4394EOF
4395if { (eval echo configure:4396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4396then
4397  ac_cv_c_bigendian=no
4398else
4399  echo "configure: failed program was:" >&5
4400  cat conftest.$ac_ext >&5
4401  rm -fr conftest*
4402  ac_cv_c_bigendian=yes
4403fi
4404rm -fr conftest*
4405fi
4406
4407fi
4408fi
4409
4410echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4411if test $ac_cv_c_bigendian = yes; then
4412  cat >> confdefs.h <<\EOF
4413#define WORDS_BIGENDIAN 1
4414EOF
4415
4416fi
4417
4418
4419#------------------------------------------------------------------------
4420# If Tcl and Tk are installed in different places, adjust the library
4421# search path to reflect this.
4422#------------------------------------------------------------------------
4423
4424LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'
4425
4426if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then
4427    LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}/lib"
4428fi
4429
4430if test "$TCL_PREFIX" != "$prefix"; then
4431    echo "configure: warning: 
4432        Different --prefix selected for Tk and Tcl!
4433        [package require Tk] may not work correctly in tclsh." 1>&2
4434fi
4435
4436#--------------------------------------------------------------------
4437#	Include sys/select.h if it exists and if it supplies things
4438#	that appear to be useful and aren't already in sys/types.h.
4439#	This appears to be true only on the RS/6000 under AIX.  Some
4440#	systems like OSF/1 have a sys/select.h that's of no use, and
4441#	other systems like SCO UNIX have a sys/select.h that's
4442#	pernicious.  If "fd_set" isn't defined anywhere then set a
4443#	special flag.
4444#--------------------------------------------------------------------
4445
4446echo $ac_n "checking for fd_set in sys/types""... $ac_c" 1>&6
4447echo "configure:4448: checking for fd_set in sys/types" >&5
4448if eval "test \"`echo '$''{'tcl_cv_type_fd_set'+set}'`\" = set"; then
4449  echo $ac_n "(cached) $ac_c" 1>&6
4450else
4451  
4452    cat > conftest.$ac_ext <<EOF
4453#line 4454 "configure"
4454#include "confdefs.h"
4455#include <sys/types.h>
4456int main() {
4457fd_set readMask, writeMask;
4458; return 0; }
4459EOF
4460if { (eval echo configure:4461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4461  rm -rf conftest*
4462  tcl_cv_type_fd_set=yes
4463else
4464  echo "configure: failed program was:" >&5
4465  cat conftest.$ac_ext >&5
4466  rm -rf conftest*
4467  tcl_cv_type_fd_set=no
4468fi
4469rm -f conftest*
4470fi
4471
4472echo "$ac_t""$tcl_cv_type_fd_set" 1>&6
4473tk_ok=$tcl_cv_type_fd_set
4474if test $tk_ok = no; then
4475    echo $ac_n "checking for fd_mask in sys/select""... $ac_c" 1>&6
4476echo "configure:4477: checking for fd_mask in sys/select" >&5
4477if eval "test \"`echo '$''{'tcl_cv_grep_fd_mask'+set}'`\" = set"; then
4478  echo $ac_n "(cached) $ac_c" 1>&6
4479else
4480  
4481	cat > conftest.$ac_ext <<EOF
4482#line 4483 "configure"
4483#include "confdefs.h"
4484#include <sys/select.h>
4485EOF
4486if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4487  egrep "fd_mask" >/dev/null 2>&1; then
4488  rm -rf conftest*
4489  tcl_cv_grep_fd_mask=present
4490else
4491  rm -rf conftest*
4492  tcl_cv_grep_fd_mask=missing
4493fi
4494rm -f conftest*
4495
4496fi
4497
4498echo "$ac_t""$tcl_cv_grep_fd_mask" 1>&6
4499    if test $tcl_cv_grep_fd_mask = present; then
4500	cat >> confdefs.h <<\EOF
4501#define HAVE_SYS_SELECT_H 1
4502EOF
4503
4504	tk_ok=yes
4505    fi
4506fi
4507if test $tk_ok = no; then
4508    cat >> confdefs.h <<\EOF
4509#define NO_FD_SET 1
4510EOF
4511
4512fi
4513
4514#------------------------------------------------------------------------------
4515#       Find out all about time handling differences.
4516#------------------------------------------------------------------------------
4517
4518for ac_hdr in sys/time.h
4519do
4520ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4521echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4522echo "configure:4523: checking for $ac_hdr" >&5
4523if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4524  echo $ac_n "(cached) $ac_c" 1>&6
4525else
4526  cat > conftest.$ac_ext <<EOF
4527#line 4528 "configure"
4528#include "confdefs.h"
4529#include <$ac_hdr>
4530EOF
4531ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4532{ (eval echo configure:4533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4533ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4534if test -z "$ac_err"; then
4535  rm -rf conftest*
4536  eval "ac_cv_header_$ac_safe=yes"
4537else
4538  echo "$ac_err" >&5
4539  echo "configure: failed program was:" >&5
4540  cat conftest.$ac_ext >&5
4541  rm -rf conftest*
4542  eval "ac_cv_header_$ac_safe=no"
4543fi
4544rm -f conftest*
4545fi
4546if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4547  echo "$ac_t""yes" 1>&6
4548    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4549  cat >> confdefs.h <<EOF
4550#define $ac_tr_hdr 1
4551EOF
4552 
4553else
4554  echo "$ac_t""no" 1>&6
4555fi
4556done
4557
4558echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
4559echo "configure:4560: checking whether time.h and sys/time.h may both be included" >&5
4560if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
4561  echo $ac_n "(cached) $ac_c" 1>&6
4562else
4563  cat > conftest.$ac_ext <<EOF
4564#line 4565 "configure"
4565#include "confdefs.h"
4566#include <sys/types.h>
4567#include <sys/time.h>
4568#include <time.h>
4569int main() {
4570struct tm *tp;
4571; return 0; }
4572EOF
4573if { (eval echo configure:4574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4574  rm -rf conftest*
4575  ac_cv_header_time=yes
4576else
4577  echo "configure: failed program was:" >&5
4578  cat conftest.$ac_ext >&5
4579  rm -rf conftest*
4580  ac_cv_header_time=no
4581fi
4582rm -f conftest*
4583fi
4584
4585echo "$ac_t""$ac_cv_header_time" 1>&6
4586if test $ac_cv_header_time = yes; then
4587  cat >> confdefs.h <<\EOF
4588#define TIME_WITH_SYS_TIME 1
4589EOF
4590
4591fi
4592
4593
4594#--------------------------------------------------------------------
4595#	Under Solaris 2.4, strtod returns the wrong value for the
4596#	terminating character under some conditions.  Check for this
4597#	and if the problem exists use a substitute procedure
4598#	"fixstrtod" (provided by Tcl) that corrects the error.
4599#--------------------------------------------------------------------
4600
4601
4602    echo $ac_n "checking for strtod""... $ac_c" 1>&6
4603echo "configure:4604: checking for strtod" >&5
4604if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then
4605  echo $ac_n "(cached) $ac_c" 1>&6
4606else
4607  cat > conftest.$ac_ext <<EOF
4608#line 4609 "configure"
4609#include "confdefs.h"
4610/* System header to define __stub macros and hopefully few prototypes,
4611    which can conflict with char strtod(); below.  */
4612#include <assert.h>
4613/* Override any gcc2 internal prototype to avoid an error.  */
4614/* We use char because int might match the return type of a gcc2
4615    builtin and then its argument prototype would still apply.  */
4616char strtod();
4617
4618int main() {
4619
4620/* The GNU C library defines this for functions which it implements
4621    to always fail with ENOSYS.  Some functions are actually named
4622    something starting with __ and the normal name is an alias.  */
4623#if defined (__stub_strtod) || defined (__stub___strtod)
4624choke me
4625#else
4626strtod();
4627#endif
4628
4629; return 0; }
4630EOF
4631if { (eval echo configure:4632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4632  rm -rf conftest*
4633  eval "ac_cv_func_strtod=yes"
4634else
4635  echo "configure: failed program was:" >&5
4636  cat conftest.$ac_ext >&5
4637  rm -rf conftest*
4638  eval "ac_cv_func_strtod=no"
4639fi
4640rm -f conftest*
4641fi
4642
4643if eval "test \"`echo '$ac_cv_func_'strtod`\" = yes"; then
4644  echo "$ac_t""yes" 1>&6
4645  tcl_strtod=1
4646else
4647  echo "$ac_t""no" 1>&6
4648tcl_strtod=0
4649fi
4650
4651    if test "$tcl_strtod" = 1; then
4652	echo $ac_n "checking for Solaris2.4/Tru64 strtod bugs""... $ac_c" 1>&6
4653echo "configure:4654: checking for Solaris2.4/Tru64 strtod bugs" >&5
4654if eval "test \"`echo '$''{'tcl_cv_strtod_buggy'+set}'`\" = set"; then
4655  echo $ac_n "(cached) $ac_c" 1>&6
4656else
4657  
4658	    if test "$cross_compiling" = yes; then
4659  tcl_cv_strtod_buggy=buggy
4660else
4661  cat > conftest.$ac_ext <<EOF
4662#line 4663 "configure"
4663#include "confdefs.h"
4664
4665		extern double strtod();
4666		int main() {
4667		    char *infString="Inf", *nanString="NaN", *spaceString=" ";
4668		    char *term;
4669		    double value;
4670		    value = strtod(infString, &term);
4671		    if ((term != infString) && (term[-1] == 0)) {
4672			exit(1);
4673		    }
4674		    value = strtod(nanString, &term);
4675		    if ((term != nanString) && (term[-1] == 0)) {
4676			exit(1);
4677		    }
4678		    value = strtod(spaceString, &term);
4679		    if (term == (spaceString+1)) {
4680			exit(1);
4681		    }
4682		    exit(0);
4683		}
4684EOF
4685if { (eval echo configure:4686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4686then
4687  tcl_cv_strtod_buggy=ok
4688else
4689  echo "configure: failed program was:" >&5
4690  cat conftest.$ac_ext >&5
4691  rm -fr conftest*
4692  tcl_cv_strtod_buggy=buggy
4693fi
4694rm -fr conftest*
4695fi
4696
4697fi
4698
4699echo "$ac_t""$tcl_cv_strtod_buggy" 1>&6
4700	if test "$tcl_cv_strtod_buggy" = buggy; then
4701	    LIBOBJS="$LIBOBJS fixstrtod.o"
4702	    cat >> confdefs.h <<\EOF
4703#define strtod fixstrtod
4704EOF
4705
4706	fi
4707    fi
4708
4709
4710#--------------------------------------------------------------------
4711#	Check for various typedefs and provide substitutes if
4712#	they don't exist.
4713#--------------------------------------------------------------------
4714
4715echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4716echo "configure:4717: checking for ANSI C header files" >&5
4717if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
4718  echo $ac_n "(cached) $ac_c" 1>&6
4719else
4720  cat > conftest.$ac_ext <<EOF
4721#line 4722 "configure"
4722#include "confdefs.h"
4723#include <stdlib.h>
4724#include <stdarg.h>
4725#include <string.h>
4726#include <float.h>
4727EOF
4728ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4729{ (eval echo configure:4730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4730ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4731if test -z "$ac_err"; then
4732  rm -rf conftest*
4733  ac_cv_header_stdc=yes
4734else
4735  echo "$ac_err" >&5
4736  echo "configure: failed program was:" >&5
4737  cat conftest.$ac_ext >&5
4738  rm -rf conftest*
4739  ac_cv_header_stdc=no
4740fi
4741rm -f conftest*
4742
4743if test $ac_cv_header_stdc = yes; then
4744  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4745cat > conftest.$ac_ext <<EOF
4746#line 4747 "configure"
4747#include "confdefs.h"
4748#include <string.h>
4749EOF
4750if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4751  egrep "memchr" >/dev/null 2>&1; then
4752  :
4753else
4754  rm -rf conftest*
4755  ac_cv_header_stdc=no
4756fi
4757rm -f conftest*
4758
4759fi
4760
4761if test $ac_cv_header_stdc = yes; then
4762  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4763cat > conftest.$ac_ext <<EOF
4764#line 4765 "configure"
4765#include "confdefs.h"
4766#include <stdlib.h>
4767EOF
4768if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4769  egrep "free" >/dev/null 2>&1; then
4770  :
4771else
4772  rm -rf conftest*
4773  ac_cv_header_stdc=no
4774fi
4775rm -f conftest*
4776
4777fi
4778
4779if test $ac_cv_header_stdc = yes; then
4780  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4781if test "$cross_compiling" = yes; then
4782  :
4783else
4784  cat > conftest.$ac_ext <<EOF
4785#line 4786 "configure"
4786#include "confdefs.h"
4787#include <ctype.h>
4788#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4789#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4790#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4791int main () { int i; for (i = 0; i < 256; i++)
4792if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4793exit (0); }
4794
4795EOF
4796if { (eval echo configure:4797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4797then
4798  :
4799else
4800  echo "configure: failed program was:" >&5
4801  cat conftest.$ac_ext >&5
4802  rm -fr conftest*
4803  ac_cv_header_stdc=no
4804fi
4805rm -fr conftest*
4806fi
4807
4808fi
4809fi
4810
4811echo "$ac_t""$ac_cv_header_stdc" 1>&6
4812if test $ac_cv_header_stdc = yes; then
4813  cat >> confdefs.h <<\EOF
4814#define STDC_HEADERS 1
4815EOF
4816
4817fi
4818
4819echo $ac_n "checking for mode_t""... $ac_c" 1>&6
4820echo "configure:4821: checking for mode_t" >&5
4821if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
4822  echo $ac_n "(cached) $ac_c" 1>&6
4823else
4824  cat > conftest.$ac_ext <<EOF
4825#line 4826 "configure"
4826#include "confdefs.h"
4827#include <sys/types.h>
4828#if STDC_HEADERS
4829#include <stdlib.h>
4830#include <stddef.h>
4831#endif
4832EOF
4833if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4834  egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
4835  rm -rf conftest*
4836  ac_cv_type_mode_t=yes
4837else
4838  rm -rf conftest*
4839  ac_cv_type_mode_t=no
4840fi
4841rm -f conftest*
4842
4843fi
4844echo "$ac_t""$ac_cv_type_mode_t" 1>&6
4845if test $ac_cv_type_mode_t = no; then
4846  cat >> confdefs.h <<\EOF
4847#define mode_t int
4848EOF
4849
4850fi
4851
4852echo $ac_n "checking for pid_t""... $ac_c" 1>&6
4853echo "configure:4854: checking for pid_t" >&5
4854if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
4855  echo $ac_n "(cached) $ac_c" 1>&6
4856else
4857  cat > conftest.$ac_ext <<EOF
4858#line 4859 "configure"
4859#include "confdefs.h"
4860#include <sys/types.h>
4861#if STDC_HEADERS
4862#include <stdlib.h>
4863#include <stddef.h>
4864#endif
4865EOF
4866if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4867  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
4868  rm -rf conftest*
4869  ac_cv_type_pid_t=yes
4870else
4871  rm -rf conftest*
4872  ac_cv_type_pid_t=no
4873fi
4874rm -f conftest*
4875
4876fi
4877echo "$ac_t""$ac_cv_type_pid_t" 1>&6
4878if test $ac_cv_type_pid_t = no; then
4879  cat >> confdefs.h <<\EOF
4880#define pid_t int
4881EOF
4882
4883fi
4884
4885echo $ac_n "checking for size_t""... $ac_c" 1>&6
4886echo "configure:4887: checking for size_t" >&5
4887if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
4888  echo $ac_n "(cached) $ac_c" 1>&6
4889else
4890  cat > conftest.$ac_ext <<EOF
4891#line 4892 "configure"
4892#include "confdefs.h"
4893#include <sys/types.h>
4894#if STDC_HEADERS
4895#include <stdlib.h>
4896#include <stddef.h>
4897#endif
4898EOF
4899if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4900  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
4901  rm -rf conftest*
4902  ac_cv_type_size_t=yes
4903else
4904  rm -rf conftest*
4905  ac_cv_type_size_t=no
4906fi
4907rm -f conftest*
4908
4909fi
4910echo "$ac_t""$ac_cv_type_size_t" 1>&6
4911if test $ac_cv_type_size_t = no; then
4912  cat >> confdefs.h <<\EOF
4913#define size_t unsigned
4914EOF
4915
4916fi
4917
4918echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
4919echo "configure:4920: checking for uid_t in sys/types.h" >&5
4920if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
4921  echo $ac_n "(cached) $ac_c" 1>&6
4922else
4923  cat > conftest.$ac_ext <<EOF
4924#line 4925 "configure"
4925#include "confdefs.h"
4926#include <sys/types.h>
4927EOF
4928if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4929  egrep "uid_t" >/dev/null 2>&1; then
4930  rm -rf conftest*
4931  ac_cv_type_uid_t=yes
4932else
4933  rm -rf conftest*
4934  ac_cv_type_uid_t=no
4935fi
4936rm -f conftest*
4937
4938fi
4939
4940echo "$ac_t""$ac_cv_type_uid_t" 1>&6
4941if test $ac_cv_type_uid_t = no; then
4942  cat >> confdefs.h <<\EOF
4943#define uid_t int
4944EOF
4945
4946  cat >> confdefs.h <<\EOF
4947#define gid_t int
4948EOF
4949
4950fi
4951
4952
4953#-------------------------------------------
4954#     In OS/390 struct pwd has no pw_gecos field
4955#-------------------------------------------
4956
4957echo $ac_n "checking pw_gecos in struct pwd""... $ac_c" 1>&6
4958echo "configure:4959: checking pw_gecos in struct pwd" >&5
4959if eval "test \"`echo '$''{'tcl_cv_pwd_pw_gecos'+set}'`\" = set"; then
4960  echo $ac_n "(cached) $ac_c" 1>&6
4961else
4962  
4963    cat > conftest.$ac_ext <<EOF
4964#line 4965 "configure"
4965#include "confdefs.h"
4966#include <pwd.h>
4967int main() {
4968struct passwd pwd; pwd.pw_gecos;
4969; return 0; }
4970EOF
4971if { (eval echo configure:4972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4972  rm -rf conftest*
4973  tcl_cv_pwd_pw_gecos=yes
4974else
4975  echo "configure: failed program was:" >&5
4976  cat conftest.$ac_ext >&5
4977  rm -rf conftest*
4978  tcl_cv_pwd_pw_gecos=no
4979fi
4980rm -f conftest*
4981fi
4982
4983echo "$ac_t""$tcl_cv_pwd_pw_gecos" 1>&6
4984if test $tcl_cv_pwd_pw_gecos = yes; then
4985    cat >> confdefs.h <<\EOF
4986#define HAVE_PW_GECOS 1
4987EOF
4988
4989fi
4990
4991#--------------------------------------------------------------------
4992#	On Mac OS X, we can build either with X11 or with Aqua
4993#--------------------------------------------------------------------
4994
4995if test "`uname -s`" = "Darwin" ; then
4996    echo $ac_n "checking whether to use Aqua""... $ac_c" 1>&6
4997echo "configure:4998: checking whether to use Aqua" >&5
4998    # Check whether --enable-aqua or --disable-aqua was given.
4999if test "${enable_aqua+set}" = set; then
5000  enableval="$enable_aqua"
5001  tk_aqua=$enableval
5002else
5003  tk_aqua=no
5004fi
5005
5006    if test $tk_aqua = yes; then
5007	if test $tcl_corefoundation = no; then
5008	    echo "configure: warning: Aqua can only be used when CoreFoundation is available" 1>&2
5009	    tk_aqua=no
5010	fi
5011	if test ! -d /System/Library/Frameworks/Carbon.framework; then
5012	    echo "configure: warning: Aqua can only be used when Carbon is available" 1>&2
5013	    tk_aqua=no
5014	fi
5015	if test "`uname -r | awk -F. '{print $1}'`" -lt 6; then
5016	    echo "configure: warning: Aqua requires Mac OS X 10.2 or later" 1>&2
5017	    tk_aqua=no
5018	fi
5019    fi
5020    echo "$ac_t""$tk_aqua" 1>&6
5021    if test "$fat_32_64" = yes; then
5022	if test $tk_aqua = no; then
5023	    echo $ac_n "checking for 64-bit X11""... $ac_c" 1>&6
5024echo "configure:5025: checking for 64-bit X11" >&5
5025if eval "test \"`echo '$''{'tcl_cv_lib_x11_64'+set}'`\" = set"; then
5026  echo $ac_n "(cached) $ac_c" 1>&6
5027else
5028  
5029		for v in CFLAGS CPPFLAGS LDFLAGS; do
5030		    eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
5031		done
5032		CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
5033		LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
5034		cat > conftest.$ac_ext <<EOF
5035#line 5036 "configure"
5036#include "confdefs.h"
5037#include <X11/Xlib.h>
5038int main() {
5039XrmInitialize();
5040; return 0; }
5041EOF
5042if { (eval echo configure:5043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5043  rm -rf conftest*
5044  tcl_cv_lib_x11_64=yes
5045else
5046  echo "configure: failed program was:" >&5
5047  cat conftest.$ac_ext >&5
5048  rm -rf conftest*
5049  tcl_cv_lib_x11_64=no
5050fi
5051rm -f conftest*
5052		for v in CFLAGS CPPFLAGS LDFLAGS; do
5053		    eval $v'="$hold_'$v'"'
5054		done
5055fi
5056
5057echo "$ac_t""$tcl_cv_lib_x11_64" 1>&6
5058	fi
5059	# remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit
5060	# fat builds if configuration does not support 64-bit.
5061	if test $tk_aqua = yes -o "$tcl_cv_lib_x11_64" = no; then
5062	    echo "configure: warning: Removing 64-bit architectures from compiler & linker flags" 1>&2
5063	    for v in CFLAGS CPPFLAGS LDFLAGS; do
5064		eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
5065	    done
5066	fi
5067    fi
5068else
5069    tk_aqua=no
5070fi
5071
5072if test $tk_aqua = yes; then
5073    cat >> confdefs.h <<\EOF
5074#define MAC_OSX_TK 1
5075EOF
5076
5077    LIBS="$LIBS -framework Carbon"
5078    CFLAGS="$CFLAGS -fpascal-strings"
5079    TK_WINDOWINGSYSTEM=AQUA
5080    if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then
5081        cat >> confdefs.h <<\EOF
5082#define TK_MAC_DEBUG 1
5083EOF
5084
5085    fi
5086else
5087    #--------------------------------------------------------------------
5088    #	Locate the X11 header files and the X11 library archive.  Try
5089    #	the ac_path_x macro first, but if it doesn't find the X stuff
5090    #	(e.g. because there's no xmkmf program) then check through
5091    #	a list of possible directories.  Under some conditions the
5092    #	autoconf macro will return an include directory that contains
5093    #	no include files, so double-check its result just to be safe.
5094    #--------------------------------------------------------------------
5095    
5096    
5097    # If we find X, set shell vars x_includes and x_libraries to the
5098# paths, otherwise set no_x=yes.
5099# Uses ac_ vars as temps to allow command line to override cache and checks.
5100# --without-x overrides everything else, but does not touch the cache.
5101echo $ac_n "checking for X""... $ac_c" 1>&6
5102echo "configure:5103: checking for X" >&5
5103
5104# Check whether --with-x or --without-x was given.
5105if test "${with_x+set}" = set; then
5106  withval="$with_x"
5107  :
5108fi
5109
5110# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
5111if test "x$with_x" = xno; then
5112  # The user explicitly disabled X.
5113  have_x=disabled
5114else
5115  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
5116    # Both variables are already set.
5117    have_x=yes
5118  else
5119if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
5120  echo $ac_n "(cached) $ac_c" 1>&6
5121else
5122  # One or both of the vars are not set, and there is no cached value.
5123ac_x_includes=NO ac_x_libraries=NO
5124rm -fr conftestdir
5125if mkdir conftestdir; then
5126  cd conftestdir
5127  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
5128  cat > Imakefile <<'EOF'
5129acfindx:
5130	@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
5131EOF
5132  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5133    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5134    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
5135    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
5136    for ac_extension in a so sl; do
5137      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
5138        test -f $ac_im_libdir/libX11.$ac_extension; then
5139        ac_im_usrlibdir=$ac_im_libdir; break
5140      fi
5141    done
5142    # Screen out bogus values from the imake configuration.  They are
5143    # bogus both because they are the default anyway, and because
5144    # using them would break gcc on systems where it needs fixed includes.
5145    case "$ac_im_incroot" in
5146	/usr/include) ;;
5147	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
5148    esac
5149    case "$ac_im_usrlibdir" in
5150	/usr/lib | /lib) ;;
5151	*) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
5152    esac
5153  fi
5154  cd ..
5155  rm -fr conftestdir
5156fi
5157
5158if test "$ac_x_includes" = NO; then
5159  # Guess where to find include files, by looking for this one X11 .h file.
5160  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
5161
5162  # First, try using that file with no special directory specified.
5163cat > conftest.$ac_ext <<EOF
5164#line 5165 "configure"
5165#include "confdefs.h"
5166#include <$x_direct_test_include>
5167EOF
5168ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5169{ (eval echo configure:5170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5170ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5171if test -z "$ac_err"; then
5172  rm -rf conftest*
5173  # We can compile using X headers with no special include directory.
5174ac_x_includes=
5175else
5176  echo "$ac_err" >&5
5177  echo "configure: failed program was:" >&5
5178  cat conftest.$ac_ext >&5
5179  rm -rf conftest*
5180  # Look for the header file in a standard set of common directories.
5181# Check X11 before X11Rn because it is often a symlink to the current release.
5182  for ac_dir in               \
5183    /usr/X11/include          \
5184    /usr/X11R6/include        \
5185    /usr/X11R5/include        \
5186    /usr/X11R4/include        \
5187                              \
5188    /usr/include/X11          \
5189    /usr/include/X11R6        \
5190    /usr/include/X11R5        \
5191    /usr/include/X11R4        \
5192                              \
5193    /usr/local/X11/include    \
5194    /usr/local/X11R6/include  \
5195    /usr/local/X11R5/include  \
5196    /usr/local/X11R4/include  \
5197                              \
5198    /usr/local/include/X11    \
5199    /usr/local/include/X11R6  \
5200    /usr/local/include/X11R5  \
5201    /usr/local/include/X11R4  \
5202                              \
5203    /usr/X386/include         \
5204    /usr/x386/include         \
5205    /usr/XFree86/include/X11  \
5206                              \
5207    /usr/include              \
5208    /usr/local/include        \
5209    /usr/unsupported/include  \
5210    /usr/athena/include       \
5211    /usr/local/x11r5/include  \
5212    /usr/lpp/Xamples/include  \
5213                              \
5214    /usr/openwin/include      \
5215    /usr/openwin/share/include \
5216    ; \
5217  do
5218    if test -r "$ac_dir/$x_direct_test_include"; then
5219      ac_x_includes=$ac_dir
5220      break
5221    fi
5222  done
5223fi
5224rm -f conftest*
5225fi # $ac_x_includes = NO
5226
5227if test "$ac_x_libraries" = NO; then
5228  # Check for the libraries.
5229
5230  test -z "$x_direct_test_library" && x_direct_test_library=Xt
5231  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
5232
5233  # See if we find them without any special options.
5234  # Don't add to $LIBS permanently.
5235  ac_save_LIBS="$LIBS"
5236  LIBS="-l$x_direct_test_library $LIBS"
5237cat > conftest.$ac_ext <<EOF
5238#line 5239 "configure"
5239#include "confdefs.h"
5240
5241int main() {
5242${x_direct_test_function}()
5243; return 0; }
5244EOF
5245if { (eval echo configure:5246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5246  rm -rf conftest*
5247  LIBS="$ac_save_LIBS"
5248# We can link X programs with no special library path.
5249ac_x_libraries=
5250else
5251  echo "configure: failed program was:" >&5
5252  cat conftest.$ac_ext >&5
5253  rm -rf conftest*
5254  LIBS="$ac_save_LIBS"
5255# First see if replacing the include by lib works.
5256# Check X11 before X11Rn because it is often a symlink to the current release.
5257for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
5258    /usr/X11/lib          \
5259    /usr/X11R6/lib        \
5260    /usr/X11R5/lib        \
5261    /usr/X11R4/lib        \
5262                          \
5263    /usr/lib/X11          \
5264    /usr/lib/X11R6        \
5265    /usr/lib/X11R5        \
5266    /usr/lib/X11R4        \
5267                          \
5268    /usr/local/X11/lib    \
5269    /usr/local/X11R6/lib  \
5270    /usr/local/X11R5/lib  \
5271    /usr/local/X11R4/lib  \
5272                          \
5273    /usr/local/lib/X11    \
5274    /usr/local/lib/X11R6  \
5275    /usr/local/lib/X11R5  \
5276    /usr/local/lib/X11R4  \
5277                          \
5278    /usr/X386/lib         \
5279    /usr/x386/lib         \
5280    /usr/XFree86/lib/X11  \
5281                          \
5282    /usr/lib              \
5283    /usr/local/lib        \
5284    /usr/unsupported/lib  \
5285    /usr/athena/lib       \
5286    /usr/local/x11r5/lib  \
5287    /usr/lpp/Xamples/lib  \
5288    /lib/usr/lib/X11	  \
5289                          \
5290    /usr/openwin/lib      \
5291    /usr/openwin/share/lib \
5292    ; \
5293do
5294  for ac_extension in a so sl; do
5295    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
5296      ac_x_libraries=$ac_dir
5297      break 2
5298    fi
5299  done
5300done
5301fi
5302rm -f conftest*
5303fi # $ac_x_libraries = NO
5304
5305if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
5306  # Didn't find X anywhere.  Cache the known absence of X.
5307  ac_cv_have_x="have_x=no"
5308else
5309  # Record where we found X for the cache.
5310  ac_cv_have_x="have_x=yes \
5311	        ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
5312fi
5313fi
5314  fi
5315  eval "$ac_cv_have_x"
5316fi # $with_x != no
5317
5318if test "$have_x" != yes; then
5319  echo "$ac_t""$have_x" 1>&6
5320  no_x=yes
5321else
5322  # If each of the values was on the command line, it overrides each guess.
5323  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
5324  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
5325  # Update the cache value to reflect the command line values.
5326  ac_cv_have_x="have_x=yes \
5327		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
5328  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
5329fi
5330
5331    not_really_there=""
5332    if test "$no_x" = ""; then
5333	if test "$x_includes" = ""; then
5334	    cat > conftest.$ac_ext <<EOF
5335#line 5336 "configure"
5336#include "confdefs.h"
5337#include <X11/XIntrinsic.h>
5338EOF
5339ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5340{ (eval echo configure:5341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5341ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5342if test -z "$ac_err"; then
5343  :
5344else
5345  echo "$ac_err" >&5
5346  echo "configure: failed program was:" >&5
5347  cat conftest.$ac_ext >&5
5348  rm -rf conftest*
5349  not_really_there="yes"
5350fi
5351rm -f conftest*
5352	else
5353	    if test ! -r $x_includes/X11/Intrinsic.h; then
5354		not_really_there="yes"
5355	    fi
5356	fi
5357    fi
5358    if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
5359	echo $ac_n "checking for X11 header files""... $ac_c" 1>&6
5360echo "configure:5361: checking for X11 header files" >&5
5361	found_xincludes="no"
5362	cat > conftest.$ac_ext <<EOF
5363#line 5364 "configure"
5364#include "confdefs.h"
5365#include <X11/Intrinsic.h>
5366EOF
5367ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5368{ (eval echo configure:5369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5369ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5370if test -z "$ac_err"; then
5371  rm -rf conftest*
5372  found_xincludes="yes"
5373else
5374  echo "$ac_err" >&5
5375  echo "configure: failed program was:" >&5
5376  cat conftest.$ac_ext >&5
5377  rm -rf conftest*
5378  found_xincludes="no"
5379fi
5380rm -f conftest*
5381	if test "$found_xincludes" = "no"; then
5382	    dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
5383	    for i in $dirs ; do
5384		if test -r $i/X11/Intrinsic.h; then
5385		    echo "$ac_t""$i" 1>&6
5386		    XINCLUDES=" -I$i"
5387		    found_xincludes="yes"
5388		    break
5389		fi
5390	    done
5391	fi
5392    else
5393	if test "$x_includes" != ""; then
5394	    XINCLUDES="-I$x_includes"
5395	    found_xincludes="yes"
5396	fi
5397    fi
5398    if test found_xincludes = "no"; then
5399	echo "$ac_t""couldn't find any!" 1>&6
5400    fi
5401
5402    if test "$no_x" = yes; then
5403	echo $ac_n "checking for X11 libraries""... $ac_c" 1>&6
5404echo "configure:5405: checking for X11 libraries" >&5
5405	XLIBSW=nope
5406	dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
5407	for i in $dirs ; do
5408	    if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then
5409		echo "$ac_t""$i" 1>&6
5410		XLIBSW="-L$i -lX11"
5411		x_libraries="$i"
5412		break
5413	    fi
5414	done
5415    else
5416	if test "$x_libraries" = ""; then
5417	    XLIBSW=-lX11
5418	else
5419	    XLIBSW="-L$x_libraries -lX11"
5420	fi
5421    fi
5422    if test "$XLIBSW" = nope ; then
5423	echo $ac_n "checking for XCreateWindow in -lXwindow""... $ac_c" 1>&6
5424echo "configure:5425: checking for XCreateWindow in -lXwindow" >&5
5425ac_lib_var=`echo Xwindow'_'XCreateWindow | sed 'y%./+-%__p_%'`
5426if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5427  echo $ac_n "(cached) $ac_c" 1>&6
5428else
5429  ac_save_LIBS="$LIBS"
5430LIBS="-lXwindow  $LIBS"
5431cat > conftest.$ac_ext <<EOF
5432#line 5433 "configure"
5433#include "confdefs.h"
5434/* Override any gcc2 internal prototype to avoid an error.  */
5435/* We use char because int might match the return type of a gcc2
5436    builtin and then its argument prototype would still apply.  */
5437char XCreateWindow();
5438
5439int main() {
5440XCreateWindow()
5441; return 0; }
5442EOF
5443if { (eval echo configure:5444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5444  rm -rf conftest*
5445  eval "ac_cv_lib_$ac_lib_var=yes"
5446else
5447  echo "configure: failed program was:" >&5
5448  cat conftest.$ac_ext >&5
5449  rm -rf conftest*
5450  eval "ac_cv_lib_$ac_lib_var=no"
5451fi
5452rm -f conftest*
5453LIBS="$ac_save_LIBS"
5454
5455fi
5456if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5457  echo "$ac_t""yes" 1>&6
5458  XLIBSW=-lXwindow
5459else
5460  echo "$ac_t""no" 1>&6
5461fi
5462
5463    fi
5464    if test "$XLIBSW" = nope ; then
5465	echo "$ac_t""could not find any!  Using -lX11." 1>&6
5466	XLIBSW=-lX11
5467    fi
5468
5469    TK_WINDOWINGSYSTEM=X11
5470fi
5471
5472#--------------------------------------------------------------------
5473#	Various manipulations on the search path used at runtime to
5474#	find shared libraries:
5475#	1. If the X library binaries are in a non-standard directory,
5476#	   add the X library location into that search path.
5477#	2. On systems such as AIX and Ultrix that use "-L" as the
5478#	   search path option, colons cannot be used to separate
5479#	   directories from each other. Change colons to " -L".
5480#	3. Create two sets of search flags, one for use in cc lines
5481#	   and the other for when the linker is invoked directly.  In
5482#	   the second case, '-Wl,' must be stripped off and commas must
5483#	   be replaced by spaces.
5484#--------------------------------------------------------------------
5485
5486if test "x${x_libraries}" != "x"; then
5487    LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${x_libraries}"
5488fi
5489if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
5490    LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'`
5491fi
5492
5493# The statement below is very tricky!  It actually *evaluates* the
5494# string in TCL_CC_SEARCH_FLAGS and TCL_LD_SEARCH_FLAGS which
5495# causes a substitution of the variable LIB_RUNTIME_DIR.
5496
5497eval "CC_SEARCH_FLAGS=\"$TCL_CC_SEARCH_FLAGS\""
5498eval "LD_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\""
5499
5500#--------------------------------------------------------------------
5501#	Check for the existence of various libraries.  The order here
5502#	is important, so that then end up in the right order in the
5503#	command line generated by make.  The -lsocket and -lnsl libraries
5504#	require a couple of special tricks:
5505#	1. Use "connect" and "accept" to check for -lsocket, and
5506#	   "gethostbyname" to check for -lnsl.
5507#	2. Use each function name only once:  can't redo a check because
5508#	   autoconf caches the results of the last check and won't redo it.
5509#	3. Use -lnsl and -lsocket only if they supply procedures that
5510#	   aren't already present in the normal libraries.  This is because
5511#	   IRIX 5.2 has libraries, but they aren't needed and they're
5512#	   bogus:  they goof up name resolution if used.
5513#	4. On some SVR4 systems, can't use -lsocket without -lnsl too.
5514#	   To get around this problem, check for both libraries together
5515#	   if -lsocket doesn't work by itself.
5516#--------------------------------------------------------------------
5517
5518if test $tk_aqua = no; then
5519    echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5520echo "configure:5521: checking for main in -lXbsd" >&5
5521ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5522if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5523  echo $ac_n "(cached) $ac_c" 1>&6
5524else
5525  ac_save_LIBS="$LIBS"
5526LIBS="-lXbsd  $LIBS"
5527cat > conftest.$ac_ext <<EOF
5528#line 5529 "configure"
5529#include "confdefs.h"
5530
5531int main() {
5532main()
5533; return 0; }
5534EOF
5535if { (eval echo configure:5536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5536  rm -rf conftest*
5537  eval "ac_cv_lib_$ac_lib_var=yes"
5538else
5539  echo "configure: failed program was:" >&5
5540  cat conftest.$ac_ext >&5
5541  rm -rf conftest*
5542  eval "ac_cv_lib_$ac_lib_var=no"
5543fi
5544rm -f conftest*
5545LIBS="$ac_save_LIBS"
5546
5547fi
5548if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5549  echo "$ac_t""yes" 1>&6
5550  LIBS="$LIBS -lXbsd"
5551else
5552  echo "$ac_t""no" 1>&6
5553fi
5554
5555fi
5556
5557tk_checkBoth=0
5558echo $ac_n "checking for connect""... $ac_c" 1>&6
5559echo "configure:5560: checking for connect" >&5
5560if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
5561  echo $ac_n "(cached) $ac_c" 1>&6
5562else
5563  cat > conftest.$ac_ext <<EOF
5564#line 5565 "configure"
5565#include "confdefs.h"
5566/* System header to define __stub macros and hopefully few prototypes,
5567    which can conflict with char connect(); below.  */
5568#include <assert.h>
5569/* Override any gcc2 internal prototype to avoid an error.  */
5570/* We use char because int might match the return type of a gcc2
5571    builtin and then its argument prototype would still apply.  */
5572char connect();
5573
5574int main() {
5575
5576/* The GNU C library defines this for functions which it implements
5577    to always fail with ENOSYS.  Some functions are actually named
5578    something starting with __ and the normal name is an alias.  */
5579#if defined (__stub_connect) || defined (__stub___connect)
5580choke me
5581#else
5582connect();
5583#endif
5584
5585; return 0; }
5586EOF
5587if { (eval echo configure:5588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5588  rm -rf conftest*
5589  eval "ac_cv_func_connect=yes"
5590else
5591  echo "configure: failed program was:" >&5
5592  cat conftest.$ac_ext >&5
5593  rm -rf conftest*
5594  eval "ac_cv_func_connect=no"
5595fi
5596rm -f conftest*
5597fi
5598
5599if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
5600  echo "$ac_t""yes" 1>&6
5601  tk_checkSocket=0
5602else
5603  echo "$ac_t""no" 1>&6
5604tk_checkSocket=1
5605fi
5606
5607if test "$tk_checkSocket" = 1; then
5608    echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5609echo "configure:5610: checking for main in -lsocket" >&5
5610ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
5611if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5612  echo $ac_n "(cached) $ac_c" 1>&6
5613else
5614  ac_save_LIBS="$LIBS"
5615LIBS="-lsocket  $LIBS"
5616cat > conftest.$ac_ext <<EOF
5617#line 5618 "configure"
5618#include "confdefs.h"
5619
5620int main() {
5621main()
5622; return 0; }
5623EOF
5624if { (eval echo configure:5625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5625  rm -rf conftest*
5626  eval "ac_cv_lib_$ac_lib_var=yes"
5627else
5628  echo "configure: failed program was:" >&5
5629  cat conftest.$ac_ext >&5
5630  rm -rf conftest*
5631  eval "ac_cv_lib_$ac_lib_var=no"
5632fi
5633rm -f conftest*
5634LIBS="$ac_save_LIBS"
5635
5636fi
5637if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5638  echo "$ac_t""yes" 1>&6
5639  LIBS="$LIBS -lsocket"
5640else
5641  echo "$ac_t""no" 1>&6
5642tk_checkBoth=1
5643fi
5644
5645fi
5646if test "$tk_checkBoth" = 1; then
5647    tk_oldLibs=$LIBS
5648    LIBS="$LIBS -lsocket -lnsl"
5649    echo $ac_n "checking for accept""... $ac_c" 1>&6
5650echo "configure:5651: checking for accept" >&5
5651if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
5652  echo $ac_n "(cached) $ac_c" 1>&6
5653else
5654  cat > conftest.$ac_ext <<EOF
5655#line 5656 "configure"
5656#include "confdefs.h"
5657/* System header to define __stub macros and hopefully few prototypes,
5658    which can conflict with char accept(); below.  */
5659#include <assert.h>
5660/* Override any gcc2 internal prototype to avoid an error.  */
5661/* We use char because int might match the return type of a gcc2
5662    builtin and then its argument prototype would still apply.  */
5663char accept();
5664
5665int main() {
5666
5667/* The GNU C library defines this for functions which it implements
5668    to always fail with ENOSYS.  Some functions are actually named
5669    something starting with __ and the normal name is an alias.  */
5670#if defined (__stub_accept) || defined (__stub___accept)
5671choke me
5672#else
5673accept();
5674#endif
5675
5676; return 0; }
5677EOF
5678if { (eval echo configure:5679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5679  rm -rf conftest*
5680  eval "ac_cv_func_accept=yes"
5681else
5682  echo "configure: failed program was:" >&5
5683  cat conftest.$ac_ext >&5
5684  rm -rf conftest*
5685  eval "ac_cv_func_accept=no"
5686fi
5687rm -f conftest*
5688fi
5689
5690if eval "test \"`echo '$ac_cv_func_'accept`\" = yes"; then
5691  echo "$ac_t""yes" 1>&6
5692  tk_checkNsl=0
5693else
5694  echo "$ac_t""no" 1>&6
5695LIBS=$tk_oldLibs
5696fi
5697
5698fi
5699echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
5700echo "configure:5701: checking for gethostbyname" >&5
5701if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
5702  echo $ac_n "(cached) $ac_c" 1>&6
5703else
5704  cat > conftest.$ac_ext <<EOF
5705#line 5706 "configure"
5706#include "confdefs.h"
5707/* System header to define __stub macros and hopefully few prototypes,
5708    which can conflict with char gethostbyname(); below.  */
5709#include <assert.h>
5710/* Override any gcc2 internal prototype to avoid an error.  */
5711/* We use char because int might match the return type of a gcc2
5712    builtin and then its argument prototype would still apply.  */
5713char gethostbyname();
5714
5715int main() {
5716
5717/* The GNU C library defines this for functions which it implements
5718    to always fail with ENOSYS.  Some functions are actually named
5719    something starting with __ and the normal name is an alias.  */
5720#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
5721choke me
5722#else
5723gethostbyname();
5724#endif
5725
5726; return 0; }
5727EOF
5728if { (eval echo configure:5729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5729  rm -rf conftest*
5730  eval "ac_cv_func_gethostbyname=yes"
5731else
5732  echo "configure: failed program was:" >&5
5733  cat conftest.$ac_ext >&5
5734  rm -rf conftest*
5735  eval "ac_cv_func_gethostbyname=no"
5736fi
5737rm -f conftest*
5738fi
5739
5740if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
5741  echo "$ac_t""yes" 1>&6
5742  :
5743else
5744  echo "$ac_t""no" 1>&6
5745echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5746echo "configure:5747: checking for main in -lnsl" >&5
5747ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
5748if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5749  echo $ac_n "(cached) $ac_c" 1>&6
5750else
5751  ac_save_LIBS="$LIBS"
5752LIBS="-lnsl  $LIBS"
5753cat > conftest.$ac_ext <<EOF
5754#line 5755 "configure"
5755#include "confdefs.h"
5756
5757int main() {
5758main()
5759; return 0; }
5760EOF
5761if { (eval echo configure:5762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5762  rm -rf conftest*
5763  eval "ac_cv_lib_$ac_lib_var=yes"
5764else
5765  echo "configure: failed program was:" >&5
5766  cat conftest.$ac_ext >&5
5767  rm -rf conftest*
5768  eval "ac_cv_lib_$ac_lib_var=no"
5769fi
5770rm -f conftest*
5771LIBS="$ac_save_LIBS"
5772
5773fi
5774if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5775  echo "$ac_t""yes" 1>&6
5776  LIBS="$LIBS -lnsl"
5777else
5778  echo "$ac_t""no" 1>&6
5779fi
5780
5781fi
5782
5783
5784#--------------------------------------------------------------------
5785# One more check related to the X libraries.  The standard releases
5786# of Ultrix don't support the "xauth" mechanism, so send won't work
5787# unless TK_NO_SECURITY is defined.  However, there are usually copies
5788# of the MIT X server available as well, which do support xauth.
5789# Check for the MIT stuff and use it if it exists.
5790#
5791# Note: can't use ac_check_lib macro (at least, not in Autoconf 2.1)
5792# because it can't deal with the "-" in the library name.
5793#--------------------------------------------------------------------
5794
5795if test -d /usr/include/mit -a $tk_aqua = no; then
5796    echo $ac_n "checking MIT X libraries""... $ac_c" 1>&6
5797echo "configure:5798: checking MIT X libraries" >&5
5798    tk_oldCFlags=$CFLAGS
5799    CFLAGS="$CFLAGS -I/usr/include/mit"
5800    tk_oldLibs=$LIBS
5801    LIBS="$LIBS -lX11-mit"
5802    cat > conftest.$ac_ext <<EOF
5803#line 5804 "configure"
5804#include "confdefs.h"
5805
5806	#include <X11/Xlib.h>
5807    
5808int main() {
5809
5810	XOpenDisplay(0);
5811    
5812; return 0; }
5813EOF
5814if { (eval echo configure:5815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5815  rm -rf conftest*
5816  
5817	echo "$ac_t""yes" 1>&6
5818	XLIBSW="-lX11-mit"
5819	XINCLUDES="-I/usr/include/mit"
5820    
5821else
5822  echo "configure: failed program was:" >&5
5823  cat conftest.$ac_ext >&5
5824  rm -rf conftest*
5825  echo "$ac_t""no" 1>&6
5826fi
5827rm -f conftest*
5828    CFLAGS=$tk_oldCFlags
5829    LIBS=$tk_oldLibs
5830fi
5831
5832#--------------------------------------------------------------------
5833#	Figure out whether "char" is unsigned.  If so, set a
5834#	#define for __CHAR_UNSIGNED__.
5835#--------------------------------------------------------------------
5836
5837echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
5838echo "configure:5839: checking whether char is unsigned" >&5
5839if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
5840  echo $ac_n "(cached) $ac_c" 1>&6
5841else
5842  if test "$GCC" = yes; then
5843  # GCC predefines this symbol on systems where it applies.
5844cat > conftest.$ac_ext <<EOF
5845#line 5846 "configure"
5846#include "confdefs.h"
5847#ifdef __CHAR_UNSIGNED__
5848  yes
5849#endif
5850
5851EOF
5852if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5853  egrep "yes" >/dev/null 2>&1; then
5854  rm -rf conftest*
5855  ac_cv_c_char_unsigned=yes
5856else
5857  rm -rf conftest*
5858  ac_cv_c_char_unsigned=no
5859fi
5860rm -f conftest*
5861
5862else
5863if test "$cross_compiling" = yes; then
5864    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
5865else
5866  cat > conftest.$ac_ext <<EOF
5867#line 5868 "configure"
5868#include "confdefs.h"
5869/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
5870#if !defined(__STDC__) || __STDC__ != 1
5871#define volatile
5872#endif
5873main() {
5874  volatile char c = 255; exit(c < 0);
5875}
5876EOF
5877if { (eval echo configure:5878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5878then
5879  ac_cv_c_char_unsigned=yes
5880else
5881  echo "configure: failed program was:" >&5
5882  cat conftest.$ac_ext >&5
5883  rm -fr conftest*
5884  ac_cv_c_char_unsigned=no
5885fi
5886rm -fr conftest*
5887fi
5888
5889fi
5890fi
5891
5892echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6
5893if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
5894  cat >> confdefs.h <<\EOF
5895#define __CHAR_UNSIGNED__ 1
5896EOF
5897
5898fi
5899
5900
5901#--------------------------------------------------------------------
5902#	The statements below define a collection of symbols related to
5903#	building libtk as a shared library instead of a static library.
5904#--------------------------------------------------------------------
5905
5906eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}"
5907eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}"
5908eval "TK_LIB_FILE=libtk${LIB_SUFFIX}"
5909
5910# tkConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed
5911# so that the backslashes quoting the DBX braces are dropped.
5912
5913# Trick to replace DBGX with TK_DBGX
5914DBGX='${TK_DBGX}'
5915eval "TK_LIB_FILE=${TK_LIB_FILE}"
5916
5917if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
5918    SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${TCL_STUB_LIB_SPEC}"
5919    TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
5920fi
5921
5922TK_LIBRARY='$(prefix)/lib/tk$(VERSION)'
5923PRIVATE_INCLUDE_DIR='$(includedir)'
5924HTML_DIR='$(DISTDIR)/html'
5925TK_PKG_DIR='tk$(VERSION)$(TK_DBGX)'
5926TK_RSRC_FILE='tk$(VERSION).rsrc'
5927WISH_RSRC_FILE='wish$(VERSION).rsrc'
5928
5929# Note:  in the following variable, it's important to use the absolute
5930# path name of the Tcl directory rather than "..":  this is because
5931# AIX remembers this path and will attempt to use it at run-time to look
5932# up the Tcl library.
5933
5934if test "`uname -s`" = "Darwin" ; then
5935    
5936    if test "`uname -s`" = "Darwin" ; then
5937	echo $ac_n "checking how to package libraries""... $ac_c" 1>&6
5938echo "configure:5939: checking how to package libraries" >&5
5939	# Check whether --enable-framework or --disable-framework was given.
5940if test "${enable_framework+set}" = set; then
5941  enableval="$enable_framework"
5942  enable_framework=$enableval
5943else
5944  enable_framework=no
5945fi
5946
5947	if test $enable_framework = yes; then
5948	    if test $SHARED_BUILD = 0; then
5949		echo "configure: warning: Frameworks can only be built if --enable-shared is yes" 1>&2
5950		enable_framework=no
5951	    fi
5952	    if test $tcl_corefoundation = no; then
5953		echo "configure: warning: Frameworks can only be used when CoreFoundation is available" 1>&2
5954		enable_framework=no
5955	    fi
5956	fi
5957	if test $enable_framework = yes; then
5958	    echo "$ac_t""framework" 1>&6
5959	    FRAMEWORK_BUILD=1
5960	else
5961	    if test $SHARED_BUILD = 1; then
5962		echo "$ac_t""shared library" 1>&6
5963	    else
5964		echo "$ac_t""static library" 1>&6
5965	    fi
5966	    FRAMEWORK_BUILD=0
5967	fi
5968    fi
5969
5970    TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`"
5971    TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | grep ^_[^_] > $$f && echo $$f)'
5972    echo "$LDFLAGS " | grep -q -- '-prebind ' && TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -seg1addr 0xb000000'
5973    TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist'
5974    EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist'
5975    EXTRA_APP_CC_SWITCHES='-mdynamic-no-pic'
5976    tk_config_files="${tk_config_files} Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in"
5977    for l in ${LOCALES}; do CFBUNDLELOCALIZATIONS="${CFBUNDLELOCALIZATIONS}<string>$l</string>"; done
5978    TK_YEAR="`date +%Y`"
5979fi
5980
5981if test "$FRAMEWORK_BUILD" = "1" ; then
5982    cat >> confdefs.h <<\EOF
5983#define TK_FRAMEWORK 1
5984EOF
5985
5986    # Construct a fake local framework structure to make linking with
5987    # '-framework Tk' and running of tktest work
5988    
5989    LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH"
5990    if test "${libdir}" = '${exec_prefix}/lib'; then
5991        # override libdir default
5992        libdir="/Library/Frameworks"
5993    fi
5994    TK_LIB_FILE="Tk"
5995    TK_LIB_FLAG="-framework Tk"
5996    TK_BUILD_LIB_SPEC="-F`pwd` -framework Tk"
5997    TK_LIB_SPEC="-F${libdir} -framework Tk"
5998    libdir="${libdir}/Tk.framework/Versions/\${VERSION}"
5999    TK_LIBRARY="${libdir}/Resources/Scripts"
6000    TK_PKG_DIR="Resources/Scripts"
6001    TK_RSRC_FILE="Tk.rsrc"
6002    WISH_RSRC_FILE="Wish.rsrc"
6003    includedir="${libdir}/Headers"
6004    PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders"
6005    HTML_DIR="${libdir}/Resources/Documentation/Reference/Tk"
6006    EXTRA_INSTALL="install-private-headers html-tk"
6007    EXTRA_BUILD_HTML='@ln -fs contents.htm $(HTML_INSTALL_DIR)/TkTOC.html' 
6008    EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"'
6009    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"'
6010    if test $tk_aqua = yes; then
6011        EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"'
6012        EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'" && mkdir -p "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"'
6013        bindir="${libdir}/Resources/Wish.app/Contents/MacOS"
6014        EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/.." && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"'
6015        EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "'\$\(MAC\_OSX_DIR\)'/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources"'
6016        EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"'
6017    fi
6018    EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tkConfig.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)/../.."'
6019    # Don't use AC_DEFINE for the following as the framework version define 
6020    # needs to go into the Makefile even when using autoheader, so that we  
6021    # can pick up a potential make override of VERSION. Also, don't put this
6022    # into CFLAGS as it should not go into tkConfig.sh
6023    EXTRA_CC_SWITCHES='-DTK_FRAMEWORK_VERSION=\"$(VERSION)\"'
6024else
6025    # libdir must be a fully qualified path and not ${exec_prefix}/lib
6026    eval libdir="$libdir"
6027    if test "$SHARED_BUILD" = "0" || test "$TCL_NEEDS_EXP_FILE" = "0"; then
6028        if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
6029            eval TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
6030        else
6031            eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
6032        fi
6033        TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
6034        TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
6035    else
6036        TK_BUILD_EXP_FILE="lib.exp"
6037        eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}"
6038    
6039        if test "$GCC" = "yes" ; then
6040            TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`"
6041            TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`"
6042        else
6043            TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}"
6044            TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}"
6045        fi
6046    fi
6047fi
6048
6049# Support for building the Aqua resource files
6050if test $tk_aqua = yes; then
6051    LIB_RSRC_FILE='${TK_RSRC_FILE}'
6052    APP_RSRC_FILE='${WISH_RSRC_FILE}'
6053    REZ="`xcrun -find Rez`"
6054    test -z "$REZ" && REZ=/Developer/Tools/Rez
6055    REZ_FLAGS='-d "SystemSevenOrLater=1" -useDF -ro'
6056    if test "$SHARED_BUILD" = 0; then
6057        EXTRA_INSTALL_BINARIES='@echo "Installing $(TK_RSRC_FILE) to $(LIB_INSTALL_DIR)" && $(INSTALL_DATA) $(TK_RSRC_FILE) $(LIB_INSTALL_DIR)'
6058	TK_BUILD_LIB_SPEC="$TK_BUILD_LIB_SPEC -sectcreate __TEXT __tk_rsrc `pwd`/\${TK_RSRC_FILE}"
6059	TK_LIB_SPEC="$TK_LIB_SPEC -sectcreate __TEXT __tk_rsrc ${libdir}/\${TK_RSRC_FILE}"        
6060    else
6061        TK_SHLIB_LD_EXTRAS="$TK_SHLIB_LD_EXTRAS -sectcreate __TEXT __tk_rsrc \${TK_RSRC_FILE}"
6062    fi
6063fi
6064
6065#--------------------------------------------------------------------
6066#       The statements below define various symbols relating to Tk
6067#       stub support.
6068#--------------------------------------------------------------------
6069
6070# Replace ${VERSION} with contents of ${TK_VERSION}
6071eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}"
6072eval "TK_STUB_LIB_DIR=${libdir}"
6073
6074if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
6075    eval TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}\${TK_DBGX}"
6076else
6077    eval TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`\${TK_DBGX}"
6078fi
6079
6080TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}"
6081TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}"
6082TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}"
6083TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}"
6084
6085# Install time header dir can be set via --includedir
6086eval "TK_INCLUDE_SPEC=\"-I${includedir}\""
6087
6088#------------------------------------------------------------------------
6089# tkConfig.sh refers to this by a different name
6090#------------------------------------------------------------------------
6091
6092TK_SHARED_BUILD=${SHARED_BUILD}
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
6149
6150
6151tk_config_files="${tk_config_files} Makefile tkConfig.sh"
6152trap '' 1 2 15
6153cat > confcache <<\EOF
6154# This file is a shell script that caches the results of configure
6155# tests run on this system so they can be shared between configure
6156# scripts and configure runs.  It is not useful on other systems.
6157# If it contains results you don't want to keep, you may remove or edit it.
6158#
6159# By default, configure uses ./config.cache as the cache file,
6160# creating it if it does not exist already.  You can give configure
6161# the --cache-file=FILE option to use a different cache file; that is
6162# what configure does when it calls configure scripts in
6163# subdirectories, so they share the cache.
6164# Giving --cache-file=/dev/null disables caching, for debugging configure.
6165# config.status only pays attention to the cache file if you give it the
6166# --recheck option to rerun configure.
6167#
6168EOF
6169# The following way of writing the cache mishandles newlines in values,
6170# but we know of no workaround that is simple, portable, and efficient.
6171# So, don't put newlines in cache variables' values.
6172# Ultrix sh set writes to stderr and can't be redirected directly,
6173# and sets the high bit in the cache file unless we assign to the vars.
6174(set) 2>&1 |
6175  case `(ac_space=' '; set | grep ac_space) 2>&1` in
6176  *ac_space=\ *)
6177    # `set' does not quote correctly, so add quotes (double-quote substitution
6178    # turns \\\\ into \\, and sed turns \\ into \).
6179    sed -n \
6180      -e "s/'/'\\\\''/g" \
6181      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
6182    ;;
6183  *)
6184    # `set' quotes correctly as required by POSIX, so do not add quotes.
6185    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
6186    ;;
6187  esac >> confcache
6188if cmp -s $cache_file confcache; then
6189  :
6190else
6191  if test -w $cache_file; then
6192    echo "updating cache $cache_file"
6193    cat confcache > $cache_file
6194  else
6195    echo "not updating unwritable cache $cache_file"
6196  fi
6197fi
6198rm -f confcache
6199
6200trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
6201
6202test "x$prefix" = xNONE && prefix=$ac_default_prefix
6203# Let make expand exec_prefix.
6204test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
6205
6206# Any assignment to VPATH causes Sun make to only execute
6207# the first set of double-colon rules, so remove it if not needed.
6208# If there is a colon in the path, we need to keep it.
6209if test "x$srcdir" = x.; then
6210  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
6211fi
6212
6213trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
6214
6215# Transform confdefs.h into DEFS.
6216# Protect against shell expansion while executing Makefile rules.
6217# Protect against Makefile macro expansion.
6218cat > conftest.defs <<\EOF
6219s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
6220s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
6221s%\[%\\&%g
6222s%\]%\\&%g
6223s%\$%$$%g
6224EOF
6225DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
6226rm -f conftest.defs
6227
6228
6229# Without the "./", some shells look in PATH for config.status.
6230: ${CONFIG_STATUS=./config.status}
6231
6232echo creating $CONFIG_STATUS
6233rm -f $CONFIG_STATUS
6234cat > $CONFIG_STATUS <<EOF
6235#! /bin/sh
6236# Generated automatically by configure.
6237# Run this file to recreate the current configuration.
6238# This directory was configured as follows,
6239# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6240#
6241# $0 $ac_configure_args
6242#
6243# Compiler output produced by configure, useful for debugging
6244# configure, is in ./config.log if it exists.
6245
6246ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
6247for ac_option
6248do
6249  case "\$ac_option" in
6250  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
6251    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
6252    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
6253  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
6254    echo "$CONFIG_STATUS generated by autoconf version 2.13"
6255    exit 0 ;;
6256  -help | --help | --hel | --he | --h)
6257    echo "\$ac_cs_usage"; exit 0 ;;
6258  *) echo "\$ac_cs_usage"; exit 1 ;;
6259  esac
6260done
6261
6262ac_given_srcdir=$srcdir
6263
6264trap 'rm -fr `echo "${tk_config_files}" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
6265EOF
6266cat >> $CONFIG_STATUS <<EOF
6267
6268# Protect against being on the right side of a sed subst in config.status.
6269sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
6270 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
6271$ac_vpsub
6272$extrasub
6273s%@SHELL@%$SHELL%g
6274s%@CFLAGS@%$CFLAGS%g
6275s%@CPPFLAGS@%$CPPFLAGS%g
6276s%@CXXFLAGS@%$CXXFLAGS%g
6277s%@FFLAGS@%$FFLAGS%g
6278s%@DEFS@%$DEFS%g
6279s%@LDFLAGS@%$LDFLAGS%g
6280s%@LIBS@%$LIBS%g
6281s%@exec_prefix@%$exec_prefix%g
6282s%@prefix@%$prefix%g
6283s%@program_transform_name@%$program_transform_name%g
6284s%@bindir@%$bindir%g
6285s%@sbindir@%$sbindir%g
6286s%@libexecdir@%$libexecdir%g
6287s%@datadir@%$datadir%g
6288s%@sysconfdir@%$sysconfdir%g
6289s%@sharedstatedir@%$sharedstatedir%g
6290s%@localstatedir@%$localstatedir%g
6291s%@libdir@%$libdir%g
6292s%@includedir@%$includedir%g
6293s%@oldincludedir@%$oldincludedir%g
6294s%@infodir@%$infodir%g
6295s%@mandir@%$mandir%g
6296s%@TCL_VERSION@%$TCL_VERSION%g
6297s%@TCL_PATCH_LEVEL@%$TCL_PATCH_LEVEL%g
6298s%@TCL_BIN_DIR@%$TCL_BIN_DIR%g
6299s%@TCL_SRC_DIR@%$TCL_SRC_DIR%g
6300s%@TCL_LIB_FILE@%$TCL_LIB_FILE%g
6301s%@TCL_LIB_FLAG@%$TCL_LIB_FLAG%g
6302s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
6303s%@TCL_STUB_LIB_FILE@%$TCL_STUB_LIB_FILE%g
6304s%@TCL_STUB_LIB_FLAG@%$TCL_STUB_LIB_FLAG%g
6305s%@TCL_STUB_LIB_SPEC@%$TCL_STUB_LIB_SPEC%g
6306s%@TCLSH_PROG@%$TCLSH_PROG%g
6307s%@BUILD_TCLSH@%$BUILD_TCLSH%g
6308s%@MAN_FLAGS@%$MAN_FLAGS%g
6309s%@CC@%$CC%g
6310s%@CPP@%$CPP%g
6311s%@TCL_THREADS@%$TCL_THREADS%g
6312s%@RANLIB@%$RANLIB%g
6313s%@AR@%$AR%g
6314s%@DL_LIBS@%$DL_LIBS%g
6315s%@DL_OBJS@%$DL_OBJS%g
6316s%@PLAT_OBJS@%$PLAT_OBJS%g
6317s%@PLAT_SRCS@%$PLAT_SRCS%g
6318s%@CFLAGS_DEBUG@%$CFLAGS_DEBUG%g
6319s%@CFLAGS_OPTIMIZE@%$CFLAGS_OPTIMIZE%g
6320s%@CFLAGS_WARNING@%$CFLAGS_WARNING%g
6321s%@LDFLAGS_DEBUG@%$LDFLAGS_DEBUG%g
6322s%@LDFLAGS_OPTIMIZE@%$LDFLAGS_OPTIMIZE%g
6323s%@CC_SEARCH_FLAGS@%$CC_SEARCH_FLAGS%g
6324s%@LD_SEARCH_FLAGS@%$LD_SEARCH_FLAGS%g
6325s%@STLIB_LD@%$STLIB_LD%g
6326s%@SHLIB_LD@%$SHLIB_LD%g
6327s%@TCL_SHLIB_LD_EXTRAS@%$TCL_SHLIB_LD_EXTRAS%g
6328s%@TK_SHLIB_LD_EXTRAS@%$TK_SHLIB_LD_EXTRAS%g
6329s%@SHLIB_LD_LIBS@%$SHLIB_LD_LIBS%g
6330s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
6331s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
6332s%@MAKE_LIB@%$MAKE_LIB%g
6333s%@MAKE_STUB_LIB@%$MAKE_STUB_LIB%g
6334s%@INSTALL_LIB@%$INSTALL_LIB%g
6335s%@INSTALL_STUB_LIB@%$INSTALL_STUB_LIB%g
6336s%@CFLAGS_DEFAULT@%$CFLAGS_DEFAULT%g
6337s%@LDFLAGS_DEFAULT@%$LDFLAGS_DEFAULT%g
6338s%@TK_VERSION@%$TK_VERSION%g
6339s%@TK_MAJOR_VERSION@%$TK_MAJOR_VERSION%g
6340s%@TK_MINOR_VERSION@%$TK_MINOR_VERSION%g
6341s%@TK_PATCH_LEVEL@%$TK_PATCH_LEVEL%g
6342s%@TK_YEAR@%$TK_YEAR%g
6343s%@TK_LIB_FILE@%$TK_LIB_FILE%g
6344s%@TK_LIB_FLAG@%$TK_LIB_FLAG%g
6345s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g
6346s%@TK_STUB_LIB_FILE@%$TK_STUB_LIB_FILE%g
6347s%@TK_STUB_LIB_FLAG@%$TK_STUB_LIB_FLAG%g
6348s%@TK_STUB_LIB_SPEC@%$TK_STUB_LIB_SPEC%g
6349s%@TK_STUB_LIB_PATH@%$TK_STUB_LIB_PATH%g
6350s%@TK_INCLUDE_SPEC@%$TK_INCLUDE_SPEC%g
6351s%@TK_BUILD_STUB_LIB_SPEC@%$TK_BUILD_STUB_LIB_SPEC%g
6352s%@TK_BUILD_STUB_LIB_PATH@%$TK_BUILD_STUB_LIB_PATH%g
6353s%@TK_SRC_DIR@%$TK_SRC_DIR%g
6354s%@TK_DBGX@%$TK_DBGX%g
6355s%@TK_SHARED_BUILD@%$TK_SHARED_BUILD%g
6356s%@LD_LIBRARY_PATH_VAR@%$LD_LIBRARY_PATH_VAR%g
6357s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g
6358s%@TK_BUILD_EXP_FILE@%$TK_BUILD_EXP_FILE%g
6359s%@TK_EXP_FILE@%$TK_EXP_FILE%g
6360s%@TCL_STUB_FLAGS@%$TCL_STUB_FLAGS%g
6361s%@MATH_LIBS@%$MATH_LIBS%g
6362s%@XINCLUDES@%$XINCLUDES%g
6363s%@XLIBSW@%$XLIBSW%g
6364s%@LOCALES@%$LOCALES%g
6365s%@TK_WINDOWINGSYSTEM@%$TK_WINDOWINGSYSTEM%g
6366s%@TK_PKG_DIR@%$TK_PKG_DIR%g
6367s%@TK_LIBRARY@%$TK_LIBRARY%g
6368s%@PRIVATE_INCLUDE_DIR@%$PRIVATE_INCLUDE_DIR%g
6369s%@HTML_DIR@%$HTML_DIR%g
6370s%@EXTRA_CC_SWITCHES@%$EXTRA_CC_SWITCHES%g
6371s%@EXTRA_APP_CC_SWITCHES@%$EXTRA_APP_CC_SWITCHES%g
6372s%@EXTRA_INSTALL@%$EXTRA_INSTALL%g
6373s%@EXTRA_INSTALL_BINARIES@%$EXTRA_INSTALL_BINARIES%g
6374s%@EXTRA_BUILD_HTML@%$EXTRA_BUILD_HTML%g
6375s%@EXTRA_WISH_LIBS@%$EXTRA_WISH_LIBS%g
6376s%@CFBUNDLELOCALIZATIONS@%$CFBUNDLELOCALIZATIONS%g
6377s%@TK_RSRC_FILE@%$TK_RSRC_FILE%g
6378s%@WISH_RSRC_FILE@%$WISH_RSRC_FILE%g
6379s%@LIB_RSRC_FILE@%$LIB_RSRC_FILE%g
6380s%@APP_RSRC_FILE@%$APP_RSRC_FILE%g
6381s%@REZ@%$REZ%g
6382s%@REZ_FLAGS@%$REZ_FLAGS%g
6383
6384CEOF
6385EOF
6386
6387cat >> $CONFIG_STATUS <<\EOF
6388
6389# Split the substitutions into bite-sized pieces for seds with
6390# small command number limits, like on Digital OSF/1 and HP-UX.
6391ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
6392ac_file=1 # Number of current file.
6393ac_beg=1 # First line for current file.
6394ac_end=$ac_max_sed_cmds # Line after last line for current file.
6395ac_more_lines=:
6396ac_sed_cmds=""
6397while $ac_more_lines; do
6398  if test $ac_beg -gt 1; then
6399    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
6400  else
6401    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
6402  fi
6403  if test ! -s conftest.s$ac_file; then
6404    ac_more_lines=false
6405    rm -f conftest.s$ac_file
6406  else
6407    if test -z "$ac_sed_cmds"; then
6408      ac_sed_cmds="sed -f conftest.s$ac_file"
6409    else
6410      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
6411    fi
6412    ac_file=`expr $ac_file + 1`
6413    ac_beg=$ac_end
6414    ac_end=`expr $ac_end + $ac_max_sed_cmds`
6415  fi
6416done
6417if test -z "$ac_sed_cmds"; then
6418  ac_sed_cmds=cat
6419fi
6420EOF
6421
6422cat >> $CONFIG_STATUS <<EOF
6423
6424CONFIG_FILES=\${CONFIG_FILES-"${tk_config_files}"}
6425EOF
6426cat >> $CONFIG_STATUS <<\EOF
6427for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
6428  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
6429  case "$ac_file" in
6430  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
6431       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
6432  *) ac_file_in="${ac_file}.in" ;;
6433  esac
6434
6435  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
6436
6437  # Remove last slash and all that follows it.  Not all systems have dirname.
6438  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
6439  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
6440    # The file is in a subdirectory.
6441    test ! -d "$ac_dir" && mkdir "$ac_dir"
6442    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
6443    # A "../" for each directory in $ac_dir_suffix.
6444    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
6445  else
6446    ac_dir_suffix= ac_dots=
6447  fi
6448
6449  case "$ac_given_srcdir" in
6450  .)  srcdir=.
6451      if test -z "$ac_dots"; then top_srcdir=.
6452      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
6453  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
6454  *) # Relative path.
6455    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
6456    top_srcdir="$ac_dots$ac_given_srcdir" ;;
6457  esac
6458
6459
6460  echo creating "$ac_file"
6461  rm -f "$ac_file"
6462  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
6463  case "$ac_file" in
6464  *Makefile*) ac_comsub="1i\\
6465# $configure_input" ;;
6466  *) ac_comsub= ;;
6467  esac
6468
6469  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
6470  sed -e "$ac_comsub
6471s%@configure_input@%$configure_input%g
6472s%@srcdir@%$srcdir%g
6473s%@top_srcdir@%$top_srcdir%g
6474" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
6475fi; done
6476rm -f conftest.s*
6477
6478EOF
6479cat >> $CONFIG_STATUS <<EOF
6480VERSION=${TK_VERSION} FRAMEWORK_BUILD=${FRAMEWORK_BUILD}
6481	tk_aqua=${tk_aqua}
6482
6483EOF
6484cat >> $CONFIG_STATUS <<\EOF
6485test "$FRAMEWORK_BUILD" = "1" && n=Tk &&
6486	f=$n.framework && v=Versions/$VERSION &&
6487	echo "creating $f" && rm -rf $f && mkdir -p $f/$v/Resources &&
6488	ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v &&
6489	ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist &&
6490	if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi &&
6491	unset n f v
6492    
6493
6494exit 0
6495EOF
6496chmod +x $CONFIG_STATUS
6497rm -fr confdefs* $ac_clean_files
6498test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
6499
6500