Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 May 2013 22:39:22 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        "Simon J. Gerraty" <sjg@juniper.net>, "freebsd-toolchain@freebsd.org" <freebsd-toolchain@freebsd.org>, Brooks Davis <brooks@freebsd.org>, "freebsd-arch@FreeBSD.org Arch" <freebsd-arch@freebsd.org>
Subject:   Re: [RFC] adding a variable to .mk and Makefile.inc1 to point to top of the FreeBSD source tree
Message-ID:  <6700AD11-D97D-42D0-9355-0D928CF0E103@gmail.com>
In-Reply-To: <DF7CE54D-871D-4071-B977-898305568291@bsdimp.com>
References:  <CAGH67wS21otQr1fBqQ2z=XQjUV30QUjdtyAkzC_Tf1Ts%2BPq%2B8g@mail.gmail.com> <20130507203906.GB40460@lor.one-eyed-alien.net> <2E2C2F74-A25B-4B9F-84C4-0A434B8C7EE6@gmail.com> <AA6A95AC-7553-4ACD-83BC-7374ACF360D1@bsdimp.com> <CAGH67wTE_FoPsvFN5KuwpC80CW2t9hL_P6mKLDk4oR6G5dTzXw@mail.gmail.com> <CAGH67wSnH-gMSETqDS37VmMcJr130NaCiRfv4e7tNDdBzu5F8Q@mail.gmail.com> <DF7CE54D-871D-4071-B977-898305568291@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On May 7, 2013, at 10:09 PM, Warner Losh <imp@bsdimp.com> wrote:

>=20
> On May 7, 2013, at 9:42 PM, Garrett Cooper wrote:
>=20
>> On Tue, May 7, 2013 at 2:26 PM, Garrett Cooper <yanegomi@gmail.com> wrote=
:
>>=20
>> On Tue, May 7, 2013 at 2:00 PM, Warner Losh <imp@bsdimp.com> wrote:
>>=20
>> On May 7, 2013, at 2:46 PM, Garrett Cooper wrote:
>>=20
>>> On May 7, 2013, at 1:39 PM, Brooks Davis wrote:
>>>=20
>>>> On Tue, May 07, 2013 at 01:05:07PM -0700, Garrett Cooper wrote:
>>>>> Hi,
>>>>>  A common pattern that I've seen at Isilon and something else that I'v=
e
>>>>> wanted to have for a while is the ability to designate where the top o=
f a
>>>>> source tree was. This is important and helpful when dealing with sourc=
e
>>>>> files that build upon each other or depend on sources located in other=

>>>>> sections of the tree; contrib stuff needs to set .PATH appropriately t=
o
>>>>> point to sources at the top of the tree, sys stuff is riddled with S=3D=
 in
>>>>> order to point to where /sys, etc lives, we build upon FreeBSD within a=
n
>>>>> expected directory structure as well.
>>>>>  I haven't come up with a name, but was wondering if this was a good
>>>>> idea, and if so does anyone have any outstanding patches for this that=
 can
>>>>> be pushed into FreeBSD?
>>>>=20
>>>> I'd like to see this.  There's a variable for this in NetBSD and I've
>>>> wanted to do this because it makes code easier to relocate within the
>>>> tree.
>>>=20
>>>      This is another good reason. It would make porting code to/from Net=
BSD a LOT easier=81c especially because I plan on pulling a lot of test/test=
 infrastructure code from NetBSD and I really don't want to commit too many l=
ocal changes to the Makefiles. Less divergence -> better cross-pollination -=
> less work for all -> win for the BSDs.
>>>      Thanks for the reminder.. I'll base it off what NetBSD did :).
>>=20
>> SRCDIR
>>=20
>> EVARINUSE?
>>=20
>> share/mk/bsd.doc.mk:# SRCDIR    Directory where source files live.  [${.C=
URDIR}]
>> share/mk/bsd.doc.mk:TRFLAGS+=3D   -I${SRCDIR}
>> share/mk/bsd.doc.mk:.PATH: ${.CURDIR} ${SRCDIR}
>> share/mk/bsd.doc.mk:    cd ${SRCDIR}; \
>> share/mk/bsd.doc.mk:SRCDIR?=3D    ${.CURDIR}
>> share/mk/bsd.doc.mk:    cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \=

>> share/mk/bsd.doc.mk:    cd ${SRCDIR}; ${UNROFF} -ms ${UNROFFFLAGS} \
>> share/mk/bsd.info.mk:SRCDIR?=3D   ${.CURDIR}
>> ...
>> share/doc/llvm/Makefile:SRCDIR=3D         ${.CURDIR}/../../../contrib/llv=
m
>> share/doc/llvm/Makefile:.PATH: ${SRCDIR} ${SRCDIR}/lib/Support
>> share/doc/llvm/clang/Makefile:SRCDIR=3D           ${.CURDIR}/../../../../=
contrib/llvm/tools/clang
>> share/doc/llvm/clang/Makefile:.PATH: ${SRCDIR}
>>=20
>> Once upon a time, this *HAD* to be set, and wasn't inferred from the curr=
ent top of the tree. Please, for the love of god, make sure that we don't lo=
se the infer from top of tree ability, or I will hurt you. Often. Through al=
l the minions that owe me minor favors.
>>=20
>> I don't want to break that ever; it's a fantastic feature. If you could p=
oint me to where that magic awesomeness lives (make?), I'll be more than hap=
py to address it in my branch where I'm going to do this.
>>=20
>> I really don't like how NetBSD turned their top-level build command into a=
 shell script [in part because it needs to bootstrap a bunch of tools]. It m=
akes things painful when doing iterative builds..
>>=20
>> So all in all, I completely and wholeheartedly agree with your concerns.
>>=20
>> Oh sweet.. this is something to keep in mind too (from bsd.port.mk)...
>>=20
>> # SRC_BASE      - The root of the src tree.  (Some ports require this to g=
et
>> #                 kernel sources).  Default: /usr/src
>>=20
>> All else fails, ports has done it first -_-...
>>=20
>> Not the first var I've seen this done with...
>=20
> I thought ports specifically named things differently to avoid conflicts.

Perhaps. It matches autoconf too. It's just a pain when there isn't consiste=
ncy, but oh well...
Thanks!
-Garrett=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6700AD11-D97D-42D0-9355-0D928CF0E103>