diff options
-rwxr-xr-x | win/buildall.vc.bat | 43 | ||||
-rw-r--r-- | win/makefile.vc | 137 | ||||
-rw-r--r-- | win/rules.vc | 97 | ||||
-rw-r--r-- | win/winMain.c | 18 |
4 files changed, 187 insertions, 108 deletions
diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat index 8a7c59d..655f7b6 100755 --- a/win/buildall.vc.bat +++ b/win/buildall.vc.bat @@ -4,33 +4,60 @@ :: edit this (or make your own) for your needs and wants using :: the instructions for calling makefile.vc found in makefile.vc :: -:: RCS: @(#) $Id: buildall.vc.bat,v 1.3 2002/03/29 03:55:41 davygrvy Exp $ +:: RCS: @(#) $Id: buildall.vc.bat,v 1.4 2002/11/04 07:49:43 davygrvy Exp $ echo Sit back and have a cup of coffee while this grinds through ;) echo You asked for *everything*, remember? echo. -if "%MSVCDir%" == "" call C:\dev\devstudio60\vc98\bin\vcvars32.bat -set INSTALLDIR=C:\progra~1\tcl -set TCLDIR=..\..\tcl_head +title Building Tk, please wait... +if "%MSVCDir%" == "" call c:\dev\devstudio60\vc98\bin\vcvars32.bat +::if "%MSVCDir%" == "" call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat" + +set INSTALLDIR=C:\Program Files\Tcl + +:: Where is the Tcl source directory? +set TCLDIR=..\..\tcl_head_stock +::set TCLDIR=..\..\tcl8.4 + +:: Build the normal stuff along with the help file. +:: nmake -nologo -f makefile.vc release winhelp OPTS=none if errorlevel 1 goto error -nmake -nologo -f makefile.vc release OPTS=static,linkexten + +:: Build the static core, dlls and shell. +:: +nmake -nologo -f makefile.vc release OPTS=static if errorlevel 1 goto error + +:: Build the special static libraries that use the dynamic runtime. +:: nmake -nologo -f makefile.vc core OPTS=static,msvcrt if errorlevel 1 goto error + +:: Build the core and shell for thread support. +:: +nmake -nologo -f makefile.vc release OPTS=threads +if errorlevel 1 goto error + +:: Build a static, thread support core library (no shell). +:: nmake -nologo -f makefile.vc core OPTS=static,threads if errorlevel 1 goto error + +:: Build the special static libraries the use the dynamic runtime, +:: but now with thread support. +:: nmake -nologo -f makefile.vc core OPTS=static,msvcrt,threads if errorlevel 1 goto error -nmake -nologo -f makefile.vc release OPTS=threads -if errorlevel 1 goto error + goto end :error echo *** BOOM! *** :end -echo done! +title Building Tk, please wait...DONE! +echo DONE! pause diff --git a/win/makefile.vc b/win/makefile.vc index 4bd537f..52feff6 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -12,7 +12,7 @@ # Copyright (c) 2001-2002 David Gravereaux. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.64 2002/11/01 18:33:54 andreas_kupries Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.65 2002/11/04 07:49:43 davygrvy Exp $ #------------------------------------------------------------------------------ !if "$(MSVCDIR)" == "" @@ -155,30 +155,6 @@ Please `cd` to its location first. PROJECT = tk !include "rules.vc" -_INSTALLDIR = $(INSTALLDIR:/=\) - -!if !defined(TCLDIR) -!if exist($(_INSTALLDIR)\include\tcl.h) -TCLINSTALL = 1 -_TCLDIR = $(_INSTALLDIR) -!else -MSG=^ -Don't know where tcl.h is. Set the _TCLDIR macro. -!error $(MSG) -!endif -!else -_TCLDIR = $(TCLDIR:/=\) -!if exist($(_TCLDIR)\include\tcl.h) -TCLINSTALL = 1 -!elseif exist($(_TCLDIR)\generic\tcl.h) -TCLINSTALL = 0 -!else -MSG =^ -Don't know where tcl.h is. the TCLDIR macro doesn't appear correct. -!error $(MSG) -!endif -!endif - !if $(TCLINSTALL) !message *** Warning: Tk requires the source distribution of Tcl to build from, !message *** at this time, sorry. Please set the TCLDIR macro to point to the @@ -193,47 +169,22 @@ WISHNAMEPREFIX = wish BINROOT = . ROOT = .. -TCLIMPLIBNAME = tcl$(VERSION)$(SUFX).lib -TCLLIBNAME = tcl$(VERSION)$(SUFX).$(EXT) -TCLSTUBLIBNAME = tclstub$(VERSION).lib +#TCLIMPLIBNAME = tcl$(VERSION)$(SUFX).lib +#TCLLIB = tcl$(VERSION)$(SUFX).$(EXT) +#TCLSTUBLIBNAME = tclstub$(VERSION).lib -TCLREGLIBNAME = tclreg11$(SUFX:t=).lib -TCLDDELIBNAME = tcldde12$(SUFX:t=).lib - -TKIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib +TKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib" TKLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) -TKLIB = $(OUT_DIR)\$(TKLIBNAME) +TKLIB = "$(OUT_DIR)\$(TKLIBNAME)" TKSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib -TKSTUBLIB = $(OUT_DIR)\$(TKSTUBLIBNAME) - -!if $(TCLINSTALL) -TCLSH = $(_INSTALLDIR)\bin\tclsh$(VERSION)$(SUFX).exe -TCLSTUBLIB = $(_INSTALLDIR)\lib\$(TCLSTUBLIBNAME) -TCLIMPLIB = $(_INSTALLDIR)\lib\$(TCLIMPLIBNAME) -TCL_LIBRARY = $(_INSTALLDIR)\lib -TCLREGLIB = $(_INSTALLDIR)\lib\$(TCLREGLIBNAME) -TCLDDELIB = $(_INSTALLDIR)\lib\$(TCLDDELIBNAME) -TCLTMP_DIR = \must\have\tcl\sources\to\build\this\target -COFFBASE = \must\have\tcl\sources\to\build\this\target -TOOLSDIR = \must\have\tcl\sources\to\build\this\target -!else -TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(VERSION)$(SUFX).exe -TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCLSTUBLIBNAME) -TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCLIMPLIBNAME) -TCL_LIBRARY = $(_TCLDIR)\library -TCLREGLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCLREGLIBNAME) -TCLDDELIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCLDDELIBNAME) -TCLTMP_DIR = $(_TCLDIR)\win\$(TMP_DIR:tk=tcl) -COFFBASE = $(_TCLDIR)\win\coffbase.txt -TOOLSDIR = $(_TCLDIR)\tools -!endif +TKSTUBLIB = "$(OUT_DIR)\$(TKSTUBLIBNAME)" -WISH = $(OUT_DIR)\$(WISHNAMEPREFIX)$(VERSION)$(SUFX).exe -WISHC = $(OUT_DIR)\$(WISHNAMEPREFIX)c$(VERSION)$(SUFX).exe +WISH = "$(OUT_DIR)\$(WISHNAMEPREFIX)$(VERSION)$(SUFX).exe" +WISHC = "$(OUT_DIR)\$(WISHNAMEPREFIX)c$(VERSION)$(SUFX).exe" -TKTEST = $(OUT_DIR)\$(PROJECT)test.exe -CAT32 = $(OUT_DIR)\cat32.exe +TKTEST = "$(OUT_DIR)\$(PROJECT)test.exe" +CAT32 = "$(OUT_DIR)\cat32.exe" RMDIR = .\rmd.bat RM = del @@ -245,7 +196,7 @@ INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include WISHOBJS = \ $(TMP_DIR)\winMain.obj \ -!if $(TCL_LINKWITHEXTENSIONS) +!if $(TCL_USE_STATIC_PACKAGES) $(TCLDDELIB) \ $(TCLREGLIB) \ !endif @@ -466,8 +417,8 @@ dlllflags = $(lflags) -dll conlflags = $(lflags) -subsystem:console guilflags = $(lflags) -subsystem:windows -baselibs = kernel32.lib advapi32.lib user32.lib -guilibs = $(baselibs) shell32.lib gdi32.lib comdlg32.lib winspool.lib imm32.lib comctl32.lib +baselibs = kernel32.lib advapi32.lib user32.lib +guilibs = $(baselibs) shell32.lib gdi32.lib comdlg32.lib winspool.lib imm32.lib comctl32.lib #--------------------------------------------------------------------- @@ -563,25 +514,25 @@ $(CAT32): $(_TCLDIR)\win\cat.c $(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj $(baselibs) install-binaries: - @xcopy /i /y "$(WISH)" "$(BIN_INSTALL_DIR)\" -!if "$(TKLIB)" != "$(TKIMPLIB)" - @xcopy /i /y "$(TKLIB)" "$(BIN_INSTALL_DIR)\" + @$(CPY) "$(WISH)" "$(BIN_INSTALL_DIR)\" +!if $(TKLIB) != $(TKIMPLIB) + @$(CPY) "$(TKLIB)" "$(BIN_INSTALL_DIR)\" !endif - @xcopy /i /y "$(TKIMPLIB)" "$(LIB_INSTALL_DIR)\" - @xcopy /i /y "$(TKSTUBLIB)" "$(LIB_INSTALL_DIR)\" + @$(CPY) "$(TKIMPLIB)" "$(LIB_INSTALL_DIR)\" + @$(CPY) "$(TKSTUBLIB)" "$(LIB_INSTALL_DIR)\" install-libraries: - @xcopy /i /y "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)\" - @xcopy /i /y "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)\" - @xcopy /i /y "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\" - @xcopy /i /y "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)\" - @xcopy /i /y "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11\" - @xcopy /i /y "$(ROOT)\library\*" "$(SCRIPT_INSTALL_DIR)\" - @xcopy /i /y "$(ROOT)\library\*" "$(SCRIPT_INSTALL_DIR)\" - @xcopy /i /y "$(ROOT)\library\demos\*" "$(SCRIPT_INSTALL_DIR)\demos\" - @xcopy /i /y "$(ROOT)\library\demos\images\*" "$(SCRIPT_INSTALL_DIR)\demos\images\" - @xcopy /i /y "$(ROOT)\library\images\*" "$(SCRIPT_INSTALL_DIR)\images\" - @xcopy /i /y "$(ROOT)\library\msgs\*" "$(SCRIPT_INSTALL_DIR)\msgs\" + @$(CPY) "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11\" + @$(CPY) "$(ROOT)\library\*" "$(SCRIPT_INSTALL_DIR)\" + @$(CPY) "$(ROOT)\library\*" "$(SCRIPT_INSTALL_DIR)\" + @$(CPY) "$(ROOT)\library\demos\*" "$(SCRIPT_INSTALL_DIR)\demos\" + @$(CPY) "$(ROOT)\library\demos\images\*" "$(SCRIPT_INSTALL_DIR)\demos\images\" + @$(CPY) "$(ROOT)\library\images\*" "$(SCRIPT_INSTALL_DIR)\images\" + @$(CPY) "$(ROOT)\library\msgs\*" "$(SCRIPT_INSTALL_DIR)\msgs\" #--------------------------------------------------------------------- @@ -630,11 +581,11 @@ winhelp: docsetup $(HELPFILE) docsetup: @if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR) -$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TOOLSDIR)\$$(@F) - copy $(TOOLSDIR)\$(@F) $(@D) +$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TCLTOOLSDIR)\$$(@F) + $(CPY) $(TCLTOOLSDIR)\$(@F) $(@D) $(BMP): - copy $(WINDIR)\$(@F) $(@D) + $(CPY) $(WINDIR)\$(@F) $(@D) $(HELPFILE): $(HELPRTF) $(BMP) cd $(DOCTMP_DIR) @@ -661,19 +612,19 @@ CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk")) CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/")) << cd $(MAKEDIR) - copy "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)" - copy "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)" + $(CPY) "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)" + $(CPY) "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)" -$(MAN2TCL): $(TOOLSDIR)\$$(@B).c - $(cc32) -nologo -G4 -ML -O2 -Fo$(@D)\ $(TOOLSDIR)\$(@B).c -link -out:$@ +$(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c + $(cc32) -nologo -G4 -ML -O2 -Fo$(@D)\ $(TCLTOOLSDIR)\$(@B).c -link -out:$@ $(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX) - $(TCLSH) $(MAN2HELP:\=/) -bitmap $(BMP_NOPATH) $(PROJECT) $(VERSION) $(DOCDIR:\=/) + $(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(VERSION) $(DOCDIR:\=/) install-docs: !if exist($(HELPFILE)) - @xcopy /i /y "$(HELPFILE)" "$(DOC_INSTALL_DIR)\" - @xcopy /i /y "$(HELPCNT)" "$(DOC_INSTALL_DIR)\" + $(CPY) "$(HELPFILE)" "$(DOC_INSTALL_DIR)\" + $(CPY) "$(HELPCNT)" "$(DOC_INSTALL_DIR)\" $(TCLSH) << puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..." set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(VERSION).cnt" r] @@ -702,8 +653,8 @@ close $$f #--------------------------------------------------------------------- $(TMP_DIR)\testMain.obj: $(WINDIR)\winMain.c -!if $(TCL_LINKWITHEXTENSIONS) - $(cc32) $(WISH_CFLAGS) -DTK_TEST -DTCL_LINKWITHEXTENSIONS -Fo$@ $? +!if $(TCL_USE_STATIC_PACKAGES) + $(cc32) $(WISH_CFLAGS) -DTK_TEST -DTCL_USE_STATIC_PACKAGES -Fo$@ $? !else $(cc32) $(WISH_CFLAGS) -DTK_TEST -Fo$@ $? !endif @@ -718,8 +669,8 @@ $(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c $(cc32) $(WISH_CFLAGS) -Fo$@ $? $(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c -!if $(TCL_LINKWITHEXTENSIONS) - $(cc32) $(WISH_CFLAGS) -DTCL_LINKWITHEXTENSIONS -Fo$@ $? +!if $(TCL_USE_STATIC_PACKAGES) + $(cc32) $(WISH_CFLAGS) -DTCL_USE_STATIC_PACKAGES -Fo$@ $? !else $(cc32) $(WISH_CFLAGS) -Fo$@ $? !endif diff --git a/win/rules.vc b/win/rules.vc index 44b33b8..72cf2c5 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -10,7 +10,7 @@ # Copyright (c) 2001-2002 David Gravereaux. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: rules.vc,v 1.3 2002/06/14 14:43:18 davygrvy Exp $ +# RCS: @(#) $Id: rules.vc,v 1.4 2002/11/04 07:49:43 davygrvy Exp $ #------------------------------------------------------------------------------ !ifndef _RULES_VC @@ -22,13 +22,34 @@ lib32 = lib rc32 = $(RC) # built-in default. !ifndef INSTALLDIR -INSTALLDIR = C:\Progra~1\Tcl +### Assume the normal default. +_INSTALLDIR = C:\Program Files\Tcl +!else +### Fix the path seperators. +_INSTALLDIR = $(INSTALLDIR:/=\) !endif !ifndef MACHINE MACHINE = IX86 !endif + +#---------------------------------------------------------- +# Set the proper copy method to avoid overwrite questions +# to the user when copying files. +#---------------------------------------------------------- + +!if "$(OS)" == "Windows_NT" +!if ![ver | find "4.0" > nul] +CPY = echo y | xcopy /i +!else +CPY = xcopy /i /y +!endif +!else +CPY = xcopy /i +!endif + + !message =============================================================================== #---------------------------------------------------------- @@ -100,7 +121,7 @@ DEBUG = 0 PROFILE = 0 MSVCRT = 0 LOIMPACT = 0 -TCL_LINKWITHEXTENSIONS = 0 +TCL_USE_STATIC_PACKAGES = 0 !else !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static @@ -116,9 +137,9 @@ MSVCRT = 0 !endif !if [nmakehlp -f $(OPTS) "linkexten"] !message *** Doing linkexten -TCL_LINKWITHEXTENSIONS = 1 +TCL_USE_STATIC_PACKAGES = 1 !else -TCL_LINKWITHEXTENSIONS = 0 +TCL_USE_STATIC_PACKAGES = 0 !endif !if [nmakehlp -f $(OPTS) "threads"] !message *** Doing threads @@ -151,7 +172,7 @@ LOIMPACT = 0 # 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 +TCL_USE_STATIC_PACKAGES = 0 !endif @@ -251,6 +272,70 @@ OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD #---------------------------------------------------------- +# Get common info used when building extensions. +#---------------------------------------------------------- + +!if "$(PROJECT)" != "tcl" + +!if !defined(TCLDIR) +!if exist("$(_INSTALLDIR)\include\tcl.h") +TCLINSTALL = 1 +_TCLDIR = $(_INSTALLDIR) +!else +MSG=^ +Don't know where tcl.h is. Set the TCLDIR macro. +!error $(MSG) +!endif +!else +_TCLDIR = $(TCLDIR:/=\) +!if exist("$(_TCLDIR)\include\tcl.h") +TCLINSTALL = 1 +!elseif exist("$(_TCLDIR)\generic\tcl.h") +TCLINSTALL = 0 +!else +MSG =^ +Don't know where tcl.h is. The TCLDIR macro doesn't appear correct. +!error $(MSG) +!endif +!endif + +### TODO: add a command to nmakehlp.c to grep for Tcl's version from tcl.h. +### Because nmake can't return a string, we'll need to play games with return +### codes :) It might look something like this: +#!if [nmakehlp -g $(TCL.H)] == 81 +#TCL_DOTVERSION = 8.1 +#!elseif [nmakehlp -g $(TCL.H)] == 82 +#TCL_DOTVERSION = 8.2 +#... +#!endif + +TCL_DOTVERSION = 8.4 +TCL_VERSION = $(TCL_DOTVERSION:.=) + +!if $(TCLINSTALL) +TCLSH = "$(_INSTALLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" +TCLSTUBLIB = "$(_INSTALLDIR)\lib\tclstub$(TCL_VERSION).lib" +TCLIMPLIB = "$(_INSTALLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib" +TCL_LIBRARY = $(_INSTALLDIR)\lib +TCLREGLIB = "$(_INSTALLDIR)\lib\tclreg11$(SUFX:t=).lib" +TCLDDELIB = "$(_INSTALLDIR)\lib\tcldde12$(SUFX:t=).lib" +COFFBASE = \must\have\tcl\sources\to\build\this\target +TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target +!else +TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe" +TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib" +TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib" +TCL_LIBRARY = $(_TCLDIR)\library +TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg11$(SUFX:t=).lib" +TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde12$(SUFX:t=).lib" +COFFBASE = "$(_TCLDIR)\win\coffbase.txt" +TCLTOOLSDIR = $(_TCLDIR)\tools +!endif + +!endif + + +#---------------------------------------------------------- # Display stats being used. #---------------------------------------------------------- diff --git a/win/winMain.c b/win/winMain.c index c0b3e2f..edfd42f 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: winMain.c,v 1.14 2002/10/19 02:10:07 hobbs Exp $ + * RCS: @(#) $Id: winMain.c,v 1.15 2002/11/04 07:49:43 davygrvy Exp $ */ #include <tk.h> @@ -173,6 +173,22 @@ Tcl_AppInit(interp) goto error; } } +#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 #ifdef TK_TEST if (Tktest_Init(interp) == TCL_ERROR) { |