git: 701ab6dba4a2 - main - Stop building FDT-only modules in an ACPI only kernel

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Thu, 27 Oct 2022 17:59:50 UTC
The branch main has been updated by andrew:

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

commit 701ab6dba4a2232751cd91f79bfc1d8e96bf5316
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-10-27 17:01:44 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-10-27 17:59:33 +0000

    Stop building FDT-only modules in an ACPI only kernel
    
    When building a kernel without FDT these modules don't build. As they
    depend on FDT and don't work with ACPI disable them.
    
    Reviewed by:    imp, kevans
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D37178
---
 sys/modules/Makefile      | 11 +++++++++--
 sys/modules/uart/Makefile |  2 ++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 8737871e7a53..5d6f8a352a86 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -611,8 +611,10 @@ _irdma=		irdma
 
 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
 	${MACHINE_CPUARCH} == "riscv"
+.if !empty(OPT_FDT)
 _if_cgem=	if_cgem
 .endif
+.endif
 
 # These rely on 64bit atomics
 .if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
@@ -638,18 +640,23 @@ _cxgb=		cxgb
 .endif
 
 .if ${MACHINE_CPUARCH} == "aarch64"
-_allwinner=	allwinner
 _armv8crypto=	armv8crypto
 _dpaa2=		dpaa2
-_dwwdt=		dwwdt
 _em=		em
+
+.if !empty(OPT_FDT)
+_allwinner=	allwinner
+_dwwdt=		dwwdt
 _enetc=		enetc
 _felix=		felix
 _rockchip=	rockchip
 .endif
+.endif
 
 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
+.if !empty(OPT_FDT)
 _sdhci_fdt=	sdhci_fdt
+.endif
 _e6000sw=	e6000sw
 _neta=		neta
 _hyperv=  hyperv
diff --git a/sys/modules/uart/Makefile b/sys/modules/uart/Makefile
index ad946fb063d6..29d6e0897b56 100644
--- a/sys/modules/uart/Makefile
+++ b/sys/modules/uart/Makefile
@@ -24,8 +24,10 @@ uart_cpu_machine= ${_uart_cpu}
 
 .if ${MACHINE} == "arm64"
 uart_dev_mvebu=uart_dev_mvebu.c
+.if !empty(OPT_FDT)
 uart_dev_mu=uart_dev_mu.c
 .endif
+.endif
 
 KMOD=	uart
 SRCS=	${uart_bus_acpi} uart_bus_isa.c \