Browse Source

* fixed searching for utils

peter 24 years ago
parent
commit
5ea6603165
2 changed files with 27 additions and 17 deletions
  1. 9 5
      compiler/assemble.pas
  2. 18 12
      compiler/link.pas

+ 9 - 5
compiler/assemble.pas

@@ -151,16 +151,17 @@ var
 Function TAsmList.FindAssembler:string;
 var
   asfound : boolean;
+  UtilExe  : string;
 begin
+  UtilExe:=AddExtension(target_asm.asmbin,source_os.exeext);
   if lastas<>ord(target_asm.id) then
    begin
      lastas:=ord(target_asm.id);
      { is an assembler passed ? }
      if utilsdirectory<>'' then
-       LastASBin:=FindFile(target_asm.asmbin+source_os.exeext,utilsdirectory,asfound)+
-         target_asm.asmbin+source_os.exeext;
-     if LastASBin='' then
-       LastASBin:=FindExe(target_asm.asmbin,asfound);
+       LastASBin:=FindFile(UtilExe,utilsdirectory,asfound)+UtilExe;
+     if not AsFound then
+       LastASBin:=FindExe(UtilExe,asfound);
      if (not asfound) and not(cs_asm_extern in aktglobalswitches) then
       begin
         Message1(exec_w_assembler_not_found,LastASBin);
@@ -596,7 +597,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.8  2000-12-25 00:07:25  peter
+  Revision 1.9  2001-01-12 19:19:44  peter
+    * fixed searching for utils
+
+  Revision 1.8  2000/12/25 00:07:25  peter
     + new tlinkedlist class (merge of old tstringqueue,tcontainer and
       tlinkedlist objects)
 

+ 18 - 12
compiler/link.pas

@@ -247,22 +247,25 @@ end;
 
 Function TLinker.FindUtil(const s:string):string;
 var
-  ldfound : boolean;
-  LastBin : string;
+  Found    : boolean;
+  FoundBin : string;
+  UtilExe  : string;
 begin
-  LastBin:='';
+  UtilExe:=AddExtension(s,source_os.exeext);
+  FoundBin:='';
+  Found:=false;
   if utilsdirectory<>'' then
-   LastBin:=FindFile(s+source_os.exeext,utilsdirectory,ldfound)+s+source_os.exeext;
-  if LastBin='' then
-   LastBin:=FindExe(s,ldfound);
-  if (not ldfound) and not(cs_link_extern in aktglobalswitches) then
+   FoundBin:=FindFile(utilexe,utilsdirectory,Found)+utilexe;
+  if (not Found) then
+   FoundBin:=FindExe(utilexe,Found);
+  if (not Found) and not(cs_link_extern in aktglobalswitches) then
    begin
-     Message1(exec_w_util_not_found,s);
+     Message1(exec_w_util_not_found,utilexe);
      aktglobalswitches:=aktglobalswitches+[cs_link_extern];
    end;
-  if ldfound then
-   Message1(exec_t_using_util,LastBin);
-  FindUtil:=LastBin;
+  if (FoundBin<>'') then
+   Message1(exec_t_using_util,FoundBin);
+  FindUtil:=FoundBin;
 end;
 
 
@@ -540,7 +543,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.11  2000-12-25 00:07:26  peter
+  Revision 1.12  2001-01-12 19:19:44  peter
+    * fixed searching for utils
+
+  Revision 1.11  2000/12/25 00:07:26  peter
     + new tlinkedlist class (merge of old tstringqueue,tcontainer and
       tlinkedlist objects)