#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 1.7.9 
# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.

# This configure script is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This script is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
# Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# Save the original args to write them into config.status later.
ac_configure_args="$*"

# Only options that might do something get documented.
ac_usage="Usage: configure [options] [host]
Options: [defaults in brackets]
--enable-FEATURE[=VAL]	include FEATURE [VAL=yes]
--exec-prefix=PREFIX	install host dependent files in PREFIX [/usr/local]
--help			print this message
--prefix=PREFIX		install host independent files in PREFIX [/usr/local]
--quiet, --silent	do not print \`checking for...' messages
--srcdir=DIR		find the sources in DIR [configure dir or ..]
--verbose		print results of checks
--version		print the version of autoconf that created configure
--with-PACKAGE		use external PACKAGE
--without-PACKAGE	do not use external PACKAGE"

# Initialize some variables set by options.
build=NONE
exec_prefix=
host=NONE
norecursion=
prefix=
program_prefix=
program_suffix=
program_transform_name=
ac_silent=
site=
srcdir=
target=NONE
ac_verbose=

ac_prev=
for ac_option
do

  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval "$ac_prev=\$ac_option"
    ac_prev=
    continue
  fi

  # Accept but ignore most of the Cygnus configure options,
  # so we can diagnose typos and other invalid options.

  case "$ac_option" in
  *=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) ac_optarg= ;;
  esac

  case "$ac_option" in

  -build | --build | --buil | --bui | --bu | --b)
    ac_prev=build ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
    build="$ac_optarg" ;;

  -enable-* | --enable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
    # Reject names that aren't valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
      echo "configure: $ac_feature: invalid feature name" >&2; exit 1
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "enable_${ac_feature}='$ac_optarg'" ;;

  # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix="$ac_optarg" ;;

  -gas | --gas | --ga | --g) with_gas=1 ;; # Obsolete; use --with-gas.

  -help | --help | --hel | --he)
    cat << EOF
$ac_usage
EOF
    exit 0 ;;

  -host | --host | --hos | --ho)
    ac_prev=host ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host="$ac_optarg" ;;

  -nfp | --nfp | --nf) with_fp=no ;; # Obsolete; use --without-fp.

  -norecursion | --norecursion | --norecursio | --norecursi \
  | --norecurs | --norecur | --norecu | --norec | --nore | --nor | --no)
  norecursion=yes ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix="$ac_optarg" ;;

  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  | --program-pre | --program-pr | --program-p)
    ac_prev=program_prefix ;;
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    program_prefix="$ac_optarg" ;;

  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  | --program-suf | --program-su | --program-s)
    ac_prev=program_suffix ;;
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    program_suffix="$ac_optarg" ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name="$ac_optarg" ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    ac_silent=yes ;;

  -site | --site | --sit)
    ac_prev=site ;;
  -site= | --site=* | --sit=*)
    site="$ac_optarg" ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    srcdir="$ac_optarg" ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target="$ac_optarg" ;;

  -v | -verbose | --verbose | --verbos | --verbo | --verb)
      ac_verbose=yes ;;

  -version | --version | --versio | --versi | --vers)
    echo "configure generated by autoconf version 1.7.9"
    exit 0 ;;

  -with-* | --with-*)
    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
    # Reject names that aren't valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
      echo "configure: $ac_package: invalid package name" >&2; exit 1
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "with_${ac_package}='$ac_optarg'" ;;

  -without-* | --without-*)
    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
    # Reject names that aren't valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
      echo "configure: $ac_package: invalid package name" >&2; exit 1
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    eval "with_${ac_package}=no" ;;

  --x) with_x=1 ;; # Obsolete; use --with-x.

  -*) echo "configure: warning: $ac_option: invalid option; use --help to show usage" >&2
    ;;

  *) 
    if test -n "`echo $ac_option| sed 's/[-a-z0-9]//g'`"; then
      echo "configure: warning: $ac_option: invalid host type" >&2
    fi
    ;;

  esac
done

if test -n "$ac_prev"; then
  echo "configure: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" >&2; exit 1
fi

trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
trap 'rm -fr confdefs* $ac_clean_files' 0

# Save the original args if we used an alternate arg parser.
ac_configure_args="${ac_configure_args-$*}"

# NLS nuisances.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
if test "${LC_ALL+set}" = 'set'; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}"   = 'set'; then LANG=C;   export LANG;   fi

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=tcl.h

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then `..'.
  ac_prog=$0
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  srcdir=$ac_confdir
  if test ! -r $srcdir/$ac_unique_file; then
    srcdir=..
  fi
fi
if test ! -r $srcdir/$ac_unique_file; then
  if test x$ac_srcdir_defaulted = xyes; then
    echo "configure: can not find sources in ${ac_confdir} or .." >&2; exit 1
  else
    echo "configure: can not find sources in ${srcdir}" >&2; exit 1
  fi
fi

ac_ext=c
ac_cpp='${CPP} $CFLAGS'
ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'

if test -z "$RANLIB"; then
  # Extract the first word of `ranlib', so it can be a program name with args.
  set ac_dummy ranlib; ac_word=$2
  test -n "$ac_silent" || echo "checking for $ac_word"
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
test -z "$RANLIB" && RANLIB=":"
test -n "$RANLIB" && test -n "$ac_verbose" && echo "	setting RANLIB to $RANLIB"

test -n "$ac_silent" || echo "checking how to run the C preprocessor"
if test -z "$CPP"; then
  # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  # make.  It must be expanded now.
  CPP="${CC-cc} -E"
  cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <stdio.h>
Syntax Error
EOF
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  :
else
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <stdio.h>
Syntax Error
EOF
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  :
else
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
test -n "$ac_verbose" && echo "	setting CPP to $CPP"

CC=${CC-cc}


#--------------------------------------------------------------------
# On a few rare braindead systems, libm.a is the same as libc.a
#--------------------------------------------------------------------

test -n "$ac_silent" || echo "checking for sin"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { return 0; }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_sin) || defined (__stub___sin)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char sin(); sin();
#endif
; return 0; }
EOF
if eval $ac_compile; then
  :
else
  rm -rf conftest*
  LIBS="-lm" ; test -n "$verbose" && echo "	Adding -lm to library list"
fi
rm -f conftest*


#--------------------------------------------------------------------
#	Supply substitutes for missing POSIX library procedures, or
#	set flags so Tcl uses alternate procedures.
#--------------------------------------------------------------------

for ac_func in getcwd opendir strerror strstr
do
test -n "$ac_silent" || echo "checking for ${ac_func}"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { return 0; }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${ac_func}) || defined (__stub___${ac_func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${ac_func}(); ${ac_func}();
#endif
; return 0; }
EOF
if eval $ac_compile; then
  :
else
  rm -rf conftest*
  LIBOBJS="$LIBOBJS ${ac_func}.o"
test -n "$ac_verbose" && echo "	using ${ac_func}.o instead"
fi
rm -f conftest*

done

for ac_func in strtol tmpnam waitpid
do
test -n "$ac_silent" || echo "checking for ${ac_func}"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { return 0; }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${ac_func}) || defined (__stub___${ac_func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${ac_func}(); ${ac_func}();
#endif
; return 0; }
EOF
if eval $ac_compile; then
  :
else
  rm -rf conftest*
  LIBOBJS="$LIBOBJS ${ac_func}.o"
test -n "$ac_verbose" && echo "	using ${ac_func}.o instead"
fi
rm -f conftest*

done

test -n "$ac_silent" || echo "checking for gettimeofday"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { return 0; }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char gettimeofday(); gettimeofday();
#endif
; return 0; }
EOF
if eval $ac_compile; then
  :
else
  rm -rf conftest*
  {
test -n "$ac_verbose" && \
echo "	defining NO_GETTOD"
echo "#define" NO_GETTOD "1" >> confdefs.h
DEFS="$DEFS -DNO_GETTOD=1"
}

fi
rm -f conftest*

test -n "$ac_silent" || echo "checking for getwd"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { return 0; }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_getwd) || defined (__stub___getwd)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char getwd(); getwd();
#endif
; return 0; }
EOF
if eval $ac_compile; then
  :
else
  rm -rf conftest*
  {
test -n "$ac_verbose" && \
echo "	defining NO_GETWD"
echo "#define" NO_GETWD "1" >> confdefs.h
DEFS="$DEFS -DNO_GETWD=1"
}

fi
rm -f conftest*

test -n "$ac_silent" || echo "checking for wait3"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { return 0; }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_wait3) || defined (__stub___wait3)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char wait3(); wait3();
#endif
; return 0; }
EOF
if eval $ac_compile; then
  :
else
  rm -rf conftest*
  {
test -n "$ac_verbose" && \
echo "	defining NO_WAIT3"
echo "#define" NO_WAIT3 "1" >> confdefs.h
DEFS="$DEFS -DNO_WAIT3=1"
}

fi
rm -f conftest*


#--------------------------------------------------------------------
#	Supply substitutes for missing POSIX header files.  Special
#	notes:
#	    - Sprite's dirent.h exists but is bogus.
#	    - stdlib.h doesn't define strtol, strtoul, or
#	      strtod insome versions of SunOS
#	    - some versions of string.h don't declare procedures such
#	      as strstr
#--------------------------------------------------------------------
test -n "$ac_silent" || echo "checking for dirent.h"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <dirent.h>
int main() { return 0; }
int t() { 
#ifndef _POSIX_SOURCE
#ifdef __Lynx__
#error "Lynx headers are usually only valid if really in the POSIX environment"
#endif
#endif
DIR *d;
struct dirent *entryPtr;
char *p;
d = opendir("foobar");
entryPtr = readdir(d);
p = entryPtr->d_name;
closedir(d);
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  tcl_ok=1

else
  rm -rf conftest*
  tcl_ok=0
fi
rm -f conftest*


test -n "$ac_silent" || echo "checking for unistd.h"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <unistd.h>
EOF
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining HAVE_UNISTD_H"
echo "#define" HAVE_UNISTD_H "1" >> confdefs.h
DEFS="$DEFS -DHAVE_UNISTD_H=1"
}


fi
rm -f conftest*

test -n "$ac_silent" || echo "checking for errno.h"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <errno.h>
EOF
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining NO_ERRNO_H"
echo "#define" NO_ERRNO_H "1" >> confdefs.h
DEFS="$DEFS -DNO_ERRNO_H=1"
}

fi
rm -f conftest*

test -n "$ac_silent" || echo "checking for float.h"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <float.h>
EOF
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining NO_FLOAT_H"
echo "#define" NO_FLOAT_H "1" >> confdefs.h
DEFS="$DEFS -DNO_FLOAT_H=1"
}

fi
rm -f conftest*

test -n "$ac_silent" || echo "checking for limits.h"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <limits.h>
EOF
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining NO_LIMITS_H"
echo "#define" NO_LIMITS_H "1" >> confdefs.h
DEFS="$DEFS -DNO_LIMITS_H=1"
}

fi
rm -f conftest*

test -n "$ac_silent" || echo "checking for stdlib.h"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  rm -rf conftest*
  tcl_ok=1

else
  rm -rf conftest*
  tcl_ok=0
fi
rm -f conftest*

echo '#include "confdefs.h"
#include <stdlib.h>' > conftest.${ac_ext}
eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
if egrep "strtol" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  tcl_ok=0
fi
rm -f conftest*

echo '#include "confdefs.h"
#include <stdlib.h>' > conftest.${ac_ext}
eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
if egrep "strtoul" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  tcl_ok=0
fi
rm -f conftest*

echo '#include "confdefs.h"
#include <stdlib.h>' > conftest.${ac_ext}
eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
if egrep "strtod" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  tcl_ok=0
fi
rm -f conftest*

if test $tcl_ok = 0; then
    
{
test -n "$ac_verbose" && \
echo "	defining NO_STDLIB_H"
echo "#define" NO_STDLIB_H "1" >> confdefs.h
DEFS="$DEFS -DNO_STDLIB_H=1"
}

fi
test -n "$ac_silent" || echo "checking for string.h"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <string.h>
EOF
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  rm -rf conftest*
  tcl_ok=1

else
  rm -rf conftest*
  tcl_ok=0
fi
rm -f conftest*

echo '#include "confdefs.h"
#include <string.h>' > conftest.${ac_ext}
eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
if egrep "strstr" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  tcl_ok=0
fi
rm -f conftest*

echo '#include "confdefs.h"
#include <string.h>' > conftest.${ac_ext}
eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
if egrep "strerror" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  tcl_ok=0
fi
rm -f conftest*

if test $tcl_ok = 0; then
    
{
test -n "$ac_verbose" && \
echo "	defining NO_STRING_H"
echo "#define" NO_STRING_H "1" >> confdefs.h
DEFS="$DEFS -DNO_STRING_H=1"
}

fi
test -n "$ac_silent" || echo "checking for sys/time.h"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <sys/time.h>
EOF
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining NO_SYS_TIME_H"
echo "#define" NO_SYS_TIME_H "1" >> confdefs.h
DEFS="$DEFS -DNO_SYS_TIME_H=1"
}

fi
rm -f conftest*

test -n "$ac_silent" || echo "checking for sys/wait.h"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <sys/wait.h>
EOF
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining NO_SYS_WAIT_H"
echo "#define" NO_SYS_WAIT_H "1" >> confdefs.h
DEFS="$DEFS -DNO_SYS_WAIT_H=1"
}

fi
rm -f conftest*


#--------------------------------------------------------------------
#	On some systems strstr is broken: it returns a pointer even
#	even if the original string is empty.
#--------------------------------------------------------------------

echo "checking for strstr.o"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"

extern int strstr();
int main()
{
    exit(strstr("\0test", "test") ? 1 : 0);
}

EOF
eval $ac_compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  :
else
  LIBOBJS="$LIBOBJS strstr.o" 
fi
rm -fr conftest*

#--------------------------------------------------------------------
#	Check for strtoul function.  This is tricky because under some
#	versions of AIX strtoul returns an incorrect terminator
#	pointer for the string "0".
#--------------------------------------------------------------------

test -n "$ac_silent" || echo "checking for strtoul"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { return 0; }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_strtoul) || defined (__stub___strtoul)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char strtoul(); strtoul();
#endif
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  tcl_ok=1

else
  rm -rf conftest*
  tcl_ok=0
fi
rm -f conftest*

cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"

extern int strtoul();
int main()
{
    char *string = "0";
    char *term;
    int value;
    value = strtoul(string, &term, 0);
    if ((value != 0) || (term != (string+1))) {
        exit(1);
    }
    exit(0);
}
EOF
eval $ac_compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  :
else
  tcl_ok=0
fi
rm -fr conftest*
if test $tcl_ok = 0; then
    test -n "$verbose" && echo "	Adding strtoul.o."
    LIBOBJS="$LIBOBJS strtoul.o"
fi

#--------------------------------------------------------------------
#	Check for the strtod function.  This is tricky because under
#	some versions of Linux it mis-parses the string "+".
#--------------------------------------------------------------------

test -n "$ac_silent" || echo "checking for strtod"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { return 0; }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_strtod) || defined (__stub___strtod)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char strtod(); strtod();
#endif
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  tcl_ok=1

else
  rm -rf conftest*
  tcl_ok=0
fi
rm -f conftest*

cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"

extern double strtod();
int main()
{
    char *string = " +69";
    char *term;
    double value;
    value = strtod(string, &term);
    if ((value != 69) || (term != (string+4))) {
	exit(1);
    }
    exit(0);
}
EOF
eval $ac_compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  :
else
  tcl_ok=0
fi
rm -fr conftest*
if test $tcl_ok = 0; then
    test -n "$verbose" && echo "	Adding strtod.o."
    LIBOBJS="$LIBOBJS strtod.o"
fi

#--------------------------------------------------------------------
#	Check for various typedefs and provide substitutes if
#	they don't exist.
#--------------------------------------------------------------------

test -n "$ac_silent" || echo "checking for mode_t in sys/types.h"
echo '#include "confdefs.h"
#include <sys/types.h>' > conftest.${ac_ext}
eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
if egrep "mode_t" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining" mode_t to be "int"
echo "#define" mode_t "int" >> confdefs.h
DEFS="$DEFS -Dmode_t=int"
}

fi
rm -f conftest*

test -n "$ac_silent" || echo "checking for pid_t in sys/types.h"
echo '#include "confdefs.h"
#include <sys/types.h>' > conftest.${ac_ext}
eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining" pid_t to be "int"
echo "#define" pid_t "int" >> confdefs.h
DEFS="$DEFS -Dpid_t=int"
}

fi
rm -f conftest*

test -n "$ac_silent" || echo "checking for size_t in sys/types.h"
echo '#include "confdefs.h"
#include <sys/types.h>' > conftest.${ac_ext}
eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
if egrep "size_t" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining" size_t to be "unsigned"
echo "#define" size_t "unsigned" >> confdefs.h
DEFS="$DEFS -Dsize_t=unsigned"
}

fi
rm -f conftest*

test -n "$ac_silent" || echo "checking for uid_t in sys/types.h"
echo '#include "confdefs.h"
#include <sys/types.h>' > conftest.${ac_ext}
eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining" uid_t to be "int"
echo "#define" uid_t "int" >> confdefs.h
DEFS="$DEFS -Duid_t=int"
}
 
{
test -n "$ac_verbose" && \
echo "	defining" gid_t to be "int"
echo "#define" gid_t "int" >> confdefs.h
DEFS="$DEFS -Dgid_t=int"
}

fi
rm -f conftest*


#--------------------------------------------------------------------
#	If a system doesn't have an opendir function (man, that's old!)
#	then we have to supply a different version of dirent.h which
#	is compatible with the substitute version of opendir that's
#	provided.  This version only works with V7-style directories.
#--------------------------------------------------------------------

test -n "$ac_silent" || echo "checking for opendir"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { return 0; }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_opendir) || defined (__stub___opendir)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char opendir(); opendir();
#endif
; return 0; }
EOF
if eval $ac_compile; then
  :
else
  rm -rf conftest*
  {
test -n "$ac_verbose" && \
echo "	defining USE_DIRENT2_H"
echo "#define" USE_DIRENT2_H "1" >> confdefs.h
DEFS="$DEFS -DUSE_DIRENT2_H=1"
}

fi
rm -f conftest*


#--------------------------------------------------------------------
#	Check for the existence of sys_errlist (this is only needed if
#	there's no strerror, but I don't know how to conditionalize the
#	check).
#--------------------------------------------------------------------

test -n "$ac_silent" || echo "checking for sys_errlist"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"

int main() { return 0; }
int t() { 
extern char *sys_errlist[];
extern int sys_nerr;
sys_errlist[sys_nerr-1][0] = 0;
; return 0; }
EOF
if eval $ac_compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining NO_SYS_ERRLIST"
echo "#define" NO_SYS_ERRLIST "1" >> confdefs.h
DEFS="$DEFS -DNO_SYS_ERRLIST=1"
}

fi
rm -f conftest*


#--------------------------------------------------------------------
#	The check below checks whether <sys/wait.h> defines the type
#	"union wait" correctly.  It's needed because of weirdness in
#	HP-UX where "union wait" is defined in both the BSD and SYS-V
#	environments.  Checking the usability of WIFEXITED seems to do
#	the trick.
#--------------------------------------------------------------------

test -n "$ac_silent" || echo "checking for union wait"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <sys/types.h> 
#include <sys/wait.h>
int main() { return 0; }
int t() { 
union wait x;
WIFEXITED(x);		/* Generates compiler error if WIFEXITED
			 * uses an int. */
; return 0; }
EOF
if eval $ac_compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$ac_verbose" && \
echo "	defining NO_UNION_WAIT"
echo "#define" NO_UNION_WAIT "1" >> confdefs.h
DEFS="$DEFS -DNO_UNION_WAIT=1"
}

fi
rm -f conftest*


#--------------------------------------------------------------------
#	Check to see whether the system supports the matherr function
#	and its associated type "struct exception".
#--------------------------------------------------------------------

test -n "$ac_silent" || echo "checking for matherr support"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <math.h>
int main() { return 0; }
int t() { 
struct exception x;
x.type = DOMAIN;
x.type = SING;
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  LIBOBJS="$LIBOBJS tclMtherr.o"; 
{
test -n "$ac_verbose" && \
echo "	defining NEED_MATHERR"
echo "#define" NEED_MATHERR "1" >> confdefs.h
DEFS="$DEFS -DNEED_MATHERR=1"
}


fi
rm -f conftest*


# Set default prefixes.
if test -n "$prefix"; then
  test -z "$exec_prefix" && exec_prefix='${prefix}' # Let make expand it.
  ac_prsub="s%^prefix\\([ 	]*\\)=\\([ 	]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
  ac_prsub="$ac_prsub
s%^exec_prefix\\([ 	]*\\)=\\([ 	]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
fi
# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
fi

# Quote sed substitution magic chars in DEFS.
cat >conftest.def <<EOF
$DEFS
EOF
ac_escape_ampersand_and_backslash='s%[&\\]%\\&%g'
DEFS=`sed "$ac_escape_ampersand_and_backslash" <conftest.def`
rm -f conftest.def
# Substitute for predefined variables.

trap 'rm -f config.status; exit 1' 1 2 15
echo creating config.status
rm -f config.status
cat > config.status <<EOF
#!/bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args

ac_cs_usage="Usage: config.status [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "config.status generated by autoconf version 1.7.9"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

trap 'rm -f Makefile; exit 1' 1 2 15
RANLIB='$RANLIB'
CPP='$CPP'
CC='$CC'
LIBOBJS='$LIBOBJS'
LIBS='$LIBS'
srcdir='$srcdir'
prefix='$prefix'
exec_prefix='$exec_prefix'
DEFS='$DEFS'
ac_prsub='$ac_prsub'
ac_vpsub='$ac_vpsub'
extrasub='$extrasub'
EOF
cat >> config.status <<\EOF

ac_top_srcdir=$srcdir

CONFIG_FILES=${CONFIG_FILES-"Makefile"}
for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then
  # Remove last slash and all that follows it.  Not all systems have dirname.
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  if test "$ac_dir" != "$ac_file"; then
    # The file is in a subdirectory.
    test ! -d "$ac_dir" && mkdir "$ac_dir"
    ac_dir_suffix="/$ac_dir"
  else
    ac_dir_suffix=
  fi

  case "$ac_top_srcdir" in
  .)  srcdir=. ;;
  /*) srcdir="$ac_top_srcdir$ac_dir_suffix" ;;
  *)
    # Relative path.  Prepend a "../" for each directory in $ac_dir_suffix.
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
    srcdir="$ac_dots$ac_top_srcdir$ac_dir_suffix" ;;
  esac

  echo creating "$ac_file"
  rm -f "$ac_file"
  comment_str="Generated automatically from `echo $ac_file|sed 's|.*/||'`.in by configure."
  case "$ac_file" in
    *.c | *.h | *.C | *.cc | *.m )  echo "/* $comment_str */" > "$ac_file" ;;
    * )          echo "# $comment_str"     > "$ac_file" ;;
  esac
  sed -e "
$ac_prsub
$ac_vpsub
$extrasub
s%@RANLIB@%$RANLIB%g
s%@CPP@%$CPP%g
s%@CC@%$CC%g
s%@LIBOBJS@%$LIBOBJS%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@prefix@%$prefix%g
s%@exec_prefix@%$exec_prefix%g
s%@DEFS@%$DEFS%
" $ac_top_srcdir/${ac_file}.in >> $ac_file
fi; done


exit 0
EOF
chmod +x config.status
${CONFIG_SHELL-/bin/sh} config.status

