rpmbuild: unset CFLAGS & CXXFLAGS ?

Debarshi 'Rishi' Ray debarshi.ray at gmail.com
Fri Nov 9 17:39:05 UTC 2007

> I suppose that setting the appropriate environment variable CPPFLAGS
> instead of abusing C[XX]FLAGS for this purpose would have been sufficient
> to avoid your problems.

Yes, I should have used CPPFLAGS to set the include directory. Thanks
for pointing out.

However it still bothers me that rpmbuild takes the environment's
CFLAGS and CXXFLAGS instead of forcing its own. Since Koji normally
CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions ...
CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions ..
FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions ...
would it not be better if rpmbuild used the same values and ignored
the user's environment?

If a package, indeed, needed some custom value for CFLAGS, CXXFLAGS
and FFLAGS, I believe that can be done through the spec file itself
and the user's environment setting would not be required.

What do you think?

GPG key ID: 63D4A5A7
Key server: pgp.mit.edu

More information about the fedora-devel-list mailing list