-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynobuild.sh
69 lines (59 loc) · 1.59 KB
/
dynobuild.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
#!/bin/bash
CYAN='\033[0;36m'
NC='\033[0m' # No Color
echo_cyan() {
echo -e "${CYAN}$@${NC}"
}
echo_cyan "=> Install requirement packages"
apt update
apt install -y build-essential git cmake autoconf libtool gcc automake openssl pkg-config libyaml-dev libssl-dev
echo
echo_cyan "=> Clone dynomite repository"
cd /tmp
git clone https://github.com/Netflix/dynomite.git
cd /tmp/dynomite
git checkout v0.6.22
echo
echo_cyan "=> Fix dyn_ring_queue code"
cd /tmp/dynomite
sed -i '14i _C2G_InQ C2G_InQ = {};' src/dyn_ring_queue.c
sed -i '15i _C2G_OutQ C2G_OutQ = {};' src/dyn_ring_queue.c
sed -i '19s/.*/typedef volatile struct {/' src/dyn_ring_queue.h
sed -i '23s/.*/} _C2G_InQ;/' src/dyn_ring_queue.h
sed -i '25s/.*/typedef volatile struct {/' src/dyn_ring_queue.h
sed -i '29s/.*/} _C2G_OutQ ;/' src/dyn_ring_queue.h
sed -i '30i ' src/dyn_ring_queue.h
sed -i '31i extern _C2G_InQ C2G_InQ;' src/dyn_ring_queue.h
sed -i '32i extern _C2G_OutQ C2G_OutQ;' src/dyn_ring_queue.h
git add .
git commit -m "Fix building and linking with GCC 10"
echo
echo_cyan "=> Unzip yaml library"
cd /tmp/dynomite/contrib
tar -xzf yaml-0.1.4.tar.gz
echo
echo_cyan "=> Run autoupdate conf"
cd /tmp/dynomite/contrib/yaml-0.1.4
autoupdate
cd /tmp/dynomite
autoupdate
git add .
git commit -m "autoupdate conf"
echo
echo_cyan "=> Cleaning build tag"
git tag "v0.6.23"
git checkout v0.6.23
git reset --hard HEAD
echo
echo_cyan "=> Run build"
cd /tmp/dynomite
autoreconf -fvi
./configure --enable-debug=yes
make clean
make
src/dynomite -h
echo
echo_cyan "=> Clean up"
cd "$(dirname "$0")"
cp /tmp/dynomite/src/dynomite .
rm -r /tmp/dynomite