From eab55eb1180c1e689fdff5d1a60249cfca8b6f69 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 10 Jul 2024 18:04:00 +0000 Subject: [PATCH] bsd.prefs.mk: Restore OPSYS-related variables in MAKEFLAGS. In bsd.prefs.mk revision 1.440, where I introduced NATIVE_OPSYS, NATIVE_OS_VERSION, &c., I put the NATIVE_* variables into MAKEFLAGS because they're the ones that require spawning uname subprocesses to determine. But MAKEFLAGS also leaks into the package make(1) environment, and various package makefiles (particularly ones we patched) relied on OPSYS being defined there, which this broke. So put back MAKEFLAGS+= OPSYS=${OPSYS:Q} and the others. --- mk/bsd.prefs.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk index 20916f04503c..d7722cb24020 100644 --- a/mk/bsd.prefs.mk +++ b/mk/bsd.prefs.mk @@ -90,6 +90,7 @@ UNAME=echo Unknown .if !defined(NATIVE_OPSYS) NATIVE_OPSYS:= ${:!${UNAME} -s!:S/-//g:S/\///g:C/^CYGWIN_.*$/Cygwin/} MAKEFLAGS+= NATIVE_OPSYS=${NATIVE_OPSYS:Q} +MAKEFLAGS+= OPSYS=${OPSYS:Q} # defined in crossvars .endif # OS_VARIANT is used to differentiate operating systems which have a common @@ -104,6 +105,7 @@ NATIVE_OS_VARIANT?= # empty _NATIVE_OS_VERSION_CMD= ${UNAME} -r NATIVE_OS_VERSION= ${_NATIVE_OS_VERSION_CMD:sh} MAKEFLAGS+= NATIVE_OS_VERSION=${NATIVE_OS_VERSION:Q} +MAKEFLAGS+= OS_VERSION=${OS_VERSION:Q} # defined in crossvars .endif # @@ -117,6 +119,7 @@ _NATIVE_OPSYS_VERSION_CMD= ${UNAME} -r | \ awk -F. '{major=int($$1); minor=int($$2); if (minor>=100) minor=99; patch=int($$3); if (patch>=100) patch=99; printf "%02d%02d%02d", major, minor, patch}' NATIVE_OPSYS_VERSION= ${_NATIVE_OPSYS_VERSION_CMD:sh} MAKEFLAGS+= NATIVE_OPSYS_VERSION=${NATIVE_OPSYS_VERSION:Q} +MAKEFLAGS+= OPSYS_VERSION=${OPSYS_VERSION:Q} # defined in crossvars .endif # Preload these for architectures not in all variations of bsd.own.mk, @@ -343,6 +346,7 @@ NATIVE_LOWER_OPSYS:= ${NATIVE_OPSYS:tl} NATIVE_OS_VERSION:= ${NATIVE_OS_VERSION} MAKEFLAGS+= NATIVE_LOWER_OPSYS=${NATIVE_LOWER_OPSYS:Q} +MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS:Q} # defined in crossvars NATIVE_LOWER_VENDOR?= # empty ("arch--opsys")