Brian wrote: > I have a need to force three files to not be optimized. I've followed the > instructions in the manual for setting them up in their own library, and > then using LIBADD to combine it with the original library. > > If I use AM_CXXFLAGS, the -O0 is superceded by a -O2. The same occurs if I > use libx_la_CXXFLAGS. I am not allowed to override CXXFLAGS (and don't want > to). > > Makefile.am <http://Makefile.am> sample (one or the other): > > > - libx_la_CXXFLAGS = -O0 > - AM_CXXFLAGS = -O0 >
According to the documentation AM_CXXFLAGS is ignored for building libx.la, if you set libx_la_CXXFLAGS. The problem is that something is defining CXXFLAGS. The manual says that this variable is reserved to be set by the user on the command line (AFAIR). CXXFLAGS has a higher priority than both AM_CXXFLAGS and libx_la_CXXFLAGS, i.e. whatever in autoconf/ automake is defining CXXFLAGS, it overrides the variables set by the writer of Makefile.am. I doubt that this is reasonable. IMHO autoconf/automake should predefine AM_CXXFLAGS instead. CXXFLAGS should be empty. (Actually I would be glad if automake would not set any variable to '-g -O2'.) Regards Harri