From owner-freebsd-gnome Tue Jan 22 0:12:31 2002 Delivered-To: freebsd-gnome@freebsd.org Received: from alcatraz.iptelecom.net.ua (alcatraz.iptelecom.net.ua [212.9.224.15]) by hub.freebsd.org (Postfix) with ESMTP id D363137B416 for ; Tue, 22 Jan 2002 00:12:21 -0800 (PST) Received: from ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by alcatraz.iptelecom.net.ua (8.9.3/8.9.3) with ESMTP id KAA92727; Tue, 22 Jan 2002 10:12:03 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: from vega.vega.com (h105.229.dialup.iptcom.net [212.9.229.105]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id KAA78060; Tue, 22 Jan 2002 10:11:58 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.11.6/8.11.3) with ESMTP id g0M8AQI18530; Tue, 22 Jan 2002 10:10:26 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Message-ID: <3C4D1EAC.C2D63C98@FreeBSD.org> Date: Tue, 22 Jan 2002 10:11:24 +0200 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Glenn Johnson Cc: Joe Clarke , freebsd-gnome@FreeBSD.org Subject: Re: dependency question References: <1011565282.28534.22.camel@shumai.marcuscom.com> <20020120234902.GA74865@gforce.johnson.home> <1011573437.28534.24.camel@shumai.marcuscom.com> <20020121011015.GA20453@gforce.johnson.home> <1011575865.28534.39.camel@shumai.marcuscom.com> <20020121031843.GA23586@gforce.johnson.home> <3C4BE9F6.A85C98B5@FreeBSD.org> <20020122013838.GA20427@gforce.johnson.home> <1011667138.85870.20.camel@shumai.marcuscom.com> <20020122043726.GA81434@gforce.johnson.home> <20020122050508.GA84339@gforce.johnson.home> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-gnome@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Glenn Johnson wrote: > On Mon, Jan 21, 2002 at 10:37:26PM -0600, Glenn Johnson wrote: > > > OK, something like the following in the port Makefile would do what I > > want: > > > > .if exists(/usr/local/bin/aspell) > > RUN_DEPENDS+= aspell:${PORTSDIR}/textproc/aspell > > .elif exists(/usr/local/bin/ispell) > > RUN_DEPENDS+= ispell:${PORTSDIR}/textproc/ispell > > .else > > BUILD_DEPENDS= ispell:${PORTSDIR}/textproc/ispell > > RUN_DEPENDS+= ispell:${PORTSDIR}/textproc/ispell > > .endif > > > > What I can not figure out though is how to use $LOCALBASE instead of > > '/usr/local' in the above. > > I just figured out the answer. I have to use > > .include > > before the above and > > .include > > at the end of the Makefile. > > What magic is happening there? That's because make(1) evaluates variables in conditionals (exists(...), defined(...) etc.) instantly, while in other cases it deffers their evaluation until the variable is actually used in target. If you want to know more please read documentation on make, particularly manpage and one in /usr/share/doc/psd/12.make directory. -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-gnome" in the body of the message