-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·94 lines (80 loc) · 2.36 KB
/
run.sh
File metadata and controls
executable file
·94 lines (80 loc) · 2.36 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env bash
set -euo pipefail
init_system=''
normal_build=''
pgo_build=''
download_source=''
skip_fulltext_mecab='false'
print_usage() {
printf "Usage: run.sh [-i] [-d] [-n] [-p] [--skip-fulltext-mecab]\n"
printf "i init system lib and gcc, require sudo permissions\n"
printf "d download source\n"
printf "n normal build\n"
printf "p pgo build\n"
exit 1
}
while [[ $# -gt 0 ]]; do
case "$1" in
-i) init_system='true' ;;
-n) normal_build='true' ;;
-p) pgo_build='true' ;;
-d) download_source='true' ;;
--skip-fulltext-mecab) skip_fulltext_mecab='true' ;;
-h|--help) print_usage ;;
*) print_usage ;;
esac
shift
done
[[ -z $init_system && -z $download_source && -z $normal_build && -z $pgo_build ]] && print_usage
SELF_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$SELF_PATH/lib/common.sh"
: ${CPU_OPT_FLAGS:="-march=nehalem -mtune=haswell"}
: ${MYSQL_VER:=8.0}
: ${MYSQL_MINI_VER:=45-36}
if [[ "$skip_fulltext_mecab" == 'true' ]]; then
export SKIP_FULLTEXT_MECAB=ON
else
export SKIP_FULLTEXT_MECAB=OFF
fi
export MYSQL_VER MYSQL_MINI_VER CPU_OPT_FLAGS SKIP_FULLTEXT_MECAB
export MYSQL_SOURCE_PATH="$SELF_PATH/percona-server-Percona-Server-${MYSQL_VER}.${MYSQL_MINI_VER}"
export WORK_ROOT="${WORK_ROOT:-$SELF_PATH/work}"
if [[ "$init_system" == 'true' ]]; then
bash "$SELF_PATH/prepare/prepare_system.sh"
fi
if [[ "$download_source" == 'true' ]]; then
bash "$SELF_PATH/prepare/download-source.sh"
fi
if platform_enable_optional_toolchain >/dev/null; then
log_info "enabled optional toolchain: ${PLATFORM_OPTIONAL_TOOLCHAIN_PATH:-unknown}"
fi
if [[ "$normal_build" == 'true' ]]; then
case "$MYSQL_VER" in
8.0|8.4)
bash "$SELF_PATH/stages/build_normal_80.sh"
bash "$SELF_PATH/stages/smoke_normal_80.sh"
bash "$SELF_PATH/stages/benchmark_normal_80.sh"
;;
5.6|5.7)
bash "$SELF_PATH/stages/build_normal_57.sh"
bash "$SELF_PATH/stages/smoke_normal.sh"
bash "$SELF_PATH/stages/benchmark_normal.sh"
;;
*)
die "unsupported MYSQL_VER for normal build flow: $MYSQL_VER"
;;
esac
fi
if [[ "$pgo_build" == 'true' ]]; then
case "$MYSQL_VER" in
8.0|8.4)
bash "$SELF_PATH/stages/build_pgo_80.sh"
;;
5.6|5.7)
bash "$SELF_PATH/stages/build_pgo_57.sh"
;;
*)
die "unsupported MYSQL_VER for PGO build flow: $MYSQL_VER"
;;
esac
fi