Hex Artifact Content

Artifact 6606614e6e9ff1cfbd3d259934b7823fab437267:


0000: 64 6e 6c 20 44 65 66 69 6e 65 20 6f 75 72 73 65  dnl Define ourse
0010: 6c 76 65 73 0a 41 43 5f 49 4e 49 54 28 74 63 6c  lves.AC_INIT(tcl
0020: 74 6c 73 2c 20 31 2e 37 2e 33 29 0a 0a 64 6e 6c  tls, 1.7.3)..dnl
0030: 20 43 68 65 63 6b 73 20 66 6f 72 20 70 72 6f 67   Checks for prog
0040: 72 61 6d 73 2e 0a 41 43 5f 50 52 4f 47 5f 43 43  rams..AC_PROG_CC
0050: 0a 41 43 5f 50 52 4f 47 5f 4d 41 4b 45 5f 53 45  .AC_PROG_MAKE_SE
0060: 54 0a 41 43 5f 50 52 4f 47 5f 49 4e 53 54 41 4c  T.AC_PROG_INSTAL
0070: 4c 0a 41 43 5f 47 4e 55 5f 53 4f 55 52 43 45 0a  L.AC_GNU_SOURCE.
0080: 0a 64 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 73  .dnl Determine s
0090: 79 73 74 65 6d 20 69 6e 66 6f 72 6d 61 74 69 6f  ystem informatio
00a0: 6e 0a 44 43 5f 43 48 4b 5f 4f 53 5f 49 4e 46 4f  n.DC_CHK_OS_INFO
00b0: 0a 0a 64 6e 6c 20 4c 6f 6f 6b 20 66 6f 72 20 61  ..dnl Look for a
00c0: 70 70 72 6f 70 72 69 61 74 65 20 68 65 61 64 65  ppropriate heade
00d0: 72 73 0a 41 43 5f 43 48 45 43 4b 5f 48 45 41 44  rs.AC_CHECK_HEAD
00e0: 45 52 53 28 75 6e 69 73 74 64 2e 68 20 73 74 64  ERS(unistd.h std
00f0: 6c 69 62 2e 68 20 73 74 72 69 6e 67 2e 68 20 73  lib.h string.h s
0100: 74 72 69 6e 67 73 2e 68 29 0a 0a 64 6e 6c 20 50  trings.h)..dnl P
0110: 65 72 66 6f 72 6d 20 54 63 6c 20 45 78 74 65 6e  erform Tcl Exten
0120: 73 69 6f 6e 20 72 65 71 75 69 72 65 64 20 73 74  sion required st
0130: 75 66 66 0a 54 43 4c 45 58 54 5f 49 4e 49 54 0a  uff.TCLEXT_INIT.
0140: 0a 69 66 20 74 65 73 74 20 22 24 54 43 4c 45 58  .if test "$TCLEX
0150: 54 5f 42 55 49 4c 44 22 20 21 3d 20 27 73 74 61  T_BUILD" != 'sta
0160: 74 69 63 27 3b 20 74 68 65 6e 0a 09 64 6e 6c 20  tic'; then..dnl 
0170: 44 65 74 65 72 6d 69 6e 65 20 68 6f 77 20 74 6f  Determine how to
0180: 20 6d 61 6b 65 20 73 68 61 72 65 64 20 6f 62 6a   make shared obj
0190: 65 63 74 73 0a 09 44 43 5f 47 45 54 5f 53 48 4f  ects..DC_GET_SHO
01a0: 42 4a 46 4c 41 47 53 0a 0a 09 45 58 54 45 4e 53  BJFLAGS...EXTENS
01b0: 49 4f 4e 5f 54 41 52 47 45 54 3d 22 74 63 6c 74  ION_TARGET="tclt
01c0: 6c 73 2e 24 7b 53 48 4f 42 4a 45 58 54 7d 22 0a  ls.${SHOBJEXT}".
01d0: 65 6c 73 65 0a 09 41 43 5f 43 48 45 43 4b 5f 54  else..AC_CHECK_T
01e0: 4f 4f 4c 28 5b 41 52 5d 2c 20 5b 61 72 5d 2c 20  OOL([AR], [ar], 
01f0: 5b 66 61 6c 73 65 5d 29 0a 09 41 43 5f 43 48 45  [false])..AC_CHE
0200: 43 4b 5f 54 4f 4f 4c 28 5b 52 41 4e 4c 49 42 5d  CK_TOOL([RANLIB]
0210: 2c 20 5b 72 61 6e 6c 69 62 5d 2c 20 5b 3a 5d 29  , [ranlib], [:])
0220: 0a 09 45 58 54 45 4e 53 49 4f 4e 5f 54 41 52 47  ..EXTENSION_TARG
0230: 45 54 3d 22 74 63 6c 74 6c 73 2e 24 7b 41 52 45  ET="tcltls.${ARE
0240: 58 54 7d 22 0a 66 69 0a 41 43 5f 53 55 42 53 54  XT}".fi.AC_SUBST
0250: 28 45 58 54 45 4e 53 49 4f 4e 5f 54 41 52 47 45  (EXTENSION_TARGE
0260: 54 29 0a 41 43 5f 53 55 42 53 54 28 54 43 4c 45  T).AC_SUBST(TCLE
0270: 58 54 5f 42 55 49 4c 44 29 0a 0a 64 6e 6c 20 44  XT_BUILD)..dnl D
0280: 65 74 65 72 6d 69 6e 65 20 77 68 61 74 20 53 53  etermine what SS
0290: 4c 20 6c 69 62 72 61 72 79 20 74 6f 20 6c 69 6e  L library to lin
02a0: 6b 20 77 69 74 68 0a 41 43 5f 41 52 47 5f 57 49  k with.AC_ARG_WI
02b0: 54 48 28 5b 73 73 6c 5d 2c 20 41 53 5f 48 45 4c  TH([ssl], AS_HEL
02c0: 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 77 69 74 68  P_STRING([--with
02d0: 2d 73 73 6c 3d 3c 6e 61 6d 65 3e 5d 2c 20 5b 6e  -ssl=<name>], [n
02e0: 61 6d 65 20 6f 66 20 73 73 6c 20 6c 69 62 72 61  ame of ssl libra
02f0: 72 79 20 74 6f 20 62 75 69 6c 64 20 61 67 61 69  ry to build agai
0300: 6e 73 74 20 28 6f 70 65 6e 73 73 6c 2c 20 6c 69  nst (openssl, li
0310: 62 72 65 73 73 6c 2c 20 6e 73 73 2c 20 61 75 74  bressl, nss, aut
0320: 6f 29 5d 29 2c 20 5b 0a 09 69 66 20 74 65 73 74  o)]), [..if test
0330: 20 22 24 77 69 74 68 76 61 6c 22 20 3d 20 22 6e   "$withval" = "n
0340: 6f 22 3b 20 74 68 65 6e 0a 09 09 41 43 5f 4d 53  o"; then...AC_MS
0350: 47 5f 45 52 52 4f 52 28 5b 59 6f 75 20 6d 61 79  G_ERROR([You may
0360: 20 6e 6f 74 20 73 70 65 63 69 66 79 20 2d 2d 77   not specify --w
0370: 69 74 68 6f 75 74 2d 73 73 6c 5d 29 0a 09 66 69  ithout-ssl])..fi
0380: 0a 0a 09 69 66 20 74 65 73 74 20 22 24 77 69 74  ...if test "$wit
0390: 68 76 61 6c 22 20 3d 20 22 79 65 73 22 3b 20 74  hval" = "yes"; t
03a0: 68 65 6e 0a 09 09 41 43 5f 4d 53 47 5f 45 52 52  hen...AC_MSG_ERR
03b0: 4f 52 28 5b 49 66 20 79 6f 75 20 73 70 65 63 69  OR([If you speci
03c0: 66 79 20 2d 2d 77 69 74 68 2d 73 73 6c 20 74 68  fy --with-ssl th
03d0: 65 6e 20 79 6f 75 20 6d 75 73 74 20 70 72 6f 76  en you must prov
03e0: 69 64 65 20 61 20 76 61 6c 75 65 5d 29 0a 09 66  ide a value])..f
03f0: 69 0a 0a 09 74 63 6c 74 6c 73 5f 73 73 6c 5f 6c  i...tcltls_ssl_l
0400: 69 62 3d 22 24 77 69 74 68 76 61 6c 22 0a 5d 2c  ib="$withval".],
0410: 20 5b 0a 09 74 63 6c 74 6c 73 5f 73 73 6c 5f 6c   [..tcltls_ssl_l
0420: 69 62 3d 27 61 75 74 6f 27 0a 5d 29 0a 0a 64 6e  ib='auto'.])..dn
0430: 6c 20 45 6e 61 62 6c 65 20 73 75 70 70 6f 72 74  l Enable support
0440: 20 66 6f 72 20 62 75 69 6c 64 69 6e 67 20 74 68   for building th
0450: 65 20 73 61 6d 65 20 6c 69 62 72 61 72 79 20 65  e same library e
0460: 76 65 72 79 20 74 69 6d 65 0a 74 63 6c 74 6c 73  very time.tcltls
0470: 5f 64 65 74 65 72 6d 69 6e 69 73 74 69 63 3d 27  _deterministic='
0480: 66 61 6c 73 65 27 0a 41 43 5f 41 52 47 5f 45 4e  false'.AC_ARG_EN
0490: 41 42 4c 45 28 5b 64 65 74 65 72 6d 69 6e 69 73  ABLE([determinis
04a0: 74 69 63 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54  tic], AS_HELP_ST
04b0: 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 64  RING([--enable-d
04c0: 65 74 65 72 6d 69 6e 69 73 74 69 63 5d 2c 20 5b  eterministic], [
04d0: 65 6e 61 62 6c 65 20 64 65 74 65 72 6d 69 6e 69  enable determini
04e0: 73 74 69 63 20 70 61 72 61 6d 65 74 65 72 73 5d  stic parameters]
04f0: 29 2c 20 5b 0a 09 69 66 20 74 65 73 74 20 22 24  ), [..if test "$
0500: 65 6e 61 62 6c 65 76 61 6c 22 20 3d 20 22 79 65  enableval" = "ye
0510: 73 22 3b 20 74 68 65 6e 0a 09 09 74 63 6c 74 6c  s"; then...tcltl
0520: 73 5f 64 65 74 65 72 6d 69 6e 69 73 74 69 63 3d  s_deterministic=
0530: 27 74 72 75 65 27 0a 09 66 69 0a 5d 29 0a 69 66  'true'..fi.]).if
0540: 20 74 65 73 74 20 22 24 74 63 6c 74 6c 73 5f 64   test "$tcltls_d
0550: 65 74 65 72 6d 69 6e 69 73 74 69 63 22 20 3d 20  eterministic" = 
0560: 27 74 72 75 65 27 3b 20 74 68 65 6e 0a 09 47 45  'true'; then..GE
0570: 4e 5f 44 48 5f 50 41 52 41 4d 53 5f 41 52 47 53  N_DH_PARAMS_ARGS
0580: 3d 27 66 61 6c 6c 62 61 63 6b 27 0a 65 6c 73 65  ='fallback'.else
0590: 0a 09 47 45 4e 5f 44 48 5f 50 41 52 41 4d 53 5f  ..GEN_DH_PARAMS_
05a0: 41 52 47 53 3d 27 27 0a 66 69 0a 41 43 5f 53 55  ARGS=''.fi.AC_SU
05b0: 42 53 54 28 47 45 4e 5f 44 48 5f 50 41 52 41 4d  BST(GEN_DH_PARAM
05c0: 53 5f 41 52 47 53 29 0a 0a 64 6e 6c 20 41 6c 6c  S_ARGS)..dnl All
05d0: 6f 77 20 74 68 65 20 75 73 65 72 20 74 6f 20 6d  ow the user to m
05e0: 61 6e 75 61 6c 6c 79 20 64 69 73 61 62 6c 65 20  anually disable 
05f0: 70 72 6f 74 6f 63 6f 6c 73 0a 64 6e 6c 20 23 23  protocols.dnl ##
0600: 20 53 53 4c 76 32 3a 20 44 69 73 61 62 6c 65 64   SSLv2: Disabled
0610: 20 62 79 20 64 65 66 61 75 6c 74 0a 74 63 6c 74   by default.tclt
0620: 6c 73 5f 73 73 6c 5f 73 73 6c 32 3d 27 66 61 6c  ls_ssl_ssl2='fal
0630: 73 65 27 0a 41 43 5f 41 52 47 5f 45 4e 41 42 4c  se'.AC_ARG_ENABL
0640: 45 28 5b 73 73 6c 76 32 5d 2c 20 41 53 5f 48 45  E([sslv2], AS_HE
0650: 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61  LP_STRING([--ena
0660: 62 6c 65 2d 73 73 6c 76 32 5d 2c 20 5b 65 6e 61  ble-sslv2], [ena
0670: 62 6c 65 20 53 53 4c 76 32 20 70 72 6f 74 6f 63  ble SSLv2 protoc
0680: 6f 6c 5d 29 2c 20 5b 0a 09 69 66 20 74 65 73 74  ol]), [..if test
0690: 20 22 24 65 6e 61 62 6c 65 76 61 6c 22 20 3d 20   "$enableval" = 
06a0: 22 79 65 73 22 3b 20 74 68 65 6e 0a 09 09 74 63  "yes"; then...tc
06b0: 6c 74 6c 73 5f 73 73 6c 5f 73 73 6c 32 3d 27 66  ltls_ssl_ssl2='f
06c0: 6f 72 63 65 27 0a 09 66 69 0a 5d 29 0a 0a 64 6e  orce'..fi.])..dn
06d0: 6c 20 23 23 20 53 53 4c 76 33 3a 20 44 69 73 61  l ## SSLv3: Disa
06e0: 62 6c 65 64 20 62 79 20 64 65 66 61 75 6c 74 0a  bled by default.
06f0: 74 63 6c 74 6c 73 5f 73 73 6c 5f 73 73 6c 33 3d  tcltls_ssl_ssl3=
0700: 27 66 61 6c 73 65 27 0a 41 43 5f 41 52 47 5f 45  'false'.AC_ARG_E
0710: 4e 41 42 4c 45 28 5b 73 73 6c 76 33 5d 2c 20 41  NABLE([sslv3], A
0720: 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d  S_HELP_STRING([-
0730: 2d 65 6e 61 62 6c 65 2d 73 73 6c 76 33 5d 2c 20  -enable-sslv3], 
0740: 5b 65 6e 61 62 6c 65 20 53 53 4c 76 33 20 70 72  [enable SSLv3 pr
0750: 6f 74 6f 63 6f 6c 5d 29 2c 20 5b 0a 09 69 66 20  otocol]), [..if 
0760: 74 65 73 74 20 22 24 65 6e 61 62 6c 65 76 61 6c  test "$enableval
0770: 22 20 3d 20 22 79 65 73 22 3b 20 74 68 65 6e 0a  " = "yes"; then.
0780: 09 09 74 63 6c 74 6c 73 5f 73 73 6c 5f 73 73 6c  ..tcltls_ssl_ssl
0790: 33 3d 27 66 6f 72 63 65 27 0a 09 66 69 0a 5d 29  3='force'..fi.])
07a0: 0a 0a 64 6e 6c 20 23 23 20 54 4c 53 76 31 2e 30  ..dnl ## TLSv1.0
07b0: 3a 20 45 6e 61 62 6c 65 64 20 62 79 20 64 65 66  : Enabled by def
07c0: 61 75 6c 74 0a 74 63 6c 74 6c 73 5f 73 73 6c 5f  ault.tcltls_ssl_
07d0: 74 6c 73 31 5f 30 3d 27 74 72 75 65 27 0a 41 43  tls1_0='true'.AC
07e0: 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b 74 6c 73  _ARG_ENABLE([tls
07f0: 76 31 2e 30 5d 2c 20 41 53 5f 48 45 4c 50 5f 53  v1.0], AS_HELP_S
0800: 54 52 49 4e 47 28 5b 2d 2d 64 69 73 61 62 6c 65  TRING([--disable
0810: 2d 74 6c 73 76 31 2e 30 5d 2c 20 5b 64 69 73 61  -tlsv1.0], [disa
0820: 62 6c 65 20 54 4c 53 76 31 2e 30 20 70 72 6f 74  ble TLSv1.0 prot
0830: 6f 63 6f 6c 5d 29 2c 20 5b 0a 09 69 66 20 74 65  ocol]), [..if te
0840: 73 74 20 22 24 65 6e 61 62 6c 65 76 61 6c 22 20  st "$enableval" 
0850: 3d 20 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 09 74  = "no"; then...t
0860: 63 6c 74 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 30  cltls_ssl_tls1_0
0870: 3d 27 66 61 6c 73 65 27 0a 09 66 69 0a 5d 29 0a  ='false'..fi.]).
0880: 0a 64 6e 6c 20 23 23 20 54 4c 53 76 31 2e 31 3a  .dnl ## TLSv1.1:
0890: 20 45 6e 61 62 6c 65 64 20 62 79 20 64 65 66 61   Enabled by defa
08a0: 75 6c 74 0a 74 63 6c 74 6c 73 5f 73 73 6c 5f 74  ult.tcltls_ssl_t
08b0: 6c 73 31 5f 31 3d 27 74 72 75 65 27 0a 41 43 5f  ls1_1='true'.AC_
08c0: 41 52 47 5f 45 4e 41 42 4c 45 28 5b 74 6c 73 76  ARG_ENABLE([tlsv
08d0: 31 2e 31 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54  1.1], AS_HELP_ST
08e0: 52 49 4e 47 28 5b 2d 2d 64 69 73 61 62 6c 65 2d  RING([--disable-
08f0: 74 6c 73 76 31 2e 31 5d 2c 20 5b 64 69 73 61 62  tlsv1.1], [disab
0900: 6c 65 20 54 4c 53 76 31 2e 31 20 70 72 6f 74 6f  le TLSv1.1 proto
0910: 63 6f 6c 5d 29 2c 20 5b 0a 09 69 66 20 74 65 73  col]), [..if tes
0920: 74 20 22 24 65 6e 61 62 6c 65 76 61 6c 22 20 3d  t "$enableval" =
0930: 20 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 09 74 63   "no"; then...tc
0940: 6c 74 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 31 3d  ltls_ssl_tls1_1=
0950: 27 66 61 6c 73 65 27 0a 09 66 69 0a 5d 29 0a 0a  'false'..fi.])..
0960: 64 6e 6c 20 23 23 20 54 4c 53 76 31 2e 31 3a 20  dnl ## TLSv1.1: 
0970: 45 6e 61 62 6c 65 64 20 62 79 20 64 65 66 61 75  Enabled by defau
0980: 6c 74 0a 74 63 6c 74 6c 73 5f 73 73 6c 5f 74 6c  lt.tcltls_ssl_tl
0990: 73 31 5f 32 3d 27 74 72 75 65 27 0a 41 43 5f 41  s1_2='true'.AC_A
09a0: 52 47 5f 45 4e 41 42 4c 45 28 5b 74 6c 73 76 31  RG_ENABLE([tlsv1
09b0: 2e 32 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 52  .2], AS_HELP_STR
09c0: 49 4e 47 28 5b 2d 2d 64 69 73 61 62 6c 65 2d 74  ING([--disable-t
09d0: 6c 73 76 31 2e 32 5d 2c 20 5b 64 69 73 61 62 6c  lsv1.2], [disabl
09e0: 65 20 54 4c 53 76 31 2e 32 20 70 72 6f 74 6f 63  e TLSv1.2 protoc
09f0: 6f 6c 5d 29 2c 20 5b 0a 09 69 66 20 74 65 73 74  ol]), [..if test
0a00: 20 22 24 65 6e 61 62 6c 65 76 61 6c 22 20 3d 20   "$enableval" = 
0a10: 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 09 74 63 6c  "no"; then...tcl
0a20: 74 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 32 3d 27  tls_ssl_tls1_2='
0a30: 66 61 6c 73 65 27 0a 09 66 69 0a 5d 29 0a 0a 64  false'..fi.])..d
0a40: 6e 6c 20 45 6e 61 62 6c 65 20 73 75 70 70 6f 72  nl Enable suppor
0a50: 74 20 66 6f 72 20 61 20 64 65 62 75 67 67 69 6e  t for a debuggin
0a60: 67 20 62 75 69 6c 64 0a 74 63 6c 74 6c 73 5f 64  g build.tcltls_d
0a70: 65 62 75 67 3d 27 66 61 6c 73 65 27 0a 41 43 5f  ebug='false'.AC_
0a80: 41 52 47 5f 45 4e 41 42 4c 45 28 5b 64 65 62 75  ARG_ENABLE([debu
0a90: 67 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 52 49  g], AS_HELP_STRI
0aa0: 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 64 65 62  NG([--enable-deb
0ab0: 75 67 5d 2c 20 5b 65 6e 61 62 6c 65 20 64 65 62  ug], [enable deb
0ac0: 75 67 67 69 6e 67 20 70 61 72 61 6d 65 74 65 72  ugging parameter
0ad0: 73 5d 29 2c 20 5b 0a 09 69 66 20 74 65 73 74 20  s]), [..if test 
0ae0: 22 24 65 6e 61 62 6c 65 76 61 6c 22 20 3d 20 22  "$enableval" = "
0af0: 79 65 73 22 3b 20 74 68 65 6e 0a 09 09 74 63 6c  yes"; then...tcl
0b00: 74 6c 73 5f 64 65 62 75 67 3d 27 74 72 75 65 27  tls_debug='true'
0b10: 0a 09 66 69 0a 5d 29 0a 69 66 20 74 65 73 74 20  ..fi.]).if test 
0b20: 22 24 74 63 6c 74 6c 73 5f 64 65 62 75 67 22 20  "$tcltls_debug" 
0b30: 3d 20 27 74 72 75 65 27 3b 20 74 68 65 6e 0a 09  = 'true'; then..
0b40: 41 43 5f 44 45 46 49 4e 45 28 54 43 4c 45 58 54  AC_DEFINE(TCLEXT
0b50: 5f 54 43 4c 54 4c 53 5f 44 45 42 55 47 2c 20 5b  _TCLTLS_DEBUG, [
0b60: 31 5d 2c 20 5b 45 6e 61 62 6c 65 20 64 65 62 75  1], [Enable debu
0b70: 67 67 69 6e 67 20 62 75 69 6c 64 5d 29 0a 09 41  gging build])..A
0b80: 58 5f 43 48 45 43 4b 5f 43 4f 4d 50 49 4c 45 5f  X_CHECK_COMPILE_
0b90: 46 4c 41 47 28 5b 2d 66 63 68 65 63 6b 2d 70 6f  FLAG([-fcheck-po
0ba0: 69 6e 74 65 72 2d 62 6f 75 6e 64 73 5d 2c 20 5b  inter-bounds], [
0bb0: 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20  CFLAGS="$CFLAGS 
0bc0: 2d 66 63 68 65 63 6b 2d 70 6f 69 6e 74 65 72 2d  -fcheck-pointer-
0bd0: 62 6f 75 6e 64 73 22 5d 29 0a 09 41 58 5f 43 48  bounds"])..AX_CH
0be0: 45 43 4b 5f 43 4f 4d 50 49 4c 45 5f 46 4c 41 47  ECK_COMPILE_FLAG
0bf0: 28 5b 2d 66 73 61 6e 69 74 69 7a 65 3d 61 64 64  ([-fsanitize=add
0c00: 72 65 73 73 5d 2c 20 5b 43 46 4c 41 47 53 3d 22  ress], [CFLAGS="
0c10: 24 43 46 4c 41 47 53 20 2d 66 73 61 6e 69 74 69  $CFLAGS -fsaniti
0c20: 7a 65 3d 61 64 64 72 65 73 73 22 5d 29 0a 09 41  ze=address"])..A
0c30: 58 5f 43 48 45 43 4b 5f 43 4f 4d 50 49 4c 45 5f  X_CHECK_COMPILE_
0c40: 46 4c 41 47 28 5b 2d 66 73 61 6e 69 74 69 7a 65  FLAG([-fsanitize
0c50: 3d 75 6e 64 65 66 69 6e 65 64 5d 2c 20 5b 43 46  =undefined], [CF
0c60: 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d 66  LAGS="$CFLAGS -f
0c70: 73 61 6e 69 74 69 7a 65 3d 75 6e 64 65 66 69 6e  sanitize=undefin
0c80: 65 64 22 5d 29 0a 65 6c 73 65 0a 09 64 6e 6c 20  ed"]).else..dnl 
0c90: 49 66 20 77 65 20 61 72 65 20 6e 6f 74 20 64 6f  If we are not do
0ca0: 69 6e 67 20 64 65 62 75 67 67 69 6e 67 20 64 69  ing debugging di
0cb0: 73 61 62 6c 65 20 73 6f 6d 65 20 6f 66 20 74 68  sable some of th
0cc0: 65 20 6d 6f 72 65 20 61 6e 6e 6f 79 69 6e 67 20  e more annoying 
0cd0: 77 61 72 6e 69 6e 67 73 0a 09 41 58 5f 43 48 45  warnings..AX_CHE
0ce0: 43 4b 5f 43 4f 4d 50 49 4c 45 5f 46 4c 41 47 28  CK_COMPILE_FLAG(
0cf0: 5b 2d 57 6e 6f 2d 75 6e 75 73 65 64 2d 76 61 6c  [-Wno-unused-val
0d00: 75 65 5d 2c 20 5b 43 46 4c 41 47 53 3d 22 24 43  ue], [CFLAGS="$C
0d10: 46 4c 41 47 53 20 2d 57 6e 6f 2d 75 6e 75 73 65  FLAGS -Wno-unuse
0d20: 64 2d 76 61 6c 75 65 22 5d 29 0a 09 41 58 5f 43  d-value"])..AX_C
0d30: 48 45 43 4b 5f 43 4f 4d 50 49 4c 45 5f 46 4c 41  HECK_COMPILE_FLA
0d40: 47 28 5b 2d 57 6e 6f 2d 75 6e 75 73 65 64 2d 70  G([-Wno-unused-p
0d50: 61 72 61 6d 65 74 65 72 5d 2c 20 5b 43 46 4c 41  arameter], [CFLA
0d60: 47 53 3d 22 24 43 46 4c 41 47 53 20 2d 57 6e 6f  GS="$CFLAGS -Wno
0d70: 2d 75 6e 75 73 65 64 2d 70 61 72 61 6d 65 74 65  -unused-paramete
0d80: 72 22 5d 29 0a 09 41 58 5f 43 48 45 43 4b 5f 43  r"])..AX_CHECK_C
0d90: 4f 4d 50 49 4c 45 5f 46 4c 41 47 28 5b 2d 57 6e  OMPILE_FLAG([-Wn
0da0: 6f 2d 64 65 70 72 65 63 61 74 65 64 2d 64 65 63  o-deprecated-dec
0db0: 6c 61 72 61 74 69 6f 6e 73 5d 2c 20 5b 43 46 4c  larations], [CFL
0dc0: 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d 57 6e  AGS="$CFLAGS -Wn
0dd0: 6f 2d 64 65 70 72 65 63 61 74 65 64 2d 64 65 63  o-deprecated-dec
0de0: 6c 61 72 61 74 69 6f 6e 73 22 5d 29 0a 66 69 0a  larations"]).fi.
0df0: 0a 64 6e 6c 20 46 69 6e 64 20 22 78 78 64 22 20  .dnl Find "xxd" 
0e00: 73 6f 20 77 65 20 63 61 6e 20 62 75 69 6c 64 20  so we can build 
0e10: 74 68 65 20 74 6c 73 2e 74 63 6c 2e 68 20 66 69  the tls.tcl.h fi
0e20: 6c 65 0a 41 43 5f 43 48 45 43 4b 5f 50 52 4f 47  le.AC_CHECK_PROG
0e30: 28 5b 58 58 44 5d 2c 20 5b 78 78 64 5d 2c 20 5b  ([XXD], [xxd], [
0e40: 78 78 64 5d 2c 20 5b 5f 5f 78 78 64 5f 5f 6e 6f  xxd], [__xxd__no
0e50: 74 5f 5f 66 6f 75 6e 64 5d 29 0a 0a 64 6e 6c 20  t__found])..dnl 
0e60: 46 69 6e 64 20 22 70 6b 67 2d 63 6f 6e 66 69 67  Find "pkg-config
0e70: 22 20 73 69 6e 63 65 20 77 65 20 6e 65 65 64 20  " since we need 
0e80: 74 6f 20 75 73 65 20 69 74 0a 41 43 5f 43 48 45  to use it.AC_CHE
0e90: 43 4b 5f 54 4f 4f 4c 28 5b 50 4b 47 43 4f 4e 46  CK_TOOL([PKGCONF
0ea0: 49 47 5d 2c 20 5b 70 6b 67 2d 63 6f 6e 66 69 67  IG], [pkg-config
0eb0: 5d 2c 20 5b 66 61 6c 73 65 5d 29 0a 0a 64 6e 6c  ], [false])..dnl
0ec0: 20 44 65 74 65 72 6d 69 6e 65 20 69 66 20 77 65   Determine if we
0ed0: 20 68 61 76 65 20 62 65 65 6e 20 61 73 6b 65 64   have been asked
0ee0: 20 74 6f 20 73 74 61 74 69 63 61 6c 6c 79 20 6c   to statically l
0ef0: 69 6e 6b 20 74 6f 20 74 68 65 20 53 53 4c 20 6c  ink to the SSL l
0f00: 69 62 72 61 72 79 0a 54 43 4c 45 58 54 5f 54 4c  ibrary.TCLEXT_TL
0f10: 53 5f 53 54 41 54 49 43 5f 53 53 4c 3d 27 6e 6f  S_STATIC_SSL='no
0f20: 27 0a 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28  '.AC_ARG_ENABLE(
0f30: 5b 73 74 61 74 69 63 2d 73 73 6c 5d 2c 20 41 53  [static-ssl], AS
0f40: 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d  _HELP_STRING([--
0f50: 65 6e 61 62 6c 65 2d 73 74 61 74 69 63 2d 73 73  enable-static-ss
0f60: 6c 5d 2c 20 5b 65 6e 61 62 6c 65 20 73 74 61 74  l], [enable stat
0f70: 69 63 61 6c 6c 79 20 6c 69 6e 6b 69 6e 67 20 74  ically linking t
0f80: 6f 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20  o the specified 
0f90: 53 53 4c 20 6c 69 62 72 61 72 79 5d 29 2c 20 5b  SSL library]), [
0fa0: 0a 09 69 66 20 74 65 73 74 20 22 24 65 6e 61 62  ..if test "$enab
0fb0: 6c 65 76 61 6c 22 20 3d 20 27 79 65 73 27 3b 20  leval" = 'yes'; 
0fc0: 74 68 65 6e 0a 09 09 54 43 4c 45 58 54 5f 54 4c  then...TCLEXT_TL
0fd0: 53 5f 53 54 41 54 49 43 5f 53 53 4c 3d 27 79 65  S_STATIC_SSL='ye
0fe0: 73 27 0a 09 66 69 0a 5d 29 0a 0a 64 6e 6c 20 45  s'..fi.])..dnl E
0ff0: 6e 61 62 6c 65 20 63 6f 6d 70 69 6c 65 72 20 77  nable compiler w
1000: 61 72 6e 69 6e 67 73 0a 41 58 5f 43 48 45 43 4b  arnings.AX_CHECK
1010: 5f 43 4f 4d 50 49 4c 45 5f 46 4c 41 47 28 5b 2d  _COMPILE_FLAG([-
1020: 57 61 6c 6c 5d 2c 20 5b 43 46 4c 41 47 53 3d 22  Wall], [CFLAGS="
1030: 24 43 46 4c 41 47 53 20 2d 57 61 6c 6c 22 5d 29  $CFLAGS -Wall"])
1040: 0a 41 58 5f 43 48 45 43 4b 5f 43 4f 4d 50 49 4c  .AX_CHECK_COMPIL
1050: 45 5f 46 4c 41 47 28 5b 2d 57 5d 2c 20 5b 43 46  E_FLAG([-W], [CF
1060: 4c 41 47 53 3d 22 24 43 46 4c 41 47 53 20 2d 57  LAGS="$CFLAGS -W
1070: 22 5d 29 0a 0a 64 6e 6c 20 45 6e 61 62 6c 65 20  "])..dnl Enable 
1080: 68 61 72 64 65 6e 69 6e 67 0a 41 58 5f 43 48 45  hardening.AX_CHE
1090: 43 4b 5f 43 4f 4d 50 49 4c 45 5f 46 4c 41 47 28  CK_COMPILE_FLAG(
10a0: 5b 2d 66 73 74 61 63 6b 2d 70 72 6f 74 65 63 74  [-fstack-protect
10b0: 6f 72 2d 61 6c 6c 5d 2c 20 5b 43 46 4c 41 47 53  or-all], [CFLAGS
10c0: 3d 22 24 43 46 4c 41 47 53 20 2d 66 73 74 61 63  ="$CFLAGS -fstac
10d0: 6b 2d 70 72 6f 74 65 63 74 6f 72 2d 61 6c 6c 22  k-protector-all"
10e0: 5d 29 0a 41 58 5f 43 48 45 43 4b 5f 43 4f 4d 50  ]).AX_CHECK_COMP
10f0: 49 4c 45 5f 46 4c 41 47 28 5b 2d 66 6e 6f 2d 73  ILE_FLAG([-fno-s
1100: 74 72 69 63 74 2d 6f 76 65 72 66 6c 6f 77 5d 2c  trict-overflow],
1110: 20 5b 43 46 4c 41 47 53 3d 22 24 43 46 4c 41 47   [CFLAGS="$CFLAG
1120: 53 20 2d 66 6e 6f 2d 73 74 72 69 63 74 2d 6f 76  S -fno-strict-ov
1130: 65 72 66 6c 6f 77 22 5d 29 0a 41 43 5f 44 45 46  erflow"]).AC_DEF
1140: 49 4e 45 28 5b 5f 46 4f 52 54 49 46 59 5f 53 4f  INE([_FORTIFY_SO
1150: 55 52 43 45 5d 2c 20 5b 32 5d 2c 20 5b 45 6e 61  URCE], [2], [Ena
1160: 62 6c 65 20 66 6f 72 74 69 66 69 63 61 74 69 6f  ble fortificatio
1170: 6e 5d 29 0a 0a 64 6e 6c 20 58 58 58 3a 54 4f 44  n])..dnl XXX:TOD
1180: 4f 3a 20 41 75 74 6f 6d 61 74 69 63 61 6c 6c 79  O: Automatically
1190: 20 64 65 74 65 72 6d 69 6e 65 20 74 68 65 20 53   determine the S
11a0: 53 4c 20 6c 69 62 72 61 72 79 20 74 6f 20 75 73  SL library to us
11b0: 65 0a 64 6e 6c 20 20 20 20 20 20 20 20 20 20 20  e.dnl           
11c0: 64 65 66 61 75 6c 74 69 6e 67 20 74 6f 20 4f 70  defaulting to Op
11d0: 65 6e 53 53 4c 20 66 6f 72 20 63 6f 6d 70 61 74  enSSL for compat
11e0: 69 62 69 6c 69 74 79 20 72 65 61 73 6f 6e 73 0a  ibility reasons.
11f0: 69 66 20 74 65 73 74 20 22 24 74 63 6c 74 6c 73  if test "$tcltls
1200: 5f 73 73 6c 5f 6c 69 62 22 20 3d 20 27 61 75 74  _ssl_lib" = 'aut
1210: 6f 27 3b 20 74 68 65 6e 0a 09 74 63 6c 74 6c 73  o'; then..tcltls
1220: 5f 73 73 6c 5f 6c 69 62 3d 27 6f 70 65 6e 73 73  _ssl_lib='openss
1230: 6c 27 0a 66 69 0a 0a 41 43 5f 4d 53 47 5f 43 48  l'.fi..AC_MSG_CH
1240: 45 43 4b 49 4e 47 28 5b 77 68 69 63 68 20 54 4c  ECKING([which TL
1250: 53 20 6c 69 62 72 61 72 79 20 74 6f 20 75 73 65  S library to use
1260: 5d 29 0a 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  ]).AC_MSG_RESULT
1270: 28 5b 24 74 63 6c 74 6c 73 5f 73 73 6c 5f 6c 69  ([$tcltls_ssl_li
1280: 62 5d 29 0a 0a 64 6e 6c 20 4d 61 6e 75 61 6c 6c  b])..dnl Manuall
1290: 79 20 72 65 77 72 69 74 65 20 6c 69 62 72 65 73  y rewrite libres
12a0: 73 6c 20 74 6f 20 4f 70 65 6e 53 53 4c 20 73 69  sl to OpenSSL si
12b0: 6e 63 65 20 77 65 20 75 73 65 20 74 68 65 0a 64  nce we use the.d
12c0: 6e 6c 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 79  nl compatibility
12d0: 20 69 6e 74 65 72 66 61 63 65 0a 69 66 20 74 65   interface.if te
12e0: 73 74 20 22 24 74 63 6c 74 6c 73 5f 73 73 6c 5f  st "$tcltls_ssl_
12f0: 6c 69 62 22 20 3d 20 22 6c 69 62 72 65 73 73 6c  lib" = "libressl
1300: 22 3b 20 74 68 65 6e 0a 09 74 63 6c 74 6c 73 5f  "; then..tcltls_
1310: 73 73 6c 5f 6c 69 62 3d 27 6f 70 65 6e 73 73 6c  ssl_lib='openssl
1320: 27 0a 66 69 0a 0a 41 53 5f 43 41 53 45 28 5b 24  '.fi..AS_CASE([$
1330: 74 63 6c 74 6c 73 5f 73 73 6c 5f 6c 69 62 5d 2c  tcltls_ssl_lib],
1340: 0a 09 5b 6f 70 65 6e 73 73 6c 5d 2c 20 5b 0a 09  ..[openssl], [..
1350: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4f 50 45 4e  .TCLTLS_SSL_OPEN
1360: 53 53 4c 0a 09 5d 2c 0a 09 5b 6e 73 73 5d 2c 20  SSL..],..[nss], 
1370: 5b 0a 09 20 09 54 43 4c 54 4c 53 5f 53 53 4c 5f  [.. .TCLTLS_SSL_
1380: 4c 49 42 53 3d 22 22 0a 09 09 54 43 4c 54 4c 53  LIBS=""...TCLTLS
1390: 5f 53 53 4c 5f 43 46 4c 41 47 53 3d 22 22 0a 09  _SSL_CFLAGS=""..
13a0: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 46  .TCLTLS_SSL_CPPF
13b0: 4c 41 47 53 3d 22 22 0a 09 5d 2c 0a 09 5b 0a 09  LAGS=""..],..[..
13c0: 09 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55  .AC_MSG_ERROR([U
13d0: 6e 73 75 70 70 6f 72 74 65 64 20 53 53 4c 20 6c  nsupported SSL l
13e0: 69 62 72 61 72 79 3a 20 24 74 63 6c 74 6c 73 5f  ibrary: $tcltls_
13f0: 73 73 6c 5f 6c 69 62 5d 29 0a 09 5d 0a 29 0a 64  ssl_lib])..].).d
1400: 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 68 6f 77  nl Determine how
1410: 20 74 6f 20 75 73 65 20 74 68 69 73 20 53 53 4c   to use this SSL
1420: 20 6c 69 62 72 61 72 79 0a 41 43 5f 4d 53 47 5f   library.AC_MSG_
1430: 43 48 45 43 4b 49 4e 47 28 5b 68 6f 77 20 74 6f  CHECKING([how to
1440: 20 75 73 65 20 24 74 63 6c 74 6c 73 5f 73 73 6c   use $tcltls_ssl
1450: 5f 6c 69 62 5d 29 0a 4c 49 42 53 3d 22 24 7b 4c  _lib]).LIBS="${L
1460: 49 42 53 7d 20 24 7b 54 43 4c 54 4c 53 5f 53 53  IBS} ${TCLTLS_SS
1470: 4c 5f 4c 49 42 53 7d 22 0a 43 46 4c 41 47 53 3d  L_LIBS}".CFLAGS=
1480: 22 24 7b 43 46 4c 41 47 53 7d 20 24 7b 54 43 4c  "${CFLAGS} ${TCL
1490: 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53 7d 22  TLS_SSL_CFLAGS}"
14a0: 0a 43 50 50 46 4c 41 47 53 3d 22 24 7b 43 50 50  .CPPFLAGS="${CPP
14b0: 46 4c 41 47 53 7d 20 24 7b 54 43 4c 54 4c 53 5f  FLAGS} ${TCLTLS_
14c0: 53 53 4c 5f 43 50 50 46 4c 41 47 53 7d 22 0a 41  SSL_CPPFLAGS}".A
14d0: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 24 54  C_MSG_RESULT([$T
14e0: 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 46 4c 41  CLTLS_SSL_CPPFLA
14f0: 47 53 20 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 43  GS $TCLTLS_SSL_C
1500: 46 4c 41 47 53 20 24 54 43 4c 54 4c 53 5f 53 53  FLAGS $TCLTLS_SS
1510: 4c 5f 4c 49 42 53 5d 29 0a 0a 64 6e 6c 20 53 79  L_LIBS])..dnl Sy
1520: 6e 63 20 74 68 65 20 52 50 41 54 48 20 69 66 20  nc the RPATH if 
1530: 72 65 71 75 65 73 74 65 64 0a 69 66 20 74 65 73  requested.if tes
1540: 74 20 22 24 54 43 4c 45 58 54 5f 42 55 49 4c 44  t "$TCLEXT_BUILD
1550: 22 20 21 3d 20 27 73 74 61 74 69 63 27 3b 20 74  " != 'static'; t
1560: 68 65 6e 0a 09 69 66 20 74 65 73 74 20 22 24 54  hen..if test "$T
1570: 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54 49 43  CLEXT_TLS_STATIC
1580: 5f 53 53 4c 22 20 3d 20 27 79 65 73 27 3b 20 74  _SSL" = 'yes'; t
1590: 68 65 6e 0a 09 09 44 43 5f 53 59 4e 43 5f 52 50  hen...DC_SYNC_RP
15a0: 41 54 48 28 5b 6e 6f 5d 29 0a 09 65 6c 73 65 0a  ATH([no])..else.
15b0: 09 09 44 43 5f 53 59 4e 43 5f 52 50 41 54 48 28  ..DC_SYNC_RPATH(
15c0: 5b 79 65 73 5d 29 0a 09 66 69 0a 66 69 0a 0a 64  [yes])..fi.fi..d
15d0: 6e 6c 20 50 72 6f 64 75 63 65 20 6f 75 74 70 75  nl Produce outpu
15e0: 74 0a 41 43 5f 4f 55 54 50 55 54 28 4d 61 6b 65  t.AC_OUTPUT(Make
15f0: 66 69 6c 65 20 70 6b 67 49 6e 64 65 78 2e 74 63  file pkgIndex.tc
1600: 6c 29 0a                                         l).