rpmbuild: unset CFLAGS & CXXFLAGS ?

Mike A. Harris mharris at mharris.ca
Fri Nov 9 19:30:40 UTC 2007


Leszek Matok wrote:
> Dnia 2007-11-09, o godz. 23:09:05 "Debarshi 'Rishi' Ray"
> <debarshi.ray at gmail.com> napisał(a):
> 
>> 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.
> I build RPM-s locally from time to time (or more often) and I have to admit,
> using environment variables has saved me hours of spec file editing. Imagine
> recompiling more than one srpm, more than one time, with different options
> (like benchmarking -Os vs -O2 or something). You can easily alias rpm to
> always clear the environment, won't that solve your problem without
> introducing new problems to other users? :)

That can be done easily enough by rpm itself as well:

rpmbuild -ba --define 'optflags -O77 -funslide -funpotato' foo.spec

alias rpmgentoobuild='rpmbuild --define \'optflags -O77 -funslide\' '

then you can do:

rpmgentoobuild -ba foo.spec


Don't forget to pass the rice!


-- 
Mike A. Harris

Come and join us on the #fedora8 IRC help forum on irc.freenode.net




More information about the fedora-devel-list mailing list