Diff
Bounty program for improvements to Tcl and certain Tcl packages.

Differences From Artifact [a8ad16f8ba]:

To Artifact [1ecdb77483]:


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
# Copyright (c) 2001 ActiveState Corporation.
# Copyright (c) 2001-2002 David Gravereaux.
# Copyright (c) 2003-2006 Pat Thoyts
#
#-------------------------------------------------------------------------
# RCS: @(#)$Id: makefile.vc,v 1.4 2007/09/06 21:01:55 patthoyts Exp $
#-------------------------------------------------------------------------

# Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
# or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define
# VCINSTALLDIR instead. The MSVC Toolkit release defines yet another.
!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR) && !defined(VCToolkitInstallDir)
MSG = ^






|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
# Copyright (c) 2001 ActiveState Corporation.
# Copyright (c) 2001-2002 David Gravereaux.
# Copyright (c) 2003-2006 Pat Thoyts
#
#-------------------------------------------------------------------------
# RCS: @(#)$Id: makefile.vc,v 1.5 2008/03/19 02:34:21 patthoyts Exp $
#-------------------------------------------------------------------------

# Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
# or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define
# VCINSTALLDIR instead. The MSVC Toolkit release defines yet another.
!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR) && !defined(VCToolkitInstallDir)
MSG = ^
169
170
171
172
173
174
175

176

177
178
179
180
181
182
183
STUBPREFIX      = $(PROJECT)stub

DLLOBJS = \
	$(TMP_DIR)\tls.obj \
	$(TMP_DIR)\tlsBIO.obj \
	$(TMP_DIR)\tlsIO.obj \
	$(TMP_DIR)\tlsX509.obj \

	$(TMP_DIR)\tls.res


#-------------------------------------------------------------------------
# Locate the OpenSSL library and headers
#-------------------------------------------------------------------------

!ifndef OPENSSL
OPENSSL = c:\opt\openssl






>

>







169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
STUBPREFIX      = $(PROJECT)stub

DLLOBJS = \
	$(TMP_DIR)\tls.obj \
	$(TMP_DIR)\tlsBIO.obj \
	$(TMP_DIR)\tlsIO.obj \
	$(TMP_DIR)\tlsX509.obj \
!if !$(STATIC_BUILD)
	$(TMP_DIR)\tls.res
!endif

#-------------------------------------------------------------------------
# Locate the OpenSSL library and headers
#-------------------------------------------------------------------------

!ifndef OPENSSL
OPENSSL = c:\opt\openssl
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
### Warnings are too many, can't support warnings into errors.
cdebug	= -Zi -Od $(DEBUGFLAGS)
!else
cdebug	= -Zi -WX $(DEBUGFLAGS)
!endif

### Declarations common to all compiler options
cwarn = -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\

# Warning level
!if $(FULLWARNINGS)
cflags = $(cflags) -W4
!else
cflags = $(cflags) -W3
!endif

!if $(MSVCRT)
!if $(DEBUG) && !$(UNCHECKED)
crt = -MDd
!else
crt = -MD
!endif
!else






|


<
<
<
<
<
<
<







248
249
250
251
252
253
254
255
256
257







258
259
260
261
262
263
264
### Warnings are too many, can't support warnings into errors.
cdebug	= -Zi -Od $(DEBUGFLAGS)
!else
cdebug	= -Zi -WX $(DEBUGFLAGS)
!endif

### Declarations common to all compiler options
cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\








!if $(MSVCRT)
!if $(DEBUG) && !$(UNCHECKED)
crt = -MDd
!else
crt = -MD
!endif
!else
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
!else
ldebug	= -release -opt:ref -opt:icf,3
!endif

### Declarations common to all linker options
lflags	= -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug)

!if $(FULLWARNINGS)
lflags = $(lflags) -warn:3
!endif

!if $(PROFILE)
lflags	= $(lflags) -profile
!endif

!if $(ALIGN98_HACK) && !$(STATIC_BUILD)
### Align sections for PE size savings.
lflags	= $(lflags) -opt:nowin98






<
<
<
<







297
298
299
300
301
302
303




304
305
306
307
308
309
310
!else
ldebug	= -release -opt:ref -opt:icf,3
!endif

### Declarations common to all linker options
lflags	= -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug)





!if $(PROFILE)
lflags	= $(lflags) -profile
!endif

!if $(ALIGN98_HACK) && !$(STATIC_BUILD)
### Align sections for PE size savings.
lflags	= $(lflags) -opt:nowin98
335
336
337
338
339
340
341

342

343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368

369
370
371



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388










389
390
391
392
393
394
395
baselibs  = $(baselibs) $(TKSTUBLIB)
!endif
!endif

# Avoid 'unresolved external symbol __security_cookie' errors.
# c.f. http://support.microsoft.com/?id=894573
!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"

baselibs   = $(baselibs) bufferoverflowU.lib

!endif

baselibs  = $(baselibs) $(SSL_LIBS) ws2_32.lib user32.lib gdi32.lib advapi32.lib

#---------------------------------------------------------------------
# TclTest flags
#---------------------------------------------------------------------

!IF "$(TESTPAT)" != ""
TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
!ENDIF

#---------------------------------------------------------------------
# Project specific targets (EDIT)
#---------------------------------------------------------------------

all:	    setup $(PROJECT)
$(PROJECT): setup $(PRJLIB)
install:    install-binaries install-libraries install-docs

# Tests need to ensure we load the right dll file we
# have to handle the output differently on Win9x.
#
!if "$(OS)" == "Windows_NT"  || "$(MSVCDIR)" == "IDE"
test: setup $(PROJECT)
        set TCL_LIBRARY=$(ROOT)/library

        $(TCLSH) <<
load $(PRJLIB:\=/)
source [file join $(LIBDIR) tls.tcl]



cd "$(ROOT)/tests"
set argv "$(TESTFLAGS)"
source all.tcl
<<
!else
test: setup $(PROJECT)
        echo Please wait while the test results are collected
        set TCL_LIBRARY=$(ROOT)/library
        $(TCLSH) << >tests.log
load $(PRJLIB:\=/)
source [file normalize [file join $(LIBDIR) tls.tcl]]
cd "$(ROOT)/tests"
set argv "$(TESTFLAGS)"
source all.tcl
<<
        type tests.log | more
!endif











setup:
	@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
	@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)

# See <tcl>/win/coffbase.txt for extension base addresses.
$(PRJLIB): $(DLLOBJS)






>

>

















|


<
<
<
<

|
>
|
|
|
>
>
>
|
<
<
<

<
|
<
<
<
<
|
<
<
<
|

>
>
>
>
>
>
>
>
>
>







326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355




356
357
358
359
360
361
362
363
364
365



366

367




368



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
baselibs  = $(baselibs) $(TKSTUBLIB)
!endif
!endif

# Avoid 'unresolved external symbol __security_cookie' errors.
# c.f. http://support.microsoft.com/?id=894573
!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
!if $(VCVERSION) >= 1400 && $(VCVERSION) < 1500
baselibs   = $(baselibs) bufferoverflowU.lib
!endif
!endif

baselibs  = $(baselibs) $(SSL_LIBS) ws2_32.lib user32.lib gdi32.lib advapi32.lib

#---------------------------------------------------------------------
# TclTest flags
#---------------------------------------------------------------------

!IF "$(TESTPAT)" != ""
TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
!ENDIF

#---------------------------------------------------------------------
# Project specific targets (EDIT)
#---------------------------------------------------------------------

all:	    setup $(PROJECT)
$(PROJECT): setup $(OUT_DIR)\pkgIndex.tcl $(OUT_DIR)\tls.tcl $(PRJLIB)
install:    install-binaries install-libraries install-docs





test: setup $(PROJECT)
	@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
	@set TCLLIBPATH=$(OUT_DIR:\=/)
!if $(TCLINSTALL)
	@set PATH=$(_TCLDIR)\bin;$(PATH)
!else
	@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
!if "$(OS)" == "Windows_NT"  || "$(MSVCDIR)" == "IDE"
	$(DEBUGGER) $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS)



!else

	@echo Please wait while the tests are collected...




	$(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log



	type tests.log | more
!endif

shell: setup $(PROJECT)
	@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
	@set TCLLIBPATH=$(OUT_DIR:\=/)
!if $(TCLINSTALL)
	@set PATH=$(_TCLDIR)\bin;$(PATH)
!else
	@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
	$(DEBUGGER) $(TCLSH)

setup:
	@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
	@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)

# See <tcl>/win/coffbase.txt for extension base addresses.
$(PRJLIB): $(DLLOBJS)
447
448
449
450
451
452
453





454
455

456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
.SUFFIXES:.c .rc

#-------------------------------------------------------------------------
# Explicit dependency rules
#
#-------------------------------------------------------------------------






$(OUT_DIR)\pkgIndex.tcl: $(ROOT)\pkgIndex.tcl.in
	nmakehlp -s << $** > [email protected]

@PAC[email protected]    $(DOTVERSION)
@[email protected]       $(PROJECT)
@[email protected]       $(PRJLIBNAME)
<<

#---------------------------------------------------------------------
# Installation. (EDIT)
#
# You may need to modify this section to reflect the final distribution
# of your files and possibly to generate documentation.
#
#---------------------------------------------------------------------

install-binaries:
	@echo Installing binaries to '$(SCRIPT_INSTALL_DIR)'
	@if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)"
	@$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL

install-libraries:
        @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)'
        @if exist $(LIBDIR) $(CPY) $(LIBDIR)\tls.tcl "$(SCRIPT_INSTALL_DIR)" > NUL
        @echo Installing package index in '$(SCRIPT_INSTALL_DIR)'
        @type << >"$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
# pkgIndex.tcl -
if {![package vsatisfies [package provide Tcl] 8.3]} {return}
package ifneeded $(PROJECT) $(DOTVERSION) "[list load [file join $$dir $(PROJECT)$(VERSION).$(EXT)] Tls] ; [list source [file join $$dir tls.tcl]]"
<<

install-docs:
	@echo Installing documentation files to '$(DOC_INSTALL_DIR)'
	@if exist $(DOCDIR) $(CPY) $(DOCDIR)\tls.htm "$(DOC_INSTALL_DIR)" >NUL

#---------------------------------------------------------------------
# Clean up






>
>
>
>
>
|
|
>
|
<
<



















|
<
<
<
<







439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454


455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474




475
476
477
478
479
480
481
.SUFFIXES:.c .rc

#-------------------------------------------------------------------------
# Explicit dependency rules
#
#-------------------------------------------------------------------------

.PHONY: $(OUT_DIR)\pkgIndex.tcl $(OUT_DIR)\tls.tcl

$(OUT_DIR)\tls.tcl: $(GENERICDIR)\tls.tcl
	@$(COPY) $** [email protected]

$(OUT_DIR)\pkgIndex.tcl:
        @type << > [email protected]
if {![package vsatisfies [package provide Tcl] 8.3]} {return}
package ifneeded $(PROJECT) $(DOTVERSION) "source \[file join [list $$dir] tls.tcl\] ; tls::initlib [list $$dir] $(PRJLIBNAME)"


<<

#---------------------------------------------------------------------
# Installation. (EDIT)
#
# You may need to modify this section to reflect the final distribution
# of your files and possibly to generate documentation.
#
#---------------------------------------------------------------------

install-binaries:
	@echo Installing binaries to '$(SCRIPT_INSTALL_DIR)'
	@if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)"
	@$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL

install-libraries:
        @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)'
        @if exist $(LIBDIR) $(CPY) $(LIBDIR)\tls.tcl "$(SCRIPT_INSTALL_DIR)" > NUL
        @echo Installing package index in '$(SCRIPT_INSTALL_DIR)'
	@$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)"





install-docs:
	@echo Installing documentation files to '$(DOC_INSTALL_DIR)'
	@if exist $(DOCDIR) $(CPY) $(DOCDIR)\tls.htm "$(DOC_INSTALL_DIR)" >NUL

#---------------------------------------------------------------------
# Clean up