]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - bin/blhc
Don't recognize options which contain compiler names as compiler lines.
[blhc/blhc.git] / bin / blhc
index 518626d54429f6570def1af01e9d163491732782..1d35e0ba489008f5c2eee8bab499256e0445d2b3 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -31,8 +31,10 @@ our $VERSION = '0.01';
 
 # Regex to catch compiler commands.
 my $cc_regex = qr/
-    (?<!\.)(?:cc|gcc|g\+\+|c\+\+)
-    (?:-[\d.]+)?
+    (?<!\s-)               # ignore options, e.g. "-c++" [sic!] (used by swig)
+    (?<!\.)                # ignore file names, e.g. "test.gcc"
+    (?:cc|gcc|g\+\+|c\+\+)
+    (?:-[\d.]+)?           # version suffix, e.g. "gcc-4.6"
     /x;
 # Full regex which matches the complete compiler name. Used in a few places to
 # prevent false negatives.