git: 4355ab6f04b7 - main - config.mk: All options in DEFAULTS are now defined in opt_global.h

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 24 Oct 2022 18:13:56 UTC
The branch main has been updated by imp:

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

commit 4355ab6f04b79b43682e2643926e65f4ef1fb33f
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-10-24 18:12:17 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-10-24 18:13:04 +0000

    config.mk: All options in DEFAULTS are now defined in opt_global.h
    
    To simplify management of all the options that should be enabled for the
    different architectures, adopt the convention that all options listed in
    DEFAULTS will be #defined to 1 in opt_global.h for untied builds. Except
    for GEOM_* and ISAPNP, they are all in opt_global.h. ISAPNP is a
    opt_dontuse.h, so only filter GEOM_*.
    
    Sponsored by:           Netflix
    Reviewed by:            kevans
    Differential Revision:  https://reviews.freebsd.org/D37108
---
 sys/conf/config.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/conf/config.mk b/sys/conf/config.mk
index 90e8934d1908..37ab26aae1bd 100644
--- a/sys/conf/config.mk
+++ b/sys/conf/config.mk
@@ -13,6 +13,13 @@ opt_global.h:
 	@echo "#define SMP 1" >> ${.TARGET}
 	@echo "#define MAC 1" >> ${.TARGET}
 	@echo "#define VIMAGE 1" >> ${.TARGET}
+# Note: Define 'options' in DEFAULTS to 1. For simplicity, no check if the
+# option is in opt_global.h. Nearly all the options in DEFAUlTS today are in
+# opt_global.h with GEOM_* being the main exceptions. Move any options from
+# GENERIC or std.* files to DEFAULTS to get this treatment for untied builds.
+	@awk '$$1 == "options" && $$2 !~ "GEOM_" { print "#define ", $$2, " 1"; }' \
+		< ${SYSDIR}/${MACHINE}/conf/DEFAULTS \
+		>>  ${.TARGET}
 .if ${MK_BHYVE_SNAPSHOT} != "no"
 opt_bhyve_snapshot.h:
 	@echo "#define BHYVE_SNAPSHOT 1" > ${.TARGET}