Check-in [5fb2d63afa]
Bounty program for improvements to Tcl and certain Tcl packages.
Overview
Comment:Updated the nmake build files with MSVC9 support and fixed to run the test-suite properly. Corrected namespace handling in tls::initlib on Windows. Applied #1890223 to fix handshake on non-blocking sockets
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5fb2d63afac90707305245323253fa16d86a9f66
User & Date: patthoyts on 2008-03-19 02:34:21
Other Links: manifest | tags
Context
2008-03-19
19:59
* tls.c (Tls_Clean, ImportObjCmd): Fix cleanup mem leak [Bug 1414045] check-in: 8dd7366fcc user: hobbs2 tags: trunk
02:34
Updated the nmake build files with MSVC9 support and fixed to run the test-suite properly. Corrected namespace handling in tls::initlib on Windows. Applied #1890223 to fix handshake on non-blocking sockets check-in: 5fb2d63afa user: patthoyts tags: trunk
2008-03-18
00:40
* tls.tcl (tls::initlib): load tls.tcl first and call * Makefile.in (pkgIndex.tcl): tls::initlib to load library to handle cwd changes. [Bug 1888113] check-in: c55de2b08b user: hobbs2 tags: trunk
Changes

Modified ChangeLog from [59b9d3b9d8] to [c3dbe35daa].

            1  +2008-03-19  Pat Thoyts  <[email protected]>
            2  +
            3  +	* win/Makefile.vc  Updated the nmake build files with MSVC9 support
            4  +	* win/rules.vc:    and fixed to run the test-suite properly.
            5  +	* win/nmakehlp.c:
            6  +	* tls.tcl (tls::initlib): Corrected namespace handling.
            7  +	* tls.c: Applied #1890223 to fix handshake on non-blocking sockets
            8  +
     1      9   2007-09-06  Pat Thoyts  <[email protected]>
     2     10   
     3     11   	* tls.c:           Silence 64 bit integer conversion warnings
     4     12   	* win/nmakehlp.c:  Update build system to support AMD64 target
     5     13   	* win/makefile.vc: with MSVC8
     6     14   	* win/rules.vc:
     7     15   

Modified tls.c from [0abefbb942] to [531e26fa4b].

     1      1   /*
     2      2    * Copyright (C) 1997-1999 Matt Newman <[email protected]>
     3      3    * some modifications:
     4      4    *	Copyright (C) 2000 Ajuba Solutions
     5      5    *	Copyright (C) 2002 ActiveState Corporation
     6      6    *	Copyright (C) 2004 Starfish Systems 
     7      7    *
     8         - * $Header: /home/rkeene/tmp/cvs2fossil/../tcltls/tls/tls/tls.c,v 1.26 2007/09/06 21:01:55 patthoyts Exp $
            8  + * $Header: /home/rkeene/tmp/cvs2fossil/../tcltls/tls/tls/tls.c,v 1.27 2008/03/19 02:34:21 patthoyts Exp $
     9      9    *
    10     10    * TLS (aka SSL) Channel - can be layered on any bi-directional
    11     11    * Tcl_Channel (Note: Requires Trf Core Patch)
    12     12    *
    13     13    * This was built (almost) from scratch based upon observation of
    14     14    * OpenSSL 0.9.2B
    15     15    *
................................................................................
   604    604   	return TCL_ERROR;
   605    605       }
   606    606       statePtr = (State *)Tcl_GetChannelInstanceData(chan);
   607    607   
   608    608       if (!SSL_is_init_finished(statePtr->ssl)) {
   609    609   	int err;
   610    610   	ret = Tls_WaitForConnect(statePtr, &err);
          611  +	if ((statePtr->flags & TLS_TCL_ASYNC) && err == EAGAIN) {
          612  +	    ret = 0;
          613  +	}
   611    614   	if (ret < 0) {
   612    615   	    CONST char *errStr = statePtr->err;
   613    616   	    Tcl_ResetResult(interp);
   614    617   	    Tcl_SetErrno(err);
   615    618   
   616    619   	    if (!errStr || *errStr == 0) {
   617    620   		errStr = Tcl_PosixError(interp);

Modified tls.tcl from [ba8dd19213] to [aea23a4bee].

     1      1   #
     2      2   # Copyright (C) 1997-2000 Matt Newman <[email protected]> 
     3      3   #
     4         -# $Header: /home/rkeene/tmp/cvs2fossil/../tcltls/tls/tls/tls.tcl,v 1.9 2008/03/18 00:40:37 hobbs2 Exp $
            4  +# $Header: /home/rkeene/tmp/cvs2fossil/../tcltls/tls/tls/tls.tcl,v 1.10 2008/03/19 02:34:21 patthoyts Exp $
     5      5   #
     6      6   namespace eval tls {
     7      7       variable logcmd tclLog
     8      8       variable debug 0
     9      9    
    10     10       # Default flags passed to tls::import
    11     11       variable defaults {}
................................................................................
    23     23   
    24     24   proc tls::initlib {dir dll} {
    25     25       # Package index cd's into the package directory for loading.
    26     26       # Irrelevant to unixoids, but for Windows this enables the OS to find
    27     27       # the dependent DLL's in the CWD, where they may be.
    28     28       set cwd [pwd]
    29     29       catch {cd $dir}
    30         -    set res [catch {load [file join $dir $dll]} err]
           30  +    set res [catch {uplevel #0 [list load [file join [pwd] $dll]]} err]
    31     31       catch {cd $cwd}
    32     32       if {$res} {
    33         -	namespace delete tls
           33  +	namespace eval [namespace parent] {namespace delete tls}
    34     34   	return -code $res $err
    35     35       }
    36     36       rename tls::initlib {}
    37     37   }
    38     38   
    39     39   #
    40     40   # Backwards compatibility, also used to set the default

Modified win/makefile.vc from [a8ad16f8ba] to [1ecdb77483].

    14     14   # Copyright (c) 1995-1996 Sun Microsystems, Inc.
    15     15   # Copyright (c) 1998-2000 Ajuba Solutions.
    16     16   # Copyright (c) 2001 ActiveState Corporation.
    17     17   # Copyright (c) 2001-2002 David Gravereaux.
    18     18   # Copyright (c) 2003-2006 Pat Thoyts
    19     19   #
    20     20   #-------------------------------------------------------------------------
    21         -# RCS: @(#)$Id: makefile.vc,v 1.4 2007/09/06 21:01:55 patthoyts Exp $
           21  +# RCS: @(#)$Id: makefile.vc,v 1.5 2008/03/19 02:34:21 patthoyts Exp $
    22     22   #-------------------------------------------------------------------------
    23     23   
    24     24   # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
    25     25   # or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define
    26     26   # VCINSTALLDIR instead. The MSVC Toolkit release defines yet another.
    27     27   !if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR) && !defined(VCToolkitInstallDir)
    28     28   MSG = ^
................................................................................
   169    169   STUBPREFIX      = $(PROJECT)stub
   170    170   
   171    171   DLLOBJS = \
   172    172   	$(TMP_DIR)\tls.obj \
   173    173   	$(TMP_DIR)\tlsBIO.obj \
   174    174   	$(TMP_DIR)\tlsIO.obj \
   175    175   	$(TMP_DIR)\tlsX509.obj \
          176  +!if !$(STATIC_BUILD)
   176    177   	$(TMP_DIR)\tls.res
          178  +!endif
   177    179   
   178    180   #-------------------------------------------------------------------------
   179    181   # Locate the OpenSSL library and headers
   180    182   #-------------------------------------------------------------------------
   181    183   
   182    184   !ifndef OPENSSL
   183    185   OPENSSL = c:\opt\openssl
................................................................................
   246    248   ### Warnings are too many, can't support warnings into errors.
   247    249   cdebug	= -Zi -Od $(DEBUGFLAGS)
   248    250   !else
   249    251   cdebug	= -Zi -WX $(DEBUGFLAGS)
   250    252   !endif
   251    253   
   252    254   ### Declarations common to all compiler options
   253         -cwarn = -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
          255  +cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
   254    256   cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\
   255    257   
   256         -# Warning level
   257         -!if $(FULLWARNINGS)
   258         -cflags = $(cflags) -W4
   259         -!else
   260         -cflags = $(cflags) -W3
   261         -!endif
   262         -
   263    258   !if $(MSVCRT)
   264    259   !if $(DEBUG) && !$(UNCHECKED)
   265    260   crt = -MDd
   266    261   !else
   267    262   crt = -MD
   268    263   !endif
   269    264   !else
................................................................................
   302    297   !else
   303    298   ldebug	= -release -opt:ref -opt:icf,3
   304    299   !endif
   305    300   
   306    301   ### Declarations common to all linker options
   307    302   lflags	= -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug)
   308    303   
   309         -!if $(FULLWARNINGS)
   310         -lflags = $(lflags) -warn:3
   311         -!endif
   312         -
   313    304   !if $(PROFILE)
   314    305   lflags	= $(lflags) -profile
   315    306   !endif
   316    307   
   317    308   !if $(ALIGN98_HACK) && !$(STATIC_BUILD)
   318    309   ### Align sections for PE size savings.
   319    310   lflags	= $(lflags) -opt:nowin98
................................................................................
   335    326   baselibs  = $(baselibs) $(TKSTUBLIB)
   336    327   !endif
   337    328   !endif
   338    329   
   339    330   # Avoid 'unresolved external symbol __security_cookie' errors.
   340    331   # c.f. http://support.microsoft.com/?id=894573
   341    332   !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
          333  +!if $(VCVERSION) >= 1400 && $(VCVERSION) < 1500
   342    334   baselibs   = $(baselibs) bufferoverflowU.lib
          335  +!endif
   343    336   !endif
   344    337   
   345    338   baselibs  = $(baselibs) $(SSL_LIBS) ws2_32.lib user32.lib gdi32.lib advapi32.lib
   346    339   
   347    340   #---------------------------------------------------------------------
   348    341   # TclTest flags
   349    342   #---------------------------------------------------------------------
................................................................................
   353    346   !ENDIF
   354    347   
   355    348   #---------------------------------------------------------------------
   356    349   # Project specific targets (EDIT)
   357    350   #---------------------------------------------------------------------
   358    351   
   359    352   all:	    setup $(PROJECT)
   360         -$(PROJECT): setup $(PRJLIB)
          353  +$(PROJECT): setup $(OUT_DIR)\pkgIndex.tcl $(OUT_DIR)\tls.tcl $(PRJLIB)
   361    354   install:    install-binaries install-libraries install-docs
   362    355   
   363         -# Tests need to ensure we load the right dll file we
   364         -# have to handle the output differently on Win9x.
   365         -#
   366         -!if "$(OS)" == "Windows_NT"  || "$(MSVCDIR)" == "IDE"
   367    356   test: setup $(PROJECT)
   368         -        set TCL_LIBRARY=$(ROOT)/library
   369         -        $(TCLSH) <<
   370         -load $(PRJLIB:\=/)
   371         -source [file join $(LIBDIR) tls.tcl]
   372         -cd "$(ROOT)/tests"
   373         -set argv "$(TESTFLAGS)"
   374         -source all.tcl
   375         -<<
          357  +	@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
          358  +	@set TCLLIBPATH=$(OUT_DIR:\=/)
          359  +!if $(TCLINSTALL)
          360  +	@set PATH=$(_TCLDIR)\bin;$(PATH)
          361  +!else
          362  +	@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
          363  +!endif
          364  +!if "$(OS)" == "Windows_NT"  || "$(MSVCDIR)" == "IDE"
          365  +	$(DEBUGGER) $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS)
          366  +!else
          367  +	@echo Please wait while the tests are collected...
          368  +	$(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log
          369  +	type tests.log | more
          370  +!endif
          371  +
          372  +shell: setup $(PROJECT)
          373  +	@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
          374  +	@set TCLLIBPATH=$(OUT_DIR:\=/)
          375  +!if $(TCLINSTALL)
          376  +	@set PATH=$(_TCLDIR)\bin;$(PATH)
   376    377   !else
   377         -test: setup $(PROJECT)
   378         -        echo Please wait while the test results are collected
   379         -        set TCL_LIBRARY=$(ROOT)/library
   380         -        $(TCLSH) << >tests.log
   381         -load $(PRJLIB:\=/)
   382         -source [file normalize [file join $(LIBDIR) tls.tcl]]
   383         -cd "$(ROOT)/tests"
   384         -set argv "$(TESTFLAGS)"
   385         -source all.tcl
   386         -<<
   387         -        type tests.log | more
          378  +	@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
   388    379   !endif
          380  +	$(DEBUGGER) $(TCLSH)
   389    381   
   390    382   setup:
   391    383   	@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
   392    384   	@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
   393    385   
   394    386   # See <tcl>/win/coffbase.txt for extension base addresses.
   395    387   $(PRJLIB): $(DLLOBJS)
................................................................................
   447    439   .SUFFIXES:.c .rc
   448    440   
   449    441   #-------------------------------------------------------------------------
   450    442   # Explicit dependency rules
   451    443   #
   452    444   #-------------------------------------------------------------------------
   453    445   
   454         -$(OUT_DIR)\pkgIndex.tcl: $(ROOT)\pkgIndex.tcl.in
   455         -	nmakehlp -s << $** > [email protected]
   456         -@[email protected]    $(DOTVERSION)
   457         -@[email protected]       $(PROJECT)
   458         -@[email protected]       $(PRJLIBNAME)
          446  +.PHONY: $(OUT_DIR)\pkgIndex.tcl $(OUT_DIR)\tls.tcl
          447  +
          448  +$(OUT_DIR)\tls.tcl: $(GENERICDIR)\tls.tcl
          449  +	@$(COPY) $** [email protected]
          450  +
          451  +$(OUT_DIR)\pkgIndex.tcl:
          452  +        @type << > [email protected]
          453  +if {![package vsatisfies [package provide Tcl] 8.3]} {return}
          454  +package ifneeded $(PROJECT) $(DOTVERSION) "source \[file join [list $$dir] tls.tcl\] ; tls::initlib [list $$dir] $(PRJLIBNAME)"
   459    455   <<
   460    456   
   461    457   #---------------------------------------------------------------------
   462    458   # Installation. (EDIT)
   463    459   #
   464    460   # You may need to modify this section to reflect the final distribution
   465    461   # of your files and possibly to generate documentation.
................................................................................
   471    467   	@if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)"
   472    468   	@$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL
   473    469   
   474    470   install-libraries:
   475    471           @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)'
   476    472           @if exist $(LIBDIR) $(CPY) $(LIBDIR)\tls.tcl "$(SCRIPT_INSTALL_DIR)" > NUL
   477    473           @echo Installing package index in '$(SCRIPT_INSTALL_DIR)'
   478         -        @type << >"$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
   479         -# pkgIndex.tcl -
   480         -if {![package vsatisfies [package provide Tcl] 8.3]} {return}
   481         -package ifneeded $(PROJECT) $(DOTVERSION) "[list load [file join $$dir $(PROJECT)$(VERSION).$(EXT)] Tls] ; [list source [file join $$dir tls.tcl]]"
   482         -<<
          474  +	@$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)"
   483    475   
   484    476   install-docs:
   485    477   	@echo Installing documentation files to '$(DOC_INSTALL_DIR)'
   486    478   	@if exist $(DOCDIR) $(CPY) $(DOCDIR)\tls.htm "$(DOC_INSTALL_DIR)" >NUL
   487    479   
   488    480   #---------------------------------------------------------------------
   489    481   # Clean up

Modified win/nmakehlp.c from [2ea691567c] to [3dec417f72].

     7      7    * Copyright (c) 2002 by David Gravereaux.
     8      8    * Copyright (c) 2006 by Pat Thoyts
     9      9    *
    10     10    * See the file "license.terms" for information on usage and redistribution of
    11     11    * this file, and for a DISCLAIMER OF ALL WARRANTIES.
    12     12    *
    13     13    * ----------------------------------------------------------------------------
    14         - * RCS: @(#) $Id: nmakehlp.c,v 1.2 2007/09/06 21:01:55 patthoyts Exp $
           14  + * RCS: @(#) $Id: nmakehlp.c,v 1.3 2008/03/19 02:34:21 patthoyts Exp $
    15     15    * ----------------------------------------------------------------------------
    16     16    */
    17     17   
    18     18   #define _CRT_SECURE_NO_DEPRECATE
    19     19   #include <windows.h>
    20     20   #pragma comment (lib, "user32.lib")
    21     21   #pragma comment (lib, "kernel32.lib")
    22     22   #include <stdio.h>
    23     23   #include <math.h>
           24  +
           25  +/*
           26  + * This library is required for x64 builds with _some_ versions of MSVC
           27  + */
    24     28   #if defined(_M_IA64) || defined(_M_AMD64)
           29  +#if _MSC_VER >= 1400 && _MSC_VER < 1500
    25     30   #pragma comment(lib, "bufferoverflowU")
           31  +#endif
    26     32   #endif
    27     33   
    28     34   /* ISO hack for dumb VC++ */
    29     35   #ifdef _MSC_VER
    30     36   #define   snprintf	_snprintf
    31     37   #endif
    32     38   
................................................................................
   295    301        * Look for the commandline warning code in both streams.
   296    302        *  - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002.
   297    303        */
   298    304   
   299    305       return !(strstr(Out.buffer, "D4002") != NULL
   300    306                || strstr(Err.buffer, "D4002") != NULL
   301    307                || strstr(Out.buffer, "D9002") != NULL
   302         -             || strstr(Err.buffer, "D9002") != NULL);
          308  +             || strstr(Err.buffer, "D9002") != NULL
          309  +             || strstr(Out.buffer, "D2021") != NULL
          310  +             || strstr(Err.buffer, "D2021") != NULL);
   303    311   }
   304    312   
   305    313   int
   306    314   CheckForLinkerFeature(
   307    315       const char *option)
   308    316   {
   309    317       STARTUPINFO si;

Modified win/rules.vc from [ca811b113c] to [48e9d3924f].

     7      7   #	This version is modified from the Tcl source version to support
     8      8   #	building extensions using nmake.
     9      9   #
    10     10   # See the file "license.terms" for information on usage and redistribution
    11     11   # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    12     12   # 
    13     13   # Copyright (c) 2001-2002 David Gravereaux.
    14         -# Copyright (c) 2003-2005 Patrick Thoyts
           14  +# Copyright (c) 2003-2008 Patrick Thoyts
    15     15   #
    16     16   #------------------------------------------------------------------------------
    17         -# RCS: @(#) $Id: rules.vc,v 1.2 2007/09/06 21:01:55 patthoyts Exp $
           17  +# RCS: @(#) $Id: rules.vc,v 1.3 2008/03/19 02:34:21 patthoyts Exp $
    18     18   #------------------------------------------------------------------------------
    19     19   
    20     20   !ifndef _RULES_VC
    21     21   _RULES_VC = 1
    22     22   
    23     23   cc32		= $(CC)   # built-in default.
    24     24   link32		= link
................................................................................
    87     87   #----------------------------------------------------------
    88     88   
    89     89   ### test for optimizations
    90     90   !if [nmakehlp -c -Ot]
    91     91   !message *** Compiler has 'Optimizations'
    92     92   OPTIMIZING	= 1
    93     93   !else
    94         -!message *** Compiler doesn't have 'Optimizations'
           94  +!message *** Compiler does not have 'Optimizations'
    95     95   OPTIMIZING	= 0
    96     96   !endif
    97     97   
    98     98   OPTIMIZATIONS  =
    99     99   
   100    100   !if [nmakehlp -c -Ot]
   101    101   OPTIMIZATIONS  = $(OPTIMIZATIONS) -Ot
................................................................................
   144    144   
   145    145   !if "$(MACHINE)" == "IX86"
   146    146   ### test for pentium errata
   147    147   !if [nmakehlp -c -QI0f]
   148    148   !message *** Compiler has 'Pentium 0x0f fix'
   149    149   COMPILERFLAGS  = $(COMPILERFLAGSS) -QI0f
   150    150   !else
   151         -!message *** Compiler doesn't have 'Pentium 0x0f fix'
          151  +!message *** Compiler does not have 'Pentium 0x0f fix'
   152    152   !endif
   153    153   !endif
   154    154   
   155    155   !if "$(MACHINE)" == "IA64"
   156    156   ### test for Itanium errata
   157    157   !if [nmakehlp -c -QIA64_Bx]
   158    158   !message *** Compiler has 'B-stepping errata workarounds'
................................................................................
   164    164   
   165    165   !if "$(MACHINE)" == "IX86"
   166    166   ### test for -align:4096, when align:512 will do.
   167    167   !if [nmakehlp -l -opt:nowin98]
   168    168   !message *** Linker has 'Win98 alignment problem'
   169    169   ALIGN98_HACK	= 1
   170    170   !else
   171         -!message *** Linker doesn't have 'Win98 alignment problem'
          171  +!message *** Linker does not have 'Win98 alignment problem'
   172    172   ALIGN98_HACK	= 0
   173    173   !endif
   174    174   !else
   175    175   ALIGN98_HACK	= 0
   176    176   !endif
   177    177   
   178    178   LINKERFLAGS     =
................................................................................
   188    188   
   189    189   _VC_MANIFEST_EMBED_EXE=
   190    190   _VC_MANIFEST_EMBED_DLL=
   191    191   VCVER=0
   192    192   !if ![echo VCVERSION=_MSC_VER > vercl.x] \
   193    193       && ![cl -nologo -TC -P vercl.x $(ERRNULL)]
   194    194   !include vercl.i
   195         -!if $(VCVERSION) >= 1400
          195  +!if $(VCVERSION) >= 1500
          196  +VCVER=9
          197  +!elseif $(VCVERSION) >= 1400
   196    198   VCVER=8
   197         -_VC_MANIFEST_EMBED_EXE=if exist [email protected] mt -nologo -manifest [email protected] -outputresource:[email protected];1
   198         -_VC_MANIFEST_EMBED_DLL=if exist [email protected] mt -nologo -manifest [email protected] -outputresource:[email protected];2
   199    199   !elseif $(VCVERSION) >= 1300
   200    200   VCVER=7
   201    201   !elseif $(VCVERSION) >= 1200
   202    202   VCVER=6
   203    203   !endif
   204    204   !endif
          205  +
          206  +# Since MSVC8 we must deal with manifest resources.
          207  +!if $(VCVERSION) >= 1400
          208  +_VC_MANIFEST_EMBED_EXE=if exist [email protected] mt -nologo -manifest [email protected] -outputresource:[email protected];1
          209  +_VC_MANIFEST_EMBED_DLL=if exist [email protected] mt -nologo -manifest [email protected] -outputresource:[email protected];2
          210  +!endif
   205    211   
   206    212   #----------------------------------------------------------
   207    213   # Decode the options requested.
   208    214   #----------------------------------------------------------
   209    215   
   210    216   !if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
   211    217   STATIC_BUILD	= 0
................................................................................
   386    392   
   387    393   #----------------------------------------------------------
   388    394   # Decode the checks requested.
   389    395   #----------------------------------------------------------
   390    396   
   391    397   !if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"]
   392    398   TCL_NO_DEPRECATED	    = 0
   393         -FULLWARNINGS		    = 0
          399  +WARNINGS		    = -W3
   394    400   !else
   395    401   !if [nmakehlp -f $(CHECKS) "nodep"]
   396    402   !message *** Doing nodep check
   397    403   TCL_NO_DEPRECATED	    = 1
   398    404   !else
   399    405   TCL_NO_DEPRECATED	    = 0
   400    406   !endif
   401    407   !if [nmakehlp -f $(CHECKS) "fullwarn"]
   402    408   !message *** Doing full warnings check
   403         -FULLWARNINGS		    = 1
          409  +WARNINGS		    = -W4
          410  +!if [nmakehlp -l -warn:3]
          411  +LINKERFLAGS		    = $(LINKERFLAGS) -warn:3
          412  +!endif
   404    413   !else
   405         -FULLWARNINGS		    = 0
          414  +WARNINGS		    = -W3
          415  +!endif
          416  +!if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64]
          417  +!message *** Doing 64bit portability warnings
          418  +WARNINGS		    = $(WARNINGS) -Wp64
   406    419   !endif
   407    420   !endif
   408         -
   409    421   
   410    422   #----------------------------------------------------------
   411    423   # Set our defines now armed with our options.
   412    424   #----------------------------------------------------------
   413    425   
   414         -OPTDEFINES	= -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING)
          426  +OPTDEFINES	= -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS
   415    427   
   416    428   !if $(TCL_MEM_DEBUG)
   417    429   OPTDEFINES	= $(OPTDEFINES) -DTCL_MEM_DEBUG
   418    430   !endif
   419    431   !if $(TCL_COMPILE_DEBUG)
   420    432   OPTDEFINES	= $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
   421    433   !endif
................................................................................
   439    451   OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DEBUG
   440    452   !elseif $(OPTIMIZING)
   441    453   OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
   442    454   !endif
   443    455   !if $(PROFILE)
   444    456   OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_PROFILED
   445    457   !endif
   446         -!if "$(MACHINE)" == "IA64"
          458  +!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
   447    459   OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DO64BIT
   448    460   !endif
   449    461   
   450    462   
   451    463   #----------------------------------------------------------
   452    464   # Get common info used when building extensions.
   453    465   #----------------------------------------------------------
................................................................................
   559    571   !endif
   560    572   !endif
   561    573   !include version.vc
   562    574   TK_VERSION = $(TK_DOTVERSION:.=)
   563    575   
   564    576   !if $(TKINSTALL)
   565    577   WISH		= "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe"
          578  +!if !exist($(WISH)) && $(TCL_THREADS)
          579  +WISH		= "$(_TKDIR)\bin\wish$(TK_VERSION)t$(SUFX).exe"
          580  +!endif
   566    581   TKSTUBLIB	= "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib"
   567    582   TKIMPLIB	= "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib"
   568    583   TK_INCLUDES     = -I"$(_TKDIR)\include"
          584  +TK_LIBRARY	= $(_TKDIR)\lib
   569    585   !else
   570    586   WISH		= "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe"
          587  +!if !exist($(WISH)) && $(TCL_THREADS)
          588  +WISH		= "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)t$(SUFX).exe"
          589  +!endif
   571    590   TKSTUBLIB	= "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib"
   572    591   TKIMPLIB	= "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib"
   573    592   TK_INCLUDES     = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib"
          593  +TK_LIBRARY	= $(_TKDIR)\library
   574    594   !endif
   575    595   
   576    596   !endif
   577    597   !endif
   578    598   !endif
   579    599   
   580    600   #----------------------------------------------------------
................................................................................
   582    602   #----------------------------------------------------------
   583    603   
   584    604   !message *** Intermediate directory will be '$(TMP_DIR)'
   585    605   !message *** Output directory will be '$(OUT_DIR)'
   586    606   !message *** Suffix for binaries will be '$(SUFX)'
   587    607   !message *** Optional defines are '$(OPTDEFINES)'
   588    608   !message *** Compiler version $(VCVER). Target machine is $(MACHINE)
   589         -!message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS)'
          609  +!message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)'
   590    610   !message *** Link options '$(LINKERFLAGS)'
   591    611   
   592    612   !endif