| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | use strict;
|
| 20 |
|
| 21 | my ($dir, $arch, @files) = @ARGV;
|
| 22 |
|
| 23 | my $ret = 0;
|
| 24 | my $line;
|
| 25 | my $lineno = 0;
|
| 26 | my $filename;
|
| 27 |
|
| 28 | foreach my $file (@files) {
|
| 29 | local *FH;
|
| 30 | $filename = $file;
|
| 31 | open(FH, "<$filename") or die "$filename: $!\n";
|
| 32 | $lineno = 0;
|
| 33 | while ($line = <FH>) {
|
| 34 | $lineno++;
|
| 35 | check_include();
|
| 36 | }
|
| 37 | close FH;
|
| 38 | }
|
| 39 | exit $ret;
|
| 40 |
|
| 41 | sub check_include
|
| 42 | {
|
| 43 | if ($line =~ m/^\s*#\s*include\s+<((asm|linux).*)>/) {
|
| 44 | my $inc = $1;
|
| 45 | my $found;
|
| 46 | $found = stat($dir . "/" . $inc);
|
| 47 | if (!$found) {
|
| 48 | $inc =~ s |
| 49 | $found = stat($dir . "/" . $inc);
|
| 50 | }
|
| 51 | if (!$found) {
|
| 52 | printf STDERR "$filename:$lineno: included file '$inc' is not exported\n";
|
| 53 | $ret = 1;
|
| 54 | }
|
| 55 | }
|
| 56 | }
|