Re: Help required to upgrade gcc

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

 



On 4/3/08, wp <qwertygd@xxxxx> wrote:
> Hi
> I instal another gcc. And now I have two gcc ( gcc 4.0.1 and 4.2.0) instaled
>
> But when I try change default gcc by: update-alternatives --config gcc i
> have the answer:
> There is only 1 program which provides gcc
> (/usr/bin/gcc-4.0.1). Nothing to configure.
>
> I install another gcc folow this step:
> ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
> --program-suffix=-4.2.0

There are several ways to make a particular gcc the default one.  And
which works depends on the tools and programs looking for gcc.

For example, the last time I tried to compile Qt with a non-default
gcc it was impossible to make anything other than 'gcc' work, and it
was aknowledged as impossible by the Trolltech team.  In that case I
believe you can do something like:

  % which gcc
  /usr/bin/gcc
  % mv /usr/bin/gcc /usr/bin/gcc.orig
  % ln -s /usr/local/bin/gcc-4.2.0 /usr/bin/gcc

I have my development environment somewhat better under control since
I don't routinely use bad children like Qt.  So I set environment
variables like so (inside such system resource files such as
/etc/profile.d/gcc.sh):

  export CXX=/usr/local/bin/g++-4.3.0
  export CC=/usr/local/bin/gcc-4.3.0

That seems to work for most GNU packages (includiing gcc) which always
seem to find my desired gcc version.

I also set those variables inside most of my Makefiles.

That works for me most of the time, and I've had up to 5 or 6 versions
of gcc-X.Y.Z at a time over the years

-Tom

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux