git: 4b932c2c9ef7 - main - Set MK_host_egacy=yes earlier

From: Simon J. Gerraty <sjg_at_FreeBSD.org>
Date: Tue, 25 Apr 2023 07:27:14 UTC
The branch main has been updated by sjg:

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

commit 4b932c2c9ef70252986792df8c71e0b058dac24e
Author:     Simon J. Gerraty <sjg@FreeBSD.org>
AuthorDate: 2023-04-25 07:26:35 +0000
Commit:     Simon J. Gerraty <sjg@FreeBSD.org>
CommitDate: 2023-04-25 07:26:35 +0000

    Set MK_host_egacy=yes earlier
    
    If we need to set MK_host_egacy=yes we might need to check it
    in local.toolchain.mk so set it earlier in local.meta.sys.env.mk
    
    Leave the default MK_host_egacy?=no in local.sys.mk so it can
    be tested in Makefiles without concern for build mode.
---
 share/mk/local.meta.sys.env.mk | 7 +++++++
 share/mk/local.sys.mk          | 7 +------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/share/mk/local.meta.sys.env.mk b/share/mk/local.meta.sys.env.mk
index 6b692d13fedf..6d0d493f1047 100644
--- a/share/mk/local.meta.sys.env.mk
+++ b/share/mk/local.meta.sys.env.mk
@@ -93,3 +93,10 @@ META_MODE+=	missing-filemon=yes
 # this does not need/want filemon
 UPDATE_DEPENDFILE= NO
 .endif
+
+.if ${MK_DIRDEPS_BUILD} == "yes"
+.if ${.MAKE.OS} != "FreeBSD" || ${_HOST_OSREL:R} < ${OS_REVISION:R}
+# a pseudo option to indicate we need libegacy for host
+MK_host_egacy= yes
+.endif
+.endif
diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk
index abcbf396c6b4..148499483c8b 100644
--- a/share/mk/local.sys.mk
+++ b/share/mk/local.sys.mk
@@ -79,12 +79,7 @@ JOB_MAX:= ${jm:R}
 .endif
 .endif
 
-.if ${MK_DIRDEPS_BUILD} == "yes"
-.if ${.MAKE.OS} != "FreeBSD" || ${_HOST_OSREL:R} < ${OS_REVISION:R}
-# a pseudo option to indicate we need libegacy for host
-MK_host_egacy= yes
-.endif
-.endif
+# this will be set via local.meta.sys.env.mk if appropriate
 MK_host_egacy?= no
 
 .if ${.MAKE.MODE:Mmeta*} != ""