Browse Source

* -XP<prefix> support

marco 22 years ago
parent
commit
487650ab51

+ 6 - 3
compiler/assemble.pas

@@ -333,11 +333,11 @@ Implementation
         if cs_link_on_target in aktglobalswitches then
         if cs_link_on_target in aktglobalswitches then
          begin
          begin
            { If linking on target, don't add any path PM }
            { If linking on target, don't add any path PM }
-           FindAssembler:=AddExtension(target_asm.asmbin,target_info.exeext);
+           FindAssembler:=utilsprefix+AddExtension(target_asm.asmbin,target_info.exeext);
            exit;
            exit;
          end
          end
         else
         else
-         UtilExe:=AddExtension(target_asm.asmbin,source_info.exeext);
+         UtilExe:=utilsprefix+AddExtension(target_asm.asmbin,source_info.exeext);
         if lastas<>ord(target_asm.id) then
         if lastas<>ord(target_asm.id) then
          begin
          begin
            lastas:=ord(target_asm.id);
            lastas:=ord(target_asm.id);
@@ -1661,7 +1661,10 @@ Implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.56  2003-09-30 19:54:23  peter
+  Revision 1.57  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.56  2003/09/30 19:54:23  peter
     * better link on target support
     * better link on target support
 
 
   Revision 1.55  2003/09/23 17:56:05  peter
   Revision 1.55  2003/09/23 17:56:05  peter

+ 7 - 1
compiler/globals.pas

@@ -137,6 +137,8 @@ interface
 
 
        { directory where the utils can be found (options -FD) }
        { directory where the utils can be found (options -FD) }
        utilsdirectory : dirstr;
        utilsdirectory : dirstr;
+       { targetname specific prefix used by these utils (options -XP<path>) }
+       utilsprefix    : dirstr; 
 
 
        { some flags for global compiler switches }
        { some flags for global compiler switches }
        do_build,
        do_build,
@@ -1609,6 +1611,7 @@ implementation
 
 
       { Utils directory }
       { Utils directory }
         utilsdirectory:='';
         utilsdirectory:='';
+	utilsprefix:='';
 
 
       { Search Paths }
       { Search Paths }
         librarysearchpath:=TSearchPathList.Create;
         librarysearchpath:=TSearchPathList.Create;
@@ -1704,7 +1707,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.105  2003-10-02 21:16:18  peter
+  Revision 1.106  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.105  2003/10/02 21:16:18  peter
     * delphi and tp7 mode use intel asm by default
     * delphi and tp7 mode use intel asm by default
 
 
   Revision 1.104  2003/10/01 20:34:48  peter
   Revision 1.104  2003/10/01 20:34:48  peter

+ 6 - 3
compiler/impdef.pas

@@ -175,7 +175,7 @@ procedure CreateTempDir(const s:string);
  end;
  end;
 procedure call_as(const name:string);
 procedure call_as(const name:string);
  begin
  begin
-  exec(as_name,'-o '+name+'o '+name);
+  exec(utilsprefix+as_name,'-o '+name+'o '+name);
  end;
  end;
 procedure call_ar;
 procedure call_ar;
  var
  var
@@ -190,7 +190,7 @@ procedure call_ar;
   GetFAttr(f,attr);
   GetFAttr(f,attr);
   If DOSError=0 then
   If DOSError=0 then
    erase(f);
    erase(f);
-  exec(ar_name,'rs '+impname+' '+path+dirsep+'*.swo');
+  exec(utilsprefix+ar_name,'rs '+impname+' '+path+dirsep+'*.swo');
   cleardir(path,'*.sw');
   cleardir(path,'*.sw');
   cleardir(path,'*.swo');
   cleardir(path,'*.swo');
   {$i-}
   {$i-}
@@ -478,7 +478,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.11  2003-10-02 21:17:08  peter
+  Revision 1.12  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.11  2003/10/02 21:17:08  peter
     * use as,ld,ar instead of asw,ldw,arw for win32
     * use as,ld,ar instead of asw,ldw,arw for win32
 
 
   Revision 1.10  2002/10/05 12:43:24  carl
   Revision 1.10  2002/10/05 12:43:24  carl

+ 8 - 1
compiler/options.pas

@@ -1116,6 +1116,10 @@ begin
                         include(initglobalswitches,cs_link_shared);
                         include(initglobalswitches,cs_link_shared);
                         LinkTypeSetExplicitly:=true;
                         LinkTypeSetExplicitly:=true;
                       end;
                       end;
+                    'P' : Begin
+			     utilsprefix:=Copy(more,2,length(More)-1);
+			     More:='';
+                          End;
                     'S' :
                     'S' :
                       begin
                       begin
                         def_symbol('FPC_LINK_STATIC');
                         def_symbol('FPC_LINK_STATIC');
@@ -1974,7 +1978,10 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.106  2003-09-17 21:37:07  olle
+  Revision 1.107  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.106  2003/09/17 21:37:07  olle
     + added command line option for language mode -M<x>
     + added command line option for language mode -M<x>
 
 
   Revision 1.105  2003/09/14 21:33:11  peter
   Revision 1.105  2003/09/14 21:33:11  peter

+ 7 - 4
compiler/systems/t_beos.pas

@@ -410,7 +410,7 @@ begin
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);
 {  Replace(cmdstr,'$DYNLINK',DynLinkStr);}
 {  Replace(cmdstr,'$DYNLINK',DynLinkStr);}
-  success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
   if (success) and not(cs_link_extern in aktglobalswitches) then
   if (success) and not(cs_link_extern in aktglobalswitches) then
@@ -438,14 +438,14 @@ begin
   Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
   Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',outputexedir+Info.ResName);
   Replace(cmdstr,'$RES',outputexedir+Info.ResName);
-  success:=DoExec(FindUtil(binstr),cmdstr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
 
 
 { Strip the library ? }
 { Strip the library ? }
   if success and (cs_link_strip in aktglobalswitches) then
   if success and (cs_link_strip in aktglobalswitches) then
    begin
    begin
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
      Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
      Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
-     success:=DoExec(FindUtil(binstr),cmdstr,true,false);
+     success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
    end;
    end;
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
@@ -470,7 +470,10 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.5  2003-04-27 07:29:52  peter
+  Revision 1.6  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.5  2003/04/27 07:29:52  peter
     * aktprocdef cleanup, aktprocdef is now always nil when parsing
     * aktprocdef cleanup, aktprocdef is now always nil when parsing
       a new procdef declaration
       a new procdef declaration
     * aktprocsym removed
     * aktprocsym removed

+ 7 - 4
compiler/systems/t_bsd.pas

@@ -447,7 +447,7 @@ begin
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$DYNLINK',DynLinkStr);
   Replace(cmdstr,'$DYNLINK',DynLinkStr);
-  success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
   if (success) and not(cs_link_extern in aktglobalswitches) then
   if (success) and not(cs_link_extern in aktglobalswitches) then
@@ -475,14 +475,14 @@ begin
   Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
   Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',outputexedir+Info.ResName);
   Replace(cmdstr,'$RES',outputexedir+Info.ResName);
-  success:=DoExec(FindUtil(binstr),cmdstr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
 
 
 { Strip the library ? }
 { Strip the library ? }
   if success and (cs_link_strip in aktglobalswitches) then
   if success and (cs_link_strip in aktglobalswitches) then
    begin
    begin
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
      Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
      Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
-     success:=DoExec(FindUtil(binstr),cmdstr,true,false);
+     success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
    end;
    end;
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
@@ -529,7 +529,10 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2003-05-25 23:15:04  marco
+  Revision 1.3  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.2  2003/05/25 23:15:04  marco
    * NetBSD target support. OpenBSD reserved in the enum, for future use.
    * NetBSD target support. OpenBSD reserved in the enum, for future use.
 
 
   Revision 1.1  2003/05/20 23:54:00  florian
   Revision 1.1  2003/05/20 23:54:00  florian

+ 5 - 2
compiler/systems/t_go32v2.pas

@@ -235,7 +235,7 @@ begin
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$SCRIPT','--script='+maybequoted(outputexedir+Info.ScriptName));
   Replace(cmdstr,'$SCRIPT','--script='+maybequoted(outputexedir+Info.ScriptName));
-  success:=DoExec(FindUtil(BinStr),cmdstr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
   if (success) and not(cs_link_extern in aktglobalswitches) then
   if (success) and not(cs_link_extern in aktglobalswitches) then
@@ -362,7 +362,10 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2003-04-26 09:16:08  peter
+  Revision 1.3  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.2  2003/04/26 09:16:08  peter
     * .o files belonging to the unit are first searched in the same dir
     * .o files belonging to the unit are first searched in the same dir
       as the .ppu
       as the .ppu
 
 

+ 7 - 4
compiler/systems/t_linux.pas

@@ -447,7 +447,7 @@ begin
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$DYNLINK',DynLinkStr);
   Replace(cmdstr,'$DYNLINK',DynLinkStr);
-  success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
   if (success) and not(cs_link_extern in aktglobalswitches) then
   if (success) and not(cs_link_extern in aktglobalswitches) then
@@ -486,14 +486,14 @@ begin
   Replace(cmdstr,'$INIT',InitStr);
   Replace(cmdstr,'$INIT',InitStr);
   Replace(cmdstr,'$FINI',FiniStr);
   Replace(cmdstr,'$FINI',FiniStr);
   Replace(cmdstr,'$SONAME',SoNameStr);
   Replace(cmdstr,'$SONAME',SoNameStr);
-  success:=DoExec(FindUtil(binstr),cmdstr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
 
 
 { Strip the library ? }
 { Strip the library ? }
   if success and (cs_link_strip in aktglobalswitches) then
   if success and (cs_link_strip in aktglobalswitches) then
    begin
    begin
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
      Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
      Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
-     success:=DoExec(FindUtil(binstr),cmdstr,true,false);
+     success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
    end;
    end;
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
@@ -555,7 +555,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.9  2003-07-21 11:52:57  florian
+  Revision 1.10  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.9  2003/07/21 11:52:57  florian
     * very basic stuff for the arm
     * very basic stuff for the arm
 
 
   Revision 1.8  2003/04/27 07:29:52  peter
   Revision 1.8  2003/04/27 07:29:52  peter

+ 7 - 4
compiler/systems/t_sunos.pas

@@ -428,7 +428,7 @@ begin
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STATIC',StaticStr);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$DYNLINK',DynLinkStr);
   Replace(cmdstr,'$DYNLINK',DynLinkStr);
-  success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
 {$IFNDEF LinkTest}
 {$IFNDEF LinkTest}
@@ -457,14 +457,14 @@ begin
   Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
   Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',outputexedir+Info.ResName);
   Replace(cmdstr,'$RES',outputexedir+Info.ResName);
-  success:=DoExec(FindUtil(binstr),cmdstr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
 
 
 { Strip the library ? }
 { Strip the library ? }
   if success and (cs_link_strip in aktglobalswitches) then
   if success and (cs_link_strip in aktglobalswitches) then
    begin
    begin
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
      SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
      Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
      Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
-     success:=DoExec(FindUtil(binstr),cmdstr,true,false);
+     success:=DoExec(utilsprefix+FindUtil(binstr),cmdstr,true,false);
    end;
    end;
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
@@ -488,7 +488,10 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2003-04-27 07:29:52  peter
+  Revision 1.5  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.4  2003/04/27 07:29:52  peter
     * aktprocdef cleanup, aktprocdef is now always nil when parsing
     * aktprocdef cleanup, aktprocdef is now always nil when parsing
       a new procdef declaration
       a new procdef declaration
     * aktprocsym removed
     * aktprocsym removed

+ 5 - 2
compiler/systems/t_watcom.pas

@@ -155,7 +155,7 @@ begin
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);
-  success:=DoExec(FindUtil(BinStr),cmdstr,true,false);
+  success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
   if (success) and not(cs_link_extern in aktglobalswitches) then
   if (success) and not(cs_link_extern in aktglobalswitches) then
@@ -179,7 +179,10 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2003-09-30 08:39:50  michael
+  Revision 1.3  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.2  2003/09/30 08:39:50  michael
   + Patch from Wiktor Sywula for watcom support
   + Patch from Wiktor Sywula for watcom support
 
 
   Revision 1.1  2003/09/06 10:01:11  florian
   Revision 1.1  2003/09/06 10:01:11  florian

+ 9 - 6
compiler/systems/t_win32.pas

@@ -1007,7 +1007,7 @@ begin
   AppTypeStr:='';
   AppTypeStr:='';
   ImageBaseStr:='';
   ImageBaseStr:='';
   StripStr:='';
   StripStr:='';
-  AsBinStr:=FindUtil('as');
+  AsBinStr:=FindUtil(utilsprefix+'as');
   if RelocSection then
   if RelocSection then
    { Using short form to avoid problems with 128 char limitation under Dos. }
    { Using short form to avoid problems with 128 char limitation under Dos. }
    RelocStr:='-b base.$$$';
    RelocStr:='-b base.$$$';
@@ -1043,7 +1043,7 @@ begin
           end
           end
         else
         else
           Replace(cmdstr,'$DEF','');
           Replace(cmdstr,'$DEF','');
-        success:=DoExec(FindUtil(binstr),cmdstr,(i=1),false);
+        success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,(i=1),false);
         if not success then
         if not success then
          break;
          break;
       end;
       end;
@@ -1087,7 +1087,7 @@ begin
   AppTypeStr:='';
   AppTypeStr:='';
   ImageBaseStr:='';
   ImageBaseStr:='';
   StripStr:='';
   StripStr:='';
-  AsBinStr:=FindUtil('as');
+  AsBinStr:=FindUtil(utilsprefix+'as');
   if RelocSection then
   if RelocSection then
    { Using short form to avoid problems with 128 char limitation under Dos. }
    { Using short form to avoid problems with 128 char limitation under Dos. }
    RelocStr:='-b base.$$$';
    RelocStr:='-b base.$$$';
@@ -1123,7 +1123,7 @@ begin
           end
           end
         else
         else
           Replace(cmdstr,'$DEF','');
           Replace(cmdstr,'$DEF','');
-        success:=DoExec(FindUtil(binstr),cmdstr,(i=1),false);
+        success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,(i=1),false);
         if not success then
         if not success then
          break;
          break;
       end;
       end;
@@ -1252,7 +1252,7 @@ begin
        cmdstr:=cmdstr+' --version '+dllversion;
        cmdstr:=cmdstr+' --version '+dllversion;
      cmdstr:=cmdstr+' --input '+maybequoted(fn);
      cmdstr:=cmdstr+' --input '+maybequoted(fn);
      cmdstr:=cmdstr+' --stack '+tostr(stacksize);
      cmdstr:=cmdstr+' --stack '+tostr(stacksize);
-     DoExec(FindUtil('postw32'),cmdstr,false,false);
+     DoExec(FindUtil(utilsprefix+'postw32'),cmdstr,false,false);
      postprocessexecutable:=true;
      postprocessexecutable:=true;
      exit;
      exit;
    end;
    end;
@@ -1626,7 +1626,10 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.20  2003-10-02 21:17:08  peter
+  Revision 1.21  2003-10-03 14:16:48  marco
+   * -XP<prefix> support
+
+  Revision 1.20  2003/10/02 21:17:08  peter
     * use as,ld,ar instead of asw,ldw,arw for win32
     * use as,ld,ar instead of asw,ldw,arw for win32
 
 
   Revision 1.19  2003/09/30 20:10:12  peter
   Revision 1.19  2003/09/30 20:10:12  peter