On Wed, Jan 30, 2019 at 08:18:31PM -0500, Tom Lane wrote:
> This looks a bit copy-and-paste-y to me, in particular no thought
> has been taken for the order of flags. We found in configure that
> it's better to add user-specified CFLAGS at the *end*, even though
> injecting user-specified CPPFLAGS at the beginning is the right
> thing. This is because in, eg, "-O2 -O0" the last flag wins.
> Presumably the same goes for CXXFLAGS. I think it's right to
> put user LDFLAGS first, though. (The argument for CPPFLAGS and
> LDFLAGS is that you want the user's -I and -L flags to go first.)
Ah yes, good point about CFLAGS and LDFLAGS. It would be better to
add a comment about that and document the difference, aka "prepend" or
"append" the flag values.
CXXFLAGS applies to compiler options like -g -O2 which you would like
to enforce for the C++ compiler, so it seems to me that like CFLAGS
the custom values should be added at the end and not at the beginning,
no?
--
Michael