Debian Codegraph @

pTk/mTk/unix/configure

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