--- ./Makefile.in.orig	2008-07-11 17:59:24.000000000 +0200
+++ ./Makefile.in	2008-07-11 18:30:17.000000000 +0200
@@ -72,4 +72,8 @@
 	config.status config.cache config.log Makefile 
 
 distclean: clean
+	(cd src; $(MAKE) distclean)
+	(cd library; $(MAKE) distclean)
+	(cd man; $(MAKE) distclean)
+	(cd demos; $(MAKE) distclean)
 	$(RM) $(GENERATED_FILES)
--- ./win/makedefs.orig	2002-10-16 07:33:53.000000000 +0200
+++ ./win/makedefs	2008-07-11 18:30:17.000000000 +0200
@@ -3,33 +3,13 @@
 
 v1 = 8.4
 v2 = 84
-v3 = 8.4.0
-
-#v1 = 8.3
-#v2 = 83
-#v3 = 8.3.4
-
-#v1 = 8.3
-#v2 = 83
-#v3 = 8.3.2
-
-#v1 = 8.2
-#v2 = 82
-#v3 = 8.2.3
-
-#v1 = 8.1
-#v2 = 81
-#v3 = 8.1.1
-
-#v1 = 8.0
-#v2 = 80
-#v3 = 8.0.5
+v3 = 8.4.12
 
 #Use Independent JPEG Group (IJG) library or Intel JPEG Library (IJL)
 # 0 = None.
 # 1 = IJG
 # 2 = IJL
-WITH_JPEG=2
+WITH_JPEG=0
 
 # ------------------------------------------------------------------------
 #       You shouldn't need to edit anything beyond this point
@@ -39,7 +19,7 @@
 BLT_MINOR_VERSION = 	4
 BLT_VERSION =		2.4
 
-prefix =		C:/Program\ Files/Tcl
+prefix =		x:/target/staff/koen/install/tcltk8.4.12/WIN
 exec_prefix =		$(prefix)
 includedir =		$(prefix)/include
 bindir =		$(prefix)/bin
--- ./src/bltGrMarker.c.orig	2002-09-19 00:30:51.000000000 +0200
+++ ./src/bltGrMarker.c	2008-07-11 18:30:17.000000000 +0200
@@ -1061,10 +1061,12 @@
     Graph *graphPtr;
     Extents2D *extsPtr;
 {
+/*
     assert(extsPtr->right >= extsPtr->left);
     assert(extsPtr->bottom >= extsPtr->top);
     assert(graphPtr->right >= graphPtr->left);
     assert(graphPtr->bottom >= graphPtr->top);
+*/
 
     return (((double)graphPtr->right < extsPtr->left) ||
 	    ((double)graphPtr->bottom < extsPtr->top) ||
--- ./src/Makefile.in.orig	2008-07-11 17:59:24.000000000 +0200
+++ ./src/Makefile.in	2008-07-11 18:30:17.000000000 +0200
@@ -230,7 +230,8 @@
 
 distclean: clean
 	$(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"*  Makefile
-	$(RM) bltConfig.h Makefile TAGS
+	$(RM) bltConfig.h bltHash.h Makefile TAGS
+	(cd shared; $(MAKE) distclean)
 
 .c.o:
 	$(CC) -c $(CC_SWITCHES) $<
--- ./src/bltWindow.c.orig	2002-09-19 05:02:09.000000000 +0200
+++ ./src/bltWindow.c	2008-07-11 18:30:17.000000000 +0200
@@ -89,9 +89,9 @@
 
 typedef struct TkDisplayStruct {
     Display *display;		/* Xlib's info about display. */
-    struct TkDisplayStruct *nextPtr; /* Next in list of all displays. */
-    char *name;			/* Name of display (with any screen
-				 * identifier removed).  Malloc-ed. */
+    struct TkDisplay *nextPtr;	/* Next in list of all displays. */
+    char *name;			/* Name of display (with any screen identifier
+				 * removed). Malloc-ed. */
     Time lastEventTime;		/* Time of last event received for this
 				 * display. */
 
@@ -107,8 +107,8 @@
      * Information used by tkAtom.c only:
      */
 
-    int atomInit;		/* 0 means stuff below hasn't been
-				 * initialized yet. */
+    int atomInit;		/* 0 means stuff below hasn't been initialized
+				 * yet. */
     Tcl_HashTable nameTable;	/* Maps from names to Atom's. */
     Tcl_HashTable atomTable;	/* Maps from Atom's back to names. */
 
@@ -116,27 +116,26 @@
      * Information used primarily by tkBind.c:
      */
 
-    int bindInfoStale;		/* Non-zero means the variables in this
-				 * part of the structure are potentially
-				 * incorrect and should be recomputed. */
+    int bindInfoStale;		/* Non-zero means the variables in this part
+				 * of the structure are potentially incorrect
+				 * and should be recomputed. */
     unsigned int modeModMask;	/* Has one bit set to indicate the modifier
-				 * corresponding to "mode shift".  If no
-				 * such modifier, than this is zero. */
+				 * corresponding to "mode shift". If no such
+				 * modifier, than this is zero. */
     unsigned int metaModMask;	/* Has one bit set to indicate the modifier
-				 * corresponding to the "Meta" key.  If no
-				 * such modifier, then this is zero. */
+				 * corresponding to the "Meta" key. If no such
+				 * modifier, then this is zero. */
     unsigned int altModMask;	/* Has one bit set to indicate the modifier
-				 * corresponding to the "Meta" key.  If no
-				 * such modifier, then this is zero. */
-    enum {
-	LU_IGNORE, LU_CAPS, LU_SHIFT
-    } lockUsage;		/* Indicates how to interpret lock modifier. */
+				 * corresponding to the "Meta" key. If no such
+				 * modifier, then this is zero. */
+    enum {LU_IGNORE, LU_CAPS, LU_SHIFT} lockUsage;
+				/* Indicates how to interpret lock
+				 * modifier. */
     int numModKeyCodes;		/* Number of entries in modKeyCodes array
 				 * below. */
-    KeyCode *modKeyCodes;	/* Pointer to an array giving keycodes for
-				 * all of the keys that have modifiers
-				 * associated with them.  Malloc'ed, but
-				 * may be NULL. */
+    KeyCode *modKeyCodes;	/* Pointer to an array giving keycodes for all
+				 * of the keys that have modifiers associated
+				 * with them. Malloc'ed, but may be NULL. */
 
     /*
      * Information used by tkBitmap.c only:
@@ -150,10 +149,10 @@
     Tcl_HashTable bitmapIdTable;/* Maps from bitmap id to the TkBitmap
 				 * structure for the bitmap. */
     Tcl_HashTable bitmapDataTable;
-				/* Used by Tk_GetBitmapFromData to map from
-				 * a collection of in-core data about a
-				 * bitmap to a reference giving an auto-
-				 * matically-generated name for the bitmap. */
+				/* Used by Tk_GetBitmapFromData to map from a
+				 * collection of in-core data about a bitmap
+				 * to a reference giving an automatically-
+				 * generated name for the bitmap. */
 
     /*
      * Information used by tkCanvas.c only:
@@ -167,9 +166,9 @@
      */
 
     int colorInit;		/* 0 means color module needs initializing. */
-    TkStressedCmap *stressPtr;	/* First in list of colormaps that have
-				 * filled up, so we have to pick an
-				 * approximate color. */
+    TkStressedCmap *stressPtr;	/* First in list of colormaps that have filled
+				 * up, so we have to pick an approximate
+				 * color. */
     Tcl_HashTable colorNameTable;
 				/* Maps from color name to TkColor structure
 				 * for that color. */
@@ -192,34 +191,33 @@
 				/* Maps from a cursor id to the TkCursor
 				 * structure for the cursor. */
     char cursorString[20];	/* Used to store a cursor id string. */
-    Font cursorFont;		/* Font to use for standard cursors.
-				 * None means font not loaded yet. */
+    Font cursorFont;		/* Font to use for standard cursors. None
+				 * means font not loaded yet. */
 
     /*
      * Information used by tkError.c only:
      */
 
     struct TkErrorHandler *errorPtr;
-				/* First in list of error handlers
-				 * for this display.  NULL means
-				 * no handlers exist at present. */
-    int deleteCount;		/* Counts # of handlers deleted since
-				 * last time inactive handlers were
-				 * garbage-collected.  When this number
-				 * gets big, handlers get cleaned up. */
+				/* First in list of error handlers for this
+				 * display. NULL means no handlers exist at
+				 * present. */
+    int deleteCount;		/* Counts # of handlers deleted since last
+				 * time inactive handlers were garbage-
+				 * collected. When this number gets big,
+				 * handlers get cleaned up. */
 
     /*
      * Used by tkEvent.c only:
      */
 
     struct TkWindowEvent *delayedMotionPtr;
-				/* Points to a malloc-ed motion event
-				 * whose processing has been delayed in
-				 * the hopes that another motion event
-				 * will come along right away and we can
-				 * merge the two of them together.  NULL
-				 * means that there is no delayed motion
-				 * event. */
+				/* Points to a malloc-ed motion event whose
+				 * processing has been delayed in the hopes
+				 * that another motion event will come along
+				 * right away and we can merge the two of them
+				 * together. NULL means that there is no
+				 * delayed motion event. */
 
     /*
      * Information used by tkFocus.c only:
@@ -229,18 +227,16 @@
 				 * statistics. */
     struct TkWindow *implicitWinPtr;
 				/* If the focus arrived at a toplevel window
-				 * implicitly via an Enter event (rather
-				 * than via a FocusIn event), this points
-				 * to the toplevel window.  Otherwise it is
-				 * NULL. */
+				 * implicitly via an Enter event (rather than
+				 * via a FocusIn event), this points to the
+				 * toplevel window. Otherwise it is NULL. */
     struct TkWindow *focusPtr;	/* Points to the window on this display that
 				 * should be receiving keyboard events.  When
 				 * multiple applications on the display have
-				 * the focus, this will refer to the
-				 * innermost window in the innermost
-				 * application.  This information isn't used
-				 * under Unix or Windows, but it's needed on
-				 * the Macintosh. */
+				 * the focus, this will refer to the innermost
+				 * window in the innermost application. This
+				 * information isn't used under Unix or
+				 * Windows, but it's needed on the Mac. */
 
     /*
      * Information used by tkGC.c only:
@@ -258,23 +254,22 @@
 
     Tcl_HashTable maintainHashTable;
 				/* Hash table that maps from a master's
-				 * Tk_Window token to a list of slaves
-				 * managed by that master. */
+				 * Tk_Window token to a list of slaves managed
+				 * by that master. */
     int geomInit;
 
     /*
      * Information used by tkGet.c only:
      */
 
-    Tcl_HashTable uidTable;	/* Stores all Tk_Uids used in a thread. */
+    Tcl_HashTable uidTable;	/* Stores all Tk_Uid used in a thread. */
     int uidInit;		/* 0 means uidTable needs initializing. */
 
     /*
      * Information used by tkGrab.c only:
      */
 
-    struct TkWindow *grabWinPtr;
-				/* Window in which the pointer is currently
+    struct TkWindow *grabWinPtr;/* Window in which the pointer is currently
 				 * grabbed, or NULL if none. */
     struct TkWindow *eventualGrabWinPtr;
 				/* Value that grabWinPtr will have once the
@@ -287,15 +282,15 @@
     struct TkWindow *serverWinPtr;
 				/* If no application contains the pointer then
 				 * this is NULL.  Otherwise it contains the
-				 * last window for which we've gotten an
-				 * Enter or Leave event from the server (i.e.
-				 * the last window known to have contained
-				 * the pointer).  Doesn't reflect events
-				 * that were synthesized in tkGrab.c. */
+				 * last window for which we've gotten an Enter
+				 * or Leave event from the server (i.e. the
+				 * last window known to have contained the
+				 * pointer). Doesn't reflect events that were
+				 * synthesized in tkGrab.c. */
     TkGrabEvent *firstGrabEventPtr;
 				/* First in list of enter/leave events
-				 * synthesized by grab code.  These events
-				 * must be processed in order before any other
+				 * synthesized by grab code. These events must
+				 * be processed in order before any other
 				 * events are processed.  NULL means no such
 				 * events. */
     TkGrabEvent *lastGrabEventPtr;
@@ -309,8 +304,8 @@
      */
 
     int gridInit;		/* 0 means table below needs initializing. */
-    Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to
-				 * corresponding Grid structures. */
+    Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to corresponding
+				 * Grid structures. */
 
     /*
      * Information used by tkImage.c only:
@@ -328,17 +323,14 @@
      * Information used by tkOption.c only.
      */
 
-
-
     /*
      * Information used by tkPack.c only.
      */
 
     int packInit;		/* 0 means table below needs initializing. */
     Tcl_HashTable packerHashTable;
-				/* Maps from Tk_Window tokens to
-				 * corresponding Packer structures. */
-
+				/* Maps from Tk_Window tokens to corresponding
+				 * Packer structures. */
 
     /*
      * Information used by tkPlace.c only.
@@ -354,14 +346,13 @@
      * Information used by tkSelect.c and tkClipboard.c only:
      */
 
-
     struct TkSelectionInfo *selectionInfoPtr;
     /* First in list of selection information
 				 * records.  Each entry contains information
 				 * about the current owner of a particular
 				 * selection on this display. */
-    Atom multipleAtom;		/* Atom for MULTIPLE.  None means
-				 * selection stuff isn't initialized. */
+    Atom multipleAtom;		/* Atom for MULTIPLE. None means selection
+				 * stuff isn't initialized. */
     Atom incrAtom;		/* Atom for INCR. */
     Atom targetsAtom;		/* Atom for TARGETS. */
     Atom timestampAtom;		/* Atom for TIMESTAMP. */
@@ -370,9 +361,8 @@
     Atom applicationAtom;	/* Atom for TK_APPLICATION. */
     Atom windowAtom;		/* Atom for TK_WINDOW. */
     Atom clipboardAtom;		/* Atom for CLIPBOARD. */
-#if (TK_VERSION_NUMBER >= _VERSION(8,4,0))
-    Atom utf8Atom;
-#endif
+    Atom utf8Atom;		/* Atom for UTF8_STRING. */
+
     Tk_Window clipWindow;	/* Window used for clipboard ownership and to
 				 * retrieve selections between processes. NULL
 				 * means clipboard info hasn't been
@@ -391,13 +381,13 @@
      * Information used by tkSend.c only:
      */
 
-    Tk_Window commTkwin;	/* Window used for communication
-				 * between interpreters during "send"
-				 * commands.  NULL means send info hasn't
-				 * been initialized yet. */
+    Tk_Window commTkwin;	/* Window used for communication between
+				 * interpreters during "send" commands. NULL
+				 * means send info hasn't been initialized
+				 * yet. */
     Atom commProperty;		/* X's name for comm property. */
-    Atom registryProperty;	/* X's name for property containing
-				 * registry of interpreter names. */
+    Atom registryProperty;	/* X's name for property containing registry
+				 * of interpreter names. */
     Atom appNameProperty;	/* X's name for property used to hold the
 				 * application name on each comm window. */
 
@@ -409,33 +399,20 @@
 				/* First in list of chunks of free resource
 				 * identifiers, or NULL if there are no free
 				 * resources. */
-    XID(*defaultAllocProc) _ANSI_ARGS_((Display *display));
+    XID (*defaultAllocProc) (Display *display);
 				/* Default resource allocator for display. */
     struct TkIdStack *windowStackPtr;
-				/* First in list of chunks of window
-				 * identifers that can't be reused right
-				 * now. */
-#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
-    int idCleanupScheduled;	/* 1 means a call to WindowIdCleanup has
-				 * already been scheduled, 0 means it
-				 * hasn't. */
-#else
+				/* First in list of chunks of window ids that
+				 * can't be reused right now. */
     Tcl_TimerToken idCleanupScheduled;
 				/* If set, it means a call to WindowIdCleanup
 				 * has already been scheduled, 0 means it
 				 * hasn't. */
-#endif
+
     /*
      * Information used by tkUnixWm.c and tkWinWm.c only:
      */
 
-#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
-    int wmTracing;		/* Used to enable or disable tracing in
-				 * this module.  If tracing is enabled,
-				 * then information is printed on
-				 * standard output about interesting
-				 * interactions with the window manager. */
-#endif
     struct TkWmInfo *firstWmPtr; /* Points to first top-level window. */
     struct TkWmInfo *foregroundWmPtr;
 				/* Points to the foreground window. */
@@ -444,9 +421,8 @@
      * Information maintained by tkWindow.c for use later on by tkXId.c:
      */
 
-
-    int destroyCount;		/* Number of Tk_DestroyWindow operations
-				 * in progress. */
+    int destroyCount;		/* Number of Tk_DestroyWindow operations in
+				 * progress. */
     unsigned long lastDestroyRequest;
 				/* Id of most recent XDestroyWindow request;
 				 * can re-use ids in windowStackPtr when
@@ -465,42 +441,41 @@
      */
 
 #ifdef TK_USE_INPUT_METHODS
-    XIM inputMethod;		/* Input method for this display */
-#if (TK_VERSION_NUMBER >= _VERSION(8,4,0))
-#if TK_XIM_SPOT
+    XIM inputMethod;		/* Input method for this display. */
+    XIMStyle inputStyle;	/* Input style selected for this display. */
     XFontSet inputXfs;		/* XFontSet cached for over-the-spot XIM. */
-#endif /* TK_XIM_SPOT */
-#endif /* TK_VERSION_NUMBER >= 8.4 */
 #endif /* TK_USE_INPUT_METHODS */
     Tcl_HashTable winTable;	/* Maps from X window ids to TkWindow ptrs. */
+
     int refCount;		/* Reference count of how many Tk applications
                                  * are using this display. Used to clean up
-                                 * the display when we no longer have any
-                                 * Tk applications using it.
-                                 */
+				 * the display when we no longer have any Tk
+				 * applications using it. */
+
     /*
      * The following field were all added for Tk8.3
      */
-    int mouseButtonState;       /* current mouse button state for this
-                                 * display */
-#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
-    int warpInProgress;
-#endif
+
+    int mouseButtonState;	/* Current mouse button state for this
+				 * display. */
+    Window mouseButtonWindow;	/* Window the button state was set in, added
+				 * in Tk 8.4. */
     Window warpWindow;
     int warpX;
     int warpY;
-#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
-    int useInputMethods;        /* Whether to use input methods */
-#else
+
     /*
      * The following field(s) were all added for Tk8.4
      */
-    long deletionEpoch;		/* Incremented by window deletions */
-    unsigned int flags;		/* Various flag values:  these are all
-				 * defined in below. */
-    TkCaret caret;		/* information about the caret for this
+
+    unsigned int flags;		/* Various flag values: these are all defined
+				 * in below. */
+    TkCaret caret;		/* Information about the caret for this
 				 * display.  This is not a pointer. */
-#endif
+
+    int iconDataSize;		/* Size of default iconphoto image data. */
+    unsigned char *iconDataPtr;	/* Default iconphoto image data, if set. */
+
 } TkDisplay;
 
 #else
--- ./src/shared/Makefile.in.orig	2008-07-11 17:59:24.000000000 +0200
+++ ./src/shared/Makefile.in	2008-07-11 18:31:26.000000000 +0200
@@ -181,7 +181,7 @@
         done
 clean:
 	$(RM) $(OBJS) $(lib_so) $(tcl_only_lib_so) $(bltwish) $(bltsh) \
-		.pure* 
+		*pure* .pure* bltInit.o
 
 distclean: clean
 	$(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"* 
--- ./src/bltNsUtil.h.orig	2002-07-18 08:35:32.000000000 +0200
+++ ./src/bltNsUtil.h	2008-07-11 18:30:17.000000000 +0200
@@ -48,7 +48,7 @@
 
 
 EXTERN Tcl_Command Tcl_FindCommand _ANSI_ARGS_((Tcl_Interp *interp,
-	char *name, Tcl_Namespace *nsPtr, int flags));
+	CONST char *name, Tcl_Namespace *nsPtr, int flags));
 
 #define NS_SEARCH_NONE		(0)
 #define NS_SEARCH_CURRENT	(1<<0)
@@ -65,15 +65,15 @@
 
 #if (TCL_MAJOR_VERSION >= 8)
 EXTERN Tcl_Namespace *Tcl_CreateNamespace _ANSI_ARGS_((Tcl_Interp *interp,
-	char *name, ClientData clientData, Tcl_NamespaceDeleteProc *nsDelProc));
+	CONST char *name, ClientData clientData, Tcl_NamespaceDeleteProc *nsDelProc));
 
 EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_((Tcl_Namespace *nsPtr));
 
 EXTERN Tcl_Namespace *Tcl_FindNamespace _ANSI_ARGS_((Tcl_Interp *interp,
-	char *name, Tcl_Namespace *context, int flags));
+	CONST char *name, Tcl_Namespace *context, int flags));
 
 EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr,
-	char *name, int resetFlag));
+	CONST char *name, int resetFlag));
 
 EXTERN Tcl_Var Tcl_FindNamespaceVar _ANSI_ARGS_((Tcl_Interp *interp, char *name,
 	Tcl_Namespace *contextNsPtr, int flags));
--- ./src/Makefile.vc.orig	2002-09-07 22:12:10.000000000 +0200
+++ ./src/Makefile.vc	2008-07-11 18:30:17.000000000 +0200
@@ -3,9 +3,8 @@
 # 	Makefile for BLT library using VC++.
 # ------------------------------------------------------------------------
 
-include	      e:/src/blt/win/makedefs
+include	      ../win/makedefs
 
-TOOLS32       =	c:/Program\ Files/Microsoft\ Visual\ Studio/Vc98
 AR            =	lib.exe -link50compat
 LD            =	link.exe
 CC            =	cl.exe
@@ -51,7 +50,7 @@
 TCL_LIB       =	$(TCLDIR)/win/Debug/tcl$(v2)d.lib 
 MSVCRT        =	msvcrtd.lib
 else
-CFLAGS        =	-Ox -GB -GD 
+CFLAGS        =	-Ox -GB
 DEBUG_LDFLAGS =	-debug:full -debugtype:cv  
 TK_LIB        =	$(TKDIR)/win/Release/tk$(v2).lib  
 TCL_LIB       =	$(TCLDIR)/win/Release/tcl$(v2).lib 
@@ -108,7 +107,6 @@
 TCLDIR        =	$(srcdir)/../../tcl$(v3)
 TKDIR         =	$(srcdir)/../../tk$(v3)
 INCLUDES      =	-I. -I$(srcdir) \
-		-I$(TOOLS32)/include \
 		-I$(JPEGINC) \
 		-I$(TCLDIR)/win -I$(TCLDIR)/generic \
 		-I$(TKDIR)/win -I$(TKDIR)/generic -I$(TKDIR)/xlib \
@@ -161,8 +159,7 @@
 		bltWatch.o  \
 		bltWinPipe.o \
 		bltWinUtil.o \
-		bltWinDde.o \
-		pure_api.o
+		bltWinDde.o
 
 DEMO_OBJS     =	tkConsole.o bltWinMain.o
 
@@ -235,7 +232,6 @@
 	$(RM) $(bltwish) 
 	$(CC) -c $(CC_SWITCHES) -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
 		-FobltWinMain.o $(srcdir)/bltWinMain.c
-	LIB=$(TOOLS32)/lib \
 	$(LD) $(LDFLAGS) tkConsole.o bltWinMain.o -out:$(bltwish) \
 		$(lib_a) $(LIBS) 
 
@@ -244,7 +240,6 @@
 	$(CC) -c $(CC_SWITCHES) -DTCL_ONLY \
 		-DTCLLIBPATH=\"$(TCLLIBPATH)\" \
 		-FobltWinMain.o $(srcdir)/bltWinMain.c
-	LIB=$(TOOLS32)/lib \
 	$(LD) $(LDFLAGS) bltWinMain.o -out:$(bltsh) \
 		$(tcl_only_lib_a) $(TCL_ONLY_LIBS) 
 
@@ -260,7 +255,6 @@
 	$(CC) -c $(CC_SWITCHES) -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
 		-FobltInit.o $(srcdir)/bltInit.c
 	$(RM) $@
-	LIB=$(TOOLS32)/lib \
 	$(LD) $(SHLIB_LDFLAGS) -out:$@ bltInit.o $(OBJS) $(SHLIB_LD_LIBS)
 
 $(tcl_only_lib_a):  bltHash.h $(TCL_ONLY_OBJS) bltInit.c
@@ -275,7 +269,6 @@
 	$(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
 		-FobltInit.o $(srcdir)/bltInit.c
 	$(RM) $@
-	LIB=$(TOOLS32)/lib \
 	$(LD) $(SHLIB_LDFLAGS) -out:$@ bltInit.o $(TCL_ONLY_OBJS) \
 		$(TCL_ONLY_LIBS) 
 
@@ -304,7 +297,7 @@
 	$(INSTALL) $(bltsh) $(bindir)/$(bltsh2)
 
 install-lib: $(lib_so) $(lib_a) 
-	$(INSTALL_DATA) $(lib_so) $(bindir)
+	$(INSTALL_DATA) $(lib_so) $(libdir)
 	$(INSTALL_DATA) $(lib_a) $(libdir)
 	$(INSTALL_DATA) $(tcl_only_lib_so) $(bindir)
 	$(INSTALL_DATA) $(tcl_only_lib_a) $(libdir)
@@ -322,10 +315,10 @@
 		$(lib_a) $(lib_so) $(tcl_only_lib_a) $(tcl_only_lib_so) \
 		$(bltwish) $(bltsh) $(bltwish2) $(bltsh2)
 	$(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"*  
+	$(RM) bltHash.h
 
 distclean: clean
 	$(RM) Makefile
 
-.c.o:
+%.o : %.c
 	$(CC) -c $(CC_SWITCHES) -Fo$*.o $<
-
--- ./src/bltText.c.orig	2002-08-13 21:45:20.000000000 +0200
+++ ./src/bltText.c	2008-07-11 18:30:17.000000000 +0200
@@ -671,6 +671,9 @@
     Pixmap bitmap;
     int active;
 
+    if (!textPtr)
+	return;
+    
     display = Tk_Display(tkwin);
     theta = FMOD(tsPtr->theta, (double)360.0);
     if (theta < 0.0) {
--- ./src/bltBgexec.c.orig	2002-09-19 00:30:50.000000000 +0200
+++ ./src/bltBgexec.c	2008-07-11 18:30:17.000000000 +0200
@@ -394,7 +394,7 @@
 	Blt_Offset(BackgroundInfo, sink1.updateCmd), 0},
     {BLT_SWITCH_BOOLEAN, "-keepnewline", 
 	Blt_Offset(BackgroundInfo, keepNewline), 0},
-    {BLT_SWITCH_BOOLEAN, "-check", 
+    {BLT_SWITCH_INT, "-check",
 	Blt_Offset(BackgroundInfo, interval), 0},
     {BLT_SWITCH_CUSTOM, "-killsignal", 
 	Blt_Offset(BackgroundInfo, signalNum), 0, &killSignalSwitch},
@@ -1659,7 +1659,7 @@
     }
     DisableTriggers(bgPtr);
     result = Tcl_SetVar(bgPtr->interp, bgPtr->statVar, 
-	Tcl_DStringValue(&dString), TCL_GLOBAL_ONLY);
+	Tcl_DStringValue(&dString), TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG);
     Tcl_DStringFree(&dString);
     if (result == NULL) {
 	Tcl_BackgroundError(bgPtr->interp);
@@ -1712,7 +1712,7 @@
      * timer handler to periodically poll for the exit status of each
      * process.  Initially check at the next idle interval.
      */
-    if (!IsOpenSink(&bgPtr->sink2)) {
+    if (!IsOpenSink(&bgPtr->sink2) && bgPtr->timerToken == 0) {
 	bgPtr->timerToken = Tcl_CreateTimerHandler(0, TimerProc, clientData);
     }
 }
@@ -1760,7 +1760,7 @@
      * timer handler to periodically poll for the exit status of each
      * process.  Initially check at the next idle interval.
      */
-    if (!IsOpenSink(&bgPtr->sink1)) {
+    if (!IsOpenSink(&bgPtr->sink1) && bgPtr->timerToken == 0) {
 	bgPtr->timerToken = Tcl_CreateTimerHandler(0, TimerProc, clientData);
     }
 }
@@ -1900,6 +1900,7 @@
     }
     bgPtr->procArr = pidPtr;
     bgPtr->nProcs = nProcs;
+    bgPtr->timerToken = 0;
 
     if (bgPtr->sink1.fd == -1) {
 
--- ./src/bltInit.c.orig	2002-09-10 07:12:33.000000000 +0200
+++ ./src/bltInit.c	2008-07-11 18:30:17.000000000 +0200
@@ -28,7 +28,7 @@
 
 #include <bltInt.h>
 
-#define EXACT 1
+#define EXACT 0
 
 #ifndef BLT_LIBRARY
 #ifdef WIN32
--- ./library/Makefile.vc.orig	2002-08-21 08:20:51.000000000 +0200
+++ ./library/Makefile.vc	2008-07-11 18:30:17.000000000 +0200
@@ -6,7 +6,6 @@
 include ../win/makedefs
 
 version =	$(BLT_MAJOR_VERSION).$(BLT_MINOR_VERSION)
-pkgdir =	$(libdir)/tcl$(v1)/blt$(version)
 srcdir =	.
 
 cursors = 	treeview.cur
@@ -30,8 +29,7 @@
 		tclIndex
 
 instdirs =	$(prefix) $(exec_prefix) $(libdir) \
-		$(scriptdir) $(scriptdir)/dd_protocols $(libdir)/tcl$(v1) \
-		$(pkgdir)
+		$(scriptdir) $(scriptdir)/dd_protocols $(libdir)/tcl$(v1)
 
 all: build-pkgindex
 
@@ -62,7 +60,6 @@
 
 install-pkgindex: pkgIndex.tcl
 	$(INSTALL_DATA) pkgIndex.tcl $(scriptdir)
-	$(INSTALL_DATA) pkgIndex.tcl $(pkgdir)
 
 clean:
 	$(RM) pkgIndex.tcl
