Date: Thu, 27 Jul 2006 23:34:18 +0200 (CEST) From: Gabor Kovesdan <gabor@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Alexander Leidinger <netchild@FreeBSD.org> Subject: ports/100939: [patch] bsd.port.mk - add basic infrastructure support for debugging Message-ID: <20060727213418.4EFCC289D76@catv-50635cb6.catv.broadband.hu> Resent-Message-ID: <200607272140.k6RLeLvP081950@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060727213418.4EFCC289D76>