Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2013 15:44:40 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        freebsd-ports@FreeBSD.org
Subject:   WITH_DEBUG messing CFLAGS
Message-ID:  <52862548.2040801@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

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}

-- 
Andriy Gapon



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