Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Sep 2001 17:46:22 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Warner Losh <imp@harmony.village.org>
Cc:        Jonathan Lemon <jlemon@flugsvamp.com>, Duncan Barclay <dmlb@dmlb.org>, arch@FreeBSD.ORG
Subject:   Re: cvs commit: src/share/mk sys.mk
Message-ID:  <20010903174621.A3146@dhcp01.pn.xcllnt.net>
In-Reply-To: <200109032117.f83LHJh28175@harmony.village.org>
References:  <20010831142958.A60910@sunbay.com> <20010831141746.A1809@zerogravity.kawo2.rwth-aachen.d> <20010831084811.B95710@dragon.nuxi.com> <20010831184945.A16872@fump.kawo2.rwth-aachen.de> <20010831100216.A17397@dragon.nuxi.com> <20010831193947.A17086@fump.kawo2.rwth-aachen.de> <200109030211.f832BCh22404@harmony.village.org> <005401c13461$37b78290$c66020c2@pc598cam> <20010903104141.E554@dhcp01.pn.xcllnt.net> <200109032117.f83LHJh28175@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 03, 2001 at 03:17:19PM -0600, Warner Losh wrote:
> : I don't particularly like this; I would prefer that things are 
> : self contained.  Having the developer specify a searchpath themselves
> : is error prone, especially when dealing with multiple source trees.
> 
> I agree.  I've tried the searchpath solution before, and it has
> exactly the problem that Jonathan describes.

I don't have the experience, so I'm going to assume that it is error
prone, but I don't want to abandon it completely.  Me, stubborn? :-)

Suggestion:

We treat build-options as policy. We provide the mechanics to allow
people to set options (ie implement policy), but we do not hardcode
how. Instead we define a generic "interface". Something like the
following (forget the names, I'm making this up while I type):

The make variable POLICY_FILE, when defined, holds the filename of
a makefile fragment to include. The intend is that the fragment
defines whatever needs to be defined to (partly) implement the policy.

The make variable POLICY_FILE_LOCATE, when defined, holds the name
of a script to run in case POLICY_FILE is undefined. The script
can select the makefile fragment in anyway it wants, based on any
condition it needs.

The POLICY_FILE variable, once set, avoids any expensive work in
locating or determining the include file. It's passed down while
recursing. Users can define it on the commandline or it can be
synthesized automaticly. We basicly don't care what the value is
and how it's been set.

If POLICY_FILE is not defined, but POLICY_FILE_LOCATE is defined,
make(1) will run the script and assigns the output to POLICY_FILE.
Thus, the script is only run once and we basicly don't care what
the script does. It may be an expensive operation, because we only
run it once at build invocation. The script is assumed to be the
same for all source trees, but it's output can differ depending
on whatever it needs to depend.

Everybody can implement build options the way they want it and
thus fits the idea that /usr/share/mk is for everybody to use.
We can provide one or more "sample" implementations for people's
convenience.

Thoughts?

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010903174621.A3146>