Artifact
155fe10a6135d3247de41432fa9e3de755e953131a23cd15f82d032e14564c05:
0000: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d #---------------
0010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 2d -------------- -
0040: 2a 2d 20 6d 61 6b 65 66 69 6c 65 20 2d 2a 2d 0a *- makefile -*-.
0050: 23 0a 23 20 4d 61 6b 65 66 69 6c 65 20 66 6f 72 #.# Makefile for
0060: 20 54 63 6c 54 4c 53 20 65 78 74 65 6e 73 69 6f TclTLS extensio
0070: 6e 73 2e 0a 23 0a 23 20 42 61 73 69 63 20 62 75 ns..#.# Basic bu
0080: 69 6c 64 2c 20 74 65 73 74 20 61 6e 64 20 69 6e ild, test and in
0090: 73 74 61 6c 6c 0a 23 20 20 20 6e 6d 61 6b 65 20 stall.# nmake
00a0: 2f 66 20 6d 61 6b 65 66 69 6c 65 2e 76 63 20 49 /f makefile.vc I
00b0: 4e 53 54 41 4c 4c 44 49 52 3d 63 3a 5c 70 61 74 NSTALLDIR=c:\pat
00c0: 68 5c 74 6f 5c 74 63 6c 0a 23 20 20 20 6e 6d 61 h\to\tcl.# nma
00d0: 6b 65 20 2f 66 20 6d 61 6b 65 66 69 6c 65 2e 76 ke /f makefile.v
00e0: 63 20 49 4e 53 54 41 4c 4c 44 49 52 3d 63 3a 5c c INSTALLDIR=c:\
00f0: 70 61 74 68 5c 74 6f 5c 74 63 6c 20 74 65 73 74 path\to\tcl test
0100: 0a 23 20 20 20 6e 6d 61 6b 65 20 2f 66 20 6d 61 .# nmake /f ma
0110: 6b 65 66 69 6c 65 2e 76 63 20 49 4e 53 54 41 4c kefile.vc INSTAL
0120: 4c 44 49 52 3d 63 3a 5c 70 61 74 68 5c 74 6f 5c LDIR=c:\path\to\
0130: 74 63 6c 20 69 6e 73 74 61 6c 6c 0a 23 0a 23 20 tcl install.#.#
0140: 46 6f 72 20 6f 74 68 65 72 20 62 75 69 6c 64 20 For other build
0150: 6f 70 74 69 6f 6e 73 20 28 64 65 62 75 67 2c 20 options (debug,
0160: 73 74 61 74 69 63 20 65 74 63 2e 29 2c 0a 23 20 static etc.),.#
0170: 53 65 65 20 54 49 50 20 34 37 37 20 28 68 74 74 See TIP 477 (htt
0180: 70 73 3a 2f 2f 63 6f 72 65 2e 74 63 6c 2d 6c 61 ps://core.tcl-la
0190: 6e 67 2e 6f 72 67 2f 74 69 70 73 2f 64 6f 63 2f ng.org/tips/doc/
01a0: 6d 61 69 6e 2f 74 69 70 2f 34 37 37 2e 6d 64 29 main/tip/477.md)
01b0: 20 66 6f 72 0a 23 20 64 65 74 61 69 6c 65 64 20 for.# detailed
01c0: 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 2e 0a 23 documentation..#
01d0: 0a 23 20 53 65 65 20 74 68 65 20 66 69 6c 65 20 .# See the file
01e0: 22 6c 69 63 65 6e 73 65 2e 74 65 72 6d 73 22 20 "license.terms"
01f0: 66 6f 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 for information
0200: 6f 6e 20 75 73 61 67 65 20 61 6e 64 20 72 65 64 on usage and red
0210: 69 73 74 72 69 62 75 74 69 6f 6e 0a 23 20 6f 66 istribution.# of
0220: 20 74 68 69 73 20 66 69 6c 65 2c 20 61 6e 64 20 this file, and
0230: 66 6f 72 20 61 20 44 49 53 43 4c 41 49 4d 45 52 for a DISCLAIMER
0240: 20 4f 46 20 41 4c 4c 20 57 41 52 52 41 4e 54 49 OF ALL WARRANTI
0250: 45 53 2e 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d ES..#.#---------
0260: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0270: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0280: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0290: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
02a0: 2d 2d 2d 2d 2d 0a 0a 23 20 54 68 65 20 6e 61 6d -----..# The nam
02b0: 65 20 6f 66 20 74 68 65 20 70 61 63 6b 61 67 65 e of the package
02c0: 0a 50 52 4f 4a 45 43 54 3d 74 6c 73 0a 0a 21 69 .PROJECT=tls..!i
02d0: 6e 63 6c 75 64 65 20 22 72 75 6c 65 73 2d 65 78 nclude "rules-ex
02e0: 74 2e 76 63 22 0a 0a 23 20 44 65 66 69 6e 65 20 t.vc"..# Define
02f0: 74 68 65 20 6f 62 6a 65 63 74 20 66 69 6c 65 73 the object files
0300: 20 61 6e 64 20 72 65 73 6f 75 72 63 65 20 66 69 and resource fi
0310: 6c 65 20 74 68 61 74 20 6d 61 6b 65 20 75 70 20 le that make up
0320: 74 68 65 20 65 78 74 65 6e 73 69 6f 6e 2e 0a 23 the extension..#
0330: 20 4e 6f 74 65 20 74 68 65 20 72 65 73 6f 75 72 Note the resour
0340: 63 65 20 66 69 6c 65 20 64 6f 65 73 20 6e 6f 74 ce file does not
0350: 20 6d 61 6b 65 73 20 73 65 6e 73 65 20 69 66 20 makes sense if
0360: 64 6f 69 6e 67 20 61 20 73 74 61 74 69 63 20 6c doing a static l
0370: 69 62 72 61 72 79 20 62 75 69 6c 64 0a 23 20 68 ibrary build.# h
0380: 65 6e 63 65 20 69 74 20 69 73 20 75 6e 64 65 72 ence it is under
0390: 20 74 68 61 74 20 63 6f 6e 64 69 74 69 6f 6e 2e that condition.
03a0: 20 54 4d 50 5f 44 49 52 20 69 73 20 74 68 65 20 TMP_DIR is the
03b0: 6f 75 74 70 75 74 20 64 69 72 65 63 74 6f 72 79 output directory
03c0: 0a 23 20 64 65 66 69 6e 65 64 20 62 79 20 72 75 .# defined by ru
03d0: 6c 65 73 20 66 6f 72 20 6f 62 6a 65 63 74 20 66 les for object f
03e0: 69 6c 65 73 2e 0a 50 52 4a 5f 4f 42 4a 53 20 3d iles..PRJ_OBJS =
03f0: 20 24 28 54 4d 50 5f 44 49 52 29 5c 74 6c 73 2e $(TMP_DIR)\tls.
0400: 6f 62 6a 20 5c 0a 09 24 28 54 4d 50 5f 44 49 52 obj \..$(TMP_DIR
0410: 29 5c 74 6c 73 42 49 4f 2e 6f 62 6a 20 5c 0a 09 )\tlsBIO.obj \..
0420: 24 28 54 4d 50 5f 44 49 52 29 5c 74 6c 73 49 4f $(TMP_DIR)\tlsIO
0430: 2e 6f 62 6a 20 5c 0a 09 24 28 54 4d 50 5f 44 49 .obj \..$(TMP_DI
0440: 52 29 5c 74 6c 73 58 35 30 39 2e 6f 62 6a 0a 0a R)\tlsX509.obj..
0450: 23 20 44 65 66 69 6e 65 20 61 6e 79 20 61 64 64 # Define any add
0460: 69 74 69 6f 6e 61 6c 20 70 72 6f 6a 65 63 74 20 itional project
0470: 69 6e 63 6c 75 64 65 20 66 6c 61 67 73 0a 23 20 include flags.#
0480: 53 53 4c 5f 49 4e 53 54 41 4c 4c 5f 46 4f 4c 44 SSL_INSTALL_FOLD
0490: 45 52 20 3d 20 77 69 74 68 20 74 68 65 20 4f 70 ER = with the Op
04a0: 65 6e 53 53 4c 20 69 6e 73 74 61 6c 6c 61 74 69 enSSL installati
04b0: 6f 6e 20 66 6f 6c 64 65 72 20 66 6f 6c 6c 6f 77 on folder follow
04c0: 69 6e 67 2e 0a 50 52 4a 5f 49 4e 43 4c 55 44 45 ing..PRJ_INCLUDE
04d0: 53 20 3d 20 2d 49 22 24 28 53 53 4c 5f 49 4e 53 S = -I"$(SSL_INS
04e0: 54 41 4c 4c 5f 46 4f 4c 44 45 52 29 5c 69 6e 63 TALL_FOLDER)\inc
04f0: 6c 75 64 65 22 20 2d 49 22 24 28 4f 50 45 4e 53 lude" -I"$(OPENS
0500: 53 4c 5f 49 4e 53 54 41 4c 4c 5f 44 49 52 29 5c SL_INSTALL_DIR)\
0510: 69 6e 63 6c 75 64 65 22 0a 0a 23 20 44 65 66 69 include"..# Defi
0520: 6e 65 20 61 6e 79 20 61 64 64 69 74 69 6f 6e 61 ne any additiona
0530: 6c 20 63 6f 6d 70 69 6c 65 72 20 66 6c 61 67 73 l compiler flags
0540: 20 74 68 61 74 20 6d 69 67 68 74 20 62 65 20 72 that might be r
0550: 65 71 75 69 72 65 64 20 66 6f 72 20 74 68 65 20 equired for the
0560: 70 72 6f 6a 65 63 74 0a 50 52 4a 5f 44 45 46 49 project.PRJ_DEFI
0570: 4e 45 53 20 3d 20 2d 44 20 4e 4f 5f 53 53 4c 32 NES = -D NO_SSL2
0580: 20 2d 44 20 4e 4f 5f 53 53 4c 33 20 2d 44 20 5f -D NO_SSL3 -D _
0590: 43 52 54 5f 53 45 43 55 52 45 5f 4e 4f 5f 57 41 CRT_SECURE_NO_WA
05a0: 52 4e 49 4e 47 53 0a 20 0a 23 20 53 53 4c 20 4c RNINGS. .# SSL L
05b0: 69 62 73 3a 0a 23 20 20 20 20 31 2e 20 24 7b 4c ibs:.# 1. ${L
05c0: 49 42 43 52 59 50 54 4f 7d 2e 64 6c 6c 0a 23 20 IBCRYPTO}.dll.#
05d0: 20 20 20 32 2e 20 24 7b 4c 49 42 53 53 4c 7d 2e 2. ${LIBSSL}.
05e0: 64 6c 6c 0a 23 20 57 68 65 72 65 20 4c 49 42 43 dll.# Where LIBC
05f0: 52 59 50 54 4f 20 28 23 31 2e 29 20 61 6e 64 20 RYPTO (#1.) and
0600: 4c 49 42 53 53 4c 20 28 23 32 2e 29 20 61 72 65 LIBSSL (#2.) are
0610: 20 64 65 66 69 6e 65 64 20 61 73 20 66 6f 6c 6c defined as foll
0620: 6f 77 73 3a 0a 23 20 20 20 20 76 31 2e 31 3a 20 ows:.# v1.1:
0630: 6c 69 62 63 72 79 70 74 6f 2d 31 2e 31 2d 78 36 libcrypto-1.1-x6
0640: 34 2e 64 6c 6c 20 61 6e 64 20 6c 69 62 73 73 6c 4.dll and libssl
0650: 2d 31 2e 31 2d 78 36 34 2e 64 6c 6c 0a 23 20 20 -1.1-x64.dll.#
0660: 20 20 76 33 3a 20 6c 69 62 63 72 79 70 74 6f 2d v3: libcrypto-
0670: 33 2d 78 36 34 2e 64 6c 6c 20 61 6e 64 20 6c 69 3-x64.dll and li
0680: 62 73 73 6c 2d 33 2d 78 36 34 2e 64 6c 6c 0a 23 bssl-3-x64.dll.#
0690: 20 4f 6e 20 2a 6e 69 78 20 6c 69 62 63 72 79 70 On *nix libcryp
06a0: 74 6f 2e 73 6f 2e 2a 20 61 6e 64 20 6c 69 62 73 to.so.* and libs
06b0: 73 6c 2e 73 6f 2e 2a 20 28 77 68 65 72 65 20 73 sl.so.* (where s
06c0: 75 66 66 69 78 20 69 73 20 61 20 76 65 72 73 69 uffix is a versi
06d0: 6f 6e 20 69 6e 64 69 63 61 74 6f 72 29 2e 0a 23 on indicator)..#
06e0: 0a 50 52 4a 5f 4c 49 42 53 20 3d 20 5c 0a 09 22 .PRJ_LIBS = \.."
06f0: 24 28 53 53 4c 5f 49 4e 53 54 41 4c 4c 5f 46 4f $(SSL_INSTALL_FO
0700: 4c 44 45 52 29 5c 6c 69 62 5c 6c 69 62 73 73 6c LDER)\lib\libssl
0710: 2e 6c 69 62 22 20 5c 0a 09 22 24 28 53 53 4c 5f .lib" \.."$(SSL_
0720: 49 4e 53 54 41 4c 4c 5f 46 4f 4c 44 45 52 29 5c INSTALL_FOLDER)\
0730: 6c 69 62 5c 6c 69 62 63 72 79 70 74 6f 2e 6c 69 lib\libcrypto.li
0740: 62 22 20 5c 0a 09 57 53 32 5f 33 32 2e 4c 49 42 b" \..WS2_32.LIB
0750: 20 47 44 49 33 32 2e 4c 49 42 20 41 44 56 41 50 GDI32.LIB ADVAP
0760: 49 33 32 2e 4c 49 42 20 43 52 59 50 54 33 32 2e I32.LIB CRYPT32.
0770: 4c 49 42 20 55 53 45 52 33 32 2e 4c 49 42 0a 0a LIB USER32.LIB..
0780: 23 20 44 65 66 69 6e 65 20 74 68 65 20 73 74 61 # Define the sta
0790: 6e 64 61 72 64 20 74 61 72 67 65 74 73 0a 21 69 ndard targets.!i
07a0: 6e 63 6c 75 64 65 20 22 74 61 72 67 65 74 73 2e nclude "targets.
07b0: 76 63 22 0a 0a 23 20 50 72 6f 6a 65 63 74 20 73 vc"..# Project s
07c0: 70 65 63 69 66 69 63 20 74 61 72 67 65 74 73 0a pecific targets.
07d0: 0a 61 6c 6c 3a 20 64 65 66 61 75 6c 74 2d 74 61 .all: default-ta
07e0: 72 67 65 74 0a 0a 63 6c 65 61 6e 3a 20 64 65 66 rget..clean: def
07f0: 61 75 6c 74 2d 63 6c 65 61 6e 0a 0a 72 65 61 6c ault-clean..real
0800: 63 6c 65 61 6e 3a 20 64 65 66 61 75 6c 74 2d 68 clean: default-h
0810: 6f 73 65 0a 0a 23 20 57 65 20 6d 75 73 74 20 64 ose..# We must d
0820: 65 66 69 6e 65 20 61 20 70 6b 67 69 6e 64 65 78 efine a pkgindex
0830: 20 74 61 72 67 65 74 20 74 68 61 74 20 77 69 6c target that wil
0840: 6c 20 63 72 65 61 74 65 20 61 20 70 6b 67 49 6e l create a pkgIn
0850: 64 65 78 2e 74 63 6c 0a 23 20 66 69 6c 65 20 69 dex.tcl.# file i
0860: 6e 20 74 68 65 20 24 28 4f 55 54 5f 44 49 52 29 n the $(OUT_DIR)
0870: 20 64 69 72 65 63 74 6f 72 79 2e 20 57 65 20 63 directory. We c
0880: 61 6e 20 6a 75 73 74 20 72 65 64 69 72 65 63 74 an just redirect
0890: 20 74 6f 20 74 68 65 0a 23 20 64 65 66 61 75 6c to the.# defaul
08a0: 74 2d 70 6b 67 69 6e 64 65 78 20 74 61 72 67 65 t-pkgindex targe
08b0: 74 20 66 6f 72 20 6f 75 72 20 73 61 6d 70 6c 65 t for our sample
08c0: 20 65 78 74 65 6e 73 69 6f 6e 2e 0a 70 6b 67 69 extension..pkgi
08d0: 6e 64 65 78 3a 20 64 65 66 61 75 6c 74 2d 70 6b ndex: default-pk
08e0: 67 69 6e 64 65 78 2d 74 65 61 0a 0a 23 20 54 68 gindex-tea..# Th
08f0: 65 20 64 65 66 61 75 6c 74 20 69 6e 73 74 61 6c e default instal
0900: 6c 20 74 61 72 67 65 74 20 6f 6e 6c 79 20 69 6e l target only in
0910: 73 74 61 6c 6c 73 20 62 69 6e 61 72 69 65 73 20 stalls binaries
0920: 61 6e 64 20 73 63 72 69 70 74 73 20 73 6f 20 61 and scripts so a
0930: 64 64 0a 23 20 61 6e 20 61 64 64 69 74 69 6f 6e dd.# an addition
0940: 61 6c 20 74 61 72 67 65 74 20 66 6f 72 20 6f 75 al target for ou
0950: 72 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 2e r documentation.
0960: 20 4e 6f 74 65 20 74 68 69 73 20 2a 61 64 64 73 Note this *adds
0970: 2a 20 61 20 74 61 72 67 65 74 0a 23 20 73 69 6e * a target.# sin
0980: 63 65 20 6e 6f 20 63 6f 6d 6d 61 6e 64 73 20 61 ce no commands a
0990: 72 65 20 6c 69 73 74 65 64 20 61 66 74 65 72 20 re listed after
09a0: 69 74 2e 20 54 68 65 20 6f 72 69 67 69 6e 61 6c it. The original
09b0: 20 74 61 72 67 65 74 73 20 66 6f 72 0a 23 20 69 targets for.# i
09c0: 6e 73 74 61 6c 6c 20 28 66 72 6f 6d 20 74 61 72 nstall (from tar
09d0: 67 65 74 73 2e 76 63 29 20 77 69 6c 6c 20 72 65 gets.vc) will re
09e0: 6d 61 69 6e 2e 0a 69 6e 73 74 61 6c 6c 3a 20 64 main..install: d
09f0: 65 66 61 75 6c 74 2d 70 6b 67 69 6e 64 65 78 2d efault-pkgindex-
0a00: 74 65 61 20 64 65 66 61 75 6c 74 2d 69 6e 73 74 tea default-inst
0a10: 61 6c 6c 20 64 65 66 61 75 6c 74 2d 69 6e 73 74 all default-inst
0a20: 61 6c 6c 2d 64 6f 63 73 2d 68 74 6d 6c 0a 20 20 all-docs-html.
0a30: 20 20 69 66 20 65 78 69 73 74 20 22 24 28 53 53 if exist "$(SS
0a40: 4c 5f 49 4e 53 54 41 4c 4c 5f 46 4f 4c 44 45 52 L_INSTALL_FOLDER
0a50: 29 5c 62 69 6e 5c 6c 69 62 63 72 79 70 74 6f 2d )\bin\libcrypto-
0a60: 2a 2d 78 36 34 2e 64 6c 6c 22 20 28 0a 20 20 20 *-x64.dll" (.
0a70: 20 20 20 20 20 78 63 6f 70 79 20 2f 63 20 2f 79 xcopy /c /y
0a80: 20 22 24 28 53 53 4c 5f 49 4e 53 54 41 4c 4c 5f "$(SSL_INSTALL_
0a90: 46 4f 4c 44 45 52 29 5c 62 69 6e 5c 6c 69 62 63 FOLDER)\bin\libc
0aa0: 72 79 70 74 6f 2d 2a 2d 78 36 34 2e 64 6c 6c 22 rypto-*-x64.dll"
0ab0: 20 22 24 28 50 52 4a 5f 49 4e 53 54 41 4c 4c 5f "$(PRJ_INSTALL_
0ac0: 44 49 52 29 22 0a 20 20 20 20 29 0a 20 20 20 20 DIR)". ).
0ad0: 69 66 20 65 78 69 73 74 20 22 24 28 53 53 4c 5f if exist "$(SSL_
0ae0: 49 4e 53 54 41 4c 4c 5f 46 4f 4c 44 45 52 29 5c INSTALL_FOLDER)\
0af0: 62 69 6e 5c 6c 69 62 73 73 6c 2d 2a 2d 78 36 34 bin\libssl-*-x64
0b00: 2e 64 6c 6c 22 20 28 0a 20 20 20 20 20 20 20 20 .dll" (.
0b10: 78 63 6f 70 79 20 2f 63 20 2f 79 20 22 24 28 53 xcopy /c /y "$(S
0b20: 53 4c 5f 49 4e 53 54 41 4c 4c 5f 46 4f 4c 44 45 SL_INSTALL_FOLDE
0b30: 52 29 5c 62 69 6e 5c 6c 69 62 73 73 6c 2d 2a 2d R)\bin\libssl-*-
0b40: 78 36 34 2e 64 6c 6c 22 20 22 24 28 50 52 4a 5f x64.dll" "$(PRJ_
0b50: 49 4e 53 54 41 4c 4c 5f 44 49 52 29 22 0a 20 20 INSTALL_DIR)".
0b60: 20 20 29 0a 0a 23 20 54 65 73 74 20 70 61 63 6b )..# Test pack
0b70: 61 67 65 0a 74 65 73 74 3a 20 64 65 66 61 75 6c age.test: defaul
0b80: 74 2d 74 65 73 74 0a t-test.