X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=klibc%2Fklibc%2Fmakeerrlist.pl;h=14498d880a9e29603bf8ef39394fc5a0b88558a8;hp=f42704f88a3b8b7987d5fc9662ae7454cee3989c;hb=54eb6a122fc6d2d765b9f71f9b47d529c1acf30f;hpb=a0622777688ad84ef3d789e0171cfb0ca3dc21d2 diff --git a/klibc/klibc/makeerrlist.pl b/klibc/klibc/makeerrlist.pl index f42704f88..14498d880 100644 --- a/klibc/klibc/makeerrlist.pl +++ b/klibc/klibc/makeerrlist.pl @@ -10,20 +10,27 @@ use FileHandle; %errors = (); %errmsg = (); $maxerr = -1; -$rootdir = '../linux/include/'; # Must have trailing / +@includelist = (); # Include directories sub parse_file($) { my($file) = @_; my($fh) = new FileHandle; my($line, $error, $msg); my($kernelonly) = 0; - - $file = $rootdir.$file; + my($root); print STDERR "opening $file\n" unless ( $quiet ); - if ( !($fh->open("< ".$file)) ) { - die "$0: cannot open $file\n"; + $ok = 0; + foreach $root ( @includelist ) { + if ( $fh->open($root.'//'.$file, '<') ) { + $ok = 1; + last; + } + } + + if ( ! $ok ) { + die "$0: Cannot find file $file\n"; } while ( defined($line = <$fh>) ) { @@ -61,8 +68,10 @@ foreach $arg ( @ARGV ) { $quiet = 1; } elsif ( $arg =~ /^-(errlist|errnos|maxerr)$/ ) { $type = $arg; + } elsif ( $arg =~ '^\-I' ) { + push(@includelist, "$'"); } else { - die "$0: Unknown option: $arg\n"; + die "$0: Unknown option: $arg\n"; } }