Re: alternatives for gcc
On Tue, 01 Feb 2011 21:01:13 -0500
Andrew Reid <reidac@bellatlantic.net> wrote:
> On Tuesday 01 February 2011 20:11:31 Joe Riel wrote:
> > Why are there no alternatives, configurable with
> > update-alternatives, for gcc? Seems like I should be able to
> > configure whether /usr/bin/gcc is linked to gcc-4.3, gcc-4.4,
> > etc. Of course I can just set the link manually (which I do),
> > but ...
>
> Can't you set up new alterantives within the update-alternatives
> mechanism?
>
> I have never done this, but it was one of the options I was
> considering a while ago to control which version of an app
> was the default -- as it turned out, I was able to use the
> "stow" mechanism to good effect, because it was a non-packaged
> app, so I only got as far as reading the update-alterantives
> documentation.
>
> The man-page says that the "--install" option sets up a new
> batch of alternatives.
>
> I don't know if this will interact constructively with the
> package manager.
>
> -- A.
The following worked:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 60
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 50
Then, to configure 4.3 as the default, I did
sudo update-alternatives --config gcc
and selected 4.3.
The packages that install gcc-4.3 and gcc-4.4 should possibly
call update-alternatives --install as part of their postinstall routine.
--
Joe Riel
Reply to: