From 154733e844810249d16bf19e09fee16f5cb8bca0 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 5 Dec 2017 21:30:22 +0000 Subject: [PATCH] Deal with bmake-20170301 no longer resolving -C like it used to. Several checks assume .CURDIR is resolved, such as for determining RELDIR from SRCTOP/.CURDIR. If -C is used then the path is no longer resolved like it was before which is problematic for symlinked source trees. A similar change was also made to ports post bmake-20170301. This fixes 'make -C buildworld' using the wrong OBJDIR. Reported by: rstone Sponsored by: Dell EMC --- share/mk/src.sys.env.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/mk/src.sys.env.mk b/share/mk/src.sys.env.mk index 5888f6a07bff..2db8114e09e6 100644 --- a/share/mk/src.sys.env.mk +++ b/share/mk/src.sys.env.mk @@ -2,6 +2,14 @@ # early setup only see also src.sys.mk +# bmake-20170301 started taking '-C' "as is" for some cases, notably absolute +# paths. Some later comparisons will assume .CURDIR is resolved and matches +# what we would get with 'cd'. So just force resolve it now if it is an +# absolute path. +.if ${MAKE_VERSION} >= 20170301 && !empty(.CURDIR:M/*) +.CURDIR:= ${.CURDIR:tA} +.endif + # make sure this is defined in a consistent manner SRCTOP:= ${.PARSEDIR:tA:H:H}