git: c3dd45c47be9 - main - sys/modules: Make use of SRCS.${KERN_OPT}.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 01 Mar 2023 18:33:00 UTC
The branch main has been updated by jhb:

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

commit c3dd45c47be9b3ea47edc84c6bc6187ab74d966b
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-03-01 18:32:30 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-03-01 18:32:30 +0000

    sys/modules: Make use of SRCS.${KERN_OPT}.
    
    kmod.mk appends the value of SRCS.${KERN_OPT} for each defined kernel
    option to SRCS.  This helper is shorter than appending to SRCS under
    explicit checks on KERN_OPTS.
    
    Reviewed by:    imp
    Sponsored by:   DARPA
    Differential Revision:  https://reviews.freebsd.org/D38738
---
 sys/modules/cxgbe/if_cxgbe/Makefile | 4 +---
 sys/modules/geom/geom_uzip/Makefile | 4 +---
 sys/modules/vmm/Makefile            | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/sys/modules/cxgbe/if_cxgbe/Makefile b/sys/modules/cxgbe/if_cxgbe/Makefile
index 723029264bac..0a4103de17c8 100644
--- a/sys/modules/cxgbe/if_cxgbe/Makefile
+++ b/sys/modules/cxgbe/if_cxgbe/Makefile
@@ -23,9 +23,7 @@ SRCS+=	t4_filter.c
 SRCS+=	t4_hw.c
 SRCS+=	t4_if.c t4_if.h
 SRCS+=	t4_iov.c
-.if ${KERN_OPTS:MKERN_TLS} != ""
-SRCS+=	t6_kern_tls.c
-.endif
+SRCS.KERN_TLS+=	t6_kern_tls.c
 SRCS+=	t4_keyctx.c
 SRCS+=	t4_l2t.c
 SRCS+=	t4_main.c
diff --git a/sys/modules/geom/geom_uzip/Makefile b/sys/modules/geom/geom_uzip/Makefile
index 7269a49422ff..8cebb60b54d8 100644
--- a/sys/modules/geom/geom_uzip/Makefile
+++ b/sys/modules/geom/geom_uzip/Makefile
@@ -10,10 +10,8 @@ SRCS+=	g_uzip.h g_uzip_dapi.h g_uzip_lzma.h g_uzip_zlib.h g_uzip_softc.h \
     g_uzip_wrkthr.h
 
 # This works for buildkernel, but will disable zstd in geom_uzip out of tree.
-.if ${KERN_OPTS:MZSTDIO} != ""
-SRCS+=	g_uzip_zstd.c g_uzip_zstd.h
+SRCS.ZSTDIO+=	g_uzip_zstd.c g_uzip_zstd.h
 CFLAGS.g_uzip_zstd.c+=	-I${SRCTOP}/sys/contrib/zstd/lib/freebsd
-.endif
 
 #CFLAGS=	-g -DINVARIANT_SUPPORT -DINVARIANTS
 
diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile
index ef0d9dcb6786..412342967eec 100644
--- a/sys/modules/vmm/Makefile
+++ b/sys/modules/vmm/Makefile
@@ -61,9 +61,7 @@ SRCS+=	vmcb.c		\
 	amdvi_hw.c	\
 	svm_msr.c
 
-.if ${KERN_OPTS:MBHYVE_SNAPSHOT} != ""
-SRCS+=	vmm_snapshot.c
-.endif
+SRCS.BHYVE_SNAPSHOT=	vmm_snapshot.c
 
 CLEANFILES=	vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o