From owner-freebsd-arch@FreeBSD.ORG Tue Jan 6 12:25:03 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCCE5106564A for ; Tue, 6 Jan 2009 12:25:03 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 8F7738FC0C for ; Tue, 6 Jan 2009 12:25:03 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id C99677309E; Tue, 6 Jan 2009 13:10:29 +0100 (CET) Date: Tue, 6 Jan 2009 13:10:29 +0100 From: Luigi Rizzo To: arch@freebsd.org Message-ID: <20090106121029.GA83861@onelab2.iet.unipi.it> References: <200812262231.mBQMVjHC052150@svn.freebsd.org> <867i59lvbj.fsf@ds4.des.no> <20090105142929.GA70683@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: des@des.no, Hartmut.Brandt@dlr.de Subject: RFC: adding > and >= to /usr/bin/make conditionals ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jan 2009 12:25:04 -0000 [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 cheers luigi [excerpt from Harti's message explaining the relation with standards] On Mon, Jan 05, 2009 at 05:40:33PM +0100, Hartmut.Brandt@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. > > harti