From owner-freebsd-questions@FreeBSD.ORG Sun Feb 24 08:11:02 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE71816A47E for ; Sun, 24 Feb 2008 08:11:01 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id C2A4213C457 for ; Sun, 24 Feb 2008 08:11:01 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id m1O8B0oO066664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 24 Feb 2008 00:11:00 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id m1O8B0qP066663 for freebsd-questions@freebsd.org; Sun, 24 Feb 2008 00:11:00 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA00572; Sun, 24 Feb 08 00:01:28 PST Date: Sat, 23 Feb 2008 23:56:29 -0800 From: perryh@pluto.rain.com To: freebsd-questions@freebsd.org Message-Id: <47c1232d.Q8ftV/J2Ibk3aWLi%perryh@pluto.rain.com> References: <47be74b1.pGW9HajDXl3VC5wx%perryh@pluto.rain.com> <47BFD6D1.3020506@bsdforen.de> <47c05ebe.Mgeup+ojPdtp/pFj%perryh@pluto.rain.com> <200802231933.02656.fbsd.questions@rachie.is-a-geek.net> In-Reply-To: <200802231933.02656.fbsd.questions@rachie.is-a-geek.net> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: setting X11BASE X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2008 08:11:02 -0000 > > > > 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?