Artifact
1fc99f0129ed560c5c45238ccb826366adc4e3ff:
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 0a 41 43 5f 43 48 45 43 4b 5f 54 4f 4f )...AC_CHECK_TOO
0430: 4c 28 5b 50 4b 47 43 4f 4e 46 49 47 5d 2c 20 5b L([PKGCONFIG], [
0440: 70 6b 67 2d 63 6f 6e 66 69 67 5d 2c 20 5b 66 61 pkg-config], [fa
0450: 6c 73 65 5d 29 0a 0a 64 6e 6c 20 58 58 58 3a 54 lse])..dnl XXX:T
0460: 4f 44 4f 3a 20 41 75 74 6f 6d 61 74 69 63 61 6c ODO: Automatical
0470: 6c 79 20 64 65 74 65 72 6d 69 6e 65 20 74 68 65 ly determine the
0480: 20 53 53 4c 20 6c 69 62 72 61 72 79 20 74 6f 20 SSL library to
0490: 75 73 65 0a 64 6e 6c 20 20 20 20 20 20 20 20 20 use.dnl
04a0: 20 20 64 65 66 61 75 6c 74 69 6e 67 20 74 6f 20 defaulting to
04b0: 4f 70 65 6e 53 53 4c 20 66 6f 72 20 63 6f 6d 70 OpenSSL for comp
04c0: 61 74 69 62 69 6c 69 74 79 20 72 65 61 73 6f 6e atibility reason
04d0: 73 0a 69 66 20 74 65 73 74 20 22 24 74 63 6c 74 s.if test "$tclt
04e0: 6c 73 5f 73 73 6c 5f 6c 69 62 22 20 3d 20 27 61 ls_ssl_lib" = 'a
04f0: 75 74 6f 27 3b 20 74 68 65 6e 0a 09 74 63 6c 74 uto'; then..tclt
0500: 6c 73 5f 73 73 6c 5f 6c 69 62 3d 27 6f 70 65 6e ls_ssl_lib='open
0510: 73 73 6c 27 0a 66 69 0a 0a 41 43 5f 4d 53 47 5f ssl'.fi..AC_MSG_
0520: 43 48 45 43 4b 49 4e 47 28 5b 77 68 69 63 68 20 CHECKING([which
0530: 54 4c 53 20 6c 69 62 72 61 72 79 20 74 6f 20 75 TLS library to u
0540: 73 65 5d 29 0a 41 53 5f 43 41 53 45 28 5b 24 74 se]).AS_CASE([$t
0550: 63 6c 74 6c 73 5f 73 73 6c 5f 6c 69 62 5d 2c 0a cltls_ssl_lib],.
0560: 09 5b 6f 70 65 6e 73 73 6c 5d 2c 20 5b 0a 09 09 .[openssl], [...
0570: 41 43 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6f AC_MSG_RESULT([o
0580: 70 65 6e 73 73 6c 5d 29 0a 0a 09 09 4c 49 42 53 penssl])....LIBS
0590: 3d 22 24 7b 4c 49 42 53 7d 20 60 22 24 7b 50 4b ="${LIBS} `"${PK
05a0: 47 43 4f 4e 46 49 47 7d 22 20 6f 70 65 6e 73 73 GCONFIG}" openss
05b0: 6c 20 2d 2d 6c 69 62 73 60 22 0a 09 09 43 46 4c l --libs`"...CFL
05c0: 41 47 53 3d 22 24 7b 43 46 4c 41 47 53 7d 20 60 AGS="${CFLAGS} `
05d0: 22 24 7b 50 4b 47 43 4f 4e 46 49 47 7d 22 20 6f "${PKGCONFIG}" o
05e0: 70 65 6e 73 73 6c 20 2d 2d 63 66 6c 61 67 73 2d penssl --cflags-
05f0: 6f 6e 6c 79 2d 6f 74 68 65 72 60 22 0a 09 09 43 only-other`"...C
0600: 50 50 46 4c 41 47 53 3d 22 24 7b 43 50 50 46 4c PPFLAGS="${CPPFL
0610: 41 47 53 7d 20 60 22 24 7b 50 4b 47 43 4f 4e 46 AGS} `"${PKGCONF
0620: 49 47 7d 22 20 6f 70 65 6e 73 73 6c 20 2d 2d 63 IG}" openssl --c
0630: 66 6c 61 67 73 2d 6f 6e 6c 79 2d 49 60 22 0a 09 flags-only-I`"..
0640: 5d 2c 0a 09 5b 6c 69 62 72 65 73 73 6c 5d 2c 20 ],..[libressl],
0650: 5b 0a 09 09 41 43 5f 4d 53 47 5f 52 45 53 55 4c [...AC_MSG_RESUL
0660: 54 28 5b 6c 69 62 72 65 73 73 6c 5d 29 0a 09 5d T([libressl])..]
0670: 2c 0a 09 5b 6e 73 73 5d 2c 20 5b 0a 09 09 41 43 ,..[nss], [...AC
0680: 5f 4d 53 47 5f 52 45 53 55 4c 54 28 5b 6e 73 73 _MSG_RESULT([nss
0690: 5d 29 0a 09 5d 2c 0a 09 5b 0a 09 09 41 43 5f 4d ])..],..[...AC_M
06a0: 53 47 5f 45 52 52 4f 52 28 5b 55 6e 73 75 70 70 SG_ERROR([Unsupp
06b0: 6f 72 74 65 64 20 53 53 4c 20 6c 69 62 72 61 72 orted SSL librar
06c0: 79 3a 20 24 74 63 6c 74 6c 73 5f 73 73 6c 5f 6c y: $tcltls_ssl_l
06d0: 69 62 5d 29 0a 09 5d 0a 29 0a 0a 64 6e 6c 20 50 ib])..].)..dnl P
06e0: 72 6f 64 75 63 65 20 6f 75 74 70 75 74 0a 41 43 roduce output.AC
06f0: 5f 4f 55 54 50 55 54 28 4d 61 6b 65 66 69 6c 65 _OUTPUT(Makefile
0700: 20 70 6b 67 49 6e 64 65 78 2e 74 63 6c 29 0a pkgIndex.tcl).