diff --git a/sys/conf/config.mk b/sys/conf/config.mk index 96b03da27980..90e8934d1908 100644 --- a/sys/conf/config.mk +++ b/sys/conf/config.mk @@ -37,7 +37,11 @@ opt_ratelimit.h: @echo "#define RATELIMIT 1" > ${.TARGET} .endif opt_mrouting.h: - echo "#define MROUTING 1" > ${.TARGET} + @echo "#define MROUTING 1" > ${.TARGET} +.if ${MK_FDT} != "no" +opt_platform.h: + @echo "#define FDT 1" > ${.TARGET} +.endif opt_printf.h: echo "#define PRINTF_BUFR_SIZE 128" > ${.TARGET} opt_scsi.h: diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 532c282edc34..077009baebf0 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -102,6 +102,12 @@ BROKEN_OPTIONS+= KERNEL_RETPOLINE BROKEN_OPTIONS+=EFI .endif +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +__DEFAULT_NO_OPTIONS += FDT +.else +__DEFAULT_YES_OPTIONS += FDT +.endif + # expanded inline from bsd.mkopt.mk to avoid share/mk dependency # Those that default to yes @@ -178,4 +184,9 @@ MK_${var}_SUPPORT:= yes .if !defined(OPT_FDT) && defined(KERNBUILDDIR) OPT_FDT!= sed -n '/FDT/p' ${KERNBUILDDIR}/opt_platform.h .export OPT_FDT +.if empty(OPT_FDT) +MK_FDT:=no +.else +MK_FDT:=yes +.endif .endif