Hex Artifact Content

Artifact bee88e3dbf47cc109b1815742e9b923bdc1e78a6:


0000: 23 21 20 2f 62 69 6e 2f 62 61 73 68 0a 0a 54 43  #! /bin/bash..TC
0010: 4c 56 45 52 53 3d 22 38 2e 34 2e 31 39 22 0a 65  LVERS="8.4.19".e
0020: 78 70 6f 72 74 20 54 43 4c 56 45 52 53 0a 0a 6d  xport TCLVERS..m
0030: 6f 64 65 3d 22 62 75 69 6c 64 22 0a 69 66 20 5b  ode="build".if [
0040: 20 22 24 31 22 20 3d 20 22 63 6c 65 61 6e 22 20   "$1" = "clean" 
0050: 5d 3b 20 74 68 65 6e 0a 09 6d 6f 64 65 3d 22 63  ]; then..mode="c
0060: 6c 65 61 6e 22 0a 66 69 0a 69 66 20 5b 20 22 24  lean".fi.if [ "$
0070: 31 22 20 3d 20 22 64 69 73 74 63 6c 65 61 6e 22  1" = "distclean"
0080: 20 5d 3b 20 74 68 65 6e 0a 09 6d 6f 64 65 3d 22   ]; then..mode="
0090: 64 69 73 74 63 6c 65 61 6e 22 0a 66 69 0a 0a 66  distclean".fi..f
00a0: 61 69 6c 65 64 70 6b 67 73 3d 22 22 0a 62 75 69  ailedpkgs="".bui
00b0: 6c 64 66 61 69 6c 65 64 3d 22 30 22 0a 66 6f 72  ldfailed="0".for
00c0: 20 70 6b 67 20 69 6e 20 74 63 6c 20 74 6b 20 69   pkg in tcl tk i
00d0: 74 63 6c 20 6d 6b 34 74 63 6c 20 74 63 6c 76 66  tcl mk4tcl tclvf
00e0: 73 20 6b 69 74 73 68 3b 20 64 6f 0a 09 69 66 20  s kitsh; do..if 
00f0: 5b 20 22 24 7b 6d 6f 64 65 7d 22 20 3d 20 22 64  [ "${mode}" = "d
0100: 69 73 74 63 6c 65 61 6e 22 20 5d 3b 20 74 68 65  istclean" ]; the
0110: 6e 0a 09 09 72 6d 20 2d 72 66 20 22 24 7b 70 6b  n...rm -rf "${pk
0120: 67 7d 2f 73 72 63 22 0a 09 66 69 0a 0a 09 69 66  g}/src"..fi...if
0130: 20 5b 20 22 24 7b 6d 6f 64 65 7d 22 20 3d 20 22   [ "${mode}" = "
0140: 63 6c 65 61 6e 22 20 2d 6f 20 22 24 7b 6d 6f 64  clean" -o "${mod
0150: 65 7d 22 20 3d 20 22 64 69 73 74 63 6c 65 61 6e  e}" = "distclean
0160: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 72 6d 20 2d  " ]; then...rm -
0170: 66 20 22 24 7b 70 6b 67 7d 2f 62 75 69 6c 64 2e  f "${pkg}/build.
0180: 6c 6f 67 22 0a 09 09 72 6d 20 2d 72 66 20 22 24  log"...rm -rf "$
0190: 7b 70 6b 67 7d 2f 6f 75 74 22 20 22 24 7b 70 6b  {pkg}/out" "${pk
01a0: 67 7d 2f 69 6e 73 74 22 20 22 24 7b 70 6b 67 7d  g}/inst" "${pkg}
01b0: 2f 62 75 69 6c 64 22 0a 0a 09 09 63 6f 6e 74 69  /build"....conti
01c0: 6e 75 65 0a 09 66 69 0a 0a 09 66 61 69 6c 65 64  nue..fi...failed
01d0: 3d 22 30 22 0a 09 28 0a 09 09 63 64 20 22 24 7b  ="0"..(...cd "${
01e0: 70 6b 67 7d 22 20 7c 7c 20 65 78 69 74 20 31 0a  pkg}" || exit 1.
01f0: 0a 09 09 2e 2f 62 75 69 6c 64 2e 73 68 20 3e 20  ..../build.sh > 
0200: 62 75 69 6c 64 2e 6c 6f 67 20 32 3e 26 31 20 7c  build.log 2>&1 |
0210: 7c 20 65 78 69 74 20 31 0a 09 29 20 7c 7c 20 66  | exit 1..) || f
0220: 61 69 6c 65 64 3d 22 31 22 0a 0a 09 69 66 20 5b  ailed="1"...if [
0230: 20 22 24 7b 66 61 69 6c 65 64 7d 22 20 3d 20 22   "${failed}" = "
0240: 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09 66 61 69  1" ]; then...fai
0250: 6c 65 64 70 6b 67 73 3d 22 24 7b 66 61 69 6c 65  ledpkgs="${faile
0260: 64 70 6b 67 73 7d 20 24 7b 70 6b 67 7d 22 0a 09  dpkgs} ${pkg}"..
0270: 66 69 0a 0a 09 63 61 73 65 20 22 24 7b 70 6b 67  fi...case "${pkg
0280: 7d 22 20 69 6e 0a 09 09 74 63 6c 29 0a 09 09 09  }" in...tcl)....
0290: 54 43 4c 43 4f 4e 46 49 47 44 49 52 3d 24 28 66  TCLCONFIGDIR=$(f
02a0: 69 6e 64 20 22 24 28 70 77 64 29 2f 74 63 6c 2f  ind "$(pwd)/tcl/
02b0: 62 75 69 6c 64 22 20 2d 6e 61 6d 65 20 74 63 6c  build" -name tcl
02c0: 43 6f 6e 66 69 67 2e 73 68 20 7c 20 68 65 61 64  Config.sh | head
02d0: 20 2d 31 20 7c 20 73 65 64 20 27 73 40 2f 5b 5e   -1 | sed 's@/[^
02e0: 2f 5d 2a 24 40 40 27 29 0a 09 09 09 65 78 70 6f  /]*$@@')....expo
02f0: 72 74 20 54 43 4c 43 4f 4e 46 49 47 44 49 52 0a  rt TCLCONFIGDIR.
0300: 09 09 09 3b 3b 0a 09 65 73 61 63 0a 0a 09 69 66  ...;;..esac...if
0310: 20 5b 20 22 24 7b 66 61 69 6c 65 64 7d 22 20 3d   [ "${failed}" =
0320: 20 22 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09 62   "1" ]; then...b
0330: 75 69 6c 64 66 61 69 6c 65 64 3d 22 31 22 0a 09  uildfailed="1"..
0340: 66 69 0a 64 6f 6e 65 0a 0a 69 66 20 5b 20 22 24  fi.done..if [ "$
0350: 7b 6d 6f 64 65 7d 22 20 3d 20 22 63 6c 65 61 6e  {mode}" = "clean
0360: 22 20 2d 6f 20 22 24 7b 6d 6f 64 65 7d 22 20 3d  " -o "${mode}" =
0370: 20 22 64 69 73 74 63 6c 65 61 6e 22 20 5d 3b 20   "distclean" ]; 
0380: 74 68 65 6e 0a 09 72 6d 20 2d 66 20 74 63 6c 6b  then..rm -f tclk
0390: 69 74 2d 2a 0a 0a 09 65 78 69 74 20 30 0a 66 69  it-*...exit 0.fi
03a0: 0a 0a 69 66 20 5b 20 2d 6e 20 22 24 7b 66 61 69  ..if [ -n "${fai
03b0: 6c 65 64 70 6b 67 73 7d 22 20 5d 3b 20 74 68 65  ledpkgs}" ]; the
03c0: 6e 0a 09 65 63 68 6f 20 22 46 61 69 6c 65 64 20  n..echo "Failed 
03d0: 74 6f 20 62 75 69 6c 64 3a 24 7b 66 61 69 6c 65  to build:${faile
03e0: 64 70 6b 67 73 7d 22 0a 66 69 0a 0a 69 66 20 5b  dpkgs}".fi..if [
03f0: 20 22 24 7b 62 75 69 6c 64 66 61 69 6c 65 64 7d   "${buildfailed}
0400: 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e  " != "0" ]; then
0410: 0a 09 65 63 68 6f 20 27 57 41 52 4e 49 4e 47 3a  ..echo 'WARNING:
0420: 20 42 75 69 6c 64 20 69 73 20 6c 69 6b 65 6c 79   Build is likely
0430: 20 69 6e 63 6f 6d 70 6c 65 74 65 20 6f 72 20 66   incomplete or f
0440: 61 69 6c 65 64 2e 27 20 3e 26 32 0a 66 69 0a 0a  ailed.' >&2.fi..
0450: 63 70 20 27 6b 69 74 73 68 2f 62 75 69 6c 64 27  cp 'kitsh/build'
0460: 2f 6b 69 74 73 68 2d 2a 2f 6b 69 74 20 22 74 63  /kitsh-*/kit "tc
0470: 6c 6b 69 74 2d 24 7b 54 43 4c 56 45 52 53 7d 22  lkit-${TCLVERS}"
0480: 0a 0a 65 78 69 74 20 22 24 7b 62 75 69 6c 64 66  ..exit "${buildf
0490: 61 69 6c 65 64 7d 22 0a                          ailed}".