setting X11BASE

perryh at pluto.rain.com perryh at pluto.rain.com
Sun Feb 24 08:11:02 UTC 2008


> > > > 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?


More information about the freebsd-questions mailing list