Index: makefile.vc
===================================================================
RCS file: /cvsroot/tcl/tcl/win/makefile.vc,v
retrieving revision 1.90
diff -c -r1.90 makefile.vc
*** makefile.vc	8 May 2002 04:25:35 -0000	1.90
--- makefile.vc	28 May 2002 01:10:21 -0000
***************
*** 197,203 ****
  
  TCLSHOBJS = \
  	$(TMP_DIR)\tclAppInit.obj \
! !if $(TCL_LINKWITHEXTENSIONS)
  	$(TMP_DIR)\tclWinReg.obj \
  	$(TMP_DIR)\tclWinDde.obj \
  !endif
--- 197,203 ----
  
  TCLSHOBJS = \
  	$(TMP_DIR)\tclAppInit.obj \
! !if $(TCL_USE_STATIC_PACKAGES)
  	$(TMP_DIR)\tclWinReg.obj \
  	$(TMP_DIR)\tclWinDde.obj \
  !endif
***************
*** 209,215 ****
  	$(TMP_DIR)\tclTestProcBodyObj.obj \
  	$(TMP_DIR)\tclThreadTest.obj \
  	$(TMP_DIR)\tclWinTest.obj \
! !if $(TCL_LINKWITHEXTENSIONS)
  	$(TMP_DIR)\tclWinReg.obj \
  	$(TMP_DIR)\tclWinDde.obj \
  !endif
--- 209,215 ----
  	$(TMP_DIR)\tclTestProcBodyObj.obj \
  	$(TMP_DIR)\tclThreadTest.obj \
  	$(TMP_DIR)\tclWinTest.obj \
! !if $(TCL_USE_STATIC_PACKAGES)
  	$(TMP_DIR)\tclWinReg.obj \
  	$(TMP_DIR)\tclWinDde.obj \
  !endif
***************
*** 583,590 ****
  #---------------------------------------------------------------------
  
  $(TMP_DIR)\testMain.obj: $(WINDIR)\tclAppInit.c
! !if $(TCL_LINKWITHEXTENSIONS)
! 	$(cc32) $(TCL_CFLAGS) -DTCL_TEST -DTCL_LINKWITHEXTENSIONS -Fo$@ $?
  !else
  	$(cc32) $(TCL_CFLAGS) -DTCL_TEST -Fo$@ $?
  !endif
--- 583,590 ----
  #---------------------------------------------------------------------
  
  $(TMP_DIR)\testMain.obj: $(WINDIR)\tclAppInit.c
! !if $(TCL_USE_STATIC_PACKAGES)
! 	$(cc32) $(TCL_CFLAGS) -DTCL_TEST -DTCL_USE_STATIC_PACKAGES -Fo$@ $?
  !else
  	$(cc32) $(TCL_CFLAGS) -DTCL_TEST -Fo$@ $?
  !endif
***************
*** 599,606 ****
  	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
  
  $(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
! !if $(TCL_LINKWITHEXTENSIONS)
! 	$(cc32) $(TCL_CFLAGS) -DTCL_LINKWITHEXTENSIONS -Fo$@ $?
  !else
  	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
  !endif
--- 599,606 ----
  	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
  
  $(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
! !if $(TCL_USE_STATIC_PACKAGES)
! 	$(cc32) $(TCL_CFLAGS) -DTCL_USE_STATIC_PACKAGES -Fo$@ $?
  !else
  	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
  !endif

Index: rules.vc
===================================================================
RCS file: /cvsroot/tcl/tcl/win/rules.vc,v
retrieving revision 1.7
diff -c -r1.7 rules.vc
*** rules.vc	27 Mar 2002 21:15:43 -0000	1.7
--- rules.vc	28 May 2002 01:10:21 -0000
***************
*** 100,106 ****
  PROFILE		= 0
  MSVCRT		= 0
  LOIMPACT	= 0
! TCL_LINKWITHEXTENSIONS	= 0
  !else
  !if [nmakehlp -f $(OPTS) "static"]
  !message *** Doing static
--- 100,106 ----
  PROFILE		= 0
  MSVCRT		= 0
  LOIMPACT	= 0
! TCL_USE_STATIC_PACKAGES	= 0
  !else
  !if [nmakehlp -f $(OPTS) "static"]
  !message *** Doing static
***************
*** 116,124 ****
  !endif
  !if [nmakehlp -f $(OPTS) "linkexten"]
  !message *** Doing linkexten
! TCL_LINKWITHEXTENSIONS	= 1
  !else
! TCL_LINKWITHEXTENSIONS	= 0
  !endif
  !if [nmakehlp -f $(OPTS) "threads"]
  !message *** Doing threads
--- 116,124 ----
  !endif
  !if [nmakehlp -f $(OPTS) "linkexten"]
  !message *** Doing linkexten
! TCL_USE_STATIC_PACKAGES	= 1
  !else
! TCL_USE_STATIC_PACKAGES	= 0
  !endif
  !if [nmakehlp -f $(OPTS) "threads"]
  !message *** Doing threads
***************
*** 151,157 ****
  # Make sure we don't build overly fat DLLs.
  MSVCRT		= 1
  # We shouldn't statically put the extensions inside the shell when dynamic.
! TCL_LINKWITHEXTENSIONS = 0
  !endif
  
  
--- 151,157 ----
  # Make sure we don't build overly fat DLLs.
  MSVCRT		= 1
  # We shouldn't statically put the extensions inside the shell when dynamic.
! TCL_USE_STATIC_PACKAGES = 0
  !endif
  
  
Index: tclAppInit.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclAppInit.c,v
retrieving revision 1.8
diff -c -r1.8 tclAppInit.c
*** tclAppInit.c	21 Feb 2002 21:20:08 -0000	1.8
--- tclAppInit.c	28 May 2002 01:10:21 -0000
***************
*** 156,161 ****
--- 156,178 ----
              Procbodytest_SafeInit);
  #endif /* TCL_TEST */
  
+ #if defined(STATIC_BUILD) && defined(TCL_USE_STATIC_PACKAGES)
+     {
+ 	extern Tcl_PackageInitProc Registry_Init;
+ 	extern Tcl_PackageInitProc Dde_Init;
+ 
+ 	if (Registry_Init(interp) == TCL_ERROR) {
+ 	    return TCL_ERROR;
+ 	}
+ 	Tcl_StaticPackage(interp, "registry", Registry_Init, NULL);
+ 
+ 	if (Dde_Init(interp) == TCL_ERROR) {
+ 	    return TCL_ERROR;
+ 	}
+ 	Tcl_StaticPackage(interp, "dde", Dde_Init, NULL);
+    }
+ #endif
+ 
      /*
       * Call the init procedures for included packages.  Each call should
       * look like this:
