Subject: Re: how can we create PATCHFILES that are not DISTFILES?
To: Andrew Brown <>
From: Frederick Bruckman <>
List: tech-pkg
Date: 04/19/2002 11:34:32
On Fri, 19 Apr 2002, Andrew Brown wrote:

> >I've been trying to update a pkgsrc module and I've run into a situation
> >where the best way to enable an option seems to be to optionally patch
> >the source before building, using a specific patch selected from a set
> >of multiple optional patches (included in say ${FILESDIR}), based on
> >some setting in mk/ and/or /etc/mk.conf.
> make your patch contain all features, and then enable each feature
> based on the presence of some preprocessor token.  ie, if you have a
> patch that does something for alpha machines, your patch would contain
> code surrounded by #ifdef alpha/#endif.

If that's not flexible enough, just invent tokens and switch them on
conditionally in the top level "Makefile", after ".include
../../mk/". Look at the output of `make -V
have available, also popular: OBJECT_FMT and USE_INET6.

This has the advantage, for the author, that it won't trigger unwanted
behavior in some other "alpha:. In fact, it clearly has no effect
unless deliberately switched on.