From owner-freebsd-questions@FreeBSD.ORG Thu Jan 28 15:57:17 2010 Return-Path: Delivered-To: freebsd-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB8711065692 for ; Thu, 28 Jan 2010 15:57:17 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 64D048FC17 for ; Thu, 28 Jan 2010 15:57:17 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 16so360956fgg.13 for ; Thu, 28 Jan 2010 07:57:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=IkvMucvX2o0nC3X7WqNWyGsJmc/ml6bjbDK8fNFwnHM=; b=uY/5ihEc066es2vylMztMY5sx5jbQupPm38zlwZSKUajMu+qRQ5x/l9fF5//SVXNGZ BCj24HQPLlPWqFHcdTJLDsntbkJPZxTZQTl2o1WgP5rkI27JXTYryjJgMXo7GZqwBOQN Xip/6y/binZBNjmKbtUKC/bHGUkhTM4WF36sQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=wz9Lf6ODyJk2tlVvWIOvyDCAXdXrvVV5WHqe5SK88Rvnm1y56/5i/dQhFwEhr7lysn 6uNtoKW9K5JZZUhx0tcM28Idyco0jDHc/GxUuxM0xuz/fBwRnPViCMlOdADlkshj073J oHWGM4I0QepvKGnoESjn+tnjf8FyLtH9l05LE= MIME-Version: 1.0 Received: by 10.216.88.144 with SMTP id a16mr2810966wef.208.1264694236275; Thu, 28 Jan 2010 07:57:16 -0800 (PST) Date: Thu, 28 Jan 2010 10:57:16 -0500 Message-ID: From: "b. f." To: freebsd-questions@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1 Cc: giorgosfm@yahoo.gr Subject: Re: How to use an older version of gcc? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2010 15:57:17 -0000 gfot wrote: ... >yes i know i can call it gcc34 but the real problem is that the toolchain has >some scripts to automate the building and it uses some paths to pick up the >appropriate tools and when i run the scripts gcc42 is used. I figure out >that the path that gcc42 is located is the same as gcc34 /usr/local/bin . >But i don't know how to switch to the old gcc34 let's say for a particular >user on my system. I'm not sure why you would have lang/gcc42 installed on FreeBSD 8, unless you needed certain extra components that didn't come with the base system compiler, which is a patched version of gcc 4.2. Are you sure your toolchain isn't using /usr/bin/cc or /usr/bin/gcc, instead of /usr/local/bin/gcc42? And I'm not sure that it's a good idea to use lang/gcc34, either. In any event, if you are determined to do this, you could try defining: setenv CC gcc34 setenv CPP cpp34 alias cc gcc34 alias gcc gcc34 alias cpp cpp34 ... and so on, in the user's shell configuration file The location of that configuration file (e.g., $HOME/.cshrc, or $HOME/.profile) and the exact syntax will obviously depend upon the shell used. Or you could redefine the PATH variable of the user in question, so that, for example, $HOME/bin precedes /usr/bin and /usr/local/bin, and set ln -s /usr/local/bin/gcc34 $HOME/bin/gcc ln -s /usr/local/bin/gcc34 $HOME/bin/cc ln -s /usr/local/bin/cpp34 $HOME/bin/cpp and so on. Of course the aliases and links above are just typical examples, and may not work in your specific case: you have to consult the scripts in your MIPS tools in order to determine which values to use. If your user still wants to have the flexibility of using the base system compiler in some cases, without having to undo changes like those above, and only wants to use gcc34 with the MIPS tools, you could try using a per-directory environment change with the sysutils/penv port. I don't mean to be impolite, but I would have thought that someone who will be doing cross-development for MIPS would have been able to figure this out, or patch the toolchain scripts. Are you sure this user is up to the task? Regards, b.