git: 2c35c867ba05 - main - showconfig: Set MACHINE for src.opts.mk

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Wed, 24 Apr 2024 18:31:44 UTC
The branch main has been updated by andrew:

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

commit 2c35c867ba05c8de167e1597c9044a72febdda63
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-04-18 15:22:46 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-04-24 18:17:20 +0000

    showconfig: Set MACHINE for src.opts.mk
    
    Also set MACHINE and MACHINE_ARCH when reading config options from
    src.opts.mk. This ensures any machine-dependent options are reported
    correctly.
    
    Reviewed by:    emaste, imp
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D44838
---
 Makefile.inc1 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index a0fd539ed25f..0728df1221a0 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -3598,7 +3598,8 @@ check-old: check-old-files check-old-libs check-old-dirs .PHONY
 #
 showconfig: .PHONY
 	@(${MAKE} -n -f ${.CURDIR}/sys/conf/kern.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH}; \
-	  ${MAKE} -n -f ${.CURDIR}/share/mk/src.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes) 2>&1 | grep -E '^(MK|OPT)_[A-Z]' | sort -u
+	  ${MAKE} -n -f ${.CURDIR}/share/mk/src.opts.mk -V dummy -dg1 UPDATE_DEPENDFILE=no NO_OBJ=yes MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH}) 2>&1 | \
+	 grep -E '^(MK|OPT)_[A-Z]' | sort -u
 
 .if !empty(KRNLOBJDIR) && !empty(KERNCONF)
 DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/