Add unbound for linux
This commit is contained in:
parent
86db4530de
commit
5a951b9398
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
.idea/
|
.idea/
|
||||||
out/
|
out/
|
||||||
|
**/.build_*_*.txt
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -70,3 +70,6 @@
|
|||||||
[submodule "build-helpers"]
|
[submodule "build-helpers"]
|
||||||
path = build-helpers
|
path = build-helpers
|
||||||
url = https://github.com/WolverinDEV/build-helpers.git
|
url = https://github.com/WolverinDEV/build-helpers.git
|
||||||
|
[submodule "third_party/unbound"]
|
||||||
|
path = third_party/unbound
|
||||||
|
url = https://github.com/NLnetLabs/unbound.git
|
||||||
|
2
client
2
client
@ -1 +1 @@
|
|||||||
Subproject commit 6def99931862133eaa37b5de6146f97ff3802188
|
Subproject commit a39f573a5fedb43167ce841f51b30d7d75905135
|
@ -21,33 +21,46 @@
|
|||||||
include(tearoot-helper)
|
include(tearoot-helper)
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
find_path(opus_ROOT_DIR
|
function(resolve_opus)
|
||||||
|
find_path(opus_ROOT_DIR
|
||||||
NAMES include/opus/opus.h
|
NAMES include/opus/opus.h
|
||||||
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/${BUILD_OUTPUT}
|
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/${BUILD_OUTPUT}
|
||||||
)
|
)
|
||||||
|
|
||||||
find_path(opus_INCLUDE_DIR
|
find_path(opus_INCLUDE_DIR
|
||||||
NAMES opus/opus.h opus/opus_defines.h
|
NAMES opus/opus.h opus/opus_defines.h
|
||||||
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/include/
|
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/include/
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(opus_LIBRARIES_STATIC
|
find_library(opus_LIBRARIES_STATIC
|
||||||
NAMES libopus.a opus.a opus.lib
|
NAMES libopus.a opus.a opus.lib
|
||||||
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/lib
|
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/lib
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(opus_LIBRARIES_SHARED
|
if(opus_LIBRARIES_STATIC)
|
||||||
|
add_library(opus::static SHARED IMPORTED)
|
||||||
|
set_target_properties(opus::static PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${opus_LIBRARIES_STATIC}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${opus_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_library(opus_LIBRARIES_SHARED
|
||||||
NAMES opus.dll libopus.so opus.so
|
NAMES opus.dll libopus.so opus.so
|
||||||
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/lib
|
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/lib
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package_handle_standard_args(opus DEFAULT_MSG
|
if(opus_LIBRARIES_SHARED)
|
||||||
opus_INCLUDE_DIR
|
add_library(opus::shared SHARED IMPORTED)
|
||||||
)
|
set_target_properties(opus::shared PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${opus_LIBRARIES_SHARED}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${opus_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
mark_as_advanced(
|
find_package_handle_standard_args(opus DEFAULT_MSG
|
||||||
opus_ROOT_DIR
|
|
||||||
opus_INCLUDE_DIR
|
opus_INCLUDE_DIR
|
||||||
opus_LIBRARIES_STATIC
|
)
|
||||||
opus_LIBRARIES_SHARED
|
endfunction()
|
||||||
)
|
resolve_opus()
|
||||||
|
|
||||||
|
67
cmake/Findunbound.cmake
Normal file
67
cmake/Findunbound.cmake
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
# - Try to find unbound include dirs and libraries
|
||||||
|
#
|
||||||
|
# Usage of this module as follows:
|
||||||
|
#
|
||||||
|
# find_package(unbound)
|
||||||
|
#
|
||||||
|
# Variables used by this module, they can change the default behaviour and need
|
||||||
|
# to be set before calling find_package:
|
||||||
|
#
|
||||||
|
# unbound_ROOT_DIR Set this variable to the root installation of
|
||||||
|
# unbound if the module has problems finding the
|
||||||
|
# proper installation path.
|
||||||
|
#
|
||||||
|
# Variables defined by this module:
|
||||||
|
#
|
||||||
|
# unbound_FOUND System has unbound, include and library dirs found
|
||||||
|
# unbound_INCLUDE_DIR The unbound include directories.
|
||||||
|
# unbound_LIBRARIES_STATIC The unbound libraries.
|
||||||
|
# unbound_LIBRARIES_SHARED The unbound libraries.
|
||||||
|
|
||||||
|
include(tearoot-helper)
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
function(resolve_unbound)
|
||||||
|
find_path(unbound_ROOT_DIR
|
||||||
|
NAMES include/unbound.h include/unbound-event.h
|
||||||
|
HINTS ${unbound_ROOT_DIR} ${unbound_ROOT_DIR}/${BUILD_OUTPUT}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_path(unbound_INCLUDE_DIR
|
||||||
|
NAMES include/unbound.h include/unbound-event.h
|
||||||
|
HINTS ${unbound_ROOT_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(unbound_LIBRARIES_STATIC
|
||||||
|
NAMES libunbound.a unbound.a unbound.lib
|
||||||
|
HINTS ${unbound_ROOT_DIR} ${unbound_ROOT_DIR}/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
if(unbound_LIBRARIES_STATIC)
|
||||||
|
add_library(unbound::static SHARED IMPORTED)
|
||||||
|
set_target_properties(unbound::static PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${unbound_LIBRARIES_STATIC}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${unbound_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_library(unbound_LIBRARIES_SHARED
|
||||||
|
NAMES unbound.dll libunbound.so unbound.so
|
||||||
|
HINTS ${unbound_ROOT_DIR} ${unbound_ROOT_DIR}/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
if(unbound_LIBRARIES_SHARED)
|
||||||
|
add_library(unbound::shared SHARED IMPORTED)
|
||||||
|
set_target_properties(unbound::shared PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${unbound_LIBRARIES_SHARED}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${unbound_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package_handle_standard_args(unbound DEFAULT_MSG
|
||||||
|
unbound_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
resolve_unbound()
|
||||||
|
|
||||||
|
|
@ -27,6 +27,7 @@ SET(PortAudio_ROOT_DIR "${LIBRARY_PATH}/portaudio/${BUILD_OUTPUT}")
|
|||||||
SET(fvad_ROOT_DIR "${LIBRARY_PATH}/libfvad/${BUILD_OUTPUT}")
|
SET(fvad_ROOT_DIR "${LIBRARY_PATH}/libfvad/${BUILD_OUTPUT}")
|
||||||
SET(opus_ROOT_DIR "${LIBRARY_PATH}/opus/${BUILD_OUTPUT}")
|
SET(opus_ROOT_DIR "${LIBRARY_PATH}/opus/${BUILD_OUTPUT}")
|
||||||
SET(breakpad_ROOT_DIR "${LIBRARY_PATH}/breakpad/${BUILD_OUTPUT}")
|
SET(breakpad_ROOT_DIR "${LIBRARY_PATH}/breakpad/${BUILD_OUTPUT}")
|
||||||
|
SET(unbound_ROOT_DIR "${LIBRARY_PATH}/unbound/${BUILD_OUTPUT}")
|
||||||
SET(TeaSpeak_SharedLib_ROOT_DIR "${LIBRARY_PATH}/../shared/")
|
SET(TeaSpeak_SharedLib_ROOT_DIR "${LIBRARY_PATH}/../shared/")
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LIBRARY_PATH}/spdlog/${BUILD_OUTPUT}")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LIBRARY_PATH}/spdlog/${BUILD_OUTPUT}")
|
BIN
third_party/.build_jsoncpp.sh.swp
vendored
BIN
third_party/.build_jsoncpp.sh.swp
vendored
Binary file not shown.
2
third_party/boringssl
vendored
2
third_party/boringssl
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 8289fee35e8ba5d6acebe0a217618aca66658c2c
|
Subproject commit 6f3e034fe58ce3bca3c1c32be6d603a6206c89af
|
7
third_party/build_boringssl.sh
vendored
7
third_party/build_boringssl.sh
vendored
@ -11,12 +11,15 @@ if [[ ${build_os_type} == "linux" ]]; then
|
|||||||
|
|
||||||
cd boringssl/
|
cd boringssl/
|
||||||
[[ $? -ne 0 ]] && exit 1
|
[[ $? -ne 0 ]] && exit 1
|
||||||
if [[ ! -d lib ]]; then
|
[[ -d lib ]] && rm -r lib
|
||||||
|
[[ $? -ne 0 ]] && exit 2
|
||||||
|
|
||||||
mkdir lib && cd lib
|
mkdir lib && cd lib
|
||||||
ln -s ../build/ssl/libssl.so .
|
ln -s ../build/ssl/libssl.so .
|
||||||
ln -s ../build/crypto/libcrypto.so .
|
ln -s ../build/crypto/libcrypto.so .
|
||||||
|
ln -s ../include/ .
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
|
||||||
cat include/openssl/opensslv.h | grep "OPENSSL_VERSION_NUMBER" &> /dev/null
|
cat include/openssl/opensslv.h | grep "OPENSSL_VERSION_NUMBER" &> /dev/null
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo "#if false
|
echo "#if false
|
||||||
|
51
third_party/build_unbound.sh
vendored
Executable file
51
third_party/build_unbound.sh
vendored
Executable file
@ -0,0 +1,51 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source ../scripts/build_helper.sh
|
||||||
|
library_path="unbound"
|
||||||
|
requires_rebuild ${library_path}
|
||||||
|
[[ $? -eq 0 ]] && exit 0
|
||||||
|
|
||||||
|
generate_build_path "${library_path}"
|
||||||
|
library_event=`pwd`/libevent/out/${build_os_type}_${build_os_arch}/
|
||||||
|
library_boringssl=`pwd`/boringssl/lib/
|
||||||
|
|
||||||
|
|
||||||
|
if [[ -d ${build_path} ]]; then
|
||||||
|
echo "Removing old build directory"
|
||||||
|
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"
|
||||||
|
|
||||||
|
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=no --enable-static=yes --with-pthreads --enable-pic --prefix=`pwd`
|
||||||
|
check_err_exit ${library_path} "Failed to configure build"
|
||||||
|
make CXXFLAGS="${CXX_FLAGS}" CFLAGS="${C_FLAGS}" ${MAKE_OPTIONS}
|
||||||
|
check_err_exit ${library_path} "Failed to build"
|
||||||
|
make install
|
||||||
|
check_err_exit ${library_path} "Failed to install"
|
||||||
|
elif [[ ${build_os_type} == "win32" ]]; then
|
||||||
|
exit 1 #TODO
|
||||||
|
cmake ../../ -G"Visual Studio 14 2015 Win64" -DOPENSSL_NO_ASM=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded"
|
||||||
|
check_err_exit ${library_path} "Failed generate build files!"
|
||||||
|
|
||||||
|
cmake --build . --target crypto --config release -j 8
|
||||||
|
#MSBuild.exe //p:Configuration=Release //p:Platform=x64 crypto/crypto.vcxproj
|
||||||
|
check_err_exit ${library_path} "Failed to build crytp!"
|
||||||
|
|
||||||
|
cmake --build . --target ssl --config release -j 8
|
||||||
|
#MSBuild.exe //p:Configuration=Release //p:Platform=x64 ssl/ssl.vcxproj
|
||||||
|
check_err_exit ${library_path} "Failed to build ssl!"
|
||||||
|
else
|
||||||
|
echo "Invalid OS!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
cd ../../../
|
||||||
|
|
||||||
|
set_build_successful ${library_path}
|
||||||
|
|
1
third_party/unbound
vendored
Submodule
1
third_party/unbound
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 7dfbcdf276e7a1070978209d2533b3b8cc504f86
|
Loading…
Reference in New Issue
Block a user