Hex Artifact Content

Artifact 6b4f8edcc8dbb4f9e63790b0762e3df0d3523dfd:


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 69 66 20 7b 5b 63 61 74 63  tclsh..if {[catc
0020: 68 20 7b 0a 09 73 65 74 20 62 75 69 6c 64 66 6c  h {..set buildfl
0030: 61 67 73 20 5b 73 70 6c 69 74 20 5b 6c 69 6e 64  ags [split [lind
0040: 65 78 20 24 61 72 67 76 20 31 5d 20 2d 5d 0a 0a  ex $argv 1] -]..
0050: 09 23 20 44 65 74 65 72 6d 69 6e 65 20 69 66 20  .# Determine if 
0060: 54 68 72 65 61 64 73 20 77 61 73 20 72 65 71 75  Threads was requ
0070: 65 73 74 65 64 20 28 6f 72 20 69 6e 20 38 2e 36  ested (or in 8.6
0080: 2b 2c 20 75 6e 72 65 71 75 65 73 74 65 64 29 0a  +, unrequested).
0090: 09 69 66 20 7b 24 74 63 6c 5f 76 65 72 73 69 6f  .if {$tcl_versio
00a0: 6e 20 3d 3d 20 22 38 2e 36 22 7d 20 7b 0a 09 09  n == "8.6"} {...
00b0: 69 66 20 7b 5b 6c 73 65 61 72 63 68 20 2d 65 78  if {[lsearch -ex
00c0: 61 63 74 20 24 62 75 69 6c 64 66 6c 61 67 73 20  act $buildflags 
00d0: 22 75 6e 74 68 72 65 61 64 65 64 22 5d 20 3d 3d  "unthreaded"] ==
00e0: 20 2d 31 7d 20 7b 0a 09 09 09 73 65 74 20 69 73   -1} {....set is
00f0: 74 68 72 65 61 64 65 64 20 31 0a 09 09 7d 20 65  threaded 1...} e
0100: 6c 73 65 20 7b 0a 09 09 09 73 65 74 20 69 73 74  lse {....set ist
0110: 68 72 65 61 64 65 64 20 30 0a 09 09 7d 0a 09 7d  hreaded 0...}..}
0120: 20 65 6c 73 65 20 7b 0a 09 09 69 66 20 7b 5b 6c   else {...if {[l
0130: 73 65 61 72 63 68 20 2d 65 78 61 63 74 20 24 62  search -exact $b
0140: 75 69 6c 64 66 6c 61 67 73 20 22 74 68 72 65 61  uildflags "threa
0150: 64 65 64 22 5d 20 3d 3d 20 2d 31 7d 20 7b 0a 09  ded"] == -1} {..
0160: 09 09 73 65 74 20 69 73 74 68 72 65 61 64 65 64  ..set isthreaded
0170: 20 30 0a 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09   0...} else {...
0180: 09 73 65 74 20 69 73 74 68 72 65 61 64 65 64 20  .set isthreaded 
0190: 31 0a 09 09 7d 0a 09 7d 0a 0a 09 23 20 53 74 61  1...}..}...# Sta
01a0: 74 69 63 20 62 75 69 6c 64 73 20 64 6f 6e 27 74  tic builds don't
01b0: 20 63 6f 6d 65 20 77 69 74 68 20 74 68 72 65 61   come with threa
01c0: 64 73 2e 0a 09 69 66 20 7b 5b 6c 73 65 61 72 63  ds...if {[lsearc
01d0: 68 20 2d 65 78 61 63 74 20 24 62 75 69 6c 64 66  h -exact $buildf
01e0: 6c 61 67 73 20 22 73 74 61 74 69 63 22 5d 20 21  lags "static"] !
01f0: 3d 20 2d 31 7d 20 7b 0a 09 09 73 65 74 20 69 73  = -1} {...set is
0200: 74 68 72 65 61 64 65 64 20 30 0a 09 7d 0a 0a 09  threaded 0..}...
0210: 69 66 20 7b 21 24 69 73 74 68 72 65 61 64 65 64  if {!$isthreaded
0220: 7d 20 7b 0a 09 09 65 78 69 74 20 30 0a 09 7d 0a  } {...exit 0..}.
0230: 0a 09 70 61 63 6b 61 67 65 20 72 65 71 75 69 72  ..package requir
0240: 65 20 54 68 72 65 61 64 0a 0a 09 65 78 69 74 20  e Thread...exit 
0250: 30 0a 7d 5d 7d 20 7b 0a 09 70 75 74 73 20 22 45  0.}]} {..puts "E
0260: 72 72 6f 72 20 69 6e 20 54 68 72 65 61 64 20 54  rror in Thread T
0270: 65 73 74 3a 20 24 65 72 72 6f 72 49 6e 66 6f 22  est: $errorInfo"
0280: 0a 09 65 78 69 74 20 31 0a 7d 0a                 ..exit 1.}.