| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | # Usage: buildall [-e] [-nocmp] [-work] |
| 4 | # |
| 5 | # Builds everything (std) for every GOOS/GOARCH combination but installs nothing. |
| 6 | # |
| 7 | # By default, runs the builds with -toolexec 'toolstash -cmp', to test that the |
| 8 | # toolchain is producing bit identical output to a previous known good toolchain. |
| 9 | # |
| 10 | # Options: |
| 11 | # -e: stop at first failure |
| 12 | # -nocmp: turn off toolstash -cmp; just check that ordinary builds succeed |
| 13 | # -work: pass -work to go command |
| 14 | |
| 15 | sete=false |
| 16 | if [scip-shell system . . `[`. "$1" = "-e" ]; then |
| 17 | sete=true |
| 18 | shift |
| 19 | fi |
| 20 | |
| 21 | cmp=true |
| 22 | if [scip-shell system . . `[`. "$1" = "-nocmp" ]; then |
| 23 | cmp=false |
| 24 | shift |
| 25 | fi |
| 26 | |
| 27 | work="" |
| 28 | if [scip-shell system . . `[`. "$1" = "-work" ]; then |
| 29 | work="-work" |
| 30 | shift |
| 31 | fi |
| 32 | |
| 33 | cd $(goscip-shell system . . go. env GOROOT)/src |
| 34 | goscip-shell system . . go. install cmd/compile cmd/link cmd/asm || exit 1 |
| 35 | pattern="$1" |
| 36 | if [scip-shell system . . `[`. "$pattern" = "" ]; then |
| 37 | pattern=. |
| 38 | fi |
| 39 | |
| 40 | targets="$(goscip-shell system . . go. tool dist list; echoscip-shell system . . echo. linux/386/softfloat)" |
| 41 | targets="$(echoscip-shell system . . echo. "$targets" | trscip-shell system . . tr. '/scip-shell filesystem . . `/`.' '-' | sortscip-shell system . . sort. | grepscip-shell system . . grep. -E "$pattern" | grepscip-shell system . . grep. -E -v 'android-arm|darwin-arm')" |
| 42 | |
| 43 | # put linux first in the target list to get all the architectures up front. |
| 44 | targets="$(echoscip-shell system . . echo. "$targets" | grepscip-shell system . . grep. -E 'linux') $(echoscip-shell system . . echo. "$targets" | grepscip-shell system . . grep. -E -v 'linux')" |
| 45 | |
| 46 | if [scip-shell system . . `[`. "$sete" = true ]; then |
| 47 | set -e |
| 48 | fi |
| 49 | for target in $targets |
| 50 | do |
| 51 | echoscip-shell system . . echo. $target |
| 52 | export GOOS=$(echoscip-shell system . . echo. $target | sedscip-shell system . . sed. 's/-.*//') |
| 53 | export GOARCH=$(echoscip-shell system . . echo. $target | sedscip-shell system . . sed. 's/.*-//') |
| 54 | unset GO386 |
| 55 | if [scip-shell system . . `[`. "$GOARCH" = "softfloat" ]; then |
| 56 | export GOARCH=386 |
| 57 | export GO386=softfloat |
| 58 | fi |
| 59 | if $cmp; then |
| 60 | if [scip-shell system . . `[`. "$GOOS" = "android" ]; then |
| 61 | goscip-shell system . . go. build $work -a -toolexec 'toolstash -cmp' std |
| 62 | else |
| 63 | goscip-shell system . . go. build $work -a -toolexec 'toolstash -cmp' std cmd |
| 64 | fi |
| 65 | else |
| 66 | goscip-shell system . . go. build $work -a std |
| 67 | fi |
| 68 | done |