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 64 6e 6c 20 44 65 74 65 72 6d ], [..dnl Determ
00c0: 69 6e 65 20 69 66 20 70 6b 67 2d 63 6f 6e 66 69 ine if pkg-confi
00d0: 67 20 74 6f 6f 6c 20 69 73 20 61 76 61 69 6c 61 g tool is availa
00e0: 62 6c 65 0a 09 41 43 5f 43 48 45 43 4b 5f 54 4f ble..AC_CHECK_TO
00f0: 4f 4c 28 5b 50 4b 47 5f 43 4f 4e 46 49 47 5d 2c OL([PKG_CONFIG],
0100: 20 5b 70 6b 67 2d 63 6f 6e 66 69 67 5d 29 0a 0a [pkg-config])..
0110: 09 64 6e 6c 20 45 6e 61 62 6c 65 20 73 75 70 70 .dnl Enable supp
0120: 6f 72 74 20 66 6f 72 20 53 53 4c 20 33 2e 30 20 ort for SSL 3.0
0130: 70 72 6f 74 6f 63 6f 6c 0a 09 41 43 5f 41 52 47 protocol..AC_ARG
0140: 5f 45 4e 41 42 4c 45 28 5b 73 73 6c 33 5d 2c 20 _ENABLE([ssl3],
0150: 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b AS_HELP_STRING([
0160: 2d 2d 64 69 73 61 62 6c 65 2d 73 73 6c 33 5d 2c --disable-ssl3],
0170: 20 5b 64 69 73 61 62 6c 65 20 53 53 4c 33 20 70 [disable SSL3 p
0180: 72 6f 74 6f 63 6f 6c 5d 29 2c 20 5b 0a 09 09 69 rotocol]), [...i
0190: 66 20 74 65 73 74 20 22 24 65 6e 61 62 6c 65 76 f test "$enablev
01a0: 61 6c 22 20 3d 3d 20 22 6e 6f 22 3b 20 74 68 65 al" == "no"; the
01b0: 6e 0a 09 09 09 41 43 5f 44 45 46 49 4e 45 28 5b n....AC_DEFINE([
01c0: 4e 4f 5f 53 53 4c 33 5d 2c 20 5b 31 5d 2c 20 5b NO_SSL3], [1], [
01d0: 44 69 73 61 62 6c 65 20 53 53 4c 33 20 70 72 6f Disable SSL3 pro
01e0: 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 tocol])....AC_MS
01f0: 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 G_CHECKING([for
0200: 64 69 73 61 62 6c 65 20 53 53 4c 33 20 70 72 6f disable SSL3 pro
0210: 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 tocol])....AC_MS
0220: 47 5f 52 45 53 55 4c 54 28 5b 79 65 73 5d 29 0a G_RESULT([yes]).
0230: 09 09 66 69 0a 09 5d 2c 20 41 43 5f 44 45 46 49 ..fi..], AC_DEFI
0240: 4e 45 28 5b 4e 4f 5f 53 53 4c 33 5d 2c 20 5b 31 NE([NO_SSL3], [1
0250: 5d 2c 20 5b 44 69 73 61 62 6c 65 20 53 53 4c 33 ], [Disable SSL3
0260: 20 70 72 6f 74 6f 63 6f 6c 5d 29 29 0a 0a 09 64 protocol]))...d
0270: 6e 6c 20 44 69 73 61 62 6c 65 20 73 75 70 70 6f nl Disable suppo
0280: 72 74 20 66 6f 72 20 54 4c 53 20 31 2e 30 20 70 rt for TLS 1.0 p
0290: 72 6f 74 6f 63 6f 6c 0a 09 41 43 5f 41 52 47 5f rotocol..AC_ARG_
02a0: 45 4e 41 42 4c 45 28 5b 74 6c 73 31 5d 2c 20 41 ENABLE([tls1], A
02b0: 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d S_HELP_STRING([-
02c0: 2d 64 69 73 61 62 6c 65 2d 74 6c 73 31 5d 2c 20 -disable-tls1],
02d0: 5b 64 69 73 61 62 6c 65 20 54 4c 53 31 20 70 72 [disable TLS1 pr
02e0: 6f 74 6f 63 6f 6c 5d 29 2c 20 5b 0a 09 09 69 66 otocol]), [...if
02f0: 20 74 65 73 74 20 22 24 65 6e 61 62 6c 65 76 61 test "$enableva
0300: 6c 22 20 3d 3d 20 22 6e 6f 22 3b 20 74 68 65 6e l" == "no"; then
0310: 0a 09 09 09 41 43 5f 44 45 46 49 4e 45 28 5b 4e ....AC_DEFINE([N
0320: 4f 5f 54 4c 53 31 5d 2c 20 5b 31 5d 2c 20 5b 44 O_TLS1], [1], [D
0330: 69 73 61 62 6c 65 20 54 4c 53 31 20 70 72 6f 74 isable TLS1 prot
0340: 6f 63 6f 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 47 ocol])....AC_MSG
0350: 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 64 _CHECKING([for d
0360: 69 73 61 62 6c 65 20 54 4c 53 31 20 70 72 6f 74 isable TLS1 prot
0370: 6f 63 6f 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 47 ocol])....AC_MSG
0380: 5f 52 45 53 55 4c 54 28 5b 79 65 73 5d 29 0a 09 _RESULT([yes])..
0390: 09 66 69 0a 09 5d 29 0a 0a 09 64 6e 6c 20 44 69 .fi..])...dnl Di
03a0: 73 61 62 6c 65 20 73 75 70 70 6f 72 74 20 66 6f sable support fo
03b0: 72 20 54 4c 53 20 31 2e 31 20 70 72 6f 74 6f 63 r TLS 1.1 protoc
03c0: 6f 6c 0a 09 41 43 5f 41 52 47 5f 45 4e 41 42 4c ol..AC_ARG_ENABL
03d0: 45 28 5b 74 6c 73 31 5f 31 5d 2c 20 41 53 5f 48 E([tls1_1], AS_H
03e0: 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 64 69 ELP_STRING([--di
03f0: 73 61 62 6c 65 2d 74 6c 73 31 5f 31 5d 2c 20 5b sable-tls1_1], [
0400: 64 69 73 61 62 6c 65 20 54 4c 53 31 2e 31 20 70 disable TLS1.1 p
0410: 72 6f 74 6f 63 6f 6c 5d 29 2c 20 5b 0a 09 09 69 rotocol]), [...i
0420: 66 20 74 65 73 74 20 22 24 65 6e 61 62 6c 65 76 f test "$enablev
0430: 61 6c 22 20 3d 3d 20 22 6e 6f 22 3b 20 74 68 65 al" == "no"; the
0440: 6e 0a 09 09 09 41 43 5f 44 45 46 49 4e 45 28 5b n....AC_DEFINE([
0450: 4e 4f 5f 54 4c 53 31 5f 31 5d 2c 20 5b 31 5d 2c NO_TLS1_1], [1],
0460: 20 5b 44 69 73 61 62 6c 65 20 54 4c 53 31 2e 31 [Disable TLS1.1
0470: 20 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 protocol])....A
0480: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b C_MSG_CHECKING([
0490: 66 6f 72 20 64 69 73 61 62 6c 65 20 54 4c 53 31 for disable TLS1
04a0: 2e 31 20 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 .1 protocol])...
04b0: 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b .AC_MSG_RESULT([
04c0: 79 65 73 5d 29 0a 09 09 66 69 0a 09 5d 29 0a 0a yes])...fi..])..
04d0: 09 64 6e 6c 20 44 69 73 61 62 6c 65 20 73 75 70 .dnl Disable sup
04e0: 70 6f 72 74 20 66 6f 72 20 54 4c 53 20 31 2e 32 port for TLS 1.2
04f0: 20 70 72 6f 74 6f 63 6f 6c 0a 09 41 43 5f 41 52 protocol..AC_AR
0500: 47 5f 45 4e 41 42 4c 45 28 5b 74 6c 73 31 5f 32 G_ENABLE([tls1_2
0510: 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e ], AS_HELP_STRIN
0520: 47 28 5b 2d 2d 64 69 73 61 62 6c 65 2d 74 6c 73 G([--disable-tls
0530: 31 5f 32 5d 2c 20 5b 64 69 73 61 62 6c 65 20 54 1_2], [disable T
0540: 4c 53 31 2e 32 20 70 72 6f 74 6f 63 6f 6c 5d 29 LS1.2 protocol])
0550: 2c 20 5b 0a 09 09 69 66 20 74 65 73 74 20 22 24 , [...if test "$
0560: 65 6e 61 62 6c 65 76 61 6c 22 20 3d 3d 20 22 6e enableval" == "n
0570: 6f 22 3b 20 74 68 65 6e 0a 09 09 09 41 43 5f 44 o"; then....AC_D
0580: 45 46 49 4e 45 28 5b 4e 4f 5f 54 4c 53 31 5f 32 EFINE([NO_TLS1_2
0590: 5d 2c 20 5b 31 5d 2c 20 5b 44 69 73 61 62 6c 65 ], [1], [Disable
05a0: 20 54 4c 53 31 2e 32 20 70 72 6f 74 6f 63 6f 6c TLS1.2 protocol
05b0: 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 43 48 45 ])....AC_MSG_CHE
05c0: 43 4b 49 4e 47 28 5b 66 6f 72 20 64 69 73 61 62 CKING([for disab
05d0: 6c 65 20 54 4c 53 31 2e 32 20 70 72 6f 74 6f 63 le TLS1.2 protoc
05e0: 6f 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 52 ol])....AC_MSG_R
05f0: 45 53 55 4c 54 28 5b 79 65 73 5d 29 0a 09 09 66 ESULT([yes])...f
0600: 69 0a 09 5d 29 0a 0a 09 64 6e 6c 20 44 69 73 61 i..])...dnl Disa
0610: 62 6c 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 ble support for
0620: 54 4c 53 20 31 2e 33 20 70 72 6f 74 6f 63 6f 6c TLS 1.3 protocol
0630: 0a 09 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 ..AC_ARG_ENABLE(
0640: 5b 74 6c 73 31 5f 33 5d 2c 20 41 53 5f 48 45 4c [tls1_3], AS_HEL
0650: 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 64 69 73 61 P_STRING([--disa
0660: 62 6c 65 2d 74 6c 73 31 5f 33 5d 2c 20 5b 64 69 ble-tls1_3], [di
0670: 73 61 62 6c 65 20 54 4c 53 31 2e 33 20 70 72 6f sable TLS1.3 pro
0680: 74 6f 63 6f 6c 5d 29 2c 20 5b 0a 09 09 69 66 20 tocol]), [...if
0690: 74 65 73 74 20 22 24 65 6e 61 62 6c 65 76 61 6c test "$enableval
06a0: 22 20 3d 3d 20 22 6e 6f 22 3b 20 74 68 65 6e 0a " == "no"; then.
06b0: 09 09 09 41 43 5f 44 45 46 49 4e 45 28 5b 4e 4f ...AC_DEFINE([NO
06c0: 5f 54 4c 53 31 5f 33 5d 2c 20 5b 31 5d 2c 20 5b _TLS1_3], [1], [
06d0: 44 69 73 61 62 6c 65 20 54 4c 53 31 2e 33 20 70 Disable TLS1.3 p
06e0: 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 43 5f rotocol])....AC_
06f0: 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f MSG_CHECKING([fo
0700: 72 20 64 69 73 61 62 6c 65 20 54 4c 53 31 2e 33 r disable TLS1.3
0710: 20 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 protocol])....A
0720: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 79 65 C_MSG_RESULT([ye
0730: 73 5d 29 0a 09 09 66 69 0a 09 5d 29 0a 0a 0a 09 s])...fi..])....
0740: 64 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 69 66 dnl Determine if
0750: 20 64 65 62 75 67 67 69 6e 67 20 6d 6f 64 65 20 debugging mode
0760: 73 68 6f 75 6c 64 20 62 65 20 65 6e 61 62 6c 65 should be enable
0770: 64 0a 09 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 d..AC_ARG_ENABLE
0780: 28 5b 64 65 62 75 67 5d 2c 20 41 53 5f 48 45 4c ([debug], AS_HEL
0790: 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 P_STRING([--enab
07a0: 6c 65 2d 64 65 62 75 67 5d 2c 0a 09 09 5b 65 6e le-debug],...[en
07b0: 61 62 6c 65 20 64 65 62 75 67 67 69 6e 67 20 6d able debugging m
07c0: 6f 64 65 20 61 6e 64 20 6f 75 74 70 75 74 20 6d ode and output m
07d0: 6f 72 65 20 73 74 61 74 75 73 5d 29 2c 20 5b 0a ore status]), [.
07e0: 09 09 74 63 6c 74 6c 73 5f 64 65 62 75 67 5f 6d ..tcltls_debug_m
07f0: 6f 64 65 3d 22 24 65 6e 61 62 6c 65 76 61 6c 22 ode="$enableval"
0800: 0a 09 5d 2c 20 5b 0a 09 09 74 63 6c 74 6c 73 5f ..], [...tcltls_
0810: 64 65 62 75 67 5f 6d 6f 64 65 3d 27 6e 6f 27 0a debug_mode='no'.
0820: 09 5d 29 0a 09 69 66 20 74 65 73 74 20 22 24 74 .])..if test "$t
0830: 63 6c 74 6c 73 5f 64 65 62 75 67 5f 6d 6f 64 65 cltls_debug_mode
0840: 22 20 3d 3d 20 27 79 65 73 27 3b 20 74 68 65 6e " == 'yes'; then
0850: 0a 09 09 41 43 5f 44 45 46 49 4e 45 28 54 43 4c ...AC_DEFINE(TCL
0860: 45 58 54 5f 54 43 4c 54 4c 53 5f 44 45 42 55 47 EXT_TCLTLS_DEBUG
0870: 2c 20 5b 31 5d 2c 20 5b 45 6e 61 62 6c 65 20 64 , [1], [Enable d
0880: 65 62 75 67 67 69 6e 67 20 6d 6f 64 65 5d 29 0a ebugging mode]).
0890: 09 66 69 0a 09 41 43 5f 4d 53 47 5f 43 48 45 43 .fi..AC_MSG_CHEC
08a0: 4b 49 4e 47 28 5b 66 6f 72 20 64 65 62 75 67 20 KING([for debug
08b0: 6d 6f 64 65 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 mode])..AC_MSG_R
08c0: 45 53 55 4c 54 28 5b 24 74 63 6c 74 6c 73 5f 64 ESULT([$tcltls_d
08d0: 65 62 75 67 5f 6d 6f 64 65 5d 29 0a 0a 0a 09 64 ebug_mode])....d
08e0: 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 69 66 20 nl Determine if
08f0: 77 65 20 68 61 76 65 20 62 65 65 6e 20 61 73 6b we have been ask
0900: 65 64 20 74 6f 20 75 73 65 20 61 20 66 61 73 74 ed to use a fast
0910: 20 70 61 74 68 20 69 66 20 70 6f 73 73 69 62 6c path if possibl
0920: 65 0a 09 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 e..AC_ARG_ENABLE
0930: 28 5b 73 73 6c 2d 66 61 73 74 70 61 74 68 5d 2c ([ssl-fastpath],
0940: 20 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 AS_HELP_STRING(
0950: 5b 2d 2d 65 6e 61 62 6c 65 2d 73 73 6c 2d 66 61 [--enable-ssl-fa
0960: 73 74 70 61 74 68 5d 2c 0a 09 09 5b 65 6e 61 62 stpath],...[enab
0970: 6c 65 20 75 73 69 6e 67 20 74 68 65 20 75 6e 64 le using the und
0980: 65 72 6c 79 69 6e 67 20 66 69 6c 65 20 64 65 73 erlying file des
0990: 63 72 69 70 74 6f 72 20 66 6f 72 20 74 61 6c 6b criptor for talk
09a0: 69 6e 67 20 64 69 72 65 63 74 6c 79 20 74 6f 20 ing directly to
09b0: 74 68 65 20 53 53 4c 20 6c 69 62 72 61 72 79 5d the SSL library]
09c0: 29 2c 20 5b 0a 09 09 74 63 6c 74 6c 73 5f 73 73 ), [...tcltls_ss
09d0: 6c 5f 66 61 73 74 70 61 74 68 3d 22 24 65 6e 61 l_fastpath="$ena
09e0: 62 6c 65 76 61 6c 22 0a 09 5d 2c 20 5b 0a 09 09 bleval"..], [...
09f0: 74 63 6c 74 6c 73 5f 73 73 6c 5f 66 61 73 74 70 tcltls_ssl_fastp
0a00: 61 74 68 3d 27 6e 6f 27 0a 09 5d 29 0a 09 69 66 ath='no'..])..if
0a10: 20 74 65 73 74 20 22 24 74 63 6c 74 6c 73 5f 73 test "$tcltls_s
0a20: 73 6c 5f 66 61 73 74 70 61 74 68 22 20 3d 3d 20 sl_fastpath" ==
0a30: 27 79 65 73 27 3b 20 74 68 65 6e 0a 09 09 41 43 'yes'; then...AC
0a40: 5f 44 45 46 49 4e 45 28 54 43 4c 54 4c 53 5f 53 _DEFINE(TCLTLS_S
0a50: 53 4c 5f 55 53 45 5f 46 41 53 54 50 41 54 48 2c SL_USE_FASTPATH,
0a60: 20 5b 31 5d 2c 20 5b 45 6e 61 62 6c 65 20 53 53 [1], [Enable SS
0a70: 4c 20 6c 69 62 72 61 72 79 20 64 69 72 65 63 74 L library direct
0a80: 20 75 73 65 20 6f 66 20 74 68 65 20 75 6e 64 65 use of the unde
0a90: 72 6c 79 69 6e 67 20 66 69 6c 65 20 64 65 73 63 rlying file desc
0aa0: 72 69 70 74 6f 72 5d 29 0a 09 66 69 0a 09 41 43 riptor])..fi..AC
0ab0: 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 _MSG_CHECKING([f
0ac0: 6f 72 20 66 61 73 74 20 70 61 74 68 5d 29 0a 09 or fast path])..
0ad0: 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 24 AC_MSG_RESULT([$
0ae0: 74 63 6c 74 6c 73 5f 73 73 6c 5f 66 61 73 74 70 tcltls_ssl_fastp
0af0: 61 74 68 5d 29 0a 0a 0a 09 64 6e 6c 20 45 6e 61 ath])....dnl Ena
0b00: 62 6c 65 20 68 61 72 64 65 6e 69 6e 67 0a 09 41 ble hardening..A
0b10: 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b 68 61 C_ARG_ENABLE([ha
0b20: 72 64 65 6e 69 6e 67 5d 2c 20 41 53 5f 48 45 4c rdening], AS_HEL
0b30: 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 P_STRING([--enab
0b40: 6c 65 2d 68 61 72 64 65 6e 69 6e 67 5d 2c 20 5b le-hardening], [
0b50: 65 6e 61 62 6c 65 20 68 61 72 64 65 6e 69 6e 67 enable hardening
0b60: 20 61 74 74 65 6d 70 74 73 5d 29 2c 20 5b 0a 09 attempts]), [..
0b70: 09 74 63 6c 74 6c 73 5f 65 6e 61 62 6c 65 5f 68 .tcltls_enable_h
0b80: 61 72 64 65 6e 69 6e 67 3d 22 24 65 6e 61 62 6c ardening="$enabl
0b90: 65 76 61 6c 22 0a 09 5d 2c 20 5b 0a 09 09 74 63 eval"..], [...tc
0ba0: 6c 74 6c 73 5f 65 6e 61 62 6c 65 5f 68 61 72 64 ltls_enable_hard
0bb0: 65 6e 69 6e 67 3d 27 79 65 73 27 0a 09 5d 29 0a ening='yes'..]).
0bc0: 09 69 66 20 74 65 73 74 20 22 24 74 63 6c 74 6c .if test "$tcltl
0bd0: 73 5f 65 6e 61 62 6c 65 5f 68 61 72 64 65 6e 69 s_enable_hardeni
0be0: 6e 67 22 20 3d 3d 20 27 79 65 73 27 3b 20 74 68 ng" == 'yes'; th
0bf0: 65 6e 0a 09 09 69 66 20 74 65 73 74 20 22 24 47 en...if test "$G
0c00: 43 43 22 20 3d 3d 20 27 79 65 73 27 20 2d 6f 20 CC" == 'yes' -o
0c10: 22 24 43 43 22 20 3d 20 27 63 6c 61 6e 67 27 3b "$CC" = 'clang';
0c20: 20 74 68 65 6e 0a 09 09 09 54 45 41 5f 41 44 44 then....TEA_ADD
0c30: 5f 43 46 4c 41 47 53 28 5b 2d 66 73 74 61 63 6b _CFLAGS([-fstack
0c40: 2d 70 72 6f 74 65 63 74 6f 72 2d 61 6c 6c 5d 29 -protector-all])
0c50: 0a 09 09 09 54 45 41 5f 41 44 44 5f 43 46 4c 41 ....TEA_ADD_CFLA
0c60: 47 53 28 5b 2d 66 6e 6f 2d 73 74 72 69 63 74 2d GS([-fno-strict-
0c70: 6f 76 65 72 66 6c 6f 77 5d 29 0a 09 09 09 41 43 overflow])....AC
0c80: 5f 44 45 46 49 4e 45 28 5b 5f 46 4f 52 54 49 46 _DEFINE([_FORTIF
0c90: 59 5f 53 4f 55 52 43 45 5d 2c 20 5b 32 5d 2c 20 Y_SOURCE], [2],
0ca0: 5b 45 6e 61 62 6c 65 20 66 6f 72 74 69 66 69 63 [Enable fortific
0cb0: 61 74 69 6f 6e 5d 29 0a 09 09 66 69 0a 09 66 69 ation])...fi..fi
0cc0: 0a 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e ..AC_MSG_CHECKIN
0cd0: 47 28 5b 66 6f 72 20 65 6e 61 62 6c 65 20 68 61 G([for enable ha
0ce0: 72 64 65 6e 69 6e 67 5d 29 0a 09 41 43 5f 4d 53 rdening])..AC_MS
0cf0: 47 5f 52 45 53 55 4c 54 28 5b 24 74 63 6c 74 6c G_RESULT([$tcltl
0d00: 73 5f 65 6e 61 62 6c 65 5f 68 61 72 64 65 6e 69 s_enable_hardeni
0d10: 6e 67 5d 29 0a 0a 0a 09 64 6e 6c 20 44 65 74 65 ng])....dnl Dete
0d20: 72 6d 69 6e 65 20 69 66 20 77 65 20 68 61 76 65 rmine if we have
0d30: 20 62 65 65 6e 20 61 73 6b 65 64 20 74 6f 20 73 been asked to s
0d40: 74 61 74 69 63 61 6c 6c 79 20 6c 69 6e 6b 20 74 tatically link t
0d50: 6f 20 74 68 65 20 53 53 4c 20 6c 69 62 72 61 72 o the SSL librar
0d60: 79 0a 09 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 y..AC_ARG_ENABLE
0d70: 28 5b 73 74 61 74 69 63 2d 73 73 6c 5d 2c 20 41 ([static-ssl], A
0d80: 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d S_HELP_STRING([-
0d90: 2d 65 6e 61 62 6c 65 2d 73 74 61 74 69 63 2d 73 -enable-static-s
0da0: 73 6c 5d 2c 20 5b 65 6e 61 62 6c 65 20 73 74 61 sl], [enable sta
0db0: 74 69 63 20 6c 69 6e 6b 69 6e 67 20 74 6f 20 74 tic linking to t
0dc0: 68 65 20 53 53 4c 20 6c 69 62 72 61 72 79 5d 29 he SSL library])
0dd0: 2c 20 5b 0a 09 09 54 43 4c 45 58 54 5f 54 4c 53 , [...TCLEXT_TLS
0de0: 5f 53 54 41 54 49 43 5f 53 53 4c 3d 22 24 65 6e _STATIC_SSL="$en
0df0: 61 62 6c 65 76 61 6c 22 0a 09 5d 2c 20 5b 0a 09 ableval"..], [..
0e00: 09 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54 .TCLEXT_TLS_STAT
0e10: 49 43 5f 53 53 4c 3d 27 6e 6f 27 0a 09 5d 29 0a IC_SSL='no'..]).
0e20: 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 .AC_MSG_CHECKING
0e30: 28 5b 66 6f 72 20 73 74 61 74 69 63 20 6c 69 6e ([for static lin
0e40: 6b 69 6e 67 20 6f 66 20 6f 70 65 6e 53 53 4c 20 king of openSSL
0e50: 6c 69 62 72 61 72 69 65 73 5d 29 0a 09 41 43 5f libraries])..AC_
0e60: 4d 53 47 5f 52 45 53 55 4c 54 28 5b 24 54 43 4c MSG_RESULT([$TCL
0e70: 45 58 54 5f 54 4c 53 5f 53 54 41 54 49 43 5f 53 EXT_TLS_STATIC_S
0e80: 53 4c 5d 29 0a 0a 0a 09 64 6e 6c 20 53 65 74 20 SL])....dnl Set
0e90: 53 53 4c 20 66 69 6c 65 73 20 72 6f 6f 74 20 70 SSL files root p
0ea0: 61 74 68 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 ath..AC_ARG_WITH
0eb0: 28 5b 6f 70 65 6e 73 73 6c 2d 64 69 72 5d 2c 0a ([openssl-dir],.
0ec0: 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 ..AS_HELP_STRING
0ed0: 28 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 73 6c ([--with-openssl
0ee0: 2d 64 69 72 3d 3c 64 69 72 3e 5d 2c 0a 09 09 09 -dir=<dir>],....
0ef0: 5b 70 61 74 68 20 74 6f 20 72 6f 6f 74 20 64 69 [path to root di
0f00: 72 65 63 74 6f 72 79 20 6f 66 20 4f 70 65 6e 53 rectory of OpenS
0f10: 53 4c 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 5d SL installation]
0f20: 0a 09 09 29 2c 20 5b 0a 09 09 09 6f 70 65 6e 73 ...), [....opens
0f30: 73 6c 64 69 72 3d 22 24 77 69 74 68 76 61 6c 22 sldir="$withval"
0f40: 0a 09 09 5d 2c 20 5b 0a 09 09 09 6f 70 65 6e 73 ...], [....opens
0f50: 73 6c 64 69 72 3d 27 27 0a 09 09 5d 0a 09 29 0a sldir=''...]..).
0f60: 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 .AC_MSG_CHECKING
0f70: 28 5b 66 6f 72 20 4f 70 65 6e 53 53 4c 20 64 69 ([for OpenSSL di
0f80: 72 65 63 74 6f 72 79 5d 29 0a 09 41 43 5f 4d 53 rectory])..AC_MS
0f90: 47 5f 52 45 53 55 4c 54 28 24 6f 70 65 6e 73 73 G_RESULT($openss
0fa0: 6c 64 69 72 29 0a 0a 09 64 6e 6c 20 53 65 74 20 ldir)...dnl Set
0fb0: 53 53 4c 20 69 6e 63 6c 75 64 65 20 66 69 6c 65 SSL include file
0fc0: 73 20 70 61 74 68 0a 09 41 43 5f 41 52 47 5f 57 s path..AC_ARG_W
0fd0: 49 54 48 28 5b 6f 70 65 6e 73 73 6c 2d 69 6e 63 ITH([openssl-inc
0fe0: 6c 75 64 65 64 69 72 5d 2c 0a 09 09 41 53 5f 48 ludedir],...AS_H
0ff0: 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 77 69 ELP_STRING([--wi
1000: 74 68 2d 6f 70 65 6e 73 73 6c 2d 69 6e 63 6c 75 th-openssl-inclu
1010: 64 65 64 69 72 3d 3c 64 69 72 3e 5d 2c 0a 09 09 dedir=<dir>],...
1020: 09 5b 70 61 74 68 20 74 6f 20 69 6e 63 6c 75 64 .[path to includ
1030: 65 20 64 69 72 65 63 74 6f 72 79 20 6f 66 20 4f e directory of O
1040: 70 65 6e 53 53 4c 20 69 6e 73 74 61 6c 6c 61 74 penSSL installat
1050: 69 6f 6e 5d 0a 09 09 29 2c 20 5b 0a 09 09 09 6f ion]...), [....o
1060: 70 65 6e 73 73 6c 69 6e 63 6c 75 64 65 64 69 72 pensslincludedir
1070: 3d 22 24 77 69 74 68 76 61 6c 22 0a 09 09 5d 2c ="$withval"...],
1080: 20 5b 0a 09 09 09 69 66 20 74 65 73 74 20 2d 6e [....if test -n
1090: 20 22 24 6f 70 65 6e 73 73 6c 64 69 72 22 3b 20 "$openssldir";
10a0: 74 68 65 6e 0a 09 09 09 09 6f 70 65 6e 73 73 6c then.....openssl
10b0: 69 6e 63 6c 75 64 65 64 69 72 3d 22 24 7b 6f 70 includedir="${op
10c0: 65 6e 73 73 6c 64 69 72 7d 2f 69 6e 63 6c 75 64 enssldir}/includ
10d0: 65 22 0a 09 09 09 65 6c 73 65 0a 09 09 09 09 6f e"....else.....o
10e0: 70 65 6e 73 73 6c 69 6e 63 6c 75 64 65 64 69 72 pensslincludedir
10f0: 3d 27 27 0a 09 09 09 66 69 0a 09 09 5d 0a 09 29 =''....fi...]..)
1100: 0a 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e ..AC_MSG_CHECKIN
1110: 47 28 5b 66 6f 72 20 4f 70 65 6e 53 53 4c 20 69 G([for OpenSSL i
1120: 6e 63 6c 75 64 65 20 64 69 72 65 63 74 6f 72 79 nclude directory
1130: 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c ])..AC_MSG_RESUL
1140: 54 28 24 6f 70 65 6e 73 73 6c 69 6e 63 6c 75 64 T($opensslinclud
1150: 65 64 69 72 29 0a 0a 09 64 6e 6c 20 53 65 74 20 edir)...dnl Set
1160: 53 53 4c 20 69 6e 63 6c 75 64 65 20 76 61 72 69 SSL include vari
1170: 61 62 6c 65 73 0a 09 69 66 20 74 65 73 74 20 2d ables..if test -
1180: 6e 20 22 24 6f 70 65 6e 73 73 6c 69 6e 63 6c 75 n "$opensslinclu
1190: 64 65 64 69 72 22 3b 20 74 68 65 6e 0a 09 09 41 dedir"; then...A
11a0: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b C_MSG_CHECKING([
11b0: 66 6f 72 20 73 73 6c 2e 68 5d 29 0a 09 09 69 66 for ssl.h])...if
11c0: 20 74 65 73 74 20 2d 66 20 22 24 7b 6f 70 65 6e test -f "${open
11d0: 73 73 6c 69 6e 63 6c 75 64 65 64 69 72 7d 2f 6f sslincludedir}/o
11e0: 70 65 6e 73 73 6c 2f 73 73 6c 2e 68 22 3b 20 74 penssl/ssl.h"; t
11f0: 68 65 6e 0a 09 09 09 54 43 4c 54 4c 53 5f 53 53 hen....TCLTLS_SS
1200: 4c 5f 43 46 4c 41 47 53 3d 22 2d 49 24 6f 70 65 L_CFLAGS="-I$ope
1210: 6e 73 73 6c 69 6e 63 6c 75 64 65 64 69 72 22 0a nsslincludedir".
1220: 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e ...TCLTLS_SSL_IN
1230: 43 4c 55 44 45 53 3d 22 2d 49 24 6f 70 65 6e 73 CLUDES="-I$opens
1240: 73 6c 69 6e 63 6c 75 64 65 64 69 72 22 0a 09 09 slincludedir"...
1250: 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b .AC_MSG_RESULT([
1260: 79 65 73 5d 29 0a 09 09 65 6c 73 65 0a 09 09 09 yes])...else....
1270: 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e AC_MSG_RESULT([n
1280: 6f 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 45 52 o])....AC_MSG_ER
1290: 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 6c ROR([Unable to l
12a0: 6f 63 61 74 65 20 73 73 6c 2e 68 5d 29 0a 09 09 ocate ssl.h])...
12b0: 66 69 0a 09 66 69 0a 0a 09 64 6e 6c 20 53 65 74 fi..fi...dnl Set
12c0: 20 53 53 4c 20 6c 69 62 20 66 69 6c 65 73 20 70 SSL lib files p
12d0: 61 74 68 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 ath..AC_ARG_WITH
12e0: 28 5b 6f 70 65 6e 73 73 6c 2d 6c 69 62 64 69 72 ([openssl-libdir
12f0: 5d 2c 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 ],...AS_HELP_STR
1300: 49 4e 47 28 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e ING([--with-open
1310: 73 73 6c 2d 6c 69 62 64 69 72 3d 3c 64 69 72 3e ssl-libdir=<dir>
1320: 5d 2c 0a 09 09 09 5b 70 61 74 68 20 74 6f 20 6c ],....[path to l
1330: 69 62 20 64 69 72 65 63 74 6f 72 79 20 6f 66 20 ib directory of
1340: 4f 70 65 6e 53 53 4c 20 69 6e 73 74 61 6c 6c 61 OpenSSL installa
1350: 74 69 6f 6e 5d 0a 09 09 29 2c 20 5b 0a 09 09 09 tion]...), [....
1360: 6f 70 65 6e 73 73 6c 6c 69 62 64 69 72 3d 22 24 openssllibdir="$
1370: 77 69 74 68 76 61 6c 22 0a 09 09 5d 2c 20 5b 0a withval"...], [.
1380: 09 09 09 69 66 20 74 65 73 74 20 2d 6e 20 22 24 ...if test -n "$
1390: 6f 70 65 6e 73 73 6c 64 69 72 22 3b 20 74 68 65 openssldir"; the
13a0: 6e 0a 09 09 09 09 69 66 20 74 65 73 74 20 22 24 n.....if test "$
13b0: 64 6f 36 34 62 69 74 22 20 3d 3d 20 27 79 65 73 do64bit" == 'yes
13c0: 27 20 2d 61 20 2d 64 20 24 7b 6f 70 65 6e 73 73 ' -a -d ${openss
13d0: 6c 64 69 72 7d 2f 6c 69 62 36 34 3b 20 74 68 65 ldir}/lib64; the
13e0: 6e 0a 09 09 09 09 09 6f 70 65 6e 73 73 6c 6c 69 n......opensslli
13f0: 62 64 69 72 3d 22 24 6f 70 65 6e 73 73 6c 64 69 bdir="$openssldi
1400: 72 2f 6c 69 62 36 34 22 0a 09 09 09 09 65 6c 73 r/lib64".....els
1410: 65 0a 09 09 09 09 09 6f 70 65 6e 73 73 6c 6c 69 e......opensslli
1420: 62 64 69 72 3d 22 24 6f 70 65 6e 73 73 6c 64 69 bdir="$openssldi
1430: 72 2f 6c 69 62 22 0a 09 09 09 09 66 69 0a 09 09 r/lib".....fi...
1440: 09 65 6c 73 65 0a 09 09 09 09 6f 70 65 6e 73 73 .else.....openss
1450: 6c 6c 69 62 64 69 72 3d 27 27 0a 09 09 09 66 69 llibdir=''....fi
1460: 0a 09 09 5d 0a 09 29 0a 09 41 43 5f 4d 53 47 5f ...]..)..AC_MSG_
1470: 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 4f 70 CHECKING([for Op
1480: 65 6e 53 53 4c 20 6c 69 62 20 64 69 72 65 63 74 enSSL lib direct
1490: 6f 72 79 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45 ory])..AC_MSG_RE
14a0: 53 55 4c 54 28 24 6f 70 65 6e 73 73 6c 6c 69 62 SULT($openssllib
14b0: 64 69 72 29 0a 0a 09 64 6e 6c 20 53 65 74 20 53 dir)...dnl Set S
14c0: 53 4c 20 6c 69 62 20 76 61 72 69 61 62 6c 65 73 SL lib variables
14d0: 0a 09 53 53 4c 5f 4c 49 42 53 5f 50 41 54 48 3d ..SSL_LIBS_PATH=
14e0: 27 27 0a 09 69 66 20 74 65 73 74 20 2d 6e 20 22 ''..if test -n "
14f0: 24 6f 70 65 6e 73 73 6c 6c 69 62 64 69 72 22 3b $openssllibdir";
1500: 20 74 68 65 6e 0a 09 09 69 66 20 74 65 73 74 20 then...if test
1510: 22 24 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 "$TCLEXT_TLS_STA
1520: 54 49 43 5f 53 53 4c 22 20 3d 3d 20 27 6e 6f 27 TIC_SSL" == 'no'
1530: 3b 20 74 68 65 6e 0a 09 09 09 4c 49 42 45 58 54 ; then....LIBEXT
1540: 3d 24 7b 53 48 4c 49 42 5f 53 55 46 46 49 58 7d =${SHLIB_SUFFIX}
1550: 0a 09 09 65 6c 73 65 0a 09 09 09 4c 49 42 45 58 ...else....LIBEX
1560: 54 3d 27 2e 61 27 0a 09 09 66 69 0a 0a 09 09 69 T='.a'...fi....i
1570: 66 20 74 65 73 74 20 2d 66 20 22 24 7b 6f 70 65 f test -f "${ope
1580: 6e 73 73 6c 6c 69 62 64 69 72 7d 2f 6c 69 62 73 nssllibdir}/libs
1590: 73 6c 24 7b 4c 49 42 45 58 54 7d 22 3b 20 74 68 sl${LIBEXT}"; th
15a0: 65 6e 0a 09 09 09 53 53 4c 5f 4c 49 42 53 5f 50 en....SSL_LIBS_P
15b0: 41 54 48 3d 22 2d 4c 24 6f 70 65 6e 73 73 6c 6c ATH="-L$openssll
15c0: 69 62 64 69 72 22 0a 09 09 65 6c 73 65 0a 09 09 ibdir"...else...
15d0: 09 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55 .AC_MSG_ERROR([U
15e0: 6e 61 62 6c 65 20 74 6f 20 6c 6f 63 61 74 65 20 nable to locate
15f0: 6c 69 62 73 73 6c 24 7b 4c 49 42 45 58 54 7d 5d libssl${LIBEXT}]
1600: 29 0a 09 09 66 69 0a 09 66 69 0a 0a 09 64 6e 6c )...fi..fi...dnl
1610: 20 53 65 74 20 6c 6f 63 61 74 69 6f 6e 20 6f 66 Set location of
1620: 20 70 6b 67 63 6f 6e 66 69 67 20 66 69 6c 65 73 pkgconfig files
1630: 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 6f ..AC_ARG_WITH([o
1640: 70 65 6e 73 73 6c 2d 70 6b 67 63 6f 6e 66 69 67 penssl-pkgconfig
1650: 5d 2c 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 ],...AS_HELP_STR
1660: 49 4e 47 28 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e ING([--with-open
1670: 73 73 6c 2d 70 6b 67 63 6f 6e 66 69 67 3d 3c 64 ssl-pkgconfig=<d
1680: 69 72 3e 5d 2c 0a 09 09 09 5b 70 61 74 68 20 74 ir>],....[path t
1690: 6f 20 70 6b 67 63 6f 6e 66 69 67 64 69 72 20 64 o pkgconfigdir d
16a0: 69 72 65 63 74 6f 72 79 20 66 6f 72 20 4f 70 65 irectory for Ope
16b0: 6e 53 53 4c 5d 0a 09 09 29 2c 20 5b 0a 09 09 09 nSSL]...), [....
16c0: 6f 70 65 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 opensslpkgconfig
16d0: 64 69 72 3d 22 24 77 69 74 68 76 61 6c 22 0a 09 dir="$withval"..
16e0: 09 5d 2c 20 5b 0a 09 09 09 69 66 20 74 65 73 74 .], [....if test
16f0: 20 2d 64 20 24 7b 6c 69 62 64 69 72 7d 2f 2e 2e -d ${libdir}/..
1700: 2f 70 6b 67 63 6f 6e 66 69 67 3b 20 74 68 65 6e /pkgconfig; then
1710: 0a 09 09 09 09 6f 70 65 6e 73 73 6c 70 6b 67 63 .....opensslpkgc
1720: 6f 6e 66 69 67 64 69 72 3d 22 24 6c 69 62 64 69 onfigdir="$libdi
1730: 72 2f 2e 2e 2f 70 6b 67 63 6f 6e 66 69 67 22 0a r/../pkgconfig".
1740: 09 09 09 65 6c 73 65 0a 09 09 09 09 6f 70 65 6e ...else.....open
1750: 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 69 72 3d sslpkgconfigdir=
1760: 27 27 0a 09 09 09 66 69 0a 09 09 5d 0a 09 29 0a ''....fi...]..).
1770: 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 .AC_MSG_CHECKING
1780: 28 5b 66 6f 72 20 4f 70 65 6e 53 53 4c 20 70 6b ([for OpenSSL pk
1790: 67 63 6f 6e 66 69 67 5d 29 0a 09 41 43 5f 4d 53 gconfig])..AC_MS
17a0: 47 5f 52 45 53 55 4c 54 28 24 6f 70 65 6e 73 73 G_RESULT($openss
17b0: 6c 70 6b 67 63 6f 6e 66 69 67 64 69 72 29 0a 0a lpkgconfigdir)..
17c0: 09 64 6e 6c 20 55 73 65 20 70 6b 67 2d 63 6f 6e .dnl Use pkg-con
17d0: 66 69 67 20 74 6f 20 66 69 6e 64 20 4f 70 65 6e fig to find Open
17e0: 53 53 4c 20 69 66 20 6e 6f 74 20 61 6c 72 65 61 SSL if not alrea
17f0: 64 79 20 66 6f 75 6e 64 20 0a 09 69 66 20 74 65 dy found ..if te
1800: 73 74 20 2d 6e 20 22 24 50 4b 47 5f 43 4f 4e 46 st -n "$PKG_CONF
1810: 49 47 22 20 2d 61 20 2d 7a 20 22 24 6f 70 65 6e IG" -a -z "$open
1820: 73 73 6c 64 69 72 22 20 2d 61 20 2d 7a 20 22 24 ssldir" -a -z "$
1830: 6f 70 65 6e 73 73 6c 69 6e 63 6c 75 64 65 64 69 opensslincludedi
1840: 72 22 20 2d 61 20 2d 7a 20 22 24 6f 70 65 6e 73 r" -a -z "$opens
1850: 73 6c 6c 69 62 64 69 72 22 3b 20 74 68 65 6e 0a sllibdir"; then.
1860: 09 20 20 20 20 55 53 45 5f 50 4b 47 5f 43 4f 4e . USE_PKG_CON
1870: 46 49 47 3d 60 22 24 7b 50 4b 47 5f 43 4f 4e 46 FIG=`"${PKG_CONF
1880: 49 47 7d 22 20 2d 2d 6c 69 73 74 2d 61 6c 6c 20 IG}" --list-all
1890: 7c 20 67 72 65 70 20 6f 70 65 6e 73 73 6c 60 0a | grep openssl`.
18a0: 0a 09 20 20 20 20 64 6e 6c 20 55 73 65 20 70 6b .. dnl Use pk
18b0: 67 2d 63 6f 6e 66 69 67 20 74 6f 20 66 69 6e 64 g-config to find
18c0: 20 74 68 65 20 6c 69 62 72 61 72 79 20 6e 61 6d the library nam
18d0: 65 73 0a 09 20 20 20 20 69 66 20 74 65 73 74 20 es.. if test
18e0: 2d 6e 20 22 24 55 53 45 5f 50 4b 47 5f 43 4f 4e -n "$USE_PKG_CON
18f0: 46 49 47 22 3b 20 74 68 65 6e 0a 09 09 64 6e 6c FIG"; then...dnl
1900: 20 54 65 6d 70 6f 72 61 72 69 6c 79 20 75 70 64 Temporarily upd
1910: 61 74 65 20 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 ate PKG_CONFIG_P
1920: 41 54 48 0a 09 09 50 4b 47 5f 43 4f 4e 46 49 47 ATH...PKG_CONFIG
1930: 5f 50 41 54 48 5f 53 41 56 45 3d 22 24 7b 50 4b _PATH_SAVE="${PK
1940: 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48 7d 22 0a G_CONFIG_PATH}".
1950: 09 09 69 66 20 74 65 73 74 20 2d 6e 20 22 24 6f ..if test -n "$o
1960: 70 65 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 pensslpkgconfigd
1970: 69 72 22 3b 20 74 68 65 6e 0a 09 09 09 69 66 20 ir"; then....if
1980: 21 20 74 65 73 74 20 2d 66 20 22 24 7b 6f 70 65 ! test -f "${ope
1990: 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 69 72 nsslpkgconfigdir
19a0: 7d 2f 6f 70 65 6e 73 73 6c 2e 70 63 22 3b 20 74 }/openssl.pc"; t
19b0: 68 65 6e 0a 09 09 09 09 41 43 5f 4d 53 47 5f 45 hen.....AC_MSG_E
19c0: 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 RROR([Unable to
19d0: 6c 6f 63 61 74 65 20 24 7b 6f 70 65 6e 73 73 6c locate ${openssl
19e0: 70 6b 67 63 6f 6e 66 69 67 64 69 72 7d 2f 6f 70 pkgconfigdir}/op
19f0: 65 6e 73 73 6c 2e 70 63 5d 29 0a 09 09 09 66 69 enssl.pc])....fi
1a00: 0a 0a 09 09 09 50 4b 47 5f 43 4f 4e 46 49 47 5f .....PKG_CONFIG_
1a10: 50 41 54 48 3d 22 24 7b 6f 70 65 6e 73 73 6c 70 PATH="${opensslp
1a20: 6b 67 63 6f 6e 66 69 67 64 69 72 7d 3a 24 7b 50 kgconfigdir}:${P
1a30: 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48 7d 22 KG_CONFIG_PATH}"
1a40: 0a 09 09 09 65 78 70 6f 72 74 20 50 4b 47 5f 43 ....export PKG_C
1a50: 4f 4e 46 49 47 5f 50 41 54 48 0a 09 09 66 69 0a ONFIG_PATH...fi.
1a60: 0a 09 09 70 6b 67 43 6f 6e 66 69 67 45 78 74 72 ...pkgConfigExtr
1a70: 61 41 72 67 73 3d 27 27 0a 09 09 69 66 20 74 65 aArgs=''...if te
1a80: 73 74 20 22 24 53 48 41 52 45 44 5f 42 55 49 4c st "$SHARED_BUIL
1a90: 44 22 20 3d 3d 20 22 30 22 20 2d 6f 20 22 24 54 D" == "0" -o "$T
1aa0: 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54 49 43 CLEXT_TLS_STATIC
1ab0: 5f 53 53 4c 22 20 3d 3d 20 27 79 65 73 27 3b 20 _SSL" == 'yes';
1ac0: 74 68 65 6e 0a 09 09 09 70 6b 67 43 6f 6e 66 69 then....pkgConfi
1ad0: 67 45 78 74 72 61 41 72 67 73 3d 27 2d 2d 73 74 gExtraArgs='--st
1ae0: 61 74 69 63 27 0a 09 09 66 69 0a 0a 09 09 69 66 atic'...fi....if
1af0: 20 74 65 73 74 20 2d 7a 20 22 24 54 43 4c 54 4c test -z "$TCLTL
1b00: 53 5f 53 53 4c 5f 4c 49 42 53 22 3b 20 74 68 65 S_SSL_LIBS"; the
1b10: 6e 0a 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f n....TCLTLS_SSL_
1b20: 4c 49 42 53 3d 22 24 53 53 4c 5f 4c 49 42 53 5f LIBS="$SSL_LIBS_
1b30: 50 41 54 48 20 60 24 7b 50 4b 47 5f 43 4f 4e 46 PATH `${PKG_CONF
1b40: 49 47 7d 20 6f 70 65 6e 73 73 6c 20 2d 2d 6c 69 IG} openssl --li
1b50: 62 73 20 24 70 6b 67 43 6f 6e 66 69 67 45 78 74 bs $pkgConfigExt
1b60: 72 61 41 72 67 73 60 22 20 7c 7c 20 41 43 5f 4d raArgs`" || AC_M
1b70: 53 47 5f 45 52 52 4f 52 28 5b 55 6e 61 62 6c 65 SG_ERROR([Unable
1b80: 20 74 6f 20 67 65 74 20 4f 70 65 6e 53 53 4c 20 to get OpenSSL
1b90: 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5d 29 0a Configuration]).
1ba0: 09 09 09 69 66 20 74 65 73 74 20 22 24 7b 54 43 ...if test "${TC
1bb0: 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54 49 43 5f LEXT_TLS_STATIC_
1bc0: 53 53 4c 7d 22 20 3d 3d 20 27 79 65 73 27 3b 20 SSL}" == 'yes';
1bd0: 74 68 65 6e 0a 09 09 09 09 54 43 4c 54 4c 53 5f then.....TCLTLS_
1be0: 53 53 4c 5f 4c 49 42 53 3d 22 2d 57 6c 2c 2d 42 SSL_LIBS="-Wl,-B
1bf0: 73 74 61 74 69 63 20 24 54 43 4c 54 4c 53 5f 53 static $TCLTLS_S
1c00: 53 4c 5f 4c 49 42 53 20 2d 57 6c 2c 2d 42 64 79 SL_LIBS -Wl,-Bdy
1c10: 6e 61 6d 69 63 22 0a 09 09 09 66 69 0a 09 09 66 namic"....fi...f
1c20: 69 0a 09 09 69 66 20 74 65 73 74 20 2d 7a 20 22 i...if test -z "
1c30: 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 $TCLTLS_SSL_CFLA
1c40: 47 53 22 3b 20 74 68 65 6e 0a 09 09 09 54 43 4c GS"; then....TCL
1c50: 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53 3d 22 TLS_SSL_CFLAGS="
1c60: 60 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 47 7d 22 `"${PKG_CONFIG}"
1c70: 20 6f 70 65 6e 73 73 6c 20 2d 2d 63 66 6c 61 67 openssl --cflag
1c80: 73 2d 6f 6e 6c 79 2d 6f 74 68 65 72 20 24 70 6b s-only-other $pk
1c90: 67 43 6f 6e 66 69 67 45 78 74 72 61 41 72 67 73 gConfigExtraArgs
1ca0: 60 22 20 7c 7c 20 41 43 5f 4d 53 47 5f 45 52 52 `" || AC_MSG_ERR
1cb0: 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 67 65 OR([Unable to ge
1cc0: 74 20 4f 70 65 6e 53 53 4c 20 43 6f 6e 66 69 67 t OpenSSL Config
1cd0: 75 72 61 74 69 6f 6e 5d 29 0a 09 09 66 69 0a 09 uration])...fi..
1ce0: 09 69 66 20 74 65 73 74 20 2d 7a 20 22 24 54 43 .if test -z "$TC
1cf0: 4c 54 4c 53 5f 53 53 4c 5f 49 4e 43 4c 55 44 45 LTLS_SSL_INCLUDE
1d00: 53 22 3b 20 74 68 65 6e 0a 09 09 09 54 43 4c 54 S"; then....TCLT
1d10: 4c 53 5f 53 53 4c 5f 49 4e 43 4c 55 44 45 53 3d LS_SSL_INCLUDES=
1d20: 22 60 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 47 7d "`"${PKG_CONFIG}
1d30: 22 20 6f 70 65 6e 73 73 6c 20 2d 2d 63 66 6c 61 " openssl --cfla
1d40: 67 73 2d 6f 6e 6c 79 2d 49 20 24 70 6b 67 43 6f gs-only-I $pkgCo
1d50: 6e 66 69 67 45 78 74 72 61 41 72 67 73 60 22 20 nfigExtraArgs`"
1d60: 7c 7c 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 || AC_MSG_ERROR(
1d70: 5b 55 6e 61 62 6c 65 20 74 6f 20 67 65 74 20 4f [Unable to get O
1d80: 70 65 6e 53 53 4c 20 43 6f 6e 66 69 67 75 72 61 penSSL Configura
1d90: 74 69 6f 6e 5d 29 0a 09 09 66 69 0a 09 09 50 4b tion])...fi...PK
1da0: 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48 3d 22 24 G_CONFIG_PATH="$
1db0: 7b 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48 {PKG_CONFIG_PATH
1dc0: 5f 53 41 56 45 7d 22 0a 09 20 20 20 20 66 69 0a _SAVE}".. fi.
1dd0: 09 66 69 0a 0a 09 64 6e 6c 20 55 73 65 20 66 61 .fi...dnl Use fa
1de0: 6c 6c 2d 62 61 63 6b 20 73 65 74 74 69 6e 67 73 ll-back settings
1df0: 20 66 6f 72 20 4f 70 65 6e 53 53 4c 20 69 6e 63 for OpenSSL inc
1e00: 6c 75 64 65 20 61 6e 64 20 6c 69 62 72 61 72 79 lude and library
1e10: 20 70 61 74 68 73 0a 09 69 66 20 74 65 73 74 20 paths..if test
1e20: 2d 7a 20 22 24 54 43 4c 54 4c 53 5f 53 53 4c 5f -z "$TCLTLS_SSL_
1e30: 43 46 4c 41 47 53 22 3b 20 74 68 65 6e 0a 09 09 CFLAGS"; then...
1e40: 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 TCLTLS_SSL_CFLAG
1e50: 53 3d 22 22 0a 09 66 69 0a 09 69 66 20 74 65 73 S=""..fi..if tes
1e60: 74 20 2d 7a 20 22 24 54 43 4c 54 4c 53 5f 53 53 t -z "$TCLTLS_SS
1e70: 4c 5f 49 4e 43 4c 55 44 45 53 22 3b 20 74 68 65 L_INCLUDES"; the
1e80: 6e 0a 09 09 69 66 20 74 65 73 74 20 2d 66 20 2f n...if test -f /
1e90: 75 73 72 2f 69 6e 63 6c 75 64 65 2f 6f 70 65 6e usr/include/open
1ea0: 73 73 6c 2f 73 73 6c 2e 68 3b 20 74 68 65 6e 0a ssl/ssl.h; then.
1eb0: 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e ...TCLTLS_SSL_IN
1ec0: 43 4c 55 44 45 53 3d 22 2d 49 2f 75 73 72 2f 69 CLUDES="-I/usr/i
1ed0: 6e 63 6c 75 64 65 22 0a 09 09 66 69 0a 09 66 69 nclude"...fi..fi
1ee0: 0a 09 69 66 20 74 65 73 74 20 2d 7a 20 22 24 54 ..if test -z "$T
1ef0: 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 22 3b CLTLS_SSL_LIBS";
1f00: 20 74 68 65 6e 0a 09 09 69 66 20 74 65 73 74 20 then...if test
1f10: 22 24 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 "$TCLEXT_TLS_STA
1f20: 54 49 43 5f 53 53 4c 22 20 3d 3d 20 27 6e 6f 27 TIC_SSL" == 'no'
1f30: 3b 20 74 68 65 6e 0a 09 09 20 20 20 20 54 43 4c ; then... TCL
1f40: 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d 22 24 53 TLS_SSL_LIBS="$S
1f50: 53 4c 5f 4c 49 42 53 5f 50 41 54 48 20 2d 6c 73 SL_LIBS_PATH -ls
1f60: 73 6c 20 2d 6c 63 72 79 70 74 6f 22 0a 09 09 65 sl -lcrypto"...e
1f70: 6c 73 65 0a 09 09 20 20 20 20 23 20 4c 69 6e 75 lse... # Linu
1f80: 78 20 61 6e 64 20 53 6f 6c 61 72 69 73 0a 09 09 x and Solaris...
1f90: 20 20 20 20 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c TCLTLS_SSL_L
1fa0: 49 42 53 3d 22 24 53 53 4c 5f 4c 49 42 53 5f 50 IBS="$SSL_LIBS_P
1fb0: 41 54 48 20 2d 57 6c 2c 2d 42 73 74 61 74 69 63 ATH -Wl,-Bstatic
1fc0: 20 2d 6c 73 73 6c 20 2d 6c 63 72 79 70 74 6f 20 -lssl -lcrypto
1fd0: 2d 57 6c 2c 2d 42 64 79 6e 61 6d 69 63 22 0a 09 -Wl,-Bdynamic"..
1fe0: 09 20 20 20 20 23 20 48 50 55 58 3a 20 2d 57 6c . # HPUX: -Wl
1ff0: 2c 2d 61 2c 61 72 63 68 69 76 65 20 2e 2e 2e 20 ,-a,archive ...
2000: 2d 57 6c 2c 2d 61 2c 73 68 61 72 65 64 5f 61 72 -Wl,-a,shared_ar
2010: 63 68 69 76 65 0a 09 09 66 69 0a 09 66 69 0a 09 chive...fi..fi..
2020: 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 AC_MSG_CHECKING(
2030: 5b 66 6f 72 20 53 53 4c 20 6c 69 62 73 5d 29 0a [for SSL libs]).
2040: 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b .AC_MSG_RESULT([
2050: 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 $TCLTLS_SSL_LIBS
2060: 5d 29 0a 0a 09 64 6e 6c 20 49 6e 63 6c 75 64 65 ])...dnl Include
2070: 20 63 6f 6e 66 69 67 20 76 61 72 69 61 62 6c 65 config variable
2080: 73 20 69 6e 20 2d 2d 68 65 6c 70 20 6c 69 73 74 s in --help list
2090: 20 61 6e 64 20 6d 61 6b 65 20 61 76 61 69 6c 61 and make availa
20a0: 62 6c 65 20 74 6f 20 62 65 20 73 75 62 73 74 69 ble to be substi
20b0: 74 75 74 65 64 20 76 69 61 20 41 43 5f 53 55 42 tuted via AC_SUB
20c0: 53 54 2e 0a 09 41 43 5f 41 52 47 5f 56 41 52 28 ST...AC_ARG_VAR(
20d0: 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 [TCLTLS_SSL_CFLA
20e0: 47 53 5d 2c 20 5b 43 20 63 6f 6d 70 69 6c 65 72 GS], [C compiler
20f0: 20 66 6c 61 67 73 20 66 6f 72 20 4f 70 65 6e 53 flags for OpenS
2100: 53 4c 5d 29 0a 09 41 43 5f 41 52 47 5f 56 41 52 SL])..AC_ARG_VAR
2110: 28 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e 43 ([TCLTLS_SSL_INC
2120: 4c 55 44 45 53 5d 2c 20 5b 43 20 63 6f 6d 70 69 LUDES], [C compi
2130: 6c 65 72 20 69 6e 63 6c 75 64 65 20 70 61 74 68 ler include path
2140: 73 20 66 6f 72 20 4f 70 65 6e 53 53 4c 5d 29 0a s for OpenSSL]).
2150: 09 41 43 5f 41 52 47 5f 56 41 52 28 5b 54 43 4c .AC_ARG_VAR([TCL
2160: 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 5d 2c 20 5b TLS_SSL_LIBS], [
2170: 6c 69 62 72 61 72 69 65 73 20 74 6f 20 70 61 73 libraries to pas
2180: 73 20 74 6f 20 74 68 65 20 6c 69 6e 6b 65 72 20 s to the linker
2190: 66 6f 72 20 4f 70 65 6e 53 53 4c 5d 29 0a 5d 29 for OpenSSL]).])
21a0: 0a .