Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Feb 2008 23:56:29 -0800
From:      perryh@pluto.rain.com
To:        freebsd-questions@freebsd.org
Subject:   Re: setting X11BASE
Message-ID:  <47c1232d.Q8ftV/J2Ibk3aWLi%perryh@pluto.rain.com>
In-Reply-To: <200802231933.02656.fbsd.questions@rachie.is-a-geek.net>
References:  <47be74b1.pGW9HajDXl3VC5wx%perryh@pluto.rain.com> <47BFD6D1.3020506@bsdforen.de> <47c05ebe.Mgeup%2BojPdtp/pFj%perryh@pluto.rain.com> <200802231933.02656.fbsd.questions@rachie.is-a-geek.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > > I'm finding it especially "interesting" that /etc/make.conf,
> > > > which to judge from its location is part of the base, depends
> > > > on a setting from something in the /usr/ports tree.
> > >
> > > Well, actually it doesn't. What gives you this impression?
> >
> > Paul Schmehl reported where LOCALBASE is set:
> > in /usr/ports/Mk/bsd.port.mk
> >
> > Now I'm being told to add this:
> >
> >     X11BASE=${LOCALBASE}
> >
> > to /etc/make.conf, so that /etc/make.conf needs LOCALBASE to be
> > set in order to set X11BASE correctly.  Is that not a dependency?
>
> You assume make(1)'s variable assignment is done on encounter base
> at runtime.  It isn't:
>
> # echo LOCALBASE=/usr/local >/tmp/foo.mk
>
> # echo 'X11BASE=${LOCALBASE}' >>/etc/make.conf
>
> # make -f /tmp/foo.mk -V X11BASE
> /usr/local
>
> # echo LOCALBASE=/tmp >/tmp/foo.mk
>
> # make -f /tmp/foo.mk -V X11BASE
> /tmp
>
> For your academic interest:
> gzcat /usr/share/doc/psd/12.make/paper.ascii.gz|$PAGER

I know perfectly well how make works.  The point is, if we have

    X11BASE=${LOCALBASE}

in /etc/make.conf, X11BASE is going to be set *correctly* during
any particular execution of make only if LOCALBASE is set somewhere
in the makefiles that are processed during that execution of make.

If we run make under conditions that *don't* involve processing
/usr/ports/Mk/bsd.port.mk -- such as when building something
that isn't a port -- X11BASE is going to be *wrong* (unless a
definition gets provided somewhere else, as in your examples).

IOW adding this line to /etc/make.conf creates a dependency on
/usr/ports/Mk/bsd.port.mk, and that seems undesirable.  Would
it not be better to put it somewhere under /usr/ports/Mk or
/usr/local/etc, rather than polluting the base with a ports-ism?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47c1232d.Q8ftV/J2Ibk3aWLi%perryh>