bintools/evalid/EvalidCompare.pm
changeset 311 3b0e5fcfce37
parent 0 044383f39525
child 312 7ae5adc67cc7
--- a/bintools/evalid/EvalidCompare.pm	Mon Mar 29 14:31:21 2010 +0100
+++ b/bintools/evalid/EvalidCompare.pm	Mon Mar 29 15:05:52 2010 +0100
@@ -27,6 +27,29 @@
 use File::Path;
 use File::Basename;
 use File::Copy;
+use Config;
+
+# Search for tools with Raptor...
+sub FindTool($)
+{
+  my $tool = shift;
+  my $location = $tool;
+  if ($Config{osname} =~ m/MSWin32/i && $ENV{SBS_HOME} && -e $ENV{SBS_HOME}."/win32/mingw/bin/".$tool.".exe")
+  {
+    $location = $ENV{SBS_HOME}."/win32/mingw/bin/".$tool.".exe"; 
+  }
+  elsif(-e $ENV{EPOCROOT}."epoc32/gcc_mingw/bin/".$tool.".exe")
+  {
+    $location = $ENV{EPOCROOT}."epoc32/gcc_mingw/bin/".$tool.".exe";
+  }
+  elsif(-e $FindBin::Bin."/".$tool.".exe")
+  {
+    $location = $FindBin::Bin."/".$tool.".exe"; 
+  }
+  return $location;
+}
+
+
 
 #
 # Constants.
@@ -71,11 +94,11 @@
 # they also enabled an order of expandor arguments where the filename is not last
 my %typeHandler = (
       e32 => {reader => 'elf2e32 --dump --e32input=', filter => \&Elf2E32Filter},
-      arm => {reader => 'nm --no-sort', filter => \&NmFilter, retry => 1, relative_paths => 1},
+      arm => {reader => FindTool("nm").' --no-sort', filter => \&NmFilter, retry => 1, relative_paths => 1},
       elf => {reader => 'elfdump -i', filter => \&ElfDumpFilter, rawretry => 1},
-      intel => {reader => '%EPOCROOT%epoc32\gcc_mingw\bin\nm --no-sort', filter => \&NmFilter, rawretry => 1, relative_paths => 1, skipstderr => 1},
+      intel => {reader => FindTool("nm").' --no-sort', filter => \&NmFilter, rawretry => 1, relative_paths => 1, skipstderr => 1},
       intel_pe => {reader => 'pe_dump', filter => \&FilterNone, rawretry => 1},
-	  zip => {reader => '"'.$FindBin::Bin.'/unzip" -l -v', filter => \&UnzipFilter, rawretry => 1},
+	  zip => {reader => FindTool("unzip").' -l -v', filter => \&UnzipFilter, rawretry => 1},
       map => {filter => \&MapFilter, skipblanks => 1},
       sgml => {filter => \&SgmlFilter},
       preprocessed_text => {filter => \&PreprocessedTextFilter},