Hex Artifact Content

Artifact 526e90fa5a89a85bb650baf4adbb8ec3caaf150c1a6408e7494b66b0ed4c1ea8:


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 0a 09 69 66 20 74 65 73  dy found..if tes
1800: 74 20 2d 6e 20 22 24 50 4b 47 5f 43 4f 4e 46 49  t -n "$PKG_CONFI
1810: 47 22 20 2d 61 20 2d 7a 20 22 24 6f 70 65 6e 73  G" -a -z "$opens
1820: 73 6c 64 69 72 22 20 2d 61 20 2d 7a 20 22 24 6f  sldir" -a -z "$o
1830: 70 65 6e 73 73 6c 69 6e 63 6c 75 64 65 64 69 72  pensslincludedir
1840: 22 20 2d 61 20 2d 7a 20 22 24 6f 70 65 6e 73 73  " -a -z "$openss
1850: 6c 6c 69 62 64 69 72 22 3b 20 74 68 65 6e 0a 09  llibdir"; then..
1860: 20 20 20 20 55 53 45 5f 50 4b 47 5f 43 4f 4e 46      USE_PKG_CONF
1870: 49 47 3d 60 22 24 7b 50 4b 47 5f 43 4f 4e 46 49  IG=`"${PKG_CONFI
1880: 47 7d 22 20 2d 2d 6c 69 73 74 2d 61 6c 6c 20 7c  G}" --list-all |
1890: 20 67 72 65 70 20 6f 70 65 6e 73 73 6c 20 7c 20   grep openssl | 
18a0: 75 6e 69 71 60 0a 0a 09 20 20 20 20 64 6e 6c 20  uniq`...    dnl 
18b0: 55 73 65 20 70 6b 67 2d 63 6f 6e 66 69 67 20 74  Use pkg-config t
18c0: 6f 20 66 69 6e 64 20 74 68 65 20 6c 69 62 72 61  o find the libra
18d0: 72 79 20 6e 61 6d 65 73 0a 09 20 20 20 20 69 66  ry names..    if
18e0: 20 74 65 73 74 20 2d 6e 20 22 24 55 53 45 5f 50   test -n "$USE_P
18f0: 4b 47 5f 43 4f 4e 46 49 47 22 3b 20 74 68 65 6e  KG_CONFIG"; then
1900: 0a 09 09 64 6e 6c 20 54 65 6d 70 6f 72 61 72 69  ...dnl Temporari
1910: 6c 79 20 75 70 64 61 74 65 20 50 4b 47 5f 43 4f  ly update PKG_CO
1920: 4e 46 49 47 5f 50 41 54 48 0a 09 09 50 4b 47 5f  NFIG_PATH...PKG_
1930: 43 4f 4e 46 49 47 5f 50 41 54 48 5f 53 41 56 45  CONFIG_PATH_SAVE
1940: 3d 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 47 5f 50  ="${PKG_CONFIG_P
1950: 41 54 48 7d 22 0a 09 09 69 66 20 74 65 73 74 20  ATH}"...if test 
1960: 2d 6e 20 22 24 6f 70 65 6e 73 73 6c 70 6b 67 63  -n "$opensslpkgc
1970: 6f 6e 66 69 67 64 69 72 22 3b 20 74 68 65 6e 0a  onfigdir"; then.
1980: 09 09 09 69 66 20 21 20 74 65 73 74 20 2d 66 20  ...if ! test -f 
1990: 22 24 7b 6f 70 65 6e 73 73 6c 70 6b 67 63 6f 6e  "${opensslpkgcon
19a0: 66 69 67 64 69 72 7d 2f 6f 70 65 6e 73 73 6c 2e  figdir}/openssl.
19b0: 70 63 22 3b 20 74 68 65 6e 0a 09 09 09 09 41 43  pc"; then.....AC
19c0: 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55 6e 61 62  _MSG_ERROR([Unab
19d0: 6c 65 20 74 6f 20 6c 6f 63 61 74 65 20 24 7b 6f  le to locate ${o
19e0: 70 65 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64  pensslpkgconfigd
19f0: 69 72 7d 2f 6f 70 65 6e 73 73 6c 2e 70 63 5d 29  ir}/openssl.pc])
1a00: 0a 09 09 09 66 69 0a 0a 09 09 09 50 4b 47 5f 43  ....fi.....PKG_C
1a10: 4f 4e 46 49 47 5f 50 41 54 48 3d 22 24 7b 6f 70  ONFIG_PATH="${op
1a20: 65 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 69  ensslpkgconfigdi
1a30: 72 7d 3a 24 7b 50 4b 47 5f 43 4f 4e 46 49 47 5f  r}:${PKG_CONFIG_
1a40: 50 41 54 48 7d 22 0a 09 09 09 65 78 70 6f 72 74  PATH}"....export
1a50: 20 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48   PKG_CONFIG_PATH
1a60: 0a 09 09 66 69 0a 0a 09 09 70 6b 67 43 6f 6e 66  ...fi....pkgConf
1a70: 69 67 45 78 74 72 61 41 72 67 73 3d 27 27 0a 09  igExtraArgs=''..
1a80: 09 69 66 20 74 65 73 74 20 22 24 53 48 41 52 45  .if test "$SHARE
1a90: 44 5f 42 55 49 4c 44 22 20 3d 3d 20 22 30 22 20  D_BUILD" == "0" 
1aa0: 2d 6f 20 22 24 54 43 4c 45 58 54 5f 54 4c 53 5f  -o "$TCLEXT_TLS_
1ab0: 53 54 41 54 49 43 5f 53 53 4c 22 20 3d 3d 20 27  STATIC_SSL" == '
1ac0: 79 65 73 27 3b 20 74 68 65 6e 0a 09 09 09 23 20  yes'; then....# 
1ad0: 53 6b 69 70 20 73 69 6e 63 65 20 73 6f 6d 65 74  Skip since somet
1ae0: 69 6d 65 73 20 77 69 6c 6c 20 69 6e 63 6c 75 64  imes will includ
1af0: 65 20 65 78 74 72 61 20 6c 69 62 72 61 72 69 65  e extra librarie
1b00: 73 0a 09 09 09 70 6b 67 43 6f 6e 66 69 67 45 78  s....pkgConfigEx
1b10: 74 72 61 41 72 67 73 3d 27 2d 2d 73 74 61 74 69  traArgs='--stati
1b20: 63 27 0a 09 09 09 70 6b 67 43 6f 6e 66 69 67 45  c'....pkgConfigE
1b30: 78 74 72 61 41 72 67 73 3d 27 27 0a 09 09 66 69  xtraArgs=''...fi
1b40: 0a 0a 09 09 69 66 20 74 65 73 74 20 2d 7a 20 22  ....if test -z "
1b50: 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41  $TCLTLS_SSL_CFLA
1b60: 47 53 22 3b 20 74 68 65 6e 0a 09 09 09 54 43 4c  GS"; then....TCL
1b70: 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53 3d 22  TLS_SSL_CFLAGS="
1b80: 60 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 47 7d 22  `"${PKG_CONFIG}"
1b90: 20 6f 70 65 6e 73 73 6c 20 2d 2d 63 66 6c 61 67   openssl --cflag
1ba0: 73 2d 6f 6e 6c 79 2d 6f 74 68 65 72 20 24 70 6b  s-only-other $pk
1bb0: 67 43 6f 6e 66 69 67 45 78 74 72 61 41 72 67 73  gConfigExtraArgs
1bc0: 60 22 20 7c 7c 20 41 43 5f 4d 53 47 5f 45 52 52  `" || AC_MSG_ERR
1bd0: 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 67 65  OR([Unable to ge
1be0: 74 20 4f 70 65 6e 53 53 4c 20 43 6f 6e 66 69 67  t OpenSSL Config
1bf0: 75 72 61 74 69 6f 6e 5d 29 0a 09 09 66 69 0a 09  uration])...fi..
1c00: 09 69 66 20 74 65 73 74 20 2d 7a 20 22 24 54 43  .if test -z "$TC
1c10: 4c 54 4c 53 5f 53 53 4c 5f 49 4e 43 4c 55 44 45  LTLS_SSL_INCLUDE
1c20: 53 22 3b 20 74 68 65 6e 0a 09 09 09 54 43 4c 54  S"; then....TCLT
1c30: 4c 53 5f 53 53 4c 5f 49 4e 43 4c 55 44 45 53 3d  LS_SSL_INCLUDES=
1c40: 22 60 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 47 7d  "`"${PKG_CONFIG}
1c50: 22 20 6f 70 65 6e 73 73 6c 20 2d 2d 63 66 6c 61  " openssl --cfla
1c60: 67 73 2d 6f 6e 6c 79 2d 49 20 24 70 6b 67 43 6f  gs-only-I $pkgCo
1c70: 6e 66 69 67 45 78 74 72 61 41 72 67 73 60 22 20  nfigExtraArgs`" 
1c80: 7c 7c 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28  || AC_MSG_ERROR(
1c90: 5b 55 6e 61 62 6c 65 20 74 6f 20 67 65 74 20 4f  [Unable to get O
1ca0: 70 65 6e 53 53 4c 20 43 6f 6e 66 69 67 75 72 61  penSSL Configura
1cb0: 74 69 6f 6e 5d 29 0a 09 09 66 69 0a 09 09 69 66  tion])...fi...if
1cc0: 20 74 65 73 74 20 2d 7a 20 22 24 54 43 4c 54 4c   test -z "$TCLTL
1cd0: 53 5f 53 53 4c 5f 4c 49 42 53 22 3b 20 74 68 65  S_SSL_LIBS"; the
1ce0: 6e 0a 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f  n....TCLTLS_SSL_
1cf0: 4c 49 42 53 3d 22 60 24 7b 50 4b 47 5f 43 4f 4e  LIBS="`${PKG_CON
1d00: 46 49 47 7d 20 6f 70 65 6e 73 73 6c 20 2d 2d 6c  FIG} openssl --l
1d10: 69 62 73 20 24 70 6b 67 43 6f 6e 66 69 67 45 78  ibs $pkgConfigEx
1d20: 74 72 61 41 72 67 73 60 22 20 7c 7c 20 41 43 5f  traArgs`" || AC_
1d30: 4d 53 47 5f 45 52 52 4f 52 28 5b 55 6e 61 62 6c  MSG_ERROR([Unabl
1d40: 65 20 74 6f 20 67 65 74 20 4f 70 65 6e 53 53 4c  e to get OpenSSL
1d50: 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5d 29   Configuration])
1d60: 0a 09 09 66 69 0a 09 09 50 4b 47 5f 43 4f 4e 46  ...fi...PKG_CONF
1d70: 49 47 5f 50 41 54 48 3d 22 24 7b 50 4b 47 5f 43  IG_PATH="${PKG_C
1d80: 4f 4e 46 49 47 5f 50 41 54 48 5f 53 41 56 45 7d  ONFIG_PATH_SAVE}
1d90: 22 0a 09 20 20 20 20 66 69 0a 09 66 69 0a 0a 09  "..    fi..fi...
1da0: 64 6e 6c 20 55 73 65 20 66 61 6c 6c 2d 62 61 63  dnl Use fall-bac
1db0: 6b 20 73 65 74 74 69 6e 67 73 20 66 6f 72 20 4f  k settings for O
1dc0: 70 65 6e 53 53 4c 20 69 6e 63 6c 75 64 65 20 61  penSSL include a
1dd0: 6e 64 20 6c 69 62 72 61 72 79 20 70 61 74 68 73  nd library paths
1de0: 0a 09 69 66 20 74 65 73 74 20 2d 7a 20 22 24 54  ..if test -z "$T
1df0: 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53  CLTLS_SSL_CFLAGS
1e00: 22 3b 20 74 68 65 6e 0a 09 09 54 43 4c 54 4c 53  "; then...TCLTLS
1e10: 5f 53 53 4c 5f 43 46 4c 41 47 53 3d 22 22 0a 09  _SSL_CFLAGS=""..
1e20: 66 69 0a 09 69 66 20 74 65 73 74 20 2d 7a 20 22  fi..if test -z "
1e30: 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e 43 4c  $TCLTLS_SSL_INCL
1e40: 55 44 45 53 22 3b 20 74 68 65 6e 0a 09 09 69 66  UDES"; then...if
1e50: 20 74 65 73 74 20 2d 66 20 2f 75 73 72 2f 69 6e   test -f /usr/in
1e60: 63 6c 75 64 65 2f 6f 70 65 6e 73 73 6c 2f 73 73  clude/openssl/ss
1e70: 6c 2e 68 3b 20 74 68 65 6e 0a 09 09 09 54 43 4c  l.h; then....TCL
1e80: 54 4c 53 5f 53 53 4c 5f 49 4e 43 4c 55 44 45 53  TLS_SSL_INCLUDES
1e90: 3d 22 2d 49 2f 75 73 72 2f 69 6e 63 6c 75 64 65  ="-I/usr/include
1ea0: 22 0a 09 09 66 69 0a 09 66 69 0a 09 69 66 20 74  "...fi..fi..if t
1eb0: 65 73 74 20 2d 7a 20 22 24 54 43 4c 54 4c 53 5f  est -z "$TCLTLS_
1ec0: 53 53 4c 5f 4c 49 42 53 22 3b 20 74 68 65 6e 0a  SSL_LIBS"; then.
1ed0: 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42  ..TCLTLS_SSL_LIB
1ee0: 53 3d 22 2d 6c 73 73 6c 20 2d 6c 63 72 79 70 74  S="-lssl -lcrypt
1ef0: 6f 22 0a 09 66 69 0a 09 0a 09 64 6e 6c 20 53 65  o"..fi....dnl Se
1f00: 74 20 66 6f 72 20 73 74 61 74 69 63 20 6c 69 62  t for static lib
1f10: 72 61 72 69 65 73 0a 09 69 66 20 74 65 73 74 20  raries..if test 
1f20: 22 24 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41  "$TCLEXT_TLS_STA
1f30: 54 49 43 5f 53 53 4c 22 20 3d 3d 20 27 79 65 73  TIC_SSL" == 'yes
1f40: 27 3b 20 74 68 65 6e 0a 09 09 73 79 73 74 65 6d  '; then...system
1f50: 3d 22 60 75 6e 61 6d 65 20 2d 73 60 22 0a 09 09  ="`uname -s`"...
1f60: 63 61 73 65 20 24 73 79 73 74 65 6d 20 69 6e 0a  case $system in.
1f70: 09 09 09 41 49 58 2a 29 0a 09 09 09 09 54 43 4c  ...AIX*).....TCL
1f80: 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d 22 2d 57  TLS_SSL_LIBS="-W
1f90: 6c 2c 2d 62 73 74 61 74 69 63 20 24 54 43 4c 54  l,-bstatic $TCLT
1fa0: 4c 53 5f 53 53 4c 5f 4c 49 42 53 20 2d 57 6c 2c  LS_SSL_LIBS -Wl,
1fb0: 2d 62 64 79 6e 61 6d 69 63 22 3b 3b 0a 09 09 09  -bdynamic";;....
1fc0: 42 53 44 2a 7c 4f 70 65 6e 42 53 44 2a 29 0a 09  BSD*|OpenBSD*)..
1fd0: 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49  ...TCLTLS_SSL_LI
1fe0: 42 53 3d 22 2d 57 6c 2c 2d 42 73 74 61 74 69 63  BS="-Wl,-Bstatic
1ff0: 20 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42   $TCLTLS_SSL_LIB
2000: 53 20 2d 57 6c 2c 2d 42 64 79 6e 61 6d 69 63 22  S -Wl,-Bdynamic"
2010: 3b 3b 0a 09 09 09 43 59 47 57 49 4e 5f 2a 7c 4d  ;;....CYGWIN_*|M
2020: 49 4e 47 57 33 32 5f 2a 7c 4d 49 4e 47 57 36 34  INGW32_*|MINGW64
2030: 5f 2a 7c 4d 53 59 53 5f 2a 29 0a 09 09 09 09 54  _*|MSYS_*).....T
2040: 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d 22  CLTLS_SSL_LIBS="
2050: 2d 57 6c 2c 2d 42 73 74 61 74 69 63 20 24 54 43  -Wl,-Bstatic $TC
2060: 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 20 2d 57  LTLS_SSL_LIBS -W
2070: 6c 2c 2d 42 64 79 6e 61 6d 69 63 22 3b 3b 0a 09  l,-Bdynamic";;..
2080: 09 09 44 61 72 77 69 6e 2d 2a 29 0a 09 09 09 09  ..Darwin-*).....
2090: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d  TCLTLS_SSL_LIBS=
20a0: 22 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42  "$TCLTLS_SSL_LIB
20b0: 53 22 3b 3b 0a 09 09 09 48 50 2d 55 58 2d 2a 29  S";;....HP-UX-*)
20c0: 0a 09 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f  .....TCLTLS_SSL_
20d0: 4c 49 42 53 3d 22 2d 57 6c 2c 2d 61 2c 61 72 63  LIBS="-Wl,-a,arc
20e0: 68 69 76 65 20 24 54 43 4c 54 4c 53 5f 53 53 4c  hive $TCLTLS_SSL
20f0: 5f 4c 49 42 53 20 2d 57 6c 2c 2d 61 2c 73 68 61  _LIBS -Wl,-a,sha
2100: 72 65 64 5f 61 72 63 68 69 76 65 22 3b 3b 0a 09  red_archive";;..
2110: 09 09 49 52 49 58 2d 2a 29 0a 09 09 09 09 54 43  ..IRIX-*).....TC
2120: 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d 22 2d  LTLS_SSL_LIBS="-
2130: 57 6c 2c 2d 42 2c 20 73 74 61 74 69 63 20 24 54  Wl,-B, static $T
2140: 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 20 2d  CLTLS_SSL_LIBS -
2150: 57 6c 2c 2d 42 2c 20 64 79 6e 61 6d 69 63 22 3b  Wl,-B, dynamic";
2160: 3b 0a 09 09 09 53 6f 6c 61 72 69 73 2a 29 0a 09  ;....Solaris*)..
2170: 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49  ...TCLTLS_SSL_LI
2180: 42 53 3d 22 2d 42 73 74 61 74 69 63 20 24 54 43  BS="-Bstatic $TC
2190: 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 20 2d 42  LTLS_SSL_LIBS -B
21a0: 64 79 6e 61 6d 69 63 22 3b 3b 0a 09 09 09 4c 69  dynamic";;....Li
21b0: 6e 75 78 2a 7c 47 4e 55 2a 7c 4e 65 74 42 53 44  nux*|GNU*|NetBSD
21c0: 2d 44 65 62 69 61 6e 7c 44 72 61 67 6f 6e 46 6c  -Debian|DragonFl
21d0: 79 2d 2a 7c 46 72 65 65 42 53 44 2d 2a 29 0a 09  y-*|FreeBSD-*)..
21e0: 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49  ...TCLTLS_SSL_LI
21f0: 42 53 3d 22 2d 57 6c 2c 2d 42 73 74 61 74 69 63  BS="-Wl,-Bstatic
2200: 20 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42   $TCLTLS_SSL_LIB
2210: 53 20 2d 57 6c 2c 2d 42 64 79 6e 61 6d 69 63 22  S -Wl,-Bdynamic"
2220: 3b 3b 0a 09 09 65 73 61 63 0a 09 66 69 0a 09 54  ;;...esac..fi..T
2230: 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d 22  CLTLS_SSL_LIBS="
2240: 24 53 53 4c 5f 4c 49 42 53 5f 50 41 54 48 20 24  $SSL_LIBS_PATH $
2250: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 22  TCLTLS_SSL_LIBS"
2260: 0a 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e  ..AC_MSG_CHECKIN
2270: 47 28 5b 66 6f 72 20 53 53 4c 20 6c 69 62 73 5d  G([for SSL libs]
2280: 29 0a 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  )..AC_MSG_RESULT
2290: 28 5b 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49  ([$TCLTLS_SSL_LI
22a0: 42 53 5d 29 0a 0a 09 64 6e 6c 20 49 6e 63 6c 75  BS])...dnl Inclu
22b0: 64 65 20 63 6f 6e 66 69 67 20 76 61 72 69 61 62  de config variab
22c0: 6c 65 73 20 69 6e 20 2d 2d 68 65 6c 70 20 6c 69  les in --help li
22d0: 73 74 20 61 6e 64 20 6d 61 6b 65 20 61 76 61 69  st and make avai
22e0: 6c 61 62 6c 65 20 74 6f 20 62 65 20 73 75 62 73  lable to be subs
22f0: 74 69 74 75 74 65 64 20 76 69 61 20 41 43 5f 53  tituted via AC_S
2300: 55 42 53 54 2e 0a 09 41 43 5f 41 52 47 5f 56 41  UBST...AC_ARG_VA
2310: 52 28 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46  R([TCLTLS_SSL_CF
2320: 4c 41 47 53 5d 2c 20 5b 43 20 63 6f 6d 70 69 6c  LAGS], [C compil
2330: 65 72 20 66 6c 61 67 73 20 66 6f 72 20 4f 70 65  er flags for Ope
2340: 6e 53 53 4c 5d 29 0a 09 41 43 5f 41 52 47 5f 56  nSSL])..AC_ARG_V
2350: 41 52 28 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f 49  AR([TCLTLS_SSL_I
2360: 4e 43 4c 55 44 45 53 5d 2c 20 5b 43 20 63 6f 6d  NCLUDES], [C com
2370: 70 69 6c 65 72 20 69 6e 63 6c 75 64 65 20 70 61  piler include pa
2380: 74 68 73 20 66 6f 72 20 4f 70 65 6e 53 53 4c 5d  ths for OpenSSL]
2390: 29 0a 09 41 43 5f 41 52 47 5f 56 41 52 28 5b 54  )..AC_ARG_VAR([T
23a0: 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 5d 2c  CLTLS_SSL_LIBS],
23b0: 20 5b 6c 69 62 72 61 72 69 65 73 20 74 6f 20 70   [libraries to p
23c0: 61 73 73 20 74 6f 20 74 68 65 20 6c 69 6e 6b 65  ass to the linke
23d0: 72 20 66 6f 72 20 4f 70 65 6e 53 53 4c 5d 29 0a  r for OpenSSL]).
23e0: 5d 29 0a                                         ]).