diff --git a/client b/client index 6393d79..24c6c4d 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit 6393d79f54a1a13300c5117bd3eecd44b909ecc3 +Subproject commit 24c6c4d32c23ea51c547ae0ecd13e66cd2587e4e diff --git a/third_party/Thread-Pool b/third_party/Thread-Pool index d858eb8..df14b58 160000 --- a/third_party/Thread-Pool +++ b/third_party/Thread-Pool @@ -1 +1 @@ -Subproject commit d858eb8b3aec7f9d2e9d308d0564a8a267710f64 +Subproject commit df14b580d9f15d7a0b16a8bfc8b906f2608d192c diff --git a/third_party/build.sh b/third_party/build.sh index bf49b5d..1989bb1 100755 --- a/third_party/build.sh +++ b/third_party/build.sh @@ -1,87 +1,87 @@ -#!/bin/bash - -# Enter third_party/ directory -cd $(dirname $0) - -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 -} - -[[ -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} - _code=$? - if [[ $_code -ne 0 ]]; then - echo "Failed to build library $name. Status code: $_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}" - code=$? - if [[ $code -ne 0 ]]; then - echo "Failed to build library $name. Status code: $code" - exit 1 - fi - - #Log the result - end_task "build_$name" "Finished $name" - echo "" -} - - -exec_script build_boringssl.sh -[[ ${build_os_type} != "win32" ]] && exec_script build_breakpad.sh #Not required for windows TeaClient -exec_script build_libevent.sh -#exec_script build_cxxterminal.sh #Depends on libevent; Not required for TeaClient -exec_script build_datapipes.sh -exec_script build_ed25519.sh -exec_script build_jsoncpp.sh -#exec_script build_mysqlconnector.sh -exec_script build_opus.sh -exec_script build_libfvad.sh -exec_script build_soxr.sh -exec_script build_portaudio.sh -exec_script_external build_protobuf.sh protobuf -exec_script build_unbound.sh -exec_script build_spdlog.sh -exec_script build_stringvariable.sh -exec_script build_threadpool.sh -exec_script build_soundio.sh -exec_script build_tom.sh -exec_script build_yaml.sh -[[ ${build_os_type} != "win32" ]] && exec_script build_jemalloc.sh #Not required for TeaClient - -#Log the result -end_task "build_third_party" "Build all libraries successfully" +#!/bin/bash + +# Enter third_party/ directory +cd $(dirname $0) + +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 +} + +[[ -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} + _code=$? + if [[ $_code -ne 0 ]]; then + echo "Failed to build library $name. Status code: $_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}" + code=$? + if [[ $code -ne 0 ]]; then + echo "Failed to build library $name. Status code: $code" + exit 1 + fi + + #Log the result + end_task "build_$name" "Finished $name" + echo "" +} + + +exec_script build_boringssl.sh +[[ ${build_os_type} != "win32" ]] && exec_script build_breakpad.sh #Not required for windows TeaClient +exec_script build_libevent.sh +#exec_script build_cxxterminal.sh #Depends on libevent; Not required for TeaClient +exec_script build_datapipes.sh +exec_script build_ed25519.sh +exec_script build_jsoncpp.sh +#exec_script build_mysqlconnector.sh +exec_script build_opus.sh +exec_script build_libfvad.sh +exec_script build_soxr.sh +exec_script build_portaudio.sh +exec_script_external build_protobuf.sh protobuf +exec_script build_unbound.sh +exec_script build_spdlog.sh +exec_script build_stringvariable.sh +exec_script build_threadpool.sh +exec_script build_soundio.sh +exec_script build_tom.sh +exec_script build_yaml.sh +[[ ${build_os_type} != "win32" ]] && exec_script build_jemalloc.sh #Not required for TeaClient + +#Log the result +end_task "build_third_party" "Build all libraries successfully" diff --git a/third_party/build_boringssl.sh b/third_party/build_boringssl.sh index 6841bcb..31ccf29 100755 --- a/third_party/build_boringssl.sh +++ b/third_party/build_boringssl.sh @@ -21,8 +21,10 @@ if [[ ${build_os_type} == "linux" ]]; then cd boringssl/ [[ $? -ne 0 ]] && exit 1 - [[ -d lib ]] && rm -r lib - [[ $? -ne 0 ]] && exit 2 + [[ -d lib ]] && { + rm -r lib + [[ $? -ne 0 ]] && exit 2 + } mkdir lib && cd lib ln -s ../build/ssl/libssl.so . diff --git a/third_party/build_soundio.sh b/third_party/build_soundio.sh index 9d83da3..c37f7cf 100755 --- a/third_party/build_soundio.sh +++ b/third_party/build_soundio.sh @@ -1,23 +1,23 @@ -#!/usr/bin/env bash - -[[ -z "${build_helper_file}" ]] && { - echo "Missing build helper file. Please define \"build_helper_file\"" - exit 1 -} -source ${build_helper_file} -[[ $build_helpers_defined -ne 1 ]] && { - echo "Failed to include build helpers." - exit 1 -} - - -library_path="soundio" -requires_rebuild ${library_path} -[[ $? -eq 0 ]] && exit 0 - -_fpic="" -[[ ${build_os_type} == "linux" ]] && _fpic="-fPIC" - -cmake_build ${library_path} -DBUILD_DYNAMIC_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_EXAMPLE_PROGRAMS=OFF -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE="Debug" -check_err_exit ${library_path} "Failed to build libsoundio!" -set_build_successful ${library_path} +#!/usr/bin/env bash + +[[ -z "${build_helper_file}" ]] && { + echo "Missing build helper file. Please define \"build_helper_file\"" + exit 1 +} +source ${build_helper_file} +[[ $build_helpers_defined -ne 1 ]] && { + echo "Failed to include build helpers." + exit 1 +} + + +library_path="soundio" +requires_rebuild ${library_path} +[[ $? -eq 0 ]] && exit 0 + +_fpic="" +[[ ${build_os_type} == "linux" ]] && _fpic="-fPIC" + +cmake_build ${library_path} -DBUILD_DYNAMIC_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_EXAMPLE_PROGRAMS=OFF -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE="Debug" +check_err_exit ${library_path} "Failed to build libsoundio!" +set_build_successful ${library_path} diff --git a/third_party/build_unbound.sh b/third_party/build_unbound.sh index 3000cc2..de0dee6 100755 --- a/third_party/build_unbound.sh +++ b/third_party/build_unbound.sh @@ -31,15 +31,12 @@ if [[ -d ${build_path} ]]; then rm -r ${build_path} fi -mkdir -p ${build_path} -check_err_exit ${library_path} "Failed to create build directory" -cd ${build_path} -check_err_exit ${library_path} "Failed to enter build directory" - +cd ${library_path} if [[ ${build_os_type} == "linux" ]]; then #Failed to build with BoringSSL, so we using openssl. No ABI stuff should be changed! # --with-ssl=${library_boringssl} - ../../configure --with-libunbound-only --with-libevent=${library_event} --enable-event-api --enable-shared=yes --enable-static=yes --with-pthreads --prefix=`pwd` + echo "Install build to ${build_path}" + ./configure --prefix="${build_path}" --with-libunbound-only --with-libevent=${library_event} --enable-event-api --enable-shared=yes --enable-static=yes --with-pthreads check_err_exit ${library_path} "Failed to configure build" make CXXFLAGS="${CXX_FLAGS}" CFLAGS="${C_FLAGS} -fPIC" ${MAKE_OPTIONS} check_err_exit ${library_path} "Failed to build" @@ -49,7 +46,7 @@ else echo "Invalid OS!" exit 1 fi -cd ../../../ +cd ../ set_build_successful ${library_path}