git: 49c7ac23fa1d - stable/15 - Centralize definition of ZFSTOP

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 23 Jun 2026 15:56:51 UTC
The branch stable/15 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=49c7ac23fa1dd4c883bc91bae4a854deff0cba54

commit 49c7ac23fa1dd4c883bc91bae4a854deff0cba54
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-11-24 15:46:56 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-06-23 15:20:55 +0000

    Centralize definition of ZFSTOP
    
    Define this helper variable in one place and make it available while
    building the entire base system.
    
    Reviewed by:    sjg
    Obtained from:  CheriBSD (mostly)
    Differential Revision:  https://reviews.freebsd.org/D53790
    
    (cherry picked from commit 7980cf5d6f71adef3ca38825f4aa8aa38a59e43c)
---
 cddl/lib/libtpool/tests/Makefile           | 2 --
 cddl/lib/libzpool/Makefile                 | 2 --
 cddl/sbin/zfs/Makefile                     | 2 --
 cddl/sbin/zpool/Makefile                   | 2 --
 cddl/share/zfs/compatibility.d/Makefile    | 2 --
 cddl/usr.bin/zinject/Makefile              | 2 --
 cddl/usr.bin/zstream/Makefile              | 2 --
 cddl/usr.bin/ztest/Makefile                | 2 --
 cddl/usr.libexec/zfs_prepare_disk/Makefile | 2 --
 cddl/usr.libexec/zpool_influxdb/Makefile   | 2 --
 cddl/usr.sbin/zdb/Makefile                 | 2 --
 cddl/usr.sbin/zhack/Makefile               | 2 --
 share/mk/src.sys.mk                        | 3 +++
 13 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/cddl/lib/libtpool/tests/Makefile b/cddl/lib/libtpool/tests/Makefile
index 19e43cc18821..72a82b6afa59 100644
--- a/cddl/lib/libtpool/tests/Makefile
+++ b/cddl/lib/libtpool/tests/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP= ${SRCTOP}/sys/contrib/openzfs
-
 ATF_TESTS_C+=	libtpool_test
 
 TEST_METADATA+= timeout="10"
diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile
index 407159a85255..c4b9b31602f5 100644
--- a/cddl/lib/libzpool/Makefile
+++ b/cddl/lib/libzpool/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP=	${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/lib/libzpool
 
 # ZFS_COMMON_SRCS
diff --git a/cddl/sbin/zfs/Makefile b/cddl/sbin/zfs/Makefile
index 9a0a5198602e..3b9abe4446e8 100644
--- a/cddl/sbin/zfs/Makefile
+++ b/cddl/sbin/zfs/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP=	${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/cmd/zfs
 .PATH: ${ZFSTOP}/man/man7
 .PATH: ${ZFSTOP}/man/man8
diff --git a/cddl/sbin/zpool/Makefile b/cddl/sbin/zpool/Makefile
index ab7b852b4d9a..be498d730011 100644
--- a/cddl/sbin/zpool/Makefile
+++ b/cddl/sbin/zpool/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP=	${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/man/man4
 .PATH: ${ZFSTOP}/man/man5
 .PATH: ${ZFSTOP}/man/man7
diff --git a/cddl/share/zfs/compatibility.d/Makefile b/cddl/share/zfs/compatibility.d/Makefile
index 6d3663081ae6..4bc8da774168 100644
--- a/cddl/share/zfs/compatibility.d/Makefile
+++ b/cddl/share/zfs/compatibility.d/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP= ${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/cmd/zpool/compatibility.d
 
 PACKAGE=	zfs
diff --git a/cddl/usr.bin/zinject/Makefile b/cddl/usr.bin/zinject/Makefile
index 921d4df7a651..6db4bf6a53cd 100644
--- a/cddl/usr.bin/zinject/Makefile
+++ b/cddl/usr.bin/zinject/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP=	${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/cmd/zinject
 .PATH: ${ZFSTOP}/man/man8
 
diff --git a/cddl/usr.bin/zstream/Makefile b/cddl/usr.bin/zstream/Makefile
index b131901cb6a9..b9c45c25923e 100644
--- a/cddl/usr.bin/zstream/Makefile
+++ b/cddl/usr.bin/zstream/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP=	${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/cmd/zstream
 .PATH: ${ZFSTOP}/man/man8
 
diff --git a/cddl/usr.bin/ztest/Makefile b/cddl/usr.bin/ztest/Makefile
index cb51b5110f03..dc80100ddcac 100644
--- a/cddl/usr.bin/ztest/Makefile
+++ b/cddl/usr.bin/ztest/Makefile
@@ -1,7 +1,5 @@
 .include <src.opts.mk>
 
-ZFSTOP=	${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/cmd
 .PATH: ${ZFSTOP}/man/man1
 
diff --git a/cddl/usr.libexec/zfs_prepare_disk/Makefile b/cddl/usr.libexec/zfs_prepare_disk/Makefile
index 0d3f9b56b28c..1a261c5684bc 100644
--- a/cddl/usr.libexec/zfs_prepare_disk/Makefile
+++ b/cddl/usr.libexec/zfs_prepare_disk/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP= ${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/scripts
 
 PACKAGE=	zfs
diff --git a/cddl/usr.libexec/zpool_influxdb/Makefile b/cddl/usr.libexec/zpool_influxdb/Makefile
index 064ac9b23e4a..3c271997fb3b 100644
--- a/cddl/usr.libexec/zpool_influxdb/Makefile
+++ b/cddl/usr.libexec/zpool_influxdb/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP=	${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/cmd/zpool_influxdb
 .PATH: ${ZFSTOP}/man/man8
 
diff --git a/cddl/usr.sbin/zdb/Makefile b/cddl/usr.sbin/zdb/Makefile
index ad6e63f428a3..13d98b60d1fb 100644
--- a/cddl/usr.sbin/zdb/Makefile
+++ b/cddl/usr.sbin/zdb/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP=	${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/cmd/zdb
 .PATH: ${ZFSTOP}/man/man8
 
diff --git a/cddl/usr.sbin/zhack/Makefile b/cddl/usr.sbin/zhack/Makefile
index 69d561b3407b..a11abd6efe9d 100644
--- a/cddl/usr.sbin/zhack/Makefile
+++ b/cddl/usr.sbin/zhack/Makefile
@@ -1,5 +1,3 @@
-ZFSTOP= ${SRCTOP}/sys/contrib/openzfs
-
 .PATH: ${ZFSTOP}/cmd
 .PATH: ${ZFSTOP}/man/man1
 
diff --git a/share/mk/src.sys.mk b/share/mk/src.sys.mk
index ec035fb71e54..6d6523f24754 100644
--- a/share/mk/src.sys.mk
+++ b/share/mk/src.sys.mk
@@ -48,6 +48,9 @@ CFLAGS+=	-fmacro-prefix-map=${SRCTOP}=/usr/src -fdebug-prefix-map=${SRCTOP}=/usr
 
 DEFAULTWARNS?=	6
 
+# ZFS source directory
+ZFSTOP?=	${SRCTOP}/sys/contrib/openzfs
+
 # tempting, but bsd.compiler.mk causes problems this early
 # probably need to remove dependence on bsd.own.mk 
 #.include "src.opts.mk"