From owner-freebsd-arch@FreeBSD.ORG Wed May 8 03:42:39 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0729E6C; Wed, 8 May 2013 03:42:39 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx1.freebsd.org (Postfix) with ESMTP id 3C4451D7; Wed, 8 May 2013 03:42:38 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id kw10so1257739vcb.23 for ; Tue, 07 May 2013 20:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=hiepuPno0za4+Yvm3t1p81TvkM5cnBxVi8LVK8ni0SU=; b=pxF4lvSjNSyFGjaeE05WLwfsqkM+e0SxWl45BwJrayQ8xOhErdXeNoJfLibc/XjnUE bwRCeBjmaXEm0noV32awG/dgX84q5oJot41tsk3pR8Bsjk/2s9kHYDeXbQmOa6Tg6NbB iUGHFIij64t4Gmea5H9UEtdhd3/do6T4lMF7aua7DKzez6HevYRKtleN6NuciiCRCkTd qxiohcfIdTpD6pvZ8lo10beL4H2/XGH5gfdJi3i7iUGdQtP/09k7DLoVoXUq5vnd0ZZX Qo+EEuwQpbhYILhH4CHHgNItjQ0V87+4C23KWMOEBqIx2RCRg0+pmRytZKufk9UDrWtS ykwA== MIME-Version: 1.0 X-Received: by 10.52.68.205 with SMTP id y13mr2710454vdt.33.1367984558233; Tue, 07 May 2013 20:42:38 -0700 (PDT) Received: by 10.52.31.194 with HTTP; Tue, 7 May 2013 20:42:38 -0700 (PDT) In-Reply-To: References: <20130507203906.GB40460@lor.one-eyed-alien.net> <2E2C2F74-A25B-4B9F-84C4-0A434B8C7EE6@gmail.com> Date: Tue, 7 May 2013 20:42:38 -0700 Message-ID: Subject: Re: [RFC] adding a variable to .mk and Makefile.inc1 to point to top of the FreeBSD source tree From: Garrett Cooper To: Warner Losh Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "Simon J. Gerraty" , freebsd-toolchain@freebsd.org, Brooks Davis , "freebsd-arch@FreeBSD.org Arch" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 03:42:39 -0000 On Tue, May 7, 2013 at 2:26 PM, Garrett Cooper wrote: > > On Tue, May 7, 2013 at 2:00 PM, Warner Losh wrote: > >> >> On May 7, 2013, at 2:46 PM, Garrett Cooper wrote: >> >> > On May 7, 2013, at 1:39 PM, Brooks Davis wrote: >> > >> >> 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've >> >>> wanted to have for a while is the ability to designate where the top >> of a >> >>> source tree was. This is important and helpful when dealing with >> source >> >>> files that build upon each other or depend on sources located in oth= er >> >>> sections of the tree; contrib stuff needs to set .PATH appropriately >> to >> >>> 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 withi= n >> an >> >>> expected directory structure as well. >> >>> I haven't come up with a name, but was wondering if this was a goo= d >> >>> idea, and if so does anyone have any outstanding patches for this >> that can >> >>> be pushed into FreeBSD? >> >> >> >> 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. >> > >> > This is another good reason. It would make porting code to/from >> NetBSD a LOT easier=85 especially because I plan on pulling a lot of >> test/test infrastructure code from NetBSD and I really don't want to com= mit >> too many local 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 :). >> >> SRCDIR >> > > EVARINUSE? > > share/mk/bsd.doc.mk:# SRCDIR Directory where source files live. > [${.CURDIR}] > 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} > > >> Once upon a time, this *HAD* to be set, and wasn't inferred from the >> current top of the tree. Please, for the love of god, make sure that we >> don't lose the infer from top of tree ability, or I will hurt you. Often= . >> Through all the minions that owe me minor favors. >> > > I don't want to break that ever; it's a fantastic feature. If you could > point me to where that magic awesomeness lives (make?), I'll be more than > happy to address it in my branch where I'm going to do this. > > 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 > makes things painful when doing iterative builds.. > > So all in all, I completely and wholeheartedly agree with your concerns. > Oh sweet.. this is something to keep in mind too (from bsd.port.mk)... # SRC_BASE - The root of the src tree. (Some ports require this to ge= t # kernel sources). Default: /usr/src All else fails, ports has done it first -_-... Not the first var I've seen this done with... Thanks, -Garrett