From owner-freebsd-arch Thu Mar 8 21:18:31 2001 Delivered-To: freebsd-arch@freebsd.org Received: from onet2.cup.hp.com (onet2.cup.hp.com [15.255.208.3]) by hub.freebsd.org (Postfix) with ESMTP id 6F67437B718 for ; Thu, 8 Mar 2001 21:18:23 -0800 (PST) (envelope-from marcel@p1000180.nsr.hp.com) Received: from kayak.muffin.org (p1000180.nsr.hp.com [15.109.0.180]) by onet2.cup.hp.com (Postfix) with ESMTP id 4761518CA0; Thu, 8 Mar 2001 21:18:15 -0800 (PST) Received: from dhcp08.muffin.org (dhcp08.muffin.org [192.168.4.208]) by kayak.muffin.org (8.11.1/8.11.1) with ESMTP id f295IE272000; Thu, 8 Mar 2001 21:18:14 -0800 (PST) (envelope-from marcel@kayak.muffin.org) Received: (from marcel@localhost) by dhcp08.muffin.org (8.11.1/8.11.2) id f295N2Q01120; Thu, 8 Mar 2001 21:23:02 -0800 (PST) (envelope-from marcel) Date: Thu, 8 Mar 2001 21:23:01 -0800 From: Marcel Moolenaar To: Warner Losh Cc: Kris Kennaway , "Rodney W. Grimes" , "Matthew D. Fuller" , arch@FreeBSD.ORG Subject: Re: Breaking up make.conf Message-ID: <20010308212301.A879@dhcp08.muffin.org> Reply-To: marcel@cup.hp.com References: <20010308201422.A94052@mollari.cthul.hu> <200103090241.SAA27525@gndrsh.dnsmgr.net> <200103090349.f293nGs04577@billy-club.village.org> <20010308201422.A94052@mollari.cthul.hu> <200103090430.f294Ucs04824@billy-club.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200103090430.f294Ucs04824@billy-club.village.org>; from imp@village.org on Thu, Mar 08, 2001 at 09:30:38PM -0700 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Mar 08, 2001 at 09:30:38PM -0700, Warner Losh wrote: > I really do want to see a generic mechanism in place. I don't want to > see another set of hacks just for FreeBSD. If we have a generic > mechanism in place, we can document it and other projects can use or > not use it as they see fit. A generic solution for the make.conf problem can be the introduction of a variable I suddenly call MODE. This MODE variable, when set on the commandline triggers the inclusion of bsd.mode.${MODE}. Where to read this file from, can be a combination of system-wide, hardcoded defaults and the use of a variable I suddenly call MODEPATH. This mode file contains defaults for certain variables and thus controls how the software is built, whether this is world or something else is not important. For the ports collection, we can have MODE default to ports. Release builds can have MODE default to release. Kernel and module builds can have MODE default to kernel. To allow a flexible mechanism of overriding modes, so that this scheme can be used in the widest possible scenarios, all mode files found by MODEPATH are read. This works nicely if mode files use the conditional assignment by convention. For example, If I have MODEPATH=~/modes /etc/modes and build my software like make MODE=foo then ~/modes/bsd.mode.foo will be included before /etc/modes/bsd.mode.foo (if it exists) and thus allows per user tweaking of system defaults. In the various Makefile.inc files, we can append to MODEPATH so that we can have /usr/src (assuming that's the root of the FreeBSD tree) part of the MODEPATH. This allows per source tree tweaking of the system default (assuming that system drectories are appended to MODEPATH last). This scheme has the nice property of having a simple way to further enhance parallelism by making MODE part of the name of the object directory. Of course it should be possible to also set MACHINE_ARCH in the mode files as well, so that we can define a cross-build as: make MODE=alpha buildworld instead of make MACHINE_ARCH=alpha buildworld. I suggest we do not traverse source trees down to the root, to search for a make.conf or something equivalent. It's too unstable from an algorithmic point of view and may cause significant build overhead. Just my $0.02... -- Marcel Moolenaar mail: marcel@cup.hp.com / marcel@FreeBSD.org tel: (408) 447-4222 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message