This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients Arfrever, lemburg, loewis, vstinner
Date 2010-03-25.10:31:30
SpamBayes Score 0.0
Marked as misclassified No
Message-id <4BAB3B80.9020400@egenix.com>
In-reply-to <1269508476.61.0.76435997971.issue8211@psf.upfronthosting.co.za>
Content
STINNER Victor wrote:
> 
> STINNER Victor <victor.stinner@haypocalc.com> added the comment:
> 
> MaL> The patch you checked in still unconditionally overrides the
> MaL> CFLAGS setting applied by AC_PROG_CC in case no CFLAGS variable
> MaL> is set.
> MaL>
> MaL> The issue now is: AC_PROG_CC no longer initializes CFLAGS 
> MaL> if not set.
> 
> Sorry, but I don't understand. Why should it be initialized?

Sorry, perhaps I wasn't clear enough.

The purpose of AC_PROG_CC is to setup the env vars depending on
the found C compiler. One of these settings is the CFLAGS env
var and you patch causes those settings to be overwritten
if CFLAGS has not been defined as env var before starting
./configure.

Since CFLAGS will most of the time not be set by the user
running ./configure, the patch effectively disables the
default settings determined based on the compiler by AC_PROG_CC.

> I don't like the default value because it enables optimization when --with-pydebug is used and I consider that as a bug. If no configure option is used, Python adds -O3 as before. About -g: Python always add it, so the -g from AC_PROG_CC was redundant.

Right, but it's possible that AC_PROG_CC adds other flags
as well (it currently doesn't, but that may well change in
future versions of autoconf).

I'd suggest to only override the CFLAGS setting in case it
was defined before running the AC_PROG_CC code.

In addition, it may be useful to have --with-pydebug replace OPT
with "-O0" or add "-O0" to it the end of it.

> In Makefile.pre.in, prefixes and suffixes are added to the CFLAGS: "CFLAGS= $(BASECFLAGS) @CFLAGS@ $(OPT) $(EXTRA_CFLAGS)". But I consider this as a separate issue.

Right. That's for historic reasons. OPT is very old, BASECFLAGS
and EXTRA_CFLAGS are newer additions.
History
Date User Action Args
2010-03-25 10:31:32lemburgsetrecipients: + lemburg, loewis, vstinner, Arfrever
2010-03-25 10:31:31lemburglinkissue8211 messages
2010-03-25 10:31:30lemburgcreate