Improved build helper scripts for the server

This commit is contained in:
WolverinDEV 2020-01-24 14:02:19 +01:00
parent 6d9170b15a
commit 5e227a059e
3 changed files with 75 additions and 43 deletions

@ -1 +1 @@
Subproject commit a651eb879e5acf1929046f2a5550b2632f27e242
Subproject commit 45a32496ba2789acf2a961246188c849cb856eb7

@ -1 +1 @@
Subproject commit 6f3e034fe58ce3bca3c1c32be6d603a6206c89af
Subproject commit 234f39b4947a8dfa1a26936af101ef1ba7368505

View File

@ -1,47 +1,79 @@
#!/bin/bash
mkdir -p \
boringssl/build \
DataPipes/build \
breakpad/build \
CXXTerminal/build \
ed25519/build \
event/build \
jsoncpp/build \
mysqlconnector/build \
opus/build \
opusfile/build \
spdlog/build \
StringVariable/build \
Thread-Pool/build \
tomcrypt/build \
tommath/build \
yaml-cpp/build \
protobuf/build \
jemalloc/build
# Enter third_party/ directory
cd $(dirname $0)
function exec_script {
echo "Executing ${1}"
./${1}
if [ $? -ne 0 ]; then
echo "Failed to execute ${1}"
export build_helper_file="../build-helpers/build_helper.sh"
build_helper_scripts="../build-helpers/libraries"
source ${build_helper_file}
[[ $build_helpers_defined -ne 1 ]] && {
echo "Failed to include build helpers."
exit 1
fi
}
exec_script build_event.sh
exec_script build_boringssl.sh
exec_script build_breakpad.sh
exec_script build_cxxterminal.sh
exec_script build_datapipes.sh
exec_script build_ed25519.sh
exec_script build_jsoncpp.sh
[[ -z "${build_os_type}" ]] && {
echo "Missing build os type. Using \"linux\""
export build_os_type="linux"
}
[[ -z "${build_os_arch}" ]] && {
echo "Missing build os arch. Using \"amd64\""
export build_os_arch="amd64"
}
begin_task "build_third_party" "Building libraries"
function exec_script() {
name=$(echo "$1" | sed -n -E 's:^build_(.*)\.sh:\1:p')
begin_task "build_$name" "Building $name"
echo -e "Building library with script $color_green${1}$color_normal"
./${1}
if [[ $? -ne 0 ]]; then
echo "Failed to build library $name. Status code: $?"
exit 1
fi
#Log the result
end_task "build_$name" "Finished $name"
echo ""
}
function exec_script_external() {
name=$(echo "$1" | sed -n -E 's:^build_(.*)\.sh:\1:p')
begin_task "build_$name" "Building $name"
echo -e "Building library with script $color_green${1}$color_normal"
_prefix="library_path=\"$2\" ${*:3}"
eval $_prefix ./${build_helper_scripts}/"${1}"
if [[ $? -ne 0 ]]; then
echo "Failed to build library $name. Status code: $?"
exit 1
fi
#Log the result
end_task "build_$name" "Finished $name"
echo ""
}
exec_script_external build_libevent.sh event
exec_script_external build_boringssl.sh boringssl
exec_script_external build_breakpad.sh breakpad
exec_script_external build_cxxterminal.sh CXXTerminal "libevent_path=event"
exec_script_external build_datapipes.sh DataPipes
exec_script_external build_ed25519.sh ed25519
exec_script_external build_jsoncpp.sh jsoncpp
#exec_script build_mysqlconnector.sh
exec_script build_opus.sh
exec_script build_protobuf.sh
exec_script build_spdlog.sh
exec_script build_stringvariable.sh
exec_script build_threadpool.sh
exec_script build_tom.sh
exec_script build_yaml.sh
exec_script build_jemalloc.sh
exec_script_external build_opus.sh opus
exec_script_external build_protobuf.sh protobuf
exec_script_external build_spdlog.sh spdlog
exec_script_external build_stringvariable.sh StringVariable
exec_script_external build_threadpool.sh Thread-Pool
exec_script_external build_tommath.sh tommath
exec_script_external build_tomcrypt.sh tomcrypt
exec_script_external build_yaml.sh yaml-cpp
exec_script_external build_jemalloc.sh jemalloc
#Log the result
end_task "build_third_party" "Build all libraries successfully"