Re: debug builds with NO optimizations

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

 



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.

"-g -O2" is simply a default if CFLAGS is not already set.  It is by no
means set in stone, and in fact any package that insists on a particular
setting of CFLAGS is broken since this is meant to be a user-supplied
variable.  You are expected to set CFLAGS when configuring if you want
something else.  For example if you have a package and you want to build
it both optimized without debug information as well as a debug build:

$ mkdir build-release && cd build-release
$ CFLAGS="-g0 -O2" ../configure --prefix=/opt/foobar && make
$ cd ..
$ mkdir build-debug && cd build-debug
$ CFLAGS="-g -O0" ../configure --prefix=/opt/foobar && make

Brian


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux