-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add generate precompile script to fix CGO flags issue (#489)
- Loading branch information
1 parent
c667f95
commit 50da2fd
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# This script generates a Stateful Precompile stub based off of a Solidity ABI file. | ||
# It first sets the necessary CGO_FLAGs for the BLST library used in AvalancheGo and | ||
# then runs PrecompileGen. | ||
if ! [[ "$0" =~ scripts/generate_precompile.sh ]]; then | ||
echo "must be run from repository root, but got $0" | ||
exit 255 | ||
fi | ||
|
||
# Load the versions | ||
SUBNET_EVM_PATH=$( | ||
cd "$(dirname "${BASH_SOURCE[0]}")" | ||
cd .. && pwd | ||
) | ||
|
||
# Load the constants | ||
source "$SUBNET_EVM_PATH"/scripts/constants.sh | ||
|
||
go run ./cmd/precompilegen/main.go $@ |