Hex Artifact Content

Artifact a920d53daaaec3d62d184e66fd720b13d577ea245ff0b756a0410ba40e54b7e7:


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 20 22 6e 6f 22 3b 20  leval}" = "no"; 
0180: 74 68 65 6e 0a 09 09 09 41 43 5f 44 45 46 49 4e  then....AC_DEFIN
0190: 45 28 5b 4e 4f 5f 54 4c 53 31 5d 2c 20 5b 31 5d  E([NO_TLS1], [1]
01a0: 2c 20 5b 44 69 73 61 62 6c 65 20 54 4c 53 31 20  , [Disable TLS1 
01b0: 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 43  protocol])....AC
01c0: 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66  _MSG_CHECKING([f
01d0: 6f 72 20 64 69 73 61 62 6c 65 20 54 4c 53 31 20  or disable TLS1 
01e0: 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 43  protocol])....AC
01f0: 5f 4d 53 47 5f 52 45 53 55 4c 54 28 27 79 65 73  _MSG_RESULT('yes
0200: 27 29 0a 09 09 66 69 0a 09 5d 29 0a 0a 09 64 6e  ')...fi..])...dn
0210: 6c 20 44 69 73 61 62 6c 65 20 73 75 70 70 6f 72  l Disable suppor
0220: 74 20 66 6f 72 20 54 4c 53 20 31 2e 31 20 70 72  t for TLS 1.1 pr
0230: 6f 74 6f 63 6f 6c 0a 09 41 43 5f 41 52 47 5f 45  otocol..AC_ARG_E
0240: 4e 41 42 4c 45 28 5b 74 6c 73 31 5f 31 5d 2c 20  NABLE([tls1_1], 
0250: 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b  AS_HELP_STRING([
0260: 2d 2d 64 69 73 61 62 6c 65 2d 74 6c 73 31 5f 31  --disable-tls1_1
0270: 5d 2c 20 5b 64 69 73 61 62 6c 65 20 54 4c 53 31  ], [disable TLS1
0280: 2e 31 20 70 72 6f 74 6f 63 6f 6c 5d 29 2c 20 5b  .1 protocol]), [
0290: 0a 09 09 69 66 20 74 65 73 74 20 22 24 7b 65 6e  ...if test "${en
02a0: 61 62 6c 65 76 61 6c 7d 22 20 3d 20 22 6e 6f 22  ableval}" = "no"
02b0: 3b 20 74 68 65 6e 0a 09 09 09 41 43 5f 44 45 46  ; then....AC_DEF
02c0: 49 4e 45 28 5b 4e 4f 5f 54 4c 53 31 5f 31 5d 2c  INE([NO_TLS1_1],
02d0: 20 5b 31 5d 2c 20 5b 44 69 73 61 62 6c 65 20 54   [1], [Disable T
02e0: 4c 53 31 2e 31 20 70 72 6f 74 6f 63 6f 6c 5d 29  LS1.1 protocol])
02f0: 0a 09 09 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b  ....AC_MSG_CHECK
0300: 49 4e 47 28 5b 66 6f 72 20 64 69 73 61 62 6c 65  ING([for disable
0310: 20 54 4c 53 31 2e 31 20 70 72 6f 74 6f 63 6f 6c   TLS1.1 protocol
0320: 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 52 45 53  ])....AC_MSG_RES
0330: 55 4c 54 28 27 79 65 73 27 29 0a 09 09 66 69 0a  ULT('yes')...fi.
0340: 09 5d 29 0a 0a 09 64 6e 6c 20 44 69 73 61 62 6c  .])...dnl Disabl
0350: 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 54 4c  e support for TL
0360: 53 20 31 2e 32 20 70 72 6f 74 6f 63 6f 6c 0a 09  S 1.2 protocol..
0370: 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b 74  AC_ARG_ENABLE([t
0380: 6c 73 31 5f 32 5d 2c 20 41 53 5f 48 45 4c 50 5f  ls1_2], AS_HELP_
0390: 53 54 52 49 4e 47 28 5b 2d 2d 64 69 73 61 62 6c  STRING([--disabl
03a0: 65 2d 74 6c 73 31 5f 32 5d 2c 20 5b 64 69 73 61  e-tls1_2], [disa
03b0: 62 6c 65 20 54 4c 53 31 2e 32 20 70 72 6f 74 6f  ble TLS1.2 proto
03c0: 63 6f 6c 5d 29 2c 20 5b 0a 09 09 69 66 20 74 65  col]), [...if te
03d0: 73 74 20 22 24 7b 65 6e 61 62 6c 65 76 61 6c 7d  st "${enableval}
03e0: 22 20 3d 20 22 6e 6f 22 3b 20 74 68 65 6e 0a 09  " = "no"; then..
03f0: 09 09 41 43 5f 44 45 46 49 4e 45 28 5b 4e 4f 5f  ..AC_DEFINE([NO_
0400: 54 4c 53 31 5f 32 5d 2c 20 5b 31 5d 2c 20 5b 44  TLS1_2], [1], [D
0410: 69 73 61 62 6c 65 20 54 4c 53 31 2e 32 20 70 72  isable TLS1.2 pr
0420: 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 43 5f 4d  otocol])....AC_M
0430: 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72  SG_CHECKING([for
0440: 20 64 69 73 61 62 6c 65 20 54 4c 53 31 2e 32 20   disable TLS1.2 
0450: 70 72 6f 74 6f 63 6f 6c 5d 29 0a 09 09 09 41 43  protocol])....AC
0460: 5f 4d 53 47 5f 52 45 53 55 4c 54 28 27 79 65 73  _MSG_RESULT('yes
0470: 27 29 0a 09 09 66 69 0a 09 5d 29 0a 0a 09 64 6e  ')...fi..])...dn
0480: 6c 20 44 69 73 61 62 6c 65 20 73 75 70 70 6f 72  l Disable suppor
0490: 74 20 66 6f 72 20 54 4c 53 20 31 2e 33 20 70 72  t for TLS 1.3 pr
04a0: 6f 74 6f 63 6f 6c 0a 09 41 43 5f 41 52 47 5f 45  otocol..AC_ARG_E
04b0: 4e 41 42 4c 45 28 5b 74 6c 73 31 5f 33 5d 2c 20  NABLE([tls1_3], 
04c0: 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b  AS_HELP_STRING([
04d0: 2d 2d 64 69 73 61 62 6c 65 2d 74 6c 73 31 5f 33  --disable-tls1_3
04e0: 5d 2c 20 5b 64 69 73 61 62 6c 65 20 54 4c 53 31  ], [disable TLS1
04f0: 2e 33 20 70 72 6f 74 6f 63 6f 6c 5d 29 2c 20 5b  .3 protocol]), [
0500: 0a 09 09 69 66 20 74 65 73 74 20 22 24 7b 65 6e  ...if test "${en
0510: 61 62 6c 65 76 61 6c 7d 22 20 3d 20 22 6e 6f 22  ableval}" = "no"
0520: 3b 20 74 68 65 6e 0a 09 09 09 41 43 5f 44 45 46  ; then....AC_DEF
0530: 49 4e 45 28 5b 4e 4f 5f 54 4c 53 31 5f 33 5d 2c  INE([NO_TLS1_3],
0540: 20 5b 31 5d 2c 20 5b 44 69 73 61 62 6c 65 20 54   [1], [Disable T
0550: 4c 53 31 2e 33 20 70 72 6f 74 6f 63 6f 6c 5d 29  LS1.3 protocol])
0560: 0a 09 09 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b  ....AC_MSG_CHECK
0570: 49 4e 47 28 5b 66 6f 72 20 64 69 73 61 62 6c 65  ING([for disable
0580: 20 54 4c 53 31 2e 33 20 70 72 6f 74 6f 63 6f 6c   TLS1.3 protocol
0590: 5d 29 0a 09 09 09 41 43 5f 4d 53 47 5f 52 45 53  ])....AC_MSG_RES
05a0: 55 4c 54 28 27 79 65 73 27 29 0a 09 09 66 69 0a  ULT('yes')...fi.
05b0: 09 5d 29 0a 0a 0a 09 64 6e 6c 20 45 6e 61 62 6c  .])....dnl Enabl
05c0: 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 62 75  e support for bu
05d0: 69 6c 64 69 6e 67 20 74 68 65 20 73 61 6d 65 20  ilding the same 
05e0: 44 69 66 66 69 65 e2 80 93 48 65 6c 6c 6d 61 6e  Diffie–Hellman
05f0: 20 70 61 72 61 6d 65 74 65 72 73 20 65 61 63 68   parameters each
0600: 20 74 69 6d 65 0a 09 41 43 5f 41 52 47 5f 45 4e   time..AC_ARG_EN
0610: 41 42 4c 45 28 5b 64 65 74 65 72 6d 69 6e 69 73  ABLE([determinis
0620: 74 69 63 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54  tic], AS_HELP_ST
0630: 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 64  RING([--enable-d
0640: 65 74 65 72 6d 69 6e 69 73 74 69 63 5d 2c 20 5b  eterministic], [
0650: 65 6e 61 62 6c 65 20 64 65 74 65 72 6d 69 6e 69  enable determini
0660: 73 74 69 63 20 44 48 20 70 61 72 61 6d 65 74 65  stic DH paramete
0670: 72 73 5d 29 2c 20 5b 0a 09 09 74 63 6c 74 6c 73  rs]), [...tcltls
0680: 5f 64 65 74 65 72 6d 69 6e 69 73 74 69 63 3d 22  _deterministic="
0690: 24 65 6e 61 62 6c 65 76 61 6c 22 0a 09 5d 2c 20  $enableval"..], 
06a0: 5b 0a 09 09 74 63 6c 74 6c 73 5f 64 65 74 65 72  [...tcltls_deter
06b0: 6d 69 6e 69 73 74 69 63 3d 27 6e 6f 27 0a 09 5d  ministic='no'..]
06c0: 29 0a 09 69 66 20 74 65 73 74 20 22 24 74 63 6c  )..if test "$tcl
06d0: 74 6c 73 5f 64 65 74 65 72 6d 69 6e 69 73 74 69  tls_deterministi
06e0: 63 22 20 3d 20 27 79 65 73 27 3b 20 74 68 65 6e  c" = 'yes'; then
06f0: 0a 09 09 47 45 4e 5f 44 48 5f 50 41 52 41 4d 53  ...GEN_DH_PARAMS
0700: 5f 41 52 47 53 3d 27 66 61 6c 6c 62 61 63 6b 27  _ARGS='fallback'
0710: 0a 09 65 6c 73 65 0a 09 09 47 45 4e 5f 44 48 5f  ..else...GEN_DH_
0720: 50 41 52 41 4d 53 5f 41 52 47 53 3d 27 27 0a 09  PARAMS_ARGS=''..
0730: 66 69 0a 0a 09 64 6e 6c 20 45 6e 61 62 6c 65 20  fi...dnl Enable 
0740: 73 75 70 70 6f 72 74 20 66 6f 72 20 73 70 65 63  support for spec
0750: 69 66 79 69 6e 67 20 70 72 65 2d 63 6f 6d 70 75  ifying pre-compu
0760: 74 65 64 20 44 48 20 70 61 72 61 6d 73 20 73 69  ted DH params si
0770: 7a 65 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28  ze..AC_ARG_WITH(
0780: 5b 62 75 69 6c 74 69 6e 2d 64 68 2d 70 61 72 61  [builtin-dh-para
0790: 6d 73 2d 73 69 7a 65 5d 2c 20 41 53 5f 48 45 4c  ms-size], AS_HEL
07a0: 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 77 69 74 68  P_STRING([--with
07b0: 2d 62 75 69 6c 74 69 6e 2d 64 68 2d 70 61 72 61  -builtin-dh-para
07c0: 6d 73 2d 73 69 7a 65 3d 3c 62 69 74 73 3e 5d 2c  ms-size=<bits>],
07d0: 0a 09 09 5b 73 70 65 63 69 66 79 20 74 68 65 20  ...[specify the 
07e0: 73 69 7a 65 20 69 6e 20 62 69 74 73 20 6f 66 20  size in bits of 
07f0: 74 68 65 20 62 75 69 6c 74 2d 69 6e 2c 20 70 72  the built-in, pr
0800: 65 63 6f 6d 70 75 74 65 64 2c 20 44 48 20 70 61  ecomputed, DH pa
0810: 72 61 6d 73 5d 29 2c 20 5b 0a 09 09 41 53 5f 43  rams]), [...AS_C
0820: 41 53 45 28 5b 24 77 69 74 68 76 61 6c 5d 2c 5b  ASE([$withval],[
0830: 32 30 34 38 7c 34 30 39 36 7c 38 31 39 32 5d 2c  2048|4096|8192],
0840: 2c 5b 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b  ,[AC_MSG_ERROR([
0850: 55 6e 73 75 70 70 6f 72 74 65 64 20 44 48 20 70  Unsupported DH p
0860: 61 72 61 6d 73 20 73 69 7a 65 3a 20 24 77 69 74  arams size: $wit
0870: 68 76 61 6c 5d 29 5d 29 0a 09 09 47 45 4e 5f 44  hval])])...GEN_D
0880: 48 5f 50 41 52 41 4d 53 5f 41 52 47 53 3d 22 24  H_PARAMS_ARGS="$
0890: 7b 47 45 4e 5f 44 48 5f 50 41 52 41 4d 53 5f 41  {GEN_DH_PARAMS_A
08a0: 52 47 53 7d 20 62 69 74 73 3d 24 77 69 74 68 76  RGS} bits=$withv
08b0: 61 6c 22 0a 09 5d 29 0a 09 41 43 5f 53 55 42 53  al"..])..AC_SUBS
08c0: 54 28 47 45 4e 5f 44 48 5f 50 41 52 41 4d 53 5f  T(GEN_DH_PARAMS_
08d0: 41 52 47 53 29 0a 09 41 43 5f 4d 53 47 5f 43 48  ARGS)..AC_MSG_CH
08e0: 45 43 4b 49 4e 47 28 5b 66 6f 72 20 44 48 20 70  ECKING([for DH p
08f0: 61 72 61 6d 73 5d 29 0a 09 41 43 5f 4d 53 47 5f  arams])..AC_MSG_
0900: 52 45 53 55 4c 54 28 5b 24 47 45 4e 5f 44 48 5f  RESULT([$GEN_DH_
0910: 50 41 52 41 4d 53 5f 41 52 47 53 5d 29 0a 0a 0a  PARAMS_ARGS])...
0920: 09 64 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 69  .dnl Determine i
0930: 66 20 77 65 20 68 61 76 65 20 62 65 65 6e 20 61  f we have been a
0940: 73 6b 65 64 20 74 6f 20 75 73 65 20 61 20 66 61  sked to use a fa
0950: 73 74 20 70 61 74 68 20 69 66 20 70 6f 73 73 69  st path if possi
0960: 62 6c 65 0a 09 41 43 5f 41 52 47 5f 45 4e 41 42  ble..AC_ARG_ENAB
0970: 4c 45 28 5b 73 73 6c 2d 66 61 73 74 70 61 74 68  LE([ssl-fastpath
0980: 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e  ], AS_HELP_STRIN
0990: 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 73 73 6c 2d  G([--enable-ssl-
09a0: 66 61 73 74 70 61 74 68 5d 2c 0a 09 09 5b 65 6e  fastpath],...[en
09b0: 61 62 6c 65 20 75 73 69 6e 67 20 74 68 65 20 75  able using the u
09c0: 6e 64 65 72 6c 79 69 6e 67 20 66 69 6c 65 20 64  nderlying file d
09d0: 65 73 63 72 69 70 74 6f 72 20 66 6f 72 20 74 61  escriptor for ta
09e0: 6c 6b 69 6e 67 20 64 69 72 65 63 74 6c 79 20 74  lking directly t
09f0: 6f 20 74 68 65 20 53 53 4c 20 6c 69 62 72 61 72  o the SSL librar
0a00: 79 5d 29 2c 20 5b 0a 09 09 74 63 6c 74 6c 73 5f  y]), [...tcltls_
0a10: 73 73 6c 5f 66 61 73 74 70 61 74 68 3d 22 24 65  ssl_fastpath="$e
0a20: 6e 61 62 6c 65 76 61 6c 22 0a 09 5d 2c 20 5b 0a  nableval"..], [.
0a30: 09 09 74 63 6c 74 6c 73 5f 73 73 6c 5f 66 61 73  ..tcltls_ssl_fas
0a40: 74 70 61 74 68 3d 27 6e 6f 27 0a 09 5d 29 0a 09  tpath='no'..])..
0a50: 69 66 20 74 65 73 74 20 22 24 74 63 6c 74 6c 73  if test "$tcltls
0a60: 5f 73 73 6c 5f 66 61 73 74 70 61 74 68 22 20 3d  _ssl_fastpath" =
0a70: 20 27 79 65 73 27 3b 20 74 68 65 6e 0a 09 09 41   'yes'; then...A
0a80: 43 5f 44 45 46 49 4e 45 28 54 43 4c 54 4c 53 5f  C_DEFINE(TCLTLS_
0a90: 53 53 4c 5f 55 53 45 5f 46 41 53 54 50 41 54 48  SSL_USE_FASTPATH
0aa0: 2c 20 5b 31 5d 2c 20 5b 45 6e 61 62 6c 65 20 53  , [1], [Enable S
0ab0: 53 4c 20 6c 69 62 72 61 72 79 20 64 69 72 65 63  SL library direc
0ac0: 74 20 75 73 65 20 6f 66 20 74 68 65 20 75 6e 64  t use of the und
0ad0: 65 72 6c 79 69 6e 67 20 66 69 6c 65 20 64 65 73  erlying file des
0ae0: 63 72 69 70 74 6f 72 5d 29 0a 09 66 69 0a 09 41  criptor])..fi..A
0af0: 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b  C_MSG_CHECKING([
0b00: 66 6f 72 20 66 61 73 74 20 70 61 74 68 5d 29 0a  for fast path]).
0b10: 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b  .AC_MSG_RESULT([
0b20: 24 74 63 6c 74 6c 73 5f 73 73 6c 5f 66 61 73 74  $tcltls_ssl_fast
0b30: 70 61 74 68 5d 29 0a 0a 0a 09 64 6e 6c 20 45 6e  path])....dnl En
0b40: 61 62 6c 65 20 68 61 72 64 65 6e 69 6e 67 0a 09  able hardening..
0b50: 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b 68  AC_ARG_ENABLE([h
0b60: 61 72 64 65 6e 69 6e 67 5d 2c 20 41 53 5f 48 45  ardening], AS_HE
0b70: 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61  LP_STRING([--ena
0b80: 62 6c 65 2d 68 61 72 64 65 6e 69 6e 67 5d 2c 20  ble-hardening], 
0b90: 5b 65 6e 61 62 6c 65 20 68 61 72 64 65 6e 69 6e  [enable hardenin
0ba0: 67 20 61 74 74 65 6d 70 74 73 5d 29 2c 20 5b 0a  g attempts]), [.
0bb0: 09 09 74 63 6c 74 6c 73 5f 65 6e 61 62 6c 65 5f  ..tcltls_enable_
0bc0: 68 61 72 64 65 6e 69 6e 67 3d 22 24 65 6e 61 62  hardening="$enab
0bd0: 6c 65 76 61 6c 22 0a 09 5d 2c 20 5b 0a 09 09 74  leval"..], [...t
0be0: 63 6c 74 6c 73 5f 65 6e 61 62 6c 65 5f 68 61 72  cltls_enable_har
0bf0: 64 65 6e 69 6e 67 3d 27 79 65 73 27 0a 09 5d 29  dening='yes'..])
0c00: 0a 09 69 66 20 74 65 73 74 20 22 24 74 63 6c 74  ..if test "$tclt
0c10: 6c 73 5f 65 6e 61 62 6c 65 5f 68 61 72 64 65 6e  ls_enable_harden
0c20: 69 6e 67 22 20 3d 20 27 79 65 73 27 3b 20 74 68  ing" = 'yes'; th
0c30: 65 6e 0a 09 09 69 66 20 74 65 73 74 20 22 24 47  en...if test "$G
0c40: 43 43 22 20 3d 20 27 79 65 73 27 20 2d 6f 20 22  CC" = 'yes' -o "
0c50: 24 43 43 22 20 3d 20 27 63 6c 61 6e 67 27 3b 20  $CC" = 'clang'; 
0c60: 74 68 65 6e 0a 09 09 09 54 45 41 5f 41 44 44 5f  then....TEA_ADD_
0c70: 43 46 4c 41 47 53 28 5b 2d 66 73 74 61 63 6b 2d  CFLAGS([-fstack-
0c80: 70 72 6f 74 65 63 74 6f 72 2d 61 6c 6c 5d 29 0a  protector-all]).
0c90: 09 09 09 54 45 41 5f 41 44 44 5f 43 46 4c 41 47  ...TEA_ADD_CFLAG
0ca0: 53 28 5b 2d 66 6e 6f 2d 73 74 72 69 63 74 2d 6f  S([-fno-strict-o
0cb0: 76 65 72 66 6c 6f 77 5d 29 0a 09 09 09 41 43 5f  verflow])....AC_
0cc0: 44 45 46 49 4e 45 28 5b 5f 46 4f 52 54 49 46 59  DEFINE([_FORTIFY
0cd0: 5f 53 4f 55 52 43 45 5d 2c 20 5b 32 5d 2c 20 5b  _SOURCE], [2], [
0ce0: 45 6e 61 62 6c 65 20 66 6f 72 74 69 66 69 63 61  Enable fortifica
0cf0: 74 69 6f 6e 5d 29 0a 09 09 66 69 0a 09 66 69 0a  tion])...fi..fi.
0d00: 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47  .AC_MSG_CHECKING
0d10: 28 5b 66 6f 72 20 65 6e 61 62 6c 65 20 68 61 72  ([for enable har
0d20: 64 65 6e 69 6e 67 5d 29 0a 09 41 43 5f 4d 53 47  dening])..AC_MSG
0d30: 5f 52 45 53 55 4c 54 28 5b 24 74 63 6c 74 6c 73  _RESULT([$tcltls
0d40: 5f 65 6e 61 62 6c 65 5f 68 61 72 64 65 6e 69 6e  _enable_hardenin
0d50: 67 5d 29 0a 0a 0a 09 64 6e 6c 20 44 65 74 65 72  g])....dnl Deter
0d60: 6d 69 6e 65 20 69 66 20 77 65 20 68 61 76 65 20  mine if we have 
0d70: 62 65 65 6e 20 61 73 6b 65 64 20 74 6f 20 73 74  been asked to st
0d80: 61 74 69 63 61 6c 6c 79 20 6c 69 6e 6b 20 74 6f  atically link to
0d90: 20 74 68 65 20 53 53 4c 20 6c 69 62 72 61 72 79   the SSL library
0da0: 0a 09 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28  ..AC_ARG_ENABLE(
0db0: 5b 73 74 61 74 69 63 2d 73 73 6c 5d 2c 20 41 53  [static-ssl], AS
0dc0: 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d  _HELP_STRING([--
0dd0: 65 6e 61 62 6c 65 2d 73 74 61 74 69 63 2d 73 73  enable-static-ss
0de0: 6c 5d 2c 20 5b 65 6e 61 62 6c 65 20 73 74 61 74  l], [enable stat
0df0: 69 63 20 6c 69 6e 6b 69 6e 67 20 74 6f 20 74 68  ic linking to th
0e00: 65 20 53 53 4c 20 6c 69 62 72 61 72 79 5d 29 2c  e SSL library]),
0e10: 20 5b 0a 09 09 54 43 4c 45 58 54 5f 54 4c 53 5f   [...TCLEXT_TLS_
0e20: 53 54 41 54 49 43 5f 53 53 4c 3d 22 24 65 6e 61  STATIC_SSL="$ena
0e30: 62 6c 65 76 61 6c 22 0a 09 5d 2c 20 5b 0a 09 09  bleval"..], [...
0e40: 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54 49  TCLEXT_TLS_STATI
0e50: 43 5f 53 53 4c 3d 27 6e 6f 27 0a 09 5d 29 0a 09  C_SSL='no'..])..
0e60: 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28  AC_MSG_CHECKING(
0e70: 5b 66 6f 72 20 73 74 61 74 69 63 20 6c 69 6e 6b  [for static link
0e80: 69 6e 67 20 6f 66 20 6f 70 65 6e 53 53 4c 20 6c  ing of openSSL l
0e90: 69 62 72 61 72 69 65 73 5d 29 0a 09 41 43 5f 4d  ibraries])..AC_M
0ea0: 53 47 5f 52 45 53 55 4c 54 28 5b 24 54 43 4c 45  SG_RESULT([$TCLE
0eb0: 58 54 5f 54 4c 53 5f 53 54 41 54 49 43 5f 53 53  XT_TLS_STATIC_SS
0ec0: 4c 5d 29 0a 0a 0a 09 64 6e 6c 20 53 65 74 20 53  L])....dnl Set S
0ed0: 53 4c 20 66 69 6c 65 73 20 72 6f 6f 74 20 70 61  SL files root pa
0ee0: 74 68 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28  th..AC_ARG_WITH(
0ef0: 5b 6f 70 65 6e 73 73 6c 2d 64 69 72 5d 2c 0a 09  [openssl-dir],..
0f00: 09 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28  .AS_HELP_STRING(
0f10: 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 73 6c 2d  [--with-openssl-
0f20: 64 69 72 3d 3c 64 69 72 3e 5d 2c 0a 09 09 09 5b  dir=<dir>],....[
0f30: 70 61 74 68 20 74 6f 20 72 6f 6f 74 20 64 69 72  path to root dir
0f40: 65 63 74 6f 72 79 20 6f 66 20 4f 70 65 6e 53 53  ectory of OpenSS
0f50: 4c 20 6f 72 20 4c 69 62 72 65 53 53 4c 20 69 6e  L or LibreSSL in
0f60: 73 74 61 6c 6c 61 74 69 6f 6e 5d 0a 09 09 29 2c  stallation]...),
0f70: 20 5b 0a 09 09 09 6f 70 65 6e 73 73 6c 64 69 72   [....openssldir
0f80: 3d 22 24 77 69 74 68 76 61 6c 22 0a 09 09 5d 2c  ="$withval"...],
0f90: 20 5b 0a 09 09 09 6f 70 65 6e 73 73 6c 64 69 72   [....openssldir
0fa0: 3d 27 27 0a 09 09 5d 0a 09 29 0a 0a 09 64 6e 6c  =''...]..)...dnl
0fb0: 20 53 65 74 20 53 53 4c 20 69 6e 63 6c 75 64 65   Set SSL include
0fc0: 20 66 69 6c 65 73 20 70 61 74 68 0a 09 41 43 5f   files path..AC_
0fd0: 41 52 47 5f 57 49 54 48 28 5b 6f 70 65 6e 73 73  ARG_WITH([openss
0fe0: 6c 2d 69 6e 63 6c 75 64 65 64 69 72 5d 2c 0a 09  l-includedir],..
0ff0: 09 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28  .AS_HELP_STRING(
1000: 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 73 6c 2d  [--with-openssl-
1010: 69 6e 63 6c 75 64 65 64 69 72 3d 3c 64 69 72 3e  includedir=<dir>
1020: 5d 2c 0a 09 09 09 5b 70 61 74 68 20 74 6f 20 69  ],....[path to i
1030: 6e 63 6c 75 64 65 20 64 69 72 65 63 74 6f 72 79  nclude directory
1040: 20 6f 66 20 4f 70 65 6e 53 53 4c 20 6f 72 20 4c   of OpenSSL or L
1050: 69 62 72 65 53 53 4c 20 69 6e 73 74 61 6c 6c 61  ibreSSL installa
1060: 74 69 6f 6e 5d 0a 09 09 29 2c 20 5b 0a 09 09 09  tion]...), [....
1070: 6f 70 65 6e 73 73 6c 69 6e 63 6c 75 64 65 64 69  opensslincludedi
1080: 72 3d 22 24 77 69 74 68 76 61 6c 22 0a 09 09 5d  r="$withval"...]
1090: 2c 20 5b 0a 09 09 09 69 66 20 74 65 73 74 20 2d  , [....if test -
10a0: 6e 20 22 24 6f 70 65 6e 73 73 6c 64 69 72 22 3b  n "$openssldir";
10b0: 20 74 68 65 6e 0a 09 09 09 09 6f 70 65 6e 73 73   then.....openss
10c0: 6c 69 6e 63 6c 75 64 65 64 69 72 3d 22 24 6f 70  lincludedir="$op
10d0: 65 6e 73 73 6c 64 69 72 2f 69 6e 63 6c 75 64 65  enssldir/include
10e0: 2f 6f 70 65 6e 73 73 6c 22 0a 09 09 09 65 6c 73  /openssl"....els
10f0: 65 0a 09 09 09 09 6f 70 65 6e 73 73 6c 69 6e 63  e.....opensslinc
1100: 6c 75 64 65 64 69 72 3d 27 27 0a 09 09 09 66 69  ludedir=''....fi
1110: 0a 09 09 5d 0a 09 29 0a 09 41 43 5f 4d 53 47 5f  ...]..)..AC_MSG_
1120: 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 4f 70  CHECKING([for Op
1130: 65 6e 53 53 4c 20 69 6e 63 6c 75 64 65 20 64 69  enSSL include di
1140: 72 65 63 74 6f 72 79 5d 29 0a 09 41 43 5f 4d 53  rectory])..AC_MS
1150: 47 5f 52 45 53 55 4c 54 28 24 6f 70 65 6e 73 73  G_RESULT($openss
1160: 6c 69 6e 63 6c 75 64 65 64 69 72 29 0a 0a 09 64  lincludedir)...d
1170: 6e 6c 20 53 65 74 20 53 53 4c 20 69 6e 63 6c 75  nl Set SSL inclu
1180: 64 65 20 76 61 72 73 0a 09 69 66 20 74 65 73 74  de vars..if test
1190: 20 2d 6e 20 22 24 6f 70 65 6e 73 73 6c 69 6e 63   -n "$opensslinc
11a0: 6c 75 64 65 64 69 72 22 3b 20 74 68 65 6e 0a 09  ludedir"; then..
11b0: 09 69 66 20 74 65 73 74 20 2d 66 20 22 24 6f 70  .if test -f "$op
11c0: 65 6e 73 73 6c 69 6e 63 6c 75 64 65 64 69 72 2f  ensslincludedir/
11d0: 73 73 6c 2e 68 22 3b 20 74 68 65 6e 0a 09 09 09  ssl.h"; then....
11e0: 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47  TCLTLS_SSL_CFLAG
11f0: 53 3d 22 2d 49 24 6f 70 65 6e 73 73 6c 69 6e 63  S="-I$opensslinc
1200: 6c 75 64 65 64 69 72 22 0a 09 09 09 54 43 4c 54  ludedir"....TCLT
1210: 4c 53 5f 53 53 4c 5f 49 4e 43 4c 55 44 45 53 3d  LS_SSL_INCLUDES=
1220: 22 2d 49 24 6f 70 65 6e 73 73 6c 69 6e 63 6c 75  "-I$opensslinclu
1230: 64 65 64 69 72 22 0a 09 09 65 6c 73 65 0a 09 09  dedir"...else...
1240: 09 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55  .AC_MSG_ERROR([U
1250: 6e 61 62 6c 65 20 74 6f 20 6c 6f 63 61 74 65 20  nable to locate 
1260: 73 73 6c 2e 68 5d 29 0a 09 09 66 69 0a 09 65 6c  ssl.h])...fi..el
1270: 73 65 0a 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f  se...TCLTLS_SSL_
1280: 43 46 4c 41 47 53 3d 22 2d 49 24 28 69 6e 63 6c  CFLAGS="-I$(incl
1290: 75 64 65 64 69 72 29 2f 6f 70 65 6e 73 73 6c 22  udedir)/openssl"
12a0: 0a 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 49 4e  ...TCLTLS_SSL_IN
12b0: 43 4c 55 44 45 53 3d 22 2d 49 24 28 69 6e 63 6c  CLUDES="-I$(incl
12c0: 75 64 65 64 69 72 29 2f 6f 70 65 6e 73 73 6c 22  udedir)/openssl"
12d0: 0a 09 66 69 0a 0a 09 64 6e 6c 20 53 65 74 20 53  ..fi...dnl Set S
12e0: 53 4c 20 6c 69 62 20 66 69 6c 65 73 20 70 61 74  SL lib files pat
12f0: 68 0a 09 41 43 5f 41 52 47 5f 57 49 54 48 28 5b  h..AC_ARG_WITH([
1300: 6f 70 65 6e 73 73 6c 2d 6c 69 62 64 69 72 5d 2c  openssl-libdir],
1310: 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e  ...AS_HELP_STRIN
1320: 47 28 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 73  G([--with-openss
1330: 6c 2d 6c 69 62 64 69 72 3d 3c 64 69 72 3e 5d 2c  l-libdir=<dir>],
1340: 0a 09 09 09 5b 70 61 74 68 20 74 6f 20 6c 69 62  ....[path to lib
1350: 20 64 69 72 65 63 74 6f 72 79 20 6f 66 20 4f 70   directory of Op
1360: 65 6e 53 53 4c 20 6f 72 20 4c 69 62 72 65 53 53  enSSL or LibreSS
1370: 4c 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 5d 0a  L installation].
1380: 09 09 29 2c 20 5b 0a 09 09 09 6f 70 65 6e 73 73  ..), [....openss
1390: 6c 6c 69 62 64 69 72 3d 22 24 77 69 74 68 76 61  llibdir="$withva
13a0: 6c 22 0a 09 09 5d 2c 20 5b 0a 09 09 09 69 66 20  l"...], [....if 
13b0: 74 65 73 74 20 2d 6e 20 22 24 6f 70 65 6e 73 73  test -n "$openss
13c0: 6c 64 69 72 22 3b 20 74 68 65 6e 0a 09 09 09 09  ldir"; then.....
13d0: 69 66 20 74 65 73 74 20 22 24 64 6f 36 34 62 69  if test "$do64bi
13e0: 74 22 20 3d 3d 20 27 79 65 73 27 3b 20 74 68 65  t" == 'yes'; the
13f0: 6e 0a 09 09 09 09 09 6f 70 65 6e 73 73 6c 6c 69  n......opensslli
1400: 62 64 69 72 3d 22 24 6f 70 65 6e 73 73 6c 64 69  bdir="$openssldi
1410: 72 2f 6c 69 62 36 34 22 0a 09 09 09 09 65 6c 73  r/lib64".....els
1420: 65 0a 09 09 09 09 09 6f 70 65 6e 73 73 6c 6c 69  e......opensslli
1430: 62 64 69 72 3d 22 24 6f 70 65 6e 73 73 6c 64 69  bdir="$openssldi
1440: 72 2f 6c 69 62 22 0a 09 09 09 09 66 69 0a 09 09  r/lib".....fi...
1450: 09 65 6c 73 65 0a 09 09 09 09 6f 70 65 6e 73 73  .else.....openss
1460: 6c 6c 69 62 64 69 72 3d 27 27 0a 09 09 09 66 69  llibdir=''....fi
1470: 0a 09 09 5d 0a 09 29 0a 09 41 43 5f 4d 53 47 5f  ...]..)..AC_MSG_
1480: 43 48 45 43 4b 49 4e 47 28 5b 66 6f 72 20 4f 70  CHECKING([for Op
1490: 65 6e 53 53 4c 20 6c 69 62 20 64 69 72 65 63 74  enSSL lib direct
14a0: 6f 72 79 5d 29 0a 09 41 43 5f 4d 53 47 5f 52 45  ory])..AC_MSG_RE
14b0: 53 55 4c 54 28 24 6f 70 65 6e 73 73 6c 6c 69 62  SULT($openssllib
14c0: 64 69 72 29 0a 0a 09 64 6e 6c 20 53 65 74 20 53  dir)...dnl Set S
14d0: 53 4c 20 6c 69 62 20 76 61 72 73 0a 09 69 66 20  SL lib vars..if 
14e0: 74 65 73 74 20 2d 6e 20 22 24 6f 70 65 6e 73 73  test -n "$openss
14f0: 6c 6c 69 62 64 69 72 22 3b 20 74 68 65 6e 0a 09  llibdir"; then..
1500: 09 69 66 20 74 65 73 74 20 2d 66 20 22 24 6f 70  .if test -f "$op
1510: 65 6e 73 73 6c 6c 69 62 64 69 72 2f 6c 69 62 73  enssllibdir/libs
1520: 73 6c 24 7b 53 48 4c 49 42 5f 53 55 46 46 49 58  sl${SHLIB_SUFFIX
1530: 7d 22 3b 20 74 68 65 6e 0a 09 09 09 69 66 20 74  }"; then....if t
1540: 65 73 74 20 22 24 7b 54 43 4c 45 58 54 5f 54 4c  est "${TCLEXT_TL
1550: 53 5f 53 54 41 54 49 43 5f 53 53 4c 7d 22 20 3d  S_STATIC_SSL}" =
1560: 3d 20 27 6e 6f 27 3b 20 74 68 65 6e 0a 09 09 09  = 'no'; then....
1570: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53  .TCLTLS_SSL_LIBS
1580: 3d 22 2d 4c 24 6f 70 65 6e 73 73 6c 6c 69 62 64  ="-L$openssllibd
1590: 69 72 20 2d 6c 63 72 79 70 74 6f 20 2d 6c 73 73  ir -lcrypto -lss
15a0: 6c 22 0a 09 09 09 65 6c 73 65 0a 09 09 09 09 23  l"....else.....#
15b0: 20 4c 69 6e 75 78 20 61 6e 64 20 53 6f 6c 61 72   Linux and Solar
15c0: 69 73 0a 09 09 09 09 54 43 4c 54 4c 53 5f 53 53  is.....TCLTLS_SS
15d0: 4c 5f 4c 49 42 53 3d 22 2d 57 6c 2c 2d 42 73 74  L_LIBS="-Wl,-Bst
15e0: 61 74 69 63 20 60 24 50 4b 47 5f 43 4f 4e 46 49  atic `$PKG_CONFI
15f0: 47 20 2d 2d 73 74 61 74 69 63 20 2d 2d 6c 69 62  G --static --lib
1600: 73 20 63 72 79 70 74 6f 20 73 73 6c 60 20 2d 57  s crypto ssl` -W
1610: 6c 2c 2d 42 64 79 6e 61 6d 69 63 22 0a 09 09 09  l,-Bdynamic"....
1620: 09 23 20 48 50 55 58 0a 09 09 09 09 23 20 2d 57  .# HPUX.....# -W
1630: 6c 2c 2d 61 2c 61 72 63 68 69 76 65 20 2e 2e 2e  l,-a,archive ...
1640: 20 2d 57 6c 2c 2d 61 2c 73 68 61 72 65 64 5f 61   -Wl,-a,shared_a
1650: 72 63 68 69 76 65 0a 09 09 09 66 69 0a 09 09 65  rchive....fi...e
1660: 6c 73 65 0a 09 09 09 41 43 5f 4d 53 47 5f 45 52  lse....AC_MSG_ER
1670: 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 6c  ROR([Unable to l
1680: 6f 63 61 74 65 20 6c 69 62 73 73 6c 24 7b 53 48  ocate libssl${SH
1690: 4c 49 42 5f 53 55 46 46 49 58 7d 5d 29 0a 09 09  LIB_SUFFIX}])...
16a0: 66 69 0a 09 65 6c 73 65 0a 09 09 54 43 4c 54 4c  fi..else...TCLTL
16b0: 53 5f 53 53 4c 5f 4c 49 42 53 3d 22 2d 6c 63 72  S_SSL_LIBS="-lcr
16c0: 79 70 74 6f 20 2d 6c 73 73 6c 22 0a 09 66 69 0a  ypto -lssl"..fi.
16d0: 0a 0a 09 64 6e 6c 20 49 6e 63 6c 75 64 65 20 63  ...dnl Include c
16e0: 6f 6e 66 69 67 20 76 61 72 69 61 62 6c 65 73 20  onfig variables 
16f0: 69 6e 20 2d 2d 68 65 6c 70 20 6c 69 73 74 20 61  in --help list a
1700: 6e 64 20 6d 61 6b 65 20 61 76 61 69 6c 61 62 6c  nd make availabl
1710: 65 20 74 6f 20 62 65 20 73 75 62 73 74 69 74 75  e to be substitu
1720: 74 65 64 20 76 69 61 20 41 43 5f 53 55 42 53 54  ted via AC_SUBST
1730: 2e 0a 09 41 43 5f 41 52 47 5f 56 41 52 28 5b 54  ...AC_ARG_VAR([T
1740: 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53  CLTLS_SSL_CFLAGS
1750: 5d 2c 20 5b 43 20 63 6f 6d 70 69 6c 65 72 20 66  ], [C compiler f
1760: 6c 61 67 73 20 66 6f 72 20 4f 70 65 6e 53 53 4c  lags for OpenSSL
1770: 20 6f 72 20 4c 69 62 72 65 53 53 4c 5d 29 0a 09   or LibreSSL])..
1780: 41 43 5f 41 52 47 5f 56 41 52 28 5b 54 43 4c 54  AC_ARG_VAR([TCLT
1790: 4c 53 5f 53 53 4c 5f 49 4e 43 4c 55 44 45 53 5d  LS_SSL_INCLUDES]
17a0: 2c 20 5b 43 20 63 6f 6d 70 69 6c 65 72 20 69 6e  , [C compiler in
17b0: 63 6c 75 64 65 20 70 61 74 68 73 20 66 6f 72 20  clude paths for 
17c0: 4f 70 65 6e 53 53 4c 20 6f 72 20 4c 69 62 72 65  OpenSSL or Libre
17d0: 53 53 4c 5d 29 0a 09 41 43 5f 41 52 47 5f 56 41  SSL])..AC_ARG_VA
17e0: 52 28 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49  R([TCLTLS_SSL_LI
17f0: 42 53 5d 2c 20 5b 6c 69 62 72 61 72 69 65 73 20  BS], [libraries 
1800: 74 6f 20 70 61 73 73 20 74 6f 20 74 68 65 20 6c  to pass to the l
1810: 69 6e 6b 65 72 20 66 6f 72 20 4f 70 65 6e 53 53  inker for OpenSS
1820: 4c 20 6f 72 20 4c 69 62 72 65 53 53 4c 5d 29 0a  L or LibreSSL]).
1830: 0a 0a 09 64 6e 6c 20 53 65 74 20 6c 6f 63 61 74  ...dnl Set locat
1840: 69 6f 6e 20 6f 66 20 70 6b 67 63 6f 6e 66 69 67  ion of pkgconfig
1850: 20 66 69 6c 65 73 0a 09 41 43 5f 41 52 47 5f 57   files..AC_ARG_W
1860: 49 54 48 28 5b 6f 70 65 6e 73 73 6c 2d 70 6b 67  ITH([openssl-pkg
1870: 63 6f 6e 66 69 67 5d 2c 0a 09 09 41 53 5f 48 45  config],...AS_HE
1880: 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 77 69 74  LP_STRING([--wit
1890: 68 2d 6f 70 65 6e 73 73 6c 2d 70 6b 67 63 6f 6e  h-openssl-pkgcon
18a0: 66 69 67 3d 3c 64 69 72 3e 5d 2c 0a 09 09 09 5b  fig=<dir>],....[
18b0: 70 61 74 68 20 74 6f 20 72 6f 6f 74 20 64 69 72  path to root dir
18c0: 65 63 74 6f 72 79 20 6f 66 20 4f 70 65 6e 53 53  ectory of OpenSS
18d0: 4c 20 6f 72 20 4c 69 62 72 65 53 53 4c 20 70 6b  L or LibreSSL pk
18e0: 67 63 6f 6e 66 69 67 64 69 72 5d 0a 09 09 29 2c  gconfigdir]...),
18f0: 20 5b 0a 09 09 09 6f 70 65 6e 73 73 6c 70 6b 67   [....opensslpkg
1900: 63 6f 6e 66 69 67 64 69 72 3d 22 24 77 69 74 68  configdir="$with
1910: 76 61 6c 22 0a 09 09 5d 2c 20 5b 0a 09 09 09 6f  val"...], [....o
1920: 70 65 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64  pensslpkgconfigd
1930: 69 72 3d 27 27 0a 09 09 5d 0a 09 29 0a 09 41 43  ir=''...]..)..AC
1940: 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 28 5b 66  _MSG_CHECKING([f
1950: 6f 72 20 4f 70 65 6e 53 53 4c 20 70 6b 67 63 6f  or OpenSSL pkgco
1960: 6e 66 69 67 5d 29 0a 09 41 43 5f 4d 53 47 5f 52  nfig])..AC_MSG_R
1970: 45 53 55 4c 54 28 24 6f 70 65 6e 73 73 6c 70 6b  ESULT($opensslpk
1980: 67 63 6f 6e 66 69 67 64 69 72 29 0a 0a 0a 09 23  gconfigdir)....#
1990: 20 55 73 65 20 50 61 63 6b 61 67 65 20 43 6f 6e   Use Package Con
19a0: 66 69 67 20 74 6f 6f 6c 20 74 6f 20 67 65 74 20  fig tool to get 
19b0: 63 6f 6e 66 69 67 0a 09 70 6b 67 43 6f 6e 66 69  config..pkgConfi
19c0: 67 45 78 74 72 61 41 72 67 73 3d 27 27 0a 09 69  gExtraArgs=''..i
19d0: 66 20 74 65 73 74 20 22 24 7b 53 48 41 52 45 44  f test "${SHARED
19e0: 5f 42 55 49 4c 44 7d 22 20 3d 3d 20 30 20 2d 6f  _BUILD}" == 0 -o
19f0: 20 22 24 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54   "$TCLEXT_TLS_ST
1a00: 41 54 49 43 5f 53 53 4c 22 20 3d 20 27 79 65 73  ATIC_SSL" = 'yes
1a10: 27 3b 20 74 68 65 6e 0a 09 09 70 6b 67 43 6f 6e  '; then...pkgCon
1a20: 66 69 67 45 78 74 72 61 41 72 67 73 3d 27 2d 2d  figExtraArgs='--
1a30: 73 74 61 74 69 63 27 0a 09 66 69 0a 0a 09 64 6e  static'..fi...dn
1a40: 6c 20 55 73 65 20 70 6b 67 2d 63 6f 6e 66 69 67  l Use pkg-config
1a50: 20 74 6f 20 66 69 6e 64 20 74 68 65 20 6c 69 62   to find the lib
1a60: 72 61 72 69 65 73 0a 09 69 66 20 74 65 73 74 20  raries..if test 
1a70: 2d 6e 20 22 24 7b 50 4b 47 5f 43 4f 4e 46 49 47  -n "${PKG_CONFIG
1a80: 7d 22 3b 20 74 68 65 6e 0a 09 09 64 6e 6c 20 54  }"; then...dnl T
1a90: 65 6d 70 6f 72 61 72 69 6c 79 20 75 70 64 61 74  emporarily updat
1aa0: 65 20 50 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 54  e PKG_CONFIG_PAT
1ab0: 48 0a 09 09 50 4b 47 5f 43 4f 4e 46 49 47 5f 50  H...PKG_CONFIG_P
1ac0: 41 54 48 5f 53 41 56 45 3d 22 24 7b 50 4b 47 5f  ATH_SAVE="${PKG_
1ad0: 43 4f 4e 46 49 47 5f 50 41 54 48 7d 22 0a 09 09  CONFIG_PATH}"...
1ae0: 69 66 20 74 65 73 74 20 2d 6e 20 22 24 7b 6f 70  if test -n "${op
1af0: 65 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 69  ensslpkgconfigdi
1b00: 72 7d 22 3b 20 74 68 65 6e 0a 09 09 09 69 66 20  r}"; then....if 
1b10: 21 20 74 65 73 74 20 2d 66 20 22 24 7b 6f 70 65  ! test -f "${ope
1b20: 6e 73 73 6c 70 6b 67 63 6f 6e 66 69 67 64 69 72  nsslpkgconfigdir
1b30: 7d 2f 6f 70 65 6e 73 73 6c 2e 70 63 22 3b 20 74  }/openssl.pc"; t
1b40: 68 65 6e 0a 09 09 09 09 41 43 5f 4d 53 47 5f 45  hen.....AC_MSG_E
1b50: 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20  RROR([Unable to 
1b60: 6c 6f 63 61 74 65 20 24 7b 6f 70 65 6e 73 73 6c  locate ${openssl
1b70: 70 6b 67 63 6f 6e 66 69 67 64 69 72 7d 2f 6f 70  pkgconfigdir}/op
1b80: 65 6e 73 73 6c 2e 70 63 5d 29 0a 09 09 09 66 69  enssl.pc])....fi
1b90: 0a 0a 09 09 09 50 4b 47 5f 43 4f 4e 46 49 47 5f  .....PKG_CONFIG_
1ba0: 50 41 54 48 3d 22 24 7b 6f 70 65 6e 73 73 6c 70  PATH="${opensslp
1bb0: 6b 67 63 6f 6e 66 69 67 64 69 72 7d 24 7b 50 41  kgconfigdir}${PA
1bc0: 54 48 5f 53 45 50 41 52 41 54 4f 52 7d 24 7b 50  TH_SEPARATOR}${P
1bd0: 4b 47 5f 43 4f 4e 46 49 47 5f 50 41 54 48 7d 22  KG_CONFIG_PATH}"
1be0: 0a 09 09 09 65 78 70 6f 72 74 20 50 4b 47 5f 43  ....export PKG_C
1bf0: 4f 4e 46 49 47 5f 50 41 54 48 0a 09 09 66 69 0a  ONFIG_PATH...fi.
1c00: 09 09 69 66 20 74 65 73 74 20 2d 7a 20 22 24 54  ..if test -z "$T
1c10: 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 22 3b  CLTLS_SSL_LIBS";
1c20: 20 74 68 65 6e 0a 09 09 09 54 43 4c 54 4c 53 5f   then....TCLTLS_
1c30: 53 53 4c 5f 4c 49 42 53 3d 22 60 22 24 7b 50 4b  SSL_LIBS="`"${PK
1c40: 47 5f 43 4f 4e 46 49 47 7d 22 20 6f 70 65 6e 73  G_CONFIG}" opens
1c50: 73 6c 20 2d 2d 6c 69 62 73 20 24 70 6b 67 43 6f  sl --libs $pkgCo
1c60: 6e 66 69 67 45 78 74 72 61 41 72 67 73 60 22 20  nfigExtraArgs`" 
1c70: 7c 7c 20 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28  || AC_MSG_ERROR(
1c80: 5b 55 6e 61 62 6c 65 20 74 6f 20 67 65 74 20 4f  [Unable to get O
1c90: 70 65 6e 53 53 4c 20 43 6f 6e 66 69 67 75 72 61  penSSL Configura
1ca0: 74 69 6f 6e 5d 29 0a 09 09 66 69 0a 09 09 69 66  tion])...fi...if
1cb0: 20 74 65 73 74 20 2d 7a 20 22 24 54 43 4c 54 4c   test -z "$TCLTL
1cc0: 53 5f 53 53 4c 5f 43 46 4c 41 47 53 22 3b 20 74  S_SSL_CFLAGS"; t
1cd0: 68 65 6e 0a 09 09 09 54 43 4c 54 4c 53 5f 53 53  hen....TCLTLS_SS
1ce0: 4c 5f 43 46 4c 41 47 53 3d 22 60 22 24 7b 50 4b  L_CFLAGS="`"${PK
1cf0: 47 5f 43 4f 4e 46 49 47 7d 22 20 6f 70 65 6e 73  G_CONFIG}" opens
1d00: 73 6c 20 2d 2d 63 66 6c 61 67 73 2d 6f 6e 6c 79  sl --cflags-only
1d10: 2d 6f 74 68 65 72 20 24 70 6b 67 43 6f 6e 66 69  -other $pkgConfi
1d20: 67 45 78 74 72 61 41 72 67 73 60 22 20 7c 7c 20  gExtraArgs`" || 
1d30: 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55 6e  AC_MSG_ERROR([Un
1d40: 61 62 6c 65 20 74 6f 20 67 65 74 20 4f 70 65 6e  able to get Open
1d50: 53 53 4c 20 43 6f 6e 66 69 67 75 72 61 74 69 6f  SSL Configuratio
1d60: 6e 5d 29 0a 09 09 66 69 0a 09 09 69 66 20 74 65  n])...fi...if te
1d70: 73 74 20 2d 7a 20 22 24 54 43 4c 54 4c 53 5f 53  st -z "$TCLTLS_S
1d80: 53 4c 5f 49 4e 43 4c 55 44 45 53 22 3b 20 74 68  SL_INCLUDES"; th
1d90: 65 6e 0a 09 09 09 54 43 4c 54 4c 53 5f 53 53 4c  en....TCLTLS_SSL
1da0: 5f 49 4e 43 4c 55 44 45 53 3d 22 60 22 24 7b 50  _INCLUDES="`"${P
1db0: 4b 47 5f 43 4f 4e 46 49 47 7d 22 20 6f 70 65 6e  KG_CONFIG}" open
1dc0: 73 73 6c 20 2d 2d 63 66 6c 61 67 73 2d 6f 6e 6c  ssl --cflags-onl
1dd0: 79 2d 49 20 24 70 6b 67 43 6f 6e 66 69 67 45 78  y-I $pkgConfigEx
1de0: 74 72 61 41 72 67 73 60 22 20 7c 7c 20 41 43 5f  traArgs`" || AC_
1df0: 4d 53 47 5f 45 52 52 4f 52 28 5b 55 6e 61 62 6c  MSG_ERROR([Unabl
1e00: 65 20 74 6f 20 67 65 74 20 4f 70 65 6e 53 53 4c  e to get OpenSSL
1e10: 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5d 29   Configuration])
1e20: 0a 09 09 66 69 0a 09 09 50 4b 47 5f 43 4f 4e 46  ...fi...PKG_CONF
1e30: 49 47 5f 50 41 54 48 3d 22 24 7b 50 4b 47 5f 43  IG_PATH="${PKG_C
1e40: 4f 4e 46 49 47 5f 50 41 54 48 5f 53 41 56 45 7d  ONFIG_PATH_SAVE}
1e50: 22 0a 09 66 69 0a 5d 29 0a                       "..fi.]).