GNOME Bugzilla – Bug 450262
default ./configure ignores CFLAGS
Last modified: 2007-08-06 12:10:23 UTC
A default ./configure overrides environment CFLAGS with "-O2" for gcc. I think this may have been introduced by the patch in bug #365029. The upcoming patch modifies the configure.in to be more "standard". AM_CFLAGS should be used for CFLAGS additions like the warning flags. Also in general, configure scripts don't tend to mess with optimization level or debug -- that is left to the user to specify with the CFLAGS environment variable. If you'd prefer to keep the optimization and debug behaviour then please describe how it should work and I'll happily fix it another way. But I feel that the simplistic approach taken here would have avoided both bug #365029 and this one. If it makes it any easier for you, I can commit this.
Created attachment 90503 [details] [review] fix
original downstream report: http://bugzilla.gnome.org/show_bug.cgi?id=450262
The patch removes the debugging option and associated -g, that's too much for my taste. Daniel
Created attachment 92649 [details] [review] updated fix Sorry for the incorrect assumptions. Here's an updated version, which I believe should create the behaviour you are looking for. $ ./autogen.sh compiler flags: -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wsign-compare -Wno-sign-compare -g $ ./autogen.sh --disable-debug compiler flags: -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wsign-compare -Wno-sign-compare -O2 $ CFLAGS="-O3 -fomit-frame-pointer" ./autogen.sh compiler flags: -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wsign-compare -Wno-sign-compare -g -O3 -fomit-frame-pointer $ CFLAGS="-O3 -fomit-frame-pointer" ./autogen.sh --disable-debug compiler flags: -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wsign-compare -Wno-sign-compare -O3 -fomit-frame-pointer