Hex Artifact Content

Artifact 4831102fe2d14f82ba809d001f04b2120546ff53:


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 69  LVERS="8.4.19".i
0020: 66 20 65 63 68 6f 20 22 24 31 22 20 7c 20 67 72  f echo "$1" | gr
0030: 65 70 20 27 5e 5b 30 2d 39 5d 5b 30 2d 39 5d 2a  ep '^[0-9][0-9]*
0040: 5c 2e 27 20 3e 2f 64 65 76 2f 6e 75 6c 6c 20 7c  \.' >/dev/null |
0050: 7c 20 65 63 68 6f 20 22 24 31 22 20 7c 20 67 72  | echo "$1" | gr
0060: 65 70 20 27 5e 63 76 73 5f 27 20 3e 2f 64 65 76  ep '^cvs_' >/dev
0070: 2f 6e 75 6c 6c 3b 20 74 68 65 6e 0a 09 54 43 4c  /null; then..TCL
0080: 56 45 52 53 3d 22 24 31 22 0a 0a 09 73 68 69 66  VERS="$1"...shif
0090: 74 0a 66 69 0a 65 78 70 6f 72 74 20 54 43 4c 56  t.fi.export TCLV
00a0: 45 52 53 0a 0a 23 20 44 65 74 65 72 6d 69 6e 65  ERS..# Determine
00b0: 20 61 70 70 72 6f 70 72 69 61 74 65 20 6d 6f 64   appropriate mod
00c0: 65 0a 6d 6f 64 65 3d 22 62 75 69 6c 64 22 0a 69  e.mode="build".i
00d0: 66 20 5b 20 22 24 31 22 20 3d 20 22 63 6c 65 61  f [ "$1" = "clea
00e0: 6e 22 20 5d 3b 20 74 68 65 6e 0a 09 73 68 69 66  n" ]; then..shif
00f0: 74 0a 0a 09 6d 6f 64 65 3d 22 63 6c 65 61 6e 22  t...mode="clean"
0100: 0a 66 69 0a 69 66 20 5b 20 22 24 31 22 20 3d 20  .fi.if [ "$1" = 
0110: 22 64 69 73 74 63 6c 65 61 6e 22 20 5d 3b 20 74  "distclean" ]; t
0120: 68 65 6e 0a 09 73 68 69 66 74 0a 0a 09 6d 6f 64  hen..shift...mod
0130: 65 3d 22 64 69 73 74 63 6c 65 61 6e 22 0a 66 69  e="distclean".fi
0140: 0a 0a 23 20 44 65 66 69 6e 65 20 74 68 65 20 6c  ..# Define the l
0150: 69 73 74 20 6f 66 20 61 6c 6c 20 70 61 63 6b 61  ist of all packa
0160: 67 65 73 2c 20 66 6f 72 20 63 6c 65 61 6e 69 6e  ges, for cleanin
0170: 67 20 70 75 72 70 6f 73 65 73 0a 4b 49 54 43 52  g purposes.KITCR
0180: 45 41 54 4f 52 5f 41 4c 4c 50 4b 47 53 3d 22 6b  EATOR_ALLPKGS="k
0190: 69 74 73 68 20 74 63 6c 20 74 63 6c 76 66 73 20  itsh tcl tclvfs 
01a0: 7a 6c 69 62 20 74 6b 20 69 74 63 6c 20 6d 6b 34  zlib tk itcl mk4
01b0: 74 63 6c 20 74 68 72 65 61 64 20 6b 69 74 64 6c  tcl thread kitdl
01c0: 6c 22 0a 66 6f 72 20 70 6b 67 20 69 6e 20 24 7b  l".for pkg in ${
01d0: 4b 49 54 43 52 45 41 54 4f 52 5f 41 4c 4c 50 4b  KITCREATOR_ALLPK
01e0: 47 53 7d 3b 20 64 6f 0a 09 72 6d 20 2d 66 20 22  GS}; do..rm -f "
01f0: 24 7b 70 6b 67 7d 2f 62 75 69 6c 64 2e 6c 6f 67  ${pkg}/build.log
0200: 22 0a 09 72 6d 20 2d 72 66 20 22 24 7b 70 6b 67  "..rm -rf "${pkg
0210: 7d 2f 6f 75 74 22 20 22 24 7b 70 6b 67 7d 2f 69  }/out" "${pkg}/i
0220: 6e 73 74 22 20 22 24 7b 70 6b 67 7d 2f 62 75 69  nst" "${pkg}/bui
0230: 6c 64 22 0a 0a 09 69 66 20 5b 20 22 24 7b 6d 6f  ld"...if [ "${mo
0240: 64 65 7d 22 20 3d 20 22 64 69 73 74 63 6c 65 61  de}" = "distclea
0250: 6e 22 20 5d 3b 20 74 68 65 6e 0a 09 09 72 6d 20  n" ]; then...rm 
0260: 2d 72 66 20 22 24 7b 70 6b 67 7d 2f 73 72 63 22  -rf "${pkg}/src"
0270: 0a 09 66 69 0a 64 6f 6e 65 0a 0a 23 20 57 65 27  ..fi.done..# We'
0280: 72 65 20 61 6c 6c 20 64 6f 6e 65 20 69 66 20 77  re all done if w
0290: 65 27 72 65 20 69 6e 20 63 6c 65 61 6e 20 6f 72  e're in clean or
02a0: 20 64 69 73 74 63 6c 65 61 6e 20 6d 6f 64 65 0a   distclean mode.
02b0: 69 66 20 5b 20 22 24 7b 6d 6f 64 65 7d 22 20 3d  if [ "${mode}" =
02c0: 20 22 63 6c 65 61 6e 22 20 2d 6f 20 22 24 7b 6d   "clean" -o "${m
02d0: 6f 64 65 7d 22 20 3d 20 22 64 69 73 74 63 6c 65  ode}" = "distcle
02e0: 61 6e 22 20 5d 3b 20 74 68 65 6e 0a 09 72 6d 20  an" ]; then..rm 
02f0: 2d 66 20 74 63 6c 6b 69 74 2d 2a 0a 09 72 6d 20  -f tclkit-*..rm 
0300: 2d 66 20 6c 69 62 74 63 6c 6b 69 74 2d 2a 2e 2a  -f libtclkit-*.*
0310: 0a 0a 09 65 78 69 74 20 30 0a 66 69 0a 0a 23 20  ...exit 0.fi..# 
0320: 41 64 64 20 70 61 63 6b 61 67 65 73 20 69 6d 70  Add packages imp
0330: 6c 69 65 64 20 62 79 20 74 68 65 20 61 64 64 69  lied by the addi
0340: 74 69 6f 6e 61 6c 20 61 72 67 75 6d 65 6e 74 73  tional arguments
0350: 0a 69 66 20 5b 20 2d 7a 20 22 24 7b 4b 49 54 43  .if [ -z "${KITC
0360: 52 45 41 54 4f 52 5f 50 4b 47 53 7d 22 20 5d 3b  REATOR_PKGS}" ];
0370: 20 74 68 65 6e 0a 09 4b 49 54 43 52 45 41 54 4f   then..KITCREATO
0380: 52 5f 50 4b 47 53 3d 22 74 6b 20 69 74 63 6c 20  R_PKGS="tk itcl 
0390: 6d 6b 34 74 63 6c 22 0a 66 69 0a 0a 43 4f 4e 46  mk4tcl".fi..CONF
03a0: 49 47 55 52 45 45 58 54 52 41 3d 22 24 40 22 0a  IGUREEXTRA="$@".
03b0: 65 78 70 6f 72 74 20 43 4f 4e 46 49 47 55 52 45  export CONFIGURE
03c0: 45 58 54 52 41 0a 0a 69 66 20 65 63 68 6f 20 22  EXTRA..if echo "
03d0: 20 24 7b 43 4f 4e 46 49 47 55 52 45 45 58 54 52   ${CONFIGUREEXTR
03e0: 41 7d 20 22 20 7c 20 67 72 65 70 20 27 20 2d 2d  A} " | grep ' --
03f0: 65 6e 61 62 6c 65 2d 74 68 72 65 61 64 73 27 20  enable-threads' 
0400: 3e 2f 64 65 76 2f 6e 75 6c 6c 20 32 3e 2f 64 65  >/dev/null 2>/de
0410: 76 2f 6e 75 6c 6c 3b 20 74 68 65 6e 0a 09 4b 49  v/null; then..KI
0420: 54 43 52 45 41 54 4f 52 5f 50 4b 47 53 3d 22 24  TCREATOR_PKGS="$
0430: 7b 4b 49 54 43 52 45 41 54 4f 52 5f 50 4b 47 53  {KITCREATOR_PKGS
0440: 7d 20 74 68 72 65 61 64 22 0a 66 69 0a 0a 23 20  } thread".fi..# 
0450: 46 69 78 20 75 70 20 70 61 63 6b 61 67 65 20 6c  Fix up package l
0460: 69 73 74 0a 23 23 20 49 66 20 62 75 69 6c 64 69  ist.## If buildi
0470: 6e 67 20 4b 69 74 44 4c 4c 2c 20 69 74 20 6d 75  ng KitDLL, it mu
0480: 73 74 20 63 6f 6d 65 20 6c 61 73 74 0a 69 66 20  st come last.if 
0490: 65 63 68 6f 20 22 20 24 7b 4b 49 54 43 52 45 41  echo " ${KITCREA
04a0: 54 4f 52 5f 50 4b 47 53 7d 20 22 20 7c 20 67 72  TOR_PKGS} " | gr
04b0: 65 70 20 27 20 6b 69 74 64 6c 6c 20 27 20 3e 2f  ep ' kitdll ' >/
04c0: 64 65 76 2f 6e 75 6c 6c 20 32 3e 2f 64 65 76 2f  dev/null 2>/dev/
04d0: 6e 75 6c 6c 3b 20 74 68 65 6e 0a 09 4b 49 54 43  null; then..KITC
04e0: 52 45 41 54 4f 52 5f 50 4b 47 53 3d 22 24 28 65  REATOR_PKGS="$(e
04f0: 63 68 6f 20 22 20 24 7b 4b 49 54 43 52 45 41 54  cho " ${KITCREAT
0500: 4f 52 5f 50 4b 47 53 7d 20 22 20 7c 20 73 65 64  OR_PKGS} " | sed
0510: 20 27 73 40 20 6b 69 74 64 6c 6c 20 40 20 40 67   's@ kitdll @ @g
0520: 3b 73 40 5e 20 20 2a 40 40 3b 73 40 20 20 2a 24  ;s@^  *@@;s@  *$
0530: 40 40 3b 73 40 20 20 20 2a 40 20 40 67 27 29 20  @@;s@   *@ @g') 
0540: 6b 69 74 64 6c 6c 22 0a 66 69 0a 0a 23 23 20 49  kitdll".fi..## I
0550: 66 20 62 75 69 6c 64 69 6e 67 20 4b 69 74 44 4c  f building KitDL
0560: 4c 20 61 6e 64 20 54 6b 2c 20 6d 75 73 74 20 64  L and Tk, must d
0570: 6f 20 54 6b 20 73 74 61 74 69 63 61 6c 6c 79 0a  o Tk statically.
0580: 23 23 23 20 28 57 65 6c 6c 2c 20 77 65 20 64 6f  ### (Well, we do
0590: 6e 27 74 20 48 41 56 45 20 74 6f 2c 20 62 75 74  n't HAVE to, but
05a0: 20 69 74 20 77 6f 75 6c 64 20 64 65 66 65 61 74   it would defeat
05b0: 20 6d 75 63 68 20 6f 66 20 74 68 65 20 70 75 72   much of the pur
05c0: 70 6f 73 65 29 0a 69 66 20 65 63 68 6f 20 22 20  pose).if echo " 
05d0: 24 7b 4b 49 54 43 52 45 41 54 4f 52 5f 50 4b 47  ${KITCREATOR_PKG
05e0: 53 7d 20 22 20 7c 20 67 72 65 70 20 27 20 6b 69  S} " | grep ' ki
05f0: 74 64 6c 6c 20 27 20 3e 2f 64 65 76 2f 6e 75 6c  tdll ' >/dev/nul
0600: 6c 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 3b 20 74  l 2>/dev/null; t
0610: 68 65 6e 0a 09 69 66 20 65 63 68 6f 20 22 20 24  hen..if echo " $
0620: 7b 4b 49 54 43 52 45 41 54 4f 52 5f 50 4b 47 53  {KITCREATOR_PKGS
0630: 7d 20 22 20 7c 20 67 72 65 70 20 27 20 74 6b 20  } " | grep ' tk 
0640: 27 20 3e 2f 64 65 76 2f 6e 75 6c 6c 20 32 3e 2f  ' >/dev/null 2>/
0650: 64 65 76 2f 6e 75 6c 6c 3b 20 74 68 65 6e 0a 09  dev/null; then..
0660: 09 69 66 20 5b 20 22 24 7b 53 54 41 54 49 43 54  .if [ "${STATICT
0670: 4b 7d 22 20 21 3d 20 22 31 22 20 2d 61 20 22 24  K}" != "1" -a "$
0680: 7b 53 54 41 54 49 43 54 4b 7d 22 20 21 3d 20 22  {STATICTK}" != "
0690: 2d 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 65  -1" ]; then....e
06a0: 63 68 6f 20 27 57 61 72 6e 69 6e 67 3a 20 4c 69  cho 'Warning: Li
06b0: 6e 6b 69 6e 67 20 54 6b 20 73 74 61 74 69 63 61  nking Tk statica
06c0: 6c 6c 79 20 62 65 63 61 75 73 65 20 79 6f 75 20  lly because you 
06d0: 61 72 65 20 62 75 69 6c 64 69 6e 67 20 4b 69 74  are building Kit
06e0: 44 4c 4c 27 20 32 3e 26 31 0a 09 09 09 65 63 68  DLL' 2>&1....ech
06f0: 6f 20 27 20 20 20 20 20 20 20 20 20 53 65 74 20  o '         Set 
0700: 53 54 41 54 49 43 54 4b 20 74 6f 20 2d 31 20 69  STATICTK to -1 i
0710: 66 20 79 6f 75 20 72 65 61 6c 6c 79 20 77 61 6e  f you really wan
0720: 74 20 74 6f 20 6c 69 6e 6b 20 54 6b 20 64 79 6e  t to link Tk dyn
0730: 61 6d 69 63 61 6c 6c 79 2e 27 20 3e 26 32 0a 0a  amically.' >&2..
0740: 09 09 09 53 54 41 54 49 43 54 4b 3d 22 31 22 0a  ...STATICTK="1".
0750: 09 09 09 65 78 70 6f 72 74 20 53 54 41 54 49 43  ...export STATIC
0760: 54 4b 0a 09 09 66 69 0a 09 66 69 0a 66 69 0a 0a  TK...fi..fi.fi..
0770: 66 61 69 6c 65 64 70 6b 67 73 3d 22 22 0a 62 75  failedpkgs="".bu
0780: 69 6c 64 66 61 69 6c 65 64 3d 22 30 22 0a 66 6f  ildfailed="0".fo
0790: 72 20 70 6b 67 20 69 6e 20 74 63 6c 20 74 63 6c  r pkg in tcl tcl
07a0: 76 66 73 20 7a 6c 69 62 20 24 7b 4b 49 54 43 52  vfs zlib ${KITCR
07b0: 45 41 54 4f 52 5f 50 4b 47 53 7d 20 6b 69 74 73  EATOR_PKGS} kits
07c0: 68 3b 20 64 6f 0a 09 65 63 68 6f 20 2d 6e 20 22  h; do..echo -n "
07d0: 42 75 69 6c 64 69 6e 67 20 24 7b 70 6b 67 7d 20  Building ${pkg} 
07e0: 2e 2e 2e 22 0a 0a 09 66 61 69 6c 65 64 3d 22 30  ..."...failed="0
07f0: 22 0a 09 28 0a 09 09 63 64 20 22 24 7b 70 6b 67  "..(...cd "${pkg
0800: 7d 22 20 3e 2f 64 65 76 2f 6e 75 6c 6c 20 32 3e  }" >/dev/null 2>
0810: 2f 64 65 76 2f 6e 75 6c 6c 20 7c 7c 20 65 78 69  /dev/null || exi
0820: 74 20 31 0a 0a 09 09 2e 2f 62 75 69 6c 64 2e 73  t 1...../build.s
0830: 68 20 3e 20 62 75 69 6c 64 2e 6c 6f 67 20 32 3e  h > build.log 2>
0840: 26 31 20 7c 7c 20 65 78 69 74 20 31 0a 09 29 20  &1 || exit 1..) 
0850: 7c 7c 20 66 61 69 6c 65 64 3d 22 31 22 0a 0a 09  || failed="1"...
0860: 69 66 20 5b 20 22 24 7b 66 61 69 6c 65 64 7d 22  if [ "${failed}"
0870: 20 3d 20 22 31 22 20 5d 3b 20 74 68 65 6e 0a 09   = "1" ]; then..
0880: 09 65 63 68 6f 20 22 20 66 61 69 6c 65 64 2e 22  .echo " failed."
0890: 0a 09 09 66 61 69 6c 65 64 70 6b 67 73 3d 22 24  ...failedpkgs="$
08a0: 7b 66 61 69 6c 65 64 70 6b 67 73 7d 20 24 7b 70  {failedpkgs} ${p
08b0: 6b 67 7d 22 0a 09 65 6c 73 65 0a 09 09 65 63 68  kg}"..else...ech
08c0: 6f 20 22 20 64 6f 6e 65 2e 22 0a 09 66 69 0a 0a  o " done."..fi..
08d0: 09 63 61 73 65 20 22 24 7b 70 6b 67 7d 22 20 69  .case "${pkg}" i
08e0: 6e 0a 09 09 74 63 6c 29 0a 09 09 09 54 43 4c 43  n...tcl)....TCLC
08f0: 4f 4e 46 49 47 44 49 52 3d 24 28 66 69 6e 64 20  ONFIGDIR=$(find 
0900: 22 24 28 70 77 64 29 2f 74 63 6c 2f 62 75 69 6c  "$(pwd)/tcl/buil
0910: 64 22 20 2d 6e 61 6d 65 20 74 63 6c 43 6f 6e 66  d" -name tclConf
0920: 69 67 2e 73 68 20 7c 20 68 65 61 64 20 2d 31 20  ig.sh | head -1 
0930: 7c 20 73 65 64 20 27 73 40 2f 5b 5e 2f 5d 2a 24  | sed 's@/[^/]*$
0940: 40 40 27 29 0a 09 09 09 65 78 70 6f 72 74 20 54  @@')....export T
0950: 43 4c 43 4f 4e 46 49 47 44 49 52 0a 09 09 09 3b  CLCONFIGDIR....;
0960: 3b 0a 09 65 73 61 63 0a 0a 09 69 66 20 5b 20 22  ;..esac...if [ "
0970: 24 7b 66 61 69 6c 65 64 7d 22 20 3d 20 22 31 22  ${failed}" = "1"
0980: 20 5d 3b 20 74 68 65 6e 0a 09 09 62 75 69 6c 64   ]; then...build
0990: 66 61 69 6c 65 64 3d 22 31 22 0a 09 66 69 0a 64  failed="1"..fi.d
09a0: 6f 6e 65 0a 0a 69 66 20 5b 20 2d 6e 20 22 24 7b  one..if [ -n "${
09b0: 66 61 69 6c 65 64 70 6b 67 73 7d 22 20 5d 3b 20  failedpkgs}" ]; 
09c0: 74 68 65 6e 0a 09 65 63 68 6f 20 22 46 61 69 6c  then..echo "Fail
09d0: 65 64 20 74 6f 20 62 75 69 6c 64 3a 24 7b 66 61  ed to build:${fa
09e0: 69 6c 65 64 70 6b 67 73 7d 22 0a 66 69 0a 0a 69  iledpkgs}".fi..i
09f0: 66 20 5b 20 22 24 7b 62 75 69 6c 64 66 61 69 6c  f [ "${buildfail
0a00: 65 64 7d 22 20 21 3d 20 22 30 22 20 5d 3b 20 74  ed}" != "0" ]; t
0a10: 68 65 6e 0a 09 65 63 68 6f 20 27 57 41 52 4e 49  hen..echo 'WARNI
0a20: 4e 47 3a 20 42 75 69 6c 64 20 69 73 20 6c 69 6b  NG: Build is lik
0a30: 65 6c 79 20 69 6e 63 6f 6d 70 6c 65 74 65 20 6f  ely incomplete o
0a40: 72 20 66 61 69 6c 65 64 2e 27 20 3e 26 32 0a 66  r failed.' >&2.f
0a50: 69 0a 0a 66 6f 72 20 6b 69 74 64 6c 6c 66 69 6c  i..for kitdllfil
0a60: 65 20 69 6e 20 27 6b 69 74 64 6c 6c 2f 62 75 69  e in 'kitdll/bui
0a70: 6c 64 27 2f 6b 69 74 64 6c 6c 2d 2a 2f 6c 69 62  ld'/kitdll-*/lib
0a80: 74 63 6c 6b 69 74 2e 2a 3b 20 64 6f 0a 09 63 70  tclkit.*; do..cp
0a90: 20 22 24 7b 6b 69 74 64 6c 6c 66 69 6c 65 7d 22   "${kitdllfile}"
0aa0: 20 22 24 28 65 63 68 6f 20 22 24 7b 6b 69 74 64   "$(echo "${kitd
0ab0: 6c 6c 66 69 6c 65 7d 22 20 7c 20 73 65 64 20 22  llfile}" | sed "
0ac0: 73 40 5e 2e 2a 2f 40 40 3b 73 40 5c 2e 2e 2a 5c  s@^.*/@@;s@\..*\
0ad0: 24 40 2d 24 7b 54 43 4c 56 45 52 53 7d 26 40 22  $@-${TCLVERS}&@"
0ae0: 29 22 20 3e 2f 64 65 76 2f 6e 75 6c 6c 20 32 3e  )" >/dev/null 2>
0af0: 2f 64 65 76 2f 6e 75 6c 6c 0a 64 6f 6e 65 0a 63  /dev/null.done.c
0b00: 70 20 27 6b 69 74 73 68 2f 62 75 69 6c 64 27 2f  p 'kitsh/build'/
0b10: 6b 69 74 73 68 2d 2a 2f 6b 69 74 20 22 74 63 6c  kitsh-*/kit "tcl
0b20: 6b 69 74 2d 24 7b 54 43 4c 56 45 52 53 7d 22 0a  kit-${TCLVERS}".
0b30: 0a 65 78 69 74 20 22 24 7b 62 75 69 6c 64 66 61  .exit "${buildfa
0b40: 69 6c 65 64 7d 22 0a                             iled}".