RFC: adding > and >= to /usr/bin/make conditionals ?
rizzo at iet.unipi.it
Tue Jan 6 04:25:04 PST 2009
[not sure what is the proper forum for discussing this...]
I recently realised (and documented in the manpage) that /usr/bin/make
only implements == and != when comparing strings in coditionals,
yet it would be totally trivial to add support for > >= < <= as
well, because the underlying code already uses strcmp(), and
according to Harti (message attached below) there are no restrictions
from the standards point of view.
There is some value in having this feature, e.g. when comparing
package names to find out which one is more recent, etc.;
on the other hand, if we add (and start using) this feature,
our Makefiles might become harder to reuse on other platforms
(e.g. other BSDs, OSX ports) which use the same 'make' program.
So, I am polling to see if there is any consensus for or against
adding this feature to /usr/bin/make
[excerpt from Harti's message explaining the relation with standards]
On Mon, Jan 05, 2009 at 05:40:33PM +0100, Hartmut.Brandt at dlr.de wrote:
> >From the Posix standpoint of view, we can do what we want as long as we
> are not syntax compatible with posix-make :-) This is the reason, why
> most of our make extensions are compatible with posix. As soon as you
> have a construct that is a syntax error according to the Posix
> specification you invoke implementation-defined behaviour and as such
> you just have to document it. There are several of these escape
> mechanisms in the standard: the .POSIX pseudo-target and all targets
> that start with a dot and consist of uppercase letters.
> With regard to conditionals: there is no standard. Posix decided to
> standard only minimal make, which is roughly compatible to V7 make. If
> you change things like conditional semantics you should: (1) document
> it, and (2) arrange a full ports build with the portcluster people. This
> takes some days, but is a good thing to do.
More information about the freebsd-arch