File tkrat-load.patch of Package tkrat

Index: tkrat/lib/Makefile.in
===================================================================
--- tkrat.orig/lib/Makefile.in
+++ tkrat/lib/Makefile.in
@@ -98,11 +98,11 @@ ${DUMMYLIB}: ratDummy.o
 	${SHLIB_LD} -o ${DUMMYLIB} ratDummy.o $(EXTRA_LIBS) ${SHLIB_LD_LIBS}
 
 pkgIndex.tcl: ${RATLIB} ${RATOLDLIB} ${DUMMYLIB}
-	echo "if [catch {load ./${DUMMYLIB}; \
-			 load ./${RATLIB}; \
+	echo "if [catch {load ./${RATLIB}; \
 			 load ./${RATOLDLIB}; \
 			 pkg_mkIndex . ${RATLIB} ${RATOLDLIB}} error] \
-		  {puts \$$error; exit 1}" | ${TCLSH}
+		  {puts \$$error; exit 1}" | \
+	LD_PRELOAD="./${DUMMYLIB} ./${RATOLDLIB}" ${TCLSH}
 
 install.bin: ${RATLIB} ${RATOLDLIB} ${DUMMYLIB}
 	if test ! -d ${INSTALL_PREFIX}${LIB_DIR} ; then\
Index: tkrat/util/Makefile.in
===================================================================
--- tkrat.orig/util/Makefile.in
+++ tkrat/util/Makefile.in
@@ -91,10 +91,9 @@ ${DUMMYLIB}: rat_dummy.o
 	${SHLIB_LD} -o ${DUMMYLIB} rat_dummy.o $(EXTRA_LIBS) ${SHLIB_LD_LIBS}
 
 pkgIndex.tcl: ${TARGETS} ${DUMMYLIB}
-	echo "if [catch {load ./${DUMMYLIB}; \
-			 load ./${BUSYLIB}; \
+	echo "if [catch {load ./${BUSYLIB}; \
 			 pkg_mkIndex . ${TARGETS}} error] \
-		  {puts \$$error; exit 1}" | ${TCLSH}
+		  {puts \$$error; exit 1}" | LD_PRELOAD=./${DUMMYLIB} ${TCLSH}
 
 install.bin:  ${TARGETS_LIB} ${DUMMYLIB}
 	if test ! -d ${INSTALL_PREFIX}${LIB_DIR} ; then\
@@ -105,11 +104,10 @@ install.bin:  ${TARGETS_LIB} ${DUMMYLIB}
 	    ${INSTALL} -m 0755 $$i ${INSTALL_PREFIX}${LIB_DIR} ;\
 	done
 	INST=${INSTALL_PREFIX}${LIB_DIR}; \
-	    echo "if [catch {load ./${DUMMYLIB}; \
-		     cd $$INST; \
+	    echo "if [catch { cd $$INST; \
 		     pkg_mkIndex -load ./*${SHLIB_SUFFIX} . \
 				 *${SHLIB_SUFFIX}} error] \
-	  	  {puts \$$error; exit 1}" | ${TCLSH}
+	  	  {puts \$$error; exit 1}" | LD_PRELOAD=./${DUMMYLIB} ${TCLSH}
 
 install.shared:  ${TARGETS_data}
 	if test ! -d ${INSTALL_PREFIX}${DATA_DIR} ; then\