From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Jul 27 21:40:38 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97EDB16A642 for ; Thu, 27 Jul 2006 21:40:38 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D3ED43D5F for ; Thu, 27 Jul 2006 21:40:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k6RLeLfJ081952 for ; Thu, 27 Jul 2006 21:40:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k6RLeLvP081950; Thu, 27 Jul 2006 21:40:21 GMT (envelope-from gnats) Resent-Date: Thu, 27 Jul 2006 21:40:21 GMT Resent-Message-Id: <200607272140.k6RLeLvP081950@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Gabor Kovesdan Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 09BAB16A4DE; Thu, 27 Jul 2006 21:34:20 +0000 (UTC) (envelope-from gabor@catv-50635cb6.catv.broadband.hu) Received: from catv-50635cb6.catv.broadband.hu (catv-50635cb6.catv.broadband.hu [80.99.92.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 97FB643D46; Thu, 27 Jul 2006 21:34:19 +0000 (GMT) (envelope-from gabor@catv-50635cb6.catv.broadband.hu) Received: by catv-50635cb6.catv.broadband.hu (Postfix, from userid 1001) id 4EFCC289D76; Thu, 27 Jul 2006 23:34:18 +0200 (CEST) Message-Id: <20060727213418.4EFCC289D76@catv-50635cb6.catv.broadband.hu> Date: Thu, 27 Jul 2006 23:34:18 +0200 (CEST) From: Gabor Kovesdan To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Alexander Leidinger Subject: ports/100939: [patch] bsd.port.mk - add basic infrastructure support for debugging X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gabor Kovesdan List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jul 2006 21:40:38 -0000 >Number: 100939 >Category: ports >Synopsis: [patch] bsd.port.mk - add basic infrastructure support for debugging >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jul 27 21:40:21 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Gabor Kovesdan >Release: FreeBSD 6.1-STABLE i386 >Organization: n/a >Environment: System: FreeBSD spitfire 6.1-STABLE FreeBSD 6.1-STABLE #0: Sun Jul 2 19:31:12 CEST 2006 gabor@spitfire:/usr/src/sys/i386/compile/SPITFIRE i386 >Description: This patch adds a basic infrastructure support for building binaries for debugging purposes. A new knob, WITH_DEBUG is introduced. If set DEBUG_FLAGS (-g at default) are added to CFLAGS and binaries doesn't get stripped by INSTALL_PROGRAM. Besides, each port could/should add its specific things for WITH_DEBUG. DEBUG_FLAGS can be overridden, of course. Suggested by: netchild Reviewed by: netchild >How-To-Repeat: >Fix: --- with_debug.diff begins here --- --- bsd.port.mk.orig Wed Jul 26 17:10:58 2006 +++ bsd.port.mk Wed Jul 26 17:52:54 2006 @@ -289,6 +289,14 @@ # usage inside the ports framework, and the latter are reserved for user- # settable options. (Setting USE_* in /etc/make.conf is always wrong). # +# WITH_DEBUG - If set, debugging flags are added to CFLAGS and the +# binaries don't get stripped by INSTALL_PROGRAM. +# Besides, individual ports might add their specific +# to produce binaries for debugging purposes. +# You can override the debug flags that are passed to +# the compiler by setting DEBUG_FLAGS. It is set to +# "-g" at default. +# # USE_BZIP2 - If set, this port tarballs use bzip2, not gzip, for # compression. # USE_ZIP - If set, this port distfile uses zip, not tar w/[bg]zip @@ -1509,6 +1517,12 @@ CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//} .endif .endif +.endif + +.if defined(WITH_DEBUG) && ${WITH_DEBUG} != "no" +.undef STRIP +DEBUG_FLAGS?= -g +CFLAGS+= ${DEBUG_FLAGS} .endif .if defined(NOPORTDOCS) --- with_debug.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: