Tcl Extension Architecture (TEA) Sample Extension

Check-in [46bab6aa51]
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:Replace sample.rc with default resource template
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | vc-reform
Files: files | file ages | folders
SHA1: 46bab6aa517ba0520c043a506d3c269eb091e14b
User & Date: ashok 2017-10-08 15:28:14
Context
2017-10-16
13:06
Update to latest rules from Tcl. Use automatic resource file generation. check-in: 9132b5cd84 user: ashok tags: vc-reform
2017-10-08
15:28
Replace sample.rc with default resource template check-in: 46bab6aa51 user: ashok tags: vc-reform
2017-10-07
14:47
Update to latest rules from Tcl. In particular, use targets.vc check-in: 1f353b37cb user: ashok tags: vc-reform
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to win/makefile.vc.

   158    158   !endif
   159    159   
   160    160   # Define any additional compiler flags that might be required for the project
   161    161   PRJ_DEFINES = -D_CRT_SECURE_NO_DEPRECATE
   162    162   
   163    163   # Define the standard targets
   164    164   !include "$(_RULESDIR)\targets.vc"
          165  +
          166  +# We will use the standard resource template instead of writing our own
          167  +$(TMP_DIR)\$(PROJECT).res: default-rc
   165    168   
   166    169   # We must define a pkgindex target that will create a pkgIndex.tcl
   167    170   # file in the $(OUT_DIR) directory. We can just redirect to the
   168    171   # default-pkgindex target for our sample extension.
   169    172   pkgindex: default-pkgindex
   170    173   
   171    174   # The default install target only installs binaries and scripts so add

Changes to win/rules.vc.

    93     93   #----------------------------------------------------------
    94     94   
    95     95   RMDIR	= rmdir /S /Q
    96     96   ERRNULL  = 2>NUL
    97     97   CPY	= xcopy /i /y >NUL
    98     98   COPY	= copy /y >NUL
    99     99   MKDIR   = mkdir
   100         -
   101         -# The ProgramFiles(x86) environment variable is not accessible
   102         -# from nmake since it has the parenthesis which nmake does not like
   103         -# within a macro name. So define our own in terms of the
   104         -# ProgramFiles environment variable.
   105         -# Note: env variables are always UPPER CASE in nmake
   106         -!if defined(PROCESSOR_ARCHITECTURE) && "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
   107         -PROGRAMFILES_X86 = $(PROGRAMFILES) (x86)
   108         -!else
   109         -PROGRAMFILES_X86 = $(PROGRAMFILES)
   110         -!endif
   111         -
   112    100   
   113    101   ######################################################################
   114    102   # 2. Figure out our build environment in terms of what we're building.
   115    103   #
   116    104   # (a) Tcl itself
   117    105   # (b) Tk
   118    106   # (c) a Tcl extension using libraries/includes from an *installed* Tcl
................................................................................
   394    382   _VC_MANIFEST_EMBED_DLL=if exist [email protected] mt -nologo -manifest [email protected] -outputresource:[email protected];2
   395    383   !endif
   396    384   
   397    385   !ifndef CFG_ENCODING
   398    386   CFG_ENCODING	= \"cp1252\"
   399    387   !endif
   400    388   
   401         -!message =====================================================================
   402         -
   403    389   ################################################################
   404    390   # 4. Build the nmakehlp program
   405    391   # This is a helper app we need to overcome nmake's limiting
   406    392   # environment. We will call out to it to get various bits of
   407    393   # information about supported compiler options etc.
   408    394   #
   409    395   # Tcl itself will always use the nmakehlp.c program which is
................................................................................
   866    852   !if [echo DOTVERSION = \> versions.vc] \
   867    853      || [nmakehlp -V ..\configure.ac AC_INIT >> versions.vc]
   868    854   !error *** Could not figure out extension version. Please define DOTVERSION in parent makefile before including rules.vc.
   869    855   !endif
   870    856   !endif
   871    857   !include versions.vc
   872    858   !endif # DOTVERSION
          859  +VERSION         = $(DOTVERSION:.=)
   873    860   
   874    861   !endif # $(DOING_TCL) ... etc.
   875    862   
   876    863   ################################################################
   877    864   # 10. Construct output directory and file paths
   878    865   # Figure-out how to name our intermediate and output directories.
   879    866   # In order to avoid inadvertent mixing of object files built using
................................................................................
  1332   1319   MAKEBINCMD = $(MAKEDLLCMD)
  1333   1320   !endif
  1334   1321   MAKECONCMD = $(link32) $(conlflags) -out:[email protected] $(baselibs) $(tcllibs)
  1335   1322   MAKEGUICMD = $(link32) $(guilflags) -out:[email protected] $(baselibs) $(tcllibs)
  1336   1323   MAKERESCMD  = $(rc32) -fo [email protected] -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \
  1337   1324   	    $(TCL_INCLUDES) \
  1338   1325   	    -DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \
  1339         -	    -DTCL_THREADS=$(TCL_THREADS) \
  1340         -	    -DSTATIC_BUILD=$(STATIC_BUILD) \
  1341   1326   	    -DCOMMAVERSION=$(DOTVERSION:.=,),0 \
  1342   1327   	    -DDOTVERSION=\"$(DOTVERSION)\" \
  1343   1328   	    -DVERSION=\"$(VERSION)\" \
  1344   1329   	    -DSUFX=\"$(SUFX)\" \
         1330  +            -DPROJECT=\"$(PROJECT)\" \
         1331  +            -DPRJLIBNAME=\"$(PRJLIBNAME)\" \
  1345   1332   	    $<
  1346   1333   
  1347   1334   
  1348   1335   !ifndef DEFAULT_BUILD_TARGET
  1349   1336   DEFAULT_BUILD_TARGET = $(PROJECT)
  1350   1337   !endif
  1351   1338   
................................................................................
  1398   1385   default-distclean: default-hose
  1399   1386   	@if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe
  1400   1387   	@if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj
  1401   1388   
  1402   1389   default-setup:
  1403   1390   	@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
  1404   1391   	@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
         1392  +
         1393  +default-rc:
         1394  +	@$(COPY) << $(TMP_DIR)\$(PROJECT).rc
         1395  +#include <winver.h>
         1396  +
         1397  +VS_VERSION_INFO VERSIONINFO
         1398  + FILEVERSION	COMMAVERSION
         1399  + PRODUCTVERSION	COMMAVERSION
         1400  + FILEFLAGSMASK	0x3fL
         1401  +#ifdef DEBUG
         1402  + FILEFLAGS	VS_FF_DEBUG
         1403  +#else
         1404  + FILEFLAGS	0x0L
         1405  +#endif
         1406  + FILEOS		VOS_NT_WINDOWS32
         1407  + FILETYPE	VFT_DLL
         1408  + FILESUBTYPE	0x0L
         1409  +BEGIN
         1410  +    BLOCK "StringFileInfo"
         1411  +    BEGIN
         1412  +        BLOCK "040904b0"
         1413  +        BEGIN
         1414  +            VALUE "FileDescription",  "Tcl extension " PROJECT
         1415  +            VALUE "OriginalFilename", PRJLIBNAME
         1416  +            VALUE "FileVersion",      DOTVERSION
         1417  +            VALUE "ProductName",      "Package " PROJECT " for Tcl"
         1418  +            VALUE "ProductVersion",   DOTVERSION 
         1419  +        END
         1420  +    END
         1421  +    BLOCK "VarFileInfo"
         1422  +    BEGIN
         1423  +        VALUE "Translation", 0x409, 1200
         1424  +    END
         1425  +END
         1426  +
         1427  +<<
         1428  +
  1405   1429   
  1406   1430   !ifndef DISABLE_IMPLICIT_RULES
  1407   1431   # Implicit rule definitions - only for building library objects. For stubs and
  1408   1432   # main application, the master makefile should define explicit rules.
  1409   1433   
  1410   1434   {$(WINDIR)}.c{$(TMP_DIR)}.obj::
  1411   1435   	$(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
................................................................................
  1423   1447   <<
  1424   1448   
  1425   1449   {$(RCDIR)}.rc{$(TMP_DIR)}.res:
  1426   1450   	$(MAKERESCMD)
  1427   1451   
  1428   1452   {$(WINDIR)}.rc{$(TMP_DIR)}.res:
  1429   1453   	$(MAKERESCMD)
         1454  +
         1455  +{$(TMP_DIR)}.rc{$(TMP_DIR)}.res:
         1456  +	$(MAKERESCMD)
  1430   1457   
  1431   1458   .SUFFIXES:
  1432   1459   .SUFFIXES:.c .rc
  1433   1460   
  1434   1461   !endif
  1435   1462   
  1436   1463   ################################################################

Deleted win/sample.rc.

     1         -// sample.rc - Copyright (C) 2006 Pat Thoyts <[email protected]>
     2         -//
     3         -// There is no need to modify this file.
     4         -//
     5         -
     6         -#include <winver.h>
     7         -
     8         -VS_VERSION_INFO VERSIONINFO
     9         - FILEVERSION	COMMAVERSION
    10         - PRODUCTVERSION	COMMAVERSION
    11         - FILEFLAGSMASK	0x3fL
    12         -#ifdef DEBUG
    13         - FILEFLAGS	VS_FF_DEBUG
    14         -#else
    15         - FILEFLAGS	0x0L
    16         -#endif
    17         - FILEOS		VOS__WINDOWS32
    18         - FILETYPE	VFT_DLL
    19         - FILESUBTYPE	0x0L
    20         -BEGIN
    21         -    BLOCK "StringFileInfo"
    22         -    BEGIN
    23         -        BLOCK "040904b0"
    24         -        BEGIN
    25         -            VALUE "FileDescription",  "Tcl Sample Extension " DOTVERSION "\0"
    26         -            VALUE "OriginalFilename", "sample" VERSION ".dll\0"
    27         -            VALUE "CompanyName",      "The Tcl Development Community\0"
    28         -            VALUE "FileVersion",      DOTVERSION "\0"
    29         -            VALUE "LegalCopyright",   "Copyright \251 1999 Scriptics Corp.\0"
    30         -            VALUE "ProductName",      "Tcl Sample Extension " DOTVERSION "\0"
    31         -            VALUE "ProductVersion",   DOTVERSION "\0"
    32         -        END
    33         -    END
    34         -    BLOCK "VarFileInfo"
    35         -    BEGIN
    36         -        VALUE "Translation", 0x409, 1200
    37         -    END
    38         -END