Index: unix/Makefile.in
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/Makefile.in,v
retrieving revision 1.106
diff -u -r1.106 Makefile.in
--- unix/Makefile.in	5 Jul 2005 20:56:50 -0000	1.106
+++ unix/Makefile.in	25 Jul 2005 01:00:28 -0000
@@ -187,6 +187,21 @@
 # determine which shell to use for executing commands:
 SHELL			= /bin/sh
 
+# BUILD_TCLSH is the fully qualified path name of the tclsh shell
+# in the Tcl build directory. Test that need to be run in the
+# version of tclsh that we are building against should use this
+# path. Targets that need an installed tclsh should not depend
+# on this variable.
+
+BUILD_TCLSH		= @BUILD_TCLSH@
+
+# TCL_EXE is the name of a tclsh executable that is available *BEFORE*
+# running make for the first time. Certain build targets (make genstubs)
+# need it to be available on the PATH. This executable should *NOT* be
+# required just to do a normal build although it can be required to run
+# make dist. This variable is set to "" if no tclsh is available.
+TCL_EXE			= @TCLSH_PROG@
+
 # Tk used to let the configure script choose which program to use
 # for installing, but there are just too many different versions of
 # "install" around;  better to use the install-sh script that comes
@@ -200,13 +215,6 @@
 INSTALL_LIBRARY		= ${INSTALL}
 INSTALL_DATA		= ${INSTALL} -m 644
 
-# TCL_EXE is the name of a tclsh executable that is available *BEFORE*
-# running make for the first time. Certain build targets (make genstubs)
-# need it to be available on the PATH. This executable should *NOT* be
-# required just to do a normal build although it can be required to run
-# make dist.
-TCL_EXE			= tclsh
-
 # The symbol below provides support for dynamic loading and shared
 # libraries.  See configure.in for a description of what it means.
 # The value of the symbol is normally set by the configure script.
@@ -1473,13 +1481,10 @@
 	@EXTRA_BUILD_HTML@
 
 BUILD_HTML = \
-	@if test -f $(TCL_BIN_DIR)/tclsh; then \
-	@LD_LIBRARY_PATH_VAR@=$(TCL_BIN_DIR):$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \
-	TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
-	TCLSH="$(TCL_BIN_DIR)/tclsh"; else \
-	TCLSH="$(TCL_EXE)"; fi ;\
-	$${TCLSH} $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \
-		--srcdir=$(TOP_DIR)/..
+	@if test -f "$(TCL_EXE)"; then \
+	$(TCL_EXE) $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \
+		--srcdir=$(TOP_DIR)/.. ; \
+	fi
 
 #
 # Targets to build Solaris package of the distribution for the current
Index: unix/configure.in
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/configure.in,v
retrieving revision 1.109
diff -u -r1.109 configure.in
--- unix/configure.in	7 Jun 2005 14:20:18 -0000	1.109
+++ unix/configure.in	25 Jul 2005 01:00:28 -0000
@@ -28,6 +28,9 @@
 SC_PATH_TCLCONFIG
 SC_LOAD_TCLCONFIG
 
+SC_PROG_TCLSH
+SC_BUILD_TCLSH
+
 if test "${TCL_VERSION}" != "${TK_VERSION}"; then
     AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
 Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
Index: win/Makefile.in
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/Makefile.in,v
retrieving revision 1.62
diff -u -r1.62 Makefile.in
--- win/Makefile.in	20 Jul 2004 10:23:51 -0000	1.62
+++ win/Makefile.in	25 Jul 2005 01:00:29 -0000
@@ -198,14 +198,14 @@
 RM		= rm -f
 COPY		= cp
 
-TCLSH_PROG	= @TCLSH_PROG@
+BUILD_TCLSH	= @BUILD_TCLSH@
 
 # TCL_EXE is the name of a tclsh executable that is available *BEFORE*
 # running make for the first time. Certain build targets (make genstubs)
 # need it to be available on the PATH. This executable should *NOT* be
 # required just to do a normal build although it can be required to run
 # make dist.
-TCL_EXE			= tclsh
+TCL_EXE			= @TCLSH_PROG@
 
 CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
 -I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \
@@ -372,10 +372,7 @@
 doc: $(ROOT_DIR)/doc/man.macros
 
 winhelp: $(TCL_SRC_DIR_NATIVE)/tools/man2help.tcl $(MAN2TCL)
-	TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \
-	TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \
-	PATH="$(PATH):$(TCL_BIN_DIR)"; export PATH; \
-	$(TCLSH_PROG) "$(TCL_SRC_DIR_NATIVE)/tools/man2help.tcl" tcl "$(VER)" $(CORE_DOCS)
+	$(TCL_EXE) "$(TCL_SRC_DIR_NATIVE)/tools/man2help.tcl" tcl "$(VER)" $(CORE_DOCS)
 	$(COPY) "$(TCL_BIN_DIR)"/tcl.hpj ./
 	hcw /c /e tcl.hpj
 	$(COPY) ./tcl$(VER).cnt ./TCL$(VER).HLP "$(TCL_SRC_DIR_NATIVE)"/tools/
Index: win/configure.in
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/configure.in,v
retrieving revision 1.60
diff -u -r1.60 configure.in
--- win/configure.in	7 Jun 2005 14:20:18 -0000	1.60
+++ win/configure.in	25 Jul 2005 01:00:29 -0000
@@ -154,6 +154,7 @@
 SC_PATH_TCLCONFIG($TK_PATCH_LEVEL)
 SC_LOAD_TCLCONFIG
 
+SC_BUILD_TCLSH
 SC_PROG_TCLSH
 
 #------------------------------------------------------------------------
