autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debug builds with NO optimizations


From: Russell Shaw
Subject: Re: debug builds with NO optimizations
Date: Tue, 07 Feb 2006 13:09:27 +1100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.11) Gecko/20050914 Debian/1.7.11-1

John Calcote wrote:
Generally, when I build with the DEBUG macro defined, it's because I want to step through a portion of my code with the debugger. However, I've noticed that using AC_PROG_CC sets CFLAGS to "-g -O2" on GCC - and tries to use similar options on other compilers. I really like the use of this macro because it also attempts to put the compiler into standard C mode - which has no standard mechnism, so it really belongs in the macro. I also completely subscribe to the "symbols on all builds" philosophy, so I too would recommend enabling -g-like functionality on all possible compilers for all possible build configurations. What I _don't_ agree with is automatically tacking in a -O2 * who thought that would be a good idea? What we really need is a macro that enables optimization levels (such as -Ox), or completely disables them. Then we can use our various debug flags to enable/disable them conditionally, as maintainer/programmer configuration dictates. My question: Anyone know of a good idiom for managing optimization flags - including disabling the obligatory -O2 placed in CFLAGS by AC_PROG_CC?

./configure CFLAGS="-g -O0"

Now whenever you do a "make", the default CFLAGS are "-g -O0". To use "-g -O2"
temporarily or for a session, then: #export CFLAGS="-g -O2"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]