-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
51 lines (44 loc) · 1.2 KB
/
build.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
#/bin/bash
BUILD_PATH=${PWD}
SRC_PATH=$(realpath $(dirname "$0"))
echo "SRC path ="$SRC_PATH
echo "Build path="${BUILD_PATH}
cd $SRC_PATH
mkdir -p ${BUILD_PATH}/install/include/swss
cd sonic-swss/
git apply ../patch/swss_pfcwdorch.diff
cd ../
# Build sonic-swss-common
SWSS_COMMON_PATH="${SRC_PATH}/sonic-swss-common"
cd ${SWSS_COMMON_PATH}
./autogen.sh
./configure --prefix=$(realpath ${BUILD_PATH}/install )
make && make install
if [ "$?" -ne "0" ]; then
echo "Failed to build swss-common"
exit 1
fi
cp ./common/*.h ${BUILD_PATH}/install/include/swss
cp ./common/*.hpp ${BUILD_PATH}/install/include/swss
SAIREDIS_PATH="${SRC_PATH}/sonic-sairedis"
cd ${SAIREDIS_PATH}/SAI/meta
export PERL5LIB=${PWD}
make saimetadata.c saimetadata.h
if [ "$?" -ne "0" ]; then
echo "Failed to build saimetadata"
exit 1
fi
cd ${SAIREDIS_PATH}
./autogen.sh
./configure --prefix=$(realpath ${BUILD_PATH}/install) --with-sai=vs
make CXXFLAGS="-I$(realpath ${BUILD_PATH}/install/include) \
-Wno-error=long-long \
-std=c++11 \
-L$(realpath ${BUILD_PATH}/install/lib)"
if [ "$?" -ne "0" ]; then
echo "Failed to build sairedis"
exit 1
fi
make install
cd ${BUILD_PATH}
cmake ${SRC_PATH}