But, when I use rpmbuild -bc hello.spec, the configure script still
takes cc as /usr/bin/gcc from /usr/lib/rpm/macros. Why is it so?
Only when I do something like, CC=/path/to/compiler-gcc rpmbuild -bc
hello.spec, does the new CC used for building the package. Why isn't
~/.rpmmacros overriding the default macros?
Appreciate any inputs,
Thanks!
SK
--
Shakthi Kannan
http://www.shakthimaan.com
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
05-02-2010, 01:01 PM
Jos Vos
Overriding RPM macros
On Sun, May 02, 2010 at 06:13:51PM +0530, Shakthi Kannan wrote:
> I tried to set the following in ~/.rpmmacros:
>
> %__cc /path/to/compiler-gcc
>
> and when I did rpmbuild -bc hello.spec, it shows:
>
> $ rpmbuild --showrc | grep cc
> rpmlib(ConcurrentAccess) = 4.1-1
> -14: __cc /path/to/compiler-gcc
> -14: __cpp gcc -E
>
> But, when I use rpmbuild -bc hello.spec, the configure script still
> takes cc as /usr/bin/gcc from /usr/lib/rpm/macros. Why is it so?
>
> Only when I do something like, CC=/path/to/compiler-gcc rpmbuild -bc
> hello.spec, does the new CC used for building the package. Why isn't
> ~/.rpmmacros overriding the default macros?
>
> Appreciate any inputs,
Why do you think the configure script uses the %__cc macro?
Look how %configure is defined (with macros substitued):
rpm --eval '%configure'
If your path is not listed there, it will not be used, as the
configure script internally will only refer to environment
variables.
Changing the spec file so that you set
export CC=/path/to/compiler-gcc
at the beginning of %build might do what you want.
--
-- Jos Vos <jos@xos.nl>
-- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
-- Amsterdam, The Netherlands | Fax: +31 20 6948204
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
05-02-2010, 01:16 PM
Shakthi Kannan
Overriding RPM macros
Hi,
--- On Sun, May 2, 2010 at 6:31 PM, Jos Vos <jos@xos.nl> wrote:
| Look how %configure is defined (with macros substitued):
|
| * rpm --eval '%configure'
|
| If your path is not listed there, it will not be used, as the
| configure script internally will only refer to environment
| variables.
--
I see.
---
| Changing the spec file so that you set
|
| * export CC=/path/to/compiler-gcc
--
This worked. I am wondering if it is possible to export CC, AS, LD and
any other variables without having to patch the .spec file? Sourcing a
file listing all the variables is one option. Is there something that
rpmbuild can import in its environment before starting the build,
perhaps?
Thanks for your reply,
SK
--
Shakthi Kannan
http://www.shakthimaan.com
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
05-02-2010, 01:40 PM
Jos Vos
Overriding RPM macros
On Sun, May 02, 2010 at 06:46:03PM +0530, Shakthi Kannan wrote:
> This worked. I am wondering if it is possible to export CC, AS, LD and
> any other variables without having to patch the .spec file? Sourcing a
> file listing all the variables is one option. Is there something that
> rpmbuild can import in its environment before starting the build,
> perhaps?
Well, you can export in a script in which you at the end call "rpmbuild"
of course, but that's about it. Yes, you could redefine %configure etc.
but that would become too dirty to even mention.
In general, RPM is designed for getting predictable results, so what
you want to do is in fact against the normal RPM way of working.
--
-- Jos Vos <jos@xos.nl>
-- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
-- Amsterdam, The Netherlands | Fax: +31 20 6948204
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
05-02-2010, 01:40 PM
Shakthi Kannan
Overriding RPM macros
Replying to my own post (for reference):
--- On Sun, May 2, 2010 at 6:46 PM, Shakthi Kannan
<shakthimaan@gmail.com> wrote:
| Is there something that
| rpmbuild can import in its environment before starting the build,
| perhaps?
--
I just checked that ~/.rpmmacros (at user-level) does override macros,
and /etc/rpm/macros* for system-wide.
Sorry for the noise!
SK
--
Shakthi Kannan
http://www.shakthimaan.com
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel