git: f383cfc03bbf - stable/14 - sys.mk: Improve ports compatibility hack guard

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Thu, 01 May 2025 20:15:12 UTC
The branch stable/14 has been updated by brooks:

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

commit f383cfc03bbf89516135d67dcd6018a6be1b9533
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2025-03-04 20:50:32 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2025-05-01 20:14:24 +0000

    sys.mk: Improve ports compatibility hack guard
    
    Back in 9ca543438039 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)
---
 share/mk/sys.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index 8cdaae4a3de2..b668e4b3a75e 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -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