3b9cf2
diff -up expect5.45/configure.in.orig expect5.45/configure.in
3b9cf2
--- expect5.45/configure.in.orig	2011-01-18 16:58:14.860806442 +0100
3b9cf2
+++ expect5.45/configure.in	2011-01-18 16:58:30.378753210 +0100
3b9cf2
@@ -977,6 +977,7 @@ AC_SUBST(EXP_CC_SEARCH_FLAGS)
3b9cf2
 AC_SUBST(SETUID)
3b9cf2
 AC_SUBST(SETPGRP_VOID)
3b9cf2
 AC_SUBST(DEFAULT_STTY_ARGS)
3b9cf2
+AC_SUBST(TCL_VERSION)
3b9cf2
 # Expect uses these from tclConfig.sh to make the main executable
3b9cf2
 AC_SUBST(TCL_DL_LIBS)
3b9cf2
 AC_SUBST(TCL_CC_SEARCH_FLAGS)
3b9cf2
diff -up expect5.45/Makefile.in.orig expect5.45/Makefile.in
3b9cf2
--- expect5.45/Makefile.in.orig	2011-01-18 16:58:37.787723824 +0100
3b9cf2
+++ expect5.45/Makefile.in	2011-01-18 17:05:10.697636907 +0100
3b9cf2
@@ -121,8 +121,8 @@ includedir	= @includedir@
3b9cf2
 DESTDIR		=
3b9cf2
 
3b9cf2
 PKG_DIR		= $(PACKAGE_NAME)$(PACKAGE_VERSION)
3b9cf2
-pkgdatadir	= $(datadir)/$(PKG_DIR)
3b9cf2
-pkglibdir	= $(libdir)/$(PKG_DIR)
3b9cf2
+pkgdatadir     = $(datadir)/tcl@TCL_VERSION@/$(PKG_DIR)
3b9cf2
+pkglibdir      = $(libdir)/tcl@TCL_VERSION@/$(PKG_DIR)
3b9cf2
 pkgincludedir	= $(includedir)/$(PKG_DIR)
3b9cf2
 
3b9cf2
 top_builddir	= .
3b9cf2
@@ -263,7 +263,7 @@ install-doc: doc
3b9cf2
 	  else true; fi ; \
3b9cf2
 	done
3b9cf2
 
3b9cf2
-test: binaries libraries
3b9cf2
+test: binaries libraries pkgIndex.tcl-test
3b9cf2
 	$(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
3b9cf2
 
3b9cf2
 shell: binaries libraries
3b9cf2
@@ -331,6 +331,11 @@ pkgIndex.tcl:
3b9cf2
 pkgIndex.tcl-hand:
3b9cf2
 	(echo 'if {![package vsatisfies [package provide Tcl] @TCL_VERSION@]} {return}' ; \
3b9cf2
 	 echo 'package ifneeded Expect $(PACKAGE_VERSION) \
3b9cf2
+	    [list load [file join $$dir .. .. $(PKG_LIB_FILE)]]'\
3b9cf2
+	) > pkgIndex.tcl
3b9cf2
+
3b9cf2
+pkgIndex.tcl-test:
3b9cf2
+	(echo 'package ifneeded Expect $(PACKAGE_VERSION) \
3b9cf2
 	    [list load [file join $$dir $(PKG_LIB_FILE)]]'\
3b9cf2
 	) > pkgIndex.tcl
3b9cf2