-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild_core_bpf.sh
More file actions
executable file
·42 lines (37 loc) · 1.35 KB
/
build_core_bpf.sh
File metadata and controls
executable file
·42 lines (37 loc) · 1.35 KB
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
40
41
42
#!/bin/bash
: "${BPF_PROGRAMS_DIR:=bpf_programs}"
: "${CARGO:=cargo}"
if [ -z "$1" ]; then
echo "Error: Program name argument is missing."
exit 1
fi
set_core_bpf_vars() {
case "$1" in
address-lookup-table)
CORE_BPF_PROGRAM_ID="AddressLookupTab1e1111111111111111111111111"
CORE_BPF_TARGET="$BPF_PROGRAMS_DIR/lib/solana_address_lookup_table_program.so"
;;
config)
CORE_BPF_PROGRAM_ID="Config1111111111111111111111111111111111111"
CORE_BPF_TARGET="$BPF_PROGRAMS_DIR/lib/solana_config_program.so"
;;
feature-gate)
CORE_BPF_PROGRAM_ID="Feature111111111111111111111111111111111111"
CORE_BPF_TARGET="$BPF_PROGRAMS_DIR/lib/solana_feature_gate_program.so"
;;
stake)
CORE_BPF_PROGRAM_ID="Stake11111111111111111111111111111111111111"
CORE_BPF_TARGET="$BPF_PROGRAMS_DIR/lib/solana_stake_program.so"
;;
*)
echo "Invalid argument. Use 'address-lookup-table', 'config', 'feature-gate', or 'stake'."
exit 1
;;
esac
}
set_core_bpf_vars "$1"
CORE_BPF_PROGRAM_ID=$CORE_BPF_PROGRAM_ID CORE_BPF_TARGET=$CORE_BPF_TARGET FORCE_RECOMPILE=true $CARGO build \
--target x86_64-unknown-linux-gnu \
--features core-bpf-conformance \
--lib \
--release