aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-01-03 18:20:08 +0800
committerfanquake <fanquake@gmail.com>2022-02-14 16:52:23 +0000
commit7b06ffce9c50110b475c722918c55a14402346a5 (patch)
treed90e13c9e3425452eafeb2ffab1ad397601c8c7e
parent3ce40e64d4ae9419658555fd1fb250b93f52684a (diff)
build: add NetBSD support to depends
-rw-r--r--depends/Makefile2
-rw-r--r--depends/builders/netbsd.mk2
-rw-r--r--depends/hosts/netbsd.mk31
-rw-r--r--depends/packages/bdb.mk1
-rw-r--r--depends/packages/libevent.mk1
-rw-r--r--depends/packages/sqlite.mk1
-rw-r--r--depends/packages/zeromq.mk1
7 files changed, 39 insertions, 0 deletions
diff --git a/depends/Makefile b/depends/Makefile
index 573115d447..723509c81d 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 netbsd,$(full_build_os))
build_os+=$(findstring openbsd,$(full_build_os))
build_os:=$(strip $(build_os))
ifeq ($(build_os),)
@@ -89,6 +90,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/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 95004f3a22..dc536fd399 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 94bc6dda79..126781ceeb 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 2d8286ea36..c74ae15b31 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_netbsd=--with-pic
$(package)_config_opts_openbsd=--with-pic
$(package)_config_opts_android=--with-pic
$(package)_cxxflags+=-std=c++17