Tcl UDP

Check-in [b43da5b57b]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Get rid of tcludp.rc and use the default rc template instead
Timelines: family | ancestors | descendants | both | vc-reform
Files: files | file ages | folders
SHA1:b43da5b57bb28f89ecd63d932d88c096e9886243
User & Date: apnadkarni 2017-10-08 16:05:45
Context
2017-10-16
13:17
Updated to latest Tcl rules check-in: b01a44a88a user: apnadkarni tags: vc-reform
2017-10-08
16:05
Get rid of tcludp.rc and use the default rc template instead check-in: b43da5b57b user: apnadkarni tags: vc-reform
2017-09-30
13:37
First cut at building with new rules.vc check-in: 4442f2b1bb user: apnadkarni tags: vc-reform
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to win/makefile.vc.

155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190

191
192
193
194
195
196
197
198
199
200
201
202

203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#
# You need to specify the object files that need to be linked into your
# binary here.
#
#-------------------------------------------------------------------------

PROJECT = udp
!include "rules.vc"

DOTVERSION      = 1.0.11
VERSION         = $(DOTVERSION:.=)

DLLOBJS = \
	$(TMP_DIR)\udp_tcl.obj \
	$(TMP_DIR)\tcludp.res

PRJDOCS = \
	$(OUT_DIR)\udp.html

#-------------------------------------------------------------------------
# Target names and paths ( shouldn't need changing )
#-------------------------------------------------------------------------

PRJLIBNAME	= $(PROJECT)$(VERSION)$(SUFX).$(EXT)
PRJLIB		= $(OUT_DIR)\$(PRJLIBNAME)

PRJ_DEFINES     = -DPACKAGE_NAME="\"$(PROJECT)\"" \
		  -DPACKAGE_VERSION="\"$(DOTVERSION)\"" \
		  -D_CRT_SECURE_NO_WARNINGS \
		  -D_WINSOCK_DEPRECATED_NO_WARNINGS
PRJ_LIBS	= ws2_32.lib

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


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

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

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



# 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)
        $(TCLSH) <<
load $(PRJLIB:\=/)
cd "$(ROOT)/tests"
set argv "$(TESTFLAGS)"
source all.tcl
<<
!else
test: setup $(PROJECT)
        echo Please wait while the test results are collected
        $(TCLSH) << >tests.log
load $(PRJLIB:\=/)
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)

$(PRJLIB): $(DLLOBJS)
	$(MAKEBINCMD) $** 
	$(_VC_MANIFEST_EMBED_DLL)
	@if exist $*.exp del $*.exp

#---------------------------------------------------------------------
# Implicit rules
#---------------------------------------------------------------------

{$(WINDIR)}.rc{$(TMP_DIR)}.res:
	$(rc32) -fo $@ -r -i "$(GENERICDIR)" -D__WIN32__ \
                -DCOMMAVERSION=$(DOTVERSION:.=,),0 \
                -DDOTVERSION=\"$(DOTVERSION)\" \
                -DVERSION=\"$(VERSION)$(SUFX)\" \
!if $(DEBUG)
	-d DEBUG \
!endif
!if $(TCL_THREADS)
	-d TCL_THREADS \
!endif
!if $(STATIC_BUILD)
	-d STATIC_BUILD \
!endif
	$<

DOC2HTML = $(TCLSH) "$(TOOLSDIR)\mpexpand.tcl" html

{$(DOCDIR)}.man{$(OUT_DIR)}.html:
	$(DOC2HTML) $< $@
        @$(TCLSH) <<
set name $(@:\=/)
set f [open $$name r]; set d [read $$f]; close $$f
set d [regsub {</head>} $$d {<link rel="stylesheet" href="manpage.css" type="text/css"></head>}]
set f [open $$name w]; puts -nonewline $$f $$d; close $$f
<<

.SUFFIXES:
.SUFFIXES: .man

#---------------------------------------------------------------------
# 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)\nul mkdir "$(SCRIPT_INSTALL_DIR)"
	@$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL

install-libraries:
        @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)'
        @if exist $(LIBDIR)\NUL $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)" >NUL
        @echo Installing package index in '$(SCRIPT_INSTALL_DIR)'
        @type << >"$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
    package ifneeded $(PROJECT) $(DOTVERSION) "[list load [file join $$dir $(PROJECT)$(VERSION)$(SUFX).$(EXT)] $(PROJECT)]"
<<

install-docs: $(PRJDOCS)
	@echo Installing documentation to '$(DOC_INSTALL_DIR)'
	@if not exist $(DOC_INSTALL_DIR)\NUL mkdir "$(DOC_INSTALL_DIR)"
	@$(CPY) "$(DOCDIR)\manpage.css" "$(DOC_INSTALL_DIR)\" >NUL
	@for %i in ($(PRJDOCS)) do @$(CPY) %i "$(DOC_INSTALL_DIR)\" > NUL

install-demos:
	@echo Installing demos to '$(DEMO_INSTALL_DIR)'
	@if not exist $(DEMO_INSTALL_DIR)\nul mkdir "$(DEMO_INSTALL_DIR)"
	@$(CPY) $(DEMODIR)\*.tcl "$(DEMO_INSTALL_DIR)" >NUL

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

distclean: realclean
	@if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe
	@if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj







|

<
<
<
|

|








<
<

<
<
|



|
|
<

>
|
<
<






<

|
>

<
<
<
<
<



|



<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<





<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<











<


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<











<
<
<
<
<
<
<
155
156
157
158
159
160
161
162
163



164
165
166
167
168
169
170
171
172
173
174


175


176
177
178
179
180
181

182
183
184


185
186
187
188
189
190

191
192
193
194





195
196
197
198
199
200
201




















202
203
204
205
206
















207
208
209
210
211
212
213
214
215
216
217

218
219





















220
221
222
223
224
225
226
227
228
229
230







#
# You need to specify the object files that need to be linked into your
# binary here.
#
#-------------------------------------------------------------------------

PROJECT = udp
!include "rules-ext.vc"




PRJ_OBJS = \
	$(TMP_DIR)\udp_tcl.obj \
	$(TMP_DIR)\$(PROJECT).res

PRJDOCS = \
	$(OUT_DIR)\udp.html

#-------------------------------------------------------------------------
# Target names and paths ( shouldn't need changing )
#-------------------------------------------------------------------------






PRJ_DEFINES     = -D_CRT_SECURE_NO_WARNINGS \
		  -D_WINSOCK_DEPRECATED_NO_WARNINGS
PRJ_LIBS	= ws2_32.lib

# Define the standard targets
!include "$(_RULESDIR)\targets.vc"


# We will use the standard resource template instead of writing our own
$(TMP_DIR)\$(PROJECT).res: default-rc



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

all:	    setup $(PROJECT)

doc:        setup $(PRJDOCS)
install:    install-docs install-demos
pkgindex:   default-pkgindex






test: setup $(PROJECT)
        $(TCLSH) <<
load $(PRJLIB:\=/)
cd {$(ROOT)/tests}
set argv "$(TESTFLAGS)"
source all.tcl
<<





















#---------------------------------------------------------------------
# Implicit rules
#---------------------------------------------------------------------

















DOC2HTML = $(TCLSH) "$(TOOLSDIR)\mpexpand.tcl" html

{$(DOCDIR)}.man{$(OUT_DIR)}.html:
	$(DOC2HTML) $< $@
        @$(TCLSH) <<
set name $(@:\=/)
set f [open $$name r]; set d [read $$f]; close $$f
set d [regsub {</head>} $$d {<link rel="stylesheet" href="manpage.css" type="text/css"></head>}]
set f [open $$name w]; puts -nonewline $$f $$d; close $$f
<<


.SUFFIXES: .man






















install-docs: $(PRJDOCS)
	@echo Installing documentation to '$(DOC_INSTALL_DIR)'
	@if not exist $(DOC_INSTALL_DIR)\NUL mkdir "$(DOC_INSTALL_DIR)"
	@$(CPY) "$(DOCDIR)\manpage.css" "$(DOC_INSTALL_DIR)\" >NUL
	@for %i in ($(PRJDOCS)) do @$(CPY) %i "$(DOC_INSTALL_DIR)\" > NUL

install-demos:
	@echo Installing demos to '$(DEMO_INSTALL_DIR)'
	@if not exist $(DEMO_INSTALL_DIR)\nul mkdir "$(DEMO_INSTALL_DIR)"
	@$(CPY) $(DEMODIR)\*.tcl "$(DEMO_INSTALL_DIR)" >NUL








Changes to win/rules.vc.

1
2
3
4
5
6
7
8
..
10
11
12
13
14
15
16




17
18
19
20
21
22
23
....
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090


















1091
1092
1093
1094
1095
1096
1097
#------------------------------------------------------------------------------
# rules.vc --
#
#	Microsoft Visual C++ makefile include for decoding the commandline
#	macros.  This file does not need editing to build Tcl.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
................................................................................
# Copyright (c) 2001-2003 David Gravereaux.
# Copyright (c) 2003-2008 Patrick Thoyts
# Copyright (c) 2017      Ashok P. Nadkarni
#------------------------------------------------------------------------------

!ifndef _RULES_VC
_RULES_VC = 1





################################################################
# Nmake is a pretty weak environment in syntax and capabilities
# so this file is necessarily verbose. It's broken down into
# the following parts.
#
# 0. Sanity check that compiler environment is set up.
................................................................................
!if "$(MACHINE)" == "AMD64"
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DO64BIT
!endif
!if $(VCVERSION) < 1300
OPTDEFINES	= $(OPTDEFINES) -DNO_STRTOI64
!endif

# UNICODE - Use the wide char Windows API.
# _ATL_XP_TARGETING - Newer SDK's need this to build for XP
COMPILERFLAGS  = /DUNICODE /D_UNICODE /D_ATL_XP_TARGETING



















# crt picks the C run time based on selected OPTS
!if $(MSVCRT)
!if $(DEBUG) && !$(UNCHECKED)
crt = -MDd
!else
crt = -MD
|







 







>
>
>
>







 







<

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
..
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
....
1085
1086
1087
1088
1089
1090
1091

1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
#------------------------------------------------------------- -*- makefile -*-
# rules.vc --
#
#	Microsoft Visual C++ makefile include for decoding the commandline
#	macros.  This file does not need editing to build Tcl.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
................................................................................
# Copyright (c) 2001-2003 David Gravereaux.
# Copyright (c) 2003-2008 Patrick Thoyts
# Copyright (c) 2017      Ashok P. Nadkarni
#------------------------------------------------------------------------------

!ifndef _RULES_VC
_RULES_VC = 1

# The following macros define the version of the rules.vc nmake build system
RULES_VERSION_MAJOR = 1
RULES_VERSION_MINOR = 0

################################################################
# Nmake is a pretty weak environment in syntax and capabilities
# so this file is necessarily verbose. It's broken down into
# the following parts.
#
# 0. Sanity check that compiler environment is set up.
................................................................................
!if "$(MACHINE)" == "AMD64"
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DO64BIT
!endif
!if $(VCVERSION) < 1300
OPTDEFINES	= $(OPTDEFINES) -DNO_STRTOI64
!endif


# _ATL_XP_TARGETING - Newer SDK's need this to build for XP
COMPILERFLAGS  = /D_ATL_XP_TARGETING


# Following is primarily for the benefit of extensions. Tcl 8.5 builds
# Tcl without /DUNICODE, while 8.6 builds with it defined. When building
# an extension, it is advisable (but not mandated) to use the same Windows
# API as the Tcl build. This is accordingly defaulted below. A particular
# extension can override this by pre-definining USE_WIDECHAR_API.
!ifndef USE_WIDECHAR_API
!if $(TCL_VERSION) > 85
USE_WIDECHAR_API = 1
!else
USE_WIDECHAR_API = 0
!endif
!endif

!if $(USE_WIDECHAR_API)
COMPILERFLAGS = $(COMPILERFLAGS) /DUNICODE /D_UNICODE 
!endif

# crt picks the C run time based on selected OPTS
!if $(MSVCRT)
!if $(DEBUG) && !$(UNCHECKED)
crt = -MDd
!else
crt = -MD

Deleted win/tcludp.rc.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// RCS: @(#) $Id: tcludp.rc,v 1.4 2004/11/22 23:48:48 patthoyts Exp $
//
// Version Resource Script
//

#include <winver.h>

LANGUAGE 0x9, 0x1	/* LANG_ENGLISH, SUBLANG_DEFAULT */

VS_VERSION_INFO VERSIONINFO
 FILEVERSION    COMMAVERSION
 PRODUCTVERSION COMMAVERSION
 FILEFLAGSMASK 	0x3fL
#ifdef DEBUG
 FILEFLAGS 	VS_FF_DEBUG
#else
 FILEFLAGS 	0x0L
#endif
 FILEOS 	VOS__WINDOWS32
 FILETYPE 	VFT_DLL
 FILESUBTYPE 	0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */
        BEGIN
            VALUE "FileDescription", "Tcl UDP " DOTVERSION " for Windows\0"
            VALUE "OriginalFilename", "udp" VERSION ".dll\0"
            VALUE "FileVersion",      DOTVERSION "\0"
            VALUE "LegalCopyright",   "Copyright \251 1999-2000 Columbia University; all rights reserved\0"
            VALUE "ProductName",      "TclUDP " DOTVERSION " for Windows\0"
            VALUE "ProductVersion",   DOTVERSION "\0"
        END		    
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<