1#! /bin/sh
2
3# From configure.in Id: configure.in
4# Guess values for system-dependent variables and create Makefiles.
5# Generated automatically using autoconf version 2.13 
6# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
7#
8# This configure script is free software; the Free Software Foundation
9# gives unlimited permission to copy, distribute and modify it.
10
11# Defaults:
12ac_help=
13ac_default_prefix=/usr/local
14# Any additions from configure.in:
15ac_help="$ac_help
16  --with-tcl=DIR		tcl.h resides in DIR/include, libtcl resides in DIR/lib"
17ac_help="$ac_help
18  --with-tcl-include-dir=DIR	tcl.h resides in DIR"
19ac_help="$ac_help
20  --with-tcl-lib-dir=DIR	libtcl resides in DIR"
21ac_help="$ac_help
22  --disable-shared		don't build memchan as a shared library"
23
24# Initialize some variables set by options.
25# The variables have the same names as the options, with
26# dashes changed to underlines.
27build=NONE
28cache_file=./config.cache
29exec_prefix=NONE
30host=NONE
31no_create=
32nonopt=NONE
33no_recursion=
34prefix=NONE
35program_prefix=NONE
36program_suffix=NONE
37program_transform_name=s,x,x,
38silent=
39site=
40srcdir=
41target=NONE
42verbose=
43x_includes=NONE
44x_libraries=NONE
45bindir='${exec_prefix}/bin'
46sbindir='${exec_prefix}/sbin'
47libexecdir='${exec_prefix}/libexec'
48datadir='${prefix}/share'
49sysconfdir='${prefix}/etc'
50sharedstatedir='${prefix}/com'
51localstatedir='${prefix}/var'
52libdir='${exec_prefix}/lib'
53includedir='${prefix}/include'
54oldincludedir='/usr/include'
55infodir='${prefix}/info'
56mandir='${prefix}/man'
57
58# Initialize some other variables.
59subdirs=
60MFLAGS= MAKEFLAGS=
61SHELL=${CONFIG_SHELL-/bin/sh}
62# Maximum number of lines to put in a shell here document.
63ac_max_here_lines=12
64
65ac_prev=
66for ac_option
67do
68
69  # If the previous option needs an argument, assign it.
70  if test -n "$ac_prev"; then
71    eval "$ac_prev=\$ac_option"
72    ac_prev=
73    continue
74  fi
75
76  case "$ac_option" in
77  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
78  *) ac_optarg= ;;
79  esac
80
81  # Accept the important Cygnus configure options, so we can diagnose typos.
82
83  case "$ac_option" in
84
85  -bindir | --bindir | --bindi | --bind | --bin | --bi)
86    ac_prev=bindir ;;
87  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
88    bindir="$ac_optarg" ;;
89
90  -build | --build | --buil | --bui | --bu)
91    ac_prev=build ;;
92  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
93    build="$ac_optarg" ;;
94
95  -cache-file | --cache-file | --cache-fil | --cache-fi \
96  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
97    ac_prev=cache_file ;;
98  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
99  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
100    cache_file="$ac_optarg" ;;
101
102  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
103    ac_prev=datadir ;;
104  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
105  | --da=*)
106    datadir="$ac_optarg" ;;
107
108  -disable-* | --disable-*)
109    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
110    # Reject names that are not valid shell variable names.
111    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
112      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
113    fi
114    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
115    eval "enable_${ac_feature}=no" ;;
116
117  -enable-* | --enable-*)
118    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
119    # Reject names that are not valid shell variable names.
120    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
121      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
122    fi
123    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
124    case "$ac_option" in
125      *=*) ;;
126      *) ac_optarg=yes ;;
127    esac
128    eval "enable_${ac_feature}='$ac_optarg'" ;;
129
130  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
131  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
132  | --exec | --exe | --ex)
133    ac_prev=exec_prefix ;;
134  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
135  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
136  | --exec=* | --exe=* | --ex=*)
137    exec_prefix="$ac_optarg" ;;
138
139  -gas | --gas | --ga | --g)
140    # Obsolete; use --with-gas.
141    with_gas=yes ;;
142
143  -help | --help | --hel | --he)
144    # Omit some internal or obsolete options to make the list less imposing.
145    # This message is too long to be a string in the A/UX 3.1 sh.
146    cat << EOF
147Usage: configure [options] [host]
148Options: [defaults in brackets after descriptions]
149Configuration:
150  --cache-file=FILE       cache test results in FILE
151  --help                  print this message
152  --no-create             do not create output files
153  --quiet, --silent       do not print \`checking...' messages
154  --version               print the version of autoconf that created configure
155Directory and file names:
156  --prefix=PREFIX         install architecture-independent files in PREFIX
157                          [$ac_default_prefix]
158  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
159                          [same as prefix]
160  --bindir=DIR            user executables in DIR [EPREFIX/bin]
161  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
162  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
163  --datadir=DIR           read-only architecture-independent data in DIR
164                          [PREFIX/share]
165  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
166  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
167                          [PREFIX/com]
168  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
169  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
170  --includedir=DIR        C header files in DIR [PREFIX/include]
171  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
172  --infodir=DIR           info documentation in DIR [PREFIX/info]
173  --mandir=DIR            man documentation in DIR [PREFIX/man]
174  --srcdir=DIR            find the sources in DIR [configure dir or ..]
175  --program-prefix=PREFIX prepend PREFIX to installed program names
176  --program-suffix=SUFFIX append SUFFIX to installed program names
177  --program-transform-name=PROGRAM
178                          run sed PROGRAM on installed program names
179EOF
180    cat << EOF
181Host type:
182  --build=BUILD           configure for building on BUILD [BUILD=HOST]
183  --host=HOST             configure for HOST [guessed]
184  --target=TARGET         configure for TARGET [TARGET=HOST]
185Features and packages:
186  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
187  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
188  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
189  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
190  --x-includes=DIR        X include files are in DIR
191  --x-libraries=DIR       X library files are in DIR
192EOF
193    if test -n "$ac_help"; then
194      echo "--enable and --with options recognized:$ac_help"
195    fi
196    exit 0 ;;
197
198  -host | --host | --hos | --ho)
199    ac_prev=host ;;
200  -host=* | --host=* | --hos=* | --ho=*)
201    host="$ac_optarg" ;;
202
203  -includedir | --includedir | --includedi | --included | --include \
204  | --includ | --inclu | --incl | --inc)
205    ac_prev=includedir ;;
206  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
207  | --includ=* | --inclu=* | --incl=* | --inc=*)
208    includedir="$ac_optarg" ;;
209
210  -infodir | --infodir | --infodi | --infod | --info | --inf)
211    ac_prev=infodir ;;
212  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
213    infodir="$ac_optarg" ;;
214
215  -libdir | --libdir | --libdi | --libd)
216    ac_prev=libdir ;;
217  -libdir=* | --libdir=* | --libdi=* | --libd=*)
218    libdir="$ac_optarg" ;;
219
220  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
221  | --libexe | --libex | --libe)
222    ac_prev=libexecdir ;;
223  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
224  | --libexe=* | --libex=* | --libe=*)
225    libexecdir="$ac_optarg" ;;
226
227  -localstatedir | --localstatedir | --localstatedi | --localstated \
228  | --localstate | --localstat | --localsta | --localst \
229  | --locals | --local | --loca | --loc | --lo)
230    ac_prev=localstatedir ;;
231  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
232  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
233  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
234    localstatedir="$ac_optarg" ;;
235
236  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
237    ac_prev=mandir ;;
238  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
239    mandir="$ac_optarg" ;;
240
241  -nfp | --nfp | --nf)
242    # Obsolete; use --without-fp.
243    with_fp=no ;;
244
245  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
246  | --no-cr | --no-c)
247    no_create=yes ;;
248
249  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
250  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
251    no_recursion=yes ;;
252
253  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
254  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
255  | --oldin | --oldi | --old | --ol | --o)
256    ac_prev=oldincludedir ;;
257  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
258  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
259  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
260    oldincludedir="$ac_optarg" ;;
261
262  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
263    ac_prev=prefix ;;
264  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
265    prefix="$ac_optarg" ;;
266
267  -program-prefix | --program-prefix | --program-prefi | --program-pref \
268  | --program-pre | --program-pr | --program-p)
269    ac_prev=program_prefix ;;
270  -program-prefix=* | --program-prefix=* | --program-prefi=* \
271  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
272    program_prefix="$ac_optarg" ;;
273
274  -program-suffix | --program-suffix | --program-suffi | --program-suff \
275  | --program-suf | --program-su | --program-s)
276    ac_prev=program_suffix ;;
277  -program-suffix=* | --program-suffix=* | --program-suffi=* \
278  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
279    program_suffix="$ac_optarg" ;;
280
281  -program-transform-name | --program-transform-name \
282  | --program-transform-nam | --program-transform-na \
283  | --program-transform-n | --program-transform- \
284  | --program-transform | --program-transfor \
285  | --program-transfo | --program-transf \
286  | --program-trans | --program-tran \
287  | --progr-tra | --program-tr | --program-t)
288    ac_prev=program_transform_name ;;
289  -program-transform-name=* | --program-transform-name=* \
290  | --program-transform-nam=* | --program-transform-na=* \
291  | --program-transform-n=* | --program-transform-=* \
292  | --program-transform=* | --program-transfor=* \
293  | --program-transfo=* | --program-transf=* \
294  | --program-trans=* | --program-tran=* \
295  | --progr-tra=* | --program-tr=* | --program-t=*)
296    program_transform_name="$ac_optarg" ;;
297
298  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
299  | -silent | --silent | --silen | --sile | --sil)
300    silent=yes ;;
301
302  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
303    ac_prev=sbindir ;;
304  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
305  | --sbi=* | --sb=*)
306    sbindir="$ac_optarg" ;;
307
308  -sharedstatedir | --sharedstatedir | --sharedstatedi \
309  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
310  | --sharedst | --shareds | --shared | --share | --shar \
311  | --sha | --sh)
312    ac_prev=sharedstatedir ;;
313  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
314  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
315  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
316  | --sha=* | --sh=*)
317    sharedstatedir="$ac_optarg" ;;
318
319  -site | --site | --sit)
320    ac_prev=site ;;
321  -site=* | --site=* | --sit=*)
322    site="$ac_optarg" ;;
323
324  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
325    ac_prev=srcdir ;;
326  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
327    srcdir="$ac_optarg" ;;
328
329  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
330  | --syscon | --sysco | --sysc | --sys | --sy)
331    ac_prev=sysconfdir ;;
332  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
333  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
334    sysconfdir="$ac_optarg" ;;
335
336  -target | --target | --targe | --targ | --tar | --ta | --t)
337    ac_prev=target ;;
338  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
339    target="$ac_optarg" ;;
340
341  -v | -verbose | --verbose | --verbos | --verbo | --verb)
342    verbose=yes ;;
343
344  -version | --version | --versio | --versi | --vers)
345    echo "configure generated by autoconf version 2.13"
346    exit 0 ;;
347
348  -with-* | --with-*)
349    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
350    # Reject names that are not valid shell variable names.
351    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
352      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
353    fi
354    ac_package=`echo $ac_package| sed 's/-/_/g'`
355    case "$ac_option" in
356      *=*) ;;
357      *) ac_optarg=yes ;;
358    esac
359    eval "with_${ac_package}='$ac_optarg'" ;;
360
361  -without-* | --without-*)
362    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
363    # Reject names that are not valid shell variable names.
364    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
365      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
366    fi
367    ac_package=`echo $ac_package| sed 's/-/_/g'`
368    eval "with_${ac_package}=no" ;;
369
370  --x)
371    # Obsolete; use --with-x.
372    with_x=yes ;;
373
374  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
375  | --x-incl | --x-inc | --x-in | --x-i)
376    ac_prev=x_includes ;;
377  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
378  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
379    x_includes="$ac_optarg" ;;
380
381  -x-libraries | --x-libraries | --x-librarie | --x-librari \
382  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
383    ac_prev=x_libraries ;;
384  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
385  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
386    x_libraries="$ac_optarg" ;;
387
388  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
389    ;;
390
391  *)
392    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
393      echo "configure: warning: $ac_option: invalid host type" 1>&2
394    fi
395    if test "x$nonopt" != xNONE; then
396      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
397    fi
398    nonopt="$ac_option"
399    ;;
400
401  esac
402done
403
404if test -n "$ac_prev"; then
405  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
406fi
407
408trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
409
410# File descriptor usage:
411# 0 standard input
412# 1 file creation
413# 2 errors and warnings
414# 3 some systems may open it to /dev/tty
415# 4 used on the Kubota Titan
416# 6 checking for... messages and results
417# 5 compiler messages saved in config.log
418if test "$silent" = yes; then
419  exec 6>/dev/null
420else
421  exec 6>&1
422fi
423exec 5>./config.log
424
425echo "\
426This file contains any messages produced by compilers while
427running configure, to aid debugging if configure makes a mistake.
428" 1>&5
429
430# Strip out --no-create and --no-recursion so they do not pile up.
431# Also quote any args containing shell metacharacters.
432ac_configure_args=
433for ac_arg
434do
435  case "$ac_arg" in
436  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
437  | --no-cr | --no-c) ;;
438  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
439  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
440  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
441  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
442  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
443  esac
444done
445
446# NLS nuisances.
447# Only set these to C if already set.  These must not be set unconditionally
448# because not all systems understand e.g. LANG=C (notably SCO).
449# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
450# Non-C LC_CTYPE values break the ctype check.
451if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
452if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
453if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
454if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
455
456# confdefs.h avoids OS command line length limits that DEFS can exceed.
457rm -rf conftest* confdefs.h
458# AIX cpp loses on an empty file, so make sure it contains at least a newline.
459echo > confdefs.h
460
461# A filename unique to this package, relative to the directory that
462# configure is in, which we can look for to find out if srcdir is correct.
463ac_unique_file=Makefile.in
464
465# Find the source files, if location was not specified.
466if test -z "$srcdir"; then
467  ac_srcdir_defaulted=yes
468  # Try the directory containing this script, then its parent.
469  ac_prog=$0
470  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
471  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
472  srcdir=$ac_confdir
473  if test ! -r $srcdir/$ac_unique_file; then
474    srcdir=..
475  fi
476else
477  ac_srcdir_defaulted=no
478fi
479if test ! -r $srcdir/$ac_unique_file; then
480  if test "$ac_srcdir_defaulted" = yes; then
481    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
482  else
483    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
484  fi
485fi
486srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
487
488# Prefer explicitly selected file to automatically selected ones.
489if test -z "$CONFIG_SITE"; then
490  if test "x$prefix" != xNONE; then
491    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
492  else
493    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
494  fi
495fi
496for ac_site_file in $CONFIG_SITE; do
497  if test -r "$ac_site_file"; then
498    echo "loading site script $ac_site_file"
499    . "$ac_site_file"
500  fi
501done
502
503if test -r "$cache_file"; then
504  echo "loading cache $cache_file"
505  . $cache_file
506else
507  echo "creating cache $cache_file"
508  > $cache_file
509fi
510
511ac_ext=c
512# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
513ac_cpp='$CPP $CPPFLAGS'
514ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
515ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
516cross_compiling=$ac_cv_prog_cc_cross
517
518ac_exeext=
519ac_objext=o
520if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
521  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
522  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
523    ac_n= ac_c='
524' ac_t='	'
525  else
526    ac_n=-n ac_c= ac_t=
527  fi
528else
529  ac_n= ac_c='\c' ac_t=
530fi
531
532
533
534MEMCHAN_VERSION=2.2.0
535MEMCHAN_MAJOR_VERSION=2
536MEMCHAN_MINOR_VERSION=2
537VERSION=${MEMCHAN_VERSION}
538
539TCL_REQ_MAJOR_VERSION=8
540TCL_REQ_MINOR_VERSION=0
541
542
543
544if test "x$prefix" = xNONE; then
545echo $ac_n "checking for prefix by $ac_c" 1>&6
546# Extract the first word of "tclsh", so it can be a program name with args.
547set dummy tclsh; ac_word=$2
548echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
549echo "configure:550: checking for $ac_word" >&5
550if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
551  echo $ac_n "(cached) $ac_c" 1>&6
552else
553  case "$TCLSH" in
554  /*)
555  ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
556  ;;
557  ?:/*)			 
558  ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a dos path.
559  ;;
560  *)
561  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
562  ac_dummy="$PATH"
563  for ac_dir in $ac_dummy; do 
564    test -z "$ac_dir" && ac_dir=.
565    if test -f $ac_dir/$ac_word; then
566      ac_cv_path_TCLSH="$ac_dir/$ac_word"
567      break
568    fi
569  done
570  IFS="$ac_save_ifs"
571  ;;
572esac
573fi
574TCLSH="$ac_cv_path_TCLSH"
575if test -n "$TCLSH"; then
576  echo "$ac_t""$TCLSH" 1>&6
577else
578  echo "$ac_t""no" 1>&6
579fi
580
581  if test -n "$ac_cv_path_TCLSH"; then
582    prefix=`echo $ac_cv_path_TCLSH|sed 's%/[^/][^/]*//*[^/][^/]*$%%'`
583  fi
584fi
585
586
587if test "x${prefix}" = "xNONE"
588then
589    prefix=/usr/local
590fi
591if test "x${exec_prefix}" = "xNONE"
592then
593    exec_prefix="${prefix}"
594fi
595
596# -------------------------------------------------------------------
597
598BUILD_DIR=`pwd`
599cd ${srcdir}
600TOP_DIR=`pwd`
601cd ${BUILD_DIR}
602
603
604
605
606
607# Check whether --with-tcl or --without-tcl was given.
608if test "${with_tcl+set}" = set; then
609  withval="$with_tcl"
610  TCL_LIB_DIR=$withval/lib; TCL_INCLUDE_DIR=$withval/include
611fi
612
613# Check whether --with-tcl-include-dir or --without-tcl-include-dir was given.
614if test "${with_tcl_include_dir+set}" = set; then
615  withval="$with_tcl_include_dir"
616  TCL_INCLUDE_DIR=$withval
617fi
618
619# Check whether --with-tcl-lib-dir or --without-tcl-lib-dir was given.
620if test "${with_tcl_lib_dir+set}" = set; then
621  withval="$with_tcl_lib_dir"
622  TCL_LIB_DIR=$withval
623fi
624
625
626# Check whether --enable-shared or --disable-shared was given.
627if test "${enable_shared+set}" = set; then
628  enableval="$enable_shared"
629  ok=$enableval
630else
631  ok=yes
632fi
633
634
635
636if test "X" = "X$TCL_LIB_DIR" -a "X" != "X$TCL_INCLUDE_DIR"
637then
638    TCL_LIB_DIR="$TCL_INCLUDE_DIR/../lib"
639fi
640
641if test "X" = "X$TCL_INCLUDE_DIR" -a "X" != "X$TCL_LIB_DIR"
642then
643    TCL_INCLUDE_DIR="$TCL_LIB_DIR/../include"
644fi
645
646# Extract the first word of "gcc", so it can be a program name with args.
647set dummy gcc; ac_word=$2
648echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
649echo "configure:650: checking for $ac_word" >&5
650if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
651  echo $ac_n "(cached) $ac_c" 1>&6
652else
653  if test -n "$CC"; then
654  ac_cv_prog_CC="$CC" # Let the user override the test.
655else
656  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
657  ac_dummy="$PATH"
658  for ac_dir in $ac_dummy; do
659    test -z "$ac_dir" && ac_dir=.
660    if test -f $ac_dir/$ac_word; then
661      ac_cv_prog_CC="gcc"
662      break
663    fi
664  done
665  IFS="$ac_save_ifs"
666fi
667fi
668CC="$ac_cv_prog_CC"
669if test -n "$CC"; then
670  echo "$ac_t""$CC" 1>&6
671else
672  echo "$ac_t""no" 1>&6
673fi
674
675if test -z "$CC"; then
676  # Extract the first word of "cc", so it can be a program name with args.
677set dummy cc; ac_word=$2
678echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
679echo "configure:680: checking for $ac_word" >&5
680if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
681  echo $ac_n "(cached) $ac_c" 1>&6
682else
683  if test -n "$CC"; then
684  ac_cv_prog_CC="$CC" # Let the user override the test.
685else
686  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
687  ac_prog_rejected=no
688  ac_dummy="$PATH"
689  for ac_dir in $ac_dummy; do
690    test -z "$ac_dir" && ac_dir=.
691    if test -f $ac_dir/$ac_word; then
692      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
693        ac_prog_rejected=yes
694	continue
695      fi
696      ac_cv_prog_CC="cc"
697      break
698    fi
699  done
700  IFS="$ac_save_ifs"
701if test $ac_prog_rejected = yes; then
702  # We found a bogon in the path, so make sure we never use it.
703  set dummy $ac_cv_prog_CC
704  shift
705  if test $# -gt 0; then
706    # We chose a different compiler from the bogus one.
707    # However, it has the same basename, so the bogon will be chosen
708    # first if we set CC to just the basename; use the full file name.
709    shift
710    set dummy "$ac_dir/$ac_word" "$@"
711    shift
712    ac_cv_prog_CC="$@"
713  fi
714fi
715fi
716fi
717CC="$ac_cv_prog_CC"
718if test -n "$CC"; then
719  echo "$ac_t""$CC" 1>&6
720else
721  echo "$ac_t""no" 1>&6
722fi
723
724  if test -z "$CC"; then
725    case "`uname -s`" in
726    *win32* | *WIN32*)
727      # Extract the first word of "cl", so it can be a program name with args.
728set dummy cl; ac_word=$2
729echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
730echo "configure:731: checking for $ac_word" >&5
731if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
732  echo $ac_n "(cached) $ac_c" 1>&6
733else
734  if test -n "$CC"; then
735  ac_cv_prog_CC="$CC" # Let the user override the test.
736else
737  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
738  ac_dummy="$PATH"
739  for ac_dir in $ac_dummy; do
740    test -z "$ac_dir" && ac_dir=.
741    if test -f $ac_dir/$ac_word; then
742      ac_cv_prog_CC="cl"
743      break
744    fi
745  done
746  IFS="$ac_save_ifs"
747fi
748fi
749CC="$ac_cv_prog_CC"
750if test -n "$CC"; then
751  echo "$ac_t""$CC" 1>&6
752else
753  echo "$ac_t""no" 1>&6
754fi
755 ;;
756    esac
757  fi
758  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
759fi
760
761echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
762echo "configure:763: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
763
764ac_ext=c
765# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
766ac_cpp='$CPP $CPPFLAGS'
767ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
768ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
769cross_compiling=$ac_cv_prog_cc_cross
770
771cat > conftest.$ac_ext << EOF
772
773#line 774 "configure"
774#include "confdefs.h"
775
776main(){return(0);}
777EOF
778if { (eval echo configure:779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
779  ac_cv_prog_cc_works=yes
780  # If we can't run a trivial program, we are probably using a cross compiler.
781  if (./conftest; exit) 2>/dev/null; then
782    ac_cv_prog_cc_cross=no
783  else
784    ac_cv_prog_cc_cross=yes
785  fi
786else
787  echo "configure: failed program was:" >&5
788  cat conftest.$ac_ext >&5
789  ac_cv_prog_cc_works=no
790fi
791rm -fr conftest*
792ac_ext=c
793# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
794ac_cpp='$CPP $CPPFLAGS'
795ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
796ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
797cross_compiling=$ac_cv_prog_cc_cross
798
799echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
800if test $ac_cv_prog_cc_works = no; then
801  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
802fi
803echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
804echo "configure:805: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
805echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
806cross_compiling=$ac_cv_prog_cc_cross
807
808echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
809echo "configure:810: checking whether we are using GNU C" >&5
810if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
811  echo $ac_n "(cached) $ac_c" 1>&6
812else
813  cat > conftest.c <<EOF
814#ifdef __GNUC__
815  yes;
816#endif
817EOF
818if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
819  ac_cv_prog_gcc=yes
820else
821  ac_cv_prog_gcc=no
822fi
823fi
824
825echo "$ac_t""$ac_cv_prog_gcc" 1>&6
826
827if test $ac_cv_prog_gcc = yes; then
828  GCC=yes
829else
830  GCC=
831fi
832
833ac_test_CFLAGS="${CFLAGS+set}"
834ac_save_CFLAGS="$CFLAGS"
835CFLAGS=
836echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
837echo "configure:838: checking whether ${CC-cc} accepts -g" >&5
838if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
839  echo $ac_n "(cached) $ac_c" 1>&6
840else
841  echo 'void f(){}' > conftest.c
842if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
843  ac_cv_prog_cc_g=yes
844else
845  ac_cv_prog_cc_g=no
846fi
847rm -f conftest*
848
849fi
850
851echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
852if test "$ac_test_CFLAGS" = set; then
853  CFLAGS="$ac_save_CFLAGS"
854elif test $ac_cv_prog_cc_g = yes; then
855  if test "$GCC" = yes; then
856    CFLAGS="-g -O2"
857  else
858    CFLAGS="-g"
859  fi
860else
861  if test "$GCC" = yes; then
862    CFLAGS="-O2"
863  else
864    CFLAGS=
865  fi
866fi
867
868echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
869echo "configure:870: checking how to run the C preprocessor" >&5
870# On Suns, sometimes $CPP names a directory.
871if test -n "$CPP" && test -d "$CPP"; then
872  CPP=
873fi
874if test -z "$CPP"; then
875if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
876  echo $ac_n "(cached) $ac_c" 1>&6
877else
878    # This must be in double quotes, not single quotes, because CPP may get
879  # substituted into the Makefile and "${CC-cc}" will confuse make.
880  CPP="${CC-cc} -E"
881  # On the NeXT, cc -E runs the code through the compiler's parser,
882  # not just through cpp.
883  cat > conftest.$ac_ext <<EOF
884#line 885 "configure"
885#include "confdefs.h"
886#include <assert.h>
887Syntax Error
888EOF
889ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
890{ (eval echo configure:891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
891ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
892if test -z "$ac_err"; then
893  :
894else
895  echo "$ac_err" >&5
896  echo "configure: failed program was:" >&5
897  cat conftest.$ac_ext >&5
898  rm -rf conftest*
899  CPP="${CC-cc} -E -traditional-cpp"
900  cat > conftest.$ac_ext <<EOF
901#line 902 "configure"
902#include "confdefs.h"
903#include <assert.h>
904Syntax Error
905EOF
906ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
907{ (eval echo configure:908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
908ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
909if test -z "$ac_err"; then
910  :
911else
912  echo "$ac_err" >&5
913  echo "configure: failed program was:" >&5
914  cat conftest.$ac_ext >&5
915  rm -rf conftest*
916  CPP="${CC-cc} -nologo -E"
917  cat > conftest.$ac_ext <<EOF
918#line 919 "configure"
919#include "confdefs.h"
920#include <assert.h>
921Syntax Error
922EOF
923ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
924{ (eval echo configure:925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
925ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
926if test -z "$ac_err"; then
927  :
928else
929  echo "$ac_err" >&5
930  echo "configure: failed program was:" >&5
931  cat conftest.$ac_ext >&5
932  rm -rf conftest*
933  CPP=/lib/cpp
934fi
935rm -f conftest*
936fi
937rm -f conftest*
938fi
939rm -f conftest*
940  ac_cv_prog_CPP="$CPP"
941fi
942  CPP="$ac_cv_prog_CPP"
943else
944  ac_cv_prog_CPP="$CPP"
945fi
946echo "$ac_t""$CPP" 1>&6
947
948# Extract the first word of "ranlib", so it can be a program name with args.
949set dummy ranlib; ac_word=$2
950echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
951echo "configure:952: checking for $ac_word" >&5
952if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
953  echo $ac_n "(cached) $ac_c" 1>&6
954else
955  if test -n "$RANLIB"; then
956  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
957else
958  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
959  ac_dummy="$PATH"
960  for ac_dir in $ac_dummy; do
961    test -z "$ac_dir" && ac_dir=.
962    if test -f $ac_dir/$ac_word; then
963      ac_cv_prog_RANLIB="ranlib"
964      break
965    fi
966  done
967  IFS="$ac_save_ifs"
968  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
969fi
970fi
971RANLIB="$ac_cv_prog_RANLIB"
972if test -n "$RANLIB"; then
973  echo "$ac_t""$RANLIB" 1>&6
974else
975  echo "$ac_t""no" 1>&6
976fi
977
978
979echo $ac_n "checking for directory with tcl.h""... $ac_c" 1>&6
980echo "configure:981: checking for directory with tcl.h" >&5
981if eval "test \"`echo '$''{'memchan_cv_path_TCL_INCLUDE_DIR'+set}'`\" = set"; then
982  echo $ac_n "(cached) $ac_c" 1>&6
983else
984  memchan_cv_path_TCL_INCLUDE_DIR=""
985	 places="$TCL_INCLUDE_DIR \
986		../../tcl8.3.*/generic \
987		../../tcl8.3/generic \
988		../../tcl8.2.*/generic \
989		../../tcl8.2/generic \
990		../../tcl8.2b*/generic \
991		../../tcl8.2a*/generic \
992		../../tcl8.2.*/generic \
993		../../tcl8.1/generic \
994		../../tcl8.1b*/generic \
995		../../tcl8.1a*/generic \
996		../../tcl8.0.*/generic \
997		../../tcl8.0/generic \
998		../../tcl/generic \
999		../../tcl \
1000		$prefix/include \
1001		/usr/local/include \
1002		/usr/include"
1003     for dir in $places; do
1004         if test -r $dir/tcl.h ; then
1005            memchan_cv_path_TCL_INCLUDE_DIR=$dir
1006            break
1007         fi
1008     done
1009fi
1010
1011echo "$ac_t""$memchan_cv_path_TCL_INCLUDE_DIR" 1>&6
1012TCL_INCLUDE_DIR=$memchan_cv_path_TCL_INCLUDE_DIR
1013if test -z "$TCL_INCLUDE_DIR" ; then
1014    { echo "configure: error: not found; use --with-tcl=DIR or --with-tcl-include-dir=DIR" 1>&2; exit 1; }
1015fi
1016echo $ac_n "checking for up-to-date version of Tcl""... $ac_c" 1>&6
1017echo "configure:1018: checking for up-to-date version of Tcl" >&5
1018if eval "test \"`echo '$''{'memchan_cv_vers_good_tcl_version'+set}'`\" = set"; then
1019  echo $ac_n "(cached) $ac_c" 1>&6
1020else
1021  
1022    ac_save_cppflags="$CPPFLAGS"
1023    CPPFLAGS="-I$TCL_INCLUDE_DIR $CPPFLAGS"
1024    cat > conftest.$ac_ext <<EOF
1025#line 1026 "configure"
1026#include "confdefs.h"
1027#include <tcl.h>
1028#if ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 0))
1029    good_tcl_version
1030#endif
1031#if (TCL_MAJOR_VERSION > 8)
1032    good_tcl_version
1033#endif
1034EOF
1035if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1036  egrep "good_tcl_version" >/dev/null 2>&1; then
1037  rm -rf conftest*
1038  memchan_cv_vers_good_tcl_version=yes
1039else
1040  rm -rf conftest*
1041  memchan_cv_vers_good_tcl_version=no
1042fi
1043rm -f conftest*
1044
1045    CPPFLAGS=$ac_save_cppflags
1046fi
1047
1048echo "$ac_t""$memchan_cv_vers_good_tcl_version" 1>&6
1049
1050if test "$memchan_cv_vers_good_tcl_version" = "no"; then
1051    { echo "configure: error: Your Tcl must be at least version 8.0" 1>&2; exit 1; }
1052fi
1053
1054
1055echo $ac_n "checking for tcl library""... $ac_c" 1>&6
1056echo "configure:1057: checking for tcl library" >&5
1057if eval "test \"`echo '$''{'memchan_cv_lib_TCL_LIB'+set}'`\" = set"; then
1058  echo $ac_n "(cached) $ac_c" 1>&6
1059else
1060  memchan_cv_lib_TCL_LIB=""
1061	 places="$TCL_LIB_DIR \
1062	../../tcl8.2.*/unix \
1063	../../tcl8.2/unix \
1064	../../tcl8.3.*/unix \
1065	../../tcl8.3/unix \
1066	../../tcl8.2b*/unix \
1067	../../tcl8.2a*/unix \
1068	../../tcl8.1.*/unix \
1069	../../tcl8.1/unix \
1070	../../tcl8.1b*/unix \
1071	../../tcl8.1a*/unix \
1072	../../tcl8.0.*/unix \
1073	../../tcl8.0/unix \
1074	../../tcl/unix \
1075	../../tcl \
1076	 $exec_prefix/lib \
1077	 $prefix/lib \
1078	 /usr/local/lib \
1079	 /usr/lib"
1080    for dir in $places; do
1081        if test -n "$memchan_cv_lib_TCL_LIB"; then
1082            break
1083        fi
1084        for version in 8.3 8.2 8.1.1 8.1 8.0.5 8.0.4 8.0.3 8.0 83 82 811 81 805 804 803 80 ""; do
1085            if test -n "$memchan_cv_lib_TCL_LIB"; then
1086                break
1087            fi
1088            for libsuff in .so ".so.*" .sl .a; do
1089                if test -n "$memchan_cv_lib_TCL_LIB"; then
1090                    break
1091                fi
1092                if test -f $dir/libtcl$version$libsuff; then
1093                    memchan_cv_lib_TCL_LIB="-L$dir -ltcl$version"
1094		    TCL_LIB_DIR="$dir"
1095                fi
1096            done
1097        done
1098    done
1099fi
1100
1101echo "$ac_t""$memchan_cv_lib_TCL_LIB" 1>&6
1102
1103TCL_LIB="$memchan_cv_lib_TCL_LIB"
1104if test -z "$TCL_LIB" ; then
1105    { echo "configure: error: not found; use --with-tcl-lib-dir=path" 1>&2; exit 1; }
1106fi
1107
1108
1109
1110if eval "test \"`echo '$''{'memchan_cv_TCL_LIB_DIR'+set}'`\" = set"; then
1111  echo $ac_n "(cached) $ac_c" 1>&6
1112else
1113  memchan_cv_TCL_LIB_DIR="$TCL_LIB_DIR"
1114fi
1115
1116TCL_LIB_DIR="$memchan_cv_TCL_LIB_DIR"
1117
1118
1119#--------------------------------------------------------------------
1120#	Read in configuration information generated by Tcl for shared
1121#	libraries, and arrange for it to be substituted into our
1122#	Makefile.
1123#--------------------------------------------------------------------
1124
1125file=$TCL_LIB_DIR/tclConfig.sh
1126. $file
1127CC=$TCL_CC
1128SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
1129SHLIB_LD=$TCL_SHLIB_LD
1130SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
1131SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
1132SHLIB_VERSION=$TCL_SHLIB_VERSION
1133DL_LIBS=$TCL_DL_LIBS
1134LD_FLAGS=$TCL_LD_FLAGS
1135
1136eval "MEMCHAN_CC_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\""
1137
1138case $SHLIB_LD in
1139*ld*)
1140      MEMCHAN_LD_SEARCH_FLAGS=`echo ${MEMCHAN_CC_SEARCH_FLAGS} |sed -e "s|-Wl,||g" -e "s|,| |g"`
1141      ;;
1142*)
1143      MEMCHAN_LD_SEARCH_FLAGS="${MEMCHAN_CC_SEARCH_FLAGS}"
1144      ;;
1145esac
1146
1147
1148TCL_BASE=`echo ${TCL_LIB_SPEC} |sed -e "s|^.*-l||"`
1149TCL_STUB_BASE=`echo ${TCL_STUB_LIB_SPEC} |sed -e "s|^.*-l||"`
1150
1151
1152TCL_LIB_SPEC="-L${TCL_LIB_DIR} -l${TCL_BASE}"
1153TCL_STUB_LIB_SPEC="-L${TCL_LIB_DIR} -l${TCL_STUB_BASE}"
1154VERSION=""
1155eval "TCL_UNSHARED_LIB_FILE=lib${TCL_BASE}${TCL_UNSHARED_LIB_SUFFIX}"
1156eval "TCL_SHARED_LIB_FILE=lib${TCL_BASE}${TCL_SHARED_LIB_SUFFIX}"
1157
1158
1159#--------------------------------------------------------------------
1160#	The statements below define a collection of symbols related to
1161#	building libmemchan as a shared library instead of a static library.
1162#--------------------------------------------------------------------
1163
1164TCL_SHARED_LIBS=""
1165#--------------------------------------------------------------------
1166
1167# Use stubs <=> (((major == 8) && (minor > 0)) || (major > 8)) && 'memchan as shared library'
1168
1169echo $ac_n "checking for stubs""... $ac_c" 1>&6
1170echo "configure:1171: checking for stubs" >&5
1171
1172if test \( \( $TCL_MAJOR_VERSION -eq 8 -a $TCL_MINOR_VERSION -gt 0 \) -o $TCL_MAJOR_VERSION -gt 8 \) -a "x$ok" = "xyes"
1173then
1174    echo "$ac_t""yes" 1>&6
1175    MC_USING_STUBS=1
1176    # Stubs
1177    TCL_DEFS="$TCL_DEFS -DUSE_TCL_STUBS"
1178    TCL_SHARED_LIBS="${TCL_STUB_LIB_SPEC}"
1179else
1180    echo "$ac_t""no" 1>&6
1181    MC_USING_STUBS=0
1182    # No stubs
1183    case "$SHLIB_LD" in
1184	*ldAix*)
1185	TCL_SHARED_LIBS='${TCL_LIB_SPEC}'
1186	;;
1187    esac
1188fi
1189
1190case "$SHLIB_LD" in
1191    *ldAix*)
1192    TCL_SHARED_LIBS="${TCL_SHARED_LIBS}"
1193    ;;
1194esac
1195
1196if test "x$ok" = "xyes" -a "x${SHLIB_SUFFIX}" != "x"; then
1197    MEMCHAN_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
1198    eval "MEMCHAN_LIB_FILE=libmemchan${TCL_SHARED_LIB_SUFFIX}"
1199    MAKE_LIB="\${SHLIB_LD} -o ${MEMCHAN_LIB_FILE} \${OBJECTS} ${TCL_SHARED_LIBS} ${SHLIB_LD_LIBS}"
1200    RANLIB=":"
1201
1202    install_other=''
1203else
1204    MEMCHAN_SHLIB_CFLAGS=""
1205    eval "MEMCHAN_LIB_FILE=libmemchan${TCL_UNSHARED_LIB_SUFFIX}"
1206    MAKE_LIB="ar cr ${MEMCHAN_LIB_FILE} \${OBJECTS}"
1207
1208    install_other='install-bin'
1209fi
1210
1211# Note:  in the following variable, it's important to use the absolute
1212# path name of the Tcl directory rather than "..":  this is because
1213# AIX remembers this path and will attempt to use it at run-time to look
1214# up the Tcl library.
1215
1216if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
1217    MEMCHAN_BUILD_LIB_SPEC="-L`pwd` -lmemchan${VERSION}"
1218    MEMCHAN_LIB_SPEC="-L${exec_prefix}/lib -lmemchan${VERSION}"
1219else
1220    MEMCHAN_BUILD_LIB_SPEC="-L`pwd` -lmemchan`echo ${VERSION} | tr -d .`"
1221    MEMCHAN_LIB_SPEC="-L${exec_prefix}/lib -lmemchan`echo ${VERSION} | tr -d .`"
1222fi
1223
1224if test "x$exec_prefix" = "xNONE" ; then
1225	MEMCHAN_LIB_DIR=${prefix}/lib
1226else
1227	MEMCHAN_LIB_DIR=${exec_prefix}/lib
1228fi
1229
1230
1231for ac_func in ltoa
1232do
1233echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1234echo "configure:1235: checking for $ac_func" >&5
1235if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1236  echo $ac_n "(cached) $ac_c" 1>&6
1237else
1238  cat > conftest.$ac_ext <<EOF
1239#line 1240 "configure"
1240#include "confdefs.h"
1241/* System header to define __stub macros and hopefully few prototypes,
1242    which can conflict with char $ac_func(); below.  */
1243#include <assert.h>
1244/* Override any gcc2 internal prototype to avoid an error.  */
1245/* We use char because int might match the return type of a gcc2
1246    builtin and then its argument prototype would still apply.  */
1247char $ac_func();
1248
1249int main() {
1250
1251/* The GNU C library defines this for functions which it implements
1252    to always fail with ENOSYS.  Some functions are actually named
1253    something starting with __ and the normal name is an alias.  */
1254#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1255choke me
1256#else
1257$ac_func();
1258#endif
1259
1260; return 0; }
1261EOF
1262if { (eval echo configure:1263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1263  rm -rf conftest*
1264  eval "ac_cv_func_$ac_func=yes"
1265else
1266  echo "configure: failed program was:" >&5
1267  cat conftest.$ac_ext >&5
1268  rm -rf conftest*
1269  eval "ac_cv_func_$ac_func=no"
1270fi
1271rm -f conftest*
1272fi
1273
1274if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1275  echo "$ac_t""yes" 1>&6
1276    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1277  cat >> confdefs.h <<EOF
1278#define $ac_tr_func 1
1279EOF
1280 
1281else
1282  echo "$ac_t""no" 1>&6
1283fi
1284done
1285
1286
1287
1288if test "x${TCL_SHARED_LIB_SUFFIX}" != 'x${VERSION}.a' -o "x${SHLIB_SUFFIX}" != "x.so"; then
1289	TCL_LIB_SPEC=""
1290fi
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322if test ! -z "$GCC"; then
1323	CC="$CC -Wall"
1324fi
1325
1326
1327trap '' 1 2 15
1328cat > confcache <<\EOF
1329# This file is a shell script that caches the results of configure
1330# tests run on this system so they can be shared between configure
1331# scripts and configure runs.  It is not useful on other systems.
1332# If it contains results you don't want to keep, you may remove or edit it.
1333#
1334# By default, configure uses ./config.cache as the cache file,
1335# creating it if it does not exist already.  You can give configure
1336# the --cache-file=FILE option to use a different cache file; that is
1337# what configure does when it calls configure scripts in
1338# subdirectories, so they share the cache.
1339# Giving --cache-file=/dev/null disables caching, for debugging configure.
1340# config.status only pays attention to the cache file if you give it the
1341# --recheck option to rerun configure.
1342#
1343EOF
1344# The following way of writing the cache mishandles newlines in values,
1345# but we know of no workaround that is simple, portable, and efficient.
1346# So, don't put newlines in cache variables' values.
1347# Ultrix sh set writes to stderr and can't be redirected directly,
1348# and sets the high bit in the cache file unless we assign to the vars.
1349(set) 2>&1 |
1350  case `(ac_space=' '; set | grep ac_space) 2>&1` in
1351  *ac_space=\ *)
1352    # `set' does not quote correctly, so add quotes (double-quote substitution
1353    # turns \\\\ into \\, and sed turns \\ into \).
1354    sed -n \
1355      -e "s/'/'\\\\''/g" \
1356      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
1357    ;;
1358  *)
1359    # `set' quotes correctly as required by POSIX, so do not add quotes.
1360    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
1361    ;;
1362  esac >> confcache
1363if cmp -s $cache_file confcache; then
1364  :
1365else
1366  if test -w $cache_file; then
1367    echo "updating cache $cache_file"
1368    cat confcache > $cache_file
1369  else
1370    echo "not updating unwritable cache $cache_file"
1371  fi
1372fi
1373rm -f confcache
1374
1375trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1376
1377test "x$prefix" = xNONE && prefix=$ac_default_prefix
1378# Let make expand exec_prefix.
1379test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1380
1381# Any assignment to VPATH causes Sun make to only execute
1382# the first set of double-colon rules, so remove it if not needed.
1383# If there is a colon in the path, we need to keep it.
1384if test "x$srcdir" = x.; then
1385  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
1386fi
1387
1388trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
1389
1390# Transform confdefs.h into DEFS.
1391# Protect against shell expansion while executing Makefile rules.
1392# Protect against Makefile macro expansion.
1393cat > conftest.defs <<\EOF
1394s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
1395s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
1396s%\[%\\&%g
1397s%\]%\\&%g
1398s%\$%$$%g
1399EOF
1400DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
1401rm -f conftest.defs
1402
1403
1404# Without the "./", some shells look in PATH for config.status.
1405: ${CONFIG_STATUS=./config.status}
1406
1407echo creating $CONFIG_STATUS
1408rm -f $CONFIG_STATUS
1409cat > $CONFIG_STATUS <<EOF
1410#! /bin/sh
1411# Generated automatically by configure.
1412# Run this file to recreate the current configuration.
1413# This directory was configured as follows,
1414# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1415#
1416# $0 $ac_configure_args
1417#
1418# Compiler output produced by configure, useful for debugging
1419# configure, is in ./config.log if it exists.
1420
1421ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
1422for ac_option
1423do
1424  case "\$ac_option" in
1425  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1426    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
1427    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
1428  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
1429    echo "$CONFIG_STATUS generated by autoconf version 2.13"
1430    exit 0 ;;
1431  -help | --help | --hel | --he | --h)
1432    echo "\$ac_cs_usage"; exit 0 ;;
1433  *) echo "\$ac_cs_usage"; exit 1 ;;
1434  esac
1435done
1436
1437ac_given_srcdir=$srcdir
1438
1439trap 'rm -fr `echo "Makefile pkgIndex.tcl" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
1440EOF
1441cat >> $CONFIG_STATUS <<EOF
1442
1443# Protect against being on the right side of a sed subst in config.status.
1444sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
1445 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
1446$ac_vpsub
1447$extrasub
1448s%@SHELL@%$SHELL%g
1449s%@CFLAGS@%$CFLAGS%g
1450s%@CPPFLAGS@%$CPPFLAGS%g
1451s%@CXXFLAGS@%$CXXFLAGS%g
1452s%@FFLAGS@%$FFLAGS%g
1453s%@DEFS@%$DEFS%g
1454s%@LDFLAGS@%$LDFLAGS%g
1455s%@LIBS@%$LIBS%g
1456s%@exec_prefix@%$exec_prefix%g
1457s%@prefix@%$prefix%g
1458s%@program_transform_name@%$program_transform_name%g
1459s%@bindir@%$bindir%g
1460s%@sbindir@%$sbindir%g
1461s%@libexecdir@%$libexecdir%g
1462s%@datadir@%$datadir%g
1463s%@sysconfdir@%$sysconfdir%g
1464s%@sharedstatedir@%$sharedstatedir%g
1465s%@localstatedir@%$localstatedir%g
1466s%@libdir@%$libdir%g
1467s%@includedir@%$includedir%g
1468s%@oldincludedir@%$oldincludedir%g
1469s%@infodir@%$infodir%g
1470s%@mandir@%$mandir%g
1471s%@TCLSH@%$TCLSH%g
1472s%@TOP_DIR@%$TOP_DIR%g
1473s%@BUILD_DIR@%$BUILD_DIR%g
1474s%@CC@%$CC%g
1475s%@CPP@%$CPP%g
1476s%@RANLIB@%$RANLIB%g
1477s%@TCL_INCLUDE_DIR@%$TCL_INCLUDE_DIR%g
1478s%@TCL_LIB@%$TCL_LIB%g
1479s%@DL_LIBS@%$DL_LIBS%g
1480s%@LD_FLAGS@%$LD_FLAGS%g
1481s%@TCL_LIBS@%$TCL_LIBS%g
1482s%@MAKE_LIB@%$MAKE_LIB%g
1483s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
1484s%@SHLIB_LD@%$SHLIB_LD%g
1485s%@SHLIB_LD_LIBS@%$SHLIB_LD_LIBS%g
1486s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
1487s%@SHLIB_VERSION@%$SHLIB_VERSION%g
1488s%@TCL_BUILD_LIB_SPEC@%$TCL_BUILD_LIB_SPEC%g
1489s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
1490s%@TCL_SRC_DIR@%$TCL_SRC_DIR%g
1491s%@TCL_LIB_DIR@%$TCL_LIB_DIR%g
1492s%@TCL_VERSION@%$TCL_VERSION%g
1493s%@TCL_DEFS@%$TCL_DEFS%g
1494s%@MC_USING_STUBS@%$MC_USING_STUBS%g
1495s%@MEMCHAN_BUILD_LIB_SPEC@%$MEMCHAN_BUILD_LIB_SPEC%g
1496s%@MEMCHAN_LD_SEARCH_FLAGS@%$MEMCHAN_LD_SEARCH_FLAGS%g
1497s%@MEMCHAN_LIB_FILE@%$MEMCHAN_LIB_FILE%g
1498s%@MEMCHAN_LIB_SPEC@%$MEMCHAN_LIB_SPEC%g
1499s%@MEMCHAN_LIB_DIR@%$MEMCHAN_LIB_DIR%g
1500s%@MEMCHAN_SHLIB_CFLAGS@%$MEMCHAN_SHLIB_CFLAGS%g
1501s%@MEMCHAN_VERSION@%$MEMCHAN_VERSION%g
1502s%@MEMCHAN_MAJOR_VERSION@%$MEMCHAN_MAJOR_VERSION%g
1503s%@MEMCHAN_MINOR_VERSION@%$MEMCHAN_MINOR_VERSION%g
1504s%@install_other@%$install_other%g
1505
1506CEOF
1507EOF
1508
1509cat >> $CONFIG_STATUS <<\EOF
1510
1511# Split the substitutions into bite-sized pieces for seds with
1512# small command number limits, like on Digital OSF/1 and HP-UX.
1513ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
1514ac_file=1 # Number of current file.
1515ac_beg=1 # First line for current file.
1516ac_end=$ac_max_sed_cmds # Line after last line for current file.
1517ac_more_lines=:
1518ac_sed_cmds=""
1519while $ac_more_lines; do
1520  if test $ac_beg -gt 1; then
1521    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
1522  else
1523    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
1524  fi
1525  if test ! -s conftest.s$ac_file; then
1526    ac_more_lines=false
1527    rm -f conftest.s$ac_file
1528  else
1529    if test -z "$ac_sed_cmds"; then
1530      ac_sed_cmds="sed -f conftest.s$ac_file"
1531    else
1532      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
1533    fi
1534    ac_file=`expr $ac_file + 1`
1535    ac_beg=$ac_end
1536    ac_end=`expr $ac_end + $ac_max_sed_cmds`
1537  fi
1538done
1539if test -z "$ac_sed_cmds"; then
1540  ac_sed_cmds=cat
1541fi
1542EOF
1543
1544cat >> $CONFIG_STATUS <<EOF
1545
1546CONFIG_FILES=\${CONFIG_FILES-"Makefile pkgIndex.tcl"}
1547EOF
1548cat >> $CONFIG_STATUS <<\EOF
1549for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
1550  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
1551  case "$ac_file" in
1552  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
1553       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1554  *) ac_file_in="${ac_file}.in" ;;
1555  esac
1556
1557  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
1558
1559  # Remove last slash and all that follows it.  Not all systems have dirname.
1560  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
1561  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
1562    # The file is in a subdirectory.
1563    test ! -d "$ac_dir" && mkdir "$ac_dir"
1564    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
1565    # A "../" for each directory in $ac_dir_suffix.
1566    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
1567  else
1568    ac_dir_suffix= ac_dots=
1569  fi
1570
1571  case "$ac_given_srcdir" in
1572  .)  srcdir=.
1573      if test -z "$ac_dots"; then top_srcdir=.
1574      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
1575  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
1576  *) # Relative path.
1577    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
1578    top_srcdir="$ac_dots$ac_given_srcdir" ;;
1579  esac
1580
1581
1582  echo creating "$ac_file"
1583  rm -f "$ac_file"
1584  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
1585  case "$ac_file" in
1586  *Makefile*) ac_comsub="1i\\
1587# $configure_input" ;;
1588  *) ac_comsub= ;;
1589  esac
1590
1591  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
1592  sed -e "$ac_comsub
1593s%@configure_input@%$configure_input%g
1594s%@srcdir@%$srcdir%g
1595s%@top_srcdir@%$top_srcdir%g
1596" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
1597fi; done
1598rm -f conftest.s*
1599
1600EOF
1601cat >> $CONFIG_STATUS <<EOF
1602
1603EOF
1604cat >> $CONFIG_STATUS <<\EOF
1605
1606exit 0
1607EOF
1608chmod +x $CONFIG_STATUS
1609rm -fr confdefs* $ac_clean_files
1610test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
1611
1612
1613