Package: colormake
Version: 0.9-1
I was using colormake and noticed that my g++ lines weren't getting coloured
when the compiler was anything other than plain "g++". I'm using a few cross
compilers, but you can test this with the mingw compiler.
Here's an example line:
i686-w64-mingw32-g++ -Wall -O2 -g -mconsole -c main.cc
I believe the problem is in this bit of the gcc regex...
(([[:ascii:]]+-)?g?cc|(g|c)\+\+).*)$
This matches one or more ascii's followed by dash then "cc" or "gcc", but not
"g++". The "|" is within the overall brackets so only allows "ascii-gcc" OR
"g++", so non-crosscompiler "g++" lines were correctly matched. I believe the
fix is the addition of brackets so that gcc|cc|g++|c++ are all an atom apart
from the [ascii] prefix.
(([[:ascii:]]+-)?(g?cc|(g|c)\+\+)).*)$
Now "([[:ascii:]]+-)?" is one optional prefix atom and (g?cc|(g|c)\+\+)) is
the required suffix atom, and can be any of "gcc", "cc", "g++", or "c++".
I've attached a patch that makes this change, but it's trivial enough that it
could be done quicker by hand.
--- /usr/share/colormake/colormake.pl.bak 2014-07-09 13:39:56.000000000 +0100
+++ /usr/share/colormake/colormake.pl 2014-07-09 13:41:33.000000000 +0100
@@ -88,7 +88,7 @@
{
$in = 'make';
}
- elsif ($thisline =~ s/^(\s*(libtool:\s*)?((compile|link):\s*)?(([[:ascii:]]+-)?g?cc|(g|c)\+\+).*)$/$col_gcc$1$col_norm/)
+ elsif ($thisline =~ s/^(\s*(libtool:\s*)?((compile|link):\s*)?(([[:ascii:]]+-)?(g?cc|(g|c)\+\+)).*)$/$col_gcc$1$col_norm/)
{
$in = 'gcc';
}