Subject: misc/3300: Allow compiling with debug options
To: None <gnats-bugs@gnats.netbsd.org>
From: Simon J. Gerraty <sjg@quick.com.au>
List: netbsd-bugs
Date: 03/08/1997 09:07:06
>Number:         3300
>Category:       misc
>Synopsis:       don't hard code -O in sys.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Mar  7 14:20:01 1997
>Last-Modified:
>Originator:     Simon J. Gerraty
>Organization:
Zen Programming...
>Release:        Feb22
>Environment:
	
System: NetBSD zen.quick.com.au 1.2C NetBSD 1.2C (ZEN) #5: Mon Mar 3 16:18:58 EST 1997 root@zen.quick.com.au:/share/usr.src/sys/arch/i386/compile/ZEN i386


>Description:
	
As the /usr/share/mk macros currently stand, one cannot easily compile
and install NetBSD binaries with debugging enabled.  The patch below
adds DBG as a means of controlling the optimization/debug flags used.

>How-To-Repeat:
	
Apply the patch then
make DBG="-g -O"

>Fix:
	
*** sys.mk.~1~  Fri Oct 18 21:16:08 1996
--- sys.mk      Sat Mar  8 09:01:51 1997
***************
*** 18,25 ****
  COMPILE.S?=   ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
  LINK.S?=      ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
  
  CC?=          cc
! CFLAGS?=      -O
  COMPILE.c?=   ${CC} ${CFLAGS} ${CPPFLAGS} -c
  LINK.c?=      ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
  
--- 18,26 ----
  COMPILE.S?=   ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
  LINK.S?=      ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
  
+ DBG?=         -O
  CC?=          cc
! CFLAGS?=      ${DBG}
  COMPILE.c?=   ${CC} ${CFLAGS} ${CPPFLAGS} -c
  LINK.c?=      ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
  
>Audit-Trail:
>Unformatted: