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 [email protected]
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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to win/makefile.vc.

   155    155   #
   156    156   # You need to specify the object files that need to be linked into your
   157    157   # binary here.
   158    158   #
   159    159   #-------------------------------------------------------------------------
   160    160   
   161    161   PROJECT = udp
   162         -!include "rules.vc"
          162  +!include "rules-ext.vc"
   163    163   
   164         -DOTVERSION      = 1.0.11
   165         -VERSION         = $(DOTVERSION:.=)
   166         -
   167         -DLLOBJS = \
          164  +PRJ_OBJS = \
   168    165   	$(TMP_DIR)\udp_tcl.obj \
   169         -	$(TMP_DIR)\tcludp.res
          166  +	$(TMP_DIR)\$(PROJECT).res
   170    167   
   171    168   PRJDOCS = \
   172    169   	$(OUT_DIR)\udp.html
   173    170   
   174    171   #-------------------------------------------------------------------------
   175    172   # Target names and paths ( shouldn't need changing )
   176    173   #-------------------------------------------------------------------------
   177    174   
   178         -PRJLIBNAME	= $(PROJECT)$(VERSION)$(SUFX).$(EXT)
   179         -PRJLIB		= $(OUT_DIR)\$(PRJLIBNAME)
   180    175   
   181         -PRJ_DEFINES     = -DPACKAGE_NAME="\"$(PROJECT)\"" \
   182         -		  -DPACKAGE_VERSION="\"$(DOTVERSION)\"" \
   183         -		  -D_CRT_SECURE_NO_WARNINGS \
          176  +PRJ_DEFINES     = -D_CRT_SECURE_NO_WARNINGS \
   184    177   		  -D_WINSOCK_DEPRECATED_NO_WARNINGS
   185    178   PRJ_LIBS	= ws2_32.lib
   186    179   
   187         -#---------------------------------------------------------------------
   188         -# TclTest flags
   189         -#---------------------------------------------------------------------
          180  +# Define the standard targets
          181  +!include "$(_RULESDIR)\targets.vc"
   190    182   
   191         -!IF "$(TESTPAT)" != ""
   192         -TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
   193         -!ENDIF
          183  +# We will use the standard resource template instead of writing our own
          184  +$(TMP_DIR)\$(PROJECT).res: default-rc
   194    185   
   195    186   #---------------------------------------------------------------------
   196    187   # Project specific targets (EDIT)
   197    188   #---------------------------------------------------------------------
   198    189   
   199    190   all:	    setup $(PROJECT)
   200         -$(PROJECT): setup $(PRJLIB)
   201    191   doc:        setup $(PRJDOCS)
   202         -install:    install-binaries install-libraries install-docs install-demos
          192  +install:    install-docs install-demos
          193  +pkgindex:   default-pkgindex
   203    194   
   204         -
   205         -# Tests need to ensure we load the right dll file we
   206         -# have to handle the output differently on Win9x.
   207         -#
   208         -!if "$(OS)" == "Windows_NT"  || "$(MSVCDIR)" == "IDE"
   209    195   test: setup $(PROJECT)
   210    196           $(TCLSH) <<
   211    197   load $(PRJLIB:\=/)
   212         -cd "$(ROOT)/tests"
          198  +cd {$(ROOT)/tests}
   213    199   set argv "$(TESTFLAGS)"
   214    200   source all.tcl
   215    201   <<
   216         -!else
   217         -test: setup $(PROJECT)
   218         -        echo Please wait while the test results are collected
   219         -        $(TCLSH) << >tests.log
   220         -load $(PRJLIB:\=/)
   221         -cd "$(ROOT)/tests"
   222         -set argv "$(TESTFLAGS)"
   223         -source all.tcl
   224         -<<
   225         -        type tests.log | more
   226         -!endif
   227         -
   228         -setup:
   229         -	@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
   230         -	@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
   231         -
   232         -$(PRJLIB): $(DLLOBJS)
   233         -	$(MAKEBINCMD) $** 
   234         -	$(_VC_MANIFEST_EMBED_DLL)
   235         -	@if exist $*.exp del $*.exp
   236    202   
   237    203   #---------------------------------------------------------------------
   238    204   # Implicit rules
   239    205   #---------------------------------------------------------------------
   240    206   
   241         -{$(WINDIR)}.rc{$(TMP_DIR)}.res:
   242         -	$(rc32) -fo [email protected] -r -i "$(GENERICDIR)" -D__WIN32__ \
   243         -                -DCOMMAVERSION=$(DOTVERSION:.=,),0 \
   244         -                -DDOTVERSION=\"$(DOTVERSION)\" \
   245         -                -DVERSION=\"$(VERSION)$(SUFX)\" \
   246         -!if $(DEBUG)
   247         -	-d DEBUG \
   248         -!endif
   249         -!if $(TCL_THREADS)
   250         -	-d TCL_THREADS \
   251         -!endif
   252         -!if $(STATIC_BUILD)
   253         -	-d STATIC_BUILD \
   254         -!endif
   255         -	$<
   256         -
   257    207   DOC2HTML = $(TCLSH) "$(TOOLSDIR)\mpexpand.tcl" html
   258    208   
   259    209   {$(DOCDIR)}.man{$(OUT_DIR)}.html:
   260    210   	$(DOC2HTML) $< [email protected]
   261    211           @$(TCLSH) <<
   262    212   set name $(@:\=/)
   263    213   set f [open $$name r]; set d [read $$f]; close $$f
   264    214   set d [regsub {</head>} $$d {<link rel="stylesheet" href="manpage.css" type="text/css"></head>}]
   265    215   set f [open $$name w]; puts -nonewline $$f $$d; close $$f
   266    216   <<
   267    217   
   268         -.SUFFIXES:
   269    218   .SUFFIXES: .man
   270    219   
   271         -#---------------------------------------------------------------------
   272         -# Installation. (EDIT)
   273         -#
   274         -# You may need to modify this section to reflect the final distribution
   275         -# of your files and possibly to generate documentation.
   276         -#
   277         -#---------------------------------------------------------------------
   278         -
   279         -install-binaries:
   280         -	@echo Installing binaries to '$(SCRIPT_INSTALL_DIR)'
   281         -	@if not exist $(SCRIPT_INSTALL_DIR)\nul mkdir "$(SCRIPT_INSTALL_DIR)"
   282         -	@$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL
   283         -
   284         -install-libraries:
   285         -        @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)'
   286         -        @if exist $(LIBDIR)\NUL $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)" >NUL
   287         -        @echo Installing package index in '$(SCRIPT_INSTALL_DIR)'
   288         -        @type << >"$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
   289         -    package ifneeded $(PROJECT) $(DOTVERSION) "[list load [file join $$dir $(PROJECT)$(VERSION)$(SUFX).$(EXT)] $(PROJECT)]"
   290         -<<
   291         -
   292    220   install-docs: $(PRJDOCS)
   293    221   	@echo Installing documentation to '$(DOC_INSTALL_DIR)'
   294    222   	@if not exist $(DOC_INSTALL_DIR)\NUL mkdir "$(DOC_INSTALL_DIR)"
   295    223   	@$(CPY) "$(DOCDIR)\manpage.css" "$(DOC_INSTALL_DIR)\" >NUL
   296    224   	@for %i in ($(PRJDOCS)) do @$(CPY) %i "$(DOC_INSTALL_DIR)\" > NUL
   297    225   
   298    226   install-demos:
   299    227   	@echo Installing demos to '$(DEMO_INSTALL_DIR)'
   300    228   	@if not exist $(DEMO_INSTALL_DIR)\nul mkdir "$(DEMO_INSTALL_DIR)"
   301    229   	@$(CPY) $(DEMODIR)\*.tcl "$(DEMO_INSTALL_DIR)" >NUL
   302    230   
   303         -#---------------------------------------------------------------------
   304         -# Clean up
   305         -#---------------------------------------------------------------------
   306         -
   307         -distclean: realclean
   308         -	@if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe
   309         -	@if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj

Changes to win/rules.vc.

     1         -#------------------------------------------------------------------------------
            1  +#------------------------------------------------------------- -*- makefile -*-
     2      2   # rules.vc --
     3      3   #
     4      4   #	Microsoft Visual C++ makefile include for decoding the commandline
     5      5   #	macros.  This file does not need editing to build Tcl.
     6      6   #
     7      7   # See the file "license.terms" for information on usage and redistribution
     8      8   # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
................................................................................
    10     10   # Copyright (c) 2001-2003 David Gravereaux.
    11     11   # Copyright (c) 2003-2008 Patrick Thoyts
    12     12   # Copyright (c) 2017      Ashok P. Nadkarni
    13     13   #------------------------------------------------------------------------------
    14     14   
    15     15   !ifndef _RULES_VC
    16     16   _RULES_VC = 1
           17  +
           18  +# The following macros define the version of the rules.vc nmake build system
           19  +RULES_VERSION_MAJOR = 1
           20  +RULES_VERSION_MINOR = 0
    17     21   
    18     22   ################################################################
    19     23   # Nmake is a pretty weak environment in syntax and capabilities
    20     24   # so this file is necessarily verbose. It's broken down into
    21     25   # the following parts.
    22     26   #
    23     27   # 0. Sanity check that compiler environment is set up.
................................................................................
  1081   1085   !if "$(MACHINE)" == "AMD64"
  1082   1086   OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DO64BIT
  1083   1087   !endif
  1084   1088   !if $(VCVERSION) < 1300
  1085   1089   OPTDEFINES	= $(OPTDEFINES) -DNO_STRTOI64
  1086   1090   !endif
  1087   1091   
  1088         -# UNICODE - Use the wide char Windows API.
  1089   1092   # _ATL_XP_TARGETING - Newer SDK's need this to build for XP
  1090         -COMPILERFLAGS  = /DUNICODE /D_UNICODE /D_ATL_XP_TARGETING
         1093  +COMPILERFLAGS  = /D_ATL_XP_TARGETING
         1094  +
         1095  +
         1096  +# Following is primarily for the benefit of extensions. Tcl 8.5 builds
         1097  +# Tcl without /DUNICODE, while 8.6 builds with it defined. When building
         1098  +# an extension, it is advisable (but not mandated) to use the same Windows
         1099  +# API as the Tcl build. This is accordingly defaulted below. A particular
         1100  +# extension can override this by pre-definining USE_WIDECHAR_API.
         1101  +!ifndef USE_WIDECHAR_API
         1102  +!if $(TCL_VERSION) > 85
         1103  +USE_WIDECHAR_API = 1
         1104  +!else
         1105  +USE_WIDECHAR_API = 0
         1106  +!endif
         1107  +!endif
         1108  +
         1109  +!if $(USE_WIDECHAR_API)
         1110  +COMPILERFLAGS = $(COMPILERFLAGS) /DUNICODE /D_UNICODE 
         1111  +!endif
  1091   1112   
  1092   1113   # crt picks the C run time based on selected OPTS
  1093   1114   !if $(MSVCRT)
  1094   1115   !if $(DEBUG) && !$(UNCHECKED)
  1095   1116   crt = -MDd
  1096   1117   !else
  1097   1118   crt = -MD
................................................................................
  1295   1316   {$(COMPATDIR)}.c{$(TMP_DIR)}.obj::
  1296   1317   	$(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
  1297   1318   $<
  1298   1319   <<
  1299   1320   
  1300   1321   {$(RCDIR)}.rc{$(TMP_DIR)}.res:
  1301   1322   	$(MAKERESCMD)
  1302         -	
         1323  +
  1303   1324   {$(WINDIR)}.rc{$(TMP_DIR)}.res:
  1304   1325   	$(MAKERESCMD)
  1305   1326   
  1306   1327   .SUFFIXES:
  1307   1328   .SUFFIXES:.c .rc
  1308   1329   
  1309   1330   !endif

Deleted win/tcludp.rc.

     1         -// RCS: @(#) $Id: tcludp.rc,v 1.4 2004/11/22 23:48:48 patthoyts Exp $
     2         -//
     3         -// Version Resource Script
     4         -//
     5         -
     6         -#include <winver.h>
     7         -
     8         -LANGUAGE 0x9, 0x1	/* LANG_ENGLISH, SUBLANG_DEFAULT */
     9         -
    10         -VS_VERSION_INFO VERSIONINFO
    11         - FILEVERSION    COMMAVERSION
    12         - PRODUCTVERSION COMMAVERSION
    13         - FILEFLAGSMASK 	0x3fL
    14         -#ifdef DEBUG
    15         - FILEFLAGS 	VS_FF_DEBUG
    16         -#else
    17         - FILEFLAGS 	0x0L
    18         -#endif
    19         - FILEOS 	VOS__WINDOWS32
    20         - FILETYPE 	VFT_DLL
    21         - FILESUBTYPE 	0x0L
    22         -BEGIN
    23         -    BLOCK "StringFileInfo"
    24         -    BEGIN
    25         -        BLOCK "040904b0" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */
    26         -        BEGIN
    27         -            VALUE "FileDescription", "Tcl UDP " DOTVERSION " for Windows\0"
    28         -            VALUE "OriginalFilename", "udp" VERSION ".dll\0"
    29         -            VALUE "FileVersion",      DOTVERSION "\0"
    30         -            VALUE "LegalCopyright",   "Copyright \251 1999-2000 Columbia University; all rights reserved\0"
    31         -            VALUE "ProductName",      "TclUDP " DOTVERSION " for Windows\0"
    32         -            VALUE "ProductVersion",   DOTVERSION "\0"
    33         -        END		    
    34         -    END
    35         -    BLOCK "VarFileInfo"
    36         -    BEGIN
    37         -        VALUE "Translation", 0x409, 1200
    38         -    END
    39         -END
    40         -