ports/100939: [patch] bsd.port.mk - add basic infrastructure support for debugging
Gabor Kovesdan
gabor at FreeBSD.org
Thu Jul 27 21:40:38 UTC 2006
>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 at 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:
More information about the freebsd-ports-bugs
mailing list