[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: optflags problem



* Jeff Johnson (jbj@redhat.com) wrote:
> > Is this on the TODO for an upcoming release?
> 
> Yup, been there for going on 3 years now.

Ok, so it isn't likely to show up anytime soon then.

> >
> > > Use the rpmrc configuration in /etc/rpmrc instead. For example, putting
> > > 	optflags: i386 -O2 -march=i386 -mcpu=i686 -g
> > > adds -g debugging. Or just edit /usr/lib/rpm/rpmrc directly,
> > > not hard.
> >
> > I'm hesitant to do this because I don't want to mess with the default install,
> > since I don't want to use the goofy optflags all the time, just when I build
> > one tree.
> >
> > What I'm really trying to do is to have the optflags values in
> > /usr/lib/rpm/%_target/macros show up as the defaults when I
> > build a package like so:
> >
> >    rpm --rebuild --target foo-redhat-linux bar.src.rpm
> >
> 
> Look setting CFLAGS appropriately is really pretty simple, people
> have been doing it for years without any (ahem) assistance from rpm.

Ok, well, let's brainstorm then.  What is a good way for me to set the CFLAGS
and friends variables for 700+ packages based on the architecture they are
being built for without having to edit the spec file for every single package?

The only thing I've come up with so far is to create a custom rpmrc, override
the optflags values, and run rpm with --rcfile=myfile.  Is there another way
to do this so that the CFLAGS and such will be setup properly for the target
architecture the package is being built for?

I just tried exporting CFLAGS, and rebuilding, so maybe I've answered my own question.
So maybe I'm confused about what optflags is for then.  What is it for, if I'm
not using it properly?

> > but this isn't working either.  Is this part of the same brokenness?  How do I
> > go about making those optflags be used?
> >
> 
> Why do you think that optflags has anything to do with rebuilding bar.src.rpm?

Because the optflags that it picks up are translated into RPM_OPT_FLAGS and
CFLAGS, CXXFLAGS, etc in the build scripts.  Then the package is compiled
using these flags.  What's wrong with this?

-matt





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []