Quote:
Originally Posted by rylan76
My question is simple: how do I use the "old" GCC 3.4 instead of GCC 4.1??? If I install these pacakges above, do they remove / overwrite GCC 4.1? Is there some way to have both on the system and then switch between them, for example to be able to try a compile with 4.1, and if it fails try 3.4 with GNU autotools packages? And also with non-autotools packages?
I. e. I want to try and compile everything I need for FC6 with GCC 4.1 (to take advantage of new features and optimisations), and if a compile fails for a vital C++ package,"fall back" on GCC 3.4 to compile that particular C++ package that won't compile under 4.1.
Possible? Apparently so. But how is it done? How can I
"change" the two GCC versions around at will so I can always fall back on 3.4 if 4.1 fails on a C++ package?
|
1. You can edit your Makefile by replacing CC=gcc to CC=gcc34
2. You can configure gcc by using alternatives command.
3. you can manually create symbolic link to gcc34. In this case do the following:
# cd /usr/bin
# mv gcc gcc41
When you want gcc 3.4:
# ln -s /usr/bin/gcc34 /usr/bin/gcc
When you want gcc 4.1:
# ln -s /usr/bin/gcc41 /usr/bin/gcc
Now, the second part:
I had a bitter experience to implement "fall back". But it can be made. You know one thing: we can use the return value of a command to determine whether the command has ran successfully or not. So, we can write a bash or Perl script to implement this idea. I think, 'make' do not have such type of provision.