a portlint dilemma
Adam Weinberger
adamw at magnesium.net
Wed Jul 27 05:17:53 GMT 2005
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 <bsd.port.pre.mk>
>
> .if ${ARCH} == "i386"
> MEOW_on_off= on
> .else
> MEOW_on_off= off
> .endif
>
> .include <bsd.port.post.mk>
>
> 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 at magnesium.net || adamw at FreeBSD.org
adamw at vectors.cx || adamw at gnome.org
http://www.vectors.cx
More information about the freebsd-ports
mailing list