Fedora 16 - Colorgcc howto

08 Feb in color-gcc, colorgcc, f16, Fedora 16

To install colorgcc on Fedora 16, do the following assuming perl is installed:

  1. sudo yum install colorgcc -y
  2.  
  3. wget search.cpan.org/CPAN/authors/id/R/RR/RRA/Term-ANSIColor-3.01.tar.gz
  4. tar-xzvf Term-ANSIColor-3.01.tar.gz
  5. cd Term-ANSIColor-3.01/
  6. perl Makefile.PL
  7. make
  8. sudo make test
  9. sudo make install

Download the config file from here and move it to:

  1. wget pacificsimplicity.ca/sites/default/files/uploads/colorgccrc.txt
  2. mv colorgccrc.txt to ~/.colorgccrc

Make this directory and the following symlink:

  1. mkdir ~/home/bin
  2. cd ~/home/bin
  3. ln -s /usr/bin/color-gcc gcc

Alter the color-gcc script to look something like the below section - NOTE the starting "elsif ($option =~ m/color$/)":

  1. sudo vi /usr/bin/color-gcc
  2.  
  3. }
  4.       elsif ($option eq "nocolor")
  5.       {
  6.          # The nocolor option lists terminal types, separated by
  7.         # spaces, not to do color on.
  8.         foreach $termtype (split(/\s+/, $value))
  9.          {
  10.             $nocolor{$termtype} = "true";
  11.          }
  12.       }
  13.       elsif ($option =~ m/color$/)
  14.       {
  15.          $colors{$option} = color($value);
  16.       }
  17.       else
  18.       {
  19.         $compilerPaths{$option} = $value;
  20.       }
  21.  
  22.    }
  23.    close(PREFS);

Now adjust your .bashrc PATH variable to look similar to the following:

  1. vi ~/.bashrc
  2. export PATH=$HOME/bin:$PATH

Logout, log backin and try running gcc with a known error. You should see colors!

AttachmentSize
colorgccrc.txt1.51 KB

Comments

Post new comment

By submitting this form, you accept the Mollom privacy policy.

Pacific Simplicity 2011 All rights reserved. Contact