Still a few flaws in configure's default CFLAGS selection - Mailing list pgsql-hackers

From Tom Lane
Subject Still a few flaws in configure's default CFLAGS selection
Date
Msg-id 14232.1066258181@sss.pgh.pa.us
Whole thread Raw
Responses Re: Still a few flaws in configure's default CFLAGS selection  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Still a few flaws in configure's default CFLAGS selection  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
While fooling with adding -fno-strict-aliasing to configure, I realized
that there are still some oddities about its selection of CFLAGS.  The
problems stem from the fact that autoconf will always select a default
value of CFLAGS that includes "-g", if the compiler accepts "-g" at all.
This has a couple of consequences:

1. --enable-debug is nearly useless, since unless you've manually
specified CFLAGS, what you're going to get will include -g anyway.

2. The code Bruce put in to default to "-O" on non-gcc compilers
will never actually fire.

It would be fairly easy to override autoconf's behavior, but I wonder
whether that will surprise people who are used to the "standard"
behavior of autoconf scripts.  Personally I've always felt that
defaulting to -g was a bizarre and unwise choice on the part of the
autoconf developers, but maybe someone out there wants to defend it?

Comments anyone?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: postgres --help-config
Next
From: Tom Lane
Date:
Subject: Re: postgres --help-config