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 29 0a , [pkg-config]).
00e0: 0a 09 64 6e 6c 20 44 69 73 61 62 6c 65 20 73 75 ..dnl Disable su
00f0: 70 70 6f 72 74 20 66 6f 72 20 54 4c 53 20 31 2e pport for TLS 1.
0100: 30 20 70 72 6f 74 6f 63 6f 6c 0a 09 41 43 5f 41 0 protocol..AC_A
0110: 52 47 5f 45 4e 41 42 4c 45 28 5b 74 6c 73 31 5d RG_ENABLE([tls1]
0120: 2c 20 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 , AS_HELP_STRING
0130: 28 5b 2d 2d 64 69 73 61 62 6c 65 2d 74 6c 73 31 ([--disable-tls1
0140: 5d 2c 20 5b 64 69 73 61 62 6c 65 20 54 4c 53 31 ], [disable TLS1
0150: 20 70 72 6f 74 6f 63 6f 6c 5d 29 2c 20 5b 0a 09 protocol]), [..
0160: 09 69 66 20 74 65 73 74 20 22 24 7b 65 6e 61 62 .if test "${enab
0170: 6c 65 76 61 6c 7d 22 20 3d 3d 20 22 6e 6f 22 3b leval}" == "no";
0180: 20 74 68 65 6e 0a 09 09 09 41 43 5f 44 45 46 49 then....AC_DEFI
0190: 4e 45 28 5b 4e 4f 5f 54 4c 53 31 5d 2c 20 5b 31 NE([NO_TLS1], [1
01a0: 5d 2c 20 5b 44 69 73 61 62 6c 65 20 54 4c 53 31 ], [Disable TLS1
01b0: 20 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 protocol])....A
01c0: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b C_MSG_CHECKING([
01d0: 66 6f 72 20 64 69 73 61 62 6c 65 20 54 4c 53 31 for disable TLS1
01e0: 20 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 protocol])....A
01f0: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 79 65 C_MSG_RESULT([ye
0200: 73 5d 29 0a 09 09 66 69 0a 09 5d 29 0a 0a 09 64 s])...fi..])...d
0210: 6e 6c 20 44 69 73 61 62 6c 65 20 73 75 70 70 6f nl Disable suppo
0220: 72 74 20 66 6f 72 20 54 4c 53 20 31 2e 31 20 70 rt for TLS 1.1 p
0230: 72 6f 74 6f 63 6f 6c 0a 09 41 43 5f 41 52 47 5f rotocol..AC_ARG_
0240: 45 4e 41 42 4c 45 28 5b 74 6c 73 31 5f 31 5d 2c ENABLE([tls1_1],
0250: 20 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 AS_HELP_STRING(
0260: 5b 2d 2d 64 69 73 61 62 6c 65 2d 74 6c 73 31 5f [--disable-tls1_
0270: 31 5d 2c 20 5b 64 69 73 61 62 6c 65 20 54 4c 53 1], [disable TLS
0280: 31 2e 31 20 70 72 6f 74 6f 63 6f 6c 5d 29 2c 20 1.1 protocol]),
0290: 5b 0a 09 09 69 66 20 74 65 73 74 20 22 24 7b 65 [...if test "${e
02a0: 6e 61 62 6c 65 76 61 6c 7d 22 20 3d 3d 20 22 6e nableval}" == "n
02b0: 6f 22 3b 20 74 68 65 6e 0a 09 09 09 41 43 5f 44 o"; then....AC_D
02c0: 45 46 49 4e 45 28 5b 4e 4f 5f 54 4c 53 31 5f 31 EFINE([NO_TLS1_1
02d0: 5d 2c 20 5b 31 5d 2c 20 5b 44 69 73 61 62 6c 65 ], [1], [Disable
02e0: 20 54 4c 53 31 2e 31 20 70 72 6f 74 6f 63 6f 6c TLS1.1 protocol
02f0: 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 43 48 45 ])....AC_MSG_CHE
0300: 43 4b 49 4e 47 28 5b 66 6f 72 20 64 69 73 61 62 CKING([for disab
0310: 6c 65 20 54 4c 53 31 2e 31 20 70 72 6f 74 6f 63 le TLS1.1 protoc
0320: 6f 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 52 ol])....AC_MSG_R
0330: 45 53 55 4c 54 28 5b 79 65 73 5d 29 0a 09 09 66 ESULT([yes])...f
0340: 69 0a 09 5d 29 0a 0a 09 64 6e 6c 20 44 69 73 61 i..])...dnl Disa
0350: 62 6c 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 ble support for
0360: 54 4c 53 20 31 2e 32 20 70 72 6f 74 6f 63 6f 6c TLS 1.2 protocol
0370: 0a 09 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 ..AC_ARG_ENABLE(
0380: 5b 74 6c 73 31 5f 32 5d 2c 20 41 53 5f 48 45 4c [tls1_2], AS_HEL
0390: 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 64 69 73 61 P_STRING([--disa
03a0: 62 6c 65 2d 74 6c 73 31 5f 32 5d 2c 20 5b 64 69 ble-tls1_2], [di
03b0: 73 61 62 6c 65 20 54 4c 53 31 2e 32 20 70 72 6f sable TLS1.2 pro
03c0: 74 6f 63 6f 6c 5d 29 2c 20 5b 0a 09 09 69 66 20 tocol]), [...if
03d0: 74 65 73 74 20 22 24 7b 65 6e 61 62 6c 65 76 61 test "${enableva
03e0: 6c 7d 22 20 3d 3d 20 22 6e 6f 22 3b 20 74 68 65 l}" == "no"; the
03f0: 6e 0a 09 09 09 41 43 5f 44 45 46 49 4e 45 28 5b n....AC_DEFINE([
0400: 4e 4f 5f 54 4c 53 31 5f 32 5d 2c 20 5b 31 5d 2c NO_TLS1_2], [1],
0410: 20 5b 44 69 73 61 62 6c 65 20 54 4c 53 31 2e 32 [Disable TLS1.2
0420: 20 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 protocol])....A
0430: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b C_MSG_CHECKING([
0440: 66 6f 72 20 64 69 73 61 62 6c 65 20 54 4c 53 31 for disable TLS1
0450: 2e 32 20 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 .2 protocol])...
0460: 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b .AC_MSG_RESULT([
0470: 79 65 73 5d 29 0a 09 09 66 69 0a 09 5d 29 0a 0a yes])...fi..])..
0480: 09 64 6e 6c 20 44 69 73 61 62 6c 65 20 73 75 70 .dnl Disable sup
0490: 70 6f 72 74 20 66 6f 72 20 54 4c 53 20 31 2e 33 port for TLS 1.3
04a0: 20 70 72 6f 74 6f 63 6f 6c 0a 09 41 43 5f 41 52 protocol..AC_AR
04b0: 47 5f 45 4e 41 42 4c 45 28 5b 74 6c 73 31 5f 33 G_ENABLE([tls1_3
04c0: 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e ], AS_HELP_STRIN
04d0: 47 28 5b 2d 2d 64 69 73 61 62 6c 65 2d 74 6c 73 G([--disable-tls
04e0: 31 5f 33 5d 2c 20 5b 64 69 73 61 62 6c 65 20 54 1_3], [disable T
04f0: 4c 53 31 2e 33 20 70 72 6f 74 6f 63 6f 6c 5d 29 LS1.3 protocol])
0500: 2c 20 5b 0a 09 09 69 66 20 74 65 73 74 20 22 24 , [...if test "$
0510: 7b 65 6e 61 62 6c 65 76 61 6c 7d 22 20 3d 3d 20 {enableval}" ==
0520: 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 09 09 41 43 "no"; then....AC
0530: 5f 44 45 46 49 4e 45 28 5b 4e 4f 5f 54 4c 53 31 _DEFINE([NO_TLS1
0540: 5f 33 5d 2c 20 5b 31 5d 2c 20 5b 44 69 73 61 62 _3], [1], [Disab
0550: 6c 65 20 54 4c 53 31 2e 33 20 70 72 6f 74 6f 63 le TLS1.3 protoc
0560: 6f 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 43 ol])....AC_MSG_C
0570: 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 64 69 73 HECKING([for dis
0580: 61 62 6c 65 20 54 4c 53 31 2e 33 20 70 72 6f 74 able TLS1.3 prot
0590: 6f 63 6f 6c 5d 29 0a 09 09 09 41 43 5f 4d 53 47 ocol])....AC_MSG
05a0: 5f 52 45 53 55 4c 54 28 5b 79 65 73 5d 29 0a 09 _RESULT([yes])..
05b0: 09 66 69 0a 09 5d 29 0a 0a 0a 09 64 6e 6c 20 44 .fi..])....dnl D
05c0: 65 74 65 72 6d 69 6e 65 20 69 66 20 77 65 20 68 etermine if we h
05d0: 61 76 65 20 62 65 65 6e 20 61 73 6b 65 64 20 74 ave been asked t
05e0: 6f 20 75 73 65 20 61 20 66 61 73 74 20 70 61 74 o use a fast pat
05f0: 68 20 69 66 20 70 6f 73 73 69 62 6c 65 0a 09 41 h if possible..A
0600: 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b 73 73 C_ARG_ENABLE([ss
0610: 6c 2d 66 61 73 74 70 61 74 68 5d 2c 20 41 53 5f l-fastpath], AS_
0620: 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 HELP_STRING([--e
0630: 6e 61 62 6c 65 2d 73 73 6c 2d 66 61 73 74 70 61 nable-ssl-fastpa
0640: 74 68 5d 2c 0a 09 09 5b 65 6e 61 62 6c 65 20 75 th],...[enable u
0650: 73 69 6e 67 20 74 68 65 20 75 6e 64 65 72 6c 79 sing the underly
0660: 69 6e 67 20 66 69 6c 65 20 64 65 73 63 72 69 70 ing file descrip
0670: 74 6f 72 20 66 6f 72 20 74 61 6c 6b 69 6e 67 20 tor for talking
0680: 64 69 72 65 63 74 6c 79 20 74 6f 20 74 68 65 20 directly to the
0690: 53 53 4c 20 6c 69 62 72 61 72 79 5d 29 2c 20 5b SSL library]), [
06a0: 0a 09 09 74 63 6c 74 6c 73 5f 73 73 6c 5f 66 61 ...tcltls_ssl_fa
06b0: 73 74 70 61 74 68 3d 22 24 65 6e 61 62 6c 65 76 stpath="$enablev
06c0: 61 6c 22 0a 09 5d 2c 20 5b 0a 09 09 74 63 6c 74 al"..], [...tclt
06d0: 6c 73 5f 73 73 6c 5f 66 61 73 74 70 61 74 68 3d ls_ssl_fastpath=
06e0: 27 6e 6f 27 0a 09 5d 29 0a 09 69 66 20 74 65 73 'no'..])..if tes
06f0: 74 20 22 24 74 63 6c 74 6c 73 5f 73 73 6c 5f 66 t "$tcltls_ssl_f
0700: 61 73 74 70 61 74 68 22 20 3d 3d 20 27 79 65 73 astpath" == 'yes
0710: 27 3b 20 74 68 65 6e 0a 09 09 41 43 5f 44 45 46 '; then...AC_DEF
0720: 49 4e 45 28 54 43 4c 54 4c 53 5f 53 53 4c 5f 55 INE(TCLTLS_SSL_U
0730: 53 45 5f 46 41 53 54 50 41 54 48 2c 20 5b 31 5d SE_FASTPATH, [1]
0740: 2c 20 5b 45 6e 61 62 6c 65 20 53 53 4c 20 6c 69 , [Enable SSL li
0750: 62 72 61 72 79 20 64 69 72 65 63 74 20 75 73 65 brary direct use
0760: 20 6f 66 20 74 68 65 20 75 6e 64 65 72 6c 79 69 of the underlyi
0770: 6e 67 20 66 69 6c 65 20 64 65 73 63 72 69 70 74 ng file descript
0780: 6f 72 5d 29 0a 09 66 69 0a 09 41 43 5f 4d 53 47 or])..fi..AC_MSG
0790: 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 66 _CHECKING([for f
07a0: 61 73 74 20 70 61 74 68 5d 29 0a 09 41 43 5f 4d ast path])..AC_M
07b0: 53 47 5f 52 45 53 55 4c 54 28 5b 24 74 63 6c 74 SG_RESULT([$tclt
07c0: 6c 73 5f 73 73 6c 5f 66 61 73 74 70 61 74 68 5d ls_ssl_fastpath]
07d0: 29 0a 0a 0a 09 64 6e 6c 20 45 6e 61 62 6c 65 20 )....dnl Enable
07e0: 68 61 72 64 65 6e 69 6e 67 0a 09 41 43 5f 41 52 hardening..AC_AR
07f0: 47 5f 45 4e 41 42 4c 45 28 5b 68 61 72 64 65 6e G_ENABLE([harden
0800: 69 6e 67 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 ing], AS_HELP_ST
0810: 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 68 RING([--enable-h
0820: 61 72 64 65 6e 69 6e 67 5d 2c 20 5b 65 6e 61 62 ardening], [enab
0830: 6c 65 20 68 61 72 64 65 6e 69 6e 67 20 61 74 74 le hardening att
0840: 65 6d 70 74 73 5d 29 2c 20 5b 0a 09 09 74 63 6c empts]), [...tcl
0850: 74 6c 73 5f 65 6e 61 62 6c 65 5f 68 61 72 64 65 tls_enable_harde
0860: 6e 69 6e 67 3d 22 24 65 6e 61 62 6c 65 76 61 6c ning="$enableval
0870: 22 0a 09 5d 2c 20 5b 0a 09 09 74 63 6c 74 6c 73 "..], [...tcltls
0880: 5f 65 6e 61 62 6c 65 5f 68 61 72 64 65 6e 69 6e _enable_hardenin
0890: 67 3d 27 79 65 73 27 0a 09 5d 29 0a 09 69 66 20 g='yes'..])..if
08a0: 74 65 73 74 20 22 24 74 63 6c 74 6c 73 5f 65 6e test "$tcltls_en
08b0: 61 62 6c 65 5f 68 61 72 64 65 6e 69 6e 67 22 20 able_hardening"
08c0: 3d 3d 20 27 79 65 73 27 3b 20 74 68 65 6e 0a 09 == 'yes'; then..
08d0: 09 69 66 20 74 65 73 74 20 22 24 47 43 43 22 20 .if test "$GCC"
08e0: 3d 3d 20 27 79 65 73 27 20 2d 6f 20 22 24 43 43 == 'yes' -o "$CC
08f0: 22 20 3d 20 27 63 6c 61 6e 67 27 3b 20 74 68 65 " = 'clang'; the
0900: 6e 0a 09 09 09 54 45 41 5f 41 44 44 5f 43 46 4c n....TEA_ADD_CFL
0910: 41 47 53 28 5b 2d 66 73 74 61 63 6b 2d 70 72 6f AGS([-fstack-pro
0920: 74 65 63 74 6f 72 2d 61 6c 6c 5d 29 0a 09 09 09 tector-all])....
0930: 54 45 41 5f 41 44 44 5f 43 46 4c 41 47 53 28 5b TEA_ADD_CFLAGS([
0940: 2d 66 6e 6f 2d 73 74 72 69 63 74 2d 6f 76 65 72 -fno-strict-over
0950: 66 6c 6f 77 5d 29 0a 09 09 09 41 43 5f 44 45 46 flow])....AC_DEF
0960: 49 4e 45 28 5b 5f 46 4f 52 54 49 46 59 5f 53 4f INE([_FORTIFY_SO
0970: 55 52 43 45 5d 2c 20 5b 32 5d 2c 20 5b 45 6e 61 URCE], [2], [Ena
0980: 62 6c 65 20 66 6f 72 74 69 66 69 63 61 74 69 6f ble fortificatio
0990: 6e 5d 29 0a 09 09 66 69 0a 09 66 69 0a 09 41 43 n])...fi..fi..AC
09a0: 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 _MSG_CHECKING([f
09b0: 6f 72 20 65 6e 61 62 6c 65 20 68 61 72 64 65 6e or enable harden
09c0: 69 6e 67 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45 ing])..AC_MSG_RE
09d0: 53 55 4c 54 28 5b 24 74 63 6c 74 6c 73 5f 65 6e SULT([$tcltls_en
09e0: 61 62 6c 65 5f 68 61 72 64 65 6e 69 6e 67 5d 29 able_hardening])
09f0: 0a 0a 0a 09 64 6e 6c 20 44 65 74 65 72 6d 69 6e ....dnl Determin
0a00: 65 20 69 66 20 77 65 20 68 61 76 65 20 62 65 65 e if we have bee
0a10: 6e 20 61 73 6b 65 64 20 74 6f 20 73 74 61 74 69 n asked to stati
0a20: 63 61 6c 6c 79 20 6c 69 6e 6b 20 74 6f 20 74 68 cally link to th
0a30: 65 20 53 53 4c 20 6c 69 62 72 61 72 79 0a 09 41 e SSL library..A
0a40: 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b 73 74 C_ARG_ENABLE([st
0a50: 61 74 69 63 2d 73 73 6c 5d 2c 20 41 53 5f 48 45 atic-ssl], AS_HE
0a60: 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 LP_STRING([--ena
0a70: 62 6c 65 2d 73 74 61 74 69 63 2d 73 73 6c 5d 2c ble-static-ssl],
0a80: 20 5b 65 6e 61 62 6c 65 20 73 74 61 74 69 63 20 [enable static
0a90: 6c 69 6e 6b 69 6e 67 20 74 6f 20 74 68 65 20 53 linking to the S
0aa0: 53 4c 20 6c 69 62 72 61 72 79 5d 29 2c 20 5b 0a SL library]), [.
0ab0: 09 09 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 ..TCLEXT_TLS_STA
0ac0: 54 49 43 5f 53 53 4c 3d 22 24 65 6e 61 62 6c 65 TIC_SSL="$enable
0ad0: 76 61 6c 22 0a 09 5d 2c 20 5b 0a 09 09 54 43 4c val"..], [...TCL
0ae0: 45 58 54 5f 54 4c 53 5f 53 54 41 54 49 43 5f 53 EXT_TLS_STATIC_S
0af0: 53 4c 3d 27 6e 6f 27 0a 09 5d 29 0a 09 41 43 5f SL='no'..])..AC_
0b00: 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f MSG_CHECKING([fo
0b10: 72 20 73 74 61 74 69 63 20 6c 69 6e 6b 69 6e 67 r static linking
0b20: 20 6f 66 20 6f 70 65 6e 53 53 4c 20 6c 69 62 72 of openSSL libr
0b30: 61 72 69 65 73 5d 29 0a 09 41 43 5f 4d 53 47 5f aries])..AC_MSG_
0b40: 52 45 53 55 4c 54 28 5b 24 54 43 4c 45 58 54 5f RESULT([$TCLEXT_
0b50: 54 4c 53 5f 53 54 41 54 49 43 5f 53 53 4c 5d 29 TLS_STATIC_SSL])
0b60: 0a 0a 0a 09 64 6e 6c 20 53 65 74 20 53 53 4c 20 ....dnl Set SSL
0b70: 66 69 6c 65 73 20 72 6f 6f 74 20 70 61 74 68 0a files root path.
0b80: 09 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 6f 70 .AC_ARG_WITH([op
0b90: 65 6e 73 73 6c 2d 64 69 72 5d 2c 0a 09 09 41 53 enssl-dir],...AS
0ba0: 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d _HELP_STRING([--
0bb0: 77 69 74 68 2d 6f 70 65 6e 73 73 6c 2d 64 69 72 with-openssl-dir
0bc0: 3d 3c 64 69 72 3e 5d 2c 0a 09 09 09 5b 70 61 74 =<dir>],....[pat
0bd0: 68 20 74 6f 20 72 6f 6f 74 20 64 69 72 65 63 74 h to root direct
0be0: 6f 72 79 20 6f 66 20 4f 70 65 6e 53 53 4c 20 6f ory of OpenSSL o
0bf0: 72 20 4c 69 62 72 65 53 53 4c 20 69 6e 73 74 61 r LibreSSL insta
0c00: 6c 6c 61 74 69 6f 6e 5d 0a 09 09 29 2c 20 5b 0a llation]...), [.
0c10: 09 09 09 6f 70 65 6e 73 73 6c 64 69 72 3d 22 24 ...openssldir="$
0c20: 77 69 74 68 76 61 6c 22 0a 09 09 5d 2c 20 5b 0a withval"...], [.
0c30: 09 09 09 6f 70 65 6e 73 73 6c 64 69 72 3d 27 27 ...openssldir=''
0c40: 0a 09 09 5d 0a 09 29 0a 09 41 43 5f 4d 53 47 5f ...]..)..AC_MSG_
0c50: 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 4f 70 CHECKING([for Op
0c60: 65 6e 53 53 4c 20 64 69 72 65 63 74 6f 72 79 5d enSSL directory]
0c70: 29 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 )..AC_MSG_RESULT
0c80: 28 24 6f 70 65 6e 73 73 6c 64 69 72 29 0a 0a 09 ($openssldir)...
0c90: 64 6e 6c 20 53 65 74 20 53 53 4c 20 69 6e 63 6c dnl Set SSL incl
0ca0: 75 64 65 20 66 69 6c 65 73 20 70 61 74 68 0a 09 ude files path..
0cb0: 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 6f 70 65 AC_ARG_WITH([ope
0cc0: 6e 73 73 6c 2d 69 6e 63 6c 75 64 65 64 69 72 5d nssl-includedir]
0cd0: 2c 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 49 ,...AS_HELP_STRI
0ce0: 4e 47 28 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 NG([--with-opens
0cf0: 73 6c 2d 69 6e 63 6c 75 64 65 64 69 72 3d 3c 64 sl-includedir=<d
0d00: 69 72 3e 5d 2c 0a 09 09 09 5b 70 61 74 68 20 74 ir>],....[path t
0d10: 6f 20 69 6e 63 6c 75 64 65 20 64 69 72 65 63 74 o include direct
0d20: 6f 72 79 20 6f 66 20 4f 70 65 6e 53 53 4c 20 6f ory of OpenSSL o
0d30: 72 20 4c 69 62 72 65 53 53 4c 20 69 6e 73 74 61 r LibreSSL insta
0d40: 6c 6c 61 74 69 6f 6e 5d 0a 09 09 29 2c 20 5b 0a llation]...), [.
0d50: 09 09 09 6f 70 65 6e 73 73 6c 69 6e 63 6c 75 64 ...opensslinclud
0d60: 65 64 69 72 3d 22 24 77 69 74 68 76 61 6c 22 0a edir="$withval".
0d70: 09 09 5d 2c 20 5b 0a 09 09 09 69 66 20 74 65 73 ..], [....if tes
0d80: 74 20 2d 6e 20 22 24 6f 70 65 6e 73 73 6c 64 69 t -n "$openssldi
0d90: 72 22 3b 20 74 68 65 6e 0a 09 09 09 09 6f 70 65 r"; then.....ope
0da0: 6e 73 73 6c 69 6e 63 6c 75 64 65 64 69 72 3d 22 nsslincludedir="
0db0: 24 7b 6f 70 65 6e 73 73 6c 64 69 72 7d 2f 69 6e ${openssldir}/in
0dc0: 63 6c 75 64 65 22 0a 09 09 09 65 6c 73 65 0a 09 clude"....else..
0dd0: 09 09 09 6f 70 65 6e 73 73 6c 69 6e 63 6c 75 64 ...opensslinclud
0de0: 65 64 69 72 3d 27 27 0a 09 09 09 66 69 0a 09 09 edir=''....fi...
0df0: 5d 0a 09 29 0a 09 41 43 5f 4d 53 47 5f 43 48 45 ]..)..AC_MSG_CHE
0e00: 43 4b 49 4e 47 28 5b 66 6f 72 20 4f 70 65 6e 53 CKING([for OpenS
0e10: 53 4c 20 69 6e 63 6c 75 64 65 20 64 69 72 65 63 SL include direc
0e20: 74 6f 72 79 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 tory])..AC_MSG_R
0e30: 45 53 55 4c 54 28 24 6f 70 65 6e 73 73 6c 69 6e ESULT($opensslin
0e40: 63 6c 75 64 65 64 69 72 29 0a 0a 09 64 6e 6c 20 cludedir)...dnl
0e50: 53 65 74 20 53 53 4c 20 69 6e 63 6c 75 64 65 20 Set SSL include
0e60: 76 61 72 73 0a 09 69 66 20 74 65 73 74 20 2d 6e vars..if test -n
0e70: 20 22 24 6f 70 65 6e 73 73 6c 69 6e 63 6c 75 64 "$opensslinclud
0e80: 65 64 69 72 22 3b 20 74 68 65 6e 0a 09 09 69 66 edir"; then...if
0e90: 20 74 65 73 74 20 2d 66 20 22 24 6f 70 65 6e 73 test -f "$opens
0ea0: 73 6c 69 6e 63 6c 75 64 65 64 69 72 2f 6f 70 65 slincludedir/ope
0eb0: 6e 73 73 6c 2f 73 73 6c 2e 68 22 3b 20 74 68 65 nssl/ssl.h"; the
0ec0: 6e 0a 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f n....TCLTLS_SSL_
0ed0: 43 46 4c 41 47 53 3d 22 2d 49 24 6f 70 65 6e 73 CFLAGS="-I$opens
0ee0: 73 6c 69 6e 63 6c 75 64 65 64 69 72 22 0a 09 09 slincludedir"...
0ef0: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e 43 4c .TCLTLS_SSL_INCL
0f00: 55 44 45 53 3d 22 2d 49 24 6f 70 65 6e 73 73 6c UDES="-I$openssl
0f10: 69 6e 63 6c 75 64 65 64 69 72 22 0a 09 09 09 41 includedir"....A
0f20: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b C_MSG_CHECKING([
0f30: 66 6f 72 20 73 73 6c 2e 68 5d 29 0a 09 09 09 41 for ssl.h])....A
0f40: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 79 65 C_MSG_RESULT([ye
0f50: 73 5d 29 0a 09 09 65 6c 73 65 0a 09 09 09 41 43 s])...else....AC
0f60: 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 _MSG_CHECKING([f
0f70: 6f 72 20 73 73 6c 2e 68 5d 29 0a 09 09 09 41 43 or ssl.h])....AC
0f80: 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e 6f 5d _MSG_RESULT([no]
0f90: 29 0a 09 09 09 41 43 5f 4d 53 47 5f 45 52 52 4f )....AC_MSG_ERRO
0fa0: 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 6c 6f 63 R([Unable to loc
0fb0: 61 74 65 20 73 73 6c 2e 68 5d 29 0a 09 09 66 69 ate ssl.h])...fi
0fc0: 0a 09 66 69 0a 0a 09 64 6e 6c 20 53 65 74 20 53 ..fi...dnl Set S
0fd0: 53 4c 20 6c 69 62 20 66 69 6c 65 73 20 70 61 74 SL lib files pat
0fe0: 68 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28 5b h..AC_ARG_WITH([
0ff0: 6f 70 65 6e 73 73 6c 2d 6c 69 62 64 69 72 5d 2c openssl-libdir],
1000: 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e ...AS_HELP_STRIN
1010: 47 28 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 73 G([--with-openss
1020: 6c 2d 6c 69 62 64 69 72 3d 3c 64 69 72 3e 5d 2c l-libdir=<dir>],
1030: 0a 09 09 09 5b 70 61 74 68 20 74 6f 20 6c 69 62 ....[path to lib
1040: 20 64 69 72 65 63 74 6f 72 79 20 6f 66 20 4f 70 directory of Op
1050: 65 6e 53 53 4c 20 6f 72 20 4c 69 62 72 65 53 53 enSSL or LibreSS
1060: 4c 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 5d 0a L installation].
1070: 09 09 29 2c 20 5b 0a 09 09 09 6f 70 65 6e 73 73 ..), [....openss
1080: 6c 6c 69 62 64 69 72 3d 22 24 77 69 74 68 76 61 llibdir="$withva
1090: 6c 22 0a 09 09 5d 2c 20 5b 0a 09 09 09 69 66 20 l"...], [....if
10a0: 74 65 73 74 20 2d 6e 20 22 24 6f 70 65 6e 73 73 test -n "$openss
10b0: 6c 64 69 72 22 3b 20 74 68 65 6e 0a 09 09 09 09 ldir"; then.....
10c0: 69 66 20 74 65 73 74 20 22 24 64 6f 36 34 62 69 if test "$do64bi
10d0: 74 22 20 3d 3d 20 27 79 65 73 27 3b 20 74 68 65 t" == 'yes'; the
10e0: 6e 0a 09 09 09 09 09 6f 70 65 6e 73 73 6c 6c 69 n......opensslli
10f0: 62 64 69 72 3d 22 24 6f 70 65 6e 73 73 6c 64 69 bdir="$openssldi
1100: 72 2f 6c 69 62 36 34 22 0a 09 09 09 09 65 6c 73 r/lib64".....els
1110: 65 0a 09 09 09 09 09 6f 70 65 6e 73 73 6c 6c 69 e......opensslli
1120: 62 64 69 72 3d 22 24 6f 70 65 6e 73 73 6c 64 69 bdir="$openssldi
1130: 72 2f 6c 69 62 22 0a 09 09 09 09 66 69 0a 09 09 r/lib".....fi...
1140: 09 65 6c 73 65 0a 09 09 09 09 6f 70 65 6e 73 73 .else.....openss
1150: 6c 6c 69 62 64 69 72 3d 27 27 0a 09 09 09 66 69 llibdir=''....fi
1160: 0a 09 09 5d 0a 09 29 0a 09 41 43 5f 4d 53 47 5f ...]..)..AC_MSG_
1170: 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 4f 70 CHECKING([for Op
1180: 65 6e 53 53 4c 20 6c 69 62 20 64 69 72 65 63 74 enSSL lib direct
1190: 6f 72 79 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45 ory])..AC_MSG_RE
11a0: 53 55 4c 54 28 24 6f 70 65 6e 73 73 6c 6c 69 62 SULT($openssllib
11b0: 64 69 72 29 0a 0a 09 64 6e 6c 20 53 65 74 20 53 dir)...dnl Set S
11c0: 53 4c 20 6c 69 62 20 76 61 72 73 0a 09 53 53 4c SL lib vars..SSL
11d0: 5f 4c 49 42 53 5f 50 41 54 48 3d 27 27 0a 09 69 _LIBS_PATH=''..i
11e0: 66 20 74 65 73 74 20 2d 6e 20 22 24 6f 70 65 6e f test -n "$open
11f0: 73 73 6c 6c 69 62 64 69 72 22 3b 20 74 68 65 6e ssllibdir"; then
1200: 0a 09 09 69 66 20 74 65 73 74 20 2d 66 20 22 24 ...if test -f "$
1210: 6f 70 65 6e 73 73 6c 6c 69 62 64 69 72 2f 6c 69 openssllibdir/li
1220: 62 73 73 6c 24 7b 53 48 4c 49 42 5f 53 55 46 46 bssl${SHLIB_SUFF
1230: 49 58 7d 22 3b 20 74 68 65 6e 0a 09 09 09 53 53 IX}"; then....SS
1240: 4c 5f 4c 49 42 53 5f 50 41 54 48 3d 22 2d 4c 24 L_LIBS_PATH="-L$
1250: 6f 70 65 6e 73 73 6c 6c 69 62 64 69 72 22 0a 09 openssllibdir"..
1260: 09 65 6c 73 65 0a 09 09 09 41 43 5f 4d 53 47 5f .else....AC_MSG_
1270: 45 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f ERROR([Unable to
1280: 20 6c 6f 63 61 74 65 20 6c 69 62 73 73 6c 24 7b locate libssl${
1290: 53 48 4c 49 42 5f 53 55 46 46 49 58 7d 5d 29 0a SHLIB_SUFFIX}]).
12a0: 09 09 66 69 0a 09 66 69 0a 0a 09 64 6e 6c 20 53 ..fi..fi...dnl S
12b0: 65 74 20 6c 6f 63 61 74 69 6f 6e 20 6f 66 20 70 et location of p
12c0: 6b 67 63 6f 6e 66 69 67 20 66 69 6c 65 73 0a 09 kgconfig files..
12d0: 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 6f 70 65 AC_ARG_WITH([ope
12e0: 6e 73 73 6c 2d 70 6b 67 63 6f 6e 66 69 67 5d 2c nssl-pkgconfig],
12f0: 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e ...AS_HELP_STRIN
1300: 47 28 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 73 G([--with-openss
1310: 6c 2d 70 6b 67 63 6f 6e 66 69 67 3d 3c 64 69 72 l-pkgconfig=<dir
1320: 3e 5d 2c 0a 09 09 09 5b 70 61 74 68 20 74 6f 20 >],....[path to
1330: 70 6b 67 63 6f 6e 66 69 67 64 69 72 20 64 69 72 pkgconfigdir dir
1340: 65 63 74 6f 72 79 20 66 6f 72 20 4f 70 65 6e 53 ectory for OpenS
1350: 53 4c 20 6f 72 20 4c 69 62 72 65 53 53 4c 5d 0a SL or LibreSSL].
1360: 09 09 29 2c 20 5b 0a 09 09 09 6f 70 65 6e 73 73 ..), [....openss
1370: 6c 70 6b 67 63 6f 6e 66 69 67 64 69 72 3d 22 24 lpkgconfigdir="$
1380: 77 69 74 68 76 61 6c 22 0a 09 09 5d 2c 20 5b 0a withval"...], [.
1390: 09 09 09 69 66 20 74 65 73 74 20 2d 64 20 24 7b ...if test -d ${
13a0: 6c 69 62 64 69 72 7d 2f 2e 2e 2f 70 6b 67 63 6f libdir}/../pkgco
13b0: 6e 66 69 67 3b 20 74 68 65 6e 0a 09 09 09 09 6f nfig; then.....o
13c0: 70 65 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 pensslpkgconfigd
13d0: 69 72 3d 22 24 6c 69 62 64 69 72 2f 2e 2e 2f 70 ir="$libdir/../p
13e0: 6b 67 63 6f 6e 66 69 67 22 0a 09 09 09 65 6c 73 kgconfig"....els
13f0: 65 0a 09 09 09 09 6f 70 65 6e 73 73 6c 70 6b 67 e.....opensslpkg
1400: 63 6f 6e 66 69 67 64 69 72 3d 27 27 0a 09 09 09 configdir=''....
1410: 66 69 0a 09 09 5d 0a 09 29 0a 09 41 43 5f 4d 53 fi...]..)..AC_MS
1420: 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 G_CHECKING([for
1430: 4f 70 65 6e 53 53 4c 20 70 6b 67 63 6f 6e 66 69 OpenSSL pkgconfi
1440: 67 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 g])..AC_MSG_RESU
1450: 4c 54 28 24 6f 70 65 6e 73 73 6c 70 6b 67 63 6f LT($opensslpkgco
1460: 6e 66 69 67 64 69 72 29 0a 0a 09 64 6e 6c 20 55 nfigdir)...dnl U
1470: 73 65 20 70 6b 67 2d 63 6f 6e 66 69 67 20 74 6f se pkg-config to
1480: 20 66 69 6e 64 20 74 68 65 20 6c 69 62 72 61 72 find the librar
1490: 79 20 6e 61 6d 65 73 0a 09 69 66 20 74 65 73 74 y names..if test
14a0: 20 2d 6e 20 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 -n "${PKG_CONFI
14b0: 47 7d 22 3b 20 74 68 65 6e 0a 09 09 64 6e 6c 20 G}"; then...dnl
14c0: 54 65 6d 70 6f 72 61 72 69 6c 79 20 75 70 64 61 Temporarily upda
14d0: 74 65 20 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 te PKG_CONFIG_PA
14e0: 54 48 0a 09 09 50 4b 47 5f 43 4f 4e 46 49 47 5f TH...PKG_CONFIG_
14f0: 50 41 54 48 5f 53 41 56 45 3d 22 24 7b 50 4b 47 PATH_SAVE="${PKG
1500: 5f 43 4f 4e 46 49 47 5f 50 41 54 48 7d 22 0a 09 _CONFIG_PATH}"..
1510: 09 69 66 20 74 65 73 74 20 2d 6e 20 22 24 7b 6f .if test -n "${o
1520: 70 65 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 pensslpkgconfigd
1530: 69 72 7d 22 3b 20 74 68 65 6e 0a 09 09 09 69 66 ir}"; then....if
1540: 20 21 20 74 65 73 74 20 2d 66 20 22 24 7b 6f 70 ! test -f "${op
1550: 65 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 69 ensslpkgconfigdi
1560: 72 7d 2f 6f 70 65 6e 73 73 6c 2e 70 63 22 3b 20 r}/openssl.pc";
1570: 74 68 65 6e 0a 09 09 09 09 41 43 5f 4d 53 47 5f then.....AC_MSG_
1580: 45 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f ERROR([Unable to
1590: 20 6c 6f 63 61 74 65 20 24 7b 6f 70 65 6e 73 73 locate ${openss
15a0: 6c 70 6b 67 63 6f 6e 66 69 67 64 69 72 7d 2f 6f lpkgconfigdir}/o
15b0: 70 65 6e 73 73 6c 2e 70 63 5d 29 0a 09 09 09 66 penssl.pc])....f
15c0: 69 0a 0a 09 09 09 50 4b 47 5f 43 4f 4e 46 49 47 i.....PKG_CONFIG
15d0: 5f 50 41 54 48 3d 22 24 7b 6f 70 65 6e 73 73 6c _PATH="${openssl
15e0: 70 6b 67 63 6f 6e 66 69 67 64 69 72 7d 3a 24 7b pkgconfigdir}:${
15f0: 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48 7d PKG_CONFIG_PATH}
1600: 22 0a 09 09 09 65 78 70 6f 72 74 20 50 4b 47 5f "....export PKG_
1610: 43 4f 4e 46 49 47 5f 50 41 54 48 0a 09 09 66 69 CONFIG_PATH...fi
1620: 0a 0a 09 09 70 6b 67 43 6f 6e 66 69 67 45 78 74 ....pkgConfigExt
1630: 72 61 41 72 67 73 3d 27 27 0a 09 09 69 66 20 74 raArgs=''...if t
1640: 65 73 74 20 22 24 7b 53 48 41 52 45 44 5f 42 55 est "${SHARED_BU
1650: 49 4c 44 7d 22 20 3d 3d 20 22 30 22 20 2d 6f 20 ILD}" == "0" -o
1660: 22 24 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 "$TCLEXT_TLS_STA
1670: 54 49 43 5f 53 53 4c 22 20 3d 3d 20 27 79 65 73 TIC_SSL" == 'yes
1680: 27 3b 20 74 68 65 6e 0a 09 09 09 70 6b 67 43 6f '; then....pkgCo
1690: 6e 66 69 67 45 78 74 72 61 41 72 67 73 3d 27 2d nfigExtraArgs='-
16a0: 2d 73 74 61 74 69 63 27 0a 09 09 66 69 0a 0a 09 -static'...fi...
16b0: 09 69 66 20 74 65 73 74 20 2d 7a 20 22 24 54 43 .if test -z "$TC
16c0: 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 22 3b 20 LTLS_SSL_LIBS";
16d0: 74 68 65 6e 0a 09 09 09 54 43 4c 54 4c 53 5f 53 then....TCLTLS_S
16e0: 53 4c 5f 4c 49 42 53 3d 22 24 53 53 4c 5f 4c 49 SL_LIBS="$SSL_LI
16f0: 42 53 5f 50 41 54 48 20 60 24 7b 50 4b 47 5f 43 BS_PATH `${PKG_C
1700: 4f 4e 46 49 47 7d 20 6f 70 65 6e 73 73 6c 20 2d ONFIG} openssl -
1710: 2d 6c 69 62 73 20 24 70 6b 67 43 6f 6e 66 69 67 -libs $pkgConfig
1720: 45 78 74 72 61 41 72 67 73 60 22 20 7c 7c 20 41 ExtraArgs`" || A
1730: 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55 6e 61 C_MSG_ERROR([Una
1740: 62 6c 65 20 74 6f 20 67 65 74 20 4f 70 65 6e 53 ble to get OpenS
1750: 53 4c 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e SL Configuration
1760: 5d 29 0a 09 09 09 69 66 20 74 65 73 74 20 22 24 ])....if test "$
1770: 7b 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54 {TCLEXT_TLS_STAT
1780: 49 43 5f 53 53 4c 7d 22 20 3d 3d 20 27 79 65 73 IC_SSL}" == 'yes
1790: 27 3b 20 74 68 65 6e 0a 09 09 09 09 54 43 4c 54 '; then.....TCLT
17a0: 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d 22 2d 57 6c LS_SSL_LIBS="-Wl
17b0: 2c 2d 42 73 74 61 74 69 63 20 24 54 43 4c 54 4c ,-Bstatic $TCLTL
17c0: 53 5f 53 53 4c 5f 4c 49 42 53 20 2d 57 6c 2c 2d S_SSL_LIBS -Wl,-
17d0: 42 64 79 6e 61 6d 69 63 22 0a 09 09 09 66 69 0a Bdynamic"....fi.
17e0: 09 09 66 69 0a 09 09 69 66 20 74 65 73 74 20 2d ..fi...if test -
17f0: 7a 20 22 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 z "$TCLTLS_SSL_C
1800: 46 4c 41 47 53 22 3b 20 74 68 65 6e 0a 09 09 09 FLAGS"; then....
1810: 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 TCLTLS_SSL_CFLAG
1820: 53 3d 22 60 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 S="`"${PKG_CONFI
1830: 47 7d 22 20 6f 70 65 6e 73 73 6c 20 2d 2d 63 66 G}" openssl --cf
1840: 6c 61 67 73 2d 6f 6e 6c 79 2d 6f 74 68 65 72 20 lags-only-other
1850: 24 70 6b 67 43 6f 6e 66 69 67 45 78 74 72 61 41 $pkgConfigExtraA
1860: 72 67 73 60 22 20 7c 7c 20 41 43 5f 4d 53 47 5f rgs`" || AC_MSG_
1870: 45 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f ERROR([Unable to
1880: 20 67 65 74 20 4f 70 65 6e 53 53 4c 20 43 6f 6e get OpenSSL Con
1890: 66 69 67 75 72 61 74 69 6f 6e 5d 29 0a 09 09 66 figuration])...f
18a0: 69 0a 09 09 69 66 20 74 65 73 74 20 2d 7a 20 22 i...if test -z "
18b0: 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e 43 4c $TCLTLS_SSL_INCL
18c0: 55 44 45 53 22 3b 20 74 68 65 6e 0a 09 09 09 54 UDES"; then....T
18d0: 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e 43 4c 55 44 CLTLS_SSL_INCLUD
18e0: 45 53 3d 22 60 22 24 7b 50 4b 47 5f 43 4f 4e 46 ES="`"${PKG_CONF
18f0: 49 47 7d 22 20 6f 70 65 6e 73 73 6c 20 2d 2d 63 IG}" openssl --c
1900: 66 6c 61 67 73 2d 6f 6e 6c 79 2d 49 20 24 70 6b flags-only-I $pk
1910: 67 43 6f 6e 66 69 67 45 78 74 72 61 41 72 67 73 gConfigExtraArgs
1920: 60 22 20 7c 7c 20 41 43 5f 4d 53 47 5f 45 52 52 `" || AC_MSG_ERR
1930: 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 67 65 OR([Unable to ge
1940: 74 20 4f 70 65 6e 53 53 4c 20 43 6f 6e 66 69 67 t OpenSSL Config
1950: 75 72 61 74 69 6f 6e 5d 29 0a 09 09 66 69 0a 09 uration])...fi..
1960: 09 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48 .PKG_CONFIG_PATH
1970: 3d 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 ="${PKG_CONFIG_P
1980: 41 54 48 5f 53 41 56 45 7d 22 0a 09 66 69 0a 0a ATH_SAVE}"..fi..
1990: 09 64 6e 6c 20 46 61 6c 6c 62 61 63 6b 20 73 65 .dnl Fallback se
19a0: 74 74 69 6e 67 73 20 66 6f 72 20 4f 70 65 6e 53 ttings for OpenS
19b0: 53 4c 20 69 6e 63 6c 75 64 65 73 20 61 6e 64 20 SL includes and
19c0: 6c 69 62 73 0a 09 69 66 20 74 65 73 74 20 2d 7a libs..if test -z
19d0: 20 22 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 "$TCLTLS_SSL_CF
19e0: 4c 41 47 53 22 3b 20 74 68 65 6e 0a 09 09 54 43 LAGS"; then...TC
19f0: 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53 3d LTLS_SSL_CFLAGS=
1a00: 22 22 0a 09 66 69 0a 09 69 66 20 74 65 73 74 20 ""..fi..if test
1a10: 2d 7a 20 22 24 54 43 4c 54 4c 53 5f 53 53 4c 5f -z "$TCLTLS_SSL_
1a20: 49 4e 43 4c 55 44 45 53 22 3b 20 74 68 65 6e 0a INCLUDES"; then.
1a30: 09 09 69 66 20 74 65 73 74 20 2d 66 20 2f 75 73 ..if test -f /us
1a40: 72 2f 69 6e 63 6c 75 64 65 2f 6f 70 65 6e 73 73 r/include/openss
1a50: 6c 2f 73 73 6c 2e 68 3b 20 74 68 65 6e 0a 09 09 l/ssl.h; then...
1a60: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e 43 4c .TCLTLS_SSL_INCL
1a70: 55 44 45 53 3d 22 2d 49 2f 75 73 72 2f 69 6e 63 UDES="-I/usr/inc
1a80: 6c 75 64 65 22 0a 09 09 66 69 0a 09 66 69 0a 09 lude"...fi..fi..
1a90: 69 66 20 74 65 73 74 20 2d 7a 20 22 24 54 43 4c if test -z "$TCL
1aa0: 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 22 3b 20 74 TLS_SSL_LIBS"; t
1ab0: 68 65 6e 0a 09 09 69 66 20 74 65 73 74 20 22 24 hen...if test "$
1ac0: 7b 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54 {TCLEXT_TLS_STAT
1ad0: 49 43 5f 53 53 4c 7d 22 20 3d 3d 20 27 6e 6f 27 IC_SSL}" == 'no'
1ae0: 3b 20 74 68 65 6e 0a 09 09 20 20 20 20 54 43 4c ; then... TCL
1af0: 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d 22 24 53 TLS_SSL_LIBS="$S
1b00: 53 4c 5f 4c 49 42 53 5f 50 41 54 48 20 2d 6c 73 SL_LIBS_PATH -ls
1b10: 73 6c 20 2d 6c 63 72 79 70 74 6f 22 0a 09 09 65 sl -lcrypto"...e
1b20: 6c 73 65 0a 09 09 20 20 20 20 23 20 4c 69 6e 75 lse... # Linu
1b30: 78 20 61 6e 64 20 53 6f 6c 61 72 69 73 0a 09 09 x and Solaris...
1b40: 20 20 20 20 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c TCLTLS_SSL_L
1b50: 49 42 53 3d 22 24 53 53 4c 5f 4c 49 42 53 5f 50 IBS="$SSL_LIBS_P
1b60: 41 54 48 20 2d 57 6c 2c 2d 42 73 74 61 74 69 63 ATH -Wl,-Bstatic
1b70: 20 2d 6c 73 73 6c 20 2d 6c 63 72 79 70 74 6f 20 -lssl -lcrypto
1b80: 2d 57 6c 2c 2d 42 64 79 6e 61 6d 69 63 22 0a 09 -Wl,-Bdynamic"..
1b90: 09 20 20 20 20 23 20 48 50 55 58 3a 20 2d 57 6c . # HPUX: -Wl
1ba0: 2c 2d 61 2c 61 72 63 68 69 76 65 20 2e 2e 2e 20 ,-a,archive ...
1bb0: 2d 57 6c 2c 2d 61 2c 73 68 61 72 65 64 5f 61 72 -Wl,-a,shared_ar
1bc0: 63 68 69 76 65 0a 09 09 66 69 0a 09 66 69 0a 0a chive...fi..fi..
1bd0: 09 64 6e 6c 20 49 6e 63 6c 75 64 65 20 63 6f 6e .dnl Include con
1be0: 66 69 67 20 76 61 72 69 61 62 6c 65 73 20 69 6e fig variables in
1bf0: 20 2d 2d 68 65 6c 70 20 6c 69 73 74 20 61 6e 64 --help list and
1c00: 20 6d 61 6b 65 20 61 76 61 69 6c 61 62 6c 65 20 make available
1c10: 74 6f 20 62 65 20 73 75 62 73 74 69 74 75 74 65 to be substitute
1c20: 64 20 76 69 61 20 41 43 5f 53 55 42 53 54 2e 0a d via AC_SUBST..
1c30: 09 41 43 5f 41 52 47 5f 56 41 52 28 5b 54 43 4c .AC_ARG_VAR([TCL
1c40: 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53 5d 2c TLS_SSL_CFLAGS],
1c50: 20 5b 43 20 63 6f 6d 70 69 6c 65 72 20 66 6c 61 [C compiler fla
1c60: 67 73 20 66 6f 72 20 4f 70 65 6e 53 53 4c 20 6f gs for OpenSSL o
1c70: 72 20 4c 69 62 72 65 53 53 4c 5d 29 0a 09 41 43 r LibreSSL])..AC
1c80: 5f 41 52 47 5f 56 41 52 28 5b 54 43 4c 54 4c 53 _ARG_VAR([TCLTLS
1c90: 5f 53 53 4c 5f 49 4e 43 4c 55 44 45 53 5d 2c 20 _SSL_INCLUDES],
1ca0: 5b 43 20 63 6f 6d 70 69 6c 65 72 20 69 6e 63 6c [C compiler incl
1cb0: 75 64 65 20 70 61 74 68 73 20 66 6f 72 20 4f 70 ude paths for Op
1cc0: 65 6e 53 53 4c 20 6f 72 20 4c 69 62 72 65 53 53 enSSL or LibreSS
1cd0: 4c 5d 29 0a 09 41 43 5f 41 52 47 5f 56 41 52 28 L])..AC_ARG_VAR(
1ce0: 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 [TCLTLS_SSL_LIBS
1cf0: 5d 2c 20 5b 6c 69 62 72 61 72 69 65 73 20 74 6f ], [libraries to
1d00: 20 70 61 73 73 20 74 6f 20 74 68 65 20 6c 69 6e pass to the lin
1d10: 6b 65 72 20 66 6f 72 20 4f 70 65 6e 53 53 4c 20 ker for OpenSSL
1d20: 6f 72 20 4c 69 62 72 65 53 53 4c 5d 29 0a 5d 29 or LibreSSL]).])
1d30: 0a .