bintools/evalid/EvalidCompare.pm
changeset 311 3b0e5fcfce37
parent 0 044383f39525
child 312 7ae5adc67cc7
equal deleted inserted replaced
310:c6bc7799f2e4 311:3b0e5fcfce37
    25 use File::Temp qw/ tempfile tempdir /;
    25 use File::Temp qw/ tempfile tempdir /;
    26 use File::Find;
    26 use File::Find;
    27 use File::Path;
    27 use File::Path;
    28 use File::Basename;
    28 use File::Basename;
    29 use File::Copy;
    29 use File::Copy;
       
    30 use Config;
       
    31 
       
    32 # Search for tools with Raptor...
       
    33 sub FindTool($)
       
    34 {
       
    35   my $tool = shift;
       
    36   my $location = $tool;
       
    37   if ($Config{osname} =~ m/MSWin32/i && $ENV{SBS_HOME} && -e $ENV{SBS_HOME}."/win32/mingw/bin/".$tool.".exe")
       
    38   {
       
    39     $location = $ENV{SBS_HOME}."/win32/mingw/bin/".$tool.".exe"; 
       
    40   }
       
    41   elsif(-e $ENV{EPOCROOT}."epoc32/gcc_mingw/bin/".$tool.".exe")
       
    42   {
       
    43     $location = $ENV{EPOCROOT}."epoc32/gcc_mingw/bin/".$tool.".exe";
       
    44   }
       
    45   elsif(-e $FindBin::Bin."/".$tool.".exe")
       
    46   {
       
    47     $location = $FindBin::Bin."/".$tool.".exe"; 
       
    48   }
       
    49   return $location;
       
    50 }
       
    51 
       
    52 
    30 
    53 
    31 #
    54 #
    32 # Constants.
    55 # Constants.
    33 #
    56 #
    34 
    57 
    69 # %TEMPDIR% and %FILE% are magic words for the expandor
    92 # %TEMPDIR% and %FILE% are magic words for the expandor
    70 # they will be replaced with suitable values when used
    93 # they will be replaced with suitable values when used
    71 # they also enabled an order of expandor arguments where the filename is not last
    94 # they also enabled an order of expandor arguments where the filename is not last
    72 my %typeHandler = (
    95 my %typeHandler = (
    73       e32 => {reader => 'elf2e32 --dump --e32input=', filter => \&Elf2E32Filter},
    96       e32 => {reader => 'elf2e32 --dump --e32input=', filter => \&Elf2E32Filter},
    74       arm => {reader => 'nm --no-sort', filter => \&NmFilter, retry => 1, relative_paths => 1},
    97       arm => {reader => FindTool("nm").' --no-sort', filter => \&NmFilter, retry => 1, relative_paths => 1},
    75       elf => {reader => 'elfdump -i', filter => \&ElfDumpFilter, rawretry => 1},
    98       elf => {reader => 'elfdump -i', filter => \&ElfDumpFilter, rawretry => 1},
    76       intel => {reader => '%EPOCROOT%epoc32\gcc_mingw\bin\nm --no-sort', filter => \&NmFilter, rawretry => 1, relative_paths => 1, skipstderr => 1},
    99       intel => {reader => FindTool("nm").' --no-sort', filter => \&NmFilter, rawretry => 1, relative_paths => 1, skipstderr => 1},
    77       intel_pe => {reader => 'pe_dump', filter => \&FilterNone, rawretry => 1},
   100       intel_pe => {reader => 'pe_dump', filter => \&FilterNone, rawretry => 1},
    78 	  zip => {reader => '"'.$FindBin::Bin.'/unzip" -l -v', filter => \&UnzipFilter, rawretry => 1},
   101 	  zip => {reader => FindTool("unzip").' -l -v', filter => \&UnzipFilter, rawretry => 1},
    79       map => {filter => \&MapFilter, skipblanks => 1},
   102       map => {filter => \&MapFilter, skipblanks => 1},
    80       sgml => {filter => \&SgmlFilter},
   103       sgml => {filter => \&SgmlFilter},
    81       preprocessed_text => {filter => \&PreprocessedTextFilter},
   104       preprocessed_text => {filter => \&PreprocessedTextFilter},
    82       permanent_file_store => {reader => 'pfsdump -c -v', filter => \&PermanentFileStoreFilter, rawretry => 1, relative_paths => 1},
   105       permanent_file_store => {reader => 'pfsdump -c -v', filter => \&PermanentFileStoreFilter, rawretry => 1, relative_paths => 1},
    83       ignore => {filter => \&FilterAll},
   106       ignore => {filter => \&FilterAll},