Subject: Option to enable debug support in a pkg
To: None <tech-pkg@NetBSD.org>
From: Martin Husemann <martin@duskware.de>
List: tech-pkg
Date: 11/01/2005 16:08:16
As a user of a less common architecture (;-}) I frequently find myself
debugging packages. Many do have configure or buildtime switches to
support this, but they are different from pkg to pkg.

I usually modify the affected pkg makefiles locally, like these two
examples:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/net/ORBit2/Makefile,v
retrieving revision 1.42
diff -u -r1.42 Makefile
--- Makefile	7 Oct 2005 16:03:21 -0000	1.42
+++ Makefile	1 Nov 2005 15:00:24 -0000
@@ -20,6 +20,7 @@
 
 CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
 CONFIGURE_ARGS+=	--with-html-dir=${PREFIX}/share/doc
+CONFIGURE_ARGS+=	--enable-debug=yes
 
 PKGCONFIG_OVERRIDE=	ORBit-2.0.pc.in
 PKGCONFIG_OVERRIDE+=	ORBit-CosNaming-2.0.pc.in
Index: Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/www/mozilla/Makefile.common,v
retrieving revision 1.63
diff -u -r1.63 Makefile.common
--- Makefile.common	17 Sep 2005 02:35:19 -0000	1.63
+++ Makefile.common	1 Nov 2005 15:01:35 -0000
@@ -42,7 +42,6 @@
 PKGCONFIG_OVERRIDE_STAGE=	post-build
 
 CONFIGURE_ARGS+= --disable-tests \
-		--disable-debug \
 		--disable-pedantic \
 		--with-system-jpeg=${BUILDLINK_PREFIX.jpeg} \
 		--with-system-png=${BUILDLINK_PREFIX.png} \


Now my question: would it be a good idea to have a common way to do this
via the options framework? Like 

  PKG_OPTIONS.ORBit2 += debug
  PKG_OPTIONS.gecko += debug

This would save the casual debugger (like me) having to figure out the
config/build magic, which likely is very obvious to the pkg creator.

Martin