bholland
2014-08-10 17:48:49 UTC
Hi everyone,
I am working on a project that I joined and I noticed that the flags are all
a mess. When a flag called --enabled-debug was set it it sets
AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -O0"
AM_LDFLAGS="$AM_LDFLAGS -g"
but when I compile all of my stuff, the CXXFLAGS variable is set to -g -O2
which completely negates the ability to debug. Likewise, I want to set
LDFLAGS to actually link the compiled libraries first as oppose to anything
that I have installed. I don't think this is a problem as LDFLAGS apparently
doesn't have a default for autoconf, or at least not one that overrides.
I am actually surprised that autoconf decided that the default CXXFLAG set
was not empty. I am sure there are reasons for that, but to me it causes
more harm than good. I set AM_CXXFLAGS with the expectation that if I don't
explicitly set CXXFLAGS, that I get to use whatever I set for AM_CXXFLAGS
but that is not the case. Even in build mode
AM_CXXFLAGS="$AM_CXXFLAGS -O3"
will be overridden to be -g -O2 by CXXFLAGS.
Basically, what I want is the expected default behavior. I want to set
CXXFLAGS to nothing by default unless it has been specified by the user. It
is very strange that this is not how it works so I suppose I am also curious
as to why this is the case.
Thanks,
~Ben
--
View this message in context: http://gnu-autoconf.7623.n7.nabble.com/How-can-I-override-CXXFLAGS-tp19630.html
Sent from the Gnu - Autoconf - General mailing list archive at Nabble.com.
I am working on a project that I joined and I noticed that the flags are all
a mess. When a flag called --enabled-debug was set it it sets
AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -O0"
AM_LDFLAGS="$AM_LDFLAGS -g"
but when I compile all of my stuff, the CXXFLAGS variable is set to -g -O2
which completely negates the ability to debug. Likewise, I want to set
LDFLAGS to actually link the compiled libraries first as oppose to anything
that I have installed. I don't think this is a problem as LDFLAGS apparently
doesn't have a default for autoconf, or at least not one that overrides.
I am actually surprised that autoconf decided that the default CXXFLAG set
was not empty. I am sure there are reasons for that, but to me it causes
more harm than good. I set AM_CXXFLAGS with the expectation that if I don't
explicitly set CXXFLAGS, that I get to use whatever I set for AM_CXXFLAGS
but that is not the case. Even in build mode
AM_CXXFLAGS="$AM_CXXFLAGS -O3"
will be overridden to be -g -O2 by CXXFLAGS.
Basically, what I want is the expected default behavior. I want to set
CXXFLAGS to nothing by default unless it has been specified by the user. It
is very strange that this is not how it works so I suppose I am also curious
as to why this is the case.
Thanks,
~Ben
--
View this message in context: http://gnu-autoconf.7623.n7.nabble.com/How-can-I-override-CXXFLAGS-tp19630.html
Sent from the Gnu - Autoconf - General mailing list archive at Nabble.com.