a portlint dilemma

Mikhail Teterin mi+mx at aldan.algebra.com
Wed Jul 27 03:27:44 GMT 2005


> 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


More information about the freebsd-ports mailing list