Re: configure sets CFLAGS or how to disable default CFLAGS='-g -O2' for gcc?

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

 



On Sun, 2006-04-02 at 15:35 +0400, Peter Volkov wrote:
> Hello.
> 
> I'm using autoconf / automake to build my program. I'd like to set some
> default CFLAGS for my project with the following variable in my
> src/Makefile.am:
> 
> AM_CFLAGS = $(GLIB_CFLAGS) -O3 -Wall -ffast-math
Very bad idea. These are architecture- and compiler-specific,
non-portable flags. You therefore should not set them anywhere.

> Does anybody see what is the problem here?
You are not applying the autotools correctly.

>  I do not want to set CFLAGS
> environment variable forever...
You don't have to. Don't try to mess up with CFLAGS inside of
configure.ac or Makefile.am and leave choosing CFLAGS to the user.

Only the user knows what he wants and needs on his platform.

>  Any suggestions are welcome.
> 
> Another related question is what if I want to have different CFLAGS for
> release and for debugging. How should I do this?
Leave choosing CFLAGS to the user/installer.

Ralf





_______________________________________________
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