-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

daid kahl wrote:
> Hello,
> 
> I have encountered a problem maintaining my system using revdep-rebuild.  I
> have both gcc-3.4.6 and gcc-4.3.2 installed on my machine.  I mainly use
> gcc4, but sometimes I need g77 because many people at my laboratory use
> fortran code that is not compliant with gfortran standards.
> 
> However, I have an Intel duo Core machine, so I usually have the CFLAG
> march=core2, but this is not supported in gcc3.  Thus, if I need to rebuild
> gcc3 during revdep-rebuild, I have to do most of the updates by hand so that
> I can turn on an older march setting for gcc3 (such as march=nocona).
> 
> Is there some way to set specfic CFLAGS for different gcc installs?  Is my
> method of manually having different architectures for different gcc
> installations a risk?
> 
> Regards,
> daid
> 

It is possible, although unsupported, to set CFLAGS/CXXFLAGS for a
particular version of a package.  The bashrc for the base profile (which
all modern profiles inherit from) will attempt to source, if they exist,
the following files:

    /etc/portage/env/${CATEGORY}/${PN}
    /etc/portage/env/${CATEGORY}/${PN}-${PV}
    /etc/portage/env/${CATEGORY}/${PN}-${PV}-${PR}

(where for sys-devel/gcc-3.4.6-r2, CATEGORY=sys-devel, PN=gcc, PV=3.4.6,
and PR=r2 (when there is no "-r#" part, PR=r0))

In one of those files, you can export a new value for CFLAGS/CXXFLAGS.
Note that not all portage variables can be changed in this manner. (To
be precise, variables that are referenced from the parts of portage
written in bash can be changed in this manner.) Also note that if you
have 'CXXFLAGS="${CFLAGS}"' in your make.conf, this will set CXXFLAGS to
the value of CFLAGS *that is in make.conf*, so you will need to modify
CXXFLAGS as well as CFLAGS.

- --
ABCD
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmNIhcACgkQOypDUo0oQOpmzwCbBmDk9w0vdr1OxO8YPBeLhQBq
lqkAoJ41FE04llfOHF1RH1DG0rUxJg9d
=rEti
-----END PGP SIGNATURE-----


Reply via email to