-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.sh
executable file
·39 lines (32 loc) · 1.17 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# (c) 2019-2023, Ava Labs, Inc. All rights reserved.
# See the file LICENSE for licensing terms.
set -o errexit
set -o nounset
set -o pipefail
# Set the CGO flags to use the portable version of BLST
#
# We use "export" here instead of just setting a bash variable because we need
# to pass this flag to all child processes spawned by the shell.
export CGO_CFLAGS="-O -D__BLST_PORTABLE__"
# Load the constants
# Set the PATHS
GOPATH="$(go env GOPATH)"
# TimestampVM root directory
TIMESTAMPVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
# Set default binary directory location
binary_directory="$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins"
if [[ $# -eq 1 ]]; then
binary_directory=$1
elif [[ $# -eq 0 ]]; then
binary_directory="$GOPATH/src/github.com/ava-labs/avalanchego/build/tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH"
else
echo "Invalid arguments to build timestampvm. Requires either no arguments (default) or one arguments to specify binary location."
exit 1
fi
# Build timestampvm, which is run as a subprocess
echo "Building timestampvm in $binary_directory"
go build -o "$binary_directory" "main/"*.go