Check-in [f92c42c849]
Bounty program for improvements to Tcl and certain Tcl packages.
Overview
Comment:MSVC Win maker (WIP, got wiped out, re-constitution in progress)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | readd-win-msvc
Files: files | file ages | folders
SHA3-256: f92c42c8495681bf0c39b2997afd9027ec0d177bf25227945a9fe1bea3882b62
User & Date: rkeene on 2019-11-12 17:48:27
Other Links: branch diff | manifest | tags
Context
2019-11-12
17:48
MSVC Win maker (WIP, got wiped out, re-constitution in progress) Leaf check-in: f92c42c849 user: rkeene tags: readd-win-msvc
17:47
Started readding MSVC Windows build support check-in: 8478c7ec08 user: rkeene tags: readd-win-msvc
Changes

Added build/make-msvc-win version [bca2ec86ab].




































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
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
#! /usr/bin/env bash

cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1

function make-makefile-vc() {
	local outDir

	outDir="$1"

	cat << \_EOF_ > "${outDir}/Makefile.vc"
# Specify OpenSSL and Tcl parameters here
# -----BEGIN MODIFICATIONS-----
OPENSSL_DIR        = c:/OpenSSL-Win64
OPENSSL_LIBS       = c:/OpenSSL-Win64/lib/VC/static/libssl64MT.lib c:/OpenSSL-Win64/lib/VC/static/libcrypto64MT.lib
OPENSSL_CPPFLAGS   = -DNO_SSL2 -DNO_SSL3

TCL_DIR            = c:/Tcl
# -----END MODIFICATIONS-----
_EOF_

AR
CC
CFLAGS
CPPFLAGS
DEFS
EXTENSION_TARGET
GEN_DH_PARAMS_ARGS
INSTALL
INSTALL_DATA
INSTALL_PROGRAM
LDFLAGS
LIBS
PACKAGE_VERSION
RANLIB
REMOVESYMS
SHOBJFLAGS
SHOBJLDFLAGS
TCLEXT_BUILD
TCLSH_PROG
TCL_DEFS
TCL_PACKAGE_PATH
WEAKENSYMS
exec_prefix
libdir
prefix
srcdir
--
CC = @[email protected]
AR = @[email protected]
RANLIB = @[email protected]
CFLAGS = @[email protected] @[email protected]
CPPFLAGS = @[email protected] [email protected]@ -I. @[email protected] @[email protected]
LDFLAGS = @[email protected] @[email protected]
LIBS = @[email protected]
PACKAGE_VERSION = @[email protected]
prefix = @[email protected]
exec_prefix = @[email protected]
libdir = @[email protected]
TCL_PACKAGE_PATH = @[email protected]
PACKAGE_INSTALL_DIR = $(TCL_PACKAGE_PATH)/tcltls$(PACKAGE_VERSION)
INSTALL = @[email protected]
INSTALL_PROGRAM = @[email protected]
INSTALL_DATA = @[email protected]
VPATH = @[email protected]

all: @[email protected]

@[email protected]: @TCLEX[email protected]@[email protected]
	mv @[email protected]@[email protected] @[email protected]

# The shared object target
[email protected][email protected]: tls.o tlsBIO.o tlsIO.o tlsX509.o Makefile
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o [email protected][email protected] tls.o tlsBIO.o tlsIO.o tlsX509.o $(LIBS)
	[email protected]@ [email protected][email protected]
	[email protected]@ [email protected][email protected]

# The static target
[email protected][email protected]: tls.o tlsBIO.o tlsIO.o tlsX509.o Makefile
	$(AR) rcu [email protected][email protected] tls.o tlsBIO.o tlsIO.o tlsX509.o
	-$(RANLIB) [email protected][email protected]

# Dependencies for all our targets
tls.o: @[email protected]/tls.c @[email protected]/tlsInt.h @[email protected]/tclOpts.h tls.tcl.h dh_params.h Makefile
	$(CC) $(CPPFLAGS) $(CFLAGS) -o tls.o -c @[email protected]/tls.c

tlsBIO.o: @[email protected]/tlsBIO.c @[email protected]/tlsInt.h Makefile
	$(CC) $(CPPFLAGS) $(CFLAGS) -o tlsBIO.o -c @[email protected]/tlsBIO.c

tlsIO.o: @[email protected]/tlsIO.c @[email protected]/tlsInt.h Makefile
	$(CC) $(CPPFLAGS) $(CFLAGS) -o tlsIO.o -c @[email protected]/tlsIO.c

tlsX509.o: @[email protected]/tlsX509.c @[email protected]/tlsInt.h Makefile
	$(CC) $(CPPFLAGS) $(CFLAGS) -o tlsX509.o -c @[email protected]/tlsX509.c

# Create a C-source-ified version of the script resources
# for TclTLS so that we only need a single file to enable
# this extension
tls.tcl.h: @[email protected]/tls.tcl Makefile
	od -A n -v -t xC < '@[email protected]/tls.tcl' > tls.tcl.h.new.1
	sed '[email protected]  *@@g;[email protected]@0x&, @g' < tls.tcl.h.new.1 > tls.tcl.h.new.2
	rm -f tls.tcl.h.new.1
	mv tls.tcl.h.new.2 tls.tcl.h

# Create default DH parameters
dh_params.h: @[email protected]/gen_dh_params Makefile
	sh @[email protected]/gen_dh_params @[email protected] > dh_params.h.new
	mv dh_params.h.new dh_params.h

# Install the extension
install: @[email protected] pkgIndex.tcl
	$(INSTALL) -d '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
	$(INSTALL_PROGRAM) @[email protected] '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
	$(INSTALL_DATA)    pkgIndex.tcl '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'

# A convienent helper to undo the installation just done
uninstall:
	rm -f '$(DESTDIR)$(PACKAGE_INSTALL_DIR)/@[email protected]'
	rm -f '$(DESTDIR)$(PACKAGE_INSTALL_DIR)/pkgIndex.tcl'
	-rmdir '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'

# Test target, run the automated test suite
test: @[email protected]
	@[email protected] @[email protected]/tests/all.tcl $(TESTFLAGS) -load "lappend auto_path $(shell pwd)"

# Clean the local build directory for rebuild against the same configuration
clean:
	rm -f tls.o tlsBIO.o tlsIO.o tlsX509.o
	rm -f @[email protected] [email protected][email protected] [email protected][email protected]
	rm -f [email protected][email protected] [email protected][email protected]
	rm -f tls.tcl.h tls.tcl.h.new.1 tls.tcl.h.new.2

# Clean the local build directory back to what it was after unpacking the
# distribution tarball
distclean: clean
	rm -f config.log config.status
	rm -f dh_params.h.new dh_params.h
	rm -f Makefile pkgIndex.tcl
	rm -f tcltls.a.linkadd

# Clean the local build directory back to only thing things that exist in
# version control system
mrproper: distclean
	rm -f @[email protected]/configure @[email protected]/config.sub @[email protected]/config.guess @[email protected]/install-sh
	rm -f @[email protected]/aclocal.m4
	rm -rf @[email protected]/autom4te.cache

.PHONY: all install uninstall clean distclean mrproper test
--
CC = CL
AR = false
RANLIB = false
CFLAGS = $(OPENSSL_CFLAGS) 
CPPFLAGS = $(OPENSSL_CPPFLAGS) -I$(OPENSSL_DIR)/include -I$(TCL_DIR)/include -DPACKAGE_VERSION="\"$(PACKAGE_VERSION)\"" -I.. -I. -DUSE_TCL_STUBS=1 -DUSE_TCL_STUBS=1
LDFLAGS =  -LD
LIBS = $(OPENSSL_LIBS) $(TCL_DIR)/lib/libtclstub86.lib ws2_32.lib advapi32.lib crypt32.lib user32.lib
PACKAGE_VERSION = 1.7.19
prefix = /
exec_prefix = /
libdir = /lib
TCL_PACKAGE_PATH = 
PACKAGE_INSTALL_DIR = $(TCL_PACKAGE_PATH)/tcltls$(PACKAGE_VERSION)
INSTALL = false
INSTALL_PROGRAM = false
INSTALL_DATA = false
VPATH = ..

all: tcltls.dll

tcltls.dll: shared-tcltls.dll
	REN shared-tcltls.dll tcltls.dll

# The shared object target
shared-tcltls.dll: tls.o tlsBIO.o tlsIO.o tlsX509.o Makefile.vc
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Feshared-tcltls.dll tls.o tlsBIO.o tlsIO.o tlsX509.o $(LIBS)

# The static target
static-tcltls.dll: tls.o tlsBIO.o tlsIO.o tlsX509.o Makefile.vc
	$(AR) rcu static-tcltls.dll tls.o tlsBIO.o tlsIO.o tlsX509.o
	-$(RANLIB) static-tcltls.dll

# Dependencies for all our targets
tls.o: ../tls.c ../tlsInt.h ../tclOpts.h tls.tcl.h dh_params.h Makefile.vc
	$(CC) $(CPPFLAGS) $(CFLAGS) -Fotls.o -c ../tls.c

tlsBIO.o: ../tlsBIO.c ../tlsInt.h Makefile.vc
	$(CC) $(CPPFLAGS) $(CFLAGS) -FotlsBIO.o -c ../tlsBIO.c

tlsIO.o: ../tlsIO.c ../tlsInt.h Makefile.vc
	$(CC) $(CPPFLAGS) $(CFLAGS) -FotlsIO.o -c ../tlsIO.c

tlsX509.o: ../tlsX509.c ../tlsInt.h Makefile.vc
	$(CC) $(CPPFLAGS) $(CFLAGS) -FotlsX509.o -c ../tlsX509.c

# Create a C-source-ified version of the script resources
# for TclTLS so that we only need a single file to enable
# this extension
# Create default DH parameters
.c.o:

# Install the extension
install: tcltls.dll pkgIndex.tcl
	$(INSTALL) -d '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
	$(INSTALL_PROGRAM) tcltls.dll '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
	$(INSTALL_DATA)    pkgIndex.tcl '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'

# A convienent helper to undo the installation just done
uninstall:
	DEL /F '$(DESTDIR)$(PACKAGE_INSTALL_DIR)/tcltls.dll'
	DEL /F '$(DESTDIR)$(PACKAGE_INSTALL_DIR)/pkgIndex.tcl'
	-DEL /F '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'

# Test target, run the automated test suite
# Clean the local build directory for rebuild against the same configuration
clean:
	DEL /F tls.o tlsBIO.o tlsIO.o tlsX509.o
	DEL /F tcltls.dll shared-tcltls.dll static-tcltls.dll
	DEL /F shared-tcltls.dll.def shared-tcltls.dll.lib

# Clean the local build directory back to what it was after unpacking the
# distribution tarball
distclean: clean
	DEL /F config.log config.status
	DEL /F tcltls.a.linkadd

# Clean the local build directory back to only thing things that exist in
# version control system
mrproper: distclean
	DEL /F ../configure ../config.sub ../config.guess ../install-sh
	DEL /F ../aclocal.m4
	DEL /F ../autom4te.cache

.PHONY: all install uninstall clean distclean mrproper test

}

mkdir ../win || exit 1
make-makefile-vc ../win
cd ../win || exit 1

sed 's|@[email protected]|..|g;s|@[email protected]|fallback|g' < ../Makefile.in > Makefile
make tls.tcl.h dh_params.h
rm -f Makefile