-
-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathinstall.sh
executable file
·111 lines (79 loc) · 1.94 KB
/
install.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
LIBXDP=0
INSTALL=1
CLEAN=0
OBJDUMP=0
HELP=0
STATIC=1
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--libxdp)
LIBXDP=1
shift
;;
--no-install)
INSTALL=0
shift
;;
--clean)
CLEAN=1
shift
;;
--no-static)
STATIC=0
shift
;;
--objdump)
OBJDUMP=1
shift
;;
--help)
HELP=1
shift
;;
*)
shift
;;
esac
done
if [ "$HELP" -gt 0 ]; then
echo "Usage: install.sh [OPTIONS]"
echo
echo "Options:"
echo " --libxdp Build and install LibXDP before building the tool."
echo " --no-install Build the tool and/or LibXDP without installing them."
echo " --clean Remove build files for the tool and LibXDP."
echo " --no-static Do not statically link LibXDP and LibBPF object files when building the tool and rely on shared libraries (-lbpf and -lxdp flags)."
echo " --objdump Dumps the XDP/BPF object file using 'llvm-objdump' to Assemby into 'objdump.asm'."
echo " --help Display this help message."
exit 0
fi
if [ "$CLEAN" -gt 0 ]; then
if [ "$LIBXDP" -gt 0 ]; then
echo "Cleaning LibXDP..."
./scripts/libxdp_clean.sh
fi
echo "Cleaning up tool..."
./scripts/clean.sh
exit 0
fi
if [ "$OBJDUMP" -gt 0 ]; then
echo "Dumping object file..."
./scripts/objdump.sh
exit 0
fi
if [ "$LIBXDP" -gt 0 ]; then
echo "Building LibXDP..."
./scripts/libxdp_build.sh
if [ "$INSTALL" -gt 0 ]; then
echo "Installing LibXDP..."
sudo ./scripts/libxdp_install.sh
fi
fi
echo "Building tool..."
./scripts/build.sh $STATIC
if [ "$INSTALL" -gt 0 ]; then
echo "Installing tool..."
sudo ./scripts/install.sh
fi