From owner-freebsd-arch@FreeBSD.ORG Tue May 7 21:26:17 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5B751EAE; Tue, 7 May 2013 21:26:17 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-bk0-x235.google.com (mail-bk0-x235.google.com [IPv6:2a00:1450:4008:c01::235]) by mx1.freebsd.org (Postfix) with ESMTP id 8E77C26D; Tue, 7 May 2013 21:26:16 +0000 (UTC) Received: by mail-bk0-f53.google.com with SMTP id i18so539727bkv.40 for ; Tue, 07 May 2013 14:26:15 -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=YJriwf6hpu47VfHM4lgfIOvQ0JbuMWLQSk/niRU5zAI=; b=HyTh7rs9OKKd9aYMiZYFsXXM0YH63FQ7RmnveRlRzLowkgkBF1+uFE+cQCx7j6Uqj2 nn5uoCib9t8rRSoRhzLLNd3zwFkYah2RAfWemvIuVC2uWtt2Re0/geK2TbHZiOZkdeNK A9UB1BW/IqlO77hsxuWb/uCe3j9Pp9vyIl4QeHydK9ubD34U/UN2CAhTAHv5nLRsbMkD Yk0ozuCKxKV35Bvw5NMuNEHIoSoDqKxjN/QA8lW9+MKVx+16o6NfaA1tB2dfWboWo4tj s8JA2zwMIJnccfPJwmUQ744ncril3Rzf4NllQf1qLRnHX4YnW0SWHcalz9/v/37hAifi wfaQ== MIME-Version: 1.0 X-Received: by 10.204.226.80 with SMTP id iv16mr1076112bkb.48.1367961975281; Tue, 07 May 2013 14:26:15 -0700 (PDT) Received: by 10.204.225.206 with HTTP; Tue, 7 May 2013 14:26:15 -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 14:26:15 -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: Tue, 07 May 2013 21:26:17 -0000 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 sour= ce > >>> files that build upon each other or depend on sources located in othe= r > >>> 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 within > an > >>> 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 tha= t > 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 comm= it > 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/llvm 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. Thanks! -Garrett