Artifact
04069331bc4c5e49fc6bb7bd0ece20e6468178ad0ca43e8f1570f4e3eb2168ce:
0000: 41 43 5f 44 45 46 55 4e 28 5b 54 43 4c 54 4c 53 AC_DEFUN([TCLTLS
0010: 5f 53 53 4c 5f 4d 42 45 44 54 4c 53 5d 2c 20 5b _SSL_MBEDTLS], [
0020: 0a 09 6d 62 65 64 74 6c 73 64 69 72 3d 27 27 0a ..mbedtlsdir=''.
0030: 09 41 43 5f 41 52 47 5f 57 49 54 48 28 5b 6d 62 .AC_ARG_WITH([mb
0040: 65 64 74 6c 73 2d 64 69 72 5d 2c 0a 09 09 41 53 edtls-dir],...AS
0050: 5f 48 45 4c 50 5f 53 54 52 49 4e 47 28 0a 09 09 _HELP_STRING(...
0060: 09 5b 2d 2d 77 69 74 68 2d 6d 62 65 64 74 6c 73 .[--with-mbedtls
0070: 2d 64 69 72 3d 3c 64 69 72 3e 5d 2c 0a 09 09 09 -dir=<dir>],....
0080: 5b 70 61 74 68 20 74 6f 20 72 6f 6f 74 20 64 69 [path to root di
0090: 72 65 63 74 6f 72 79 20 6f 66 20 4d 62 65 64 54 rectory of MbedT
00a0: 4c 53 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 5d LS installation]
00b0: 0a 09 09 29 2c 20 5b 0a 09 09 09 6d 62 65 64 74 ...), [....mbedt
00c0: 6c 73 64 69 72 3d 22 24 77 69 74 68 76 61 6c 22 lsdir="$withval"
00d0: 0a 09 09 5d 0a 09 29 0a 0a 09 69 66 20 74 65 73 ...]..)...if tes
00e0: 74 20 2d 6e 20 22 24 6d 62 65 64 74 6c 73 64 69 t -n "$mbedtlsdi
00f0: 72 22 3b 20 74 68 65 6e 0a 09 09 69 66 20 74 65 r"; then...if te
0100: 73 74 20 2d 65 20 22 24 6d 62 65 64 74 6c 73 64 st -e "$mbedtlsd
0110: 69 72 2f 6c 69 62 6d 62 65 64 74 6c 73 2e 61 22 ir/libmbedtls.a"
0120: 20 2d 6f 20 2d 65 20 22 24 6d 62 65 64 74 6c 73 -o -e "$mbedtls
0130: 64 69 72 2f 6c 69 62 6d 62 65 64 74 6c 73 2e 24 dir/libmbedtls.$
0140: 7b 41 52 45 58 54 7d 22 3b 20 74 68 65 6e 0a 09 {AREXT}"; then..
0150: 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 ..TCLTLS_SSL_LIB
0160: 53 3d 22 2d 4c 24 6d 62 65 64 74 6c 73 64 69 72 S="-L$mbedtlsdir
0170: 20 2d 6c 6d 62 65 64 74 6c 73 20 2d 6c 6d 62 65 -lmbedtls -lmbe
0180: 64 63 72 79 70 74 6f 22 0a 09 09 09 6d 62 65 64 dcrypto"....mbed
0190: 74 6c 73 64 69 72 3d 22 60 41 53 5f 44 49 52 4e tlsdir="`AS_DIRN
01a0: 41 4d 45 28 5b 22 24 6d 62 65 64 74 6c 73 64 69 AME(["$mbedtlsdi
01b0: 72 22 5d 29 60 22 0a 09 09 65 6c 73 65 0a 09 09 r"])`"...else...
01c0: 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 .TCLTLS_SSL_LIBS
01d0: 3d 22 2d 4c 24 6d 62 65 64 74 6c 73 64 69 72 2f ="-L$mbedtlsdir/
01e0: 6c 69 62 72 61 72 79 20 2d 6c 6d 62 65 64 74 6c library -lmbedtl
01f0: 73 20 2d 6c 6d 62 65 64 63 72 79 70 74 6f 22 0a s -lmbedcrypto".
0200: 09 09 66 69 0a 09 09 54 43 4c 54 4c 53 5f 53 53 ..fi...TCLTLS_SS
0210: 4c 5f 43 46 4c 41 47 53 3d 22 2d 49 24 6d 62 65 L_CFLAGS="-I$mbe
0220: 64 74 6c 73 64 69 72 2f 69 6e 63 6c 75 64 65 20 dtlsdir/include
0230: 2d 49 24 7b 6d 62 65 64 74 6c 73 64 69 72 7d 2f -I${mbedtlsdir}/
0240: 69 6e 63 6c 75 64 65 2f 6d 62 65 64 74 6c 73 22 include/mbedtls"
0250: 0a 09 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 ...TCLTLS_SSL_CP
0260: 50 46 4c 41 47 53 3d 22 2d 49 24 6d 62 65 64 74 PFLAGS="-I$mbedt
0270: 6c 73 64 69 72 2f 69 6e 63 6c 75 64 65 20 2d 49 lsdir/include -I
0280: 24 7b 6d 62 65 64 74 6c 73 64 69 72 7d 2f 69 6e ${mbedtlsdir}/in
0290: 63 6c 75 64 65 2f 6d 62 65 64 74 6c 73 22 0a 09 clude/mbedtls"..
02a0: 66 69 0a 0a 09 41 43 5f 41 52 47 5f 56 41 52 28 fi...AC_ARG_VAR(
02b0: 5b 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 [TCLTLS_SSL_LIBS
02c0: 5d 2c 20 5b 6c 69 62 72 61 72 69 65 73 20 74 6f ], [libraries to
02d0: 20 70 61 73 73 20 74 6f 20 74 68 65 20 6c 69 6e pass to the lin
02e0: 6b 65 72 20 66 6f 72 20 4d 62 65 64 54 4c 53 5d ker for MbedTLS]
02f0: 29 0a 09 41 43 5f 41 52 47 5f 56 41 52 28 5b 54 )..AC_ARG_VAR([T
0300: 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c 41 47 53 CLTLS_SSL_CFLAGS
0310: 5d 2c 20 5b 43 20 63 6f 6d 70 69 6c 65 72 20 66 ], [C compiler f
0320: 6c 61 67 73 20 66 6f 72 20 4d 62 65 64 54 4c 53 lags for MbedTLS
0330: 5d 29 0a 09 41 43 5f 41 52 47 5f 56 41 52 28 5b ])..AC_ARG_VAR([
0340: 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 46 4c TCLTLS_SSL_CPPFL
0350: 41 47 53 5d 2c 20 5b 43 20 70 72 65 70 72 6f 63 AGS], [C preproc
0360: 65 73 73 6f 72 20 66 6c 61 67 73 20 66 6f 72 20 essor flags for
0370: 4d 62 65 64 54 4c 53 5d 29 0a 0a 09 69 66 20 74 MbedTLS])...if t
0380: 65 73 74 20 22 24 54 43 4c 45 58 54 5f 42 55 49 est "$TCLEXT_BUI
0390: 4c 44 22 20 3d 20 22 73 74 61 74 69 63 22 3b 20 LD" = "static";
03a0: 74 68 65 6e 0a 09 09 64 6e 6c 20 49 66 20 77 65 then...dnl If we
03b0: 20 61 72 65 20 64 6f 69 6e 67 20 61 20 73 74 61 are doing a sta
03c0: 74 69 63 20 62 75 69 6c 64 2c 20 73 61 76 65 20 tic build, save
03d0: 74 68 65 20 6c 69 6e 6b 65 72 20 66 6c 61 67 73 the linker flags
03e0: 20 66 6f 72 20 6f 74 68 65 72 20 70 72 6f 67 72 for other progr
03f0: 61 6d 73 20 74 6f 20 63 6f 6e 73 75 6d 65 0a 09 ams to consume..
0400: 09 72 6d 20 2d 66 20 74 63 6c 74 6c 73 2e 24 7b .rm -f tcltls.${
0410: 41 52 45 58 54 7d 2e 6c 69 6e 6b 61 64 64 0a 09 AREXT}.linkadd..
0420: 09 41 53 5f 45 43 48 4f 28 5b 22 24 54 43 4c 54 .AS_ECHO(["$TCLT
0430: 4c 53 5f 53 53 4c 5f 4c 49 42 53 22 5d 29 20 3e LS_SSL_LIBS"]) >
0440: 20 74 63 6c 74 6c 73 2e 24 7b 41 52 45 58 54 7d tcltls.${AREXT}
0450: 2e 6c 69 6e 6b 61 64 64 0a 09 66 69 0a 0a 09 64 .linkadd..fi...d
0460: 6e 6c 20 49 66 20 77 65 20 68 61 76 65 20 62 65 nl If we have be
0470: 65 6e 20 61 73 6b 65 64 20 74 6f 20 73 74 61 74 en asked to stat
0480: 69 63 61 6c 6c 79 20 6c 69 6e 6b 20 74 6f 20 74 ically link to t
0490: 68 65 20 53 53 4c 20 6c 69 62 72 61 72 79 2c 20 he SSL library,
04a0: 73 70 65 63 69 66 69 63 61 6c 6c 79 20 74 65 6c specifically tel
04b0: 6c 20 74 68 65 20 6c 69 6e 6b 65 72 20 74 6f 20 l the linker to
04c0: 64 6f 20 73 6f 0a 09 69 66 20 74 65 73 74 20 22 do so..if test "
04d0: 24 54 43 4c 45 58 54 5f 54 4c 53 5f 53 54 41 54 $TCLEXT_TLS_STAT
04e0: 49 43 5f 53 53 4c 22 20 3d 20 27 79 65 73 27 3b IC_SSL" = 'yes';
04f0: 20 74 68 65 6e 0a 09 09 64 6e 6c 20 44 6f 6e 27 then...dnl Don'
0500: 74 20 62 6f 74 68 65 72 20 64 6f 69 6e 67 20 74 t bother doing t
0510: 68 69 73 20 69 66 20 77 65 20 61 72 65 6e 27 74 his if we aren't
0520: 20 61 63 74 75 61 6c 6c 79 20 64 6f 69 6e 67 20 actually doing
0530: 74 68 65 20 72 75 6e 74 69 6d 65 20 6c 69 6e 6b the runtime link
0540: 69 6e 67 0a 09 09 69 66 20 74 65 73 74 20 22 24 ing...if test "$
0550: 54 43 4c 45 58 54 5f 42 55 49 4c 44 22 20 21 3d TCLEXT_BUILD" !=
0560: 20 22 73 74 61 74 69 63 22 3b 20 74 68 65 6e 0a "static"; then.
0570: 09 09 09 64 6e 6c 20 53 70 6c 69 74 20 74 68 65 ...dnl Split the
0580: 20 6c 69 62 72 61 72 69 65 73 20 69 6e 74 6f 20 libraries into
0590: 53 53 4c 20 61 6e 64 20 6e 6f 6e 2d 53 53 4c 20 SSL and non-SSL
05a0: 6c 69 62 72 61 72 69 65 73 0a 09 09 09 6e 65 77 libraries....new
05b0: 5f 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 _TCLTLS_SSL_LIBS
05c0: 5f 6e 6f 72 6d 61 6c 3d 27 27 0a 09 09 09 6e 65 _normal=''....ne
05d0: 77 5f 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 w_TCLTLS_SSL_LIB
05e0: 53 5f 73 74 61 74 69 63 3d 27 27 0a 09 09 09 66 S_static=''....f
05f0: 6f 72 20 61 72 67 20 69 6e 20 24 54 43 4c 54 4c or arg in $TCLTL
0600: 53 5f 53 53 4c 5f 4c 49 42 53 3b 20 64 6f 0a 09 S_SSL_LIBS; do..
0610: 09 09 09 63 61 73 65 20 22 24 7b 61 72 67 7d 22 ...case "${arg}"
0620: 20 69 6e 0a 09 09 09 09 09 2d 4c 2a 29 0a 09 09 in......-L*)...
0630: 09 09 09 09 6e 65 77 5f 54 43 4c 54 4c 53 5f 53 ....new_TCLTLS_S
0640: 53 4c 5f 4c 49 42 53 5f 6e 6f 72 6d 61 6c 3d 22 SL_LIBS_normal="
0650: 24 7b 6e 65 77 5f 54 43 4c 54 4c 53 5f 53 53 4c ${new_TCLTLS_SSL
0660: 5f 4c 49 42 53 5f 6e 6f 72 6d 61 6c 7d 20 24 7b _LIBS_normal} ${
0670: 61 72 67 7d 22 0a 09 09 09 09 09 09 6e 65 77 5f arg}".......new_
0680: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 5f TCLTLS_SSL_LIBS_
0690: 73 74 61 74 69 63 3d 22 24 7b 6e 65 77 5f 54 43 static="${new_TC
06a0: 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 5f 73 74 LTLS_SSL_LIBS_st
06b0: 61 74 69 63 7d 20 24 7b 61 72 67 7d 22 0a 09 09 atic} ${arg}"...
06c0: 09 09 09 09 3b 3b 0a 09 09 09 09 09 2d 6c 64 6c ....;;......-ldl
06d0: 7c 2d 6c 72 74 7c 2d 6c 63 7c 2d 6c 70 74 68 72 |-lrt|-lc|-lpthr
06e0: 65 61 64 7c 2d 6c 6d 7c 2d 6c 63 72 79 70 74 7c ead|-lm|-lcrypt|
06f0: 2d 6c 69 64 6e 7c 2d 6c 72 65 73 6f 6c 76 7c 2d -lidn|-lresolv|-
0700: 6c 67 63 63 7c 2d 6c 67 63 63 5f 73 29 0a 09 09 lgcc|-lgcc_s)...
0710: 09 09 09 09 6e 65 77 5f 54 43 4c 54 4c 53 5f 53 ....new_TCLTLS_S
0720: 53 4c 5f 4c 49 42 53 5f 6e 6f 72 6d 61 6c 3d 22 SL_LIBS_normal="
0730: 24 7b 6e 65 77 5f 54 43 4c 54 4c 53 5f 53 53 4c ${new_TCLTLS_SSL
0740: 5f 4c 49 42 53 5f 6e 6f 72 6d 61 6c 7d 20 24 7b _LIBS_normal} ${
0750: 61 72 67 7d 22 0a 09 09 09 09 09 09 3b 3b 0a 09 arg}".......;;..
0760: 09 09 09 09 2d 6c 2a 29 0a 09 09 09 09 09 09 6e ....-l*).......n
0770: 65 77 5f 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 ew_TCLTLS_SSL_LI
0780: 42 53 5f 73 74 61 74 69 63 3d 22 24 7b 6e 65 77 BS_static="${new
0790: 5f 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 _TCLTLS_SSL_LIBS
07a0: 5f 73 74 61 74 69 63 7d 20 24 7b 61 72 67 7d 22 _static} ${arg}"
07b0: 0a 09 09 09 09 09 09 3b 3b 0a 09 09 09 09 09 2a .......;;......*
07c0: 29 0a 09 09 09 09 09 09 6e 65 77 5f 54 43 4c 54 ).......new_TCLT
07d0: 4c 53 5f 53 53 4c 5f 4c 49 42 53 5f 6e 6f 72 6d LS_SSL_LIBS_norm
07e0: 61 6c 3d 22 24 7b 6e 65 77 5f 54 43 4c 54 4c 53 al="${new_TCLTLS
07f0: 5f 53 53 4c 5f 4c 49 42 53 5f 6e 6f 72 6d 61 6c _SSL_LIBS_normal
0800: 7d 20 24 7b 61 72 67 7d 22 0a 09 09 09 09 09 09 } ${arg}".......
0810: 3b 3b 0a 09 09 09 09 65 73 61 63 0a 09 09 09 64 ;;.....esac....d
0820: 6f 6e 65 0a 09 09 09 53 48 4f 42 4a 5f 44 4f 5f one....SHOBJ_DO_
0830: 53 54 41 54 49 43 5f 4c 49 4e 4b 5f 4c 49 42 28 STATIC_LINK_LIB(
0840: 5b 4d 62 65 64 54 4c 53 5d 2c 20 5b 24 6e 65 77 [MbedTLS], [$new
0850: 5f 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 _TCLTLS_SSL_LIBS
0860: 5f 73 74 61 74 69 63 5d 2c 20 5b 6e 65 77 5f 54 _static], [new_T
0870: 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 5f 73 CLTLS_SSL_LIBS_s
0880: 74 61 74 69 63 5d 29 0a 09 09 09 54 43 4c 54 4c tatic])....TCLTL
0890: 53 5f 53 53 4c 5f 4c 49 42 53 3d 22 24 7b 6e 65 S_SSL_LIBS="${ne
08a0: 77 5f 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 w_TCLTLS_SSL_LIB
08b0: 53 5f 6e 6f 72 6d 61 6c 7d 20 24 7b 6e 65 77 5f S_normal} ${new_
08c0: 54 43 4c 54 4c 53 5f 53 53 4c 5f 4c 49 42 53 5f TCLTLS_SSL_LIBS_
08d0: 73 74 61 74 69 63 7d 22 0a 09 09 66 69 0a 09 66 static}"...fi..f
08e0: 69 0a 0a 09 64 6e 6c 20 53 61 76 65 20 63 6f 6d i...dnl Save com
08f0: 70 69 6c 65 2d 61 6c 74 65 72 69 6e 67 20 76 61 pile-altering va
0900: 72 69 61 62 6c 65 73 20 77 65 20 61 72 65 20 63 riables we are c
0910: 68 61 6e 67 69 6e 67 0a 09 53 41 56 45 5f 4c 49 hanging..SAVE_LI
0920: 42 53 3d 22 24 7b 4c 49 42 53 7d 22 0a 09 53 41 BS="${LIBS}"..SA
0930: 56 45 5f 43 46 4c 41 47 53 3d 22 24 7b 43 46 4c VE_CFLAGS="${CFL
0940: 41 47 53 7d 22 0a 09 53 41 56 45 5f 43 50 50 46 AGS}"..SAVE_CPPF
0950: 4c 41 47 53 3d 22 24 7b 43 50 50 46 4c 41 47 53 LAGS="${CPPFLAGS
0960: 7d 22 0a 0a 09 64 6e 6c 20 55 70 64 61 74 65 20 }"...dnl Update
0970: 63 6f 6d 70 69 6c 65 2d 61 6c 74 65 72 69 6e 67 compile-altering
0980: 20 76 61 72 69 61 62 6c 65 73 20 74 6f 20 69 6e variables to in
0990: 63 6c 75 64 65 20 74 68 65 20 4d 62 65 64 54 4c clude the MbedTL
09a0: 53 20 6c 69 62 72 61 72 69 65 73 0a 09 4c 49 42 S libraries..LIB
09b0: 53 3d 22 24 7b 54 43 4c 54 4c 53 5f 53 53 4c 5f S="${TCLTLS_SSL_
09c0: 4c 49 42 53 7d 20 24 7b 53 41 56 45 5f 4c 49 42 LIBS} ${SAVE_LIB
09d0: 53 7d 20 24 7b 54 43 4c 54 4c 53 5f 53 53 4c 5f S} ${TCLTLS_SSL_
09e0: 4c 49 42 53 7d 22 0a 09 43 46 4c 41 47 53 3d 22 LIBS}"..CFLAGS="
09f0: 24 7b 54 43 4c 54 4c 53 5f 53 53 4c 5f 43 46 4c ${TCLTLS_SSL_CFL
0a00: 41 47 53 7d 20 24 7b 53 41 56 45 5f 43 46 4c 41 AGS} ${SAVE_CFLA
0a10: 47 53 7d 20 24 7b 54 43 4c 54 4c 53 5f 53 53 4c GS} ${TCLTLS_SSL
0a20: 5f 43 46 4c 41 47 53 7d 22 0a 09 43 50 50 46 4c _CFLAGS}"..CPPFL
0a30: 41 47 53 3d 22 24 7b 54 43 4c 54 4c 53 5f 53 53 AGS="${TCLTLS_SS
0a40: 4c 5f 43 50 50 46 4c 41 47 53 7d 20 24 7b 53 41 L_CPPFLAGS} ${SA
0a50: 56 45 5f 43 50 50 46 4c 41 47 53 7d 20 24 7b 54 VE_CPPFLAGS} ${T
0a60: 43 4c 54 4c 53 5f 53 53 4c 5f 43 50 50 46 4c 41 CLTLS_SSL_CPPFLA
0a70: 47 53 7d 22 0a 0a 09 64 6e 6c 20 56 65 72 69 66 GS}"...dnl Verif
0a80: 79 20 74 68 61 74 20 62 61 73 69 63 20 66 75 6e y that basic fun
0a90: 63 74 69 6f 6e 61 6c 69 74 79 20 69 73 20 74 68 ctionality is th
0aa0: 65 72 65 0a 09 41 43 5f 4c 41 4e 47 5f 50 55 53 ere..AC_LANG_PUS
0ab0: 48 28 43 29 0a 09 41 43 5f 4d 53 47 5f 43 48 45 H(C)..AC_MSG_CHE
0ac0: 43 4b 49 4e 47 28 5b 69 66 20 61 20 62 61 73 69 CKING([if a basi
0ad0: 63 20 4d 62 65 64 54 4c 53 20 70 72 6f 67 72 61 c MbedTLS progra
0ae0: 6d 20 77 6f 72 6b 73 5d 29 0a 09 41 43 5f 4c 49 m works])..AC_LI
0af0: 4e 4b 5f 49 46 45 4c 53 45 28 5b 41 43 5f 4c 41 NK_IFELSE([AC_LA
0b00: 4e 47 5f 50 52 4f 47 52 41 4d 28 5b 0a 23 64 65 NG_PROGRAM([.#de
0b10: 66 69 6e 65 20 4d 42 45 44 54 4c 53 5f 43 4f 4e fine MBEDTLS_CON
0b20: 46 49 47 5f 46 49 4c 45 20 3c 6d 62 65 64 74 6c FIG_FILE <mbedtl
0b30: 73 2f 63 6f 6e 66 69 67 2e 68 3e 0a 23 69 6e 63 s/config.h>.#inc
0b40: 6c 75 64 65 20 4d 42 45 44 54 4c 53 5f 43 4f 4e lude MBEDTLS_CON
0b50: 46 49 47 5f 46 49 4c 45 0a 09 09 5d 2c 20 5b 0a FIG_FILE...], [.
0b60: 20 20 20 20 6d 62 65 64 74 6c 73 5f 73 73 6c 5f mbedtls_ssl_
0b70: 63 6f 6e 74 65 78 74 20 2a 63 74 78 3b 0a 20 20 context *ctx;.
0b80: 20 20 6d 62 65 64 74 6c 73 5f 73 73 6c 5f 69 6e mbedtls_ssl_in
0b90: 69 74 28 63 74 78 29 3b 0a 20 20 20 20 6d 62 65 it(ctx);. mbe
0ba0: 64 74 6c 73 5f 73 73 6c 5f 73 65 74 75 70 28 63 dtls_ssl_setup(c
0bb0: 74 78 2c 20 28 76 6f 69 64 20 2a 29 20 30 29 3b tx, (void *) 0);
0bc0: 0a 20 20 20 20 6d 62 65 64 74 6c 73 5f 73 73 6c . mbedtls_ssl
0bd0: 5f 66 72 65 65 28 63 74 78 29 3b 0a 09 09 5d 29 _free(ctx);...])
0be0: 5d 2c 20 5b 0a 09 09 41 43 5f 4d 53 47 5f 52 45 ], [...AC_MSG_RE
0bf0: 53 55 4c 54 28 5b 79 65 73 5d 29 0a 09 5d 2c 20 SULT([yes])..],
0c00: 5b 0a 09 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c [...AC_MSG_RESUL
0c10: 54 28 5b 6e 6f 5d 29 0a 09 09 41 43 5f 4d 53 47 T([no])...AC_MSG
0c20: 5f 45 52 52 4f 52 28 5b 55 6e 61 62 6c 65 20 74 _ERROR([Unable t
0c30: 6f 20 63 6f 6d 70 69 6c 65 20 61 20 62 61 73 69 o compile a basi
0c40: 63 20 70 72 6f 67 72 61 6d 20 75 73 69 6e 67 20 c program using
0c50: 4d 62 65 64 54 4c 53 5d 29 0a 09 5d 29 0a 09 41 MbedTLS])..])..A
0c60: 43 5f 4c 41 4e 47 5f 50 4f 50 28 5b 43 5d 29 0a C_LANG_POP([C]).
0c70: 0a 64 6e 6c 0a 64 6e 6c 09 41 43 5f 43 48 45 43 .dnl.dnl.AC_CHEC
0c80: 4b 5f 46 55 4e 43 53 28 5b 54 4c 53 5f 6d 65 74 K_FUNCS([TLS_met
0c90: 68 6f 64 5d 29 0a 64 6e 6c 09 54 43 4c 54 4c 53 hod]).dnl.TCLTLS
0ca0: 5f 53 53 4c 5f 4f 50 45 4e 53 53 4c 5f 43 48 45 _SSL_OPENSSL_CHE
0cb0: 43 4b 5f 50 52 4f 54 4f 5f 56 45 52 28 5b 74 63 CK_PROTO_VER([tc
0cc0: 6c 74 6c 73 5f 73 73 6c 5f 73 73 6c 32 5d 2c 20 ltls_ssl_ssl2],
0cd0: 5b 53 53 4c 76 32 5f 6d 65 74 68 6f 64 5d 2c 20 [SSLv2_method],
0ce0: 5b 73 73 6c 76 32 5d 2c 20 5b 4e 4f 5f 53 53 4c [sslv2], [NO_SSL
0cf0: 32 5d 29 0a 64 6e 6c 09 54 43 4c 54 4c 53 5f 53 2]).dnl.TCLTLS_S
0d00: 53 4c 5f 4f 50 45 4e 53 53 4c 5f 43 48 45 43 4b SL_OPENSSL_CHECK
0d10: 5f 50 52 4f 54 4f 5f 56 45 52 28 5b 74 63 6c 74 _PROTO_VER([tclt
0d20: 6c 73 5f 73 73 6c 5f 73 73 6c 33 5d 2c 20 5b 53 ls_ssl_ssl3], [S
0d30: 53 4c 76 33 5f 6d 65 74 68 6f 64 5d 2c 20 5b 73 SLv3_method], [s
0d40: 73 6c 76 33 5d 2c 20 5b 4e 4f 5f 53 53 4c 33 5d slv3], [NO_SSL3]
0d50: 29 0a 64 6e 6c 09 54 43 4c 54 4c 53 5f 53 53 4c ).dnl.TCLTLS_SSL
0d60: 5f 4f 50 45 4e 53 53 4c 5f 43 48 45 43 4b 5f 50 _OPENSSL_CHECK_P
0d70: 52 4f 54 4f 5f 56 45 52 28 5b 74 63 6c 74 6c 73 ROTO_VER([tcltls
0d80: 5f 73 73 6c 5f 74 6c 73 31 5f 30 5d 2c 20 5b 54 _ssl_tls1_0], [T
0d90: 4c 53 76 31 5f 6d 65 74 68 6f 64 5d 2c 20 5b 74 LSv1_method], [t
0da0: 6c 73 76 31 2e 30 5d 2c 20 5b 4e 4f 5f 54 4c 53 lsv1.0], [NO_TLS
0db0: 31 5d 29 0a 64 6e 6c 09 54 43 4c 54 4c 53 5f 53 1]).dnl.TCLTLS_S
0dc0: 53 4c 5f 4f 50 45 4e 53 53 4c 5f 43 48 45 43 4b SL_OPENSSL_CHECK
0dd0: 5f 50 52 4f 54 4f 5f 56 45 52 28 5b 74 63 6c 74 _PROTO_VER([tclt
0de0: 6c 73 5f 73 73 6c 5f 74 6c 73 31 5f 31 5d 2c 20 ls_ssl_tls1_1],
0df0: 5b 54 4c 53 76 31 5f 31 5f 6d 65 74 68 6f 64 5d [TLSv1_1_method]
0e00: 2c 20 5b 74 6c 73 76 31 2e 31 5d 2c 20 5b 4e 4f , [tlsv1.1], [NO
0e10: 5f 54 4c 53 31 5f 31 5d 29 0a 64 6e 6c 09 54 43 _TLS1_1]).dnl.TC
0e20: 4c 54 4c 53 5f 53 53 4c 5f 4f 50 45 4e 53 53 4c LTLS_SSL_OPENSSL
0e30: 5f 43 48 45 43 4b 5f 50 52 4f 54 4f 5f 56 45 52 _CHECK_PROTO_VER
0e40: 28 5b 74 63 6c 74 6c 73 5f 73 73 6c 5f 74 6c 73 ([tcltls_ssl_tls
0e50: 31 5f 32 5d 2c 20 5b 54 4c 53 76 31 5f 32 5f 6d 1_2], [TLSv1_2_m
0e60: 65 74 68 6f 64 5d 2c 20 5b 74 6c 73 76 31 2e 32 ethod], [tlsv1.2
0e70: 5d 2c 20 5b 4e 4f 5f 54 4c 53 31 5f 32 5d 29 0a ], [NO_TLS1_2]).
0e80: 64 6e 6c 09 54 43 4c 54 4c 53 5f 53 53 4c 5f 4f dnl.TCLTLS_SSL_O
0e90: 50 45 4e 53 53 4c 5f 43 48 45 43 4b 5f 50 52 4f PENSSL_CHECK_PRO
0ea0: 54 4f 5f 56 45 52 28 5b 74 63 6c 74 6c 73 5f 73 TO_VER([tcltls_s
0eb0: 73 6c 5f 74 6c 73 31 5f 33 5d 2c 20 5b 5d 2c 20 sl_tls1_3], [],
0ec0: 5b 74 6c 73 76 31 2e 33 5d 2c 20 5b 4e 4f 5f 54 [tlsv1.3], [NO_T
0ed0: 4c 53 31 5f 33 5d 2c 20 5b 53 53 4c 5f 4f 50 5f LS1_3], [SSL_OP_
0ee0: 4e 4f 5f 54 4c 53 76 31 5f 33 5d 29 0a 64 6e 6c NO_TLSv1_3]).dnl
0ef0: 0a 0a 09 64 6e 6c 20 52 65 73 74 6f 72 65 20 63 ...dnl Restore c
0f00: 6f 6d 70 69 6c 65 2d 61 6c 74 65 72 69 6e 67 20 ompile-altering
0f10: 76 61 72 69 61 62 6c 65 73 0a 09 4c 49 42 53 3d variables..LIBS=
0f20: 22 24 7b 53 41 56 45 5f 4c 49 42 53 7d 22 0a 09 "${SAVE_LIBS}"..
0f30: 43 46 4c 41 47 53 3d 22 24 7b 53 41 56 45 5f 43 CFLAGS="${SAVE_C
0f40: 46 4c 41 47 53 7d 22 0a 09 43 50 50 46 4c 41 47 FLAGS}"..CPPFLAG
0f50: 53 3d 22 24 7b 53 41 56 45 5f 43 50 50 46 4c 41 S="${SAVE_CPPFLA
0f60: 47 53 7d 22 0a 5d 29 0a GS}".]).