If sys.mk were found via the magic path .../share/mk

replace it with the absolute path of .PARSEDIR, so that sub-makes
launched from objdirs (eg kernel) can still find the correct mk files.

Reviewed by:	obrien
This commit is contained in:
Simon J. Gerraty 2015-02-24 19:03:31 +00:00
parent 1605bac6fb
commit 2ad4692912

View File

@ -11,3 +11,13 @@ SRCCONF?= /etc/src.conf
.include "${SRCCONF}"
_srcconf_included_: .NOTMAIN
.endif
# If we were found via .../share/mk we need to replace that in
# with ${.PARSEDIR:tA} so that we can be found by
# sub-makes launched from objdir.
.if ${.MAKEFLAGS:M.../share/mk} != ""
.MAKEFLAGS:= ${.MAKEFLAGS:S,.../share/mk,${.PARSEDIR:tA},}
.endif
.if ${MAKESYSPATH:Uno:M*.../*} != ""
MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},}
.export MAKESYSPATH
.endif