From 32533e3c9604aad0895c3131efeb5fbc2734c555 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Tue, 5 Apr 2022 19:05:15 +0200 Subject: [PATCH] FreeBSD build --- CMakeLists.txt | 6 +++++- README.md | 24 ++++++++++++++++++------ src/util.cpp | 2 +- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af5b3bf..6df26ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,8 @@ include_directories(external/src/robin-hood-hashing/src/include) if (WIN32) set(LIBS ${LIBS} ws2_32 iphlpapi userenv psapi) +elseif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD) + set(LIBS ${LIBS} pthread) elseif (NOT APPLE) set(LIBS ${LIBS} pthread gss dl) endif() @@ -140,7 +142,9 @@ if (STATIC_BINARY) set(STATIC_LIBS randomx) endif() - if (NOT APPLE) + if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD) + set(STATIC_LIBS ${STATIC_LIBS} pthread) + elseif (NOT APPLE) set(STATIC_LIBS ${STATIC_LIBS} pthread dl) endif() diff --git a/README.md b/README.md index f10eee2..d59bd9b 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ Pool status and monitoring pages can be found at https://p2pool.io/, https://p2p ### Build Status -![C/C++ CI](https://github.com/SChernykh/p2pool/actions/workflows/c-cpp.yml/badge.svg) -![CodeQL](https://github.com/SChernykh/p2pool/actions/workflows/codeql-analysis.yml/badge.svg) -![msvc-analysis](https://github.com/SChernykh/p2pool/actions/workflows/msvc-analysis.yml/badge.svg) -![cppcheck](https://github.com/SChernykh/p2pool/actions/workflows/cppcheck.yml/badge.svg) +![C/C++ CI](https://github.com/SChernykh/p2pool/actions/workflows/c-cpp.yml/badge.svg) +![CodeQL](https://github.com/SChernykh/p2pool/actions/workflows/codeql-analysis.yml/badge.svg) +![msvc-analysis](https://github.com/SChernykh/p2pool/actions/workflows/msvc-analysis.yml/badge.svg) +![cppcheck](https://github.com/SChernykh/p2pool/actions/workflows/cppcheck.yml/badge.svg) Coverity Scan Build Status @@ -188,7 +188,7 @@ Please see the relevant instructions for your platform: ### Ubuntu 20.04 -Run the following commands to install the necessary prerequisites, clone this repo, and build P2Pool locally on Ubuntu 20.04: +Run the following commands to install the necessary prerequisites, clone this repo, and build P2Pool locally on Ubuntu 20.04: ``` sudo apt update && sudo apt install git build-essential cmake libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev git clone --recursive https://github.com/SChernykh/p2pool @@ -239,7 +239,7 @@ Alternatively, you can select "Clone a repository" within the GUI, then select " ### macOS -Run the following commands to install the necessary prerequisites, clone this repo, and build P2Pool locally on your Mac: +Run the following commands to install the necessary prerequisites, clone this repo, and build P2Pool locally on your Mac: ``` brew update && brew install git cmake libuv zmq libpgm git clone --recursive https://github.com/SChernykh/p2pool @@ -249,6 +249,18 @@ cmake .. make -j$(sysctl -n hw.logicalcpu) ``` +### FreeBSD + +Run the following commands to install the necessary prerequisites, clone this repo, and build P2Pool locally on FreeBSD: +``` +pkg install git cmake libuv libzmq4 +git clone --recursive https://github.com/SChernykh/p2pool +cd p2pool +mkdir build && cd build +cmake .. +make +``` + ## Donations If you'd like to support further development of Monero P2Pool, you're welcome to send any amount of XMR to the following address: diff --git a/src/util.cpp b/src/util.cpp index 5ee0a03..ca4c469 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -66,7 +66,7 @@ void make_thread_background() SetThreadPriorityBoost(GetCurrentThread(), true); SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN); SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE); -#elif !defined(__APPLE__) +#elif !defined(__APPLE__) && !defined(__FreeBSD__) sched_param param; param.sched_priority = 0; if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) {