From a1dc3f3f03308e6c90c31e771e9edd66368e0ebe Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 14 Feb 2022 20:16:56 +0000 Subject: [PATCH] Merge bitcoin/bitcoin#23955: build: add support for NetBSD in depends bcd36e14f0a2b89445f1436094de40696d6ad76c build: correct depends FreeBSD C{XX}FLAGS (fanquake) 7b06ffce9c50110b475c722918c55a14402346a5 build: add NetBSD support to depends (fanquake) Pull request description: Similar to #23948. Doesn't build the Qt package; I haven't looked at doing that yet, but have an assumption that it's going to fail out of the box similar to the FreeBSD build. Guix Build: ```bash ``` ACKs for top commit: theuni: ACK bcd36e14f0a2b89445f1436094de40696d6ad76c Tree-SHA512: 9a0946cefbcb9a92dd730b885463f3213e304c8d4b39fea8d831fc013a73d2ef998ca84e384bf45a01fa1449cf5a35eaffaa5b57a9062c2cdda34312d33ec3fc --- depends/Makefile | 2 ++ depends/builders/netbsd.mk | 2 ++ depends/hosts/freebsd.mk | 10 +++++----- depends/hosts/netbsd.mk | 31 +++++++++++++++++++++++++++++++ depends/packages/bdb.mk | 1 + depends/packages/libevent.mk | 1 + depends/packages/sqlite.mk | 1 + depends/packages/zeromq.mk | 1 + 8 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 depends/builders/netbsd.mk create mode 100644 depends/hosts/netbsd.mk diff --git a/depends/Makefile b/depends/Makefile index ab641bc6db..b8ef940dba 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -72,6 +72,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 netbsd,$(full_build_os)) build_os+=$(findstring openbsd,$(full_build_os)) build_os:=$(strip $(build_os)) ifeq ($(build_os),) @@ -84,6 +85,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 netbsd,$(full_host_os)) host_os+=$(findstring openbsd,$(full_host_os)) host_os+=$(findstring mingw32,$(full_host_os)) diff --git a/depends/builders/netbsd.mk b/depends/builders/netbsd.mk new file mode 100644 index 0000000000..b7cf1f7514 --- /dev/null +++ b/depends/builders/netbsd.mk @@ -0,0 +1,2 @@ +build_netbsd_SHA256SUM = shasum -a 256 +build_netbsd_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o diff --git a/depends/hosts/freebsd.mk b/depends/hosts/freebsd.mk index 307f844331..0a62347b57 100644 --- a/depends/hosts/freebsd.mk +++ b/depends/hosts/freebsd.mk @@ -1,11 +1,11 @@ freebsd_CFLAGS=-pipe -freebsd_CFLAGS_CXXFLAGS=$(freebsd_CFLAGS) +freebsd_CXXFLAGS=$(freebsd_CFLAGS) -freebsd_CFLAGS_release_CFLAGS=-O2 -freebsd_CFLAGS_release_CXXFLAGS=$(freebsd_release_CFLAGS) +freebsd_release_CFLAGS=-O2 +freebsd_release_CXXFLAGS=$(freebsd_release_CFLAGS) -freebsd_CFLAGS_debug_CFLAGS=-O1 -freebsd_CFLAGS_debug_CXXFLAGS=$(freebsd_debug_CFLAGS) +freebsd_debug_CFLAGS=-O1 +freebsd_debug_CXXFLAGS=$(freebsd_debug_CFLAGS) ifeq (86,$(findstring 86,$(build_arch))) i686_freebsd_CC=clang -m32 diff --git a/depends/hosts/netbsd.mk b/depends/hosts/netbsd.mk new file mode 100644 index 0000000000..b3e4545a64 --- /dev/null +++ b/depends/hosts/netbsd.mk @@ -0,0 +1,31 @@ +netbsd_CFLAGS=-pipe +netbsd_CXXFLAGS=$(netbsd_CFLAGS) + +netbsd_release_CFLAGS=-O2 +netbsd_release_CXXFLAGS=$(netbsd_release_CFLAGS) + +netbsd_debug_CFLAGS=-O1 +netbsd_debug_CXXFLAGS=$(netbsd_debug_CFLAGS) + +ifeq (86,$(findstring 86,$(build_arch))) +i686_netbsd_CC=gcc -m32 +i686_netbsd_CXX=g++ -m32 +i686_netbsd_AR=ar +i686_netbsd_RANLIB=ranlib +i686_netbsd_NM=nm +i686_netbsd_STRIP=strip + +x86_64_netbsd_CC=gcc -m64 +x86_64_netbsd_CXX=g++ -m64 +x86_64_netbsd_AR=ar +x86_64_netbsd_RANLIB=ranlib +x86_64_netbsd_NM=nm +x86_64_netbsd_STRIP=strip +else +i686_netbsd_CC=$(default_host_CC) -m32 +i686_netbsd_CXX=$(default_host_CXX) -m32 +x86_64_netbsd_CC=$(default_host_CC) -m64 +x86_64_netbsd_CXX=$(default_host_CXX) -m64 +endif + +netbsd_cmake_system=NetBSD diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk index 6a74588c4f..34180e571f 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_netbsd=--with-pic $(package)_config_opts_openbsd=--with-pic $(package)_config_opts_android=--with-pic $(package)_cflags+=-Wno-error=implicit-function-declaration diff --git a/depends/packages/libevent.mk b/depends/packages/libevent.mk index 78850e583e..748ed510c1 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_netbsd=--with-pic $(package)_config_opts_openbsd=--with-pic $(package)_config_opts_android=--with-pic $(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0601 diff --git a/depends/packages/sqlite.mk b/depends/packages/sqlite.mk index e772bff288..820d724214 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_netbsd=--with-pic $(package)_config_opts_openbsd=--with-pic endef diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index 1d37c77f0b..85c2003780 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -11,6 +11,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_netbsd=--with-pic $(package)_config_opts_openbsd=--with-pic $(package)_config_opts_android=--with-pic $(package)_cxxflags=-std=c++17