Check-in [7c266d8a5b]
Overview
Comment:Updated Window Make Files to add OPENSSL lib directory to includes. Added missing files nmakehlp.c, rules.vc, rules-ext.vc, etc. Source: https://core.tcl-lang.org/tcltls/tktview/316976aff3
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | TEA
Files: files | file ages | folders
SHA3-256: 7c266d8a5b22e61fbf919b51f276102bd385c39b477a09b2b4d06e087d13ab2d
User & Date: bohagan on 2023-04-23 22:31:35
Other Links: branch diff | manifest | tags
Context
2023-04-30
02:08
Format clean-ups. check-in: e02b79f82f user: bohagan tags: TEA
2023-04-23
22:31
Updated Window Make Files to add OPENSSL lib directory to includes. Added missing files nmakehlp.c, rules.vc, rules-ext.vc, etc. Source: https://core.tcl-lang.org/tcltls/tktview/316976aff3 check-in: 7c266d8a5b user: bohagan tags: TEA
21:01
Created TEA updates branch check-in: b8dafda9a9 user: bohagan tags: TEA
Changes

Modified win/README.txt from [8e3c348717] to [e5e165d151].

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




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


+


-
+

-
+


-
+



+
+
+
-
-
+
+

+
-
-
+
+

-

+
-
-
-
-
+
+
+
+
+
+

-
+


+
+



-
+



-
-
+
+

-
+

-
+






-
+

-
+









-

-
-
+
+
+
+
	Windows DLL Build instructions using nmake build system
	2020-10-15 [email protected]
	2023-04-23 Brian O'Hagan

Properties:
- 32 bit DLL
- 64 bit DLL
- VisualStudio 2015
Note: Vuisual C++ 6 does not build OpenSSL (long long syntax error)
Note: Visual C++ 6 does not build OpenSSL (long long syntax error)
- Cygwin32 (temporary helper, please help to replace by tclsh)
- OpenSSL statically linked to TCLTLS DLL.
Note: Dynamic linking also works but results in a DLL dependeny on OPENSSL DLL's
Note: Dynamic linking also works but results in a DLL dependency on OPENSSL DLL's

1) Build OpenSSL static libraries:

(1a) Get OpenSSL
  https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1t/openssl-1.1.1t.tar.gz

OpenSSL source distribtution unpacked in:
c:\test\tcltls\Openssl_1_1_1h
  OpenSSL source distribution unpacked in:
  C:\Users\Brian\Documents\Source\Build\openssl-1.1.1t

(1b) Install Perl from https://strawberryperl.com/
- Install Perl from http://strawberryperl.com/download/5.32.0.1/strawberry-perl-5.32.0.1-32bit.msi
  to C:\perl
  https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit.msi
  to C:\Strawberry\perl
  (ActivePerl failed due to missing 32 bit console module)
- Install NASM Assembler:

(1c) Install NASM Assembler from https://www.nasm.us/
https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win32/nasm-2.15.05-installer-x86.exe
  to C:\Program Files (x86)\NASM
  
-> Visual Studio x86 native prompt.
  https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-installer-x64.exe
  to C:\Program Files\NASM

(1d)
- Configure
  At Visual Studio x86 native prompt:

set Path=%PATH%;C:\Program Files (x86)\NASM;C:\Perl\perl\bin
set Path=%PATH%;C:\Program Files\NASM;C:\Strawberry\perl\bin

perl Configure VC-WIN32 --prefix=c:\test\tcltls\openssl --openssldir=c:\test\tcltls\openssldir no-shared no-filenames threads
perl ..\Configure VC-WIN64A no-asm no-ssl3 no-zlib no-comp no-ui-console no-autoload-config --api=1.1.0 --prefix="%installdir%" --openssldir="%commoninstalldir%" -DOPENSSL_NO_DEPRECATED


nmake
nmake test
namke install
nmake install

2) Build TCLTLS

Unzip distribution in:
c:\test\tcltls\tcltls-1.7.22
2a) Unzip distribution in:
C:\Users\Brian\Documents\Source\Build\tcltls-b5c41cdeb6

-> start cygwin bash prompt
2b) Start BASH shell (MinGW62 Git shell)

cd /cygdrive/c/test/tcltls/tcltls-1.7.22
cd /c/Users/Brian/Documents/Source/Build/tcltls-b5c41cdeb6
./gen_dh_params > dh_params.h

od -A n -v -t xC < 'tls.tcl' > tls.tcl.h.new.1
sed 's@[^0-9A-Fa-f]@@g;s@..@0x&, @g' < tls.tcl.h.new.1 > tls.tcl.h
rm -f tls.tcl.h.new.1

-> Visual Studio x86 native prompt.
2c) Start Visual Studio shell

cd C:\test\tcltls\tcltls-1.7.22\win
cd C:\Users\Brian\Documents\Source\Build\tcltls-b5c41cdeb6\win

nmake -f makefile.vc TCLDIR=c:\test\tcl8610 SSL_INSTALL_FOLDER=C:\test\tcltls\openssl

nmake -f makefile.vc install TCLDIR=c:\test\tcl8610 INSTALLDIR=c:\test\tcltls SSL_INSTALL_FOLDER=C:\test\tcltls\openssl

3) Test

Start tclsh or wish

lappend auto_path {C:\test\tcltls\tls1.7.22}
package require tls

A small "1.7.22" showing up is hopefully the end of this long way...
package require http
http::register https 443 [list ::tls::socket -autoservername true]
set tok [http::data [http::geturl https://www.tcl-lang.org]]
::http::cleanup $tok

Modified win/makefile.vc from [2103458bde] to [02934efb2a].

1
2

3
4
5
6
7
8











9
10
11
12
13
14
15
1

2
3
4
5
6


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

-
+




-
-
+
+
+
+
+
+
+
+
+
+
+







# call nmake with additional parameter SSL_INSTALL_FOLDER= with the
# OpenSSL instalation folder following.
# OpenSSL installation folder following.

PROJECT=tls
DOTVERSION = 1.7.22

PRJ_INCLUDES	= -I"$(SSL_INSTALL_FOLDER)\include"
PRJ_DEFINES =  -D NO_SSL2 -D NO_SSL3 -D _CRT_SECURE_NO_WARNINGS
PRJ_INCLUDES = -I"$(SSL_INSTALL_FOLDER)\include" -I"$(OPENSSL_INSTALL_DIR)\include"
PRJ_DEFINES = -D NO_SSL2 -D NO_SSL3 -D _CRT_SECURE_NO_WARNINGS
 
# SSL Libs:
#    1. ${LIBCRYPTO}.dll
#    2. ${LIBSSL}.dll
# Where LIBCRYPTO (#1.) and LIBSSL (#2.) are defined as follows:
#    v1.1: libcrypto-1.1-x64.dll and libssl-1.1-x64.dll
#    v3: libcrypto-3-x64.dll and libssl-3-x64.dll
# On *nix libcrypto.so.* and libssl.so.* (where suffix is a version indicator).
#

PRJ_LIBS = \
	"$(SSL_INSTALL_FOLDER)\lib\libssl.lib" \
	"$(SSL_INSTALL_FOLDER)\lib\libcrypto.lib" \
	WS2_32.LIB GDI32.LIB ADVAPI32.LIB CRYPT32.LIB USER32.LIB

PRJ_OBJS = $(TMP_DIR)\tls.obj \

Added win/nmakehlp.c version [b01f822eab].

Added win/rules-ext.vc version [566230fdd9].

Added win/rules.vc version [79247ddfc9].

Modified win/targets.vc from [a9dacf9516] to [96a25a1fa6].

1
2
3
4
5
6
7

8
9
10
11
12
13
14
1
2
3
4
5
6

7
8
9
10
11
12
13
14






-
+







#------------------------------------------------------------- -*- makefile -*-
# targets.vc --
#
# Part of the nmake based build system for Tcl and its extensions.
# This file defines some standard targets for the convenience of extensions
# and can be optionally included by the extension makefile.
# See TIP 477 (https://core.tcl-lang.org/tips/doc/trunk/tip/477.md) for docs.
# See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for docs.

$(PROJECT): setup pkgindex $(PRJLIB)

!ifdef PRJ_STUBOBJS
$(PROJECT): $(PRJSTUBLIB)
$(PRJSTUBLIB): $(PRJ_STUBOBJS)
	$(LIBCMD) $**