LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to tell a package what gcc version to use? (https://www.linuxquestions.org/questions/linux-software-2/how-to-tell-a-package-what-gcc-version-to-use-452400/)

noware 06-07-2006 08:45 AM

How to tell a package what gcc version to use?
 
Hi All!

I have Fedora3 on my box, with gcc-4.1.1 installed.
I want to install MPlayer, which compiles only with 3.x.x gcc compilers, but other stuff need the gcc-4.1.1.
I compiled gcc-3.4.4 to /opt/gcc3, but I cannot find a way to tell MPlayer's configure script to use this one.
Is tehere a way to make it use the version I installed at /opt/gcc3?

Any help would be appreciated!
Thanks!

:noware:

haertig 06-07-2006 09:16 AM

You could try setting some enironmental variables before compiling (I don't know if MPlayer will honor them however):
Code:

# CC=/usr/bin/gcc-3.3
# export CC

If that doesn't work, you could brute force some symlinks to point to the compiler you want. On my system, /usr/bin/gcc is just a symlink to /usr/bin/gcc-4.0 Similar link exists for gccbug. I have removed these symlinks and recreated new ones pointing to older compiler version in the past, and this worked for me.

Here's what the compiler looks like in my /usr/bin. You can see the symlinks illustrated:
Code:

$ cd /usr/bin
$ pwd
/usr/bin
$ ls -l gcc*
lrwxrwxrwx 1 root root    7 2006-01-15 10:58 gcc -> gcc-4.0
-rwxr-xr-x 1 root root 81072 2005-12-23 19:20 gcc-3.3
-rwxr-xr-x 1 root root 89136 2005-12-01 17:12 gcc-4.0
lrwxrwxrwx 1 root root    10 2006-01-15 10:58 gccbug -> gccbug-4.0
-rwxr-xr-x 1 root root 15963 2005-12-23 19:15 gccbug-3.3
-rwxr-xr-x 1 root root 16239 2005-12-01 17:06 gccbug-4.0
$

Below you can see how I required g++ version 3.3 back in January to compile something. My symlink is still pointing to the older compiler. I guess I should fix that now, but it conveniently illustrates what I'm recommending. If I remember correctly on that January compile, I could redirect to the older version of gcc using the CC enviroment variable, but I had to brute-force the g++ redirect using the symlink trick. Just don't forget to undo it after you're done (I should talk - it's obvious I forgot to undo mine!):
Code:

$ ls -l g++*
lrwxrwxrwx 1 root root    7 2006-01-08 20:47 g++ -> g++-3.3
-rwxr-xr-x 1 root root 84720 2005-12-23 19:20 g++-3.3
-rwxr-xr-x 1 root root 93008 2005-12-01 17:10 g++-4.0
$



All times are GMT -5. The time now is 04:14 PM.