Re: Setting Debug flag in /etc/make.conf

2010-08-02 Thread Anonymous
Robert Bonomi  writes:

>> I have been having problems with several different programs lately.
>> Would there be any serious drawback to simply setting: "WITH_DEBUG= "
>> in the /etc/make.conf file to force everything I build/rebuild to be
>> built with debug symbols? I am assuming that I can simply place that
>> flag in the make.conf file. Do I have to also give it a value; i.e "=1"
>> or "=yes" also?
>>
>
> What's wrong with the traditional way of doing this -- i.e.,  setting the 
> environment variable CFLAGS to  -g   befoe your start make-inthings?

Because you need to define empty STRIP, too. OTOH, setting WITH_DEBUG or
DEBUG_FLAGS does this for you.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Setting Debug flag in /etc/make.conf

2010-08-02 Thread Robert Bonomi
> From owner-freebsd-questi...@freebsd.org  Sun Aug  1 06:28:18 2010
> Date: Sun, 1 Aug 2010 07:28:24 -0400
> From: Jerry 
> To: freebsd-questions@freebsd.org
> Subject: Setting Debug flag in /etc/make.conf
>
> I have been having problems with several different programs lately.
> Would there be any serious drawback to simply setting: "WITH_DEBUG= "
> in the /etc/make.conf file to force everything I build/rebuild to be
> built with debug symbols? I am assuming that I can simply place that
> flag in the make.conf file. Do I have to also give it a value; i.e "=1"
> or "=yes" also?
>

What's wrong with the traditional way of doing this -- i.e.,  setting the 
environment variable CFLAGS to  -g   befoe your start make-inthings?


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Setting Debug flag in /etc/make.conf

2010-08-02 Thread Robert Bonomi

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Setting Debug flag in /etc/make.conf

2010-08-02 Thread Greg Larkin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Roland Smith wrote:
> On Sun, Aug 01, 2010 at 07:28:24AM -0400, Jerry wrote:
>> I have been having problems with several different programs lately.
>> Would there be any serious drawback to simply setting: "WITH_DEBUG= "
>> in the /etc/make.conf file to force everything I build/rebuild to be
>> built with debug symbols? 
> 
> No.
> 
> You are assuming every program's Makefile uses WITH_DEBUG that way!  The base
> system doesn't for one. And neither do all ports. To look for yourself, use
> the following command;
> 
> find /usr/ports/ -type f -name Makefile -exec grep -H DEBUG {} \;
> 
> While a lot use WITH_DEBUG, not all ports do, and some use other options, like
> NODEBUG or DEBUGFLAGS, or DEBUGGING.
> 
> You'd have to look into the programs in question to see how to enable
> debugging for those.
> 
> Roland

WITH_DEBUG has special meaning in the ports infrastructure, and as long
as a specific port uses CFLAGS during compilation, it will be compiled
with debugging symbols when WITH_DEBUG is enabled.  Some ports also
check the value of WITH_DEBUG within their own Makefile in order to set
port-specific debug build options.

See this excerpt from /usr/ports/Mk/bsd.port.mk:

# 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.

Just put the following in /etc/make.conf and then recompile the ports
you want to include debug symbols:

WITH_DEBUG= yes

Hope that helps,
Greg
- --
Greg Larkin

http://www.FreeBSD.org/   - The Power To Serve
http://www.sourcehosting.net/ - Ready. Set. Code.
http://twitter.com/sourcehosting/ - Follow me, follow you
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFMVtFn0sRouByUApARAvlbAKDKwV2anUR87ShERsHVsCpidSof5wCgtb8U
27W9F1G2DmKiebrDrgCe+0c=
=Xhvf
-END PGP SIGNATURE-

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Setting Debug flag in /etc/make.conf

2010-08-02 Thread Roland Smith
On Sun, Aug 01, 2010 at 07:28:24AM -0400, Jerry wrote:
> I have been having problems with several different programs lately.
> Would there be any serious drawback to simply setting: "WITH_DEBUG= "
> in the /etc/make.conf file to force everything I build/rebuild to be
> built with debug symbols? 

No.

You are assuming every program's Makefile uses WITH_DEBUG that way!  The base
system doesn't for one. And neither do all ports. To look for yourself, use
the following command;

find /usr/ports/ -type f -name Makefile -exec grep -H DEBUG {} \;

While a lot use WITH_DEBUG, not all ports do, and some use other options, like
NODEBUG or DEBUGFLAGS, or DEBUGGING.

You'd have to look into the programs in question to see how to enable
debugging for those.

Roland
-- 
R.F.Smith   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)


pgpL4HEueUnRI.pgp
Description: PGP signature


Re: Setting Debug flag in /etc/make.conf

2010-08-01 Thread Anonymous
(resending, previous mail didn't show up in the list archive)

Jerry  writes:

> I have been having problems with several different programs lately.
> Would there be any serious drawback to simply setting: "WITH_DEBUG= "

You'd lose `-O2' compiler-specific optimization. If you want to retain
it use DEBUG_FLAGS, e.g.

  DEBUG_FLAGS = -ggdb
  CFLAGS += ${DEBUG_FLAGS}

Ports that build using bsdmake don't really need the second line as well
as buildworld.

> in the /etc/make.conf file to force everything I build/rebuild to be
> built with debug symbols? I am assuming that I can simply place that
> flag in the make.conf file. Do I have to also give it a value; i.e "=1"
> or "=yes" also?

Besides symbols some ports enable compile-time debugging and disable
optimization using WITH_DEBUG ifdef that may impact performance.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Setting Debug flag in /etc/make.conf

2010-08-01 Thread Jerry
I have been having problems with several different programs lately.
Would there be any serious drawback to simply setting: "WITH_DEBUG= "
in the /etc/make.conf file to force everything I build/rebuild to be
built with debug symbols? I am assuming that I can simply place that
flag in the make.conf file. Do I have to also give it a value; i.e "=1"
or "=yes" also?

-- 
Jerry ✌
freebsd.u...@seibercom.net

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__

Which is worse: ignorance or apathy?  Who knows?  Who cares?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"