Supporting multiple GNU toolchains

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

 



In my build environment I have multiple GNU toolchains. For instance gcc 4.4 to compile kernel, 4.6 for general programs, and 4.7 for experimental work. 

To make full use of these toolchains when packaging components, I am looking to do two things:
  1. Set a default toolchain used by all invocations of rpmbuild (which may or may not be the same toolchain used when I compile outside of rpmbuild)
  2. Allow a SPEC file to easily select a specific toolchain to use. This selection would override the default toolchain for the machine
My plan to accomplish this was to redefine the %configure macro in /etc/rpm/macros.toolchain and add the following:

%_CC /opt/gcc4_6/bin/gcc  
%_CXX /opt/gcc4_6/bin/g++ 
%configure \                   
  CC=%{_CC} ; export CC ; \    
  CXX=%{_CXX} ; export CXX ; \
  ... 

Then in a specific SPEC file the toolchain could be selected by changing the %_CC and %_CXX variables:

...
%define _CC /usr/bin/gcc  
%define _CXX /usr/bin/g++
... 

Is this the best way to allow multiple toolchains to coexist for packaging with RPM?

-Kyle

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux