Hex Artifact Content

Artifact df3ccdde39718f879d462a60f901abb785c5abd8:


0000: 23 21 20 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20  #! /usr/bin/env 
0010: 74 63 6c 73 68 0a 0a 73 65 74 20 62 75 69 6c 64  tclsh..set build
0020: 66 6c 61 67 73 20 5b 73 70 6c 69 74 20 5b 6c 69  flags [split [li
0030: 6e 64 65 78 20 24 61 72 67 76 20 31 5d 20 2d 5d  ndex $argv 1] -]
0040: 0a 0a 23 20 44 65 74 65 72 6d 69 6e 65 20 69 66  ..# Determine if
0050: 20 54 68 72 65 61 64 73 20 77 61 73 20 72 65 71   Threads was req
0060: 75 65 73 74 65 64 20 28 6f 72 20 69 6e 20 38 2e  uested (or in 8.
0070: 36 2b 2c 20 75 6e 72 65 71 75 65 73 74 65 64 29  6+, unrequested)
0080: 0a 69 66 20 7b 24 74 63 6c 5f 76 65 72 73 69 6f  .if {$tcl_versio
0090: 6e 20 3d 3d 20 22 38 2e 36 22 7d 20 7b 0a 09 69  n == "8.6"} {..i
00a0: 66 20 7b 5b 6c 73 65 61 72 63 68 20 2d 65 78 61  f {[lsearch -exa
00b0: 63 74 20 24 62 75 69 6c 64 66 6c 61 67 73 20 22  ct $buildflags "
00c0: 75 6e 74 68 72 65 61 64 65 64 22 5d 20 3d 3d 20  unthreaded"] == 
00d0: 2d 31 7d 20 7b 0a 09 09 73 65 74 20 69 73 74 68  -1} {...set isth
00e0: 72 65 61 64 65 64 20 31 0a 09 7d 20 65 6c 73 65  readed 1..} else
00f0: 20 7b 0a 09 09 73 65 74 20 69 73 74 68 72 65 61   {...set isthrea
0100: 64 65 64 20 30 0a 09 7d 0a 7d 20 65 6c 73 65 20  ded 0..}.} else 
0110: 7b 0a 09 69 66 20 7b 5b 6c 73 65 61 72 63 68 20  {..if {[lsearch 
0120: 2d 65 78 61 63 74 20 24 62 75 69 6c 64 66 6c 61  -exact $buildfla
0130: 67 73 20 22 74 68 72 65 61 64 65 64 22 5d 20 3d  gs "threaded"] =
0140: 3d 20 2d 31 7d 20 7b 0a 09 09 73 65 74 20 69 73  = -1} {...set is
0150: 74 68 72 65 61 64 65 64 20 30 0a 09 7d 20 65 6c  threaded 0..} el
0160: 73 65 20 7b 0a 09 09 73 65 74 20 69 73 74 68 72  se {...set isthr
0170: 65 61 64 65 64 20 31 0a 09 7d 0a 7d 0a 0a 23 20  eaded 1..}.}..# 
0180: 53 74 61 74 69 63 20 62 75 69 6c 64 73 20 64 6f  Static builds do
0190: 6e 27 74 20 63 6f 6d 65 20 77 69 74 68 20 74 68  n't come with th
01a0: 72 65 61 64 73 2e 0a 69 66 20 7b 5b 6c 73 65 61  reads..if {[lsea
01b0: 72 63 68 20 2d 65 78 61 63 74 20 24 62 75 69 6c  rch -exact $buil
01c0: 64 66 6c 61 67 73 20 22 73 74 61 74 69 63 22 5d  dflags "static"]
01d0: 20 21 3d 20 2d 31 7d 20 7b 0a 09 73 65 74 20 69   != -1} {..set i
01e0: 73 74 68 72 65 61 64 65 64 20 30 0a 7d 0a 0a 69  sthreaded 0.}..i
01f0: 66 20 7b 21 24 69 73 74 68 72 65 61 64 65 64 7d  f {!$isthreaded}
0200: 20 7b 0a 09 65 78 69 74 20 30 0a 7d 0a 0a 70 61   {..exit 0.}..pa
0210: 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 54 68  ckage require Th
0220: 72 65 61 64 0a 0a 65 78 69 74 20 30 0a           read..exit 0.