Artifact
8db4917da695e306d9bfb3fe568d5887de160396:
0000: 64 6e 6c 20 24 31 20 3d 20 4e 61 6d 65 20 6f 66 dnl $1 = Name of
0010: 20 76 61 72 69 61 62 6c 65 0a 64 6e 6c 20 24 32 variable.dnl $2
0020: 20 3d 20 4e 61 6d 65 20 6f 66 20 66 75 6e 63 74 = Name of funct
0030: 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 ion to check for
0040: 0a 64 6e 6c 20 24 33 20 3d 20 4e 61 6d 65 20 6f .dnl $3 = Name o
0050: 66 20 70 72 6f 74 6f 63 6f 6c 0a 64 6e 6c 20 24 f protocol.dnl $
0060: 34 20 3d 20 4e 61 6d 65 20 6f 66 20 43 50 50 20 4 = Name of CPP
0070: 6d 61 63 72 6f 20 74 6f 20 64 65 66 69 6e 65 0a macro to define.
0080: 41 43 5f 44 45 46 55 4e 28 5b 54 43 4c 54 4c 53 AC_DEFUN([TCLTLS
0090: 5f 53 53 4c 5f 4f 50 45 4e 53 53 4c 5f 43 48 45 _SSL_OPENSSL_CHE
00a0: 43 4b 5f 50 52 4f 54 4f 5f 56 45 52 5d 2c 20 5b CK_PROTO_VER], [
00b0: 0a 09 64 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 ..dnl Determine
00c0: 69 66 20 70 61 72 74 69 63 75 6c 61 72 20 53 53 if particular SS
00d0: 4c 20 76 65 72 73 69 6f 6e 20 69 73 20 65 6e 61 L version is ena
00e0: 62 6c 65 64 0a 09 69 66 20 74 65 73 74 20 22 5b bled..if test "[
00f0: 24 5d 24 31 22 20 3d 20 22 74 72 75 65 22 20 2d $]$1" = "true" -
0100: 6f 20 22 5b 24 5d 24 31 22 20 3d 20 22 66 6f 72 o "[$]$1" = "for
0110: 63 65 22 3b 20 74 68 65 6e 0a 09 09 41 43 5f 43 ce"; then...AC_C
0120: 48 45 43 4b 5f 46 55 4e 43 28 24 32 2c 2c 20 5b HECK_FUNC($2,, [
0130: 0a 09 09 09 69 66 20 74 65 73 74 20 22 5b 24 5d ....if test "[$]
0140: 24 31 22 20 3d 20 22 66 6f 72 63 65 22 3b 20 74 $1" = "force"; t
0150: 68 65 6e 0a 09 09 09 09 41 43 5f 4d 53 47 5f 45 hen.....AC_MSG_E
0160: 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 RROR([Unable to
0170: 65 6e 61 62 6c 65 20 24 33 5d 29 0a 09 09 09 66 enable $3])....f
0180: 69 0a 0a 09 09 09 24 31 3d 27 66 61 6c 73 65 27 i.....$1='false'
0190: 0a 09 09 5d 29 0a 09 66 69 0a 0a 09 69 66 20 74 ...])..fi...if t
01a0: 65 73 74 20 22 5b 24 5d 24 31 22 20 3d 20 22 66 est "[$]$1" = "f
01b0: 61 6c 73 65 22 3b 20 74 68 65 6e 0a 09 09 41 43 alse"; then...AC
01c0: 5f 44 45 46 49 4e 45 28 24 34 2c 20 5b 31 5d 2c _DEFINE($4, [1],
01d0: 20 5b 44 65 66 69 6e 65 20 74 68 69 73 20 74 6f [Define this to
01e0: 20 64 69 73 61 62 6c 65 20 24 33 20 69 6e 20 4f disable $3 in O
01f0: 70 65 6e 53 53 4c 20 73 75 70 70 6f 72 74 5d 29 penSSL support])
0200: 0a 09 66 69 0a 0a 5d 29 0a 0a 41 43 5f 44 45 46 ..fi..])..AC_DEF
0210: 55 4e 28 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f 4f UN([TCLTLS_SSL_O
0220: 50 45 4e 53 53 4c 5d 2c 20 5b 0a 09 6f 70 65 6e PENSSL], [..open
0230: 73 73 6c 64 69 72 3d 27 27 0a 09 41 43 5f 41 52 ssldir=''..AC_AR
0240: 47 5f 57 49 54 48 28 5b 73 73 6c 2d 64 69 72 5d G_WITH([ssl-dir]
0250: 2c 0a 09 09 41 53 5f 48 45 4c 50 5f 53 54 52 49 ,...AS_HELP_STRI
0260: 4e 47 28 0a 09 09 09 5b 2d 2d 77 69 74 68 2d 73 NG(....[--with-s
0270: 73 6c 2d 64 69 72 3d 3c 64 69 72 3e 5d 2c 0a 09 sl-dir=<dir>],..
0280: 09 09 5b 64 65 70 72 65 63 61 74 65 64 2c 20 75 ..[deprecated, u
0290: 73 65 20 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 73 se --with-openss
02a0: 6c 2d 64 69 72 20 2d 2d 20 63 75 72 72 65 6e 74 l-dir -- current
02b0: 6c 79 20 68 61 73 20 74 68 65 20 73 61 6d 65 20 ly has the same
02c0: 6d 65 61 6e 69 6e 67 5d 0a 09 09 29 2c 20 5b 0a meaning]...), [.
02d0: 09 09 09 6f 70 65 6e 73 73 6c 64 69 72 3d 22 24 ...openssldir="$
02e0: 77 69 74 68 76 61 6c 22 0a 09 09 5d 0a 09 29 0a withval"...]..).
02f0: 09 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 6f 70 .AC_ARG_WITH([op
0300: 65 6e 73 73 6c 2d 64 69 72 5d 2c 0a 09 09 41 53 enssl-dir],...AS
0310: 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 0a 09 09 _HELP_STRING(...
0320: 09 5b 2d 2d 77 69 74 68 2d 6f 70 65 6e 73 73 6c .[--with-openssl
0330: 2d 64 69 72 3d 3c 64 69 72 3e 5d 2c 0a 09 09 09 -dir=<dir>],....
0340: 5b 70 61 74 68 20 74 6f 20 72 6f 6f 74 20 64 69 [path to root di
0350: 72 65 63 74 6f 72 79 20 6f 66 20 4f 70 65 6e 53 rectory of OpenS
0360: 53 4c 20 6f 72 20 4c 69 62 72 65 53 53 4c 20 69 SL or LibreSSL i
0370: 6e 73 74 61 6c 6c 61 74 69 6f 6e 5d 0a 09 09 29 nstallation]...)
0380: 2c 20 5b 0a 09 09 09 6f 70 65 6e 73 73 6c 64 69 , [....openssldi
0390: 72 3d 22 24 77 69 74 68 76 61 6c 22 0a 09 09 5d r="$withval"...]
03a0: 0a 09 29 0a 0a 09 69 66 20 74 65 73 74 20 2d 6e ..)...if test -n
03b0: 20 22 24 6f 70 65 6e 73 73 6c 64 69 72 22 3b 20 "$openssldir";
03c0: 74 68 65 6e 0a 09 09 69 66 20 74 65 73 74 20 2d then...if test -
03d0: 65 20 22 24 6f 70 65 6e 73 73 6c 64 69 72 2f 6c e "$openssldir/l
03e0: 69 62 73 73 6c 2e 24 53 48 4f 42 4a 45 58 54 22 ibssl.$SHOBJEXT"
03f0: 3b 20 74 68 65 6e 0a 09 09 09 54 43 4c 54 4c 53 ; then....TCLTLS
0400: 5f 53 53 4c 5f 4c 49 42 53 3d 22 2d 4c 24 6f 70 _SSL_LIBS="-L$op
0410: 65 6e 73 73 6c 64 69 72 20 2d 6c 73 73 6c 20 2d enssldir -lssl -
0420: 6c 63 72 79 70 74 6f 22 0a 09 09 09 6f 70 65 6e lcrypto"....open
0430: 73 73 6c 64 69 72 3d 22 60 41 53 5f 44 49 52 4e ssldir="`AS_DIRN
0440: 41 4d 45 28 5b 22 24 6f 70 65 6e 73 73 6c 64 69 AME(["$openssldi
0450: 72 22 5d 29 60 22 0a 09 09 65 6c 73 65 0a 09 09 r"])`"...else...
0460: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 .TCLTLS_SSL_LIBS
0470: 3d 22 2d 4c 24 6f 70 65 6e 73 73 6c 64 69 72 2f ="-L$openssldir/
0480: 6c 69 62 20 2d 6c 73 73 6c 20 2d 6c 63 72 79 70 lib -lssl -lcryp
0490: 74 6f 22 0a 09 09 66 69 0a 09 09 54 43 4c 54 4c to"...fi...TCLTL
04a0: 53 5f 53 53 4c 5f 43 46 4c 41 47 53 3d 22 2d 49 S_SSL_CFLAGS="-I
04b0: 24 6f 70 65 6e 73 73 6c 64 69 72 2f 69 6e 63 6c $openssldir/incl
04c0: 75 64 65 22 0a 09 09 54 43 4c 54 4c 53 5f 53 53 ude"...TCLTLS_SS
04d0: 4c 5f 43 50 50 46 4c 41 47 53 3d 22 2d 49 24 6f L_CPPFLAGS="-I$o
04e0: 70 65 6e 73 73 6c 64 69 72 2f 69 6e 63 6c 75 64 penssldir/includ
04f0: 65 22 0a 09 66 69 0a 0a 09 70 6b 67 43 6f 6e 66 e"..fi...pkgConf
0500: 69 67 45 78 74 72 61 41 72 67 73 3d 27 27 0a 09 igExtraArgs=''..
0510: 69 66 20 74 65 73 74 20 22 24 54 43 4c 45 58 54 if test "$TCLEXT
0520: 5f 42 55 49 4c 44 22 20 3d 20 22 73 74 61 74 69 _BUILD" = "stati
0530: 63 22 20 2d 6f 20 22 24 54 43 4c 45 58 54 5f 54 c" -o "$TCLEXT_T
0540: 4c 53 5f 53 54 41 54 49 43 5f 53 53 4c 22 20 3d LS_STATIC_SSL" =
0550: 20 27 79 65 73 27 3b 20 74 68 65 6e 0a 09 09 70 'yes'; then...p
0560: 6b 67 43 6f 6e 66 69 67 45 78 74 72 61 41 72 67 kgConfigExtraArg
0570: 73 3d 27 2d 2d 73 74 61 74 69 63 27 0a 09 66 69 s='--static'..fi
0580: 0a 0a 09 64 6e 6c 20 55 73 65 20 70 6b 67 2d 63 ...dnl Use pkg-c
0590: 6f 6e 66 69 67 20 74 6f 20 66 69 6e 64 20 74 68 onfig to find th
05a0: 65 20 6c 69 62 72 61 72 69 65 73 0a 09 41 43 5f e libraries..AC_
05b0: 41 52 47 5f 56 41 52 28 5b 54 43 4c 54 4c 53 5f ARG_VAR([TCLTLS_
05c0: 53 53 4c 5f 4c 49 42 53 5d 2c 20 5b 6c 69 62 72 SSL_LIBS], [libr
05d0: 61 72 69 65 73 20 74 6f 20 70 61 73 73 20 74 6f aries to pass to
05e0: 20 74 68 65 20 6c 69 6e 6b 65 72 20 66 6f 72 20 the linker for
05f0: 4f 70 65 6e 53 53 4c 20 6f 72 20 4c 69 62 72 65 OpenSSL or Libre
0600: 53 53 4c 5d 29 0a 09 41 43 5f 41 52 47 5f 56 41 SSL])..AC_ARG_VA
0610: 52 28 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 R([TCLTLS_SSL_CF
0620: 4c 41 47 53 5d 2c 20 5b 43 20 63 6f 6d 70 69 6c LAGS], [C compil
0630: 65 72 20 66 6c 61 67 73 20 66 6f 72 20 4f 70 65 er flags for Ope
0640: 6e 53 53 4c 20 6f 72 20 4c 69 62 72 65 53 53 4c nSSL or LibreSSL
0650: 5d 29 0a 09 41 43 5f 41 52 47 5f 56 41 52 28 5b ])..AC_ARG_VAR([
0660: 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 46 4c TCLTLS_SSL_CPPFL
0670: 41 47 53 5d 2c 20 5b 43 20 70 72 65 70 72 6f 63 AGS], [C preproc
0680: 65 73 73 6f 72 20 66 6c 61 67 73 20 66 6f 72 20 essor flags for
0690: 4f 70 65 6e 53 53 4c 20 6f 72 20 4c 69 62 72 65 OpenSSL or Libre
06a0: 53 53 4c 5d 29 0a 09 69 66 20 74 65 73 74 20 2d SSL])..if test -
06b0: 7a 20 22 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c z "$TCLTLS_SSL_L
06c0: 49 42 53 22 3b 20 74 68 65 6e 0a 09 09 54 43 4c IBS"; then...TCL
06d0: 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d 22 60 22 TLS_SSL_LIBS="`"
06e0: 24 7b 50 4b 47 43 4f 4e 46 49 47 7d 22 20 6f 70 ${PKGCONFIG}" op
06f0: 65 6e 73 73 6c 20 2d 2d 6c 69 62 73 20 24 70 6b enssl --libs $pk
0700: 67 43 6f 6e 66 69 67 45 78 74 72 61 41 72 67 73 gConfigExtraArgs
0710: 60 22 20 7c 7c 20 41 43 5f 4d 53 47 5f 45 52 52 `" || AC_MSG_ERR
0720: 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 67 65 OR([Unable to ge
0730: 74 20 4f 70 65 6e 53 53 4c 20 43 6f 6e 66 69 67 t OpenSSL Config
0740: 75 72 61 74 69 6f 6e 5d 29 0a 09 66 69 0a 09 69 uration])..fi..i
0750: 66 20 74 65 73 74 20 2d 7a 20 22 24 54 43 4c 54 f test -z "$TCLT
0760: 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53 22 3b 20 LS_SSL_CFLAGS";
0770: 74 68 65 6e 0a 09 09 54 43 4c 54 4c 53 5f 53 53 then...TCLTLS_SS
0780: 4c 5f 43 46 4c 41 47 53 3d 22 60 22 24 7b 50 4b L_CFLAGS="`"${PK
0790: 47 43 4f 4e 46 49 47 7d 22 20 6f 70 65 6e 73 73 GCONFIG}" openss
07a0: 6c 20 2d 2d 63 66 6c 61 67 73 2d 6f 6e 6c 79 2d l --cflags-only-
07b0: 6f 74 68 65 72 20 24 70 6b 67 43 6f 6e 66 69 67 other $pkgConfig
07c0: 45 78 74 72 61 41 72 67 73 60 22 20 7c 7c 20 41 ExtraArgs`" || A
07d0: 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 55 6e 61 C_MSG_ERROR([Una
07e0: 62 6c 65 20 74 6f 20 67 65 74 20 4f 70 65 6e 53 ble to get OpenS
07f0: 53 4c 20 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e SL Configuration
0800: 5d 29 0a 09 66 69 0a 09 69 66 20 74 65 73 74 20 ])..fi..if test
0810: 2d 7a 20 22 24 54 43 4c 54 4c 53 5f 53 53 4c 5f -z "$TCLTLS_SSL_
0820: 43 50 50 46 4c 41 47 53 22 3b 20 74 68 65 6e 0a CPPFLAGS"; then.
0830: 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 ..TCLTLS_SSL_CPP
0840: 46 4c 41 47 53 3d 22 60 22 24 7b 50 4b 47 43 4f FLAGS="`"${PKGCO
0850: 4e 46 49 47 7d 22 20 6f 70 65 6e 73 73 6c 20 2d NFIG}" openssl -
0860: 2d 63 66 6c 61 67 73 2d 6f 6e 6c 79 2d 49 20 24 -cflags-only-I $
0870: 70 6b 67 43 6f 6e 66 69 67 45 78 74 72 61 41 72 pkgConfigExtraAr
0880: 67 73 60 22 20 7c 7c 20 41 43 5f 4d 53 47 5f 45 gs`" || AC_MSG_E
0890: 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 RROR([Unable to
08a0: 67 65 74 20 4f 70 65 6e 53 53 4c 20 43 6f 6e 66 get OpenSSL Conf
08b0: 69 67 75 72 61 74 69 6f 6e 5d 29 0a 09 66 69 0a iguration])..fi.
08c0: 0a 09 69 66 20 74 65 73 74 20 22 24 54 43 4c 45 ..if test "$TCLE
08d0: 58 54 5f 42 55 49 4c 44 22 20 3d 20 22 73 74 61 XT_BUILD" = "sta
08e0: 74 69 63 22 3b 20 74 68 65 6e 0a 09 09 64 6e 6c tic"; then...dnl
08f0: 20 49 66 20 77 65 20 61 72 65 20 64 6f 69 6e 67 If we are doing
0900: 20 61 20 73 74 61 74 69 63 20 62 75 69 6c 64 2c a static build,
0910: 20 73 61 76 65 20 74 68 65 20 6c 69 6e 6b 65 72 save the linker
0920: 20 66 6c 61 67 73 20 66 6f 72 20 6f 74 68 65 72 flags for other
0930: 20 70 72 6f 67 72 61 6d 73 20 74 6f 20 63 6f 6e programs to con
0940: 73 75 6d 65 0a 09 09 72 6d 20 2d 66 20 74 63 6c sume...rm -f tcl
0950: 74 6c 73 2e 61 2e 6c 69 6e 6b 61 64 64 0a 09 09 tls.a.linkadd...
0960: 41 53 5f 45 43 48 4f 28 5b 22 24 54 43 4c 54 4c AS_ECHO(["$TCLTL
0970: 53 5f 53 53 4c 5f 4c 49 42 53 22 5d 29 20 3e 20 S_SSL_LIBS"]) >
0980: 74 63 6c 74 6c 73 2e 61 2e 6c 69 6e 6b 61 64 64 tcltls.a.linkadd
0990: 0a 09 66 69 0a 0a 09 64 6e 6c 20 49 66 20 77 65 ..fi...dnl If we
09a0: 20 68 61 76 65 20 62 65 65 6e 20 61 73 6b 65 64 have been asked
09b0: 20 74 6f 20 73 74 61 74 69 63 61 6c 6c 79 20 6c to statically l
09c0: 69 6e 6b 20 74 6f 20 74 68 65 20 53 53 4c 20 6c ink to the SSL l
09d0: 69 62 72 61 72 79 2c 20 73 70 65 63 69 66 69 63 ibrary, specific
09e0: 61 6c 6c 79 20 74 65 6c 6c 20 74 68 65 20 6c 69 ally tell the li
09f0: 6e 6b 65 72 20 74 6f 20 64 6f 20 73 6f 0a 09 69 nker to do so..i
0a00: 66 20 74 65 73 74 20 22 24 54 43 4c 45 58 54 5f f test "$TCLEXT_
0a10: 54 4c 53 5f 53 54 41 54 49 43 5f 53 53 4c 22 20 TLS_STATIC_SSL"
0a20: 3d 20 27 79 65 73 27 3b 20 74 68 65 6e 0a 09 09 = 'yes'; then...
0a30: 64 6e 6c 20 44 6f 6e 27 74 20 62 6f 74 68 65 72 dnl Don't bother
0a40: 20 64 6f 69 6e 67 20 74 68 69 73 20 69 66 20 77 doing this if w
0a50: 65 20 61 72 65 6e 27 74 20 61 63 74 75 61 6c 6c e aren't actuall
0a60: 79 20 64 6f 69 6e 67 20 74 68 65 20 72 75 6e 74 y doing the runt
0a70: 69 6d 65 20 6c 69 6e 6b 69 6e 67 0a 09 09 69 66 ime linking...if
0a80: 20 74 65 73 74 20 22 24 54 43 4c 45 58 54 5f 42 test "$TCLEXT_B
0a90: 55 49 4c 44 22 20 21 3d 20 22 73 74 61 74 69 63 UILD" != "static
0aa0: 22 3b 20 74 68 65 6e 0a 09 09 09 64 6e 6c 20 53 "; then....dnl S
0ab0: 70 6c 69 74 20 74 68 65 20 6c 69 62 72 61 72 69 plit the librari
0ac0: 65 73 20 69 6e 74 6f 20 53 53 4c 20 61 6e 64 20 es into SSL and
0ad0: 6e 6f 6e 2d 53 53 4c 20 6c 69 62 72 61 72 69 65 non-SSL librarie
0ae0: 73 0a 09 09 09 6e 65 77 5f 54 43 4c 54 4c 53 5f s....new_TCLTLS_
0af0: 53 53 4c 5f 4c 49 42 53 5f 6e 6f 72 6d 61 6c 3d SSL_LIBS_normal=
0b00: 27 27 0a 09 09 09 6e 65 77 5f 54 43 4c 54 4c 53 ''....new_TCLTLS
0b10: 5f 53 53 4c 5f 4c 49 42 53 5f 73 74 61 74 69 63 _SSL_LIBS_static
0b20: 3d 27 27 0a 09 09 09 66 6f 72 20 61 72 67 20 69 =''....for arg i
0b30: 6e 20 24 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 n $TCLTLS_SSL_LI
0b40: 42 53 3b 20 64 6f 0a 09 09 09 09 63 61 73 65 20 BS; do.....case
0b50: 22 24 7b 61 72 67 7d 22 20 69 6e 0a 09 09 09 09 "${arg}" in.....
0b60: 09 2d 6c 64 6c 7c 2d 6c 72 74 7c 2d 6c 63 7c 2d .-ldl|-lrt|-lc|-
0b70: 6c 70 74 68 72 65 61 64 7c 2d 6c 6d 7c 2d 6c 63 lpthread|-lm|-lc
0b80: 72 79 70 74 7c 2d 6c 69 64 6e 7c 2d 6c 72 65 73 rypt|-lidn|-lres
0b90: 6f 6c 76 7c 2d 6c 67 63 63 7c 2d 6c 67 63 63 5f olv|-lgcc|-lgcc_
0ba0: 73 7c 2d 4c 2a 29 0a 09 09 09 09 09 09 6e 65 77 s|-L*).......new
0bb0: 5f 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 _TCLTLS_SSL_LIBS
0bc0: 5f 6e 6f 72 6d 61 6c 3d 22 24 7b 6e 65 77 5f 54 _normal="${new_T
0bd0: 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 5f 6e CLTLS_SSL_LIBS_n
0be0: 6f 72 6d 61 6c 7d 20 24 7b 61 72 67 7d 22 0a 09 ormal} ${arg}"..
0bf0: 09 09 09 09 09 3b 3b 0a 09 09 09 09 09 2d 6c 2a .....;;......-l*
0c00: 29 0a 09 09 09 09 09 09 6e 65 77 5f 54 43 4c 54 ).......new_TCLT
0c10: 4c 53 5f 53 53 4c 5f 4c 49 42 53 5f 73 74 61 74 LS_SSL_LIBS_stat
0c20: 69 63 3d 22 24 7b 6e 65 77 5f 54 43 4c 54 4c 53 ic="${new_TCLTLS
0c30: 5f 53 53 4c 5f 4c 49 42 53 5f 73 74 61 74 69 63 _SSL_LIBS_static
0c40: 7d 20 24 7b 61 72 67 7d 22 0a 09 09 09 09 09 09 } ${arg}".......
0c50: 3b 3b 0a 09 09 09 09 09 2a 29 0a 09 09 09 09 09 ;;......*)......
0c60: 09 6e 65 77 5f 54 43 4c 54 4c 53 5f 53 53 4c 5f .new_TCLTLS_SSL_
0c70: 4c 49 42 53 5f 6e 6f 72 6d 61 6c 3d 22 24 7b 6e LIBS_normal="${n
0c80: 65 77 5f 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 ew_TCLTLS_SSL_LI
0c90: 42 53 5f 6e 6f 72 6d 61 6c 7d 20 24 7b 61 72 67 BS_normal} ${arg
0ca0: 7d 22 0a 09 09 09 09 09 09 3b 3b 0a 09 09 09 09 }".......;;.....
0cb0: 65 73 61 63 0a 09 09 09 64 6f 6e 65 0a 09 09 09 esac....done....
0cc0: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 3d TCLTLS_SSL_LIBS=
0cd0: 22 24 7b 6e 65 77 5f 54 43 4c 54 4c 53 5f 53 53 "${new_TCLTLS_SS
0ce0: 4c 5f 4c 49 42 53 5f 6e 6f 72 6d 61 6c 7d 20 2d L_LIBS_normal} -
0cf0: 57 6c 2c 2d 42 73 74 61 74 69 63 20 24 7b 6e 65 Wl,-Bstatic ${ne
0d00: 77 5f 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 w_TCLTLS_SSL_LIB
0d10: 53 5f 73 74 61 74 69 63 7d 20 2d 57 6c 2c 2d 42 S_static} -Wl,-B
0d20: 64 79 6e 61 6d 69 63 22 0a 09 09 66 69 0a 09 66 dynamic"...fi..f
0d30: 69 0a 0a 09 64 6e 6c 20 53 61 76 65 20 63 6f 6d i...dnl Save com
0d40: 70 69 6c 65 2d 61 6c 74 65 72 69 6e 67 20 76 61 pile-altering va
0d50: 72 69 61 62 6c 65 73 20 77 65 20 61 72 65 20 63 riables we are c
0d60: 68 61 6e 67 69 6e 67 0a 09 53 41 56 45 5f 4c 49 hanging..SAVE_LI
0d70: 42 53 3d 22 24 7b 4c 49 42 53 7d 22 0a 09 53 41 BS="${LIBS}"..SA
0d80: 56 45 5f 43 46 4c 41 47 53 3d 22 24 7b 43 46 4c VE_CFLAGS="${CFL
0d90: 41 47 53 7d 22 0a 09 53 41 56 45 5f 43 50 50 46 AGS}"..SAVE_CPPF
0da0: 4c 41 47 53 3d 22 24 7b 43 50 50 46 4c 41 47 53 LAGS="${CPPFLAGS
0db0: 7d 22 0a 0a 09 64 6e 6c 20 55 70 64 61 74 65 20 }"...dnl Update
0dc0: 63 6f 6d 70 69 6c 65 2d 61 6c 74 65 72 69 6e 67 compile-altering
0dd0: 20 76 61 72 69 61 62 6c 65 73 20 74 6f 20 69 6e variables to in
0de0: 63 6c 75 64 65 20 74 68 65 20 4f 70 65 6e 53 53 clude the OpenSS
0df0: 4c 20 6c 69 62 72 61 72 69 65 73 0a 09 4c 49 42 L libraries..LIB
0e00: 53 3d 22 24 7b 53 41 56 45 5f 4c 49 42 53 7d 20 S="${SAVE_LIBS}
0e10: 24 7b 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 ${TCLTLS_SSL_LIB
0e20: 53 7d 22 0a 09 43 46 4c 41 47 53 3d 22 24 7b 53 S}"..CFLAGS="${S
0e30: 41 56 45 5f 43 46 4c 41 47 53 7d 20 24 7b 54 43 AVE_CFLAGS} ${TC
0e40: 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53 7d LTLS_SSL_CFLAGS}
0e50: 22 0a 09 43 50 50 46 4c 41 47 53 3d 22 24 7b 53 "..CPPFLAGS="${S
0e60: 41 56 45 5f 43 50 50 46 4c 41 47 53 7d 20 24 7b AVE_CPPFLAGS} ${
0e70: 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 46 4c TCLTLS_SSL_CPPFL
0e80: 41 47 53 7d 22 0a 0a 09 64 6e 6c 20 56 65 72 69 AGS}"...dnl Veri
0e90: 66 79 20 74 68 61 74 20 62 61 73 69 63 20 66 75 fy that basic fu
0ea0: 6e 63 74 69 6f 6e 61 6c 69 74 79 20 69 73 20 74 nctionality is t
0eb0: 68 65 72 65 0a 09 41 43 5f 4c 41 4e 47 5f 50 55 here..AC_LANG_PU
0ec0: 53 48 28 43 29 0a 09 41 43 5f 4d 53 47 5f 43 48 SH(C)..AC_MSG_CH
0ed0: 45 43 4b 49 4e 47 28 5b 69 66 20 61 20 62 61 73 ECKING([if a bas
0ee0: 69 63 20 4f 70 65 6e 53 53 4c 20 70 72 6f 67 72 ic OpenSSL progr
0ef0: 61 6d 20 77 6f 72 6b 73 5d 29 0a 09 41 43 5f 4c am works])..AC_L
0f00: 49 4e 4b 5f 49 46 45 4c 53 45 28 5b 41 43 5f 4c INK_IFELSE([AC_L
0f10: 41 4e 47 5f 50 52 4f 47 52 41 4d 28 5b 0a 23 69 ANG_PROGRAM([.#i
0f20: 6e 63 6c 75 64 65 20 3c 6f 70 65 6e 73 73 6c 2f nclude <openssl/
0f30: 73 73 6c 2e 68 3e 0a 23 69 66 20 28 53 53 4c 45 ssl.h>.#if (SSLE
0f40: 41 59 5f 56 45 52 53 49 4f 4e 5f 4e 55 4d 42 45 AY_VERSION_NUMBE
0f50: 52 20 3e 3d 20 30 78 30 39 30 37 30 30 30 4c 29 R >= 0x0907000L)
0f60: 0a 23 20 69 6e 63 6c 75 64 65 20 3c 6f 70 65 6e .# include <open
0f70: 73 73 6c 2f 63 6f 6e 66 2e 68 3e 0a 23 65 6e 64 ssl/conf.h>.#end
0f80: 69 66 0a 09 09 5d 2c 20 5b 0a 20 20 28 76 6f 69 if...], [. (voi
0f90: 64 29 53 53 4c 5f 6c 69 62 72 61 72 79 5f 69 6e d)SSL_library_in
0fa0: 69 74 28 29 3b 0a 20 20 53 53 4c 5f 6c 6f 61 64 it();. SSL_load
0fb0: 5f 65 72 72 6f 72 5f 73 74 72 69 6e 67 73 28 29 _error_strings()
0fc0: 3b 0a 20 20 4f 50 45 4e 53 53 4c 5f 63 6f 6e 66 ;. OPENSSL_conf
0fd0: 69 67 28 4e 55 4c 4c 29 3b 0a 09 09 5d 29 5d 2c ig(NULL);...])],
0fe0: 20 5b 0a 09 09 41 43 5f 4d 53 47 5f 52 45 53 55 [...AC_MSG_RESU
0ff0: 4c 54 28 5b 79 65 73 5d 29 0a 09 5d 2c 20 5b 0a LT([yes])..], [.
1000: 09 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 ..AC_MSG_RESULT(
1010: 5b 6e 6f 5d 29 0a 09 09 41 43 5f 4d 53 47 5f 45 [no])...AC_MSG_E
1020: 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 6f 20 RROR([Unable to
1030: 63 6f 6d 70 69 6c 65 20 61 20 62 61 73 69 63 20 compile a basic
1040: 70 72 6f 67 72 61 6d 20 75 73 69 6e 67 20 4f 70 program using Op
1050: 65 6e 53 53 4c 5d 29 0a 09 5d 29 0a 09 41 43 5f enSSL])..])..AC_
1060: 4c 41 4e 47 5f 50 4f 50 28 5b 43 5d 29 0a 0a 09 LANG_POP([C])...
1070: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4f 50 45 4e 53 TCLTLS_SSL_OPENS
1080: 53 4c 5f 43 48 45 43 4b 5f 50 52 4f 54 4f 5f 56 SL_CHECK_PROTO_V
1090: 45 52 28 5b 74 63 6c 74 6c 73 5f 73 73 6c 5f 73 ER([tcltls_ssl_s
10a0: 73 6c 32 5d 2c 20 5b 53 53 4c 76 32 5f 6d 65 74 sl2], [SSLv2_met
10b0: 68 6f 64 5d 2c 20 5b 73 73 6c 76 32 5d 2c 20 5b hod], [sslv2], [
10c0: 4e 4f 5f 53 53 4c 32 5d 29 0a 09 54 43 4c 54 4c NO_SSL2])..TCLTL
10d0: 53 5f 53 53 4c 5f 4f 50 45 4e 53 53 4c 5f 43 48 S_SSL_OPENSSL_CH
10e0: 45 43 4b 5f 50 52 4f 54 4f 5f 56 45 52 28 5b 74 ECK_PROTO_VER([t
10f0: 63 6c 74 6c 73 5f 73 73 6c 5f 73 73 6c 33 5d 2c cltls_ssl_ssl3],
1100: 20 5b 53 53 4c 76 33 5f 6d 65 74 68 6f 64 5d 2c [SSLv3_method],
1110: 20 5b 73 73 6c 76 33 5d 2c 20 5b 4e 4f 5f 53 53 [sslv3], [NO_SS
1120: 4c 33 5d 29 0a 09 54 43 4c 54 4c 53 5f 53 53 4c L3])..TCLTLS_SSL
1130: 5f 4f 50 45 4e 53 53 4c 5f 43 48 45 43 4b 5f 50 _OPENSSL_CHECK_P
1140: 52 4f 54 4f 5f 56 45 52 28 5b 74 63 6c 74 6c 73 ROTO_VER([tcltls
1150: 5f 73 73 6c 5f 74 6c 73 31 5f 30 5d 2c 20 5b 54 _ssl_tls1_0], [T
1160: 4c 53 76 31 5f 6d 65 74 68 6f 64 5d 2c 20 5b 74 LSv1_method], [t
1170: 6c 73 76 31 2e 30 5d 2c 20 5b 4e 4f 5f 54 4c 53 lsv1.0], [NO_TLS
1180: 31 5d 29 0a 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 1])..TCLTLS_SSL_
1190: 4f 50 45 4e 53 53 4c 5f 43 48 45 43 4b 5f 50 52 OPENSSL_CHECK_PR
11a0: 4f 54 4f 5f 56 45 52 28 5b 74 63 6c 74 6c 73 5f OTO_VER([tcltls_
11b0: 73 73 6c 5f 74 6c 73 31 5f 31 5d 2c 20 5b 54 4c ssl_tls1_1], [TL
11c0: 53 76 31 5f 31 5f 6d 65 74 68 6f 64 5d 2c 20 5b Sv1_1_method], [
11d0: 74 6c 73 76 31 2e 31 5d 2c 20 5b 4e 4f 5f 54 4c tlsv1.1], [NO_TL
11e0: 53 31 5f 31 5d 29 0a 09 54 43 4c 54 4c 53 5f 53 S1_1])..TCLTLS_S
11f0: 53 4c 5f 4f 50 45 4e 53 53 4c 5f 43 48 45 43 4b SL_OPENSSL_CHECK
1200: 5f 50 52 4f 54 4f 5f 56 45 52 28 5b 74 63 6c 74 _PROTO_VER([tclt
1210: 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 32 5d 2c 20 ls_ssl_tls1_2],
1220: 5b 54 4c 53 76 31 5f 32 5f 6d 65 74 68 6f 64 5d [TLSv1_2_method]
1230: 2c 20 5b 74 6c 73 76 31 2e 32 5d 2c 20 5b 4e 4f , [tlsv1.2], [NO
1240: 5f 54 4c 53 31 5f 32 5d 29 0a 0a 09 41 43 5f 43 _TLS1_2])...AC_C
1250: 41 43 48 45 5f 56 41 4c 28 5b 74 63 6c 74 6c 73 ACHE_VAL([tcltls
1260: 5f 63 76 5f 66 75 6e 63 5f 74 6c 73 65 78 74 5f _cv_func_tlsext_
1270: 68 6f 73 74 6e 61 6d 65 5d 2c 20 5b 0a 09 09 41 hostname], [...A
1280: 43 5f 4c 41 4e 47 5f 50 55 53 48 28 43 29 0a 09 C_LANG_PUSH(C)..
1290: 09 41 43 5f 4d 53 47 5f 43 48 45 43 4b 49 4e 47 .AC_MSG_CHECKING
12a0: 28 5b 66 6f 72 20 53 53 4c 5f 73 65 74 5f 74 6c ([for SSL_set_tl
12b0: 73 65 78 74 5f 68 6f 73 74 5f 6e 61 6d 65 5d 29 sext_host_name])
12c0: 0a 09 09 41 43 5f 4c 49 4e 4b 5f 49 46 45 4c 53 ...AC_LINK_IFELS
12d0: 45 28 5b 41 43 5f 4c 41 4e 47 5f 50 52 4f 47 52 E([AC_LANG_PROGR
12e0: 41 4d 28 5b 0a 23 69 6e 63 6c 75 64 65 20 3c 6f AM([.#include <o
12f0: 70 65 6e 73 73 6c 2f 73 73 6c 2e 68 3e 0a 23 69 penssl/ssl.h>.#i
1300: 66 20 28 53 53 4c 45 41 59 5f 56 45 52 53 49 4f f (SSLEAY_VERSIO
1310: 4e 5f 4e 55 4d 42 45 52 20 3e 3d 20 30 78 30 39 N_NUMBER >= 0x09
1320: 30 37 30 30 30 4c 29 0a 23 20 69 6e 63 6c 75 64 07000L).# includ
1330: 65 20 3c 6f 70 65 6e 73 73 6c 2f 63 6f 6e 66 2e e <openssl/conf.
1340: 68 3e 0a 23 65 6e 64 69 66 0a 09 09 09 5d 2c 20 h>.#endif....],
1350: 5b 0a 20 20 28 76 6f 69 64 29 53 53 4c 5f 73 65 [. (void)SSL_se
1360: 74 5f 74 6c 73 65 78 74 5f 68 6f 73 74 5f 6e 61 t_tlsext_host_na
1370: 6d 65 28 28 76 6f 69 64 20 2a 29 20 30 2c 20 28 me((void *) 0, (
1380: 76 6f 69 64 20 2a 29 20 30 29 3b 0a 09 09 09 5d void *) 0);....]
1390: 29 5d 2c 20 5b 0a 09 09 09 41 43 5f 4d 53 47 5f )], [....AC_MSG_
13a0: 52 45 53 55 4c 54 28 5b 79 65 73 5d 29 0a 09 09 RESULT([yes])...
13b0: 09 74 63 6c 74 6c 73 5f 63 76 5f 66 75 6e 63 5f .tcltls_cv_func_
13c0: 74 6c 73 65 78 74 5f 68 6f 73 74 6e 61 6d 65 3d tlsext_hostname=
13d0: 27 79 65 73 27 0a 09 09 5d 2c 20 5b 0a 09 09 09 'yes'...], [....
13e0: 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e AC_MSG_RESULT([n
13f0: 6f 5d 29 0a 09 09 09 74 63 6c 74 6c 73 5f 63 76 o])....tcltls_cv
1400: 5f 66 75 6e 63 5f 74 6c 73 65 78 74 5f 68 6f 73 _func_tlsext_hos
1410: 74 6e 61 6d 65 3d 27 6e 6f 27 0a 09 09 5d 29 0a tname='no'...]).
1420: 09 09 41 43 5f 4c 41 4e 47 5f 50 4f 50 28 5b 43 ..AC_LANG_POP([C
1430: 5d 29 0a 09 5d 29 0a 0a 09 69 66 20 74 65 73 74 ])..])...if test
1440: 20 22 24 74 63 6c 74 6c 73 5f 63 76 5f 66 75 6e "$tcltls_cv_fun
1450: 63 5f 74 6c 73 65 78 74 5f 68 6f 73 74 6e 61 6d c_tlsext_hostnam
1460: 65 22 20 3d 20 27 6e 6f 27 3b 20 74 68 65 6e 0a e" = 'no'; then.
1470: 09 09 41 43 5f 44 45 46 49 4e 45 28 5b 4f 50 45 ..AC_DEFINE([OPE
1480: 4e 53 53 4c 5f 4e 4f 5f 54 4c 53 45 58 54 5d 2c NSSL_NO_TLSEXT],
1490: 20 5b 31 5d 2c 20 5b 44 65 66 69 6e 65 20 74 68 [1], [Define th
14a0: 69 73 20 69 66 20 79 6f 75 72 20 4f 70 65 6e 53 is if your OpenS
14b0: 53 4c 20 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 SL does not supp
14c0: 6f 72 74 20 74 68 65 20 54 4c 53 20 45 78 74 65 ort the TLS Exte
14d0: 6e 73 69 6f 6e 20 66 6f 72 20 53 4e 49 5d 29 0a nsion for SNI]).
14e0: 09 66 69 0a 0a 09 64 6e 6c 20 52 65 73 74 6f 72 .fi...dnl Restor
14f0: 65 20 63 6f 6d 70 69 6c 65 2d 61 6c 74 65 72 69 e compile-alteri
1500: 6e 67 20 76 61 72 69 61 62 6c 65 73 0a 09 4c 49 ng variables..LI
1510: 42 53 3d 22 24 7b 53 41 56 45 5f 4c 49 42 53 7d BS="${SAVE_LIBS}
1520: 22 0a 09 43 46 4c 41 47 53 3d 22 24 7b 53 41 56 "..CFLAGS="${SAV
1530: 45 5f 43 46 4c 41 47 53 7d 22 0a 09 43 50 50 46 E_CFLAGS}"..CPPF
1540: 4c 41 47 53 3d 22 24 7b 53 41 56 45 5f 43 50 50 LAGS="${SAVE_CPP
1550: 46 4c 41 47 53 7d 22 0a 5d 29 0a FLAGS}".]).