-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgetdeps.sh
executable file
·68 lines (61 loc) · 1.87 KB
/
getdeps.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
#!/usr/bin/env bash
function update() {
repo=`basename $1 .git`
echo "updating $repo..."
if [ -d $repo ]; then
(cd $repo && git pull)
else
git clone $1
[ -z "$2" ] || (cd $repo && git checkout $2)
fi
}
function update_branch() {
branch="$1"
if [ "$(git symbolic-ref -q --short HEAD)" != "OpenNSL_6.3" ]; then
git checkout -tb "$branch" "origin/$branch"
fi
}
function build() {
(
echo "building $1..."
cd $1
if [ -e ./CMakeLists.txt ]; then
mkdir -p build
cd build
echo cmake .. $CMAKEFLAGS
cmake .. $CMAKEFLAGS
make
else
if [ ! -e ./configure ]; then
autoreconf --install
fi
./configure
make -j8
fi
)
}
function get_packages() {
echo "installing packages"
sudo apt-get install -yq autoconf automake libdouble-conversion-dev \
libssl-dev make zip git autoconf libtool g++ \
libevent-dev flex bison libgoogle-glog-dev scons libkrb5-dev \
libsnappy-dev libsasl2-dev libnuma-dev libi2c-dev libcurl4-nss-dev \
libusb-1.0-0-dev libpcap-dev libdb5.3-dev cmake libnl-3-dev libnl-route-3-dev
}
if [ "$1" = 'pkg' ]; then
get_packages
fi
echo "creating external..."
mkdir -p external
(
cd external
# We hard code OpenNSL to OpenNSL-6.4.6.6 release, later releases seem to
# SIGSEV in opennsl_pkt_alloc()
update https://github.com/Broadcom-Switch/OpenNSL.git 8e0b499f02dcef751a3703c9a18600901374b28a
update \
git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git v3.19.0
update https://github.com/facebook/fbthrift.git
build iproute2
# export CPPFLAGS=" -I`pwd`/folly -I`pwd`/wangle" LDFLAGS="-L`pwd`/folly/folly/.libs/ -L`pwd`/wangle/wangle/build/lib"
# build fbthrift/thrift
)