WITH_DEBUG messing CFLAGS

Dimitry Andric dim at FreeBSD.org
Fri Nov 15 18:09:03 UTC 2013


On 15 Nov 2013, at 14:44, Andriy Gapon <avg at freebsd.org> wrote:
> I wonder what is the thinking behind CFLAGS cleansing in the following snippet
> from bsd.port.mk:
> 
> .if defined(WITH_DEBUG) && !defined(WITHOUT_DEBUG)
> STRIP_CMD=  ${TRUE}
> DEBUG_FLAGS?=   -g
> CFLAGS:=        ${CFLAGS:N-O*:N-fno-strict*} ${DEBUG_FLAGS}
> .endif
> 
> If I want to control optimization level for WITH_DEBUG, then I can always pass
> -O0 or -O<whatever> in DEBUG_FLAGS.  But there is no way for me to say leave
> CFLAGS alone.
> 
> Besides, the quoted logic seems to be incomplete with respect to CXXFLAGS.
> I think that the CFLAGS line should be changed simply to:
> 
> CFLAGS+=        ${DEBUG_FLAGS}

I agree, and I even had the above in my bsd.port.mk for at least a year now. :-)

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20131115/4cf3ba07/attachment.sig>


More information about the freebsd-ports mailing list