Hex Artifact Content

Artifact dd08562c69d36280b6eff391399ee734ae5dd445:


0000: 23 21 20 2f 62 69 6e 2f 62 61 73 68 0a 0a 43 43  #! /bin/bash..CC
0010: 52 4f 4f 54 3d 22 24 7b 48 4f 4d 45 7d 2f 72 6f  ROOT="${HOME}/ro
0020: 6f 74 2f 63 72 6f 73 73 2d 63 6f 6d 70 69 6c 65  ot/cross-compile
0030: 72 73 22 0a 53 45 54 55 50 5f 43 43 3d 22 24 7b  rs".SETUP_CC="${
0040: 43 43 52 4f 4f 54 7d 2f 73 65 74 75 70 2d 63 63  CCROOT}/setup-cc
0050: 22 0a 0a 69 66 20 5b 20 2d 7a 20 22 24 31 22 20  "..if [ -z "$1" 
0060: 5d 3b 20 74 68 65 6e 0a 09 70 6c 61 74 66 6f 72  ]; then..platfor
0070: 6d 73 3d 22 69 33 38 36 2d 70 63 2d 73 6f 6c 61  ms="i386-pc-sola
0080: 72 69 73 32 2e 31 30 40 73 6f 6c 61 72 69 73 32  ris2.10@solaris2
0090: 2e 31 30 2d 69 78 38 36 20 69 33 38 36 2d 70 63  .10-ix86 i386-pc
00a0: 2d 73 6f 6c 61 72 69 73 32 2e 31 30 2c 36 34 40  -solaris2.10,64@
00b0: 73 6f 6c 61 72 69 73 32 2e 31 30 2d 78 38 36 5f  solaris2.10-x86_
00c0: 36 34 20 6d 69 70 73 65 6c 2d 75 6e 6b 6e 6f 77  64 mipsel-unknow
00d0: 6e 2d 6c 69 6e 75 78 2d 75 63 6c 69 62 63 40 6c  n-linux-uclibc@l
00e0: 69 6e 75 78 2d 67 6c 69 62 63 32 2e 30 2d 6d 69  inux-glibc2.0-mi
00f0: 70 73 65 6c 20 73 70 61 72 63 2d 73 75 6e 2d 73  psel sparc-sun-s
0100: 6f 6c 61 72 69 73 32 2e 38 40 73 6f 6c 61 72 69  olaris2.8@solari
0110: 73 32 2e 38 2d 73 70 61 72 63 20 73 70 61 72 63  s2.8-sparc sparc
0120: 2d 73 75 6e 2d 73 6f 6c 61 72 69 73 32 2e 38 2c  -sun-solaris2.8,
0130: 36 34 40 73 6f 6c 61 72 69 73 32 2e 38 2d 73 70  64@solaris2.8-sp
0140: 61 72 63 36 34 20 73 70 61 72 63 2d 73 75 6e 2d  arc64 sparc-sun-
0150: 73 6f 6c 61 72 69 73 32 2e 31 30 40 73 6f 6c 61  solaris2.10@sola
0160: 72 69 73 32 2e 31 30 2d 73 70 61 72 63 20 73 70  ris2.10-sparc sp
0170: 61 72 63 2d 73 75 6e 2d 73 6f 6c 61 72 69 73 32  arc-sun-solaris2
0180: 2e 31 30 2c 36 34 40 73 6f 6c 61 72 69 73 32 2e  .10,64@solaris2.
0190: 31 30 2d 73 70 61 72 63 36 34 20 78 38 36 5f 36  10-sparc64 x86_6
01a0: 34 2d 75 6e 6b 6e 6f 77 6e 2d 66 72 65 65 62 73  4-unknown-freebs
01b0: 64 38 40 66 72 65 65 62 73 64 38 2d 78 38 36 5f  d8@freebsd8-x86_
01c0: 36 34 20 78 38 36 5f 36 34 2d 75 6e 6b 6e 6f 77  64 x86_64-unknow
01d0: 6e 2d 6e 65 74 62 73 64 35 40 6e 65 74 62 73 64  n-netbsd5@netbsd
01e0: 35 2d 78 38 36 5f 36 34 20 61 72 6d 2d 61 6e 64  5-x86_64 arm-and
01f0: 72 6f 69 64 39 2d 6c 69 6e 75 78 2d 61 6e 64 72  roid9-linux-andr
0200: 6f 69 64 65 61 62 69 40 6c 69 6e 75 78 2d 75 6e  oideabi@linux-un
0210: 6b 6e 6f 77 6e 2d 61 72 6d 20 69 35 38 36 2d 6d  known-arm i586-m
0220: 69 6e 67 77 33 32 6d 73 76 63 40 77 69 6e 33 32  ingw32msvc@win32
0230: 2d 69 78 38 36 20 78 38 36 5f 36 34 2d 77 36 34  -ix86 x86_64-w64
0240: 2d 6d 69 6e 67 77 33 32 40 77 69 6e 33 32 2d 78  -mingw32@win32-x
0250: 38 36 5f 36 34 22 0a 65 6c 73 65 0a 09 70 6c 61  86_64".else..pla
0260: 74 66 6f 72 6d 73 3d 22 24 31 22 0a 66 69 0a 0a  tforms="$1".fi..
0270: 66 6f 72 20 70 6c 61 74 66 6f 72 6d 20 69 6e 20  for platform in 
0280: 24 7b 70 6c 61 74 66 6f 72 6d 73 7d 3b 20 64 6f  ${platforms}; do
0290: 0a 09 65 63 68 6f 20 22 20 20 2a 20 42 75 69 6c  ..echo "  * Buil
02a0: 64 69 6e 67 20 66 6f 72 20 24 7b 70 6c 61 74 66  ding for ${platf
02b0: 6f 72 6d 7d 22 0a 09 63 63 5f 70 6c 61 74 66 6f  orm}"..cc_platfo
02c0: 72 6d 3d 22 24 28 65 63 68 6f 20 22 24 7b 70 6c  rm="$(echo "${pl
02d0: 61 74 66 6f 72 6d 7d 22 20 7c 20 63 75 74 20 2d  atform}" | cut -
02e0: 66 20 31 20 2d 64 20 27 40 27 29 22 0a 09 74 63  f 1 -d '@')"..tc
02f0: 6c 5f 70 6c 61 74 66 6f 72 6d 3d 22 24 28 65 63  l_platform="$(ec
0300: 68 6f 20 22 24 7b 70 6c 61 74 66 6f 72 6d 7d 22  ho "${platform}"
0310: 20 7c 20 63 75 74 20 2d 66 20 32 20 2d 64 20 27   | cut -f 2 -d '
0320: 40 27 29 22 0a 09 6f 70 74 73 3d 27 27 0a 09 73  @')"..opts=''..s
0330: 65 74 75 70 5f 63 63 5f 6f 70 74 73 3d 27 27 0a  etup_cc_opts=''.
0340: 09 63 6f 6e 66 69 67 75 72 65 5f 6f 70 74 73 3d  .configure_opts=
0350: 27 27 0a 0a 09 69 66 20 65 63 68 6f 20 22 24 7b  ''...if echo "${
0360: 63 63 5f 70 6c 61 74 66 6f 72 6d 7d 22 20 7c 20  cc_platform}" | 
0370: 67 72 65 70 20 27 2c 27 20 3e 2f 64 65 76 2f 6e  grep ',' >/dev/n
0380: 75 6c 6c 3b 20 74 68 65 6e 0a 09 09 6f 70 74 73  ull; then...opts
0390: 3d 22 24 28 65 63 68 6f 20 22 24 7b 63 63 5f 70  ="$(echo "${cc_p
03a0: 6c 61 74 66 6f 72 6d 7d 22 20 7c 20 63 75 74 20  latform}" | cut 
03b0: 2d 66 20 32 2d 20 2d 64 20 27 2c 27 20 7c 20 73  -f 2- -d ',' | s
03c0: 65 64 20 27 73 40 2c 40 20 40 67 27 29 22 0a 09  ed 's@,@ @g')"..
03d0: 09 63 63 5f 70 6c 61 74 66 6f 72 6d 3d 22 24 28  .cc_platform="$(
03e0: 65 63 68 6f 20 22 24 7b 63 63 5f 70 6c 61 74 66  echo "${cc_platf
03f0: 6f 72 6d 7d 22 20 7c 20 63 75 74 20 2d 66 20 31  orm}" | cut -f 1
0400: 20 2d 64 20 27 2c 27 29 22 0a 09 66 69 0a 0a 09   -d ',')"..fi...
0410: 63 61 73 65 20 22 24 7b 74 63 6c 5f 70 6c 61 74  case "${tcl_plat
0420: 66 6f 72 6d 7d 22 20 69 6e 0a 09 09 2a 36 34 29  form}" in...*64)
0430: 0a 09 09 09 69 73 36 34 62 69 74 3d 27 31 27 0a  ....is64bit='1'.
0440: 09 09 09 3b 3b 0a 09 09 2a 29 0a 09 09 09 69 73  ...;;...*)....is
0450: 36 34 62 69 74 3d 27 30 27 0a 09 09 09 3b 3b 0a  64bit='0'....;;.
0460: 09 65 73 61 63 0a 0a 09 66 6f 72 20 6f 70 74 20  .esac...for opt 
0470: 69 6e 20 24 6f 70 74 73 3b 20 64 6f 0a 09 09 63  in $opts; do...c
0480: 61 73 65 20 22 24 7b 6f 70 74 7d 22 20 69 6e 0a  ase "${opt}" in.
0490: 09 09 09 36 34 29 0a 09 09 09 09 73 65 74 75 70  ...64).....setup
04a0: 5f 63 63 5f 6f 70 74 73 3d 22 24 7b 73 65 74 75  _cc_opts="${setu
04b0: 70 5f 63 63 5f 6f 70 74 73 7d 20 36 34 22 0a 09  p_cc_opts} 64"..
04c0: 09 09 09 69 73 36 34 62 69 74 3d 27 31 27 0a 09  ...is64bit='1'..
04d0: 09 09 09 3b 3b 0a 09 09 65 73 61 63 0a 09 64 6f  ...;;...esac..do
04e0: 6e 65 0a 0a 09 69 66 20 5b 20 22 24 7b 69 73 36  ne...if [ "${is6
04f0: 34 62 69 74 7d 22 20 3d 20 27 31 27 20 5d 3b 20  4bit}" = '1' ]; 
0500: 74 68 65 6e 0a 09 09 63 6f 6e 66 69 67 75 72 65  then...configure
0510: 5f 6f 70 74 73 3d 22 24 7b 63 6f 6e 66 69 67 75  _opts="${configu
0520: 72 65 5f 6f 70 74 73 7d 20 2d 2d 65 6e 61 62 6c  re_opts} --enabl
0530: 65 2d 36 34 62 69 74 22 0a 09 66 69 0a 0a 09 28  e-64bit"..fi...(
0540: 0a 09 09 65 76 61 6c 20 22 24 28 22 24 7b 53 45  ...eval "$("${SE
0550: 54 55 50 5f 43 43 7d 22 20 22 24 7b 63 63 5f 70  TUP_CC}" "${cc_p
0560: 6c 61 74 66 6f 72 6d 7d 22 20 24 7b 73 65 74 75  latform}" ${setu
0570: 70 5f 63 63 5f 6f 70 74 73 7d 20 7c 7c 20 65 63  p_cc_opts} || ec
0580: 68 6f 20 65 78 69 74 20 31 29 22 0a 0a 09 09 46  ho exit 1)"....F
0590: 4f 52 43 45 5f 50 4c 41 54 46 4f 52 4d 3d 22 24  ORCE_PLATFORM="$
05a0: 7b 74 63 6c 5f 70 6c 61 74 66 6f 72 6d 7d 22 0a  {tcl_platform}".
05b0: 09 09 65 78 70 6f 72 74 20 46 4f 52 43 45 5f 50  ..export FORCE_P
05c0: 4c 41 54 46 4f 52 4d 0a 0a 09 09 2e 2f 62 75 69  LATFORM...../bui
05d0: 6c 64 5f 61 6c 6c 2e 73 68 20 63 6c 65 61 6e 0a  ld_all.sh clean.
05e0: 0a 09 09 2e 2f 62 75 69 6c 64 5f 61 6c 6c 2e 73  ..../build_all.s
05f0: 68 20 2d 2d 68 6f 73 74 3d 22 24 7b 63 63 5f 70  h --host="${cc_p
0600: 6c 61 74 66 6f 72 6d 7d 22 20 24 7b 63 6f 6e 66  latform}" ${conf
0610: 69 67 75 72 65 5f 6f 70 74 73 7d 0a 09 29 0a 64  igure_opts}..).d
0620: 6f 6e 65 0a 0a                                   one..