xref: /OK3568_Linux_fs/buildroot/package/zfs/zfs.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# zfs
4#
5################################################################################
6
7ZFS_VERSION = 2.0.5
8ZFS_SITE = https://github.com/openzfs/zfs/releases/download/zfs-$(ZFS_VERSION)
9ZFS_LICENSE = CDDL
10ZFS_LICENSE_FILES = LICENSE COPYRIGHT
11ZFS_CPE_ID_VENDOR = openzfs
12ZFS_CPE_ID_PRODUCT = openzfs
13
14ZFS_AUTORECONF = YES
15
16ZFS_DEPENDENCIES = libaio openssl udev util-linux zlib
17
18# sysvinit installs only a commented-out modules-load.d/ config file
19ZFS_CONF_OPTS = \
20	--with-linux=$(LINUX_DIR) \
21	--with-linux-obj=$(LINUX_DIR) \
22	--disable-rpath \
23	--disable-sysvinit
24
25ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
26ZFS_DEPENDENCIES += libtirpc
27ZFS_CONF_OPTS += --with-tirpc
28else
29ZFS_CONF_OPTS += --without-tirpc
30endif
31
32ifeq ($(BR2_INIT_SYSTEMD),y)
33# Installs the optional systemd generators, units, and presets files.
34ZFS_CONF_OPTS += --enable-systemd
35else
36ZFS_CONF_OPTS += --disable-systemd
37endif
38
39# The optional PyZFS uses different scripts depending on the python
40# version (ex: arc_summary2 or arc_summary3).
41ifeq ($(BR2_PACKAGE_PYTHON),y)
42ZFS_DEPENDENCIES += python python-setuptools host-python-cffi
43ZFS_CONF_ENV += \
44	PYTHON=$(HOST_DIR)/usr/bin/python2 \
45	PYTHON_CPPFLAGS="`$(STAGING_DIR)/usr/bin/python2-config --includes`" \
46	PYTHON_LIBS="`$(STAGING_DIR)/usr/bin/python2-config --ldflags`" \
47	PYTHON_SITE_PKG="/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages"
48ZFS_CONF_OPTS += --enable-pyzfs
49else ifeq ($(BR2_PACKAGE_PYTHON3),y)
50ZFS_DEPENDENCIES += python3 python-setuptools host-python-cffi
51ZFS_CONF_ENV += \
52	PYTHON=$(HOST_DIR)/usr/bin/python3 \
53	PYTHON_CPPFLAGS="`$(STAGING_DIR)/usr/bin/python3-config --includes`" \
54	PYTHON_LIBS="`$(STAGING_DIR)/usr/bin/python3-config --ldflags`" \
55	PYTHON_EXTRA_LIBS="`$(STAGING_DIR)/usr/bin/python3-config --libs --embed`" \
56	PYTHON_SITE_PKG="/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages"
57ZFS_CONF_OPTS += --enable-pyzfs
58else
59ZFS_CONF_OPTS += --disable-pyzfs --without-python
60endif
61
62ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
63ZFS_DEPENDENCIES += linux-pam
64ZFS_CONF_ENV += --enable-pam=yes
65else
66ZFS_CONF_OPTS += --disable-pam
67endif
68
69# ZFS userland tools are unfunctional without the Linux kernel modules.
70ZFS_MODULE_SUBDIRS = \
71	module/avl \
72	module/icp \
73	module/lua \
74	module/nvpair \
75	module/spl \
76	module/unicode \
77	module/zcommon \
78	module/zstd \
79	module/zfs
80
81# These requirements will be validated by zfs/config/kernel-config-defined.m4
82define ZFS_LINUX_CONFIG_FIXUPS
83	$(call KCONFIG_DISABLE_OPT,CONFIG_DEBUG_LOCK_ALLOC)
84	$(call KCONFIG_DISABLE_OPT,CONFIG_TRIM_UNUSED_KSYMS)
85	$(call KCONFIG_ENABLE_OPT,CONFIG_CRYPTO_DEFLATE)
86	$(call KCONFIG_ENABLE_OPT,CONFIG_ZLIB_DEFLATE)
87	$(call KCONFIG_ENABLE_OPT,CONFIG_ZLIB_INFLATE)
88endef
89
90$(eval $(kernel-module))
91$(eval $(autotools-package))
92