Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Apr 2005 09:13:15 +0200 (CEST)
From:      Harti Brandt <hartmut.brandt@dlr.de>
To:        Greg 'groggy' Lehey <grog@FreeBSD.org>
Cc:        Kris Kennaway <kris@obsecurity.org>
Subject:    Re: cvs commit: src/usr.bin/make cond.c cond.h for.c for.h parse.c parse.h
Message-ID:  <20050412090431.B75274@beagle.kn.op.dlr.de>
In-Reply-To: <20050411230613.GL84649@wantadilla.lemis.com>
References:  <200504110720.j3B7KAIx034955@repoman.freebsd.org> <20050411101216.N97775@beagle.kn.op.dlr.de> <20050411230613.GL84649@wantadilla.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 12 Apr 2005, Greg 'groggy' Lehey wrote:

GgL>On Monday, 11 April 2005 at  2:11:26 -0700, Kris Kennaway wrote:
GgL>> On Mon, Apr 11, 2005 at 11:07:28AM +0200, Harti Brandt wrote:
GgL>>
GgL>>> KK>I assume you've tested that this doesn't cause problems for anything
GgL>>> KK>in the ports collection?
GgL>>>
GgL>>> I didn't test all of the ports collection - just a number of ports. But I
GgL>>> grepped the ports infrastructure and the ports Makefile* for problematic
GgL>>> constructs and found one problem that now shows up (under certain
GgL>>> conditions) instead of beeing hidden:
GgL>>>
GgL>>> mail/dspam
GgL>>> mail/dspam-devel
GgL>>>
GgL>>> both of them use
GgL>>>
GgL>>> . elseif ...
GgL>>>
GgL>>> This has been intepreted by make as a plain .else without any warning up
GgL>>> to now. Now it is just ignored when the .if defined (WITH_MYSQL40) ... is
GgL>>> false and give an error if it is true. I'll inform the maintainer about
GgL>>> this.
GgL>>>
GgL>>> There may be of course ports that use our make to build. In any case the
GgL>>> change to the .else and .endif clauses just give a warning so the ports
GgL>>> maintainer have time to fix this. What could break is the use of
GgL>>> .undefFOO but I don't expect many of them.
GgL>>
GgL>> I really hope this doesn't cause problems, but based on historical
GgL>> precedent I expect that it will.  In future, please coordinate
GgL>> troublesome make changes with us (portmgr) so we can test them first
GgL>> and avoid destabilizing the ports collection for the users.
GgL>
GgL>It would be interesting to understand the necessity of this change.
GgL>We have so many different flavours of make already.

This make Makefiles more debuggable. For an example see the dspam 
Makefile. It has a .elseif that silently is interpreted as .else. Now it 
gives a notice at least in some cases. 

This has nothing to do with different flavours of make. It is just a 
matter of writing

.undef FOO

instead of

.undefFOO

(which, I suppose, no one would have done on purpose anyway). Or

.if defined(FOO)
.else # defined(FOO)
.endif # defined(FOO)

instead of

.if defined(FOO)
.else defined(FOO)
.endif defined(FOO)

For the reader of the makefile

.else defined(FOO)

suggests that the expression is somehow used. In fact it isn't. If one 
reads:

.else # defined(FOO)

it is obvious that the expression is just a comment.

harti



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050412090431.B75274>