diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 1bfcdb6..d4aec06 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -3,7 +3,7 @@ project(TeaSpeak-Server) set(CMAKE_VERBOSE_MAKEFILE ON) #--allow-multiple-definition -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -Wall -Wno-reorder -Wno-sign-compare -static-libgcc -static-libstdc++ -g -Wl,-no-whole-archive,--allow-shlib-undefined -pthread ${MEMORY_DEBUG_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -Wall -Wno-reorder -Wno-sign-compare -static-libgcc -static-libstdc++ -g -Wl,--no-whole-archive -pthread ${MEMORY_DEBUG_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3") @@ -276,31 +276,9 @@ target_link_libraries(TeaSpeakServer mysqlclient.a jsoncpp_lib ${ed25519_LIBRARIES_STATIC} - ${DataPipes_LIBRARIES_SHARED} - ) + ${DataPipes_LIBRARIES_SHARED} # Also includes glib2.0 +) -if (COMPILE_WEB_CLIENT) - resolve_library(LIBRARY_PATH_NICE OFF "${LIBRARY_PATH}/libnice/linux_${BUILD_OS_ARCH}/lib/libnice.a") - message("Found libnice at ${LIBRARY_PATH_NICE}") - - if (EXISTS "${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/lib/i386-linux-gnu/") - set(GLIBC_LIB_DIR "${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/lib/i386-linux-gnu/") - elseif(EXISTS "${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/lib/x86_64-linux-gnu/") - set(GLIBC_LIB_DIR "${LIBRARY_PATH}/glibc/linux_${BUILD_OS_ARCH}/lib/x86_64-linux-gnu/") - else() - message(FATAL_ERROR "Failed to find glibc") - endif () - message("Found GLIBC lib dir at ${GLIBC_LIB_DIR}") - set(LIBRARY_PATH_GLIBC "${GLIBC_LIB_DIR}/libgio-2.0.a;${GLIBC_LIB_DIR}/libgmodule-2.0.a;${GLIBC_LIB_DIR}/libgobject-2.0.a;${GLIBC_LIB_DIR}/libglib-2.0.a;${GLIBC_LIB_DIR}/libffi.a;resolv") - - find_package(UsrSCTP REQUIRED) - target_link_libraries(TeaSpeakServer - ${LIBRARY_PATH_NICE} - ${LIBRARY_PATH_GLIBC} - ) - - #target_link_options(TeaSpeakServer PUBLIC "-Wl,--no-as-needed" "${LIBRARY_PATH_DATA_PIPES}" "${LIBRARY_PATH_NICE}" "-Wl,--as-needed") -endif () include_directories(${LIBRARY_PATH}/boringssl/include/) target_link_libraries(TeaSpeakServer openssl::ssl::shared diff --git a/server/repro/generate_libraries.sh b/server/repro/generate_libraries.sh index 605fc6f..df9792c 100755 --- a/server/repro/generate_libraries.sh +++ b/server/repro/generate_libraries.sh @@ -7,13 +7,14 @@ # "libjemalloc.so.2" # "libsqlite3.so.0" # "libTeaMusic.so" +# "libnice.so.10" +# "libpcre.so.3" (only for web) [[ -z "${build_os_type}" ]] && { echo "missing build os type"; exit 1; } [[ -z "${build_os_arch}" ]] && { echo "missing build os arch"; exit 1; } build_path="out/${build_os_type}_${build_os_arch}/" function query_system_link() { - echo "Query for $1" data=$(ldd ../../../environment/TeaSpeakServer | grep "$1") # shellcheck disable=SC2206 data=($data) @@ -34,7 +35,6 @@ cd libs || { echo "failed to enter lib directory"; exit 1; } # Creating symbolic links library_base=$(realpath ../../../../../libraries) -echo "$library_base" # Setting up ssl library_path=$(realpath "${library_base}/boringssl/${build_path}/ssl/libssl.so") @@ -60,9 +60,17 @@ ln -s "${library_path}" . || { echo "failed to link libjemalloc.so.2"; exit 1; } library_path=$(realpath "../../../../MusicBot/libs/libTeaMusic.so") ln -s "$library_path" . || { echo "failed to link libTeaMusic.so"; exit 1; } -# Setting up libnice -library_path=$(realpath "${library_base}/libnice/${build_os_type}_${build_os_arch}/lib/libnice.so.10") -ln -s "$library_path" . || { echo "failed to link libnice.so.10"; exit 1; } +if ldd "../../../environment/TeaSpeakServer" | grep -q "libnice.so.10"; then + echo "Adding web libraries" + + # Setting up libnice + library_path=$(realpath "${library_base}/libnice/${build_os_type}_${build_os_arch}/lib/libnice.so.10") + ln -s "$library_path" . || { echo "failed to link libnice.so.10"; exit 1; } + + # Setting up libpcre + query_system_link "libpcre.so.3" + ln -s "${library_path}" . || { echo "failed to link libpcre.so.3"; exit 1; } +fi # Validate setup broken_links=$(find . -type l ! -exec test -e {} \; -print)