Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Sep 2004 15:12:42 +0200
From:      Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
To:        John Polstra <jdp@polstra.com>
Cc:        Oliver Eikemeier <eikemeier@fillmore-labs.com>
Subject:   Re: Best way to override user's CFLAGS in a port?
Message-ID:  <m3k6v4rjjp.fsf@merlin.emma.line.org>
In-Reply-To: <XFMail.20040907114725.jdp@polstra.com> (John Polstra's message of "Tue, 07 Sep 2004 11:47:25 -0700 (PDT)")
References:  <XFMail.20040907114725.jdp@polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
John Polstra <jdp@polstra.com> writes:

> I'm afraid if I do that, I'll get even more bug reports.

Likely, because it tells the user what NOT to do,
but does not tell him what to do, and he'll inquire about that.

The BROKEN message should print that the user must use -O1 rather than
-O2 or -O3 for this particular port.

Note that "-O." isn't a sufficient regexp, some users use -O99 which,
when it becomes -O19 or -O9 still hoses the build of the b0rked
application.

How about:

CFLAGS:=    ${CFLAGS:C/-O[s1-9][0-9]*/-O1/g}

This degrades all -O options (including -Os!) to -O1 but leaves -O and
-O0 alone.

> The Porter's Handbook text seems mainly to say that the port should
> append to CFLAGS with "+=" rather than simply clobbering it with "=".
> That makes sense.  But it seems reasonable for the port to remove a
> specific setting (-O[2-9]) from CFLAGS if the porter knows that that
> setting will break the port.  It's not quite the same as clobbering
> CFLAGS totally.

I second that.

> The ezm3 port's Makefile is already a bit strange, because it invokes
> ${GMAKE} itself in a special do-install target.  I can strip off the
> -O[2-9] there.  I was just wondering if there was a more official
> way to do it.

Let's just write the Makefile line given above into the porters-handbook ;-)

-- 
Matthias Andree

Encrypted mail welcome: my GnuPG key ID is 0x052E7D95 (PGP/MIME preferred)



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