sys.mk: Improve ports compatibility hack guard

Back in 9ca5434380 and include of bsd.cpu.mk in sys.mk was added as a
hack for ports Makefiles.  This works fine in general (for values of
fine that include not being able to use MK_ variables in bsd.cpu.mk),
but has surprising effects on MacOS with a case insensitive filesystems.
There we build things in paths like share/docs/IPv6 where
../../Mk/bsd.port.mk matches share/mk/bsd.port.mk.

Fix this issue by checking for ../../Mk/Uses which seems highly unlikely
to match something in share/mk.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D49232

(cherry picked from commit e62ff34a6761025203b77ffb241c926ac8d218c8)
This commit is contained in:
Brooks Davis 2025-03-04 20:50:32 +00:00
parent 7655a4141e
commit f383cfc03b

View file

@ -326,7 +326,7 @@ __MAKE_SHELL?=/bin/sh
# the ports files are modernized, and a reasonable transition
# period has passed, include it while we're in a ports tree here
# to preserve historic behavior.
.if exists(${.CURDIR}/../../Mk/bsd.port.mk)
.if exists(${.CURDIR}/../../Mk/Uses)
.include <bsd.cpu.mk>
.endif