Updated libunbound build script for windows

This commit is contained in:
WolverinDEV 2019-10-25 20:25:44 +01:00
parent 7abb1b79c3
commit 838d5c4a21

View File

@ -1,5 +1,11 @@
#!/usr/bin/env bash
if [[ ${build_os_type} == "win32 ]]; then
echo "Windows does not require libunbound"
echo "Dont building library"
exit 0
fi
source ../scripts/build_helper.sh
library_path="unbound"
requires_rebuild ${library_path}
@ -23,24 +29,12 @@ 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`
../../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}
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