Tcl Extension Architecture (TEA) Sample Extension

Check-in [46bab6aa51]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.

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 Unified Diffs Ignore Whitespace Patch

Changes to win/makefile.vc.

158
159
160
161
162
163
164



165
166
167
168
169
170
171
!endif

# Define any additional compiler flags that might be required for the project
PRJ_DEFINES = -D_CRT_SECURE_NO_DEPRECATE

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




# We must define a pkgindex target that will create a pkgIndex.tcl
# file in the $(OUT_DIR) directory. We can just redirect to the
# default-pkgindex target for our sample extension.
pkgindex: default-pkgindex

# The default install target only installs binaries and scripts so add







>
>
>







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
!endif

# Define any additional compiler flags that might be required for the project
PRJ_DEFINES = -D_CRT_SECURE_NO_DEPRECATE

# 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

# We must define a pkgindex target that will create a pkgIndex.tcl
# file in the $(OUT_DIR) directory. We can just redirect to the
# default-pkgindex target for our sample extension.
pkgindex: default-pkgindex

# The default install target only installs binaries and scripts so add

Changes to win/rules.vc.

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
...
866
867
868
869
870
871
872

873
874
875
876
877
878
879
....
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344


1345
1346
1347
1348
1349
1350
1351
....
1398
1399
1400
1401
1402
1403
1404





































1405
1406
1407
1408
1409
1410
1411
....
1423
1424
1425
1426
1427
1428
1429



1430
1431
1432
1433
1434
1435
1436
#----------------------------------------------------------

RMDIR	= rmdir /S /Q
ERRNULL  = 2>NUL
CPY	= xcopy /i /y >NUL
COPY	= copy /y >NUL
MKDIR   = mkdir

# The ProgramFiles(x86) environment variable is not accessible
# from nmake since it has the parenthesis which nmake does not like
# within a macro name. So define our own in terms of the
# ProgramFiles environment variable.
# Note: env variables are always UPPER CASE in nmake
!if defined(PROCESSOR_ARCHITECTURE) && "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
PROGRAMFILES_X86 = $(PROGRAMFILES) (x86)
!else
PROGRAMFILES_X86 = $(PROGRAMFILES)
!endif


######################################################################
# 2. Figure out our build environment in terms of what we're building.
#
# (a) Tcl itself
# (b) Tk
# (c) a Tcl extension using libraries/includes from an *installed* Tcl
................................................................................
_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
!endif

!ifndef CFG_ENCODING
CFG_ENCODING	= \"cp1252\"
!endif

!message =====================================================================

################################################################
# 4. Build the nmakehlp program
# This is a helper app we need to overcome nmake's limiting
# environment. We will call out to it to get various bits of
# information about supported compiler options etc.
#
# Tcl itself will always use the nmakehlp.c program which is
................................................................................
!if [echo DOTVERSION = \> versions.vc] \
   || [nmakehlp -V ..\configure.ac AC_INIT >> versions.vc]
!error *** Could not figure out extension version. Please define DOTVERSION in parent makefile before including rules.vc.
!endif
!endif
!include versions.vc
!endif # DOTVERSION


!endif # $(DOING_TCL) ... etc.

################################################################
# 10. Construct output directory and file paths
# Figure-out how to name our intermediate and output directories.
# In order to avoid inadvertent mixing of object files built using
................................................................................
MAKEBINCMD = $(MAKEDLLCMD)
!endif
MAKECONCMD = $(link32) $(conlflags) -out:$@ $(baselibs) $(tcllibs)
MAKEGUICMD = $(link32) $(guilflags) -out:$@ $(baselibs) $(tcllibs)
MAKERESCMD  = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \
	    $(TCL_INCLUDES) \
	    -DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \
	    -DTCL_THREADS=$(TCL_THREADS) \
	    -DSTATIC_BUILD=$(STATIC_BUILD) \
	    -DCOMMAVERSION=$(DOTVERSION:.=,),0 \
	    -DDOTVERSION=\"$(DOTVERSION)\" \
	    -DVERSION=\"$(VERSION)\" \
	    -DSUFX=\"$(SUFX)\" \


	    $<


!ifndef DEFAULT_BUILD_TARGET
DEFAULT_BUILD_TARGET = $(PROJECT)
!endif

................................................................................
default-distclean: default-hose
	@if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe
	@if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj

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






































!ifndef DISABLE_IMPLICIT_RULES
# Implicit rule definitions - only for building library objects. For stubs and
# main application, the master makefile should define explicit rules.

{$(WINDIR)}.c{$(TMP_DIR)}.obj::
	$(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
................................................................................
<<

{$(RCDIR)}.rc{$(TMP_DIR)}.res:
	$(MAKERESCMD)

{$(WINDIR)}.rc{$(TMP_DIR)}.res:
	$(MAKERESCMD)




.SUFFIXES:
.SUFFIXES:.c .rc

!endif

################################################################







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







 







<
<







 







>







 







<
<




>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>







93
94
95
96
97
98
99












100
101
102
103
104
105
106
...
382
383
384
385
386
387
388


389
390
391
392
393
394
395
...
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
....
1319
1320
1321
1322
1323
1324
1325


1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
....
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
....
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
#----------------------------------------------------------

RMDIR	= rmdir /S /Q
ERRNULL  = 2>NUL
CPY	= xcopy /i /y >NUL
COPY	= copy /y >NUL
MKDIR   = mkdir













######################################################################
# 2. Figure out our build environment in terms of what we're building.
#
# (a) Tcl itself
# (b) Tk
# (c) a Tcl extension using libraries/includes from an *installed* Tcl
................................................................................
_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
!endif

!ifndef CFG_ENCODING
CFG_ENCODING	= \"cp1252\"
!endif



################################################################
# 4. Build the nmakehlp program
# This is a helper app we need to overcome nmake's limiting
# environment. We will call out to it to get various bits of
# information about supported compiler options etc.
#
# Tcl itself will always use the nmakehlp.c program which is
................................................................................
!if [echo DOTVERSION = \> versions.vc] \
   || [nmakehlp -V ..\configure.ac AC_INIT >> versions.vc]
!error *** Could not figure out extension version. Please define DOTVERSION in parent makefile before including rules.vc.
!endif
!endif
!include versions.vc
!endif # DOTVERSION
VERSION         = $(DOTVERSION:.=)

!endif # $(DOING_TCL) ... etc.

################################################################
# 10. Construct output directory and file paths
# Figure-out how to name our intermediate and output directories.
# In order to avoid inadvertent mixing of object files built using
................................................................................
MAKEBINCMD = $(MAKEDLLCMD)
!endif
MAKECONCMD = $(link32) $(conlflags) -out:$@ $(baselibs) $(tcllibs)
MAKEGUICMD = $(link32) $(guilflags) -out:$@ $(baselibs) $(tcllibs)
MAKERESCMD  = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \
	    $(TCL_INCLUDES) \
	    -DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \


	    -DCOMMAVERSION=$(DOTVERSION:.=,),0 \
	    -DDOTVERSION=\"$(DOTVERSION)\" \
	    -DVERSION=\"$(VERSION)\" \
	    -DSUFX=\"$(SUFX)\" \
            -DPROJECT=\"$(PROJECT)\" \
            -DPRJLIBNAME=\"$(PRJLIBNAME)\" \
	    $<


!ifndef DEFAULT_BUILD_TARGET
DEFAULT_BUILD_TARGET = $(PROJECT)
!endif

................................................................................
default-distclean: default-hose
	@if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe
	@if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj

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

default-rc:
	@$(COPY) << $(TMP_DIR)\$(PROJECT).rc
#include <winver.h>

VS_VERSION_INFO VERSIONINFO
 FILEVERSION	COMMAVERSION
 PRODUCTVERSION	COMMAVERSION
 FILEFLAGSMASK	0x3fL
#ifdef DEBUG
 FILEFLAGS	VS_FF_DEBUG
#else
 FILEFLAGS	0x0L
#endif
 FILEOS		VOS_NT_WINDOWS32
 FILETYPE	VFT_DLL
 FILESUBTYPE	0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "FileDescription",  "Tcl extension " PROJECT
            VALUE "OriginalFilename", PRJLIBNAME
            VALUE "FileVersion",      DOTVERSION
            VALUE "ProductName",      "Package " PROJECT " for Tcl"
            VALUE "ProductVersion",   DOTVERSION 
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

<<


!ifndef DISABLE_IMPLICIT_RULES
# Implicit rule definitions - only for building library objects. For stubs and
# main application, the master makefile should define explicit rules.

{$(WINDIR)}.c{$(TMP_DIR)}.obj::
	$(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
................................................................................
<<

{$(RCDIR)}.rc{$(TMP_DIR)}.res:
	$(MAKERESCMD)

{$(WINDIR)}.rc{$(TMP_DIR)}.res:
	$(MAKERESCMD)

{$(TMP_DIR)}.rc{$(TMP_DIR)}.res:
	$(MAKERESCMD)

.SUFFIXES:
.SUFFIXES:.c .rc

!endif

################################################################

Deleted win/sample.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
// sample.rc - Copyright (C) 2006 Pat Thoyts <patthoyts@users.sourceforge.net>
//
// There is no need to modify this file.
//

#include <winver.h>

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"
        BEGIN
            VALUE "FileDescription",  "Tcl Sample Extension " DOTVERSION "\0"
            VALUE "OriginalFilename", "sample" VERSION ".dll\0"
            VALUE "CompanyName",      "The Tcl Development Community\0"
            VALUE "FileVersion",      DOTVERSION "\0"
            VALUE "LegalCopyright",   "Copyright \251 1999 Scriptics Corp.\0"
            VALUE "ProductName",      "Tcl Sample Extension " DOTVERSION "\0"
            VALUE "ProductVersion",   DOTVERSION "\0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<