Mark Millard <mark...@yahoo.com> wrote: > > Of course trying to get too clever can end up being counter productive, > > but the tools are there... > > I still have the addition that we found was needed > in my experiments years ago (white space details > below may not have been preserved):
IIRC there are a few problem locations in the build where this or similar caused problems. I think this relates to some hierarchies being built with custom env - which makes it hard for src.sys.obj.mk to always get things right. I think the change below or close to it has been committed and reverted in the past. > > # git -C /usr/main-src/ diff share/ > diff --git a/share/mk/src.sys.obj.mk b/share/mk/src.sys.obj.mk > index 708559edcdb8..e710ae057fc6 100644 > --- a/share/mk/src.sys.obj.mk > +++ b/share/mk/src.sys.obj.mk > @@ -66,6 +66,9 @@ SB_OBJROOT?= ${SB}/obj/ > OBJROOT?= ${SB_OBJROOT} > .endif > OBJROOT?= ${_default_makeobjdirprefix}${SRCTOP}/ > +# save the value before we mess with it > +_OBJROOT:= ${OBJROOT:tA} > +.export _OBJROOT > .if ${OBJROOT:M*/} != "" > OBJROOT:= ${OBJROOT:H:tA}/ > .else > > where I had to use _OBJROOT to have 2 appropriate paths > built. (See later below.) > > It is still not part of the official share/mk/src.sys.obj.mk > so I normally avoid referencing it or what would involve > its use. But I've not checked if it has been added via some > other place providing the definition. > > Used via: > > # grep -r "\<_OBJROOT\>" ~/src.configs/ > /root/src.configs/make.conf:# _OBJROOT is an addition to > share/mk/src.sys.obj.mk > /root/src.configs/make.conf:# +_OBJROOT:= ${OBJROOT:tA} > /root/src.configs/make.conf:# +.export _OBJROOT > /root/src.configs/make.conf:IGNORELEGACY_NOSYMLINKPREFIX= > ${_OBJROOT}/${TARGET}.${TARGET_ARCH}/tmp/legacy/usr > /root/src.configs/make.conf:IGNOREOTHER_NOSYMLINKPREFIX= > ${_OBJROOT}/${TARGET}.${TARGET_ARCH}/tmp/usr/bin > > It was associated with symbolic links begin involved. Your use of _OBJROOT looks similar to how we (Juniper) use SB_OBJROOT. We run make via a wrapper which defines SB (location of the tree) and a number of SB_* variables which can be assumed correct. It also obviates the need for make.conf Of course our build is never used to "install" anything - we just build packages which are then installed, so it is much simpler.