+tclconfig=NONE
+AC_ARG_WITH(tclconfig, [ --with-tclconfig Path for tclConfig.sh], [tclconfig=$withval])
+if test "x$tclconfig" = xNONE; then
+ saveprefix=${prefix}
+ AC_PREFIX_PROGRAM(tclsh)
+ if test "x$prefix" = xNONE; then
+ AC_PREFIX_PROGRAM(tclsh8.3)
+ fi
+ if test "x$prefix" = xNONE; then
+ AC_PREFIX_PROGRAM(tclsh8.2)
+ fi
+ if test "x$prefix" = xNONE; then
+ AC_PREFIX_PROGRAM(tclsh8.1)
+ fi
+ if test "x$prefix" = xNONE; then
+ AC_PREFIX_PROGRAM(tclsh8.0)
+ fi
+ if test "x$prefix" = xNONE; then
+ AC_PREFIX_PROGRAM(tclsh7.6)
+ fi
+ if test "x$prefix" = xNONE; then
+ AC_PREFIX_PROGRAM(tclsh7.5)
+ fi
+ if test "x$prefix" = xNONE; then
+ prefix=/usr/local
+ fi
+ tclconfig=${prefix}/lib
+ prefix=${saveprefix}
+ if test ! -r ${tclconfig}/tclConfig.sh; then
+ # Not found, try search for Tcl on Debian systems.
+ for d in /usr/lib/tcl*; do
+ if test -f $d/tclConfig.sh; then
+ tclconfig=$d
+ fi
+ done
+ fi
+fi
+AC_MSG_CHECKING(for Tcl)
+if test -d ${tclconfig}; then
+ tclconfig=${tclconfig}/tclConfig.sh