Hex Artifact Content

Artifact ad0be0099ea04adc57ba7110f89e247e1300e465:


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 28 0a 09 09 69 33 38 36 2d 70 63 2d 73  ms=(...i386-pc-s
0080: 6f 6c 61 72 69 73 32 2e 31 30 40 73 6f 6c 61 72  olaris2.10@solar
0090: 69 73 32 2e 31 30 2d 69 78 38 36 0a 09 09 69 33  is2.10-ix86...i3
00a0: 38 36 2d 70 63 2d 73 6f 6c 61 72 69 73 32 2e 31  86-pc-solaris2.1
00b0: 30 2c 36 34 40 73 6f 6c 61 72 69 73 32 2e 31 30  0,64@solaris2.10
00c0: 2d 78 38 36 5f 36 34 0a 09 09 6d 69 70 73 65 6c  -x86_64...mipsel
00d0: 2d 75 6e 6b 6e 6f 77 6e 2d 6c 69 6e 75 78 2d 75  -unknown-linux-u
00e0: 63 6c 69 62 63 40 6c 69 6e 75 78 2d 67 6c 69 62  clibc@linux-glib
00f0: 63 32 2e 30 2d 6d 69 70 73 65 6c 0a 09 09 73 70  c2.0-mipsel...sp
0100: 61 72 63 2d 73 75 6e 2d 73 6f 6c 61 72 69 73 32  arc-sun-solaris2
0110: 2e 38 40 73 6f 6c 61 72 69 73 32 2e 38 2d 73 70  .8@solaris2.8-sp
0120: 61 72 63 0a 09 09 73 70 61 72 63 2d 73 75 6e 2d  arc...sparc-sun-
0130: 73 6f 6c 61 72 69 73 32 2e 38 2c 36 34 40 73 6f  solaris2.8,64@so
0140: 6c 61 72 69 73 32 2e 38 2d 73 70 61 72 63 36 34  laris2.8-sparc64
0150: 0a 09 09 73 70 61 72 63 2d 73 75 6e 2d 73 6f 6c  ...sparc-sun-sol
0160: 61 72 69 73 32 2e 31 30 40 73 6f 6c 61 72 69 73  aris2.10@solaris
0170: 32 2e 31 30 2d 73 70 61 72 63 0a 09 09 73 70 61  2.10-sparc...spa
0180: 72 63 2d 73 75 6e 2d 73 6f 6c 61 72 69 73 32 2e  rc-sun-solaris2.
0190: 31 30 2c 36 34 40 73 6f 6c 61 72 69 73 32 2e 31  10,64@solaris2.1
01a0: 30 2d 73 70 61 72 63 36 34 0a 09 09 78 38 36 5f  0-sparc64...x86_
01b0: 36 34 2d 75 6e 6b 6e 6f 77 6e 2d 66 72 65 65 62  64-unknown-freeb
01c0: 73 64 38 40 66 72 65 65 62 73 64 38 2d 78 38 36  sd8@freebsd8-x86
01d0: 5f 36 34 0a 09 09 78 38 36 5f 36 34 2d 75 6e 6b  _64...x86_64-unk
01e0: 6e 6f 77 6e 2d 6e 65 74 62 73 64 35 40 6e 65 74  nown-netbsd5@net
01f0: 62 73 64 35 2d 78 38 36 5f 36 34 0a 09 09 61 72  bsd5-x86_64...ar
0200: 6d 2d 61 6e 64 72 6f 69 64 39 2d 6c 69 6e 75 78  m-android9-linux
0210: 2d 61 6e 64 72 6f 69 64 65 61 62 69 40 6c 69 6e  -androideabi@lin
0220: 75 78 2d 75 6e 6b 6e 6f 77 6e 2d 61 72 6d 0a 09  ux-unknown-arm..
0230: 09 69 35 38 36 2d 6d 69 6e 67 77 33 32 6d 73 76  .i586-mingw32msv
0240: 63 40 77 69 6e 33 32 2d 69 78 38 36 0a 09 09 78  c@win32-ix86...x
0250: 38 36 5f 36 34 2d 77 36 34 2d 6d 69 6e 67 77 33  86_64-w64-mingw3
0260: 32 40 77 69 6e 33 32 2d 78 38 36 5f 36 34 0a 09  2@win32-x86_64..
0270: 09 78 38 36 5f 36 34 2d 72 65 64 68 61 74 35 2d  .x86_64-redhat5-
0280: 6c 69 6e 75 78 40 6c 69 6e 75 78 2d 67 6c 69 62  linux@linux-glib
0290: 63 32 2e 35 2d 78 38 36 5f 36 34 0a 09 09 70 6f  c2.5-x86_64...po
02a0: 77 65 72 70 63 2d 69 62 6d 2d 61 69 78 35 2e 33  werpc-ibm-aix5.3
02b0: 2e 30 2e 30 40 61 69 78 2d 70 6f 77 65 72 70 63  .0.0@aix-powerpc
02c0: 0a 09 29 0a 65 6c 73 65 0a 09 70 6c 61 74 66 6f  ..).else..platfo
02d0: 72 6d 73 3d 22 24 40 22 0a 66 69 0a 0a 66 6f 72  rms="$@".fi..for
02e0: 20 70 6c 61 74 66 6f 72 6d 20 69 6e 20 22 24 7b   platform in "${
02f0: 70 6c 61 74 66 6f 72 6d 73 5b 40 5d 7d 22 3b 20  platforms[@]}"; 
0300: 64 6f 0a 09 65 63 68 6f 20 22 20 20 2a 20 42 75  do..echo "  * Bu
0310: 69 6c 64 69 6e 67 20 66 6f 72 20 24 7b 70 6c 61  ilding for ${pla
0320: 74 66 6f 72 6d 7d 22 0a 09 63 63 5f 70 6c 61 74  tform}"..cc_plat
0330: 66 6f 72 6d 3d 22 24 28 65 63 68 6f 20 22 24 7b  form="$(echo "${
0340: 70 6c 61 74 66 6f 72 6d 7d 22 20 7c 20 63 75 74  platform}" | cut
0350: 20 2d 66 20 31 20 2d 64 20 27 40 27 29 22 0a 09   -f 1 -d '@')"..
0360: 74 63 6c 5f 70 6c 61 74 66 6f 72 6d 3d 22 24 28  tcl_platform="$(
0370: 65 63 68 6f 20 22 24 7b 70 6c 61 74 66 6f 72 6d  echo "${platform
0380: 7d 22 20 7c 20 63 75 74 20 2d 66 20 32 20 2d 64  }" | cut -f 2 -d
0390: 20 27 40 27 29 22 0a 09 6f 70 74 73 3d 27 27 0a   '@')"..opts=''.
03a0: 09 73 65 74 75 70 5f 63 63 5f 6f 70 74 73 3d 27  .setup_cc_opts='
03b0: 27 0a 09 63 6f 6e 66 69 67 75 72 65 5f 6f 70 74  '..configure_opt
03c0: 73 3d 27 27 0a 0a 09 69 66 20 65 63 68 6f 20 22  s=''...if echo "
03d0: 24 7b 63 63 5f 70 6c 61 74 66 6f 72 6d 7d 22 20  ${cc_platform}" 
03e0: 7c 20 67 72 65 70 20 27 2c 27 20 3e 2f 64 65 76  | grep ',' >/dev
03f0: 2f 6e 75 6c 6c 3b 20 74 68 65 6e 0a 09 09 6f 70  /null; then...op
0400: 74 73 3d 22 24 28 65 63 68 6f 20 22 24 7b 63 63  ts="$(echo "${cc
0410: 5f 70 6c 61 74 66 6f 72 6d 7d 22 20 7c 20 63 75  _platform}" | cu
0420: 74 20 2d 66 20 32 2d 20 2d 64 20 27 2c 27 20 7c  t -f 2- -d ',' |
0430: 20 73 65 64 20 27 73 40 2c 40 20 40 67 27 29 22   sed 's@,@ @g')"
0440: 0a 09 09 63 63 5f 70 6c 61 74 66 6f 72 6d 3d 22  ...cc_platform="
0450: 24 28 65 63 68 6f 20 22 24 7b 63 63 5f 70 6c 61  $(echo "${cc_pla
0460: 74 66 6f 72 6d 7d 22 20 7c 20 63 75 74 20 2d 66  tform}" | cut -f
0470: 20 31 20 2d 64 20 27 2c 27 29 22 0a 09 66 69 0a   1 -d ',')"..fi.
0480: 0a 09 63 61 73 65 20 22 24 7b 74 63 6c 5f 70 6c  ..case "${tcl_pl
0490: 61 74 66 6f 72 6d 7d 22 20 69 6e 0a 09 09 2a 36  atform}" in...*6
04a0: 34 29 0a 09 09 09 69 73 36 34 62 69 74 3d 27 31  4)....is64bit='1
04b0: 27 0a 09 09 09 3b 3b 0a 09 09 2a 29 0a 09 09 09  '....;;...*)....
04c0: 69 73 36 34 62 69 74 3d 27 30 27 0a 09 09 09 3b  is64bit='0'....;
04d0: 3b 0a 09 65 73 61 63 0a 0a 09 66 6f 72 20 6f 70  ;..esac...for op
04e0: 74 20 69 6e 20 24 6f 70 74 73 3b 20 64 6f 0a 09  t in $opts; do..
04f0: 09 63 61 73 65 20 22 24 7b 6f 70 74 7d 22 20 69  .case "${opt}" i
0500: 6e 0a 09 09 09 36 34 29 0a 09 09 09 09 73 65 74  n....64).....set
0510: 75 70 5f 63 63 5f 6f 70 74 73 3d 22 24 7b 73 65  up_cc_opts="${se
0520: 74 75 70 5f 63 63 5f 6f 70 74 73 7d 20 36 34 22  tup_cc_opts} 64"
0530: 0a 09 09 09 09 69 73 36 34 62 69 74 3d 27 31 27  .....is64bit='1'
0540: 0a 09 09 09 09 3b 3b 0a 09 09 09 33 32 29 0a 09  .....;;....32)..
0550: 09 09 09 73 65 74 75 70 5f 63 63 5f 6f 70 74 73  ...setup_cc_opts
0560: 3d 22 24 7b 73 65 74 75 70 5f 63 63 5f 6f 70 74  ="${setup_cc_opt
0570: 73 7d 20 33 32 22 0a 09 09 09 09 69 73 36 34 62  s} 32".....is64b
0580: 69 74 3d 27 30 27 0a 09 09 09 09 3b 3b 0a 09 09  it='0'.....;;...
0590: 65 73 61 63 0a 09 64 6f 6e 65 0a 0a 09 69 66 20  esac..done...if 
05a0: 5b 20 22 24 7b 69 73 36 34 62 69 74 7d 22 20 3d  [ "${is64bit}" =
05b0: 20 27 31 27 20 5d 3b 20 74 68 65 6e 0a 09 09 63   '1' ]; then...c
05c0: 6f 6e 66 69 67 75 72 65 5f 6f 70 74 73 3d 22 24  onfigure_opts="$
05d0: 7b 63 6f 6e 66 69 67 75 72 65 5f 6f 70 74 73 7d  {configure_opts}
05e0: 20 2d 2d 65 6e 61 62 6c 65 2d 36 34 62 69 74 22   --enable-64bit"
05f0: 0a 09 66 69 0a 0a 09 28 0a 09 09 65 76 61 6c 20  ..fi...(...eval 
0600: 22 24 28 22 24 7b 53 45 54 55 50 5f 43 43 7d 22  "$("${SETUP_CC}"
0610: 20 22 24 7b 63 63 5f 70 6c 61 74 66 6f 72 6d 7d   "${cc_platform}
0620: 22 20 24 7b 73 65 74 75 70 5f 63 63 5f 6f 70 74  " ${setup_cc_opt
0630: 73 7d 20 7c 7c 20 65 63 68 6f 20 65 78 69 74 20  s} || echo exit 
0640: 31 29 22 0a 0a 09 09 46 4f 52 43 45 5f 50 4c 41  1)"....FORCE_PLA
0650: 54 46 4f 52 4d 3d 22 24 7b 74 63 6c 5f 70 6c 61  TFORM="${tcl_pla
0660: 74 66 6f 72 6d 7d 22 0a 09 09 65 78 70 6f 72 74  tform}"...export
0670: 20 46 4f 52 43 45 5f 50 4c 41 54 46 4f 52 4d 0a   FORCE_PLATFORM.
0680: 0a 09 09 2e 2f 62 75 69 6c 64 5f 61 6c 6c 2e 73  ..../build_all.s
0690: 68 20 63 6c 65 61 6e 0a 0a 09 09 2e 2f 62 75 69  h clean...../bui
06a0: 6c 64 5f 61 6c 6c 2e 73 68 20 2d 2d 68 6f 73 74  ld_all.sh --host
06b0: 3d 22 24 7b 63 63 5f 70 6c 61 74 66 6f 72 6d 7d  ="${cc_platform}
06c0: 22 20 24 7b 63 6f 6e 66 69 67 75 72 65 5f 6f 70  " ${configure_op
06d0: 74 73 7d 0a 09 29 0a 64 6f 6e 65 0a 0a           ts}..).done..