0000: 23 0a 23 20 49 6e 63 6c 75 64 65 20 74 68 65 20 #.# Include the
0010: 54 45 41 20 73 74 61 6e 64 61 72 64 20 6d 61 63 TEA standard mac
0020: 72 6f 20 73 65 74 0a 23 0a 0a 62 75 69 6c 74 69 ro set.#..builti
0030: 6e 28 69 6e 63 6c 75 64 65 2c 74 63 6c 63 6f 6e n(include,tclcon
0040: 66 69 67 2f 74 63 6c 2e 6d 34 29 0a 0a 23 0a 23 fig/tcl.m4)..#.#
0050: 20 41 64 64 20 68 65 72 65 20 77 68 61 74 65 76 Add here whatev
0060: 65 72 20 6d 34 20 6d 61 63 72 6f 73 20 79 6f 75 er m4 macros you
0070: 20 77 61 6e 74 20 74 6f 20 64 65 66 69 6e 65 20 want to define
0080: 66 6f 72 20 79 6f 75 72 20 70 61 63 6b 61 67 65 for your package
0090: 0a 23 0a 0a 41 43 5f 44 45 46 55 4e 28 5b 54 43 .#..AC_DEFUN([TC
00a0: 4c 54 4c 53 5f 53 53 4c 5f 4f 50 45 4e 53 53 4c LTLS_SSL_OPENSSL
00b0: 5d 2c 20 5b 0a 09 41 43 5f 43 48 45 43 4b 5f 54 ], [..AC_CHECK_T
00c0: 4f 4f 4c 28 5b 50 4b 47 5f 43 4f 4e 46 49 47 5d OOL([PKG_CONFIG]
00d0: 2c 20 5b 70 6b 67 2d 63 6f 6e 66 69 67 5d 2c 20 , [pkg-config],
00e0: 5b 66 61 6c 73 65 5d 29 0a 0a 09 64 6e 6c 20 44 [false])...dnl D
00f0: 69 73 61 62 6c 65 20 73 75 70 70 6f 72 74 20 66 isable support f
0100: 6f 72 20 54 4c 53 20 31 2e 30 20 70 72 6f 74 6f or TLS 1.0 proto
0110: 63 6f 6c 0a 09 41 43 5f 41 52 47 5f 45 4e 41 42 col..AC_ARG_ENAB
0120: 4c 45 28 5b 74 6c 73 31 5d 2c 20 41 53 5f 48 45 LE([tls1], AS_HE
0130: 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 64 69 73 LP_STRING([--dis
0140: 61 62 6c 65 2d 74 6c 73 31 5d 2c 20 5b 64 69 73 able-tls1], [dis
0150: 61 62 6c 65 20 54 4c 53 31 20 70 72 6f 74 6f 63 able TLS1 protoc
0160: 6f 6c 5d 29 2c 20 5b 0a 09 09 69 66 20 74 65 73 ol]), [...if tes
0170: 74 20 22 24 7b 65 6e 61 62 6c 65 76 61 6c 7d 22 t "${enableval}"
0180: 20 3d 20 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 09 = "no"; then...
0190: 09 41 43 5f 44 45 46 49 4e 45 28 5b 4e 4f 5f 54 .AC_DEFINE([NO_T
01a0: 4c 53 31 5d 2c 20 5b 31 5d 2c 20 5b 44 69 73 61 LS1], [1], [Disa
01b0: 62 6c 65 20 54 4c 53 31 20 70 72 6f 74 6f 63 6f ble TLS1 protoco
01c0: 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 43 48 l])....AC_MSG_CH
01d0: 45 43 4b 49 4e 47 28 5b 66 6f 72 20 64 69 73 61 ECKING([for disa
01e0: 62 6c 65 20 54 4c 53 31 20 70 72 6f 74 6f 63 6f ble TLS1 protoco
01f0: 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 52 45 l])....AC_MSG_RE
0200: 53 55 4c 54 28 27 79 65 73 27 29 0a 09 09 66 69 SULT('yes')...fi
0210: 0a 09 5d 29 0a 0a 09 64 6e 6c 20 44 69 73 61 62 ..])...dnl Disab
0220: 6c 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 54 le support for T
0230: 4c 53 20 31 2e 31 20 70 72 6f 74 6f 63 6f 6c 0a LS 1.1 protocol.
0240: 09 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b .AC_ARG_ENABLE([
0250: 74 6c 73 31 5f 31 5d 2c 20 41 53 5f 48 45 4c 50 tls1_1], AS_HELP
0260: 5f 53 54 52 49 4e 47 28 5b 2d 2d 64 69 73 61 62 _STRING([--disab
0270: 6c 65 2d 74 6c 73 31 5f 31 5d 2c 20 5b 64 69 73 le-tls1_1], [dis
0280: 61 62 6c 65 20 54 4c 53 31 2e 31 20 70 72 6f 74 able TLS1.1 prot
0290: 6f 63 6f 6c 5d 29 2c 20 5b 0a 09 09 69 66 20 74 ocol]), [...if t
02a0: 65 73 74 20 22 24 7b 65 6e 61 62 6c 65 76 61 6c est "${enableval
02b0: 7d 22 20 3d 20 22 6e 6f 22 3b 20 74 68 65 6e 0a }" = "no"; then.
02c0: 09 09 09 41 43 5f 44 45 46 49 4e 45 28 5b 4e 4f ...AC_DEFINE([NO
02d0: 5f 54 4c 53 31 5f 31 5d 2c 20 5b 31 5d 2c 20 5b _TLS1_1], [1], [
02e0: 44 69 73 61 62 6c 65 20 54 4c 53 31 2e 31 20 70 Disable TLS1.1 p
02f0: 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 43 5f rotocol])....AC_
0300: 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f MSG_CHECKING([fo
0310: 72 20 64 69 73 61 62 6c 65 20 54 4c 53 31 2e 31 r disable TLS1.1
0320: 20 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 protocol])....A
0330: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 27 79 65 C_MSG_RESULT('ye
0340: 73 27 29 0a 09 09 66 69 0a 09 5d 29 0a 0a 09 64 s')...fi..])...d
0350: 6e 6c 20 44 69 73 61 62 6c 65 20 73 75 70 70 6f nl Disable suppo
0360: 72 74 20 66 6f 72 20 54 4c 53 20 31 2e 32 20 70 rt for TLS 1.2 p
0370: 72 6f 74 6f 63 6f 6c 0a 09 41 43 5f 41 52 47 5f rotocol..AC_ARG_
0380: 45 4e 41 42 4c 45 28 5b 74 6c 73 31 5f 32 5d 2c ENABLE([tls1_2],
0390: 20 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 AS_HELP_STRING(
03a0: 5b 2d 2d 64 69 73 61 62 6c 65 2d 74 6c 73 31 5f [--disable-tls1_
03b0: 32 5d 2c 20 5b 64 69 73 61 62 6c 65 20 54 4c 53 2], [disable TLS
03c0: 31 2e 32 20 70 72 6f 74 6f 63 6f 6c 5d 29 2c 20 1.2 protocol]),
03d0: 5b 0a 09 09 69 66 20 74 65 73 74 20 22 24 7b 65 [...if test "${e
03e0: 6e 61 62 6c 65 76 61 6c 7d 22 20 3d 20 22 6e 6f nableval}" = "no
03f0: 22 3b 20 74 68 65 6e 0a 09 09 09 41 43 5f 44 45 "; then....AC_DE
0400: 46 49 4e 45 28 5b 4e 4f 5f 54 4c 53 31 5f 32 5d FINE([NO_TLS1_2]
0410: 2c 20 5b 31 5d 2c 20 5b 44 69 73 61 62 6c 65 20 , [1], [Disable
0420: 54 4c 53 31 2e 32 20 70 72 6f 74 6f 63 6f 6c 5d TLS1.2 protocol]
0430: 29 0a 09 09 09 41 43 5f 4d 53 47 5f 43 48 45 43 )....AC_MSG_CHEC
0440: 4b 49 4e 47 28 5b 66 6f 72 20 64 69 73 61 62 6c KING([for disabl
0450: 65 20 54 4c 53 31 2e 32 20 70 72 6f 74 6f 63 6f e TLS1.2 protoco
0460: 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 52 45 l])....AC_MSG_RE
0470: 53 55 4c 54 28 27 79 65 73 27 29 0a 09 09 66 69 SULT('yes')...fi
0480: 0a 09 5d 29 0a 0a 09 64 6e 6c 20 44 69 73 61 62 ..])...dnl Disab
0490: 6c 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 54 le support for T
04a0: 4c 53 20 31 2e 33 20 70 72 6f 74 6f 63 6f 6c 0a LS 1.3 protocol.
04b0: 09 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b .AC_ARG_ENABLE([
04c0: 74 6c 73 31 5f 33 5d 2c 20 41 53 5f 48 45 4c 50 tls1_3], AS_HELP
04d0: 5f 53 54 52 49 4e 47 28 5b 2d 2d 64 69 73 61 62 _STRING([--disab
04e0: 6c 65 2d 74 6c 73 31 5f 33 5d 2c 20 5b 64 69 73 le-tls1_3], [dis
04f0: 61 62 6c 65 20 54 4c 53 31 2e 33 20 70 72 6f 74 able TLS1.3 prot
0500: 6f 63 6f 6c 5d 29 2c 20 5b 0a 09 09 69 66 20 74 ocol]), [...if t
0510: 65 73 74 20 22 24 7b 65 6e 61 62 6c 65 76 61 6c est "${enableval
0520: 7d 22 20 3d 20 22 6e 6f 22 3b 20 74 68 65 6e 0a }" = "no"; then.
0530: 09 09 09 41 43 5f 44 45 46 49 4e 45 28 5b 4e 4f ...AC_DEFINE([NO
0540: 5f 54 4c 53 31 5f 33 5d 2c 20 5b 31 5d 2c 20 5b _TLS1_3], [1], [
0550: 44 69 73 61 62 6c 65 20 54 4c 53 31 2e 33 20 70 Disable TLS1.3 p
0560: 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 43 5f rotocol])....AC_
0570: 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f MSG_CHECKING([fo
0580: 72 20 64 69 73 61 62 6c 65 20 54 4c 53 31 2e 33 r disable TLS1.3
0590: 20 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 protocol])....A
05a0: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 27 79 65 C_MSG_RESULT('ye
05b0: 73 27 29 0a 09 09 66 69 0a 09 5d 29 0a 0a 0a 09 s')...fi..])....
05c0: 64 6e 6c 20 45 6e 61 62 6c 65 20 73 75 70 70 6f dnl Enable suppo
05d0: 72 74 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 rt for building
05e0: 74 68 65 20 73 61 6d 65 20 44 69 66 66 69 65 e2 the same Diffieâ
05f0: 80 93 48 65 6c 6c 6d 61 6e 20 70 61 72 61 6d 65 €“Hellman parame
0600: 74 65 72 73 20 65 61 63 68 20 74 69 6d 65 0a 09 ters each time..
0610: 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b 64 AC_ARG_ENABLE([d
0620: 65 74 65 72 6d 69 6e 69 73 74 69 63 5d 2c 20 41 eterministic], A
0630: 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d S_HELP_STRING([-
0640: 2d 65 6e 61 62 6c 65 2d 64 65 74 65 72 6d 69 6e -enable-determin
0650: 69 73 74 69 63 5d 2c 20 5b 65 6e 61 62 6c 65 20 istic], [enable
0660: 64 65 74 65 72 6d 69 6e 69 73 74 69 63 20 44 48 deterministic DH
0670: 20 70 61 72 61 6d 65 74 65 72 73 5d 29 2c 20 5b parameters]), [
0680: 0a 09 09 74 63 6c 74 6c 73 5f 64 65 74 65 72 6d ...tcltls_determ
0690: 69 6e 69 73 74 69 63 3d 22 24 65 6e 61 62 6c 65 inistic="$enable
06a0: 76 61 6c 22 0a 09 5d 2c 20 5b 0a 09 09 74 63 6c val"..], [...tcl
06b0: 74 6c 73 5f 64 65 74 65 72 6d 69 6e 69 73 74 69 tls_deterministi
06c0: 63 3d 27 6e 6f 27 0a 09 5d 29 0a 09 69 66 20 74 c='no'..])..if t
06d0: 65 73 74 20 22 24 74 63 6c 74 6c 73 5f 64 65 74 est "$tcltls_det
06e0: 65 72 6d 69 6e 69 73 74 69 63 22 20 3d 20 27 79 erministic" = 'y
06f0: 65 73 27 3b 20 74 68 65 6e 0a 09 09 47 45 4e 5f es'; then...GEN_
0700: 44 48 5f 50 41 52 41 4d 53 5f 41 52 47 53 3d 27 DH_PARAMS_ARGS='
0710: 66 61 6c 6c 62 61 63 6b 27 0a 09 65 6c 73 65 0a fallback'..else.
0720: 09 09 47 45 4e 5f 44 48 5f 50 41 52 41 4d 53 5f ..GEN_DH_PARAMS_
0730: 41 52 47 53 3d 27 27 0a 09 66 69 0a 0a 09 64 6e ARGS=''..fi...dn
0740: 6c 20 45 6e 61 62 6c 65 20 73 75 70 70 6f 72 74 l Enable support
0750: 20 66 6f 72 20 73 70 65 63 69 66 79 69 6e 67 20 for specifying
0760: 70 72 65 2d 63 6f 6d 70 75 74 65 64 20 44 48 20 pre-computed DH
0770: 70 61 72 61 6d 73 20 73 69 7a 65 0a 09 41 43 5f params size..AC_
0780: 41 52 47 5f 57 49 54 48 28 5b 62 75 69 6c 74 69 ARG_WITH([builti
0790: 6e 2d 64 68 2d 70 61 72 61 6d 73 2d 73 69 7a 65 n-dh-params-size
07a0: 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e ], AS_HELP_STRIN
07b0: 47 28 5b 2d 2d 77 69 74 68 2d 62 75 69 6c 74 69 G([--with-builti
07c0: 6e 2d 64 68 2d 70 61 72 61 6d 73 2d 73 69 7a 65 n-dh-params-size
07d0: 3d 3c 62 69 74 73 3e 5d 2c 0a 09 09 5b 73 70 65 =<bits>],...[spe
07e0: 63 69 66 79 20 74 68 65 20 73 69 7a 65 20 69 6e cify the size in
07f0: 20 62 69 74 73 20 6f 66 20 74 68 65 20 62 75 69 bits of the bui
0800: 6c 74 2d 69 6e 2c 20 70 72 65 63 6f 6d 70 75 74 lt-in, precomput
0810: 65 64 2c 20 44 48 20 70 61 72 61 6d 73 5d 29 2c ed, DH params]),
0820: 20 5b 0a 09 09 41 53 5f 43 41 53 45 28 5b 24 77 [...AS_CASE([$w
0830: 69 74 68 76 61 6c 5d 2c 5b 32 30 34 38 7c 34 30 ithval],[2048|40
0840: 39 36 7c 38 31 39 32 5d 2c 2c 5b 41 43 5f 4d 53 96|8192],,[AC_MS
0850: 47 5f 45 52 52 4f 52 28 5b 55 6e 73 75 70 70 6f G_ERROR([Unsuppo
0860: 72 74 65 64 20 44 48 20 70 61 72 61 6d 73 20 73 rted DH params s
0870: 69 7a 65 3a 20 24 77 69 74 68 76 61 6c 5d 29 5d ize: $withval])]
0880: 29 0a 09 09 47 45 4e 5f 44 48 5f 50 41 52 41 4d )...GEN_DH_PARAM
0890: 53 5f 41 52 47 53 3d 22 24 7b 47 45 4e 5f 44 48 S_ARGS="${GEN_DH
08a0: 5f 50 41 52 41 4d 53 5f 41 52 47 53 7d 20 62 69 _PARAMS_ARGS} bi
08b0: 74 73 3d 24 77 69 74 68 76 61 6c 22 0a 09 5d 29 ts=$withval"..])
08c0: 0a 09 41 43 5f 53 55 42 53 54 28 47 45 4e 5f 44 ..AC_SUBST(GEN_D
08d0: 48 5f 50 41 52 41 4d 53 5f 41 52 47 53 29 0a 09 H_PARAMS_ARGS)..
08e0: 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 AC_MSG_CHECKING(
08f0: 5b 66 6f 72 20 44 48 20 70 61 72 61 6d 73 5d 29 [for DH params])
0900: 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 ..AC_MSG_RESULT(
0910: 5b 24 47 45 4e 5f 44 48 5f 50 41 52 41 4d 53 5f [$GEN_DH_PARAMS_
0920: 41 52 47 53 5d 29 0a 0a 0a 09 64 6e 6c 20 44 65 ARGS])....dnl De
0930: 74 65 72 6d 69 6e 65 20 69 66 20 77 65 20 68 61 termine if we ha
0940: 76 65 20 62 65 65 6e 20 61 73 6b 65 64 20 74 6f ve been asked to
0950: 20 75 73 65 20 61 20 66 61 73 74 20 70 61 74 68 use a fast path
0960: 20 69 66 20 70 6f 73 73 69 62 6c 65 0a 09 41 43 if possible..AC
0970: 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b 73 73 6c _ARG_ENABLE([ssl
0980: 2d 66 61 73 74 70 61 74 68 5d 2c 20 41 53 5f 48 -fastpath], AS_H
0990: 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e ELP_STRING([--en
09a0: 61 62 6c 65 2d 73 73 6c 2d 66 61 73 74 70 61 74 able-ssl-fastpat
09b0: 68 5d 2c 0a 09 09 5b 65 6e 61 62 6c 65 20 75 73 h],...[enable us
09c0: 69 6e 67 20 74 68 65 20 75 6e 64 65 72 6c 79 69 ing the underlyi
09d0: 6e 67 20 66 69 6c 65 20 64 65 73 63 72 69 70 74 ng file descript
09e0: 6f 72 20 66 6f 72 20 74 61 6c 6b 69 6e 67 20 64 or for talking d
09f0: 69 72 65 63 74 6c 79 20 74 6f 20 74 68 65 20 53 irectly to the S
0a00: 53 4c 20 6c 69 62 72 61 72 79 5d 29 2c 20 5b 0a SL library]), [.
0a10: 09 09 74 63 6c 74 6c 73 5f 73 73 6c 5f 66 61 73 ..tcltls_ssl_fas
0a20: 74 70 61 74 68 3d 22 24 65 6e 61 62 6c 65 76 61 tpath="$enableva
0a30: 6c 22 0a 09 5d 2c 20 5b 0a 09 09 74 63 6c 74 6c l"..], [...tcltl
0a40: 73 5f 73 73 6c 5f 66 61 73 74 70 61 74 68 3d 27 s_ssl_fastpath='
0a50: 6e 6f 27 0a 09 5d 29 0a 09 69 66 20 74 65 73 74 no'..])..if test
0a60: 20 22 24 74 63 6c 74 6c 73 5f 73 73 6c 5f 66 61 "$tcltls_ssl_fa
0a70: 73 74 70 61 74 68 22 20 3d 20 27 79 65 73 27 3b stpath" = 'yes';
0a80: 20 74 68 65 6e 0a 09 09 41 43 5f 44 45 46 49 4e then...AC_DEFIN
0a90: 45 28 54 43 4c 54 4c 53 5f 53 53 4c 5f 55 53 45 E(TCLTLS_SSL_USE
0aa0: 5f 46 41 53 54 50 41 54 48 2c 20 5b 31 5d 2c 20 _FASTPATH, [1],
0ab0: 5b 45 6e 61 62 6c 65 20 53 53 4c 20 6c 69 62 72 [Enable SSL libr
0ac0: 61 72 79 20 64 69 72 65 63 74 20 75 73 65 20 6f ary direct use o
0ad0: 66 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 f the underlying
0ae0: 20 66 69 6c 65 20 64 65 73 63 72 69 70 74 6f 72 file descriptor
0af0: 5d 29 0a 09 66 69 0a 09 41 43 5f 4d 53 47 5f 43 ])..fi..AC_MSG_C
0b00: 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 66 61 73 HECKING([for fas
0b10: 74 20 70 61 74 68 5d 29 0a 09 41 43 5f 4d 53 47 t path])..AC_MSG
0b20: 5f 52 45 53 55 4c 54 28 5b 24 74 63 6c 74 6c 73 _RESULT([$tcltls
0b30: 5f 73 73 6c 5f 66 61 73 74 70 61 74 68 5d 29 0a _ssl_fastpath]).
0b40: 0a 0a 09 64 6e 6c 20 45 6e 61 62 6c 65 20 68 61 ...dnl Enable ha
0b50: 72 64 65 6e 69 6e 67 0a 09 41 43 5f 41 52 47 5f rdening..AC_ARG_
0b60: 45 4e 41 42 4c 45 28 5b 68 61 72 64 65 6e 69 6e ENABLE([hardenin
0b70: 67 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 52 49 g], AS_HELP_STRI
0b80: 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 68 61 72 NG([--enable-har
0b90: 64 65 6e 69 6e 67 5d 2c 20 5b 65 6e 61 62 6c 65 dening], [enable
0ba0: 20 68 61 72 64 65 6e 69 6e 67 20 61 74 74 65 6d hardening attem
0bb0: 70 74 73 5d 29 2c 20 5b 0a 09 09 74 63 6c 74 6c pts]), [...tcltl
0bc0: 73 5f 65 6e 61 62 6c 65 5f 68 61 72 64 65 6e 69 s_enable_hardeni
0bd0: 6e 67 3d 22 24 65 6e 61 62 6c 65 76 61 6c 22 0a ng="$enableval".
0be0: 09 5d 2c 20 5b 0a 09 09 74 63 6c 74 6c 73 5f 65 .], [...tcltls_e
0bf0: 6e 61 62 6c 65 5f 68 61 72 64 65 6e 69 6e 67 3d nable_hardening=
0c00: 27 79 65 73 27 0a 09 5d 29 0a 09 69 66 20 74 65 'yes'..])..if te
0c10: 73 74 20 22 24 74 63 6c 74 6c 73 5f 65 6e 61 62 st "$tcltls_enab
0c20: 6c 65 5f 68 61 72 64 65 6e 69 6e 67 22 20 3d 20 le_hardening" =
0c30: 27 79 65 73 27 3b 20 74 68 65 6e 0a 09 09 69 66 'yes'; then...if
0c40: 20 74 65 73 74 20 22 24 47 43 43 22 20 3d 20 27 test "$GCC" = '
0c50: 79 65 73 27 20 2d 6f 20 22 24 43 43 22 20 3d 20 yes' -o "$CC" =
0c60: 27 63 6c 61 6e 67 27 3b 20 74 68 65 6e 0a 09 09 'clang'; then...
0c70: 09 54 45 41 5f 41 44 44 5f 43 46 4c 41 47 53 28 .TEA_ADD_CFLAGS(
0c80: 5b 2d 66 73 74 61 63 6b 2d 70 72 6f 74 65 63 74 [-fstack-protect
0c90: 6f 72 2d 61 6c 6c 5d 29 0a 09 09 09 54 45 41 5f or-all])....TEA_
0ca0: 41 44 44 5f 43 46 4c 41 47 53 28 5b 2d 66 6e 6f ADD_CFLAGS([-fno
0cb0: 2d 73 74 72 69 63 74 2d 6f 76 65 72 66 6c 6f 77 -strict-overflow
0cc0: 5d 29 0a 09 09 09 41 43 5f 44 45 46 49 4e 45 28 ])....AC_DEFINE(
0cd0: 5b 5f 46 4f 52 54 49 46 59 5f 53 4f 55 52 43 45 [_FORTIFY_SOURCE
0ce0: 5d 2c 20 5b 32 5d 2c 20 5b 45 6e 61 62 6c 65 20 ], [2], [Enable
0cf0: 66 6f 72 74 69 66 69 63 61 74 69 6f 6e 5d 29 0a fortification]).
0d00: 09 09 66 69 0a 09 66 69 0a 09 41 43 5f 4d 53 47 ..fi..fi..AC_MSG
0d10: 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 65 _CHECKING([for e
0d20: 6e 61 62 6c 65 20 68 61 72 64 65 6e 69 6e 67 5d nable hardening]
0d30: 29 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 )..AC_MSG_RESULT
0d40: 28 5b 24 74 63 6c 74 6c 73 5f 65 6e 61 62 6c 65 ([$tcltls_enable
0d50: 5f 68 61 72 64 65 6e 69 6e 67 5d 29 0a 0a 0a 09 _hardening])....
0d60: 64 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 69 66 dnl Determine if
0d70: 20 77 65 20 68 61 76 65 20 62 65 65 6e 20 61 73 we have been as
0d80: 6b 65 64 20 74 6f 20 73 74 61 74 69 63 61 6c 6c ked to staticall
0d90: 79 20 6c 69 6e 6b 20 74 6f 20 74 68 65 20 53 53 y link to the SS
0da0: 4c 20 6c 69 62 72 61 72 79 0a 09 41 43 5f 41 52 L library..AC_AR
0db0: 47 5f 45 4e 41 42 4c 45 28 5b 73 74 61 74 69 63 G_ENABLE([static
0dc0: 2d 73 73 6c 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 -ssl], AS_HELP_S
0dd0: 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d TRING([--enable-
0de0: 73 74 61 74 69 63 2d 73 73 6c 5d 2c 20 5b 65 6e static-ssl], [en
0df0: 61 62 6c 65 20 73 74 61 74 69 63 20 6c 69 6e 6b able static link
0e00: 69 6e 67 20 74 6f 20 74 68 65 20 53 53 4c 20 6c ing to the SSL l
0e10: 69 62 72 61 72 79 5d 29 2c 20 5b 0a 09 09 54 43 ibrary]), [...TC
0e20: 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54 49 43 5f LEXT_TLS_STATIC_
0e30: 53 53 4c 3d 22 24 65 6e 61 62 6c 65 76 61 6c 22 SSL="$enableval"
0e40: 0a 09 5d 2c 20 5b 0a 09 09 54 43 4c 45 58 54 5f ..], [...TCLEXT_
0e50: 54 4c 53 5f 53 54 41 54 49 43 5f 53 53 4c 3d 27 TLS_STATIC_SSL='
0e60: 6e 6f 27 0a 09 5d 29 0a 09 41 43 5f 4d 53 47 5f no'..])..AC_MSG_
0e70: 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 73 74 CHECKING([for st
0e80: 61 74 69 63 20 6c 69 6e 6b 69 6e 67 20 6f 66 20 atic linking of
0e90: 6f 70 65 6e 53 53 4c 20 6c 69 62 72 61 72 69 65 openSSL librarie
0ea0: 73 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 s])..AC_MSG_RESU
0eb0: 4c 54 28 5b 24 54 43 4c 45 58 54 5f 54 4c 53 5f LT([$TCLEXT_TLS_
0ec0: 53 54 41 54 49 43 5f 53 53 4c 5d 29 0a 0a 09 23 STATIC_SSL])...#
0ed0: 20 53 74 61 74 69 63 20 6c 69 62 0a 09 70 6b 67 Static lib..pkg
0ee0: 43 6f 6e 66 69 67 45 78 74 72 61 41 72 67 73 3d ConfigExtraArgs=
0ef0: 27 27 0a 09 69 66 20 74 65 73 74 20 22 24 7b 53 ''..if test "${S
0f00: 48 41 52 45 44 5f 42 55 49 4c 44 7d 22 20 3d 3d HARED_BUILD}" ==
0f10: 20 30 20 2d 6f 20 22 24 54 43 4c 45 58 54 5f 54 0 -o "$TCLEXT_T
0f20: 4c 53 5f 53 54 41 54 49 43 5f 53 53 4c 22 20 3d LS_STATIC_SSL" =
0f30: 20 27 79 65 73 27 3b 20 74 68 65 6e 0a 09 09 70 'yes'; then...p
0f40: 6b 67 43 6f 6e 66 69 67 45 78 74 72 61 41 72 67 kgConfigExtraArg
0f50: 73 3d 27 2d 2d 73 74 61 74 69 63 27 0a 09 66 69 s='--static'..fi
0f60: 0a 0a 0a 09 64 6e 6c 20 47 65 74 20 53 53 4c 20 ....dnl Get SSL
0f70: 70 61 74 68 73 0a 09 41 43 5f 41 52 47 5f 57 49 paths..AC_ARG_WI
0f80: 54 48 28 5b 6f 70 65 6e 73 73 6c 2d 64 69 72 5d TH([openssl-dir]
0f90: 2c 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 49 ,...AS_HELP_STRI
0fa0: 4e 47 28 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 NG([--with-opens
0fb0: 73 6c 2d 64 69 72 3d 3c 64 69 72 3e 5d 2c 0a 09 sl-dir=<dir>],..
0fc0: 09 09 5b 70 61 74 68 20 74 6f 20 72 6f 6f 74 20 ..[path to root
0fd0: 64 69 72 65 63 74 6f 72 79 20 6f 66 20 4f 70 65 directory of Ope
0fe0: 6e 53 53 4c 20 6f 72 20 4c 69 62 72 65 53 53 4c nSSL or LibreSSL
0ff0: 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 5d 0a 09 installation]..
1000: 09 29 2c 20 5b 0a 09 09 09 6f 70 65 6e 73 73 6c .), [....openssl
1010: 64 69 72 3d 22 24 77 69 74 68 76 61 6c 22 0a 09 dir="$withval"..
1020: 09 5d 2c 20 5b 0a 09 09 09 6f 70 65 6e 73 73 6c .], [....openssl
1030: 64 69 72 3d 27 27 0a 09 09 5d 0a 09 29 0a 0a 09 dir=''...]..)...
1040: 64 6e 6c 20 47 65 74 20 53 53 4c 20 69 6e 63 6c dnl Get SSL incl
1050: 75 64 65 20 66 69 6c 65 73 20 70 61 74 68 0a 09 ude files path..
1060: 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 6f 70 65 AC_ARG_WITH([ope
1070: 6e 73 73 6c 2d 69 6e 63 6c 75 64 65 64 69 72 5d nssl-includedir]
1080: 2c 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 49 ,...AS_HELP_STRI
1090: 4e 47 28 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 NG([--with-opens
10a0: 73 6c 2d 69 6e 63 6c 75 64 65 64 69 72 3d 3c 64 sl-includedir=<d
10b0: 69 72 3e 5d 2c 0a 09 09 09 5b 70 61 74 68 20 74 ir>],....[path t
10c0: 6f 20 69 6e 63 6c 75 64 65 20 64 69 72 65 63 74 o include direct
10d0: 6f 72 79 20 6f 66 20 4f 70 65 6e 53 53 4c 20 6f ory of OpenSSL o
10e0: 72 20 4c 69 62 72 65 53 53 4c 20 69 6e 73 74 61 r LibreSSL insta
10f0: 6c 6c 61 74 69 6f 6e 5d 0a 09 09 29 2c 20 5b 0a llation]...), [.
1100: 09 09 09 6f 70 65 6e 73 73 6c 69 6e 63 6c 75 64 ...opensslinclud
1110: 65 64 69 72 3d 22 24 77 69 74 68 76 61 6c 22 0a edir="$withval".
1120: 09 09 5d 2c 20 5b 0a 09 09 09 69 66 20 74 65 73 ..], [....if tes
1130: 74 20 2d 6e 20 22 24 6f 70 65 6e 73 73 6c 64 69 t -n "$openssldi
1140: 72 22 3b 20 74 68 65 6e 0a 09 09 09 09 6f 70 65 r"; then.....ope
1150: 6e 73 73 6c 69 6e 63 6c 75 64 65 64 69 72 3d 22 nsslincludedir="
1160: 24 6f 70 65 6e 73 73 6c 64 69 72 2f 69 6e 63 6c $openssldir/incl
1170: 75 64 65 2f 6f 70 65 6e 73 73 6c 22 0a 09 09 09 ude/openssl"....
1180: 65 6c 73 65 0a 09 09 09 09 6f 70 65 6e 73 73 6c else.....openssl
1190: 69 6e 63 6c 75 64 65 64 69 72 3d 27 27 0a 09 09 includedir=''...
11a0: 09 66 69 0a 09 09 5d 0a 09 29 0a 09 41 43 5f 4d .fi...]..)..AC_M
11b0: 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 SG_CHECKING([for
11c0: 20 4f 70 65 6e 53 53 4c 20 69 6e 63 6c 75 64 65 OpenSSL include
11d0: 20 64 69 72 65 63 74 6f 72 79 5d 29 0a 09 41 43 directory])..AC
11e0: 5f 4d 53 47 5f 52 45 53 55 4c 54 28 24 6f 70 65 _MSG_RESULT($ope
11f0: 6e 73 73 6c 69 6e 63 6c 75 64 65 64 69 72 29 0a nsslincludedir).
1200: 0a 09 64 6e 6c 20 47 65 74 20 53 53 4c 20 6c 69 ..dnl Get SSL li
1210: 62 20 66 69 6c 65 73 20 70 61 74 68 0a 09 69 66 b files path..if
1220: 20 74 65 73 74 20 2d 6e 20 22 24 6f 70 65 6e 73 test -n "$opens
1230: 73 6c 69 6e 63 6c 75 64 65 64 69 72 22 3b 20 74 slincludedir"; t
1240: 68 65 6e 0a 09 09 69 66 20 74 65 73 74 20 2d 66 hen...if test -f
1250: 20 22 24 6f 70 65 6e 73 73 6c 69 6e 63 6c 75 64 "$opensslinclud
1260: 65 64 69 72 2f 73 73 6c 2e 68 22 3b 20 74 68 65 edir/ssl.h"; the
1270: 6e 0a 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f n....TCLTLS_SSL_
1280: 43 46 4c 41 47 53 3d 22 2d 49 24 6f 70 65 6e 73 CFLAGS="-I$opens
1290: 73 6c 69 6e 63 6c 75 64 65 64 69 72 22 0a 09 09 slincludedir"...
12a0: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e 43 4c .TCLTLS_SSL_INCL
12b0: 55 44 45 53 3d 22 2d 49 24 6f 70 65 6e 73 73 6c UDES="-I$openssl
12c0: 69 6e 63 6c 75 64 65 64 69 72 22 0a 09 09 65 6c includedir"...el
12d0: 73 65 0a 09 09 09 41 43 5f 4d 53 47 5f 45 52 52 se....AC_MSG_ERR
12e0: 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 6c 6f OR([Unable to lo
12f0: 63 61 74 65 20 73 73 6c 2e 68 5d 29 0a 09 09 66 cate ssl.h])...f
1300: 69 0a 09 66 69 0a 0a 09 41 43 5f 41 52 47 5f 57 i..fi...AC_ARG_W
1310: 49 54 48 28 5b 6f 70 65 6e 73 73 6c 2d 6c 69 62 ITH([openssl-lib
1320: 64 69 72 5d 2c 0a 09 09 41 53 5f 48 45 4c 50 5f dir],...AS_HELP_
1330: 53 54 52 49 4e 47 28 5b 2d 2d 77 69 74 68 2d 6f STRING([--with-o
1340: 70 65 6e 73 73 6c 2d 6c 69 62 64 69 72 3d 3c 64 penssl-libdir=<d
1350: 69 72 3e 5d 2c 0a 09 09 09 5b 70 61 74 68 20 74 ir>],....[path t
1360: 6f 20 6c 69 62 20 64 69 72 65 63 74 6f 72 79 20 o lib directory
1370: 6f 66 20 4f 70 65 6e 53 53 4c 20 6f 72 20 4c 69 of OpenSSL or Li
1380: 62 72 65 53 53 4c 20 69 6e 73 74 61 6c 6c 61 74 breSSL installat
1390: 69 6f 6e 5d 0a 09 09 29 2c 20 5b 0a 09 09 09 6f ion]...), [....o
13a0: 70 65 6e 73 73 6c 6c 69 62 64 69 72 3d 22 24 77 penssllibdir="$w
13b0: 69 74 68 76 61 6c 22 0a 09 09 5d 2c 20 5b 0a 09 ithval"...], [..
13c0: 09 09 69 66 20 74 65 73 74 20 2d 6e 20 22 24 6f ..if test -n "$o
13d0: 70 65 6e 73 73 6c 64 69 72 22 3b 20 74 68 65 6e penssldir"; then
13e0: 0a 09 09 09 09 69 66 20 74 65 73 74 20 22 24 64 .....if test "$d
13f0: 6f 36 34 62 69 74 22 20 3d 3d 20 27 79 65 73 27 o64bit" == 'yes'
1400: 3b 20 74 68 65 6e 0a 09 09 09 09 09 6f 70 65 6e ; then......open
1410: 73 73 6c 6c 69 62 64 69 72 3d 22 24 6f 70 65 6e ssllibdir="$open
1420: 73 73 6c 64 69 72 2f 6c 69 62 36 34 22 0a 09 09 ssldir/lib64"...
1430: 09 09 65 6c 73 65 0a 09 09 09 09 09 6f 70 65 6e ..else......open
1440: 73 73 6c 6c 69 62 64 69 72 3d 22 24 6f 70 65 6e ssllibdir="$open
1450: 73 73 6c 64 69 72 2f 6c 69 62 22 0a 09 09 09 09 ssldir/lib".....
1460: 66 69 0a 09 09 09 65 6c 73 65 0a 09 09 09 09 6f fi....else.....o
1470: 70 65 6e 73 73 6c 6c 69 62 64 69 72 3d 27 27 0a penssllibdir=''.
1480: 09 09 09 66 69 0a 09 09 5d 0a 09 29 0a 09 41 43 ...fi...]..)..AC
1490: 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 _MSG_CHECKING([f
14a0: 6f 72 20 4f 70 65 6e 53 53 4c 20 6c 69 62 20 64 or OpenSSL lib d
14b0: 69 72 65 63 74 6f 72 79 5d 29 0a 09 41 43 5f 4d irectory])..AC_M
14c0: 53 47 5f 52 45 53 55 4c 54 28 24 6f 70 65 6e 73 SG_RESULT($opens
14d0: 73 6c 6c 69 62 64 69 72 29 0a 0a 09 69 66 20 74 sllibdir)...if t
14e0: 65 73 74 20 2d 6e 20 22 24 6f 70 65 6e 73 73 6c est -n "$openssl
14f0: 6c 69 62 64 69 72 22 3b 20 74 68 65 6e 0a 09 09 libdir"; then...
1500: 69 66 20 74 65 73 74 20 2d 66 20 22 24 6f 70 65 if test -f "$ope
1510: 6e 73 73 6c 6c 69 62 64 69 72 2f 6c 69 62 73 73 nssllibdir/libss
1520: 6c 24 7b 53 48 4c 49 42 5f 53 55 46 46 49 58 7d l${SHLIB_SUFFIX}
1530: 22 3b 20 74 68 65 6e 0a 09 09 09 69 66 20 74 65 "; then....if te
1540: 73 74 20 22 24 7b 54 43 4c 45 58 54 5f 54 4c 53 st "${TCLEXT_TLS
1550: 5f 53 54 41 54 49 43 5f 53 53 4c 7d 22 20 3d 3d _STATIC_SSL}" ==
1560: 20 27 6e 6f 27 3b 20 74 68 65 6e 0a 09 09 09 09 'no'; then.....
1570: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d TCLTLS_SSL_LIBS=
1580: 22 2d 4c 24 6f 70 65 6e 73 73 6c 6c 69 62 64 69 "-L$openssllibdi
1590: 72 20 2d 6c 63 72 79 70 74 6f 20 2d 6c 73 73 6c r -lcrypto -lssl
15a0: 22 0a 09 09 09 65 6c 73 65 0a 09 09 09 09 23 20 "....else.....#
15b0: 4c 69 6e 75 78 20 61 6e 64 20 53 6f 6c 61 72 69 Linux and Solari
15c0: 73 0a 09 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c s.....TCLTLS_SSL
15d0: 5f 4c 49 42 53 3d 22 2d 57 6c 2c 2d 42 73 74 61 _LIBS="-Wl,-Bsta
15e0: 74 69 63 20 60 24 50 4b 47 5f 43 4f 4e 46 49 47 tic `$PKG_CONFIG
15f0: 20 2d 2d 73 74 61 74 69 63 20 2d 2d 6c 69 62 73 --static --libs
1600: 20 63 72 79 70 74 6f 20 73 73 6c 60 20 2d 57 6c crypto ssl` -Wl
1610: 2c 2d 42 64 79 6e 61 6d 69 63 22 0a 09 09 09 09 ,-Bdynamic".....
1620: 23 20 48 50 55 58 0a 09 09 09 09 23 20 2d 57 6c # HPUX.....# -Wl
1630: 2c 2d 61 2c 61 72 63 68 69 76 65 20 2e 2e 2e 20 ,-a,archive ...
1640: 2d 57 6c 2c 2d 61 2c 73 68 61 72 65 64 5f 61 72 -Wl,-a,shared_ar
1650: 63 68 69 76 65 0a 09 09 09 66 69 0a 09 09 65 6c chive....fi...el
1660: 73 65 0a 09 09 09 41 43 5f 4d 53 47 5f 45 52 52 se....AC_MSG_ERR
1670: 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 6c 6f OR([Unable to lo
1680: 63 61 74 65 20 6c 69 62 73 73 6c 24 7b 53 48 4c cate libssl${SHL
1690: 49 42 5f 53 55 46 46 49 58 7d 5d 29 0a 09 09 66 IB_SUFFIX}])...f
16a0: 69 0a 09 65 6c 73 65 0a 09 09 54 43 4c 54 4c 53 i..else...TCLTLS
16b0: 5f 53 53 4c 5f 4c 49 42 53 3d 22 2d 6c 63 72 79 _SSL_LIBS="-lcry
16c0: 70 74 6f 20 2d 6c 73 73 6c 22 0a 09 66 69 0a 0a pto -lssl"..fi..
16d0: 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 6f ..AC_ARG_WITH([o
16e0: 70 65 6e 73 73 6c 2d 70 6b 67 63 6f 6e 66 69 67 penssl-pkgconfig
16f0: 5d 2c 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 ],...AS_HELP_STR
1700: 49 4e 47 28 0a 09 09 09 5b 2d 2d 77 69 74 68 2d ING(....[--with-
1710: 6f 70 65 6e 73 73 6c 2d 70 6b 67 63 6f 6e 66 69 openssl-pkgconfi
1720: 67 3d 3c 64 69 72 3e 5d 2c 0a 09 09 09 5b 70 61 g=<dir>],....[pa
1730: 74 68 20 74 6f 20 72 6f 6f 74 20 64 69 72 65 63 th to root direc
1740: 74 6f 72 79 20 6f 66 20 4f 70 65 6e 53 53 4c 20 tory of OpenSSL
1750: 6f 72 20 4c 69 62 72 65 53 53 4c 20 70 6b 67 63 or LibreSSL pkgc
1760: 6f 6e 66 69 67 64 69 72 5d 0a 09 09 29 2c 20 5b onfigdir]...), [
1770: 0a 09 09 09 6f 70 65 6e 73 73 6c 70 6b 67 63 6f ....opensslpkgco
1780: 6e 66 69 67 64 69 72 3d 22 24 77 69 74 68 76 61 nfigdir="$withva
1790: 6c 22 0a 09 09 5d 2c 20 5b 0a 09 09 09 6f 70 65 l"...], [....ope
17a0: 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 69 72 nsslpkgconfigdir
17b0: 3d 27 27 0a 09 09 5d 0a 09 29 0a 09 41 43 5f 4d =''...]..)..AC_M
17c0: 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 SG_CHECKING([for
17d0: 20 4f 70 65 6e 53 53 4c 20 70 6b 67 63 6f 6e 66 OpenSSL pkgconf
17e0: 69 67 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45 53 ig])..AC_MSG_RES
17f0: 55 4c 54 28 24 6f 70 65 6e 73 73 6c 70 6b 67 63 ULT($opensslpkgc
1800: 6f 6e 66 69 67 64 69 72 29 0a 0a 09 64 6e 6c 20 onfigdir)...dnl
1810: 55 73 65 20 70 6b 67 2d 63 6f 6e 66 69 67 20 74 Use pkg-config t
1820: 6f 20 66 69 6e 64 20 74 68 65 20 6c 69 62 72 61 o find the libra
1830: 72 69 65 73 0a 09 64 6e 6c 20 54 65 6d 70 6f 72 ries..dnl Tempor
1840: 61 72 69 6c 79 20 75 70 64 61 74 65 20 50 4b 47 arily update PKG
1850: 5f 43 4f 4e 46 49 47 5f 50 41 54 48 0a 09 50 4b _CONFIG_PATH..PK
1860: 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48 5f 53 41 G_CONFIG_PATH_SA
1870: 56 45 3d 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 47 VE="${PKG_CONFIG
1880: 5f 50 41 54 48 7d 22 0a 09 69 66 20 74 65 73 74 _PATH}"..if test
1890: 20 2d 6e 20 22 24 7b 6f 70 65 6e 73 73 6c 70 6b -n "${opensslpk
18a0: 67 63 6f 6e 66 69 67 64 69 72 7d 22 3b 20 74 68 gconfigdir}"; th
18b0: 65 6e 0a 09 09 69 66 20 21 20 74 65 73 74 20 2d en...if ! test -
18c0: 66 20 22 24 7b 6f 70 65 6e 73 73 6c 70 6b 67 63 f "${opensslpkgc
18d0: 6f 6e 66 69 67 64 69 72 7d 2f 6f 70 65 6e 73 73 onfigdir}/openss
18e0: 6c 2e 70 63 22 3b 20 74 68 65 6e 0a 09 09 09 41 l.pc"; then....A
18f0: 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55 6e 61 C_MSG_ERROR([Una
1900: 62 6c 65 20 74 6f 20 6c 6f 63 61 74 65 20 24 7b ble to locate ${
1910: 6f 70 65 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 opensslpkgconfig
1920: 64 69 72 7d 2f 6f 70 65 6e 73 73 6c 2e 70 63 5d dir}/openssl.pc]
1930: 29 0a 09 09 66 69 0a 0a 09 09 50 4b 47 5f 43 4f )...fi....PKG_CO
1940: 4e 46 49 47 5f 50 41 54 48 3d 22 24 7b 6f 70 65 NFIG_PATH="${ope
1950: 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 69 72 nsslpkgconfigdir
1960: 7d 24 7b 50 41 54 48 5f 53 45 50 41 52 41 54 4f }${PATH_SEPARATO
1970: 52 7d 24 7b 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 R}${PKG_CONFIG_P
1980: 41 54 48 7d 22 0a 09 09 65 78 70 6f 72 74 20 50 ATH}"...export P
1990: 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48 0a 09 KG_CONFIG_PATH..
19a0: 66 69 0a 0a 09 41 43 5f 41 52 47 5f 56 41 52 28 fi...AC_ARG_VAR(
19b0: 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 [TCLTLS_SSL_LIBS
19c0: 5d 2c 20 5b 6c 69 62 72 61 72 69 65 73 20 74 6f ], [libraries to
19d0: 20 70 61 73 73 20 74 6f 20 74 68 65 20 6c 69 6e pass to the lin
19e0: 6b 65 72 20 66 6f 72 20 4f 70 65 6e 53 53 4c 20 ker for OpenSSL
19f0: 6f 72 20 4c 69 62 72 65 53 53 4c 5d 29 0a 09 41 or LibreSSL])..A
1a00: 43 5f 41 52 47 5f 56 41 52 28 5b 54 43 4c 54 4c C_ARG_VAR([TCLTL
1a10: 53 5f 53 53 4c 5f 43 46 4c 41 47 53 5d 2c 20 5b S_SSL_CFLAGS], [
1a20: 43 20 63 6f 6d 70 69 6c 65 72 20 66 6c 61 67 73 C compiler flags
1a30: 20 66 6f 72 20 4f 70 65 6e 53 53 4c 20 6f 72 20 for OpenSSL or
1a40: 4c 69 62 72 65 53 53 4c 5d 29 0a 09 41 43 5f 41 LibreSSL])..AC_A
1a50: 52 47 5f 56 41 52 28 5b 54 43 4c 54 4c 53 5f 53 RG_VAR([TCLTLS_S
1a60: 53 4c 5f 49 4e 43 4c 55 44 45 53 5d 2c 20 5b 43 SL_INCLUDES], [C
1a70: 20 63 6f 6d 70 69 6c 65 72 20 69 6e 63 6c 75 64 compiler includ
1a80: 65 20 70 61 74 68 73 20 66 6f 72 20 4f 70 65 6e e paths for Open
1a90: 53 53 4c 20 6f 72 20 4c 69 62 72 65 53 53 4c 5d SSL or LibreSSL]
1aa0: 29 0a 09 69 66 20 74 65 73 74 20 2d 7a 20 22 24 )..if test -z "$
1ab0: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 22 TCLTLS_SSL_LIBS"
1ac0: 3b 20 74 68 65 6e 0a 09 09 54 43 4c 54 4c 53 5f ; then...TCLTLS_
1ad0: 53 53 4c 5f 4c 49 42 53 3d 22 60 22 24 7b 50 4b SSL_LIBS="`"${PK
1ae0: 47 5f 43 4f 4e 46 49 47 7d 22 20 6f 70 65 6e 73 G_CONFIG}" opens
1af0: 73 6c 20 2d 2d 6c 69 62 73 20 24 70 6b 67 43 6f sl --libs $pkgCo
1b00: 6e 66 69 67 45 78 74 72 61 41 72 67 73 60 22 20 nfigExtraArgs`"
1b10: 7c 7c 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 || AC_MSG_ERROR(
1b20: 5b 55 6e 61 62 6c 65 20 74 6f 20 67 65 74 20 4f [Unable to get O
1b30: 70 65 6e 53 53 4c 20 43 6f 6e 66 69 67 75 72 61 penSSL Configura
1b40: 74 69 6f 6e 5d 29 0a 09 66 69 0a 09 69 66 20 74 tion])..fi..if t
1b50: 65 73 74 20 2d 7a 20 22 24 54 43 4c 54 4c 53 5f est -z "$TCLTLS_
1b60: 53 53 4c 5f 43 46 4c 41 47 53 22 3b 20 74 68 65 SSL_CFLAGS"; the
1b70: 6e 0a 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 n...TCLTLS_SSL_C
1b80: 46 4c 41 47 53 3d 22 60 22 24 7b 50 4b 47 5f 43 FLAGS="`"${PKG_C
1b90: 4f 4e 46 49 47 7d 22 20 6f 70 65 6e 73 73 6c 20 ONFIG}" openssl
1ba0: 2d 2d 63 66 6c 61 67 73 2d 6f 6e 6c 79 2d 6f 74 --cflags-only-ot
1bb0: 68 65 72 20 24 70 6b 67 43 6f 6e 66 69 67 45 78 her $pkgConfigEx
1bc0: 74 72 61 41 72 67 73 60 22 20 7c 7c 20 41 43 5f traArgs`" || AC_
1bd0: 4d 53 47 5f 45 52 52 4f 52 28 5b 55 6e 61 62 6c MSG_ERROR([Unabl
1be0: 65 20 74 6f 20 67 65 74 20 4f 70 65 6e 53 53 4c e to get OpenSSL
1bf0: 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5d 29 Configuration])
1c00: 0a 09 66 69 0a 09 69 66 20 74 65 73 74 20 2d 7a ..fi..if test -z
1c10: 20 22 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e "$TCLTLS_SSL_IN
1c20: 43 4c 55 44 45 53 22 3b 20 74 68 65 6e 0a 09 09 CLUDES"; then...
1c30: 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e 43 4c 55 TCLTLS_SSL_INCLU
1c40: 44 45 53 3d 22 60 22 24 7b 50 4b 47 5f 43 4f 4e DES="`"${PKG_CON
1c50: 46 49 47 7d 22 20 6f 70 65 6e 73 73 6c 20 2d 2d FIG}" openssl --
1c60: 63 66 6c 61 67 73 2d 6f 6e 6c 79 2d 49 20 24 70 cflags-only-I $p
1c70: 6b 67 43 6f 6e 66 69 67 45 78 74 72 61 41 72 67 kgConfigExtraArg
1c80: 73 60 22 20 7c 7c 20 41 43 5f 4d 53 47 5f 45 52 s`" || AC_MSG_ER
1c90: 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 67 ROR([Unable to g
1ca0: 65 74 20 4f 70 65 6e 53 53 4c 20 43 6f 6e 66 69 et OpenSSL Confi
1cb0: 67 75 72 61 74 69 6f 6e 5d 29 0a 09 66 69 0a 09 guration])..fi..
1cc0: 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48 3d PKG_CONFIG_PATH=
1cd0: 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 "${PKG_CONFIG_PA
1ce0: 54 48 5f 53 41 56 45 7d 22 0a 5d 29 0a TH_SAVE}".]).