From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30298 invoked by alias); 3 Apr 2008 18:49:03 -0000 Received: (qmail 30290 invoked by uid 22791); 3 Apr 2008 18:49:03 -0000 X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 03 Apr 2008 18:48:37 +0000 Received: by fg-out-1718.google.com with SMTP id d23so2565244fga.28 for ; Thu, 03 Apr 2008 11:48:34 -0700 (PDT) Received: by 10.86.99.9 with SMTP id w9mr89820fgb.58.1207248514769; Thu, 03 Apr 2008 11:48:34 -0700 (PDT) Received: by 10.86.35.18 with HTTP; Thu, 3 Apr 2008 11:48:34 -0700 (PDT) Message-ID: <8bc817ee0804031148k7e00a944u31ce5a0db9b30259@mail.gmail.com> Date: Thu, 03 Apr 2008 21:06:00 -0000 From: "Tom Browder" To: wp Subject: Re: Help required to upgrade gcc Cc: gcc-help@gcc.gnu.org In-Reply-To: <006101c895b7$cf2dd3e0$7800a8c0@ntbkmm> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1207217294.28834.ezmlm@gcc.gnu.org> <007301c89575$299c23b0$7800a8c0@ntbkmm> <01e601c89577$edd78330$c9868990$@net> <8bc817ee0804030416m1529d564rcc470ca6ca914386@mail.gmail.com> <006101c895b7$cf2dd3e0$7800a8c0@ntbkmm> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg00047.txt.bz2 On 4/3/08, wp 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