dnl	The file is CYGNUS LOCAL.  It is used for cygwin32.

dnl	This file is an input file used by the GNU "autoconf" program to
dnl	generate the file "configure", which is run during Tcl installation
dnl	to configure the system for the local environment.

AC_PREREQ(2.5)

AC_INIT(../generic/tcl.h)

if test "${prefix}" = "NONE"; then
    prefix=/usr/local
fi

if test "${exec_prefix}" = "NONE"; then
    exec_prefix=$prefix
fi

AC_CANONICAL_HOST

AC_PROG_CC
AC_OBJEXT
NM=${NM-nm}
AC_SUBST(NM)
AS=${AS-as}
AC_SUBST(AS)
LD=${LD-ld}
AC_SUBST(LD)
AC_PROG_RANLIB
DLLTOOL=${DLLTOOL-dlltool}
AC_SUBST(DLLTOOL)
WINDRES=${WINDRES-windres}
AC_SUBST(WINDRES)
AC_PROG_INSTALL

# needed for the subtle differences between cygwin32 and mingw32
case "${host}" in
*-*-cygwin32*)
	TCL_ALLOC_OBJ=
	DLL_LDLIBS=-lcygwin
	DLL_LDFLAGS='-nostartfiles -Wl,--dll'
	;;
*-*-mingw32*)
	TCL_ALLOC_OBJ='$(TMPDIR)/tclAlloc.o'
	DLL_LDLIBS=
	DLL_LDFLAGS='-mdll'
	;;
esac

AC_SUBST(TCL_ALLOC_OBJ)
AC_SUBST(DLL_LDFLAGS)
AC_SUBST(DLL_LDLIBS)

# The following variables are just for tclConfig.sh, not for Makefile. 
TCL_VERSION=8.1
TCL_MAJOR_VERSION=8
TCL_MINOR_VERSION=1
TCL_PATCH_LEVEL=a2
VERSION=${TCL_VERSION}
DL_LIBS=
MATH_LIBS=-lm
SHLIB_CFLAGS=
SHLIB_LD=
SHLIB_LD_LIBS=
SHLIB_SUFFIX=
LD_FLAGS=
TCL_LD_SEARCH_FLAGS=
TCL_BIN_DIR=`pwd`
if test "$GCC" = yes; then
    TCL_BUILD_LIB_SPEC="-L`pwd` -ltcl`echo ${VERSION} | tr -d .`"
    TCL_LIB_FULL_PATH="`pwd`/libtcl`echo ${VERSION} | tr -d .`"
else
    tmp="`pwd`/libtcl`echo ${VERSION} | tr -d .`.a"
    tmp2="`cygpath --windows $tmp`"
    TCL_BUILD_LIB_SPEC="`echo $tmp2 | sed -e s#\\\\\\\\#/#g`"
    TCL_LIB_FULL_PATH="${TCL_BUILD_LIB_SPEC}"
fi
TCL_LIB_SPEC="-L${exec_prefix}/lib -ltcl`echo ${VERSION} | tr -d .`"
TCL_LIB_VERSIONS_OK=nodots
TCL_SHARED_LIB_SUFFIX=
TCL_UNSHARED_LIB_SUFFIX="`echo ${VERSION} | tr -d .`.a"
eval "TCL_LIB_FILE=libtcl${TCL_UNSHARED_LIB_SUFFIX}"
TCL_SRC_DIR=`cd $srcdir/..; pwd`
if ! test "$GCC" = yes; then
    tmp="`cygpath --windows $TCL_SRC_DIR`"
    TCL_SRC_DIR="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
fi
if test "$prefix" != "$exec_prefix"; then
    TCL_PACKAGE_PATH="${exec_prefix}/lib ${prefix}/lib"
else
    TCL_PACKAGE_PATH="${prefix}/lib"
fi

#---------------------------------------------------------------------
#
# Tcl8.1 requires writable strings under gcc.
#
#---------------------------------------------------------------------

# Tcl8.1 requires writable strings for gcc

if test "$GCC" = "yes"; then
   TCL_CFLAGS=-fwritable-strings
else
   TCL_CFLAGS=
fi
AC_SUBST(TCL_CFLAGS)

AC_SUBST(DL_LIBS)
AC_SUBST(LD_FLAGS)
AC_SUBST(MATH_LIBS)
AC_SUBST(SHLIB_CFLAGS)
AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_SUFFIX)
AC_SUBST(TCL_BUILD_LIB_SPEC)
AC_SUBST(TCL_LD_SEARCH_FLAGS)
AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_LIB_SPEC)
AC_SUBST(TCL_LIB_FULL_PATH)
AC_SUBST(TCL_LIB_VERSIONS_OK)
AC_SUBST(TCL_MAJOR_VERSION)
AC_SUBST(TCL_MINOR_VERSION)
AC_SUBST(TCL_PACKAGE_PATH)
AC_SUBST(TCL_PATCH_LEVEL)
AC_SUBST(TCL_SHARED_LIB_SUFFIX)
AC_SUBST(TCL_SHLIB_CFLAGS)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_LIB_FULL_PATH)
AC_SUBST(TCL_BIN_DIR)

AC_OUTPUT(Makefile ../unix/tclConfig.sh)
