github.com/flyinox/gosm@v0.0.0-20171117061539-16768cb62077/src/naclmake.bash (about)

     1  #!/bin/bash
     2  # Copyright 2016 The Go Authors. All rights reserved.
     3  # Use of this source code is governed by a BSD-style
     4  # license that can be found in the LICENSE file.
     5  
     6  # naclmake.bash builds runs make.bash for nacl, but not does run any
     7  # tests. This is used by the continuous build.
     8  
     9  # Assumes that sel_ldr binaries and go_nacl_$GOARCH_exec scripts are in $PATH;
    10  # see ../misc/nacl/README.
    11  
    12  set -e
    13  ulimit -c 0
    14  
    15  # guess GOARCH if not set
    16  naclGOARCH=$GOARCH
    17  if [ -z "$naclGOARCH" ]; then
    18  	case "$(uname -m)" in
    19  	x86_64)
    20  		naclGOARCH=amd64p32
    21  		;;
    22  	armv7l) # NativeClient on ARM only supports ARMv7A.
    23  		naclGOARCH=arm
    24  		;;
    25  	i?86)
    26  		naclGOARCH=386
    27  		;;
    28  	esac
    29  fi
    30  
    31  unset GOOS GOARCH
    32  if [ ! -f make.bash ]; then
    33  	echo 'nacltest.bash must be run from $GOROOT/src' 1>&2
    34  	exit 1
    35  fi
    36  
    37  # the builder might have set GOROOT_FINAL.
    38  export GOROOT=$(pwd)/..
    39  
    40  # Build zip file embedded in package syscall.
    41  echo "##### Building fake file system zip for nacl"
    42  rm -f syscall/fstest_nacl.go
    43  GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
    44  gobin=$GOROOT_BOOTSTRAP/bin
    45  GOROOT=$GOROOT_BOOTSTRAP $gobin/go run ../misc/nacl/mkzip.go -p syscall -r .. ../misc/nacl/testzip.proto syscall/fstest_nacl.go
    46  
    47  # Run standard build and tests.
    48  GOOS=nacl GOARCH=$naclGOARCH ./make.bash