Build scripts: fixed Windows 7 compatibility

This commit is contained in:
SChernykh
2025-07-05 12:58:49 +02:00
parent 1957ba519e
commit 3461872435
6 changed files with 14 additions and 4 deletions

View File

@@ -412,7 +412,7 @@ if (STATIC_BINARY OR STATIC_LIBS)
if (WIN32)
set(STATIC_LIBS ${STATIC_LIBS} ws2_32 iphlpapi userenv psapi dnsapi dbghelp)
if ((CMAKE_CXX_COMPILER_ID MATCHES GNU) OR (CMAKE_CXX_COMPILER_ID MATCHES Clang))
set(STATIC_LIBS ${STATIC_LIBS} bcrypt)
set(STATIC_LIBS ${STATIC_LIBS} bcrypt pthread)
endif()
elseif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
set(STATIC_LIBS ${STATIC_LIBS} pthread)

View File

@@ -14,7 +14,7 @@ index a44774d23..09cf10942 100644
// See: https://learn.microsoft.com/en-us/windows/win32/seccng/processprng
typedef BOOL (WINAPI *ProcessPrngFunction)(PBYTE pbData, SIZE_T cbData);
static ProcessPrngFunction g_processprng_fn = NULL;
+static HCRYPTPROV g_hCryptProv = NULL;
+static HCRYPTPROV g_hCryptProv = 0;
+
+static BOOL WINAPI wrapper_CryptGenRandom(PBYTE pbData, SIZE_T cbData)
+{

View File

@@ -18,7 +18,7 @@ if [ $? -ne 0 ]; then
fi
rm -f p2pool.tar
tar -f p2pool.tar -c ../cmake -c ../external -c ../src -c ../CMakeLists.txt -c ../LICENSE -c ../README.md
tar -f p2pool.tar -c ../cmake -c ../external -c ../patches -c ../src -c ../CMakeLists.txt -c ../LICENSE -c ../README.md
ln p2pool.tar freebsd_aarch64/p2pool.tar
ln p2pool.tar freebsd_x64/p2pool.tar

View File

@@ -433,3 +433,10 @@ rm /usr/lib/x86_64-linux-gnu/crt1.o
rm /usr/lib/x86_64-linux-gnu/crti.o
rm /usr/lib/x86_64-linux-gnu/crtn.o
rm /usr/lib/x86_64-linux-gnu/libc.a
echo "Deleting temporary files"
cd /root
rm -rf *
echo "All done"

View File

@@ -3,7 +3,7 @@
# Example usage: ./build.sh v4.8.1
cd "$(dirname "$0")"
[ ! -f "p2pool.tar" ] && tar -f p2pool.tar -c ../../cmake -c ../../external -c ../../src -c ../../CMakeLists.txt -c ../../LICENSE -c ../../README.md
[ ! -f "p2pool.tar" ] && tar -f p2pool.tar -c ../../cmake -c ../../external -c ../../patches -c ../../src -c ../../CMakeLists.txt -c ../../LICENSE -c ../../README.md
docker build --build-arg P2POOL_VERSION=$1 --build-arg BUILD_TIMESTAMP="$(git show --no-patch --format=%ct $1)" -t p2pool_windows_x64_build .

View File

@@ -15,6 +15,9 @@ flags_libs="--target=x86_64-pc-windows-gnu -Os -flto -Wl,/timestamp:$2 -fuse-ld=
flags_p2pool="--target=x86_64-pc-windows-gnu -Wl,/timestamp:$2 -fuse-ld=lld -femulated-tls -Wno-unused-command-line-argument $flags_size $flags_datetime"
flags_cxx_headers="-isystem /usr/local/x86_64-w64-mingw32/include/c++ -isystem /usr/local/x86_64-w64-mingw32/include/c++/15.1.0 -isystem /usr/local/x86_64-w64-mingw32/include"
cd /p2pool
git apply --verbose --ignore-whitespace --directory=external/src/grpc/third_party/boringssl-with-bazel patches/boringssl/win7.patch
cd /p2pool/external/src/curl
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../../cmake/windows_x86_64_toolchain_clang.cmake -DCMAKE_C_FLAGS="$flags_libs" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DBUILD_TESTING=OFF -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
make -j$(nproc)