forked from opencurve/curve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildfs.sh
executable file
·48 lines (42 loc) · 952 Bytes
/
buildfs.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
#!/bin/sh
cpplint --recursive curvefs
if [ $? -ne 0 ]
then
echo "cpplint failed"
exit
fi
if [ `gcc -dumpversion | awk -F'.' '{print $1}'` -le 6 ]
then
bazelflags=''
else
bazelflags='--copt -faligned-new'
fi
if [ "$1" = "debug" ]
then
DEBUG_FLAG="--compilation_mode=dbg"
fi
bazel build curvefs/... --copt -DHAVE_ZLIB=1 ${DEBUG_FLAG} -s \
--define=with_glog=true --define=libunwind=true --copt -DGFLAGS_NS=google --copt -Wno-error=format-security --copt \
-DUSE_BTHREAD_MUTEX --copt -DCURVEVERSION=${curve_version} --linkopt -L/usr/local/lib ${bazelflags}
if [ $? -ne 0 ]
then
echo "build curvefs failed"
exit
fi
echo "build curvefs success"
if [ "$1" = "test" ]
then
./bazel-bin/curvefs/test/metaserver/curvefs_metaserver_test
if [ $? -ne 0 ]
then
echo "metaserver_test failed"
exit
fi
./bazel-bin/curvefs/test/mds/curvefs_mds_test
if [ $? -ne 0 ]
then
echo "mds_test failed"
exit
fi
fi
echo "end compile"