diff -up tcl8.5.9/tests/env.test.orig tcl8.5.9/tests/env.test
--- tcl8.5.9/tests/env.test.orig	2011-05-14 16:24:47.871366656 -0600
+++ tcl8.5.9/tests/env.test	2011-05-14 16:26:18.149946368 -0600
@@ -80,7 +80,7 @@ set printenvScript [makeFile {
 	TCL_LIBRARY PATH LD_LIBRARY_PATH LIBPATH PURE_PROG_NAME DISPLAY
 	SHLIB_PATH SYSTEMDRIVE SYSTEMROOT DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH
 	DYLD_NEW_LOCAL_SHARED_REGIONS DYLD_NO_FIX_PREBINDING
-	__CF_USER_TEXT_ENCODING SECURITYSESSIONID LANG WINDIR TERM
+	__CF_USER_TEXT_ENCODING SECURITYSESSIONID LANG WINDIR TERM LIBRARY_PATH
     } {
 	lrem names $name
     }
@@ -112,7 +112,7 @@ foreach name [array names env] {
 	    TCL_LIBRARY PATH LD_LIBRARY_PATH LIBPATH DISPLAY SHLIB_PATH
 	    SYSTEMDRIVE SYSTEMROOT DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH
 	    DYLD_NEW_LOCAL_SHARED_REGIONS DYLD_NO_FIX_PREBINDING
-	    SECURITYSESSIONID LANG WINDIR TERM
+	    SECURITYSESSIONID LANG WINDIR TERM LIBRARY_PATH
     }} {
 	unset env($name)
     }
diff -up tcl8.5.9/unix/tcl.m4.orig tcl8.5.9/unix/tcl.m4
--- tcl8.5.9/unix/tcl.m4.orig	2010-09-08 11:40:48.016515072 -0600
+++ tcl8.5.9/unix/tcl.m4	2011-05-14 16:20:36.560201728 -0600
@@ -669,9 +669,16 @@ AC_DEFUN([SC_ENABLE_THREADS], [
 			# The space is needed
 			THREADS_LIBS=" -pthread"
 		    else
+		    AC_CHECK_LIB(root, pthread_mutex_init,
+		    tcl_ok=yes, tcl_ok=no)
+		    if test "$tcl_ok" = "yes"; then
+		    # The space is needed
+		    THREAD_LIBS=" "
+		    else
 			TCL_THREADS=0
 			AC_MSG_WARN([Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...])
 		    fi
+		    fi
 		fi
 	    fi
 	fi
@@ -1276,6 +1283,7 @@ dnl AC_CHECK_TOOL(AR, ar)
 	    SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
 	    DL_OBJS="tclLoadDl.o"
 	    DL_LIBS="-lroot"
+	    LD_LIBRARY_PATH_VAR="LIBRARY_PATH"
 	    AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"])
 	    ;;
 	HP-UX-*.11.*)
