Hex Artifact Content

Artifact eb7a77895b497f9b4fb9ccf0dfae1346e8981587:


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 30 29 0a 0a 64 6e 6c  tls, 1.7.0)..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 61 22 0a 66 69  ET="tcltls.a".fi
0240: 0a 41 43 5f 53 55 42 53 54 28 45 58 54 45 4e 53  .AC_SUBST(EXTENS
0250: 49 4f 4e 5f 54 41 52 47 45 54 29 0a 41 43 5f 53  ION_TARGET).AC_S
0260: 55 42 53 54 28 54 43 4c 45 58 54 5f 42 55 49 4c  UBST(TCLEXT_BUIL
0270: 44 29 0a 0a 64 6e 6c 20 44 65 74 65 72 6d 69 6e  D)..dnl Determin
0280: 65 20 77 68 61 74 20 53 53 4c 20 6c 69 62 72 61  e what SSL libra
0290: 72 79 20 74 6f 20 6c 69 6e 6b 20 77 69 74 68 0a  ry to link with.
02a0: 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 73 73 6c  AC_ARG_WITH([ssl
02b0: 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e  ], AS_HELP_STRIN
02c0: 47 28 5b 2d 2d 77 69 74 68 2d 73 73 6c 3d 3c 6e  G([--with-ssl=<n
02d0: 61 6d 65 3e 5d 2c 20 5b 6e 61 6d 65 20 6f 66 20  ame>], [name of 
02e0: 73 73 6c 20 6c 69 62 72 61 72 79 20 74 6f 20 62  ssl library to b
02f0: 75 69 6c 64 20 61 67 61 69 6e 73 74 20 28 6f 70  uild against (op
0300: 65 6e 73 73 6c 2c 20 6c 69 62 72 65 73 73 6c 2c  enssl, libressl,
0310: 20 6e 73 73 2c 20 61 75 74 6f 29 5d 29 2c 20 5b   nss, auto)]), [
0320: 0a 09 69 66 20 74 65 73 74 20 22 24 77 69 74 68  ..if test "$with
0330: 76 61 6c 22 20 3d 20 22 6e 6f 22 3b 20 74 68 65  val" = "no"; the
0340: 6e 0a 09 09 41 43 5f 4d 53 47 5f 45 52 52 4f 52  n...AC_MSG_ERROR
0350: 28 5b 59 6f 75 20 6d 61 79 20 6e 6f 74 20 73 70  ([You may not sp
0360: 65 63 69 66 79 20 2d 2d 77 69 74 68 6f 75 74 2d  ecify --without-
0370: 73 73 6c 5d 29 0a 09 66 69 0a 0a 09 69 66 20 74  ssl])..fi...if t
0380: 65 73 74 20 22 24 77 69 74 68 76 61 6c 22 20 3d  est "$withval" =
0390: 20 22 79 65 73 22 3b 20 74 68 65 6e 0a 09 09 41   "yes"; then...A
03a0: 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 49 66 20  C_MSG_ERROR([If 
03b0: 79 6f 75 20 73 70 65 63 69 66 79 20 2d 2d 77 69  you specify --wi
03c0: 74 68 2d 73 73 6c 20 74 68 65 6e 20 79 6f 75 20  th-ssl then you 
03d0: 6d 75 73 74 20 70 72 6f 76 69 64 65 20 61 20 76  must provide a v
03e0: 61 6c 75 65 5d 29 0a 09 66 69 0a 0a 09 74 63 6c  alue])..fi...tcl
03f0: 74 6c 73 5f 73 73 6c 5f 6c 69 62 3d 22 24 77 69  tls_ssl_lib="$wi
0400: 74 68 76 61 6c 22 0a 5d 2c 20 5b 0a 09 74 63 6c  thval".], [..tcl
0410: 74 6c 73 5f 73 73 6c 5f 6c 69 62 3d 27 61 75 74  tls_ssl_lib='aut
0420: 6f 27 0a 5d 29 0a 0a 64 6e 6c 20 45 6e 61 62 6c  o'.])..dnl Enabl
0430: 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 62 75  e support for bu
0440: 69 6c 64 69 6e 67 20 74 68 65 20 73 61 6d 65 20  ilding the same 
0450: 6c 69 62 72 61 72 79 20 65 76 65 72 79 20 74 69  library every ti
0460: 6d 65 0a 74 63 6c 74 6c 73 5f 64 65 74 65 72 6d  me.tcltls_determ
0470: 69 6e 69 73 74 69 63 3d 27 66 61 6c 73 65 27 0a  inistic='false'.
0480: 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b 64  AC_ARG_ENABLE([d
0490: 65 74 65 72 6d 69 6e 69 73 74 69 63 5d 2c 20 41  eterministic], A
04a0: 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d  S_HELP_STRING([-
04b0: 2d 65 6e 61 62 6c 65 2d 64 65 74 65 72 6d 69 6e  -enable-determin
04c0: 69 73 74 69 63 5d 2c 20 5b 65 6e 61 62 6c 65 20  istic], [enable 
04d0: 64 65 74 65 72 6d 69 6e 69 73 74 69 63 20 70 61  deterministic pa
04e0: 72 61 6d 65 74 65 72 73 5d 29 2c 20 5b 0a 09 69  rameters]), [..i
04f0: 66 20 74 65 73 74 20 22 24 65 6e 61 62 6c 65 76  f test "$enablev
0500: 61 6c 22 20 3d 20 22 79 65 73 22 3b 20 74 68 65  al" = "yes"; the
0510: 6e 0a 09 09 74 63 6c 74 6c 73 5f 64 65 74 65 72  n...tcltls_deter
0520: 6d 69 6e 69 73 74 69 63 3d 27 74 72 75 65 27 0a  ministic='true'.
0530: 09 66 69 0a 5d 29 0a 69 66 20 74 65 73 74 20 22  .fi.]).if test "
0540: 24 74 63 6c 74 6c 73 5f 64 65 74 65 72 6d 69 6e  $tcltls_determin
0550: 69 73 74 69 63 22 20 3d 20 27 74 72 75 65 27 3b  istic" = 'true';
0560: 20 74 68 65 6e 0a 09 47 45 4e 5f 44 48 5f 50 41   then..GEN_DH_PA
0570: 52 41 4d 53 5f 41 52 47 53 3d 27 66 61 6c 6c 62  RAMS_ARGS='fallb
0580: 61 63 6b 27 0a 65 6c 73 65 0a 09 47 45 4e 5f 44  ack'.else..GEN_D
0590: 48 5f 50 41 52 41 4d 53 5f 41 52 47 53 3d 27 27  H_PARAMS_ARGS=''
05a0: 0a 66 69 0a 41 43 5f 53 55 42 53 54 28 47 45 4e  .fi.AC_SUBST(GEN
05b0: 5f 44 48 5f 50 41 52 41 4d 53 5f 41 52 47 53 29  _DH_PARAMS_ARGS)
05c0: 0a 0a 64 6e 6c 20 41 6c 6c 6f 77 20 74 68 65 20  ..dnl Allow the 
05d0: 75 73 65 72 20 74 6f 20 6d 61 6e 75 61 6c 6c 79  user to manually
05e0: 20 64 69 73 61 62 6c 65 20 70 72 6f 74 6f 63 6f   disable protoco
05f0: 6c 73 0a 64 6e 6c 20 23 23 20 53 53 4c 76 32 3a  ls.dnl ## SSLv2:
0600: 20 44 69 73 61 62 6c 65 64 20 62 79 20 64 65 66   Disabled by def
0610: 61 75 6c 74 0a 74 63 6c 74 6c 73 5f 73 73 6c 5f  ault.tcltls_ssl_
0620: 73 73 6c 32 3d 27 66 61 6c 73 65 27 0a 41 43 5f  ssl2='false'.AC_
0630: 41 52 47 5f 45 4e 41 42 4c 45 28 5b 73 73 6c 76  ARG_ENABLE([sslv
0640: 32 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 52 49  2], AS_HELP_STRI
0650: 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65 2d 73 73 6c  NG([--enable-ssl
0660: 76 32 5d 2c 20 5b 65 6e 61 62 6c 65 20 53 53 4c  v2], [enable SSL
0670: 76 32 20 70 72 6f 74 6f 63 6f 6c 5d 29 2c 20 5b  v2 protocol]), [
0680: 0a 09 69 66 20 74 65 73 74 20 22 24 65 6e 61 62  ..if test "$enab
0690: 6c 65 76 61 6c 22 20 3d 20 22 79 65 73 22 3b 20  leval" = "yes"; 
06a0: 74 68 65 6e 0a 09 09 74 63 6c 74 6c 73 5f 73 73  then...tcltls_ss
06b0: 6c 5f 73 73 6c 32 3d 27 66 6f 72 63 65 27 0a 09  l_ssl2='force'..
06c0: 66 69 0a 5d 29 0a 0a 64 6e 6c 20 23 23 20 53 53  fi.])..dnl ## SS
06d0: 4c 76 33 3a 20 44 69 73 61 62 6c 65 64 20 62 79  Lv3: Disabled by
06e0: 20 64 65 66 61 75 6c 74 0a 74 63 6c 74 6c 73 5f   default.tcltls_
06f0: 73 73 6c 5f 73 73 6c 33 3d 27 66 61 6c 73 65 27  ssl_ssl3='false'
0700: 0a 41 43 5f 41 52 47 5f 45 4e 41 42 4c 45 28 5b  .AC_ARG_ENABLE([
0710: 73 73 6c 76 33 5d 2c 20 41 53 5f 48 45 4c 50 5f  sslv3], AS_HELP_
0720: 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65  STRING([--enable
0730: 2d 73 73 6c 76 33 5d 2c 20 5b 65 6e 61 62 6c 65  -sslv3], [enable
0740: 20 53 53 4c 76 33 20 70 72 6f 74 6f 63 6f 6c 5d   SSLv3 protocol]
0750: 29 2c 20 5b 0a 09 69 66 20 74 65 73 74 20 22 24  ), [..if test "$
0760: 65 6e 61 62 6c 65 76 61 6c 22 20 3d 20 22 79 65  enableval" = "ye
0770: 73 22 3b 20 74 68 65 6e 0a 09 09 74 63 6c 74 6c  s"; then...tcltl
0780: 73 5f 73 73 6c 5f 73 73 6c 33 3d 27 66 6f 72 63  s_ssl_ssl3='forc
0790: 65 27 0a 09 66 69 0a 5d 29 0a 0a 64 6e 6c 20 23  e'..fi.])..dnl #
07a0: 23 20 54 4c 53 76 31 2e 30 3a 20 45 6e 61 62 6c  # TLSv1.0: Enabl
07b0: 65 64 20 62 79 20 64 65 66 61 75 6c 74 0a 74 63  ed by default.tc
07c0: 6c 74 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 30 3d  ltls_ssl_tls1_0=
07d0: 27 74 72 75 65 27 0a 41 43 5f 41 52 47 5f 45 4e  'true'.AC_ARG_EN
07e0: 41 42 4c 45 28 5b 74 6c 73 76 31 2e 30 5d 2c 20  ABLE([tlsv1.0], 
07f0: 41 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b  AS_HELP_STRING([
0800: 2d 2d 64 69 73 61 62 6c 65 2d 74 6c 73 76 31 2e  --disable-tlsv1.
0810: 30 5d 2c 20 5b 64 69 73 61 62 6c 65 20 54 4c 53  0], [disable TLS
0820: 76 31 2e 30 20 70 72 6f 74 6f 63 6f 6c 5d 29 2c  v1.0 protocol]),
0830: 20 5b 0a 09 69 66 20 74 65 73 74 20 22 24 65 6e   [..if test "$en
0840: 61 62 6c 65 76 61 6c 22 20 3d 20 22 6e 6f 22 3b  ableval" = "no";
0850: 20 74 68 65 6e 0a 09 09 74 63 6c 74 6c 73 5f 73   then...tcltls_s
0860: 73 6c 5f 74 6c 73 31 5f 30 3d 27 66 61 6c 73 65  sl_tls1_0='false
0870: 27 0a 09 66 69 0a 5d 29 0a 0a 64 6e 6c 20 23 23  '..fi.])..dnl ##
0880: 20 54 4c 53 76 31 2e 31 3a 20 45 6e 61 62 6c 65   TLSv1.1: Enable
0890: 64 20 62 79 20 64 65 66 61 75 6c 74 0a 74 63 6c  d by default.tcl
08a0: 74 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 31 3d 27  tls_ssl_tls1_1='
08b0: 74 72 75 65 27 0a 41 43 5f 41 52 47 5f 45 4e 41  true'.AC_ARG_ENA
08c0: 42 4c 45 28 5b 74 6c 73 76 31 2e 31 5d 2c 20 41  BLE([tlsv1.1], A
08d0: 53 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d  S_HELP_STRING([-
08e0: 2d 64 69 73 61 62 6c 65 2d 74 6c 73 76 31 2e 31  -disable-tlsv1.1
08f0: 5d 2c 20 5b 64 69 73 61 62 6c 65 20 54 4c 53 76  ], [disable TLSv
0900: 31 2e 31 20 70 72 6f 74 6f 63 6f 6c 5d 29 2c 20  1.1 protocol]), 
0910: 5b 0a 09 69 66 20 74 65 73 74 20 22 24 65 6e 61  [..if test "$ena
0920: 62 6c 65 76 61 6c 22 20 3d 20 22 6e 6f 22 3b 20  bleval" = "no"; 
0930: 74 68 65 6e 0a 09 09 74 63 6c 74 6c 73 5f 73 73  then...tcltls_ss
0940: 6c 5f 74 6c 73 31 5f 31 3d 27 66 61 6c 73 65 27  l_tls1_1='false'
0950: 0a 09 66 69 0a 5d 29 0a 0a 64 6e 6c 20 23 23 20  ..fi.])..dnl ## 
0960: 54 4c 53 76 31 2e 31 3a 20 45 6e 61 62 6c 65 64  TLSv1.1: Enabled
0970: 20 62 79 20 64 65 66 61 75 6c 74 0a 74 63 6c 74   by default.tclt
0980: 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 32 3d 27 74  ls_ssl_tls1_2='t
0990: 72 75 65 27 0a 41 43 5f 41 52 47 5f 45 4e 41 42  rue'.AC_ARG_ENAB
09a0: 4c 45 28 5b 74 6c 73 76 31 2e 32 5d 2c 20 41 53  LE([tlsv1.2], AS
09b0: 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d  _HELP_STRING([--
09c0: 64 69 73 61 62 6c 65 2d 74 6c 73 76 31 2e 32 5d  disable-tlsv1.2]
09d0: 2c 20 5b 64 69 73 61 62 6c 65 20 54 4c 53 76 31  , [disable TLSv1
09e0: 2e 32 20 70 72 6f 74 6f 63 6f 6c 5d 29 2c 20 5b  .2 protocol]), [
09f0: 0a 09 69 66 20 74 65 73 74 20 22 24 65 6e 61 62  ..if test "$enab
0a00: 6c 65 76 61 6c 22 20 3d 20 22 6e 6f 22 3b 20 74  leval" = "no"; t
0a10: 68 65 6e 0a 09 09 74 63 6c 74 6c 73 5f 73 73 6c  hen...tcltls_ssl
0a20: 5f 74 6c 73 31 5f 32 3d 27 66 61 6c 73 65 27 0a  _tls1_2='false'.
0a30: 09 66 69 0a 5d 29 0a 0a 64 6e 6c 20 45 6e 61 62  .fi.])..dnl Enab
0a40: 6c 65 20 73 75 70 70 6f 72 74 20 66 6f 72 20 61  le support for a
0a50: 20 64 65 62 75 67 67 69 6e 67 20 62 75 69 6c 64   debugging build
0a60: 0a 74 63 6c 74 6c 73 5f 64 65 62 75 67 3d 27 66  .tcltls_debug='f
0a70: 61 6c 73 65 27 0a 41 43 5f 41 52 47 5f 45 4e 41  alse'.AC_ARG_ENA
0a80: 42 4c 45 28 5b 64 65 62 75 67 5d 2c 20 41 53 5f  BLE([debug], AS_
0a90: 48 45 4c 50 5f 53 54 52 49 4e 47 28 5b 2d 2d 65  HELP_STRING([--e
0aa0: 6e 61 62 6c 65 2d 64 65 62 75 67 5d 2c 20 5b 65  nable-debug], [e
0ab0: 6e 61 62 6c 65 20 64 65 62 75 67 67 69 6e 67 20  nable debugging 
0ac0: 70 61 72 61 6d 65 74 65 72 73 5d 29 2c 20 5b 0a  parameters]), [.
0ad0: 09 69 66 20 74 65 73 74 20 22 24 65 6e 61 62 6c  .if test "$enabl
0ae0: 65 76 61 6c 22 20 3d 20 22 79 65 73 22 3b 20 74  eval" = "yes"; t
0af0: 68 65 6e 0a 09 09 74 63 6c 74 6c 73 5f 64 65 62  hen...tcltls_deb
0b00: 75 67 3d 27 74 72 75 65 27 0a 09 66 69 0a 5d 29  ug='true'..fi.])
0b10: 0a 69 66 20 74 65 73 74 20 22 24 74 63 6c 74 6c  .if test "$tcltl
0b20: 73 5f 64 65 62 75 67 22 20 3d 20 27 74 72 75 65  s_debug" = 'true
0b30: 27 3b 20 74 68 65 6e 0a 09 41 43 5f 44 45 46 49  '; then..AC_DEFI
0b40: 4e 45 28 54 43 4c 45 58 54 5f 54 43 4c 54 4c 53  NE(TCLEXT_TCLTLS
0b50: 5f 44 45 42 55 47 2c 20 5b 31 5d 2c 20 5b 45 6e  _DEBUG, [1], [En
0b60: 61 62 6c 65 20 64 65 62 75 67 67 69 6e 67 20 62  able debugging b
0b70: 75 69 6c 64 5d 29 0a 66 69 0a 0a 64 6e 6c 20 46  uild]).fi..dnl F
0b80: 69 6e 64 20 22 78 78 64 22 20 73 6f 20 77 65 20  ind "xxd" so we 
0b90: 63 61 6e 20 62 75 69 6c 64 20 74 68 65 20 74 6c  can build the tl
0ba0: 73 2e 74 63 6c 2e 68 20 66 69 6c 65 0a 41 43 5f  s.tcl.h file.AC_
0bb0: 43 48 45 43 4b 5f 50 52 4f 47 28 5b 58 58 44 5d  CHECK_PROG([XXD]
0bc0: 2c 20 5b 78 78 64 5d 2c 20 5b 78 78 64 5d 2c 20  , [xxd], [xxd], 
0bd0: 5b 5f 5f 78 78 64 5f 5f 6e 6f 74 5f 5f 66 6f 75  [__xxd__not__fou
0be0: 6e 64 5d 29 0a 0a 64 6e 6c 20 46 69 6e 64 20 22  nd])..dnl Find "
0bf0: 70 6b 67 2d 63 6f 6e 66 69 67 22 20 73 69 6e 63  pkg-config" sinc
0c00: 65 20 77 65 20 6e 65 65 64 20 74 6f 20 75 73 65  e we need to use
0c10: 20 69 74 0a 41 43 5f 43 48 45 43 4b 5f 54 4f 4f   it.AC_CHECK_TOO
0c20: 4c 28 5b 50 4b 47 43 4f 4e 46 49 47 5d 2c 20 5b  L([PKGCONFIG], [
0c30: 70 6b 67 2d 63 6f 6e 66 69 67 5d 2c 20 5b 66 61  pkg-config], [fa
0c40: 6c 73 65 5d 29 0a 0a 64 6e 6c 20 44 65 74 65 72  lse])..dnl Deter
0c50: 6d 69 6e 65 20 69 66 20 77 65 20 68 61 76 65 20  mine if we have 
0c60: 62 65 65 6e 20 61 73 6b 65 64 20 74 6f 20 73 74  been asked to st
0c70: 61 74 69 63 61 6c 6c 79 20 6c 69 6e 6b 20 74 6f  atically link to
0c80: 20 74 68 65 20 53 53 4c 20 6c 69 62 72 61 72 79   the SSL library
0c90: 0a 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54  .TCLEXT_TLS_STAT
0ca0: 49 43 5f 53 53 4c 3d 27 6e 6f 27 0a 41 43 5f 41  IC_SSL='no'.AC_A
0cb0: 52 47 5f 45 4e 41 42 4c 45 28 5b 73 74 61 74 69  RG_ENABLE([stati
0cc0: 63 2d 73 73 6c 5d 2c 20 41 53 5f 48 45 4c 50 5f  c-ssl], AS_HELP_
0cd0: 53 54 52 49 4e 47 28 5b 2d 2d 65 6e 61 62 6c 65  STRING([--enable
0ce0: 2d 73 74 61 74 69 63 2d 73 73 6c 5d 2c 20 5b 65  -static-ssl], [e
0cf0: 6e 61 62 6c 65 20 73 74 61 74 69 63 61 6c 6c 79  nable statically
0d00: 20 6c 69 6e 6b 69 6e 67 20 74 6f 20 74 68 65 20   linking to the 
0d10: 73 70 65 63 69 66 69 65 64 20 53 53 4c 20 6c 69  specified SSL li
0d20: 62 72 61 72 79 5d 29 2c 20 5b 0a 09 69 66 20 74  brary]), [..if t
0d30: 65 73 74 20 22 24 65 6e 61 62 6c 65 76 61 6c 22  est "$enableval"
0d40: 20 3d 20 27 79 65 73 27 3b 20 74 68 65 6e 0a 09   = 'yes'; then..
0d50: 09 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54  .TCLEXT_TLS_STAT
0d60: 49 43 5f 53 53 4c 3d 27 79 65 73 27 0a 09 66 69  IC_SSL='yes'..fi
0d70: 0a 5d 29 0a 0a 64 6e 6c 20 58 58 58 3a 54 4f 44  .])..dnl XXX:TOD
0d80: 4f 3a 20 41 75 74 6f 6d 61 74 69 63 61 6c 6c 79  O: Automatically
0d90: 20 64 65 74 65 72 6d 69 6e 65 20 74 68 65 20 53   determine the S
0da0: 53 4c 20 6c 69 62 72 61 72 79 20 74 6f 20 75 73  SL library to us
0db0: 65 0a 64 6e 6c 20 20 20 20 20 20 20 20 20 20 20  e.dnl           
0dc0: 64 65 66 61 75 6c 74 69 6e 67 20 74 6f 20 4f 70  defaulting to Op
0dd0: 65 6e 53 53 4c 20 66 6f 72 20 63 6f 6d 70 61 74  enSSL for compat
0de0: 69 62 69 6c 69 74 79 20 72 65 61 73 6f 6e 73 0a  ibility reasons.
0df0: 69 66 20 74 65 73 74 20 22 24 74 63 6c 74 6c 73  if test "$tcltls
0e00: 5f 73 73 6c 5f 6c 69 62 22 20 3d 20 27 61 75 74  _ssl_lib" = 'aut
0e10: 6f 27 3b 20 74 68 65 6e 0a 09 74 63 6c 74 6c 73  o'; then..tcltls
0e20: 5f 73 73 6c 5f 6c 69 62 3d 27 6f 70 65 6e 73 73  _ssl_lib='openss
0e30: 6c 27 0a 66 69 0a 0a 41 43 5f 4d 53 47 5f 43 48  l'.fi..AC_MSG_CH
0e40: 45 43 4b 49 4e 47 28 5b 77 68 69 63 68 20 54 4c  ECKING([which TL
0e50: 53 20 6c 69 62 72 61 72 79 20 74 6f 20 75 73 65  S library to use
0e60: 5d 29 0a 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54  ]).AC_MSG_RESULT
0e70: 28 5b 24 74 63 6c 74 6c 73 5f 73 73 6c 5f 6c 69  ([$tcltls_ssl_li
0e80: 62 5d 29 0a 0a 64 6e 6c 20 4d 61 6e 75 61 6c 6c  b])..dnl Manuall
0e90: 79 20 72 65 77 72 69 74 65 20 6c 69 62 72 65 73  y rewrite libres
0ea0: 73 6c 20 74 6f 20 4f 70 65 6e 53 53 4c 20 73 69  sl to OpenSSL si
0eb0: 6e 63 65 20 77 65 20 75 73 65 20 74 68 65 0a 64  nce we use the.d
0ec0: 6e 6c 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 79  nl compatibility
0ed0: 20 69 6e 74 65 72 66 61 63 65 0a 69 66 20 74 65   interface.if te
0ee0: 73 74 20 22 24 74 63 6c 74 6c 73 5f 73 73 6c 5f  st "$tcltls_ssl_
0ef0: 6c 69 62 22 20 3d 20 22 6c 69 62 72 65 73 73 6c  lib" = "libressl
0f00: 22 3b 20 74 68 65 6e 0a 09 74 63 6c 74 6c 73 5f  "; then..tcltls_
0f10: 73 73 6c 5f 6c 69 62 3d 27 6f 70 65 6e 73 73 6c  ssl_lib='openssl
0f20: 27 0a 66 69 0a 0a 41 53 5f 43 41 53 45 28 5b 24  '.fi..AS_CASE([$
0f30: 74 63 6c 74 6c 73 5f 73 73 6c 5f 6c 69 62 5d 2c  tcltls_ssl_lib],
0f40: 0a 09 5b 6f 70 65 6e 73 73 6c 5d 2c 20 5b 0a 09  ..[openssl], [..
0f50: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4f 50 45 4e  .TCLTLS_SSL_OPEN
0f60: 53 53 4c 0a 09 5d 2c 0a 09 5b 6e 73 73 5d 2c 20  SSL..],..[nss], 
0f70: 5b 0a 09 20 09 54 43 4c 54 4c 53 5f 53 53 4c 5f  [.. .TCLTLS_SSL_
0f80: 4c 49 42 53 3d 22 22 0a 09 09 54 43 4c 54 4c 53  LIBS=""...TCLTLS
0f90: 5f 53 53 4c 5f 43 46 4c 41 47 53 3d 22 22 0a 09  _SSL_CFLAGS=""..
0fa0: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 46  .TCLTLS_SSL_CPPF
0fb0: 4c 41 47 53 3d 22 22 0a 09 5d 2c 0a 09 5b 0a 09  LAGS=""..],..[..
0fc0: 09 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55  .AC_MSG_ERROR([U
0fd0: 6e 73 75 70 70 6f 72 74 65 64 20 53 53 4c 20 6c  nsupported SSL l
0fe0: 69 62 72 61 72 79 3a 20 24 74 63 6c 74 6c 73 5f  ibrary: $tcltls_
0ff0: 73 73 6c 5f 6c 69 62 5d 29 0a 09 5d 0a 29 0a 64  ssl_lib])..].).d
1000: 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 68 6f 77  nl Determine how
1010: 20 74 6f 20 75 73 65 20 74 68 69 73 20 53 53 4c   to use this SSL
1020: 20 6c 69 62 72 61 72 79 0a 41 43 5f 4d 53 47 5f   library.AC_MSG_
1030: 43 48 45 43 4b 49 4e 47 28 5b 68 6f 77 20 74 6f  CHECKING([how to
1040: 20 75 73 65 20 24 74 63 6c 74 6c 73 5f 73 73 6c   use $tcltls_ssl
1050: 5f 6c 69 62 5d 29 0a 4c 49 42 53 3d 22 24 7b 4c  _lib]).LIBS="${L
1060: 49 42 53 7d 20 24 7b 54 43 4c 54 4c 53 5f 53 53  IBS} ${TCLTLS_SS
1070: 4c 5f 4c 49 42 53 7d 22 0a 43 46 4c 41 47 53 3d  L_LIBS}".CFLAGS=
1080: 22 24 7b 43 46 4c 41 47 53 7d 20 24 7b 54 43 4c  "${CFLAGS} ${TCL
1090: 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53 7d 22  TLS_SSL_CFLAGS}"
10a0: 0a 43 50 50 46 4c 41 47 53 3d 22 24 7b 43 50 50  .CPPFLAGS="${CPP
10b0: 46 4c 41 47 53 7d 20 24 7b 54 43 4c 54 4c 53 5f  FLAGS} ${TCLTLS_
10c0: 53 53 4c 5f 43 50 50 46 4c 41 47 53 7d 22 0a 41  SSL_CPPFLAGS}".A
10d0: 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 24 54  C_MSG_RESULT([$T
10e0: 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 46 4c 41  CLTLS_SSL_CPPFLA
10f0: 47 53 20 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 43  GS $TCLTLS_SSL_C
1100: 46 4c 41 47 53 20 24 54 43 4c 54 4c 53 5f 53 53  FLAGS $TCLTLS_SS
1110: 4c 5f 4c 49 42 53 5d 29 0a 0a 64 6e 6c 20 50 72  L_LIBS])..dnl Pr
1120: 6f 64 75 63 65 20 6f 75 74 70 75 74 0a 41 43 5f  oduce output.AC_
1130: 4f 55 54 50 55 54 28 4d 61 6b 65 66 69 6c 65 20  OUTPUT(Makefile 
1140: 70 6b 67 49 6e 64 65 78 2e 74 63 6c 29 0a        pkgIndex.tcl).