diff options
author | patthoyts <patthoyts@noemail.net> | 2006-09-26 00:05:02 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@noemail.net> | 2006-09-26 00:05:02 (GMT) |
commit | a2234300becc6f63f6e4807bf725cf779b8f323b (patch) | |
tree | c0ac86f04e183856c29bf53794757d77eeea7dbc /win | |
parent | 376b2f304f4be02a6d6494aba7e2ebe414fb7053 (diff) | |
download | tcl-a2234300becc6f63f6e4807bf725cf779b8f323b.zip tcl-a2234300becc6f63f6e4807bf725cf779b8f323b.tar.gz tcl-a2234300becc6f63f6e4807bf725cf779b8f323b.tar.bz2 |
More fixing which struct stat to refer to. Some casts from time_t to int required.
Tcl_Time structure members are longs. Support for varying compiler options
and build to platform-specific subdirs.
FossilOrigin-Name: 514c0c66835ae9fb987a2a77113ddfacbfcc8232
Diffstat (limited to 'win')
-rw-r--r-- | win/makefile.vc | 30 | ||||
-rw-r--r-- | win/rules.vc | 78 | ||||
-rw-r--r-- | win/tclWinDde.c | 4 |
3 files changed, 72 insertions, 40 deletions
diff --git a/win/makefile.vc b/win/makefile.vc index 4fd5f94..62222de 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -12,7 +12,7 @@ # Copyright (c) 2001-2004 David Gravereaux. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.148 2006/09/21 14:56:15 vincentdarley Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.149 2006/09/26 00:05:03 patthoyts Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) @@ -416,12 +416,6 @@ WINDIR = $(ROOT)\win # Compile flags #--------------------------------------------------------------------- -# MSVC 2005 changes: -# -Op gone, use /fp:precise ? -# /QI0f has been removed. -# /YX removed - use /Yc or /Yu or better nothing. -# /GS and /GR are on by default - !if !$(DEBUG) !if $(OPTIMIZING) ### This cranks the optimization level to maximize speed @@ -433,11 +427,12 @@ cdebug = ### Warnings are too many, can't support warnings into errors. cdebug = -Z7 -Od $(DEBUGFLAGS) !else -cdebug = -Z7 -Od $(DEBUGFLAGS) +cdebug = -Z7 -WX $(DEBUGFLAGS) !endif ### Declarations common to all compiler options -cflags = -nologo -c -Fp$(TMP_DIR)^\ +cwarn = -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE +cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ !if $(FULLWARNINGS) cflags = $(cflags) -W4 @@ -445,15 +440,6 @@ cflags = $(cflags) -W4 cflags = $(cflags) -W3 !endif - -!if $(PENT_0F_ERRATA) -cflags = $(cflags) -QI0f -!endif - -!if $(ITAN_B_ERRATA) -cflags = $(cflags) -QIA64_Bx -!endif - !if $(MSVCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd @@ -581,6 +567,7 @@ $** $(baselibs) @<< $** << + $(_VC_MANIFEST_EMBED_DLL) -@del $*.exp !endif @@ -589,13 +576,16 @@ $(TCLSTUBLIB): $(TCLSTUBOBJS) $(TCLSH): $(TCLSHOBJS) $(TCLIMPLIB) $(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $** + $(_VC_MANIFEST_EMBED_EXE) $(TCLTEST): $(TCLTESTOBJS) $(TCLIMPLIB) $(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $** + $(_VC_MANIFEST_EMBED_EXE) $(TCLPIPEDLL): $(WINDIR)\stub16.c $(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $(WINDIR)\stub16.c $(link32) $(conlflags) -out:$@ $(TMP_DIR)\stub16.obj $(baselibs) + $(_VC_MANIFEST_EMBED_DLL) !if $(STATIC_BUILD) !if !$(TCL_USE_STATIC_PACKAGES) @@ -606,6 +596,7 @@ $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB) $(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcldde -out:$@ \ $** $(baselibs) + $(_VC_MANIFEST_EMBED_DLL) -@del $*.exp -@del $*.lib !endif @@ -619,6 +610,7 @@ $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB) $(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tclreg -out:$@ \ $** $(baselibs) + $(_VC_MANIFEST_EMBED_DLL) -@del $*.exp -@del $*.lib !endif @@ -627,7 +619,7 @@ $(CAT32): $(WINDIR)\cat.c $(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $? $(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj \ $(baselibs) - + $(_VC_MANIFEST_EMBED_EXE) #--------------------------------------------------------------------- # Regenerate the stubs files. [Development use only] diff --git a/win/rules.vc b/win/rules.vc index 68e490d..1a1bda6 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -8,9 +8,10 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 2001-2003 David Gravereaux. +# Copyright (c) 2003-2006 Patrick Thoyts # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: rules.vc,v 1.23 2006/09/11 21:24:38 patthoyts Exp $ +# RCS: @(#) $Id: rules.vc,v 1.24 2006/09/26 00:05:03 patthoyts Exp $ #------------------------------------------------------------------------------ !ifndef _RULES_VC @@ -25,7 +26,7 @@ rc32 = $(RC) # built-in default. ### Assume the normal default. _INSTALLDIR = C:\Program Files\Tcl !else -### Fix the path seperators. +### Fix the path separators. _INSTALLDIR = $(INSTALLDIR:/=\) !endif @@ -74,7 +75,7 @@ COPY = copy /y >NUL #---------------------------------------------------------- ### test for optimizations -!if [nmakehlp -c -Oti] +!if [nmakehlp -c -Ot] !message *** Compiler has 'Optimizations' OPTIMIZING = 1 !else @@ -82,7 +83,15 @@ OPTIMIZING = 1 OPTIMIZING = 0 !endif -OPTIMIZATIONS = +OPTIMIZATIONS = + +!if [nmakehlp -c -Ot] +OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot +!endif + +!if [nmakehlp -c -Oi] +OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi +!endif !if [nmakehlp -c -Op] OPTIMIZATIONS = $(OPTIMIZATIONS) -Op @@ -108,15 +117,33 @@ DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 DEBUGFLAGS = $(DEBUGFLAGS) -GZ !endif +COMPILERFLAGS =-W3 + +!if [nmakehlp -c -YX] +OPTIMIZATIONS = $(OPTIMIZATIONS) -YX +!endif + !if "$(MACHINE)" == "IX86" ### test for pentium errata !if [nmakehlp -c -QI0f] !message *** Compiler has 'Pentium 0x0f fix' -PENT_0F_ERRATA = 1 +COMPILERFLAGS = $(COMPILERFLAGSS) -QI0f !else !message *** Compiler doesn't have 'Pentium 0x0f fix' -PENT_0F_ERRATA = 0 !endif +!endif + +!if "$(MACHINE)" == "IA64" +### test for Itanium errata +!if [nmakehlp -c -QIA64_Bx] +!message *** Compiler has 'B-stepping errata workarounds' +COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx +!else +!message *** Compiler does not have 'B-stepping errata workarounds' +!endif +!endif + +!if "$(MACHINE)" == "IX86" ### test for -align:4096, when align:512 will do. !if [nmakehlp -l -opt:nowin98] !message *** Linker has 'Win98 alignment problem' @@ -126,21 +153,26 @@ ALIGN98_HACK = 1 ALIGN98_HACK = 0 !endif !else -PENT_0F_ERRATA = 0 ALIGN98_HACK = 0 !endif -!if "$(MACHINE)" == "IA64" -### test for Itanium errata -!if [nmakehlp -c -QIA64_Bx] -!message *** Compiler has 'B-stepping errata workarounds' -ITAN_B_ERRATA = 1 -!else -!message *** Compiler doesn't have 'B-stepping errata workarounds' -ITAN_B_ERRATA = 0 -!endif +#---------------------------------------------------------- +# MSVC8 (ships with Visual Studio 2005) generates a manifest +# file that we should link into the binaries. This is how. +#---------------------------------------------------------- + +_VC_MANIFEST_EMBED_EXE= +_VC_MANIFEST_EMBED_DLL= +!if ![cl /Zs /Tc NUL 2>&1 | find "Version 12" > NUL] +VCVER=6 +!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 13" > NUL] +VCVER=7 +!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 14" > NUL] +VCVER=8 +_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 +_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 !else -ITAN_B_ERRATA = 0 +VCVER=0 !endif #---------------------------------------------------------- @@ -247,6 +279,13 @@ BUILDDIRTOP = Debug BUILDDIRTOP = Release !endif +!if "$(MACHINE)" != "IX86" +BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) +!endif +!if $(VCVER) > 6 +BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) +!endif + !if !$(DEBUG) || $(DEBUG) && $(UNCHECKED) SUFX = $(SUFX:g=) !endif @@ -384,7 +423,7 @@ TCLINSTALL = 1 _TCLDIR = $(_INSTALLDIR) !else MSG=^ -Don't know where tcl.h is. Set the TCLDIR macro. +Failed to find tcl.h. Set the TCLDIR macro. !error $(MSG) !endif !else @@ -397,7 +436,7 @@ TCLH = "$(_TCLDIR)\generic\tcl.h" TCLINSTALL = 0 !else MSG =^ -Don't know where tcl.h is. The TCLDIR macro doesn't appear correct. +Failed to find tcl.h. The TCLDIR macro does not appear correct. !error $(MSG) !endif !endif @@ -470,5 +509,6 @@ TCLTOOLSDIR = $(_TCLDIR)\tools !message *** Output directory will be '$(OUT_DIR)' !message *** Suffix for binaries will be '$(SUFX)' !message *** Optional defines are '$(OPTDEFINES)' +!message *** Compiler version $(VCVER) options are '$(OPTIMIZATIONS) $(DEBUGFLAGS)' !endif diff --git a/win/tclWinDde.c b/win/tclWinDde.c index 5c38115..bcd086e 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.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: tclWinDde.c,v 1.30 2006/04/05 16:32:44 dgp Exp $ + * RCS: @(#) $Id: tclWinDde.c,v 1.31 2006/09/26 00:05:03 patthoyts Exp $ */ #include "tclInt.h" @@ -378,7 +378,7 @@ DdeSetServerName( } } Tcl_DStringSetLength(&dString, - offset + strlen(Tcl_DStringValue(&dString)+offset)); + offset + (int)strlen(Tcl_DStringValue(&dString)+offset)); } /* |