Artifact
a69bede37480d44d1663057e611782b15a274d8e:
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 40 40 56 45 52 53 40 40 29 0a 0a tls, @@VERS@@)..
0030: 64 6e 6c 20 43 68 65 63 6b 73 20 66 6f 72 20 70 dnl Checks for p
0040: 72 6f 67 72 61 6d 73 2e 0a 41 43 5f 50 52 4f 47 rograms..AC_PROG
0050: 5f 43 43 0a 41 43 5f 50 52 4f 47 5f 4d 41 4b 45 _CC.AC_PROG_MAKE
0060: 5f 53 45 54 0a 41 43 5f 50 52 4f 47 5f 49 4e 53 _SET.AC_PROG_INS
0070: 54 41 4c 4c 0a 41 43 5f 47 4e 55 5f 53 4f 55 52 TALL.AC_GNU_SOUR
0080: 43 45 0a 0a 64 6e 6c 20 44 65 74 65 72 6d 69 6e CE..dnl Determin
0090: 65 20 73 79 73 74 65 6d 20 69 6e 66 6f 72 6d 61 e system informa
00a0: 74 69 6f 6e 0a 44 43 5f 43 48 4b 5f 4f 53 5f 49 tion.DC_CHK_OS_I
00b0: 4e 46 4f 0a 0a 64 6e 6c 20 4c 6f 6f 6b 20 66 6f NFO..dnl Look fo
00c0: 72 20 61 70 70 72 6f 70 72 69 61 74 65 20 68 65 r appropriate he
00d0: 61 64 65 72 73 0a 41 43 5f 43 48 45 43 4b 5f 48 aders.AC_CHECK_H
00e0: 45 41 44 45 52 53 28 75 6e 69 73 74 64 2e 68 20 EADERS(unistd.h
00f0: 73 74 64 6c 69 62 2e 68 20 73 74 72 69 6e 67 2e stdlib.h string.
0100: 68 20 73 74 72 69 6e 67 73 2e 68 29 0a 0a 64 6e h strings.h)..dn
0110: 6c 20 50 65 72 66 6f 72 6d 20 54 63 6c 20 45 78 l Perform Tcl Ex
0120: 74 65 6e 73 69 6f 6e 20 72 65 71 75 69 72 65 64 tension required
0130: 20 73 74 75 66 66 0a 54 43 4c 45 58 54 5f 49 4e stuff.TCLEXT_IN
0140: 49 54 0a 0a 69 66 20 74 65 73 74 20 22 24 54 43 IT..if test "$TC
0150: 4c 45 58 54 5f 42 55 49 4c 44 22 20 21 3d 20 27 LEXT_BUILD" != '
0160: 73 74 61 74 69 63 27 3b 20 74 68 65 6e 0a 09 64 static'; then..d
0170: 6e 6c 20 44 65 74 65 72 6d 69 6e 65 20 68 6f 77 nl Determine how
0180: 20 74 6f 20 6d 61 6b 65 20 73 68 61 72 65 64 20 to make shared
0190: 6f 62 6a 65 63 74 73 0a 09 44 43 5f 47 45 54 5f objects..DC_GET_
01a0: 53 48 4f 42 4a 46 4c 41 47 53 0a 0a 09 45 58 54 SHOBJFLAGS...EXT
01b0: 45 4e 53 49 4f 4e 5f 54 41 52 47 45 54 3d 22 74 ENSION_TARGET="t
01c0: 63 6c 74 6c 73 2e 24 7b 53 48 4f 42 4a 45 58 54 cltls.${SHOBJEXT
01d0: 7d 22 0a 65 6c 73 65 0a 09 41 43 5f 43 48 45 43 }".else..AC_CHEC
01e0: 4b 5f 54 4f 4f 4c 28 5b 41 52 5d 2c 20 5b 61 72 K_TOOL([AR], [ar
01f0: 5d 2c 20 5b 66 61 6c 73 65 5d 29 0a 09 41 43 5f ], [false])..AC_
0200: 43 48 45 43 4b 5f 54 4f 4f 4c 28 5b 52 41 4e 4c CHECK_TOOL([RANL
0210: 49 42 5d 2c 20 5b 72 61 6e 6c 69 62 5d 2c 20 5b IB], [ranlib], [
0220: 3a 5d 29 0a 09 45 58 54 45 4e 53 49 4f 4e 5f 54 :])..EXTENSION_T
0230: 41 52 47 45 54 3d 22 74 63 6c 74 6c 73 2e 61 22 ARGET="tcltls.a"
0240: 0a 66 69 0a 41 43 5f 53 55 42 53 54 28 45 58 54 .fi.AC_SUBST(EXT
0250: 45 4e 53 49 4f 4e 5f 54 41 52 47 45 54 29 0a 41 ENSION_TARGET).A
0260: 43 5f 53 55 42 53 54 28 54 43 4c 45 58 54 5f 42 C_SUBST(TCLEXT_B
0270: 55 49 4c 44 29 0a 0a 64 6e 6c 20 44 65 74 65 72 UILD)..dnl Deter
0280: 6d 69 6e 65 20 77 68 61 74 20 53 53 4c 20 6c 69 mine what SSL li
0290: 62 72 61 72 79 20 74 6f 20 6c 69 6e 6b 20 77 69 brary to link wi
02a0: 74 68 0a 41 43 5f 41 52 47 5f 57 49 54 48 28 5b th.AC_ARG_WITH([
02b0: 73 73 6c 5d 2c 20 41 53 5f 48 45 4c 50 5f 53 54 ssl], AS_HELP_ST
02c0: 52 49 4e 47 28 5b 2d 2d 77 69 74 68 2d 73 73 6c RING([--with-ssl
02d0: 5d 2c 20 5b 6e 61 6d 65 20 6f 66 20 73 73 6c 20 ], [name of ssl
02e0: 6c 69 62 72 61 72 79 20 74 6f 20 62 75 69 6c 64 library to build
02f0: 20 61 67 61 69 6e 73 74 20 28 6f 70 65 6e 73 73 against (openss
0300: 6c 2c 20 6c 69 62 72 65 73 73 6c 2c 20 6e 73 73 l, libressl, nss
0310: 2c 20 61 75 74 6f 29 5d 29 2c 20 5b 0a 09 69 66 , auto)]), [..if
0320: 20 74 65 73 74 20 22 24 77 69 74 68 76 61 6c 22 test "$withval"
0330: 20 3d 20 22 6e 6f 22 3b 20 74 68 65 6e 0a 09 09 = "no"; then...
0340: 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b 59 6f AC_MSG_ERROR([Yo
0350: 75 20 6d 61 79 20 6e 6f 74 20 73 70 65 63 69 66 u may not specif
0360: 79 20 2d 2d 77 69 74 68 6f 75 74 2d 73 73 6c 5d y --without-ssl]
0370: 29 0a 09 66 69 0a 0a 09 69 66 20 74 65 73 74 20 )..fi...if test
0380: 22 24 77 69 74 68 76 61 6c 22 20 3d 20 22 79 65 "$withval" = "ye
0390: 73 22 3b 20 74 68 65 6e 0a 09 09 41 43 5f 4d 53 s"; then...AC_MS
03a0: 47 5f 45 52 52 4f 52 28 5b 49 66 20 79 6f 75 20 G_ERROR([If you
03b0: 73 70 65 63 69 66 79 20 2d 2d 77 69 74 68 2d 73 specify --with-s
03c0: 73 6c 20 74 68 65 6e 20 79 6f 75 20 6d 75 73 74 sl then you must
03d0: 20 70 72 6f 76 69 64 65 20 61 20 76 61 6c 75 65 provide a value
03e0: 5d 29 0a 09 66 69 0a 0a 09 74 63 6c 74 6c 73 5f ])..fi...tcltls_
03f0: 73 73 6c 5f 6c 69 62 3d 22 24 77 69 74 68 76 61 ssl_lib="$withva
0400: 6c 22 0a 5d 2c 20 5b 0a 09 74 63 6c 74 6c 73 5f l".], [..tcltls_
0410: 73 73 6c 5f 6c 69 62 3d 27 61 75 74 6f 27 0a 5d ssl_lib='auto'.]
0420: 29 0a 0a 64 6e 6c 20 58 58 58 3a 54 4f 44 4f 3a )..dnl XXX:TODO:
0430: 20 41 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 64 Automatically d
0440: 65 74 65 72 6d 69 6e 65 20 74 68 65 20 53 53 4c etermine the SSL
0450: 20 6c 69 62 72 61 72 79 20 74 6f 20 75 73 65 0a library to use.
0460: 64 6e 6c 20 20 20 20 20 20 20 20 20 20 20 64 65 dnl de
0470: 66 61 75 6c 74 69 6e 67 20 74 6f 20 4f 70 65 6e faulting to Open
0480: 53 53 4c 20 66 6f 72 20 63 6f 6d 70 61 74 69 62 SSL for compatib
0490: 69 6c 69 74 79 20 72 65 61 73 6f 6e 73 0a 69 66 ility reasons.if
04a0: 20 74 65 73 74 20 22 24 74 63 6c 74 6c 73 5f 73 test "$tcltls_s
04b0: 73 6c 5f 6c 69 62 22 20 3d 20 27 61 75 74 6f 27 sl_lib" = 'auto'
04c0: 3b 20 74 68 65 6e 0a 09 74 63 6c 74 6c 73 5f 73 ; then..tcltls_s
04d0: 73 6c 5f 6c 69 62 3d 27 6f 70 65 6e 73 73 6c 27 sl_lib='openssl'
04e0: 0a 66 69 0a 0a 41 43 5f 4d 53 47 5f 43 48 45 43 .fi..AC_MSG_CHEC
04f0: 4b 49 4e 47 28 5b 77 68 69 63 68 20 54 4c 53 20 KING([which TLS
0500: 6c 69 62 72 61 72 79 20 74 6f 20 75 73 65 5d 29 library to use])
0510: 0a 41 53 5f 43 41 53 45 28 5b 24 74 63 6c 74 6c .AS_CASE([$tcltl
0520: 73 5f 73 73 6c 5f 6c 69 62 5d 2c 0a 09 5b 6f 70 s_ssl_lib],..[op
0530: 65 6e 73 73 6c 5d 2c 20 5b 0a 09 09 41 43 5f 4d enssl], [...AC_M
0540: 53 47 5f 52 45 53 55 4c 54 28 5b 6f 70 65 6e 73 SG_RESULT([opens
0550: 73 6c 5d 29 0a 09 5d 2c 0a 09 5b 6c 69 62 72 65 sl])..],..[libre
0560: 73 73 6c 5d 2c 20 5b 0a 09 09 41 43 5f 4d 53 47 ssl], [...AC_MSG
0570: 5f 52 45 53 55 4c 54 28 5b 6c 69 62 72 65 73 73 _RESULT([libress
0580: 6c 5d 29 0a 09 5d 2c 0a 09 5b 6e 73 73 5d 2c 20 l])..],..[nss],
0590: 5b 0a 09 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c [...AC_MSG_RESUL
05a0: 54 28 5b 6e 73 73 5d 29 0a 09 5d 2c 0a 09 5b 0a T([nss])..],..[.
05b0: 09 09 41 43 5f 4d 53 47 5f 45 52 52 4f 52 28 5b ..AC_MSG_ERROR([
05c0: 55 6e 73 75 70 70 6f 72 74 65 64 20 53 53 4c 20 Unsupported SSL
05d0: 6c 69 62 72 61 72 79 3a 20 24 74 63 6c 74 6c 73 library: $tcltls
05e0: 5f 73 73 6c 5f 6c 69 62 5d 29 0a 09 5d 0a 29 0a _ssl_lib])..].).
05f0: 0a 0a 64 6e 6c 20 50 72 6f 64 75 63 65 20 6f 75 ..dnl Produce ou
0600: 74 70 75 74 0a 41 43 5f 4f 55 54 50 55 54 28 4d tput.AC_OUTPUT(M
0610: 61 6b 65 66 69 6c 65 20 70 6b 67 49 6e 64 65 78 akefile pkgIndex
0620: 2e 74 63 6c 29 0a .tcl).