]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - bin/blhc
Ignore CPPFLAGS for Ada files.
[blhc/blhc.git] / bin / blhc
index 22ebd6f8a802e380e02d5a1fa02b0d92c45111a6..d276bc001b37b302672e35c6bff4abc1c7ba56ac 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -90,10 +90,14 @@ my @source_no_preprocess_compile = (
     qw( mi ),
     # Fortran
     qw( f for ftn f90 f95 f03 f08 ),
+    # Ada body
+    qw( adb ),
 );
 my @source_no_preprocess_no_compile = (
     # Assembly
     qw( s ),
+    # Ada specification
+    qw( ads ),
 );
 my @source_no_preprocess = (
     @source_no_preprocess_compile,
@@ -430,8 +434,8 @@ sub is_non_verbose_build {
         $file = $1;
 
         if (index($next_line, $file) != -1 and $next_line =~ /$cc_regex/o) {
-            # We still have to skip the current line as it doesn't contain any
-            # compiler commands.
+            # Not a non-verbose line, but we still have to skip the current line
+            # as it doesn't contain any compiler commands.
             ${$skip_ref} = 1;
             return 0;
         }
@@ -641,8 +645,8 @@ foreach my $file (@ARGV) {
         # only, doesn't use the dpkg-buildpackage header. Necessary to ignore
         # build logs which aren't built (wrong architecture, build error,
         # etc.).
-        if (not $arch and $line =~ /^Architecture: (.+)$/) {
-            $arch = $1;
+        if (not $arch and index($line, 'Architecture: ') == 0) {
+            $arch = substr $line, 14, -1; # -1 to ignore '\n' at the end
         }
 
         # dpkg-buildflags only provides hardening flags since 1.16.1, don't
@@ -713,12 +717,13 @@ foreach my $file (@ARGV) {
         # And stop at the end of the build log. Package details (reported by
         # the buildd logs) are not important for us. This also prevents false
         # positives.
-        last if $line =~ /^Build finished at \d{8}-\d{4}$/;
+        last if index($line, 'Build finished at ') == 0
+                and $line =~ /^Build finished at \d{8}-\d{4}$/;
 
         # Detect architecture automatically unless overridden.
         if (not $arch
-                and $line =~ /^dpkg-buildpackage: host architecture (.+)$/) {
-            $arch = $1;
+                and index($line, 'dpkg-buildpackage: host architecture ') == 0) {
+            $arch = substr $line, 37, -1; # -1 to ignore '\n' at the end
         }
 
         # Ignore compiler warnings for now.