diff options
author | fanquake <fanquake@gmail.com> | 2022-01-07 13:16:30 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-02-10 12:33:10 +0000 |
commit | 471d15536f12889077578884fca33d1b0930fd66 (patch) | |
tree | 20b3fba56b89048479b7215c7377bf82e9ee6f05 | |
parent | 75ae39eeec22e56c92f1241ff2ae87ad9a974625 (diff) | |
download | bitcoin-471d15536f12889077578884fca33d1b0930fd66.tar.xz |
build: add support for OpenBSD to depends
-rw-r--r-- | depends/Makefile | 2 | ||||
-rw-r--r-- | depends/README.md | 4 | ||||
-rw-r--r-- | depends/builders/openbsd.mk | 7 | ||||
-rw-r--r-- | depends/hosts/openbsd.mk | 31 | ||||
-rw-r--r-- | depends/packages/bdb.mk | 1 | ||||
-rw-r--r-- | depends/packages/boost.mk | 3 | ||||
-rw-r--r-- | depends/packages/libevent.mk | 1 | ||||
-rw-r--r-- | depends/packages/sqlite.mk | 1 | ||||
-rw-r--r-- | depends/packages/zeromq.mk | 1 | ||||
-rw-r--r-- | depends/patches/boost/fix_openbsd_test_lib.patch | 38 |
10 files changed, 89 insertions, 0 deletions
diff --git a/depends/Makefile b/depends/Makefile index fba30a1d4e..573115d447 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -77,6 +77,7 @@ full_build_os:=$(subst $(build_arch)-$(build_vendor)-,,$(build)) build_os:=$(findstring linux,$(full_build_os)) build_os+=$(findstring darwin,$(full_build_os)) build_os+=$(findstring freebsd,$(full_build_os)) +build_os+=$(findstring openbsd,$(full_build_os)) build_os:=$(strip $(build_os)) ifeq ($(build_os),) build_os=$(full_build_os) @@ -88,6 +89,7 @@ full_host_os:=$(subst $(host_arch)-$(host_vendor)-,,$(canonical_host)) host_os:=$(findstring linux,$(full_host_os)) host_os+=$(findstring darwin,$(full_host_os)) host_os+=$(findstring freebsd,$(full_host_os)) +host_os+=$(findstring openbsd,$(full_host_os)) host_os+=$(findstring mingw32,$(full_host_os)) ifeq (android,$(findstring android,$(full_host_os))) diff --git a/depends/README.md b/depends/README.md index 6b6af99dee..f7647198c6 100644 --- a/depends/README.md +++ b/depends/README.md @@ -84,6 +84,10 @@ For linux S390X cross compilation: sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu +### Install the required dependencies: OpenBSD + + pkg_add bash gtar + ### Dependency Options The following can be set when running make: `make FOO=bar` diff --git a/depends/builders/openbsd.mk b/depends/builders/openbsd.mk new file mode 100644 index 0000000000..44825d106a --- /dev/null +++ b/depends/builders/openbsd.mk @@ -0,0 +1,7 @@ +build_openbsd_CC = clang +build_openbsd_CXX = clang++ + +build_openbsd_SHA256SUM = sha256 +build_openbsd_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o + +build_openbsd_TAR = gtar diff --git a/depends/hosts/openbsd.mk b/depends/hosts/openbsd.mk new file mode 100644 index 0000000000..dc8393e04c --- /dev/null +++ b/depends/hosts/openbsd.mk @@ -0,0 +1,31 @@ +openbsd_CFLAGS=-pipe +openbsd_CFLAGS_CXXFLAGS=$(openbsd_CFLAGS) + +openbsd_CFLAGS_release_CFLAGS=-O2 +openbsd_CFLAGS_release_CXXFLAGS=$(openbsd_release_CFLAGS) + +openbsd_CFLAGS_debug_CFLAGS=-O1 +openbsd_CFLAGS_debug_CXXFLAGS=$(openbsd_debug_CFLAGS) + +ifeq (86,$(findstring 86,$(build_arch))) +i686_openbsd_CC=clang -m32 +i686_openbsd_CXX=clang++ -m32 +i686_openbsd_AR=ar +i686_openbsd_RANLIB=ranlib +i686_openbsd_NM=nm +i686_openbsd_STRIP=strip + +x86_64_openbsd_CC=clang -m64 +x86_64_openbsd_CXX=clang++ -m64 +x86_64_openbsd_AR=ar +x86_64_openbsd_RANLIB=ranlib +x86_64_openbsd_NM=nm +x86_64_openbsd_STRIP=strip +else +i686_openbsd_CC=$(default_host_CC) -m32 +i686_openbsd_CXX=$(default_host_CXX) -m32 +x86_64_openbsd_CC=$(default_host_CC) -m64 +x86_64_openbsd_CXX=$(default_host_CXX) -m64 +endif + +openbsd_cmake_system=OpenBSD diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk index 4e74c95a8e..95004f3a22 100644 --- a/depends/packages/bdb.mk +++ b/depends/packages/bdb.mk @@ -11,6 +11,7 @@ $(package)_config_opts=--disable-shared --enable-cxx --disable-replication --ena $(package)_config_opts_mingw32=--enable-mingw $(package)_config_opts_linux=--with-pic $(package)_config_opts_freebsd=--with-pic +$(package)_config_opts_openbsd=--with-pic $(package)_config_opts_android=--with-pic $(package)_cflags+=-Wno-error=implicit-function-declaration $(package)_cxxflags+=-std=c++17 diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 820a7ff4e7..6c2dd9ea08 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -4,6 +4,7 @@ $(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$(su $(package)_file_name=boost_$($(package)_version).tar.bz2 $(package)_sha256_hash=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee $(package)_dependencies=native_b2 +$(package)_patches=fix_openbsd_test_lib.patch define $(package)_set_vars $(package)_config_opts_release=variant=release @@ -26,11 +27,13 @@ $(package)_config_libraries=test $(package)_cxxflags+=-std=c++17 $(package)_cxxflags_linux=-fPIC $(package)_cxxflags_freebsd=-fPIC +$(package)_cxxflags_openbsd=-fPIC $(package)_cxxflags_android=-fPIC $(package)_cxxflags_x86_64=-fcf-protection=full endef define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/fix_openbsd_test_lib.patch && \ echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : <cflags>\"$($(package)_cflags)\" <cxxflags>\"$($(package)_cxxflags)\" <compileflags>\"$($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$($(package)_ar)\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam endef diff --git a/depends/packages/libevent.mk b/depends/packages/libevent.mk index 2305f96d27..78850e583e 100644 --- a/depends/packages/libevent.mk +++ b/depends/packages/libevent.mk @@ -13,6 +13,7 @@ define $(package)_set_vars $(package)_config_opts_release=--disable-debug-mode $(package)_config_opts_linux=--with-pic $(package)_config_opts_freebsd=--with-pic + $(package)_config_opts_openbsd=--with-pic $(package)_config_opts_android=--with-pic $(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0601 endef diff --git a/depends/packages/sqlite.mk b/depends/packages/sqlite.mk index 36b6df7f6e..94bc6dda79 100644 --- a/depends/packages/sqlite.mk +++ b/depends/packages/sqlite.mk @@ -8,6 +8,7 @@ define $(package)_set_vars $(package)_config_opts=--disable-shared --disable-readline --disable-dynamic-extensions --enable-option-checking $(package)_config_opts_linux=--with-pic $(package)_config_opts_freebsd=--with-pic +$(package)_config_opts_openbsd=--with-pic endef define $(package)_preprocess_cmds diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index c56ec5c2bd..2d8286ea36 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -13,6 +13,7 @@ define $(package)_set_vars $(package)_config_opts += --disable-Werror --disable-drafts --enable-option-checking $(package)_config_opts_linux=--with-pic $(package)_config_opts_freebsd=--with-pic + $(package)_config_opts_openbsd=--with-pic $(package)_config_opts_android=--with-pic $(package)_cxxflags+=-std=c++17 endef diff --git a/depends/patches/boost/fix_openbsd_test_lib.patch b/depends/patches/boost/fix_openbsd_test_lib.patch new file mode 100644 index 0000000000..84351065a3 --- /dev/null +++ b/depends/patches/boost/fix_openbsd_test_lib.patch @@ -0,0 +1,38 @@ +commit 684f067dde3b798877655cdda4eab8d7c26b2510 +Author: George Koehler <kernigh@gmail.com> +Date: Thu Oct 3 20:06:38 2019 -0400 + + OpenBSD is missing SI_ASYNCIO and SI_MESGQ + + Check if SI_ASYNCIO and SI_MESGQ are defined as macros. This allows + to run tests on OpenBSD 6.5, where the macros are missing. + + This is identical to patch-boost_test_impl_execution_monitor_ipp in + OpenBSD Ports, except that I added a comment. + + Can be removed when we use Boost 1.72.x or later. + +diff --git a/boost/test/impl/execution_monitor.ipp b/boost/test/impl/execution_monitor.ipp +index ccc44972..77a01e21 100644 +--- a/boost/test/impl/execution_monitor.ipp ++++ b/boost/test/impl/execution_monitor.ipp +@@ -391,14 +391,19 @@ system_signal_exception::report() const + report_error( execution_exception::system_error, + "signal: the expiration of a timer set by timer_settimer()" ); + break; ++// OpenBSD was missing SI_ASYNCIO and SI_MESGQ ++#ifdef SI_ASYNCIO + case SI_ASYNCIO: + report_error( execution_exception::system_error, + "signal: generated by the completion of an asynchronous I/O request" ); + break; ++#endif ++#ifdef SI_MESGQ + case SI_MESGQ: + report_error( execution_exception::system_error, + "signal: generated by the the arrival of a message on an empty message queue" ); + break; ++#endif + default: + break; + } |