Hex Artifact Content

Artifact 38851b5a2ace989fd124b518a562f877ff89c56a:


0000: 23 21 20 2f 62 69 6e 2f 62 61 73 68 0a 0a 56 45  #! /bin/bash..VE
0010: 52 53 49 4f 4e 53 3d 22 38 2e 34 2e 31 39 20 38  RSIONS="8.4.19 8
0020: 2e 35 2e 39 20 63 76 73 5f 48 45 41 44 22 0a 0a  .5.9 cvs_HEAD"..
0030: 23 20 46 69 6e 64 20 74 68 65 20 62 61 73 65 20  # Find the base 
0040: 64 69 72 65 63 74 6f 72 79 0a 66 6f 72 20 78 20  directory.for x 
0050: 69 6e 20 31 20 32 20 33 20 5f 5f 66 61 69 6c 5f  in 1 2 3 __fail_
0060: 5f 3b 20 64 6f 0a 09 69 66 20 5b 20 22 24 7b 78  _; do..if [ "${x
0070: 7d 22 20 3d 20 22 24 7b 66 61 69 6c 7d 22 20 5d  }" = "${fail}" ]
0080: 3b 20 74 68 65 6e 0a 09 09 65 63 68 6f 20 27 55  ; then...echo 'U
0090: 6e 61 62 6c 65 20 74 6f 20 66 69 6e 64 20 4b 69  nable to find Ki
00a0: 74 43 72 65 61 74 6f 72 2c 20 61 62 6f 72 74 69  tCreator, aborti
00b0: 6e 67 2e 27 20 3e 26 32 0a 0a 09 09 65 78 69 74  ng.' >&2....exit
00c0: 20 31 0a 09 66 69 0a 0a 09 69 66 20 5b 20 2d 78   1..fi...if [ -x
00d0: 20 6b 69 74 63 72 65 61 74 6f 72 20 5d 3b 20 74   kitcreator ]; t
00e0: 68 65 6e 0a 09 09 62 72 65 61 6b 0a 09 66 69 0a  hen...break..fi.
00f0: 0a 09 63 64 20 2e 2e 0a 64 6f 6e 65 0a 0a 52 4f  ..cd ...done..RO
0100: 4f 54 44 49 52 3d 22 24 28 70 77 64 29 22 0a 54  OTDIR="$(pwd)".T
0110: 45 53 54 44 49 52 3d 22 24 7b 52 4f 4f 54 44 49  ESTDIR="${ROOTDI
0120: 52 7d 2f 62 75 69 6c 64 2f 74 65 73 74 22 0a 65  R}/build/test".e
0130: 78 70 6f 72 74 20 52 4f 4f 54 44 49 52 20 54 45  xport ROOTDIR TE
0140: 53 54 44 49 52 0a 0a 23 20 48 61 6e 64 6c 65 20  STDIR..# Handle 
0150: 63 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20 61 72 67  command-line arg
0160: 75 6d 65 6e 74 73 0a 69 66 20 5b 20 22 24 31 22  uments.if [ "$1"
0170: 20 3d 20 22 63 6c 65 61 6e 22 20 5d 3b 20 74 68   = "clean" ]; th
0180: 65 6e 0a 09 72 6d 20 2d 72 66 20 22 24 7b 54 45  en..rm -rf "${TE
0190: 53 54 44 49 52 7d 2f 6b 69 74 73 22 0a 66 69 0a  STDIR}/kits".fi.
01a0: 0a 23 20 43 72 65 61 74 65 20 70 6c 61 63 65 20  .# Create place 
01b0: 74 6f 20 70 75 74 20 6b 69 74 73 0a 6d 6b 64 69  to put kits.mkdi
01c0: 72 20 22 24 7b 54 45 53 54 44 49 52 7d 2f 6b 69  r "${TESTDIR}/ki
01d0: 74 73 22 20 3e 2f 64 65 76 2f 6e 75 6c 6c 20 32  ts" >/dev/null 2
01e0: 3e 2f 64 65 76 2f 6e 75 6c 6c 0a 6d 6b 64 69 72  >/dev/null.mkdir
01f0: 20 22 24 7b 54 45 53 54 44 49 52 7d 2f 6b 69 74   "${TESTDIR}/kit
0200: 73 2f 66 61 69 6c 65 64 22 20 3e 2f 64 65 76 2f  s/failed" >/dev/
0210: 6e 75 6c 6c 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  null 2>/dev/null
0220: 0a 69 66 20 5b 20 21 20 2d 64 20 22 24 7b 54 45  .if [ ! -d "${TE
0230: 53 54 44 49 52 7d 2f 6b 69 74 73 22 20 5d 3b 20  STDIR}/kits" ]; 
0240: 74 68 65 6e 0a 09 65 63 68 6f 20 27 55 6e 61 62  then..echo 'Unab
0250: 6c 65 20 74 6f 20 63 72 65 61 74 65 20 6b 69 74  le to create kit
0260: 73 2f 20 64 69 72 65 63 74 6f 72 79 2c 20 61 62  s/ directory, ab
0270: 6f 72 74 69 6e 67 2e 27 20 3e 26 32 0a 0a 09 65  orting.' >&2...e
0280: 78 69 74 20 31 0a 66 69 0a 0a 23 20 43 6c 65 61  xit 1.fi..# Clea
0290: 6e 75 70 0a 66 6f 72 20 66 69 6c 65 20 69 6e 20  nup.for file in 
02a0: 22 24 7b 54 45 53 54 44 49 52 7d 22 2f 6b 69 74  "${TESTDIR}"/kit
02b0: 73 2f 2a 2e 6c 6f 67 3b 20 64 6f 0a 09 69 66 20  s/*.log; do..if 
02c0: 65 63 68 6f 20 22 24 7b 66 69 6c 65 7d 22 20 7c  echo "${file}" |
02d0: 20 67 72 65 70 20 2d 2d 20 27 2d 62 75 69 6c 64   grep -- '-build
02e0: 2e 6c 6f 67 24 27 20 3e 2f 64 65 76 2f 6e 75 6c  .log$' >/dev/nul
02f0: 6c 3b 20 74 68 65 6e 0a 09 09 63 6f 6e 74 69 6e  l; then...contin
0300: 75 65 0a 09 66 69 0a 0a 09 72 6d 20 2d 66 20 22  ue..fi...rm -f "
0310: 24 7b 66 69 6c 65 7d 22 0a 64 6f 6e 65 0a 0a 23  ${file}".done..#
0320: 20 53 74 61 72 74 20 58 76 66 62 20 66 6f 72 20   Start Xvfb for 
0330: 58 31 31 2d 62 61 73 65 64 20 74 65 73 74 73 0a  X11-based tests.
0340: 58 56 46 42 5f 50 49 44 3d 22 24 28 0a 09 58 76  XVFB_PID="$(..Xv
0350: 66 62 20 3a 33 31 20 2d 73 63 72 65 65 6e 20 30  fb :31 -screen 0
0360: 20 38 30 30 78 36 30 30 78 32 34 20 2d 6e 6f 6c   800x600x24 -nol
0370: 69 73 74 65 6e 20 74 63 70 20 3e 2f 64 65 76 2f  isten tcp >/dev/
0380: 6e 75 6c 6c 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  null 2>/dev/null
0390: 20 26 0a 09 65 63 68 6f 20 22 24 21 22 0a 29 22   &..echo "$!".)"
03a0: 0a 44 49 53 50 4c 41 59 3d 3a 33 31 0a 65 78 70  .DISPLAY=:31.exp
03b0: 6f 72 74 20 44 49 53 50 4c 41 59 0a 0a 66 61 69  ort DISPLAY..fai
03c0: 6c 65 64 3d 22 22 0a 66 6f 72 20 6b 69 74 20 69  led="".for kit i
03d0: 6e 20 6e 6f 72 6d 61 6c 20 6e 6f 72 6d 61 6c 2d  n normal normal-
03e0: 7a 69 70 20 6e 6f 72 6d 61 6c 2d 74 68 72 65 61  zip normal-threa
03f0: 64 65 64 20 6e 6f 72 6d 61 6c 2d 74 68 72 65 61  ded normal-threa
0400: 64 65 64 2d 7a 69 70 20 6e 6f 72 6d 61 6c 2d 73  ded-zip normal-s
0410: 74 61 74 69 63 74 6b 20 6e 6f 72 6d 61 6c 2d 6e  tatictk normal-n
0420: 6f 74 6b 20 6e 6f 72 6d 61 6c 2d 74 68 72 65 61  otk normal-threa
0430: 64 65 64 2d 6e 6f 74 6b 20 6e 6f 72 6d 61 6c 2d  ded-notk normal-
0440: 74 68 72 65 61 64 65 64 2d 7a 69 70 2d 6e 6f 74  threaded-zip-not
0450: 6b 20 6e 6f 72 6d 61 6c 2d 6e 6f 6d 6b 34 20 6d  k normal-nomk4 m
0460: 69 6e 20 6d 69 6e 2d 73 74 61 74 69 63 20 6e 6f  in min-static no
0470: 72 6d 61 6c 2d 6b 69 74 64 6c 6c 20 6e 6f 72 6d  rmal-kitdll norm
0480: 61 6c 2d 74 68 72 65 61 64 65 64 2d 6b 69 74 64  al-threaded-kitd
0490: 6c 6c 20 6e 6f 72 6d 61 6c 2d 6e 6f 74 6b 2d 6b  ll normal-notk-k
04a0: 69 74 64 6c 6c 20 6e 6f 72 6d 61 6c 2d 6e 6f 6d  itdll normal-nom
04b0: 6b 34 2d 6b 69 74 64 6c 6c 20 6e 6f 72 6d 61 6c  k4-kitdll normal
04c0: 2d 6e 6f 6d 6b 34 2d 6e 6f 74 6b 2d 6b 69 74 64  -nomk4-notk-kitd
04d0: 6c 6c 20 6e 6f 72 6d 61 6c 2d 74 68 72 65 61 64  ll normal-thread
04e0: 65 64 2d 6e 6f 6d 6b 34 2d 6b 69 74 64 6c 6c 20  ed-nomk4-kitdll 
04f0: 6e 6f 72 6d 61 6c 2d 74 68 72 65 61 64 65 64 2d  normal-threaded-
0500: 6e 6f 74 6b 2d 6e 6f 6d 6b 34 2d 6b 69 74 64 6c  notk-nomk4-kitdl
0510: 6c 20 6d 69 6e 2d 6b 69 74 64 6c 6c 20 77 69 6e  l min-kitdll win
0520: 33 32 2d 69 35 38 36 20 77 69 6e 33 32 2d 69 35  32-i586 win32-i5
0530: 38 36 2d 7a 69 70 20 77 69 6e 33 32 2d 69 35 38  86-zip win32-i58
0540: 36 2d 74 68 72 65 61 64 65 64 20 77 69 6e 33 32  6-threaded win32
0550: 2d 69 35 38 36 2d 74 68 72 65 61 64 65 64 2d 7a  -i586-threaded-z
0560: 69 70 20 77 69 6e 33 32 2d 69 35 38 36 2d 6e 6f  ip win32-i586-no
0570: 74 6b 20 77 69 6e 33 32 2d 69 35 38 36 2d 74 68  tk win32-i586-th
0580: 72 65 61 64 65 64 2d 6e 6f 74 6b 20 77 69 6e 33  readed-notk win3
0590: 32 2d 69 35 38 36 2d 6e 6f 6d 6b 34 20 77 69 6e  2-i586-nomk4 win
05a0: 33 32 2d 69 35 38 36 2d 6b 69 74 64 6c 6c 20 77  32-i586-kitdll w
05b0: 69 6e 33 32 2d 69 35 38 36 2d 74 68 72 65 61 64  in32-i586-thread
05c0: 65 64 2d 6b 69 74 64 6c 6c 20 77 69 6e 33 32 2d  ed-kitdll win32-
05d0: 69 35 38 36 2d 6e 6f 74 6b 2d 6b 69 74 64 6c 6c  i586-notk-kitdll
05e0: 20 77 69 6e 33 32 2d 69 35 38 36 2d 6e 6f 6d 6b   win32-i586-nomk
05f0: 34 2d 6b 69 74 64 6c 6c 20 77 69 6e 33 32 2d 69  4-kitdll win32-i
0600: 35 38 36 2d 6e 6f 6d 6b 34 2d 6e 6f 74 6b 2d 6b  586-nomk4-notk-k
0610: 69 74 64 6c 6c 20 77 69 6e 33 32 2d 69 35 38 36  itdll win32-i586
0620: 2d 74 68 72 65 61 64 65 64 2d 6e 6f 6d 6b 34 2d  -threaded-nomk4-
0630: 6b 69 74 64 6c 6c 20 77 69 6e 33 32 2d 69 35 38  kitdll win32-i58
0640: 36 2d 74 68 72 65 61 64 65 64 2d 6e 6f 74 6b 2d  6-threaded-notk-
0650: 6e 6f 6d 6b 34 2d 6b 69 74 64 6c 6c 20 6c 69 6e  nomk4-kitdll lin
0660: 75 78 2d 6d 69 70 73 65 6c 2d 6d 69 6e 20 6c 69  ux-mipsel-min li
0670: 6e 75 78 2d 6d 69 70 73 65 6c 2d 6d 69 6e 2d 6b  nux-mipsel-min-k
0680: 69 74 64 6c 6c 20 6c 69 6e 75 78 2d 61 6d 64 36  itdll linux-amd6
0690: 34 2d 6e 6f 74 6b 20 6c 69 6e 75 78 2d 61 6d 64  4-notk linux-amd
06a0: 36 34 2d 6e 6f 74 6b 2d 6b 69 74 64 6c 6c 3b 20  64-notk-kitdll; 
06b0: 64 6f 0a 09 6b 69 74 63 72 65 61 74 6f 72 3d 22  do..kitcreator="
06c0: 2e 2f 6b 69 74 63 72 65 61 74 6f 72 22 0a 09 61  ./kitcreator"..a
06d0: 72 67 73 3d 22 22 0a 09 72 75 6e 6e 61 62 6c 65  rgs=""..runnable
06e0: 3d 22 31 22 0a 09 69 73 7a 69 70 3d 22 30 22 0a  ="1"..iszip="0".
06f0: 09 73 74 61 74 69 63 74 6b 3d 22 30 22 0a 09 6e  .statictk="0"..n
0700: 6f 74 6b 3d 22 30 22 0a 09 6e 6f 6d 6b 34 3d 22  otk="0"..nomk4="
0710: 30 22 0a 09 78 63 6f 6d 70 69 6c 65 3d 22 30 22  0"..xcompile="0"
0720: 0a 09 6b 69 74 64 6c 6c 3d 22 30 22 0a 09 6b 69  ..kitdll="0"..ki
0730: 74 72 75 6e 63 6d 64 3d 22 22 0a 0a 09 23 20 48  truncmd=""...# H
0740: 61 6e 64 6c 65 20 62 61 73 65 20 63 6f 6e 66 69  andle base confi
0750: 67 75 72 61 74 69 6f 6e 0a 09 6f 73 3d 22 24 28  guration..os="$(
0760: 75 6e 61 6d 65 20 2d 73 20 7c 20 64 64 20 63 6f  uname -s | dd co
0770: 6e 76 3d 6c 63 61 73 65 20 32 3e 2f 64 65 76 2f  nv=lcase 2>/dev/
0780: 6e 75 6c 6c 29 22 0a 09 63 70 75 3d 22 24 28 75  null)"..cpu="$(u
0790: 6e 61 6d 65 20 2d 6d 20 7c 20 64 64 20 63 6f 6e  name -m | dd con
07a0: 76 3d 6c 63 61 73 65 20 32 3e 2f 64 65 76 2f 6e  v=lcase 2>/dev/n
07b0: 75 6c 6c 29 22 0a 09 63 61 73 65 20 22 24 7b 6b  ull)"..case "${k
07c0: 69 74 7d 22 20 69 6e 0a 09 09 6e 6f 72 6d 61 6c  it}" in...normal
07d0: 7c 6e 6f 72 6d 61 6c 2d 2a 29 0a 09 09 09 6b 69  |normal-*)....ki
07e0: 74 3d 22 24 28 65 63 68 6f 20 22 24 7b 6b 69 74  t="$(echo "${kit
07f0: 7d 22 20 7c 20 73 65 64 20 22 73 40 5e 6e 6f 72  }" | sed "s@^nor
0800: 6d 61 6c 40 24 6f 73 2d 24 63 70 75 40 22 29 22  mal@$os-$cpu@")"
0810: 0a 09 09 09 3b 3b 0a 09 09 6d 69 6e 7c 6d 69 6e  ....;;...min|min
0820: 2d 6b 69 74 64 6c 6c 29 0a 09 09 09 6b 69 74 63  -kitdll)....kitc
0830: 72 65 61 74 6f 72 3d 22 2e 2f 62 75 69 6c 64 2f  reator="./build/
0840: 6d 61 6b 65 2d 6d 69 6e 6b 69 74 22 0a 09 09 09  make-minkit"....
0850: 69 73 7a 69 70 3d 22 31 22 0a 09 09 09 6e 6f 74  iszip="1"....not
0860: 6b 3d 22 31 22 0a 09 09 09 6b 69 74 3d 22 24 28  k="1"....kit="$(
0870: 65 63 68 6f 20 22 24 7b 6b 69 74 7d 22 20 7c 20  echo "${kit}" | 
0880: 73 65 64 20 22 73 40 5e 6d 69 6e 40 24 6f 73 2d  sed "s@^min@$os-
0890: 24 63 70 75 2d 6d 69 6e 40 22 29 22 0a 09 09 09  $cpu-min@")"....
08a0: 3b 3b 0a 09 09 6d 69 6e 2d 73 74 61 74 69 63 29  ;;...min-static)
08b0: 0a 09 09 09 6b 69 74 63 72 65 61 74 6f 72 3d 22  ....kitcreator="
08c0: 2e 2f 62 75 69 6c 64 2f 6d 61 6b 65 2d 6d 69 6e  ./build/make-min
08d0: 6b 69 74 2d 73 74 61 74 69 63 22 0a 09 09 09 69  kit-static"....i
08e0: 73 7a 69 70 3d 22 31 22 0a 09 09 09 6e 6f 74 6b  szip="1"....notk
08f0: 3d 22 31 22 0a 09 09 09 6b 69 74 3d 22 24 7b 6f  ="1"....kit="${o
0900: 73 7d 2d 24 7b 63 70 75 7d 2d 6d 69 6e 2d 73 74  s}-${cpu}-min-st
0910: 61 74 69 63 22 0a 09 09 09 3b 3b 0a 09 09 77 69  atic"....;;...wi
0920: 6e 33 32 7c 77 69 6e 33 32 2d 2a 29 0a 09 09 09  n32|win32-*)....
0930: 6b 69 74 63 72 65 61 74 6f 72 3d 22 2e 2f 62 75  kitcreator="./bu
0940: 69 6c 64 2f 6d 61 6b 65 2d 6b 69 74 2d 77 69 6e  ild/make-kit-win
0950: 33 32 22 0a 09 09 09 78 63 6f 6d 70 69 6c 65 3d  32"....xcompile=
0960: 22 31 22 0a 09 09 09 6b 69 74 72 75 6e 63 6d 64  "1"....kitruncmd
0970: 3d 22 77 69 6e 65 22 0a 09 09 09 3b 3b 0a 09 09  ="wine"....;;...
0980: 6c 69 6e 75 78 2d 6d 69 70 73 65 6c 2d 6d 69 6e  linux-mipsel-min
0990: 7c 6c 69 6e 75 78 2d 6d 69 70 73 65 6c 2d 6d 69  |linux-mipsel-mi
09a0: 6e 2d 6b 69 74 64 6c 6c 29 0a 09 09 09 6b 69 74  n-kitdll)....kit
09b0: 63 72 65 61 74 6f 72 3d 22 2e 2f 62 75 69 6c 64  creator="./build
09c0: 2f 6d 61 6b 65 2d 6b 69 74 2d 6d 69 70 73 65 6c  /make-kit-mipsel
09d0: 22 0a 09 09 09 72 75 6e 6e 61 62 6c 65 3d 22 30  "....runnable="0
09e0: 22 0a 09 09 09 78 63 6f 6d 70 69 6c 65 3d 22 31  "....xcompile="1
09f0: 22 0a 09 09 09 6e 6f 74 6b 3d 22 31 22 0a 09 09  "....notk="1"...
0a00: 09 69 73 7a 69 70 3d 22 31 22 0a 09 09 09 3b 3b  .iszip="1"....;;
0a10: 0a 09 09 6c 69 6e 75 78 2d 61 6d 64 36 34 7c 6c  ...linux-amd64|l
0a20: 69 6e 75 78 2d 61 6d 64 36 34 2d 2a 29 0a 09 09  inux-amd64-*)...
0a30: 09 6b 69 74 63 72 65 61 74 6f 72 3d 22 2e 2f 62  .kitcreator="./b
0a40: 75 69 6c 64 2f 6d 61 6b 65 2d 6b 69 74 2d 6c 69  uild/make-kit-li
0a50: 6e 75 78 2d 61 6d 64 36 34 22 0a 09 09 09 72 75  nux-amd64"....ru
0a60: 6e 6e 61 62 6c 65 3d 22 30 22 0a 09 09 09 78 63  nnable="0"....xc
0a70: 6f 6d 70 69 6c 65 3d 22 31 22 0a 09 09 09 69 73  ompile="1"....is
0a80: 7a 69 70 3d 22 30 22 0a 09 09 09 3b 3b 0a 09 65  zip="0"....;;..e
0a90: 73 61 63 0a 0a 09 69 66 20 5b 20 22 24 7b 78 63  sac...if [ "${xc
0aa0: 6f 6d 70 69 6c 65 7d 22 20 21 3d 20 22 30 22 20  ompile}" != "0" 
0ab0: 5d 3b 20 74 68 65 6e 0a 09 09 6b 69 74 3d 22 24  ]; then...kit="$
0ac0: 7b 6b 69 74 7d 2d 78 63 6f 6d 70 69 6c 65 22 0a  {kit}-xcompile".
0ad0: 09 66 69 0a 0a 09 23 20 48 61 6e 64 6c 65 20 61  .fi...# Handle a
0ae0: 64 64 69 74 69 6f 6e 61 6c 20 63 6f 6e 66 69 67  dditional config
0af0: 75 72 61 74 69 6f 6e 0a 09 74 65 6d 70 6b 69 74  uration..tempkit
0b00: 3d 22 2d 24 7b 6b 69 74 7d 2d 22 0a 09 66 6f 72  ="-${kit}-"..for
0b10: 20 74 72 79 20 69 6e 20 31 20 32 20 33 20 34 20   try in 1 2 3 4 
0b20: 35 20 36 20 37 20 38 20 39 3b 20 64 6f 0a 09 09  5 6 7 8 9; do...
0b30: 63 61 73 65 20 22 2d 24 7b 74 65 6d 70 6b 69 74  case "-${tempkit
0b40: 7d 2d 22 20 69 6e 0a 09 09 09 2a 2d 74 68 72 65  }-" in....*-thre
0b50: 61 64 65 64 2d 2a 29 0a 09 09 09 09 74 65 6d 70  aded-*).....temp
0b60: 6b 69 74 3d 22 24 28 65 63 68 6f 20 22 24 7b 74  kit="$(echo "${t
0b70: 65 6d 70 6b 69 74 7d 22 20 7c 20 73 65 64 20 27  empkit}" | sed '
0b80: 73 40 2d 74 68 72 65 61 64 65 64 2d 40 2d 40 27  s@-threaded-@-@'
0b90: 29 22 0a 09 09 09 09 61 72 67 73 3d 22 24 7b 61  )".....args="${a
0ba0: 72 67 73 7d 20 2d 2d 65 6e 61 62 6c 65 2d 74 68  rgs} --enable-th
0bb0: 72 65 61 64 73 22 0a 09 09 09 09 3b 3b 0a 09 09  reads".....;;...
0bc0: 09 2a 2d 7a 69 70 2d 2a 29 0a 09 09 09 09 74 65  .*-zip-*).....te
0bd0: 6d 70 6b 69 74 3d 22 24 28 65 63 68 6f 20 22 24  mpkit="$(echo "$
0be0: 7b 74 65 6d 70 6b 69 74 7d 22 20 7c 20 73 65 64  {tempkit}" | sed
0bf0: 20 27 73 40 2d 7a 69 70 2d 40 2d 40 27 29 22 0a   's@-zip-@-@')".
0c00: 09 09 09 09 61 72 67 73 3d 22 24 7b 61 72 67 73  ....args="${args
0c10: 7d 20 2d 2d 65 6e 61 62 6c 65 2d 6b 69 74 2d 73  } --enable-kit-s
0c20: 74 6f 72 61 67 65 3d 7a 69 70 22 0a 09 09 09 09  torage=zip".....
0c30: 69 73 7a 69 70 3d 22 31 22 0a 09 09 09 09 3b 3b  iszip="1".....;;
0c40: 0a 09 09 09 2a 2d 73 74 61 74 69 63 74 6b 2d 2a  ....*-statictk-*
0c50: 29 0a 09 09 09 09 74 65 6d 70 6b 69 74 3d 22 24  ).....tempkit="$
0c60: 28 65 63 68 6f 20 22 24 7b 74 65 6d 70 6b 69 74  (echo "${tempkit
0c70: 7d 22 20 7c 20 73 65 64 20 27 73 40 2d 73 74 61  }" | sed 's@-sta
0c80: 74 69 63 74 6b 2d 40 2d 40 27 29 22 0a 09 09 09  tictk-@-@')"....
0c90: 09 69 66 20 5b 20 22 24 7b 6e 6f 74 6b 7d 22 20  .if [ "${notk}" 
0ca0: 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 09 09  = "0" ]; then...
0cb0: 09 09 09 73 74 61 74 69 63 74 6b 3d 22 31 22 0a  ...statictk="1".
0cc0: 09 09 09 09 65 6c 73 65 0a 09 09 09 09 09 65 63  ....else......ec
0cd0: 68 6f 20 22 24 7b 6b 69 74 7d 3a 20 55 6e 61 62  ho "${kit}: Unab
0ce0: 6c 65 20 74 6f 20 63 72 65 61 74 65 20 53 74 61  le to create Sta
0cf0: 74 69 63 54 6b 20 61 6e 64 20 4e 6f 54 6b 2c 20  ticTk and NoTk, 
0d00: 69 67 6e 6f 72 69 6e 67 20 53 74 61 74 69 63 54  ignoring StaticT
0d10: 6b 22 20 3e 26 32 0a 09 09 09 09 66 69 0a 09 09  k" >&2.....fi...
0d20: 09 09 3b 3b 0a 09 09 09 2a 2d 6e 6f 74 6b 2d 2a  ..;;....*-notk-*
0d30: 29 0a 09 09 09 09 74 65 6d 70 6b 69 74 3d 22 24  ).....tempkit="$
0d40: 28 65 63 68 6f 20 22 24 7b 74 65 6d 70 6b 69 74  (echo "${tempkit
0d50: 7d 22 20 7c 20 73 65 64 20 27 73 40 2d 6e 6f 74  }" | sed 's@-not
0d60: 6b 2d 40 2d 40 27 29 22 0a 09 09 09 09 69 66 20  k-@-@')".....if 
0d70: 5b 20 22 24 7b 73 74 61 74 69 63 74 6b 7d 22 20  [ "${statictk}" 
0d80: 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 09 09  = "0" ]; then...
0d90: 09 09 09 6e 6f 74 6b 3d 22 31 22 0a 09 09 09 09  ...notk="1".....
0da0: 65 6c 73 65 0a 09 09 09 09 09 65 63 68 6f 20 22  else......echo "
0db0: 24 7b 6b 69 74 7d 3a 20 55 6e 61 62 6c 65 20 74  ${kit}: Unable t
0dc0: 6f 20 63 72 65 61 74 65 20 53 74 61 74 69 63 54  o create StaticT
0dd0: 6b 20 61 6e 64 20 4e 6f 54 6b 2c 20 69 67 6e 6f  k and NoTk, igno
0de0: 72 69 6e 67 20 4e 6f 54 6b 22 20 3e 26 32 0a 09  ring NoTk" >&2..
0df0: 09 09 09 66 69 0a 09 09 09 09 3b 3b 0a 09 09 09  ...fi.....;;....
0e00: 2a 2d 6e 6f 6d 6b 34 2d 2a 29 0a 09 09 09 09 74  *-nomk4-*).....t
0e10: 65 6d 70 6b 69 74 3d 22 24 28 65 63 68 6f 20 22  empkit="$(echo "
0e20: 24 7b 74 65 6d 70 6b 69 74 7d 22 20 7c 20 73 65  ${tempkit}" | se
0e30: 64 20 27 73 40 2d 6e 6f 6d 6b 34 2d 40 2d 40 27  d 's@-nomk4-@-@'
0e40: 29 22 0a 09 09 09 09 6e 6f 6d 6b 34 3d 22 31 22  )".....nomk4="1"
0e50: 0a 09 09 09 09 69 73 7a 69 70 3d 22 31 22 0a 09  .....iszip="1"..
0e60: 09 09 09 3b 3b 0a 09 09 09 2a 2d 6b 69 74 64 6c  ...;;....*-kitdl
0e70: 6c 2d 2a 29 0a 09 09 09 09 6b 69 74 64 6c 6c 3d  l-*).....kitdll=
0e80: 22 31 22 0a 09 09 09 09 3b 3b 0a 09 09 65 73 61  "1".....;;...esa
0e90: 63 0a 09 64 6f 6e 65 0a 0a 09 69 66 20 5b 20 22  c..done...if [ "
0ea0: 24 7b 6b 69 74 64 6c 6c 7d 22 20 3d 20 22 31 22  ${kitdll}" = "1"
0eb0: 20 5d 3b 20 74 68 65 6e 0a 09 09 23 20 43 75 72   ]; then...# Cur
0ec0: 72 65 6e 74 6c 79 20 6e 6f 20 4b 69 74 44 4c 4c  rently no KitDLL
0ed0: 20 75 73 65 73 20 5a 69 70 0a 09 09 69 73 7a 69   uses Zip...iszi
0ee0: 70 3d 22 30 22 0a 09 66 69 0a 0a 09 66 6f 72 20  p="0"..fi...for 
0ef0: 76 65 72 73 69 6f 6e 20 69 6e 20 24 7b 56 45 52  version in ${VER
0f00: 53 49 4f 4e 53 7d 3b 20 64 6f 0a 09 09 23 20 57  SIONS}; do...# W
0f10: 6f 72 6b 20 61 72 6f 75 6e 64 20 63 68 61 6e 67  ork around chang
0f20: 65 73 20 69 6e 20 64 65 66 61 75 6c 74 20 62 65  es in default be
0f30: 68 61 76 69 6f 75 72 0a 09 09 69 66 20 5b 20 22  haviour...if [ "
0f40: 24 7b 76 65 72 73 69 6f 6e 7d 22 20 3d 20 22 63  ${version}" = "c
0f50: 76 73 5f 48 45 41 44 22 20 5d 3b 20 74 68 65 6e  vs_HEAD" ]; then
0f60: 0a 09 09 09 6b 69 74 3d 22 24 28 65 63 68 6f 20  ....kit="$(echo 
0f70: 22 24 7b 6b 69 74 7d 22 20 7c 20 73 65 64 20 27  "${kit}" | sed '
0f80: 73 40 2d 74 68 72 65 61 64 65 64 40 2d 75 6e 74  s@-threaded@-unt
0f90: 68 72 65 61 64 65 64 40 27 29 22 0a 09 09 09 61  hreaded@')"....a
0fa0: 72 67 73 3d 22 24 28 65 63 68 6f 20 22 24 7b 61  rgs="$(echo "${a
0fb0: 72 67 73 7d 22 20 7c 20 73 65 64 20 27 73 40 20  rgs}" | sed 's@ 
0fc0: 2d 2d 65 6e 61 62 6c 65 2d 74 68 72 65 61 64 73  --enable-threads
0fd0: 40 20 2d 2d 64 69 73 61 62 6c 65 2d 74 68 72 65  @ --disable-thre
0fe0: 61 64 73 40 27 29 22 0a 09 09 66 69 0a 0a 09 09  ads@')"...fi....
0ff0: 23 20 43 72 65 61 74 65 20 54 63 6c 6b 69 74 0a  # Create Tclkit.
1000: 09 09 69 66 20 5b 20 22 24 7b 6b 69 74 64 6c 6c  ..if [ "${kitdll
1010: 7d 22 20 3d 20 22 31 22 20 5d 3b 20 74 68 65 6e  }" = "1" ]; then
1020: 0a 09 09 09 63 72 65 61 74 65 64 6b 69 74 3d 22  ....createdkit="
1030: 6c 69 62 74 63 6c 6b 69 74 2a 2e 64 6c 6c 20 6c  libtclkit*.dll l
1040: 69 62 74 63 6c 6b 69 74 2a 2e 2a 22 0a 09 09 09  ibtclkit*.*"....
1050: 6f 75 74 70 75 74 6e 61 6d 65 3d 22 24 7b 54 45  outputname="${TE
1060: 53 54 44 49 52 7d 2f 6b 69 74 73 2f 6c 69 62 74  STDIR}/kits/libt
1070: 63 6c 6b 69 74 2d 24 7b 76 65 72 73 69 6f 6e 7d  clkit-${version}
1080: 2d 24 7b 6b 69 74 7d 22 0a 09 09 09 66 61 69 6c  -${kit}"....fail
1090: 6f 75 74 70 75 74 6e 61 6d 65 3d 22 24 7b 54 45  outputname="${TE
10a0: 53 54 44 49 52 7d 2f 6b 69 74 73 2f 66 61 69 6c  STDIR}/kits/fail
10b0: 65 64 2f 6c 69 62 74 63 6c 6b 69 74 2d 24 7b 76  ed/libtclkit-${v
10c0: 65 72 73 69 6f 6e 7d 2d 24 7b 6b 69 74 7d 22 0a  ersion}-${kit}".
10d0: 09 09 65 6c 73 65 0a 09 09 09 63 72 65 61 74 65  ..else....create
10e0: 64 6b 69 74 3d 22 74 63 6c 6b 69 74 2d 24 7b 76  dkit="tclkit-${v
10f0: 65 72 73 69 6f 6e 7d 22 0a 09 09 09 6f 75 74 70  ersion}"....outp
1100: 75 74 6e 61 6d 65 3d 22 24 7b 54 45 53 54 44 49  utname="${TESTDI
1110: 52 7d 2f 6b 69 74 73 2f 74 63 6c 6b 69 74 2d 24  R}/kits/tclkit-$
1120: 7b 76 65 72 73 69 6f 6e 7d 2d 24 7b 6b 69 74 7d  {version}-${kit}
1130: 22 0a 09 09 09 66 61 69 6c 6f 75 74 70 75 74 6e  "....failoutputn
1140: 61 6d 65 3d 22 24 7b 54 45 53 54 44 49 52 7d 2f  ame="${TESTDIR}/
1150: 6b 69 74 73 2f 66 61 69 6c 65 64 2f 74 63 6c 6b  kits/failed/tclk
1160: 69 74 2d 24 7b 76 65 72 73 69 6f 6e 7d 2d 24 7b  it-${version}-${
1170: 6b 69 74 7d 22 0a 09 09 66 69 0a 09 09 62 75 69  kit}"...fi...bui
1180: 6c 64 6c 6f 67 3d 22 24 7b 6f 75 74 70 75 74 6e  ldlog="${outputn
1190: 61 6d 65 7d 2d 62 75 69 6c 64 2e 6c 6f 67 22 0a  ame}-build.log".
11a0: 09 09 66 61 69 6c 62 75 69 6c 64 6c 6f 67 3d 22  ..failbuildlog="
11b0: 24 7b 66 61 69 6c 6f 75 74 70 75 74 6e 61 6d 65  ${failoutputname
11c0: 7d 2d 62 75 69 6c 64 2e 6c 6f 67 22 0a 09 09 74  }-build.log"...t
11d0: 65 73 74 72 65 73 75 6c 74 73 6c 6f 67 3d 22 24  estresultslog="$
11e0: 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 2d 74 65 73  {outputname}-tes
11f0: 74 73 2e 6c 6f 67 22 0a 0a 09 09 69 66 20 5b 20  ts.log"....if [ 
1200: 21 20 2d 66 20 22 24 7b 6f 75 74 70 75 74 6e 61  ! -f "${outputna
1210: 6d 65 7d 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09  me}" ]; then....
1220: 75 6e 73 65 74 20 4b 49 54 43 52 45 41 54 4f 52  unset KITCREATOR
1230: 5f 50 4b 47 53 20 53 54 41 54 49 43 54 4b 0a 0a  _PKGS STATICTK..
1240: 09 09 09 69 66 20 5b 20 2d 66 20 22 24 7b 66 61  ...if [ -f "${fa
1250: 69 6c 6f 75 74 70 75 74 6e 61 6d 65 7d 22 20 5d  iloutputname}" ]
1260: 3b 20 74 68 65 6e 0a 09 09 09 09 65 63 68 6f 20  ; then.....echo 
1270: 22 53 6b 69 70 70 69 6e 67 20 72 65 62 75 69 6c  "Skipping rebuil
1280: 64 69 6e 67 20 66 61 69 6c 65 64 20 6b 69 74 20  ding failed kit 
1290: 24 7b 76 65 72 73 69 6f 6e 7d 2f 24 7b 6b 69 74  ${version}/${kit
12a0: 7d 20 2e 2e 2e 22 0a 0a 09 09 09 09 66 61 69 6c  } ..."......fail
12b0: 65 64 3d 22 24 7b 66 61 69 6c 65 64 7d 20 24 7b  ed="${failed} ${
12c0: 76 65 72 73 69 6f 6e 7d 2f 24 7b 6b 69 74 7d 2d  version}/${kit}-
12d0: 62 75 69 6c 64 22 0a 0a 09 09 09 09 63 6f 6e 74  build"......cont
12e0: 69 6e 75 65 0a 09 09 09 66 69 0a 0a 09 09 09 72  inue....fi.....r
12f0: 6d 20 2d 66 20 74 63 6c 73 68 0a 09 09 09 2e 2f  m -f tclsh...../
1300: 6b 69 74 63 72 65 61 74 6f 72 20 63 6c 65 61 6e  kitcreator clean
1310: 20 3e 2f 64 65 76 2f 6e 75 6c 6c 20 32 3e 2f 64   >/dev/null 2>/d
1320: 65 76 2f 6e 75 6c 6c 0a 0a 09 09 09 65 63 68 6f  ev/null.....echo
1330: 20 22 43 72 65 61 74 69 6e 67 20 54 63 6c 6b 69   "Creating Tclki
1340: 74 20 24 7b 76 65 72 73 69 6f 6e 7d 2f 24 7b 6b  t ${version}/${k
1350: 69 74 7d 2e 2e 2e 22 0a 09 09 09 65 63 68 6f 20  it}..."....echo 
1360: 22 20 2a 2a 2a 20 42 75 69 6c 64 20 73 74 61 72  " *** Build star
1370: 74 65 64 20 24 28 77 68 6f 61 6d 69 29 40 24 28  ted $(whoami)@$(
1380: 68 6f 73 74 6e 61 6d 65 29 20 6f 6e 20 24 28 64  hostname) on $(d
1390: 61 74 65 29 22 20 3e 20 22 24 7b 62 75 69 6c 64  ate)" > "${build
13a0: 6c 6f 67 7d 22 0a 09 09 09 65 63 68 6f 20 27 27  log}"....echo ''
13b0: 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d   >> "${buildlog}
13c0: 22 0a 09 09 09 65 63 68 6f 20 22 20 2a 2a 2a 20  "....echo " *** 
13d0: 42 75 69 6c 64 20 53 63 72 69 70 74 22 20 3e 3e  Build Script" >>
13e0: 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 0a   "${buildlog}"..
13f0: 09 09 09 69 66 20 5b 20 22 24 7b 6e 6f 74 6b 7d  ...if [ "${notk}
1400: 22 20 3d 20 22 31 22 20 5d 3b 20 74 68 65 6e 0a  " = "1" ]; then.
1410: 09 09 09 09 4b 49 54 43 52 45 41 54 4f 52 5f 50  ....KITCREATOR_P
1420: 4b 47 53 3d 27 69 74 63 6c 20 6d 6b 34 74 63 6c  KGS='itcl mk4tcl
1430: 27 0a 09 09 09 66 69 0a 0a 09 09 09 69 66 20 5b  '....fi.....if [
1440: 20 22 24 7b 6e 6f 6d 6b 34 7d 22 20 3d 20 22 31   "${nomk4}" = "1
1450: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09 69 66  " ]; then.....if
1460: 20 5b 20 2d 7a 20 22 24 7b 4b 49 54 43 52 45 41   [ -z "${KITCREA
1470: 54 4f 52 5f 50 4b 47 53 7d 22 20 5d 3b 20 74 68  TOR_PKGS}" ]; th
1480: 65 6e 0a 09 09 09 09 09 4b 49 54 43 52 45 41 54  en......KITCREAT
1490: 4f 52 5f 50 4b 47 53 3d 27 69 74 63 6c 20 74 6b  OR_PKGS='itcl tk
14a0: 27 0a 09 09 09 09 65 6c 73 65 0a 09 09 09 09 09  '.....else......
14b0: 4b 49 54 43 52 45 41 54 4f 52 5f 50 4b 47 53 3d  KITCREATOR_PKGS=
14c0: 22 24 28 65 63 68 6f 20 22 24 7b 4b 49 54 43 52  "$(echo "${KITCR
14d0: 45 41 54 4f 52 5f 50 4b 47 53 7d 22 20 7c 20 73  EATOR_PKGS}" | s
14e0: 65 64 20 27 73 40 6d 6b 34 74 63 6c 40 40 27 29  ed 's@mk4tcl@@')
14f0: 22 0a 09 09 09 09 66 69 0a 09 09 09 66 69 0a 0a  ".....fi....fi..
1500: 09 09 09 69 66 20 5b 20 22 24 7b 6b 69 74 64 6c  ...if [ "${kitdl
1510: 6c 7d 22 20 3d 20 22 31 22 20 5d 3b 20 74 68 65  l}" = "1" ]; the
1520: 6e 0a 09 09 09 09 69 66 20 5b 20 2d 7a 20 22 24  n.....if [ -z "$
1530: 7b 4b 49 54 43 52 45 41 54 4f 52 5f 50 4b 47 53  {KITCREATOR_PKGS
1540: 7d 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09 09  }" ]; then......
1550: 4b 49 54 43 52 45 41 54 4f 52 5f 50 4b 47 53 3d  KITCREATOR_PKGS=
1560: 27 74 6b 20 69 74 63 6c 20 6d 6b 34 74 63 6c 20  'tk itcl mk4tcl 
1570: 6b 69 74 64 6c 6c 27 0a 09 09 09 09 65 6c 73 65  kitdll'.....else
1580: 0a 09 09 09 09 09 4b 49 54 43 52 45 41 54 4f 52  ......KITCREATOR
1590: 5f 50 4b 47 53 3d 22 24 7b 4b 49 54 43 52 45 41  _PKGS="${KITCREA
15a0: 54 4f 52 5f 50 4b 47 53 7d 20 6b 69 74 64 6c 6c  TOR_PKGS} kitdll
15b0: 22 0a 09 09 09 09 66 69 0a 09 09 09 66 69 0a 0a  ".....fi....fi..
15c0: 09 09 09 65 78 70 6f 72 74 20 4b 49 54 43 52 45  ...export KITCRE
15d0: 41 54 4f 52 5f 50 4b 47 53 0a 0a 09 09 09 69 66  ATOR_PKGS.....if
15e0: 20 5b 20 2d 6e 20 22 24 7b 4b 49 54 43 52 45 41   [ -n "${KITCREA
15f0: 54 4f 52 5f 50 4b 47 53 7d 22 20 5d 3b 20 74 68  TOR_PKGS}" ]; th
1600: 65 6e 0a 09 09 09 09 65 63 68 6f 20 22 20 20 4b  en.....echo "  K
1610: 49 54 43 52 45 41 54 4f 52 5f 50 4b 47 53 3d 5c  ITCREATOR_PKGS=\
1620: 22 24 7b 4b 49 54 43 52 45 41 54 4f 52 5f 50 4b  "${KITCREATOR_PK
1630: 47 53 7d 5c 22 22 20 3e 3e 20 22 24 7b 62 75 69  GS}\"" >> "${bui
1640: 6c 64 6c 6f 67 7d 22 0a 09 09 09 09 65 63 68 6f  ldlog}".....echo
1650: 20 22 20 20 65 78 70 6f 72 74 20 4b 49 54 43 52   "  export KITCR
1660: 45 41 54 4f 52 5f 50 4b 47 53 22 20 3e 3e 20 22  EATOR_PKGS" >> "
1670: 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 09 09 09  ${buildlog}"....
1680: 66 69 0a 0a 09 09 09 69 66 20 5b 20 22 24 7b 73  fi.....if [ "${s
1690: 74 61 74 69 63 74 6b 7d 22 20 3d 20 22 31 22 20  tatictk}" = "1" 
16a0: 5d 3b 20 74 68 65 6e 0a 09 09 09 09 53 54 41 54  ]; then.....STAT
16b0: 49 43 54 4b 3d 22 31 22 0a 09 09 09 09 65 78 70  ICTK="1".....exp
16c0: 6f 72 74 20 53 54 41 54 49 43 54 4b 0a 0a 09 09  ort STATICTK....
16d0: 09 09 65 63 68 6f 20 22 20 20 53 54 41 54 49 43  ..echo "  STATIC
16e0: 54 4b 3d 5c 22 24 7b 53 54 41 54 49 43 54 4b 7d  TK=\"${STATICTK}
16f0: 5c 22 22 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c  \"" >> "${buildl
1700: 6f 67 7d 22 0a 09 09 09 09 65 63 68 6f 20 22 20  og}".....echo " 
1710: 20 65 78 70 6f 72 74 20 53 54 41 54 49 43 54 4b   export STATICTK
1720: 22 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67  " >> "${buildlog
1730: 7d 22 0a 09 09 09 66 69 0a 0a 09 09 09 69 66 20  }"....fi.....if 
1740: 5b 20 22 24 7b 6b 69 74 63 72 65 61 74 6f 72 7d  [ "${kitcreator}
1750: 22 20 21 3d 20 22 2e 2f 6b 69 74 63 72 65 61 74  " != "./kitcreat
1760: 6f 72 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09  or" ]; then.....
1770: 65 63 68 6f 20 22 20 20 6d 6b 64 69 72 20 62 75  echo "  mkdir bu
1780: 69 6c 64 22 20 3e 3e 20 22 24 7b 62 75 69 6c 64  ild" >> "${build
1790: 6c 6f 67 7d 22 0a 0a 09 09 09 09 23 20 53 65 76  log}"......# Sev
17a0: 65 72 61 6c 20 62 75 69 6c 64 20 73 63 72 69 70  eral build scrip
17b0: 74 73 20 72 65 6c 79 20 6f 6e 20 6d 69 6e 6b 69  ts rely on minki
17c0: 74 20 74 6f 20 77 6f 72 6b 0a 09 09 09 09 69 66  t to work.....if
17d0: 20 67 72 65 70 20 27 2e 2f 62 75 69 6c 64 2f 6d   grep './build/m
17e0: 61 6b 65 2d 6d 69 6e 6b 69 74 27 20 22 24 7b 6b  ake-minkit' "${k
17f0: 69 74 63 72 65 61 74 6f 72 7d 22 20 3e 2f 64 65  itcreator}" >/de
1800: 76 2f 6e 75 6c 6c 20 32 3e 2f 64 65 76 2f 6e 75  v/null 2>/dev/nu
1810: 6c 6c 3b 20 74 68 65 6e 0a 09 09 09 09 09 65 63  ll; then......ec
1820: 68 6f 20 22 20 20 63 61 74 20 3c 3c 20 5c 5f 5f  ho "  cat << \__
1830: 45 4f 46 5f 5f 20 3e 20 2e 2f 62 75 69 6c 64 2f  EOF__ > ./build/
1840: 6d 61 6b 65 2d 6d 69 6e 6b 69 74 22 20 3e 3e 20  make-minkit" >> 
1850: 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 09 09  "${buildlog}"...
1860: 09 09 09 73 65 64 20 27 73 40 5e 40 20 20 40 27  ...sed 's@^@  @'
1870: 20 20 27 2e 2f 62 75 69 6c 64 2f 6d 61 6b 65 2d    './build/make-
1880: 6d 69 6e 6b 69 74 27 20 3e 3e 20 22 24 7b 62 75  minkit' >> "${bu
1890: 69 6c 64 6c 6f 67 7d 22 0a 09 09 09 09 09 65 63  ildlog}"......ec
18a0: 68 6f 20 22 20 20 5f 5f 45 4f 46 5f 5f 22 20 3e  ho "  __EOF__" >
18b0: 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a  > "${buildlog}".
18c0: 09 09 09 09 09 65 63 68 6f 20 27 27 20 3e 3e 20  .....echo '' >> 
18d0: 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 09 09  "${buildlog}"...
18e0: 09 09 66 69 0a 09 09 09 09 65 63 68 6f 20 22 20  ..fi.....echo " 
18f0: 20 63 61 74 20 3c 3c 20 5c 5f 5f 45 4f 46 5f 5f   cat << \__EOF__
1900: 20 3e 20 24 7b 6b 69 74 63 72 65 61 74 6f 72 7d   > ${kitcreator}
1910: 22 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67  " >> "${buildlog
1920: 7d 22 0a 09 09 09 09 73 65 64 20 27 73 40 5e 40  }".....sed 's@^@
1930: 20 20 40 27 20 20 22 24 7b 6b 69 74 63 72 65 61    @'  "${kitcrea
1940: 74 6f 72 7d 22 20 3e 3e 20 22 24 7b 62 75 69 6c  tor}" >> "${buil
1950: 64 6c 6f 67 7d 22 0a 09 09 09 09 65 63 68 6f 20  dlog}".....echo 
1960: 22 20 20 5f 5f 45 4f 46 5f 5f 22 20 3e 3e 20 22  "  __EOF__" >> "
1970: 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 09 09 09  ${buildlog}"....
1980: 09 65 63 68 6f 20 27 27 20 3e 3e 20 22 24 7b 62  .echo '' >> "${b
1990: 75 69 6c 64 6c 6f 67 7d 22 0a 09 09 09 66 69 0a  uildlog}"....fi.
19a0: 09 09 09 65 63 68 6f 20 22 20 20 5c 22 24 7b 6b  ...echo "  \"${k
19b0: 69 74 63 72 65 61 74 6f 72 7d 5c 22 20 5c 22 24  itcreator}\" \"$
19c0: 7b 76 65 72 73 69 6f 6e 7d 5c 22 20 24 7b 61 72  {version}\" ${ar
19d0: 67 73 7d 22 20 3e 3e 20 22 24 7b 62 75 69 6c 64  gs}" >> "${build
19e0: 6c 6f 67 7d 22 0a 09 09 09 65 63 68 6f 20 27 27  log}"....echo ''
19f0: 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d   >> "${buildlog}
1a00: 22 0a 09 09 09 65 63 68 6f 20 27 27 20 3e 3e 20  "....echo '' >> 
1a10: 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 09 09  "${buildlog}"...
1a20: 09 65 63 68 6f 20 27 27 20 3e 3e 20 22 24 7b 62  .echo '' >> "${b
1a30: 75 69 6c 64 6c 6f 67 7d 22 0a 09 09 09 65 63 68  uildlog}"....ech
1a40: 6f 20 22 20 2a 2a 2a 20 42 75 69 6c 64 20 52 65  o " *** Build Re
1a50: 73 75 6c 74 73 22 20 3e 3e 20 22 24 7b 62 75 69  sults" >> "${bui
1a60: 6c 64 6c 6f 67 7d 22 0a 09 09 09 65 63 68 6f 20  ldlog}"....echo 
1a70: 27 27 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f  '' >> "${buildlo
1a80: 67 7d 22 0a 0a 09 09 09 62 75 69 6c 64 66 61 69  g}".....buildfai
1a90: 6c 65 64 3d 22 30 22 0a 09 09 09 22 24 7b 6b 69  led="0"...."${ki
1aa0: 74 63 72 65 61 74 6f 72 7d 22 20 22 24 7b 76 65  tcreator}" "${ve
1ab0: 72 73 69 6f 6e 7d 22 20 24 7b 61 72 67 73 7d 20  rsion}" ${args} 
1ac0: 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22  >> "${buildlog}"
1ad0: 20 32 3e 26 31 20 7c 7c 20 62 75 69 6c 64 66 61   2>&1 || buildfa
1ae0: 69 6c 65 64 3d 22 31 22 0a 09 09 09 67 72 65 70  iled="1"....grep
1af0: 20 2d 6e 20 27 5e 27 20 2a 2f 62 75 69 6c 64 2e   -n '^' */build.
1b00: 6c 6f 67 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c  log >> "${buildl
1b10: 6f 67 7d 22 20 32 3e 26 31 0a 0a 09 09 09 69 66  og}" 2>&1.....if
1b20: 20 5b 20 22 24 7b 6b 69 74 64 6c 6c 7d 22 20 3d   [ "${kitdll}" =
1b30: 20 22 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09   "1" ]; then....
1b40: 09 23 20 43 72 65 61 74 65 20 74 65 73 74 20 64  .# Create test d
1b50: 72 69 76 65 72 73 20 66 6f 72 20 4b 69 74 44 4c  rivers for KitDL
1b60: 4c 0a 09 09 09 09 28 0a 09 09 09 09 09 65 63 68  L.....(......ech
1b70: 6f 20 22 22 0a 09 09 09 09 09 65 63 68 6f 20 22  o ""......echo "
1b80: 22 0a 09 09 09 09 09 65 63 68 6f 20 22 22 0a 09  "......echo ""..
1b90: 09 09 09 09 65 63 68 6f 20 22 20 2a 2a 2a 20 42  ....echo " *** B
1ba0: 75 69 6c 64 69 6e 67 20 4b 69 74 44 4c 4c 20 74  uilding KitDLL t
1bb0: 65 73 74 20 64 72 69 76 65 72 20 28 74 63 6c 73  est driver (tcls
1bc0: 68 29 22 0a 09 09 09 09 09 65 63 68 6f 20 22 22  h)"......echo ""
1bd0: 0a 0a 09 09 09 09 09 63 64 20 6b 69 74 73 68 2f  .......cd kitsh/
1be0: 62 75 69 6c 64 2f 6b 69 74 73 68 2d 2a 2f 20 7c  build/kitsh-*/ |
1bf0: 7c 20 65 78 69 74 20 31 0a 09 09 09 09 09 6d 61  | exit 1......ma
1c00: 6b 65 20 74 63 6c 73 68 0a 09 09 09 09 09 63 70  ke tclsh......cp
1c10: 20 74 63 6c 73 68 20 2e 2e 2f 2e 2e 2f 2e 2e 2f   tclsh ../../../
1c20: 0a 09 09 09 09 29 20 3e 3e 20 22 24 7b 62 75 69  .....) >> "${bui
1c30: 6c 64 6c 6f 67 7d 22 20 32 3e 26 31 0a 09 09 09  ldlog}" 2>&1....
1c40: 66 69 0a 0a 09 09 09 23 20 50 65 72 66 6f 72 6d  fi.....# Perform
1c50: 20 77 69 6c 64 63 61 72 64 20 65 78 70 61 6e 73   wildcard expans
1c60: 69 6f 6e 0a 09 09 09 63 72 65 61 74 65 64 6b 69  ion....createdki
1c70: 74 3d 22 24 28 6c 73 20 2d 66 31 20 24 7b 63 72  t="$(ls -f1 ${cr
1c80: 65 61 74 65 64 6b 69 74 7d 20 32 3e 2f 64 65 76  eatedkit} 2>/dev
1c90: 2f 6e 75 6c 6c 20 7c 20 68 65 61 64 20 2d 6e 20  /null | head -n 
1ca0: 31 29 22 0a 0a 09 09 09 69 66 20 5b 20 21 20 2d  1)".....if [ ! -
1cb0: 66 20 22 24 7b 63 72 65 61 74 65 64 6b 69 74 7d  f "${createdkit}
1cc0: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09 65 63  " ]; then.....ec
1cd0: 68 6f 20 22 46 61 69 6c 65 64 20 74 6f 20 63 72  ho "Failed to cr
1ce0: 65 61 74 65 20 6b 69 74 20 24 7b 76 65 72 73 69  eate kit ${versi
1cf0: 6f 6e 7d 2f 24 7b 6b 69 74 7d 22 20 3e 26 32 0a  on}/${kit}" >&2.
1d00: 0a 09 09 09 09 66 61 69 6c 65 64 3d 22 24 7b 66  .....failed="${f
1d10: 61 69 6c 65 64 7d 20 24 7b 76 65 72 73 69 6f 6e  ailed} ${version
1d20: 7d 2f 24 7b 6b 69 74 7d 2d 62 75 69 6c 64 22 0a  }/${kit}-build".
1d30: 0a 09 09 09 09 74 6f 75 63 68 20 22 24 7b 66 61  .....touch "${fa
1d40: 69 6c 6f 75 74 70 75 74 6e 61 6d 65 7d 22 0a 09  iloutputname}"..
1d50: 09 09 09 6d 76 20 22 24 7b 62 75 69 6c 64 6c 6f  ...mv "${buildlo
1d60: 67 7d 22 20 22 24 7b 66 61 69 6c 62 75 69 6c 64  g}" "${failbuild
1d70: 6c 6f 67 7d 22 0a 0a 09 09 09 09 72 6d 20 2d 66  log}"......rm -f
1d80: 20 74 63 6c 73 68 0a 0a 09 09 09 09 63 6f 6e 74   tclsh......cont
1d90: 69 6e 75 65 0a 09 09 09 66 69 0a 0a 09 09 09 23  inue....fi.....#
1da0: 20 56 65 72 69 66 79 20 73 61 6e 69 74 79 20 6f   Verify sanity o
1db0: 66 20 63 72 65 61 74 65 64 20 6b 69 74 0a 09 09  f created kit...
1dc0: 09 69 73 73 61 6e 65 3d 31 0a 0a 09 09 09 23 23  .issane=1.....##
1dd0: 20 56 65 72 69 66 79 20 74 68 61 74 20 57 69 6e   Verify that Win
1de0: 33 32 20 62 75 69 6c 64 73 20 61 72 65 20 6f 66  32 builds are of
1df0: 20 63 6f 72 72 65 63 74 20 74 79 70 65 0a 09 09   correct type...
1e00: 09 23 23 20 56 65 72 69 66 79 20 74 68 61 74 20  .## Verify that 
1e10: 44 4c 4c 20 62 75 69 6c 64 73 20 61 72 65 20 6f  DLL builds are o
1e20: 66 20 63 6f 72 72 65 63 74 20 74 79 70 65 0a 09  f correct type..
1e30: 09 09 63 61 73 65 20 22 2d 24 7b 76 65 72 73 69  ..case "-${versi
1e40: 6f 6e 7d 2d 24 7b 6b 69 74 7d 2d 22 20 69 6e 0a  on}-${kit}-" in.
1e50: 09 09 09 09 2a 2d 77 69 6e 33 32 2d 6b 69 74 64  ....*-win32-kitd
1e60: 6c 6c 2d 2a 7c 2a 2d 77 69 6e 33 32 2d 2a 2d 6b  ll-*|*-win32-*-k
1e70: 69 74 64 6c 6c 2d 2a 29 0a 09 09 09 09 09 69 66  itdll-*)......if
1e80: 20 21 20 66 69 6c 65 20 22 24 7b 63 72 65 61 74   ! file "${creat
1e90: 65 64 6b 69 74 7d 22 20 7c 20 67 72 65 70 20 27  edkit}" | grep '
1ea0: 4d 53 20 57 69 6e 64 6f 77 73 20 28 44 4c 4c 29  MS Windows (DLL)
1eb0: 27 20 3e 2f 64 65 76 2f 6e 75 6c 6c 3b 20 74 68  ' >/dev/null; th
1ec0: 65 6e 0a 09 09 09 09 09 09 69 73 73 61 6e 65 3d  en.......issane=
1ed0: 30 0a 09 09 09 09 09 66 69 0a 09 09 09 09 09 3b  0......fi......;
1ee0: 3b 0a 09 09 09 09 2a 2d 6b 69 74 64 6c 6c 2d 2a  ;.....*-kitdll-*
1ef0: 29 0a 09 09 09 09 09 69 66 20 21 20 66 69 6c 65  )......if ! file
1f00: 20 22 24 7b 63 72 65 61 74 65 64 6b 69 74 7d 22   "${createdkit}"
1f10: 20 7c 20 67 72 65 70 20 27 73 68 61 72 65 64 20   | grep 'shared 
1f20: 6f 62 6a 65 63 74 27 20 3e 2f 64 65 76 2f 6e 75  object' >/dev/nu
1f30: 6c 6c 3b 20 74 68 65 6e 0a 09 09 09 09 09 09 69  ll; then.......i
1f40: 73 73 61 6e 65 3d 30 0a 09 09 09 09 09 66 69 0a  ssane=0......fi.
1f50: 09 09 09 09 09 3b 3b 0a 09 09 09 09 2a 2d 77 69  .....;;.....*-wi
1f60: 6e 33 32 2d 6e 6f 74 6b 2d 2a 7c 2a 2d 77 69 6e  n32-notk-*|*-win
1f70: 33 32 2d 2a 2d 6e 6f 74 6b 2d 2a 29 0a 09 09 09  32-*-notk-*)....
1f80: 09 09 69 66 20 21 20 66 69 6c 65 20 22 24 7b 63  ..if ! file "${c
1f90: 72 65 61 74 65 64 6b 69 74 7d 22 20 7c 20 67 72  reatedkit}" | gr
1fa0: 65 70 20 27 4d 53 20 57 69 6e 64 6f 77 73 20 28  ep 'MS Windows (
1fb0: 63 6f 6e 73 6f 6c 65 29 27 20 3e 2f 64 65 76 2f  console)' >/dev/
1fc0: 6e 75 6c 6c 3b 20 74 68 65 6e 0a 09 09 09 09 09  null; then......
1fd0: 09 65 63 68 6f 20 22 4b 69 74 20 66 61 69 6c 65  .echo "Kit faile
1fe0: 64 20 73 61 6e 69 74 79 20 63 68 65 63 6b 20 66  d sanity check f
1ff0: 6f 72 20 62 65 69 6e 67 20 61 20 63 6f 6e 73 6f  or being a conso
2000: 6c 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 22 20  le application" 
2010: 3e 26 32 0a 09 09 09 09 09 09 69 73 73 61 6e 65  >&2.......issane
2020: 3d 30 0a 09 09 09 09 09 66 69 0a 09 09 09 09 09  =0......fi......
2030: 3b 3b 0a 09 09 09 09 2a 2d 77 69 6e 33 32 2d 2a  ;;.....*-win32-*
2040: 29 0a 09 09 09 09 09 69 66 20 21 20 66 69 6c 65  )......if ! file
2050: 20 22 24 7b 63 72 65 61 74 65 64 6b 69 74 7d 22   "${createdkit}"
2060: 20 7c 20 67 72 65 70 20 27 4d 53 20 57 69 6e 64   | grep 'MS Wind
2070: 6f 77 73 20 28 47 55 49 29 27 20 3e 2f 64 65 76  ows (GUI)' >/dev
2080: 2f 6e 75 6c 6c 3b 20 74 68 65 6e 0a 09 09 09 09  /null; then.....
2090: 09 09 65 63 68 6f 20 22 4b 69 74 20 66 61 69 6c  ..echo "Kit fail
20a0: 65 64 20 73 61 6e 69 74 79 20 63 68 65 63 6b 20  ed sanity check 
20b0: 66 6f 72 20 62 65 69 6e 67 20 61 20 47 55 49 20  for being a GUI 
20c0: 61 70 70 6c 69 63 61 74 69 6f 6e 22 20 3e 26 32  application" >&2
20d0: 0a 09 09 09 09 09 09 69 73 73 61 6e 65 3d 30 0a  .......issane=0.
20e0: 09 09 09 09 09 66 69 0a 09 09 09 09 09 3b 3b 0a  .....fi......;;.
20f0: 09 09 09 65 73 61 63 0a 0a 09 09 09 23 23 20 56  ...esac.....## V
2100: 65 72 69 66 79 20 74 68 65 20 62 75 69 6c 64 20  erify the build 
2110: 63 6f 6d 70 6c 65 74 65 64 20 77 69 74 68 6f 75  completed withou
2120: 74 20 77 61 72 6e 69 6e 67 73 0a 09 09 09 69 66  t warnings....if
2130: 20 5b 20 22 24 7b 62 75 69 6c 64 66 61 69 6c 65   [ "${buildfaile
2140: 64 7d 22 20 3d 20 22 31 22 20 5d 3b 20 74 68 65  d}" = "1" ]; the
2150: 6e 0a 09 09 09 09 65 63 68 6f 20 22 4b 69 74 20  n.....echo "Kit 
2160: 66 61 69 6c 65 64 20 73 61 6e 69 74 79 20 63 68  failed sanity ch
2170: 65 63 6b 20 66 6f 72 20 42 75 69 6c 64 69 6e 67  eck for Building
2180: 22 20 3e 26 32 0a 0a 09 09 09 09 69 73 73 61 6e  " >&2......issan
2190: 65 3d 30 0a 09 09 09 66 69 0a 0a 09 09 09 23 20  e=0....fi.....# 
21a0: 4d 61 6b 65 20 6e 6f 74 65 20 6f 66 20 73 61 6e  Make note of san
21b0: 69 74 79 20 66 61 69 6c 75 72 65 0a 09 09 09 69  ity failure....i
21c0: 66 20 5b 20 22 24 7b 69 73 73 61 6e 65 7d 22 20  f [ "${issane}" 
21d0: 21 3d 20 22 31 22 20 5d 3b 20 74 68 65 6e 0a 09  != "1" ]; then..
21e0: 09 09 09 65 63 68 6f 20 22 4b 69 74 20 66 61 69  ...echo "Kit fai
21f0: 6c 65 64 20 73 61 6e 69 74 79 20 24 7b 76 65 72  led sanity ${ver
2200: 73 69 6f 6e 7d 2f 24 7b 6b 69 74 7d 22 20 3e 26  sion}/${kit}" >&
2210: 32 0a 0a 09 09 09 09 66 61 69 6c 65 64 3d 22 24  2......failed="$
2220: 7b 66 61 69 6c 65 64 7d 20 24 7b 76 65 72 73 69  {failed} ${versi
2230: 6f 6e 7d 2f 24 7b 6b 69 74 7d 2d 73 61 6e 69 74  on}/${kit}-sanit
2240: 79 22 0a 0a 09 09 09 09 6d 76 20 22 24 7b 63 72  y"......mv "${cr
2250: 65 61 74 65 64 6b 69 74 7d 22 20 22 24 7b 66 61  eatedkit}" "${fa
2260: 69 6c 6f 75 74 70 75 74 6e 61 6d 65 7d 22 0a 09  iloutputname}"..
2270: 09 09 09 6d 76 20 22 24 7b 62 75 69 6c 64 6c 6f  ...mv "${buildlo
2280: 67 7d 22 20 22 24 7b 66 61 69 6c 62 75 69 6c 64  g}" "${failbuild
2290: 6c 6f 67 7d 22 0a 0a 09 09 09 09 72 6d 20 2d 66  log}"......rm -f
22a0: 20 74 63 6c 73 68 0a 0a 09 09 09 09 63 6f 6e 74   tclsh......cont
22b0: 69 6e 75 65 0a 09 09 09 66 69 0a 0a 09 09 09 23  inue....fi.....#
22c0: 20 52 65 6e 61 6d 65 20 63 72 65 61 74 65 64 20   Rename created 
22d0: 6b 69 74 20 74 6f 20 66 69 6e 61 6c 20 64 65 73  kit to final des
22e0: 74 69 6e 61 74 69 6f 6e 0a 09 09 09 6d 76 20 22  tination....mv "
22f0: 24 7b 63 72 65 61 74 65 64 6b 69 74 7d 22 20 22  ${createdkit}" "
2300: 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 22 0a 09  ${outputname}"..
2310: 09 09 69 66 20 5b 20 2d 66 20 22 74 63 6c 73 68  ..if [ -f "tclsh
2320: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09 6d 76  " ]; then.....mv
2330: 20 22 74 63 6c 73 68 22 20 22 24 7b 6f 75 74 70   "tclsh" "${outp
2340: 75 74 6e 61 6d 65 7d 2d 74 63 6c 73 68 22 0a 09  utname}-tclsh"..
2350: 09 09 66 69 0a 0a 09 09 09 23 20 46 6f 72 20 4b  ..fi.....# For K
2360: 69 74 44 4c 4c 2c 20 6d 61 6b 65 20 61 20 6e 6f  itDLL, make a no
2370: 74 65 20 6f 66 20 74 68 65 20 6f 72 69 67 69 6e  te of the origin
2380: 61 6c 20 6e 61 6d 65 0a 09 09 09 69 66 20 5b 20  al name....if [ 
2390: 22 24 7b 6b 69 74 64 6c 6c 7d 22 20 3d 20 22 31  "${kitdll}" = "1
23a0: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09 65 63  " ]; then.....ec
23b0: 68 6f 20 22 24 7b 63 72 65 61 74 65 64 6b 69 74  ho "${createdkit
23c0: 7d 22 20 3e 20 22 24 7b 6f 75 74 70 75 74 6e 61  }" > "${outputna
23d0: 6d 65 7d 2d 6f 72 69 67 6e 61 6d 65 22 0a 09 09  me}-origname"...
23e0: 09 66 69 0a 09 09 66 69 0a 0a 09 09 23 20 54 65  .fi...fi....# Te
23f0: 73 74 20 7a 69 70 20 73 74 61 74 75 73 0a 09 09  st zip status...
2400: 69 66 20 75 6e 7a 69 70 20 2d 6c 20 22 24 7b 6f  if unzip -l "${o
2410: 75 74 70 75 74 6e 61 6d 65 7d 22 20 32 3e 26 31  utputname}" 2>&1
2420: 20 7c 20 67 72 65 70 20 27 62 6f 6f 74 5c 2e 74   | grep 'boot\.t
2430: 63 6c 27 20 3e 2f 64 65 76 2f 6e 75 6c 6c 3b 20  cl' >/dev/null; 
2440: 74 68 65 6e 0a 09 09 09 63 61 6e 75 6e 7a 69 70  then....canunzip
2450: 3d 22 31 22 0a 09 09 65 6c 73 65 0a 09 09 09 63  ="1"...else....c
2460: 61 6e 75 6e 7a 69 70 3d 22 30 22 0a 09 09 66 69  anunzip="0"...fi
2470: 0a 0a 09 09 69 66 20 5b 20 22 24 7b 69 73 7a 69  ....if [ "${iszi
2480: 70 7d 22 20 21 3d 20 22 24 7b 63 61 6e 75 6e 7a  p}" != "${canunz
2490: 69 70 7d 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09  ip}" ]; then....
24a0: 65 63 68 6f 20 22 46 61 69 6c 65 64 20 74 6f 20  echo "Failed to 
24b0: 75 6e 7a 69 70 20 7a 69 70 6b 69 74 20 6f 72 20  unzip zipkit or 
24c0: 77 61 73 20 61 62 6c 65 20 74 6f 20 75 6e 7a 69  was able to unzi
24d0: 70 20 6e 6f 6e 2d 7a 69 70 6b 69 74 20 24 7b 76  p non-zipkit ${v
24e0: 65 72 73 69 6f 6e 7d 2f 24 7b 6b 69 74 7d 22 20  ersion}/${kit}" 
24f0: 3e 26 32 0a 0a 09 09 09 66 61 69 6c 65 64 3d 22  >&2.....failed="
2500: 24 7b 66 61 69 6c 65 64 7d 20 24 7b 76 65 72 73  ${failed} ${vers
2510: 69 6f 6e 7d 2f 24 7b 6b 69 74 7d 2d 7a 69 70 22  ion}/${kit}-zip"
2520: 0a 0a 09 09 09 63 6f 6e 74 69 6e 75 65 0a 09 09  .....continue...
2530: 66 69 0a 0a 09 09 23 20 44 6f 20 6e 6f 74 20 63  fi....# Do not c
2540: 6f 6e 74 69 6e 75 65 20 70 61 73 74 20 68 65 72  ontinue past her
2550: 65 20 66 6f 72 20 75 6e 2d 72 75 6e 6e 61 62 6c  e for un-runnabl
2560: 65 20 6b 69 74 73 0a 09 09 69 66 20 5b 20 22 24  e kits...if [ "$
2570: 7b 72 75 6e 6e 61 62 6c 65 7d 22 20 21 3d 20 22  {runnable}" != "
2580: 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 63 6f  1" ]; then....co
2590: 6e 74 69 6e 75 65 0a 09 09 66 69 0a 0a 09 09 23  ntinue...fi....#
25a0: 20 49 66 20 74 68 65 20 6e 61 6d 65 20 6f 66 20   If the name of 
25b0: 74 68 65 20 6f 72 69 67 69 6e 61 6c 20 62 75 69  the original bui
25c0: 6c 64 20 6d 61 74 74 65 72 73 2c 20 73 79 6d 6c  ld matters, syml
25d0: 69 6e 6b 20 69 74 20 75 70 0a 09 09 69 66 20 5b  ink it up...if [
25e0: 20 2d 66 20 22 24 7b 6f 75 74 70 75 74 6e 61 6d   -f "${outputnam
25f0: 65 7d 2d 6f 72 69 67 6e 61 6d 65 22 20 5d 3b 20  e}-origname" ]; 
2600: 74 68 65 6e 0a 09 09 09 63 72 65 61 74 65 64 6b  then....createdk
2610: 69 74 3d 22 24 28 63 61 74 20 22 24 7b 6f 75 74  it="$(cat "${out
2620: 70 75 74 6e 61 6d 65 7d 2d 6f 72 69 67 6e 61 6d  putname}-orignam
2630: 65 22 29 22 0a 0a 09 09 09 6c 6e 20 2d 73 20 22  e")".....ln -s "
2640: 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 22 20 22  ${outputname}" "
2650: 24 7b 63 72 65 61 74 65 64 6b 69 74 7d 22 0a 09  ${createdkit}"..
2660: 09 66 69 0a 0a 09 09 23 20 50 65 72 66 6f 72 6d  .fi....# Perform
2670: 20 62 61 74 74 65 72 79 20 6f 66 20 74 65 73 74   battery of test
2680: 73 0a 09 09 23 23 20 43 6c 65 61 6e 20 74 65 73  s...## Clean tes
2690: 74 73 20 6c 6f 67 0a 09 09 72 6d 20 2d 66 20 22  ts log...rm -f "
26a0: 24 7b 74 65 73 74 72 65 73 75 6c 74 73 6c 6f 67  ${testresultslog
26b0: 7d 22 0a 09 09 66 6f 72 20 74 65 73 74 73 63 70  }"...for testscp
26c0: 20 69 6e 20 22 24 7b 54 45 53 54 44 49 52 7d 22   in "${TESTDIR}"
26d0: 2f 74 65 73 74 73 2f 2a 2e 74 63 6c 3b 20 64 6f  /tests/*.tcl; do
26e0: 0a 09 09 09 74 65 73 74 73 63 70 5f 74 61 67 3d  ....testscp_tag=
26f0: 22 24 28 62 61 73 65 6e 61 6d 65 20 22 24 7b 74  "$(basename "${t
2700: 65 73 74 73 63 70 7d 22 20 2e 74 63 6c 29 22 0a  estscp}" .tcl)".
2710: 09 09 09 74 65 73 74 73 63 70 70 72 65 3d 22 24  ...testscppre="$
2720: 28 64 69 72 6e 61 6d 65 20 22 24 7b 74 65 73 74  (dirname "${test
2730: 73 63 70 7d 22 29 2f 24 7b 74 65 73 74 73 63 70  scp}")/${testscp
2740: 5f 74 61 67 7d 2e 73 68 22 0a 09 09 09 73 63 70  _tag}.sh"....scp
2750: 6c 6f 67 66 69 6c 65 3d 22 24 7b 6f 75 74 70 75  logfile="${outpu
2760: 74 6e 61 6d 65 7d 2d 24 7b 74 65 73 74 73 63 70  tname}-${testscp
2770: 5f 74 61 67 7d 2e 6c 6f 67 22 0a 0a 09 09 09 23  _tag}.log".....#
2780: 20 49 66 20 61 20 63 6f 6d 6d 61 6e 64 20 69 73   If a command is
2790: 20 72 65 71 75 69 72 65 64 20 74 6f 20 73 74 61   required to sta
27a0: 72 74 20 74 68 65 20 6b 69 74 2c 20 70 72 65 70  rt the kit, prep
27b0: 61 72 65 20 74 6f 20 6b 69 6c 6c 20 69 74 0a 09  are to kill it..
27c0: 09 09 23 20 69 6e 20 63 61 73 65 20 6f 66 20 74  ..# in case of t
27d0: 69 6d 65 6f 75 74 2e 0a 09 09 09 23 23 20 54 65  imeout.....## Te
27e0: 6d 70 6f 72 61 72 69 6c 79 20 64 69 73 61 62 6c  mporarily disabl
27f0: 65 64 20 73 69 6e 63 65 20 63 75 72 72 65 6e 74  ed since current
2800: 6c 79 20 69 74 20 69 73 20 63 61 75 73 69 6e 67  ly it is causing
2810: 0a 09 09 09 23 23 20 6d 6f 72 65 20 70 72 6f 62  ....## more prob
2820: 6c 65 6d 73 20 69 6e 20 74 68 65 20 66 6f 72 6d  lems in the form
2830: 20 6f 66 20 74 65 73 74 73 20 62 65 69 6e 67 20   of tests being 
2840: 6b 69 6c 6c 65 64 0a 09 09 09 23 23 20 70 72 65  killed....## pre
2850: 6d 61 74 75 72 65 6c 79 20 74 68 61 6e 20 77 65  maturely than we
2860: 20 61 72 65 20 68 61 76 69 6e 67 20 69 73 73 75   are having issu
2870: 65 73 20 77 69 74 68 20 74 65 73 74 73 0a 09 09  es with tests...
2880: 09 23 23 20 68 61 6e 67 69 6e 67 0a 09 09 09 6b  .## hanging....k
2890: 69 74 72 75 6e 6b 69 6c 6c 70 69 64 3d 22 22 0a  itrunkillpid="".
28a0: 09 09 09 69 66 20 5b 20 22 31 22 20 3d 20 22 30  ...if [ "1" = "0
28b0: 22 20 2d 61 20 2d 6e 20 22 24 7b 6b 69 74 72 75  " -a -n "${kitru
28c0: 6e 63 6d 64 7d 22 20 5d 3b 20 74 68 65 6e 0a 09  ncmd}" ]; then..
28d0: 09 09 09 28 0a 09 09 09 09 09 73 6c 65 65 70 20  ...(......sleep 
28e0: 31 32 30 0a 09 09 09 09 09 6b 69 6c 6c 61 6c 6c  120......killall
28f0: 20 22 24 28 62 61 73 65 6e 61 6d 65 20 22 24 7b   "$(basename "${
2900: 6f 75 74 70 75 74 6e 61 6d 65 7d 22 29 22 20 3e  outputname}")" >
2910: 2f 64 65 76 2f 6e 75 6c 6c 20 32 3e 2f 64 65 76  /dev/null 2>/dev
2920: 2f 6e 75 6c 6c 0a 09 09 09 09 29 20 3e 2f 64 65  /null.....) >/de
2930: 76 2f 6e 75 6c 6c 20 32 3e 2f 64 65 76 2f 6e 75  v/null 2>/dev/nu
2940: 6c 6c 20 26 0a 09 09 09 09 6b 69 74 72 75 6e 6b  ll &.....kitrunk
2950: 69 6c 6c 70 69 64 3d 22 24 21 22 0a 09 09 09 66  illpid="$!"....f
2960: 69 0a 0a 09 09 09 28 0a 09 09 09 09 69 66 20 5b  i.....(.....if [
2970: 20 2d 66 20 22 24 7b 74 65 73 74 73 63 70 70 72   -f "${testscppr
2980: 65 7d 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09  e}" ]; then.....
2990: 09 2e 20 22 24 7b 74 65 73 74 73 63 70 70 72 65  .. "${testscppre
29a0: 7d 22 0a 09 09 09 09 66 69 0a 0a 09 09 09 09 69  }".....fi......i
29b0: 66 20 5b 20 22 24 7b 6b 69 74 64 6c 6c 7d 22 20  f [ "${kitdll}" 
29c0: 3d 20 22 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09  = "1" ]; then...
29d0: 09 09 09 24 7b 6b 69 74 72 75 6e 63 6d 64 7d 20  ...${kitruncmd} 
29e0: 22 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 2d 74  "${outputname}-t
29f0: 63 6c 73 68 22 20 22 24 7b 74 65 73 74 73 63 70  clsh" "${testscp
2a00: 7d 22 20 22 24 7b 6f 75 74 70 75 74 6e 61 6d 65  }" "${outputname
2a10: 7d 22 20 22 24 7b 6b 69 74 7d 22 20 22 24 7b 76  }" "${kit}" "${v
2a20: 65 72 73 69 6f 6e 7d 22 0a 09 09 09 09 65 6c 73  ersion}".....els
2a30: 65 0a 09 09 09 09 09 24 7b 6b 69 74 72 75 6e 63  e......${kitrunc
2a40: 6d 64 7d 20 22 24 7b 6f 75 74 70 75 74 6e 61 6d  md} "${outputnam
2a50: 65 7d 22 20 22 24 7b 74 65 73 74 73 63 70 7d 22  e}" "${testscp}"
2a60: 20 22 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 22   "${outputname}"
2a70: 20 22 24 7b 6b 69 74 7d 22 20 22 24 7b 76 65 72   "${kit}" "${ver
2a80: 73 69 6f 6e 7d 22 0a 09 09 09 09 66 69 0a 09 09  sion}".....fi...
2a90: 09 29 20 3e 20 22 24 7b 73 63 70 6c 6f 67 66 69  .) > "${scplogfi
2aa0: 6c 65 7d 22 20 32 3e 26 31 0a 0a 09 09 09 69 66  le}" 2>&1.....if
2ab0: 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d   [ "$?" != "0" ]
2ac0: 3b 20 74 68 65 6e 0a 09 09 09 09 65 63 68 6f 20  ; then.....echo 
2ad0: 22 53 63 72 69 70 74 20 66 61 69 6c 65 64 3a 20  "Script failed: 
2ae0: 24 7b 74 65 73 74 73 63 70 5f 74 61 67 7d 20 6f  ${testscp_tag} o
2af0: 6e 20 24 7b 76 65 72 73 69 6f 6e 7d 2f 24 7b 6b  n ${version}/${k
2b00: 69 74 7d 22 20 3e 26 32 0a 0a 09 09 09 09 66 61  it}" >&2......fa
2b10: 69 6c 65 64 3d 22 24 7b 66 61 69 6c 65 64 7d 20  iled="${failed} 
2b20: 24 7b 76 65 72 73 69 6f 6e 7d 2f 24 7b 6b 69 74  ${version}/${kit
2b30: 7d 2d 74 65 73 74 2d 24 7b 74 65 73 74 73 63 70  }-test-${testscp
2b40: 5f 74 61 67 7d 22 0a 0a 09 09 09 09 65 63 68 6f  _tag}"......echo
2b50: 20 22 24 7b 74 65 73 74 73 63 70 5f 74 61 67 7d   "${testscp_tag}
2b60: 3a 20 46 41 49 4c 22 20 3e 3e 20 20 22 24 7b 74  : FAIL" >>  "${t
2b70: 65 73 74 72 65 73 75 6c 74 73 6c 6f 67 7d 22 0a  estresultslog}".
2b80: 0a 09 09 09 09 63 6f 6e 74 69 6e 75 65 0a 09 09  .....continue...
2b90: 09 66 69 0a 0a 09 09 09 23 20 4b 69 6c 6c 20 74  .fi.....# Kill t
2ba0: 68 65 20 77 61 74 63 68 64 6f 67 20 66 6f 72 20  he watchdog for 
2bb0: 74 68 69 73 20 69 74 65 72 61 74 69 6f 6e 0a 09  this iteration..
2bc0: 09 09 69 66 20 5b 20 2d 6e 20 22 24 7b 6b 69 74  ..if [ -n "${kit
2bd0: 72 75 6e 6b 69 6c 6c 70 69 64 7d 22 20 5d 3b 20  runkillpid}" ]; 
2be0: 74 68 65 6e 0a 09 09 09 09 6b 69 6c 6c 20 2d 39  then.....kill -9
2bf0: 20 22 24 7b 6b 69 74 72 75 6e 6b 69 6c 6c 70 69   "${kitrunkillpi
2c00: 64 7d 22 20 3e 2f 64 65 76 2f 6e 75 6c 6c 20 32  d}" >/dev/null 2
2c10: 3e 2f 64 65 76 2f 6e 75 6c 6c 0a 09 09 09 66 69  >/dev/null....fi
2c20: 0a 0a 09 09 09 65 63 68 6f 20 22 24 7b 74 65 73  .....echo "${tes
2c30: 74 73 63 70 5f 74 61 67 7d 3a 20 50 41 53 53 22  tscp_tag}: PASS"
2c40: 20 3e 3e 20 20 22 24 7b 74 65 73 74 72 65 73 75   >>  "${testresu
2c50: 6c 74 73 6c 6f 67 7d 22 0a 0a 09 09 09 72 6d 20  ltslog}".....rm 
2c60: 2d 66 20 22 24 7b 73 63 70 6c 6f 67 66 69 6c 65  -f "${scplogfile
2c70: 7d 22 0a 09 09 64 6f 6e 65 0a 0a 09 09 69 66 20  }"...done....if 
2c80: 5b 20 2d 66 20 22 24 7b 6f 75 74 70 75 74 6e 61  [ -f "${outputna
2c90: 6d 65 7d 2d 6f 72 69 67 6e 61 6d 65 22 20 5d 3b  me}-origname" ];
2ca0: 20 74 68 65 6e 0a 09 09 09 72 6d 20 2d 66 20 22   then....rm -f "
2cb0: 24 7b 63 72 65 61 74 65 64 6b 69 74 7d 22 0a 09  ${createdkit}"..
2cc0: 09 66 69 0a 09 64 6f 6e 65 0a 64 6f 6e 65 0a 0a  .fi..done.done..
2cd0: 69 66 20 5b 20 2d 6e 20 22 24 7b 66 61 69 6c 65  if [ -n "${faile
2ce0: 64 7d 22 20 5d 3b 20 74 68 65 6e 0a 09 65 63 68  d}" ]; then..ech
2cf0: 6f 20 22 46 61 69 6c 65 64 3a 20 24 7b 66 61 69  o "Failed: ${fai
2d00: 6c 65 64 7d 22 0a 66 69 0a 0a 23 20 54 65 72 6d  led}".fi..# Term
2d10: 69 6e 61 74 65 20 58 76 66 62 0a 6b 69 6c 6c 20  inate Xvfb.kill 
2d20: 2d 39 20 22 24 7b 58 56 46 42 5f 50 49 44 7d 22  -9 "${XVFB_PID}"
2d30: 0a 0a 23 20 43 6c 65 61 6e 75 70 0a 2e 2f 6b 69  ..# Cleanup../ki
2d40: 74 63 72 65 61 74 6f 72 20 63 6c 65 61 6e 0a 72  tcreator clean.r
2d50: 6d 20 2d 66 20 74 63 6c 73 68 0a                 m -f tclsh.