After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 450262 - default ./configure ignores CFLAGS
default ./configure ignores CFLAGS
Status: RESOLVED FIXED
Product: gamin
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gamin Maintainer(s)
Gamin Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2007-06-23 03:01 UTC by Daniel Drake
Modified: 2007-08-06 12:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix (2.07 KB, patch)
2007-06-23 03:02 UTC, Daniel Drake
needs-work Details | Review
updated fix (2.70 KB, patch)
2007-07-29 16:08 UTC, Daniel Drake
committed Details | Review

Description Daniel Drake 2007-06-23 03:01:44 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.
Comment 1 Daniel Drake 2007-06-23 03:02:19 UTC
Created attachment 90503 [details] [review]
fix
Comment 2 Daniel Drake 2007-06-23 03:03:27 UTC
original downstream report: http://bugzilla.gnome.org/show_bug.cgi?id=450262
Comment 3 Daniel Veillard 2007-07-29 07:58:36 UTC
The patch removes the debugging option and associated -g, that's too much
for my taste. 

Daniel
Comment 4 Daniel Drake 2007-07-29 16:08:21 UTC
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