tar -xzf gcc-3.0.3.tar.gz mkdir gccbuild cd gccbuild ../gcc-3.0.3/configure --prefix=/usr/local --enable-languages=c,c++ make bootstrap su Password: <give root password> make install exitUnless you need the other languages, I would advise against installing them. The build will shorter (believe it or not) if you only build the c and c++ compilers.
/usr/local/libThen run
ldconfigYou will have to have root priviledge to change this file, so you'll either want to do this before you exit superuser or you'll have to su again.
Once you are content that the installation worked OK, you can remove the
gccbuild
directory.
/usr/local/bin
.
You can get gcc
to tell you which version it is with the
command
gcc -vIf you get a line saying that the version is gcc version 3.0.3, you are fine. Otherwise, you need to reset your path. You can check your path by typing
printenv PATHwhich lists directories in the order they will be searched for executables. You want /usr/local/bin to occur before /usr/bin. Assuming /usr/local/bin doesn't appear in your path already and you are using bash, you can add/edit the following lines in your .bashrc file
PATH=/usr/local/bin:$PATH:. export PATHAlso make sure . appears in your path, or you'll spend your time typing ./myprogram to execute your programs.