forked from opencurve/curve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_in_image.sh
61 lines (52 loc) · 1.39 KB
/
build_in_image.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
#!/usr/bin/env bash
set -x
# Copyright (C) 2021 Jingli Chen (Wine93), NetEase Inc.
############################ GLOBAL VARIABLES
g_root="${PWD}"
g_stor=""
g_list=0
g_depend=0
g_target=""
g_release=0
g_ci=0
g_build_rocksdb=0
g_build_opts=(
"--define=with_glog=true"
"--define=libunwind=true"
"--copt -DHAVE_ZLIB=1"
"--copt -DGFLAGS_NS=google"
"--copt -DUSE_BTHREAD_MUTEX"
"--copt -DCLIENT_CONF_PATH=\"${g_root}/curvefs/conf/client.conf\""
)
# allow user to specify extra build options
# using environment variable BUILD_OPTS , if any.
# custom build options will be appended to g_build_opts
if [ -n "$BUILD_OPTS" ]; then
echo "Custom build options: $BUILD_OPTS"
g_build_opts+=("$BUILD_OPTS")
fi
g_os="debian11"
main() {
source "util/basic.sh"
source "util/build_functions.sh"
get_options "$@"
get_version
if [[ "$g_stor" != "bs" && "$g_stor" != "fs" ]]; then
die "stor option must be either bs or fs\n"
fi
if [ "$g_list" -eq 1 ]; then
list_target
elif [[ "$g_target" == "" && "$g_depend" -ne 1 ]]; then
die "must not disable both only option or dep option\n"
else
if [ "$g_depend" -eq 1 ]; then
build_requirements
(cd curvefs/sdk/java && mvn package)
fi
if [ -n "$g_target" ]; then
build_target
fi
fi
}
############################ MAIN()
main "$@"