optflags is currently not being used for C++ compiles. I think it should. /usr/lib/rpm/macros currently reads: %configure \ %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \ CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} The problem is that automake does NOT use CFLAGS in the default rule for C++ compiles, it uses CXXFLAGS. I suggest that %configure should be changed to read as follows: %configure \ %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \ CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" \ ./configure %{_target_platform} --prefix=%{_prefix}
Fixed (by setting CXXFLAGS in %configure) in rpm-3.05 and rpm-4.0.