summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2002-03-27 21:15:43 (GMT)
committerdavygrvy <davygrvy@pobox.com>2002-03-27 21:15:43 (GMT)
commit64498b577d1955dd0f2b6458753a1a4ead7c94ca (patch)
tree7d275598a37046675c0e975116a22aadfde9af9e
parente3cea75b71cf20329aa594fbd4c50fd84c3939e7 (diff)
downloadtcl-64498b577d1955dd0f2b6458753a1a4ead7c94ca.zip
tcl-64498b577d1955dd0f2b6458753a1a4ead7c94ca.tar.gz
tcl-64498b577d1955dd0f2b6458753a1a4ead7c94ca.tar.bz2
* win/.cvsignore:
* win/buildall.vc.bat: * win/coffbase.txt: * win/makefile.vc: * win/nmakehlp.c (new): * win/rules.vc: First draft fix for [Bug 527941]. More changes need to done to the makehelp target to get to stop leaving build files in the tools/ directory. This does not address the syntax errors in the man files. Having the contents of tcl.hpj(.in) inside makefile.vc allows for version numbers to be replaced with macros. The new nmakehlp.c is built by rules.vc in preprocessing and removes the need to use tricky shell syntax that wasn't compatible on Win9x systems. This is a first draft repair for [Bug 533862].
-rw-r--r--win/.cvsignore1
-rwxr-xr-xwin/buildall.vc.bat9
-rw-r--r--win/coffbase.txt4
-rw-r--r--win/makefile.vc311
-rw-r--r--win/nmakehlp.c297
-rw-r--r--win/rules.vc58
6 files changed, 513 insertions, 167 deletions
diff --git a/win/.cvsignore b/win/.cvsignore
index b981097..b986cda 100644
--- a/win/.cvsignore
+++ b/win/.cvsignore
@@ -11,4 +11,5 @@ Release
Makefile
tcl.hpj
tclConfig.sh
+nmakehlp.exe
.#*
diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat
index 74c6e29..c7709f5 100755
--- a/win/buildall.vc.bat
+++ b/win/buildall.vc.bat
@@ -4,13 +4,13 @@
:: 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/02/20 19:06:53 davygrvy Exp $
+:: RCS: @(#) $Id: buildall.vc.bat,v 1.4 2002/03/27 21:15:43 davygrvy Exp $
-echo Sit back and have a couple cups of coffee while this grinds through ;)
+echo Sit back and have a cup of coffee while this grinds through ;)
echo You asked for *everything*, remember?
echo.
-if "%MSVCDir%" == "" call C:\progra~1\micros~4\vc98\bin\vcvars32.bat
+if "%MSVCDir%" == "" call C:\dev\devstudio60\vc98\bin\vcvars32.bat
set INSTALLDIR=C:\progra~1\tcl
nmake -nologo -f makefile.vc release winhelp OPTS=none
@@ -28,7 +28,8 @@ if errorlevel 1 goto error
goto end
:error
-echo **BOOM!**
+echo *** BOOM! ***
:end
+echo done!
pause
diff --git a/win/coffbase.txt b/win/coffbase.txt
index 3a86392..3ab33ff 100644
--- a/win/coffbase.txt
+++ b/win/coffbase.txt
@@ -10,9 +10,9 @@
; the /headers option to get the "size of image" data (already in hex). If the
; maximum size is too small a linker warning will occur. Modules can overlap when
; they're mutually exclusive. This info is placed in the DLL's PE header by the
-; linker when the `-base:@$(TCLDIR)\win\coffbase.txt,XXX` option is used.
+; linker with the `-base:@$(TCLDIR)\win\coffbase.txt,<key>` option.
;
-; RCS: @(#) $Id: coffbase.txt,v 1.3 2002/02/22 03:29:05 davygrvy Exp $
+; RCS: @(#) $Id: coffbase.txt,v 1.4 2002/03/27 21:15:43 davygrvy Exp $
tcl 0x10000000 0x00200000
tcldde 0x10200000 0x00010000
diff --git a/win/makefile.vc b/win/makefile.vc
index ed5bd31..d552759 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -9,10 +9,10 @@
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
# Copyright (c) 2001 ActiveState Corporation.
-# Copyright (c) 2001 Tomasoft Engineering.
+# Copyright (c) 2001-2002 David Gravereaux.
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: makefile.vc,v 1.83 2002/02/21 22:00:58 davygrvy Exp $
+# RCS: @(#) $Id: makefile.vc,v 1.84 2002/03/27 21:15:43 davygrvy Exp $
#------------------------------------------------------------------------------
!if "$(MSVCDIR)" == ""
@@ -40,28 +40,31 @@ the environment. Jump to this line to read the new instructions.
# the 64-bit compiler, if your SDK has it.
#
# 3) Targets are:
-# release -- builds the core, the shell and the dlls. (default)
-# dlls -- just builds the windows extensions and the 16-bit DOS
-# pipe/thunk driver.
+# release -- Builds the core, the shell and the dlls. (default)
+# dlls -- Just builds the windows extensions and the 16-bit DOS
+# pipe/thunk helper app.
# shell -- Just builds the shell and the core.
-# core -- Only builds the core.
-# all -- builds everything.
-# test -- builds and runs the test suite.
-# tcltest -- just builds the binaries for the test suite.
-# install -- installs the built binaries and libraries to $(INSTALLDIR)
+# core -- Only builds the core [tclXX.(dll|lib)].
+# all -- Builds everything.
+# test -- Builds and runs the test suite.
+# tcltest -- Just builds the test shell.
+# install -- Installs the built binaries and libraries to $(INSTALLDIR)
# as the root of the install tree.
-# plugin -- [currently out-dated].
-# clean -- removes the contents of $(TMP_DIR) and $(OUT_DIR)
-# genstubs -- rebuilds the Stubs table and support files (dev only).
-# winhelp -- builds the windows .hlp file for Tcl from the troff man
-# files.
+# tidy/clean/hose -- varying levels of cleaning.
+# genstubs -- Rebuilds the Stubs table and support files (dev only).
+# depend -- Generates an accurate set of source dependancies for this
+# makefile. Helpful to avoid problems when the sources are
+# refreshed and you rebuild, but can "overbuild" when common
+# headers like tclInt.h just get small changes.
+# winhelp -- Builds the windows .hlp file for Tcl from the troff man
+# files found in $(ROOT)\doc .
#
# 4) Macros usable on the commandline:
# INSTALLDIR=<path>
# Sets where to install Tcl from the built binaries.
# C:\Progra~1\Tcl is assumed when not specified.
#
-# OPTS=static,msvcrt,linkexten,threads,symbols,profile,none
+# OPTS=static,msvcrt,linkexten,threads,symbols,profile,loimpact,none
# Sets special options for the core. The default is for none.
# Any combination of the above may be used (comma separated).
# 'none' will over-ride everything to nothing.
@@ -144,7 +147,7 @@ the environment. Jump to this line to read the new instructions.
MSG = ^
You must run this makefile only from the directory it is in.^
Please `cd` to its location first.
-!error $(MSG)
+!error $(MSG)
!endif
PROJECT = tcl
@@ -176,11 +179,11 @@ TCLSH = $(OUT_DIR)\$(TCLSHNAME)
TCLPIPEDLLNAME = $(PROJECT)pip$(VERSION).dll
TCLPIPEDLL = $(OUT_DIR)\$(TCLPIPEDLLNAME)
-TCLREGDLLNAME = $(PROJECT)reg$(REGVERSION)$(SUFX:t=).$(EXT)
-TCLREGDLL = $(OUT_DIR)\$(TCLREGDLLNAME)
+TCLREGLIBNAME = $(PROJECT)reg$(REGVERSION)$(SUFX:t=).$(EXT)
+TCLREGLIB = $(OUT_DIR)\$(TCLREGLIBNAME)
-TCLDDEDLLNAME = $(PROJECT)dde$(DDEVERSION)$(SUFX:t=).$(EXT)
-TCLDDEDLL = $(OUT_DIR)\$(TCLDDEDLLNAME)
+TCLDDELIBNAME = $(PROJECT)dde$(DDEVERSION)$(SUFX:t=).$(EXT)
+TCLDDELIB = $(OUT_DIR)\$(TCLDDELIBNAME)
TCLHLPBASE = $(PROJECT)$(VERSION)
TCLHLP = $(OUT_DIR)\$(TCLHLPBASE).hlp
@@ -211,6 +214,10 @@ TCLTESTOBJS = \
$(TMP_DIR)\tclTestProcBodyObj.obj \
$(TMP_DIR)\tclThreadTest.obj \
$(TMP_DIR)\tclWinTest.obj \
+!if $(TCL_LINKWITHEXTENSIONS)
+ $(TMP_DIR)\tclWinReg.obj \
+ $(TMP_DIR)\tclWinDde.obj \
+!endif
$(TMP_DIR)\testMain.obj
TCLOBJS = \
@@ -300,6 +307,7 @@ TCLOBJS = \
TCLSTUBOBJS = $(TMP_DIR)\tclStubLib.obj
+### The following paths CANNOT have spaces in them.
COMPATDIR = $(ROOT)\compat
GENERICDIR = $(ROOT)\generic
TOOLSDIR = $(ROOT)\tools
@@ -321,7 +329,7 @@ cdebug = -O2 -Op -Gs
cdebug =
!endif
!else if "$(MACHINE)" == "IA64"
-# Warnings are too many to support warnings into errors.
+# Warnings are too many, can't support warnings into errors.
cdebug = -Z7 -Od
!else
cdebug = -Z7 -WX -Od
@@ -418,10 +426,8 @@ test: setup $(TCLTEST) dlls $(CAT32)
!endif
setup:
- @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) &\
- echo *** Created directory '$(OUT_DIR)'
- @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) &\
- echo *** Created directory '$(TMP_DIR)'
+ @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
+ @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
!if !$(STATIC_BUILD)
$(TCLIMPLIB): $(TCLLIB)
@@ -433,159 +439,121 @@ $(TCLLIB): $(TCLOBJS)
$**
<<
!else
- $(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcl -out:$@ $(baselibs) @<<
+ $(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcl -out:$@ \
+ $(baselibs) @<<
$**
<<
-@del $*.exp
!endif
-
$(TCLSTUBLIB): $(TCLSTUBOBJS)
$(lib32) -nologo -out:$@ $(TCLSTUBOBJS)
$(TCLSH): $(TCLSHOBJS) $(TCLIMPLIB)
- $(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) @<<
-$**
-<<
-
+ $(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $**
$(TCLTEST): $(TCLTESTOBJS) $(TCLIMPLIB)
- $(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) @<<
-$**
-<<
-
+ $(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $**
$(TCLPIPEDLL): $(WINDIR)\stub16.c
$(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $(WINDIR)\stub16.c
$(link32) $(conlflags) -out:$@ $(TMP_DIR)\stub16.obj $(baselibs)
-
!if $(STATIC_BUILD)
-$(TCLDDEDLL): $(TMP_DIR)\tclWinDde.obj
+$(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj
$(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinDde.obj
!else
-$(TCLDDEDLL): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB)
- $(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcldde -out:$@ $** $(baselibs)
+$(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB)
+ $(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcldde -out:$@ \
+ $** $(baselibs)
-@del $*.exp
-@del $*.lib
!endif
-
!if $(STATIC_BUILD)
-$(TCLREGDLL): $(TMP_DIR)\tclWinReg.obj
+$(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj
$(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinReg.obj
!else
-$(TCLREGDLL): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB)
- $(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tclreg -out:$@ $** $(baselibs)
+$(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB)
+ $(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tclreg -out:$@ \
+ $** $(baselibs)
-@del $*.exp
-@del $*.lib
!endif
-
$(CAT32): $(WINDIR)\cat.c
$(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $?
$(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj \
$(baselibs)
-install-binaries:
- @echo installing $(TCLLIBNAME)
-!if "$(TCLLIB)" != "$(TCLIMPLIB)"
- @xcopy /i /y "$(TCLLIB)" "$(BIN_INSTALL_DIR)\"
-!endif
- @xcopy /i /y "$(TCLIMPLIB)" "$(LIB_INSTALL_DIR)\"
-!if exist($(TCLSH))
- @echo installing $(TCLSHNAME)
- @xcopy /i /y "$(TCLSH)" "$(BIN_INSTALL_DIR)\"
-!endif
-!if exist($(TCLPIPEDLL))
- @echo installing $(TCLPIPEDLLNAME)
- @xcopy /i /y "$(TCLPIPEDLL)" "$(BIN_INSTALL_DIR)\"
-!endif
- @echo installing $(TCLSTUBLIBNAME)
- @xcopy /i /y "$(TCLSTUBLIB)" "$(LIB_INSTALL_DIR)\"
-!if exist($(TCLHLP))
- @xcopy /i /y "$(TCLHLP)" "$(DOC_INSTALL_DIR)\"
- @xcopy /i /y "$(TCLHLPCNT)" "$(DOC_INSTALL_DIR)\"
-!endif
-install-libraries:
- @echo installing http1.0
- @xcopy /i /y "$(ROOT)\library\http1.0\*.tcl" \
- "$(SCRIPT_INSTALL_DIR)\http1.0\"
- @echo installing http2.4
- @xcopy /i /y "$(ROOT)\library\http\*.tcl" \
- "$(SCRIPT_INSTALL_DIR)\http2.4\"
- @echo installing opt0.4
- @xcopy /i /y "$(ROOT)\library\opt\*.tcl" \
- "$(SCRIPT_INSTALL_DIR)\opt0.4\"
- @echo installing msgcat1.2
- @xcopy /i /y "$(ROOT)\library\msgcat\*.tcl" \
- "$(SCRIPT_INSTALL_DIR)\msgcat1.2\"
- @echo installing $(TCLDDEDLLNAME)
-!if $(STATIC_BUILD)
- @xcopy /i /y "$(TCLDDEDLL)" "$(LIB_INSTALL_DIR)\"
-!else
- @xcopy /i /y "$(TCLDDEDLL)" "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\"
- @xcopy /i /y "$(ROOT)\library\dde\pkgIndex.tcl" \
- "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\"
-!endif
- @echo installing $(TCLREGDLLNAME)
-!if $(STATIC_BUILD)
- @xcopy /i /y "$(TCLREGDLL)" "$(LIB_INSTALL_DIR)\"
+#---------------------------------------------------------------------
+# Regenerate the stubs files. [Development use only]
+#---------------------------------------------------------------------
+
+genstubs:
+!if !exist($(TCLSH))
+ @echo Build tclsh first!
!else
- @xcopy /i /y "$(TCLREGDLL)" "$(LIB_INSTALL_DIR)\reg$(REGDOTVERSION)\"
- @xcopy /i /y "$(ROOT)\library\reg\pkgIndex.tcl" \
- "$(LIB_INSTALL_DIR)\reg$(REGDOTVERSION)\"
+ $(TCLSH) $(TOOLSDIR)\genStubs.tcl $(GENERICDIR) \
+ $(GENERICDIR)\tcl.decls $(GENERICDIR)\tclInt.decls
!endif
- @echo installing encoding files
- @xcopy /i /y "$(ROOT)\library\encoding\*.enc" \
- "$(SCRIPT_INSTALL_DIR)\encoding\"
- @echo installing library files
- @xcopy /i /y "$(GENERICDIR)\tcl.h" "$(INCLUDE_INSTALL_DIR)\"
- @xcopy /i /y "$(GENERICDIR)\tclDecls.h" "$(INCLUDE_INSTALL_DIR)\"
- @xcopy /i /y "$(GENERICDIR)\tclPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\"
- @xcopy /i /y "$(ROOT)\library\history.tcl" "$(SCRIPT_INSTALL_DIR)\"
- @xcopy /i /y "$(ROOT)\library\init.tcl" "$(SCRIPT_INSTALL_DIR)\"
- @xcopy /i /y "$(ROOT)\library\ldAout.tcl" "$(SCRIPT_INSTALL_DIR)\"
- @xcopy /i /y "$(ROOT)\library\parray.tcl" "$(SCRIPT_INSTALL_DIR)\"
- @xcopy /i /y "$(ROOT)\library\safe.tcl" "$(SCRIPT_INSTALL_DIR)\"
- @xcopy /i /y "$(ROOT)\library\tclIndex" "$(SCRIPT_INSTALL_DIR)\"
- @xcopy /i /y "$(ROOT)\library\package.tcl" "$(SCRIPT_INSTALL_DIR)\"
- @xcopy /i /y "$(ROOT)\library\word.tcl" "$(SCRIPT_INSTALL_DIR)\"
- @xcopy /i /y "$(ROOT)\library\auto.tcl" "$(SCRIPT_INSTALL_DIR)\"
#---------------------------------------------------------------------
-# Regenerate the stubs files.
+# Generate the makefile depedancies.
#---------------------------------------------------------------------
-genstubs:
- tclsh$(VERSION) $(ROOT)\tools\genStubs.tcl $(GENERICDIR) \
- $(GENERICDIR)\tcl.decls $(GENERICDIR)\tclInt.decls
+depend:
+!if !exist($(TCLSH))
+ @echo Build tclsh first!
+!else
+ echo $(TCL_INCLUDES)
+ $(TCLSH) $(TOOLSDIR)\mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
+ -passthru:"-DBUILD_tcl $(TCL_INCLUDES:"="")" $(GENERICDIR) \
+ $(COMPATDIR) $(WINDIR) @<<
+$(TCLOBJS)
+<<
+!endif
#---------------------------------------------------------------------
-# Regenerate the windows help files.
+# Build the windows help file.
#---------------------------------------------------------------------
MAN2TCL = $(TOOLSDIR)\man2tcl
-TCLRTF = $(TOOLSDIR)\tcl.rtf
+TCLRTF = $(TOOLSDIR)\$(PROJECT).rtf
MAN2HELP = $(TOOLSDIR)\man2help.tcl
-TCLHPJ = $(TOOLSDIR)\tcl.hpj
winhelp: $(TCLHLP)
$(TCLHLP): $(TCLRTF)
cd $(TOOLSDIR)
- start /wait hcrtf.exe -x tcl.hpj
+ start /wait hcrtf.exe -x <<$(PROJECT).hpj
+[OPTIONS]
+COMPRESS=12 Hall Zeck
+LCID=0x409 0x0 0x0 ; English (United States)
+TITLE=Tcl/Tk Reference Manual
+CNT=$(TCLHLPBASE).cnt
+HLP=$(TCLHLPBASE).hlp
+
+[FILES]
+$(PROJECT).rtf
+
+[WINDOWS]
+main="Tcl/Tk Reference Manual",,0
+
+[CONFIG]
+BrowseButtons()
+CreateButton(1, "Main Web Site", ExecFile("http://www.tcl.tk"))
+CreateButton(2, "Sourceforge", ExecFile("http://sf.net/projects/tcl"))
+CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk"))
+<<
cd $(MAKEDIR)
copy $(TOOLSDIR)\$(TCLHLPBASE).hlp $(OUT_DIR)
copy $(TOOLSDIR)\$(TCLHLPBASE).cnt $(OUT_DIR)
-$(TCLHPJ): $(TCLHPJ).in
- copy $(TCLHPJ).in $(TCLHPJ)
-
-$(MAN2TCL).exe: $(MAN2TCL).obj
+$(MAN2TCL).exe:
cd $(TOOLSDIR)
$(cc32) -nologo -G4 -ML -O2 $(MAN2TCL).c
cd $(MAKEDIR)
@@ -623,7 +591,7 @@ $(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
$(cc32) $(TCL_CFLAGS) -Fo$@ $?
!endif
-# The following objects should be built using the stub interfaces
+### The following objects should be built using the stub interfaces
$(TMP_DIR)\tclWinReg.obj: $(WINDIR)\tclWinReg.c
!if $(STATIC_BUILD)
@@ -641,8 +609,8 @@ $(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
!endif
-# The following objects are part of the stub library and should not
-# be built as DLL objects but none of the symbols should be exported
+### The following objects are part of the stub library and should not
+### be built as DLL objects but none of the symbols should be exported
$(TMP_DIR)\tclStubLib.obj: $(GENERICDIR)\tclStubLib.c
$(cc32) $(cdebug) $(cflags) -Zl -DSTATIC_BUILD $(TCL_INCLUDES) -Fo$@ $?
@@ -671,6 +639,16 @@ $(GENERICDIR)\regfree.c: $(GENERICDIR)\regguts.h
$(GENERICDIR)\regfronts.c: $(GENERICDIR)\regguts.h
$(GENERICDIR)\regguts.h: $(GENERICDIR)\regcustom.h
+!if exist("$(OUT_DIR)\depend.mk")
+!include "$(OUT_DIR)\depend.mk"
+!message *** Dependency rules in effect.
+!else
+!message *** Dependency rules are not being used.
+!endif
+
+### add a spacer in the output
+!message
+
#---------------------------------------------------------------------
# Implicit rules
@@ -692,7 +670,7 @@ $<
<<
{$(WINDIR)}.rc{$(TMP_DIR)}.res:
- $(rc32) -fo $@ -r -i $(GENERICDIR) -D__WIN32__ \
+ $(rc32) -fo $@ -r -i "$(GENERICDIR)" -D__WIN32__ \
!if $(DEBUG)
-d DEBUG \
!endif
@@ -704,6 +682,81 @@ $<
!endif
$<
+.SUFFIXES:
+.SUFFIXES:.c .rc
+
+
+#---------------------------------------------------------------------
+# Installation.
+#---------------------------------------------------------------------
+
+install-binaries:
+ @echo installing $(TCLLIBNAME)
+!if "$(TCLLIB)" != "$(TCLIMPLIB)"
+ @xcopy /i /y "$(TCLLIB)" "$(BIN_INSTALL_DIR)\"
+!endif
+ @xcopy /i /y "$(TCLIMPLIB)" "$(LIB_INSTALL_DIR)\"
+!if exist($(TCLSH))
+ @echo installing $(TCLSHNAME)
+ @xcopy /i /y "$(TCLSH)" "$(BIN_INSTALL_DIR)\"
+!endif
+!if exist($(TCLPIPEDLL))
+ @echo installing $(TCLPIPEDLLNAME)
+ @xcopy /i /y "$(TCLPIPEDLL)" "$(BIN_INSTALL_DIR)\"
+!endif
+ @echo installing $(TCLSTUBLIBNAME)
+ @xcopy /i /y "$(TCLSTUBLIB)" "$(LIB_INSTALL_DIR)\"
+!if exist($(TCLHLP))
+ @xcopy /i /y "$(TCLHLP)" "$(DOC_INSTALL_DIR)\"
+ @xcopy /i /y "$(TCLHLPCNT)" "$(DOC_INSTALL_DIR)\"
+!endif
+
+install-libraries:
+ @echo installing http1.0
+ @xcopy /i /y "$(ROOT)\library\http1.0\*.tcl" \
+ "$(SCRIPT_INSTALL_DIR)\http1.0\"
+ @echo installing http2.4
+ @xcopy /i /y "$(ROOT)\library\http\*.tcl" \
+ "$(SCRIPT_INSTALL_DIR)\http2.4\"
+ @echo installing opt0.4
+ @xcopy /i /y "$(ROOT)\library\opt\*.tcl" \
+ "$(SCRIPT_INSTALL_DIR)\opt0.4\"
+ @echo installing msgcat1.2
+ @xcopy /i /y "$(ROOT)\library\msgcat\*.tcl" \
+ "$(SCRIPT_INSTALL_DIR)\msgcat1.2\"
+ @echo installing $(TCLDDELIBNAME)
+!if $(STATIC_BUILD)
+ @xcopy /i /y "$(TCLDDELIB)" "$(LIB_INSTALL_DIR)\"
+!else
+ @xcopy /i /y "$(TCLDDELIB)" "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\"
+ @xcopy /i /y "$(ROOT)\library\dde\pkgIndex.tcl" \
+ "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\"
+!endif
+ @echo installing $(TCLREGLIBNAME)
+!if $(STATIC_BUILD)
+ @xcopy /i /y "$(TCLREGLIB)" "$(LIB_INSTALL_DIR)\"
+!else
+ @xcopy /i /y "$(TCLREGLIB)" "$(LIB_INSTALL_DIR)\reg$(REGDOTVERSION)\"
+ @xcopy /i /y "$(ROOT)\library\reg\pkgIndex.tcl" \
+ "$(LIB_INSTALL_DIR)\reg$(REGDOTVERSION)\"
+!endif
+ @echo installing encoding files
+ @xcopy /i /y "$(ROOT)\library\encoding\*.enc" \
+ "$(SCRIPT_INSTALL_DIR)\encoding\"
+ @echo installing library files
+ @xcopy /i /y "$(GENERICDIR)\tcl.h" "$(INCLUDE_INSTALL_DIR)\"
+ @xcopy /i /y "$(GENERICDIR)\tclDecls.h" "$(INCLUDE_INSTALL_DIR)\"
+ @xcopy /i /y "$(GENERICDIR)\tclPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\history.tcl" "$(SCRIPT_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\init.tcl" "$(SCRIPT_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\ldAout.tcl" "$(SCRIPT_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\parray.tcl" "$(SCRIPT_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\safe.tcl" "$(SCRIPT_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\tclIndex" "$(SCRIPT_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\package.tcl" "$(SCRIPT_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\word.tcl" "$(SCRIPT_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\auto.tcl" "$(SCRIPT_INSTALL_DIR)\"
+
#---------------------------------------------------------------------
# Clean up
@@ -713,15 +766,11 @@ tidy:
-del $(TCLLIB)
-del $(TCLSH)
-del $(TCLTEST)
- -del $(TCLDDEDLL)
- -del $(TCLREGDLL)
+ -del $(TCLDDELIB)
+ -del $(TCLREGLIB)
-clean:
+clean: tidy
-@$(RMDIR) $(TMP_DIR)
hose: clean
-@$(RMDIR) $(OUT_DIR)
-
-
-.SUFFIXES:
-.SUFFIXES:.c .rc
diff --git a/win/nmakehlp.c b/win/nmakehlp.c
new file mode 100644
index 0000000..4906303
--- /dev/null
+++ b/win/nmakehlp.c
@@ -0,0 +1,297 @@
+/* ----------------------------------------------------------------------------
+ * nmakehlp.c --
+ *
+ * This is used to fix limitations within nmake and the environment.
+ *
+ * Copyright (c) 2002 by David Gravereaux.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * ----------------------------------------------------------------------------
+ * RCS: @(#) $Id: nmakehlp.c,v 1.1 2002/03/27 21:15:43 davygrvy Exp $
+ * ----------------------------------------------------------------------------
+ */
+#include <windows.h>
+#pragma comment (lib, "user32.lib")
+#pragma comment (lib, "kernel32.lib")
+
+/* protos */
+int CheckForCompilerFeature (const char *option);
+int CheckForLinkerFeature (const char *option);
+int IsIn (const char *string, const char *substring);
+DWORD WINAPI ReadFromPipe (LPVOID args);
+
+/* globals */
+typedef struct {
+ HANDLE pipe;
+ char buffer[1000];
+} pipeinfo;
+
+pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'};
+pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'};
+
+
+
+/* exitcodes: 0 == no, 1 == yes, 2 == error */
+int
+main (int argc, char *argv[])
+{
+ char msg[300];
+ DWORD dwWritten;
+ int chars;
+
+ if (argc > 1 && *argv[1] == '-') {
+ switch (*(argv[1]+1)) {
+ case 'c':
+ if (argc != 3) {
+ chars = wsprintf(msg, "usage: %s -c <compiler option>\n"
+ "Tests for whether cl.exe supports an option\n"
+ "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
+ return 2;
+ }
+ return CheckForCompilerFeature(argv[2]);
+ case 'l':
+ if (argc != 3) {
+ chars = wsprintf(msg, "usage: %s -l <linker option>\n"
+ "Tests for whether link.exe supports an option\n"
+ "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
+ return 2;
+ }
+ return CheckForLinkerFeature(argv[2]);
+ case 'f':
+ if (argc == 2) {
+ chars = wsprintf(msg, "usage: %s -f <string> <substring>\n"
+ "Find a substring within another\n"
+ "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
+ return 2;
+ } else if (argc == 3) {
+ /* if the string is blank, there is no match */
+ return 0;
+ } else {
+ return IsIn(argv[2], argv[3]);
+ }
+ }
+ }
+ chars = wsprintf(msg, "usage: %s -c|-l|-f ...\n"
+ "This is a little helper app to equalize shell differences between WinNT and\n"
+ "Win9x and get nmake.exe to accomplish its job.\n",
+ argv[0]);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
+ return 2;
+}
+
+int
+CheckForCompilerFeature (const char *option)
+{
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ SECURITY_ATTRIBUTES sa;
+ DWORD threadID;
+ char msg[300];
+ BOOL ok;
+ HANDLE hProcess, h, pipeThreads[2];
+ char cmdline[100];
+
+ hProcess = GetCurrentProcess();
+
+ ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
+ ZeroMemory(&si, sizeof(STARTUPINFO));
+ si.cb = sizeof(STARTUPINFO);
+ si.dwFlags = STARTF_USESTDHANDLES;
+ si.hStdInput = INVALID_HANDLE_VALUE;
+
+ ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
+ sa.nLength = sizeof(SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = FALSE;
+
+ /* create a non-inheritible pipe. */
+ CreatePipe(&Out.pipe, &h, &sa, 0);
+
+ /* dupe the write side, make it inheritible, and close the original. */
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput,
+ 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
+
+ /* Same as above, but for the error side. */
+ CreatePipe(&Err.pipe, &h, &sa, 0);
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdError,
+ 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
+
+ /* base command line */
+ strcpy(cmdline, "cl.exe -nologo -c -TC -Fdtemp ");
+ /* append our option for testing */
+ strcat(cmdline, option);
+ /* filename to compile, which exists, but is nothing and empty. */
+ strcat(cmdline, " nul");
+
+ ok = CreateProcess(
+ NULL, /* Module name. */
+ cmdline, /* Command line. */
+ NULL, /* Process handle not inheritable. */
+ NULL, /* Thread handle not inheritable. */
+ TRUE, /* yes, inherit handles. */
+ DETACHED_PROCESS, /* No console for you. */
+ NULL, /* Use parent's environment block. */
+ NULL, /* Use parent's starting directory. */
+ &si, /* Pointer to STARTUPINFO structure. */
+ &pi); /* Pointer to PROCESS_INFORMATION structure. */
+
+ if (!ok) {
+ DWORD err = GetLastError();
+ int chars = wsprintf(msg, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
+
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID) &msg[chars],
+ (300-chars), 0);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err, NULL);
+ return 2;
+ }
+
+ /* close our references to the write handles that have now been inherited. */
+ CloseHandle(si.hStdOutput);
+ CloseHandle(si.hStdError);
+
+ WaitForInputIdle(pi.hProcess, 5000);
+ CloseHandle(pi.hThread);
+
+ /* start the pipe reader threads. */
+ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID);
+ pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID);
+
+ /* block waiting for the process to end. */
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ CloseHandle(pi.hProcess);
+
+ /* clean up temporary files before returning */
+ DeleteFile("temp.idb");
+ DeleteFile("temp.pdb");
+
+ /* wait for our pipe to get done reading, should it be a little slow. */
+ WaitForMultipleObjects(2, pipeThreads, TRUE, 500);
+ CloseHandle(pipeThreads[0]);
+ CloseHandle(pipeThreads[1]);
+
+ /* look for the commandline warning code in both streams. */
+ return !(strstr(Out.buffer, "D4002") != NULL || strstr(Err.buffer, "D4002") != NULL);
+}
+
+int
+CheckForLinkerFeature (const char *option)
+{
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ SECURITY_ATTRIBUTES sa;
+ DWORD threadID;
+ char msg[300];
+ BOOL ok;
+ HANDLE hProcess, h, pipeThreads[2];
+ char cmdline[100];
+
+ hProcess = GetCurrentProcess();
+
+ ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
+ ZeroMemory(&si, sizeof(STARTUPINFO));
+ si.cb = sizeof(STARTUPINFO);
+ si.dwFlags = STARTF_USESTDHANDLES;
+ si.hStdInput = INVALID_HANDLE_VALUE;
+
+ ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
+ sa.nLength = sizeof(SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+ /* create a non-inheritible pipe. */
+ CreatePipe(&Out.pipe, &h, &sa, 0);
+
+ /* dupe the write side, make it inheritible, and close the original. */
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput,
+ 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
+
+ /* Same as above, but for the error side. */
+ CreatePipe(&Err.pipe, &h, &sa, 0);
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdError,
+ 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
+
+ /* base command line */
+ strcpy(cmdline, "link.exe -nologo ");
+ /* append our option for testing */
+ strcat(cmdline, option);
+ /* filename to compile, which exists, but is nothing and empty. */
+// strcat(cmdline, " nul");
+
+ ok = CreateProcess(
+ NULL, /* Module name. */
+ cmdline, /* Command line. */
+ NULL, /* Process handle not inheritable. */
+ NULL, /* Thread handle not inheritable. */
+ TRUE, /* yes, inherit handles. */
+ DETACHED_PROCESS, /* No console for you. */
+ NULL, /* Use parent's environment block. */
+ NULL, /* Use parent's starting directory. */
+ &si, /* Pointer to STARTUPINFO structure. */
+ &pi); /* Pointer to PROCESS_INFORMATION structure. */
+
+ if (!ok) {
+ DWORD err = GetLastError();
+ int chars = wsprintf(msg, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
+
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID) &msg[chars],
+ (300-chars), 0);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err, NULL);
+ return 2;
+ }
+
+ /* close our references to the write handles that have now been inherited. */
+ CloseHandle(si.hStdOutput);
+ CloseHandle(si.hStdError);
+
+ WaitForInputIdle(pi.hProcess, 5000);
+ CloseHandle(pi.hThread);
+
+ /* start the pipe reader threads. */
+ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID);
+ pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID);
+
+ /* block waiting for the process to end. */
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ CloseHandle(pi.hProcess);
+
+ /* wait for our pipe to get done reading, should it be a little slow. */
+ WaitForMultipleObjects(2, pipeThreads, TRUE, 500);
+ CloseHandle(pipeThreads[0]);
+ CloseHandle(pipeThreads[1]);
+
+ /* look for the commandline warning code in the stderr stream. */
+ return !(strstr(Out.buffer, "LNK1117") != NULL || strstr(Err.buffer, "LNK1117") != NULL);
+}
+
+DWORD WINAPI
+ReadFromPipe (LPVOID args)
+{
+ pipeinfo *pi = (pipeinfo *) args;
+ char *lastBuf = pi->buffer;
+ DWORD dwRead;
+ BOOL ok;
+
+again:
+ ok = ReadFile(pi->pipe, lastBuf, 25, &dwRead, 0L);
+ if (!ok || dwRead == 0) {
+ CloseHandle(pi->pipe);
+ return 0;
+ }
+ lastBuf += dwRead;
+ goto again;
+
+ return 0; /* makes the compiler happy */
+}
+
+int
+IsIn (const char *string, const char *substring)
+{
+ return (strstr(string, substring) != NULL);
+}
diff --git a/win/rules.vc b/win/rules.vc
index 00e4255..1c0db8e 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -7,10 +7,10 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# Copyright (c) 2001 Tomasoft Engineering.
+# Copyright (c) 2001-2002 David Gravereaux.
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: rules.vc,v 1.6 2002/02/21 18:37:27 davygrvy Exp $
+# RCS: @(#) $Id: rules.vc,v 1.7 2002/03/27 21:15:43 davygrvy Exp $
#------------------------------------------------------------------------------
!ifndef _RULES_VC
@@ -31,19 +31,22 @@ MACHINE = IX86
!message ===============================================================================
-
#----------------------------------------------------------
-# Test for compiler features
+# build the helper app we need to overcome nmake's limiting
+# environment.
#----------------------------------------------------------
-### Just display the compiler and linker versions to the output
-!if [$(cc32) 2>&1 | find "(R)"]
+!if !exist(nmakehlp.exe)
+!if [$(cc32) -nologo -ML nmakehlp.c -link -subsystem:console > nul]
!endif
-!if [$(link32) 2>&1 | find "(R)"]
!endif
+#----------------------------------------------------------
+# Test for compiler features
+#----------------------------------------------------------
+
### test for optimizations
-!if [$(cc32) -Ox -nologo -c -Zs -TC -Fdtemp nul 2>&1 | find "D4002" > nul]
+!if [nmakehlp -c -Ox]
!message *** Compiler has 'Optimizations'
OPTIMIZING = 1
!else
@@ -51,16 +54,17 @@ OPTIMIZING = 1
OPTIMIZING = 0
!endif
-### test for pentium errata
!if "$(MACHINE)" == "IX86"
-!if [$(cc32) -QI0f -nologo -c -Zs -TC -Fdtemp nul 2>&1 | find "D4002" > nul]
+### test for pentium errata
+!if [nmakehlp -c -QI0f]
!message *** Compiler has 'Pentium 0x0f fix'
PENT_0F_ERRATA = 1
!else
!message *** Compiler doesn't have 'Pentium 0x0f fix'
PENT_0F_ERRATA = 0
!endif
-!if [$(link32) -nologo -opt:nowin98 2>&1 | find "LNK1117" > nul]
+### test for -align:4096, when align:512 will do.
+!if [nmakehlp -l -opt:nowin98]
!message *** Linker has 'Win98 alignment problem'
ALIGN98_HACK = 1
!else
@@ -72,9 +76,9 @@ PENT_0F_ERRATA = 0
ALIGN98_HACK = 0
!endif
-### test for Itanium errata
!if "$(MACHINE)" == "IA64"
-!if [$(cc32) -QIA64_Bx -nologo -c -Zs -TC -Fdtemp nul 2>&1 | find "D4002" > nul]
+### test for Itanium errata
+!if [nmakehlp -c -QIA64_Bx]
!message *** Compiler has 'B-stepping errata workarounds'
ITAN_B_ERRATA = 1
!else
@@ -85,16 +89,11 @@ ITAN_B_ERRATA = 0
ITAN_B_ERRATA = 0
!endif
-### Clean-up temp files after tests.
-!if [@for %d in (temp.idb temp.pdb) do @if exist %d del %d]
-!endif
-
-
#----------------------------------------------------------
# Decode the options requested.
#----------------------------------------------------------
-!if "$(OPTS)" == "" || ![echo "$(OPTS)" | find /i "none" > nul]
+!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
STATIC_BUILD = 0
TCL_THREADS = 0
DEBUG = 0
@@ -103,43 +102,43 @@ MSVCRT = 0
LOIMPACT = 0
TCL_LINKWITHEXTENSIONS = 0
!else
-!if ![echo $(OPTS) | find /i "static" > nul]
+!if [nmakehlp -f $(OPTS) "static"]
!message *** Doing static
STATIC_BUILD = 1
!else
STATIC_BUILD = 0
!endif
-!if ![echo $(OPTS) | find /i "msvcrt" > nul]
+!if [nmakehlp -f $(OPTS) "msvcrt"]
!message *** Doing msvcrt
MSVCRT = 1
!else
MSVCRT = 0
!endif
-!if ![echo $(OPTS) | find /i "linkexten" > nul]
+!if [nmakehlp -f $(OPTS) "linkexten"]
!message *** Doing linkexten
TCL_LINKWITHEXTENSIONS = 1
!else
TCL_LINKWITHEXTENSIONS = 0
!endif
-!if ![echo $(OPTS) | find /i "threads" > nul]
+!if [nmakehlp -f $(OPTS) "threads"]
!message *** Doing threads
TCL_THREADS = 1
!else
TCL_THREADS = 0
!endif
-!if ![echo $(OPTS) | find /i "symbols" > nul]
+!if [nmakehlp -f $(OPTS) "symbols"]
!message *** Doing symbols
DEBUG = 1
!else
DEBUG = 0
!endif
-!if ![echo $(OPTS) | find /i "profile" > nul]
+!if [nmakehlp -f $(OPTS) "profile"]
!message *** Doing profile
PROFILE = 1
!else
PROFILE = 0
!endif
-!if ![echo $(OPTS) | find /i "loimpact" > nul]
+!if [nmakehlp -f $(OPTS) "loimpact"]
!message *** Doing loimpact
LOIMPACT = 1
!else
@@ -213,17 +212,17 @@ OUT_DIR = $(TMP_DIR)
# Decode the statistics requested.
#----------------------------------------------------------
-!if "$(STATS)" == "" || ![echo "$(STATS)" | find /i "none" > nul]
+!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"]
TCL_MEM_DEBUG = 0
TCL_COMPILE_DEBUG = 0
!else
-!if ![echo $(STATS) | find /i "memdbg" > nul]
+!if [nmakehlp -f $(STATS) "memdbg"]
!message *** Doing memdbg
TCL_MEM_DEBUG = 1
!else
TCL_MEM_DEBUG = 0
!endif
-!if ![echo $(STATS) | find /i "compdbg" > nul]
+!if [nmakehlp -f $(STATS) "compdbg"]
!message *** Doing compdbg
TCL_COMPILE_DEBUG = 1
!else
@@ -259,6 +258,5 @@ OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
!message *** Output directory will be '$(OUT_DIR)'
!message *** Suffix for binaries will be '$(SUFX)'
!message *** Optional defines are '$(OPTDEFINES)'
-!message
!endif