From owner-freebsd-ports@FreeBSD.ORG Fri Nov 15 13:45:47 2013 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FFA17CA for ; Fri, 15 Nov 2013 13:45:47 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D6C2929E0 for ; Fri, 15 Nov 2013 13:45:46 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA28149 for ; Fri, 15 Nov 2013 15:45:38 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1VhJiM-0002by-23 for freebsd-ports@FreeBSD.org; Fri, 15 Nov 2013 15:45:38 +0200 Message-ID: <52862548.2040801@FreeBSD.org> Date: Fri, 15 Nov 2013 15:44:40 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: freebsd-ports@FreeBSD.org Subject: WITH_DEBUG messing CFLAGS X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Nov 2013 13:45:47 -0000 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 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