Brian, Thanks for the reply. I get this. I realize that you MAY set CFLAGS on the command line if you wish - and you should - IF you have special flags to set on the command line for a specific configuration or build. My complaint was that the AC_PROG_CC macro just assumes you want -O2 (again - IF nothing else is already set). I don't want it to assume you want any sort of user configuration - including optimization. Other things this macro does include setting any flags necessary to enable ansi C processing, and enabling symbol generation. These I like. I just don't like the -O2 optimization flag. I think it's inappropriate. I believe a better solution would be to have the autoconf guys add a standard macro that allows you to choose an optimization level. This way you could set the appropriate optimization level based on your projects needs. BTW, the way I currently "work around" this issue is to go ahead and add -O0 if "--enable-debug" is specified, or -O3 if it's not (on GCC only, of course). GCC docs specify that the last -O option wins, so I just live with the fact that -O2 is specified first, and then the actual optimization level that I want. Of course, my configuration file is set to allow the user to override all of these options if they use CFLAGS on the command line of either configure, or make. John
>>> Brian Dessent <[EMAIL PROTECTED]> 2/6/2006 5:25:04 pm >>> 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@gnu.org http://lists.gnu.org/mailman/listinfo/autoconf