-
Notifications
You must be signed in to change notification settings - Fork 2
/
building.sh
68 lines (57 loc) · 2.49 KB
/
building.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
# @file building.sh
# @author EricYonng<120453674@qq.com>
# @brief 3rd scripts
#!/usr/bin/env bash
# 变量与等号之间不可以有空格,否则会被当成命令
SCRIPT_PATH="$(cd $(dirname $0); pwd)"
# DEBUG_LIBS=("libKernel_debug.so" )
# RELEASE_LIBS=("libKernel.so" )
# OPEN_COREDUMP="opencoredump"
# COREDUMPFLAG="$2"
# 配置环境变量
# sudo export PATH=$PATH:${SCRIPT_PATH}/output/gmake/
OUTPUT_DIR=${SCRIPT_PATH}/output/gmake/
# sudo ln -sv $SCRIPT_PATH/Service/Cfgs ${OUTPUT_DIR}/Cfgs
if [ -n "$1" ]
then
VER="$1"
# sudo export PATH=$PATH:${SCRIPT_PATH}/output/gmake/
if [ $VER = "debug" ]
then
sudo mkdir ${OUTPUT_DIR}../../3rd/kernel
sudo rm -f ${OUTPUT_DIR}../../3rd/kernel/libCrystalKernel_debug.a
sudo cp -rf ${OUTPUT_DIR}libCrystalKernel_debug.a ${OUTPUT_DIR}../../3rd/kernel/libCrystalKernel_debug.a
# 拷贝mysqlclient.so到运行目录
sudo cp -rf ${SCRIPT_PATH}/3rd/mysql/linux/lib/libmysqlclient.so ${OUTPUT_DIR}/
sudo cp -rf ${SCRIPT_PATH}/3rd/miniz/libs/debug/libminiz.a ${OUTPUT_DIR}/
sudo cp -rf ${SCRIPT_PATH}/3rd/protobuf/lib/libprotobufd.a ${OUTPUT_DIR}/
# sudo cp -rf ${SCRIPT_PATH}/3rd/protobuf/lib/libprotobuf-lited.a ${OUTPUT_DIR}/
# sudo cp -rf ${SCRIPT_PATH}/3rd/protobuf/lib/libprotocd.a ${OUTPUT_DIR}/
sh ${SCRIPT_PATH}/partition_files.sh
# sudo ln -sv ${OUTPUT_DIR}libCrystalKernel_debug.so /usr/lib/libCrystalKernel_debug.so
# 创建debug版本的so连接符号
# for libName in $DEBUG_LIBS
# do
# sudo rm -f /usr/lib64/$libName
# sudo ln -sv ${OUTPUT_DIR}/$libName /usr/lib64/$libName
# done
else
sudo mkdir ${OUTPUT_DIR}../../3rd/kernel
sudo rm -f ${OUTPUT_DIR}../../3rd/kernel/libCrystalKernel.a
sudo cp -rf ${OUTPUT_DIR}libCrystalKernel.a ${OUTPUT_DIR}../../3rd/kernel/libCrystalKernel.a
# 拷贝mysqlclient.so到运行目录
sudo cp -rf ${SCRIPT_PATH}/3rd/mysql/linux/lib/libmysqlclient.so ${OUTPUT_DIR}/
sudo cp -rf ${SCRIPT_PATH}/3rd/miniz/libs/release/libminiz.a ${OUTPUT_DIR}/
sudo cp -rf ${SCRIPT_PATH}/3rd/protobuf/lib/libprotobuf.a ${OUTPUT_DIR}/
# sudo cp -rf ${SCRIPT_PATH}/3rd/protobuf/lib/libprotobuf-lite.a ${OUTPUT_DIR}/
# sudo cp -rf ${SCRIPT_PATH}/3rd/protobuf/lib/libprotoc.a ${OUTPUT_DIR}/
sh ${SCRIPT_PATH}/partition_files.sh
# sudo ln -sv ${OUTPUT_DIR}libCrystalKernel.so /usr/lib/libCrystalKernel.so
# 创建release版本的so连接符号
# for libName in $RELEASE_LIBS
# do
# sudo rm -f /usr/lib64/$libName
# sudo ln -sv ${OUTPUT_DIR}/$libName /usr/lib64/$libName
# done
fi
fi