From owner-freebsd-ports@FreeBSD.ORG Wed Jul 27 05:17:53 2005 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53AD716A41F for ; Wed, 27 Jul 2005 05:17:53 +0000 (GMT) (envelope-from adamw@magnesium.net) Received: from connectmail.carleton.ca (connectmail.carleton.ca [134.117.2.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 025AF43D45 for ; Wed, 27 Jul 2005 05:17:52 +0000 (GMT) (envelope-from adamw@magnesium.net) Received: from [192.168.1.102] (adsl-67-123-68-209.dsl.snfc21.pacbell.net [67.123.68.209]) by connectmail.carleton.ca (iPlanet Messaging Server 5.2 HotFix 2.04 (built Feb 8 2005)) with ESMTPSA id <0IK9002H1TDSHI@connectmail.carleton.ca> for ports@freebsd.org; Wed, 27 Jul 2005 01:17:53 -0400 (EDT) Date: Tue, 26 Jul 2005 22:17:50 -0700 From: Adam Weinberger In-reply-to: <200507262327.24793.mi+mx@aldan.algebra.com> To: Mikhail Teterin Message-id: <42E718FE.4070506@magnesium.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Mozilla Thunderbird 1.0+ (Macintosh/20050712) References: <200507262156.43233.mi+mx@aldan.algebra.com> <20050727024231.GA18447@soaustin.net> <200507262327.24793.mi+mx@aldan.algebra.com> Cc: ports@freebsd.org, Mark Linimon Subject: Re: a portlint dilemma X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2005 05:17:53 -0000 Mikhail Teterin wrote: >> There are some chicken-and-egg problems like this in bsd.port.mk (well, >> the part that is invoked by bsd.port.pre.mk). At one time I understood >> which each of them was but I haven't looked at them in a long time. > > Actually, I think, I found the way. Look at the new GraphicsMagick port. > > portlint would've raised hell about this trick (if it new about variable > modifiers), but that would be groundless. ARCH is not expanded until OPTIONS > is used (by which time ARCH is already known), so things work just fine. > > A more straightforward way would be to: > > OPTIONS= MEOW "MEOW?" ${MEOW_on_off} > > .include > > .if ${ARCH} == "i386" > MEOW_on_off= on > .else > MEOW_on_off= off > .endif > > .include > > This is also fooling portlint -- OPTIONS are, in fact, modified after > including the ...pre.mk. And there is nothing wrong with that :-) > > -mi That is indeed a very good - albeit sneaky - trick! The main problem that I find with the OPTIONS chicken-and-egg problem is that you can't modify OPTIONS based on the presence of files because, when OPTIONS processing takes place, LOCALBASE and X11BASE aren't defined. Do you have a good sneaky trick for that case? # Adam -- Adam Weinberger adamw@magnesium.net || adamw@FreeBSD.org adamw@vectors.cx || adamw@gnome.org http://www.vectors.cx